diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..bf256a92 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,88 @@ +name: CI +on: + push: + branches: + - '**' + - '!integrated/**' + - '!stl-preview-head/**' + - '!stl-preview-base/**' + - '!generated' + - '!codegen/**' + - 'codegen/stl/**' + pull_request: + branches-ignore: + - 'stl-preview-head/**' + - 'stl-preview-base/**' + +jobs: + build: + timeout-minutes: 10 + name: build + permissions: + contents: read + id-token: write + runs-on: ${{ github.repository == 'stainless-sdks/lithic-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: |- + github.repository == 'stainless-sdks/lithic-ruby' && + (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') + 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: Get GitHub OIDC Token + if: |- + github.repository == 'stainless-sdks/lithic-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/lithic-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: lithic + run: ./scripts/utils/upload-artifact.sh + lint: + timeout-minutes: 10 + name: lint + runs-on: ${{ github.repository == 'stainless-sdks/lithic-ruby' && '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: ${{ github.repository == 'stainless-sdks/lithic-ruby' && '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 diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml new file mode 100644 index 00000000..d1cdb603 --- /dev/null +++ b/.github/workflows/publish-gem.yml @@ -0,0 +1,31 @@ +# 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/lithic-com/lithic-ruby/actions/workflows/publish-gem.yml +name: Publish Gem +on: + workflow_dispatch: + + release: + types: [published] + +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 + with: + bundler-cache: false + - run: |- + bundle install + + - name: Publish to RubyGems.org + run: | + bash ./bin/publish-gem + env: + # `RUBYGEMS_HOST` is only required for private gem repositories, not https://rubygems.org + RUBYGEMS_HOST: ${{ secrets.LITHIC_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }} + GEM_HOST_API_KEY: ${{ secrets.LITHIC_GEM_HOST_API_KEY || secrets.GEM_HOST_API_KEY }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml new file mode 100644 index 00000000..cf22eae0 --- /dev/null +++ b/.github/workflows/release-doctor.yml @@ -0,0 +1,22 @@ +name: Release Doctor +on: + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + release_doctor: + name: release doctor + runs-on: ubuntu-latest + if: github.repository == 'lithic-com/lithic-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.LITHIC_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }} + GEM_HOST_API_KEY: ${{ secrets.LITHIC_GEM_HOST_API_KEY || secrets.GEM_HOST_API_KEY }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..fc9eb287 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +*.gem +.idea/ +.ignore +.prism.log +.stdy.log +.ruby-lsp/ +.yardoc/ +bin/tapioca +Brewfile.lock.json +doc/ +sorbet/tapioca/* diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 00000000..b4e9013b --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.16.0" +} \ No newline at end of file diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 00000000..a52323b4 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,296 @@ +# 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. +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: + Enabled: false + +# Don't require this extra line break, it can be excessive. +Layout/EmptyLineAfterGuardClause: + 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. +Layout/LineLength: + AllowedPatterns: + - "^\\s*#.*$" + - ^require(_relative)? + - "Lithic::Internal::Type::BaseModel$" + - "^\\s*[A-Z0-9_]+ = :" + - "Lithic::(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/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: + Enabled: false + +Metrics/CollectionLiteralLength: + Exclude: + - "test/**/*" + +Metrics/CyclomaticComplexity: + Enabled: false + +Metrics/MethodLength: + Enabled: false + +Metrics/ModuleLength: + Enabled: false + +Metrics/ParameterLists: + Enabled: false + +Metrics/PerceivedComplexity: + Enabled: false + +Naming/AccessorMethodName: + Enabled: false + +# Need to preserve block identifier for documentation. +Naming/BlockForwarding: + Enabled: false + +# Underscores are generally useful for disambiguation. +Naming/ClassAndModuleCamelCase: + Enabled: false + +Naming/MethodParameterName: + Enabled: false + +Naming/PredicatePrefix: + Exclude: + - "**/*.rbi" + +Naming/VariableNumber: + Enabled: false + +# Nothing wrong with inline private methods. +Style/AccessModifierDeclarations: + 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: + 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: + Enabled: false + +# We should go back and add these docs, but ignore for now. +Style/Documentation: + Enabled: false + +# Allow explicit empty elses, for clarity. +Style/EmptyElse: + Enabled: false + +Style/EmptyMethod: + Exclude: + - "**/*.rbi" + +# We commonly use ENV['KEY'], it's OK. +Style/FetchEnvVar: + 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: + Enabled: false + +# Rubocop is pretty bad about mangling single line lambdas. +Style/Lambda: + Enabled: false + +# Prefer consistency in method calling syntax. +Style/MethodCallWithArgsParentheses: + AllowedMethods: + - raise + Enabled: true + Exclude: + - "**/*.gemspec" + +Style/MultilineBlockChain: + Enabled: false + +# Perfectly fine. +Style/MultipleComparison: + Enabled: false + +Style/MutableConstant: + Exclude: + - "**/*.rbi" + +# Not all parameters should be named. +Style/NumberedParameters: + Enabled: false + +Style/NumberedParametersLimit: + Max: 2 + +# Reasonable to use brackets for errors with long messages. +Style/RaiseArgs: + Enabled: false + +# Be explicit about `RuntimeError`s. +Style/RedundantException: + 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: + Enabled: false + +Style/SignalException: + Exclude: + - Rakefile + - "**/*.rake" + +# We use these sparingly, where we anticipate future branches for the +# inner conditional. +Style/SoleNestedConditional: + 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" diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 00000000..944880fa --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.2.0 diff --git a/.solargraph.yml b/.solargraph.yml new file mode 100644 index 00000000..3096524e --- /dev/null +++ b/.solargraph.yml @@ -0,0 +1,11 @@ +--- +max_files: 0 +include: + - '*.gemspec' + - 'Rakefile' + - 'examples/**/*.rb' + - 'lib/**/*.rb' + - 'test/lithic/resource_namespaces.rb' + - 'test/lithic/test_helper.rb' +exclude: + - 'rbi/**/*' diff --git a/.stats.yml b/.stats.yml new file mode 100644 index 00000000..e2068bef --- /dev/null +++ b/.stats.yml @@ -0,0 +1,4 @@ +configured_endpoints: 214 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic/lithic-a4afc884f86f30a87445552888031ac1ca18aed0476d7120da555bf457627e65.yml +openapi_spec_hash: ce8d0830986c702f0c7a693b1c3cc5a2 +config_hash: 4b618a1df59e555cebe6aa13e8c0218f diff --git a/.yardopts b/.yardopts new file mode 100644 index 00000000..84c12f2a --- /dev/null +++ b/.yardopts @@ -0,0 +1,6 @@ +--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 new file mode 100644 index 00000000..7855934b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,125 @@ +## Setting up the environment + +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). + +Please follow the instructions for your preferred version manager to install the Ruby version specified in the `.ruby-version` file. + +To set up the repository, run: + +```bash +$ ./scripts/bootstrap +``` + +This will install all the required dependencies. + +## Modifying/Adding 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/lithic/helpers/` and `examples/` directory. + +## Adding and running examples + +All files in the `examples/` directory are not modified by the generator and can be freely edited or added to. + +```ruby +#!/usr/bin/env ruby +# frozen_string_literal: true + +require_relative "../lib/lithic" + +# ... +``` + +```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 "lithic", git: "https://github.com/lithic-com/lithic-ruby" +``` + +Alternatively, reference local copy of the repo: + +```bash +$ git clone -- 'https://github.com/lithic-com/lithic-ruby' '' +``` + +```ruby +gem "lithic", path: "" +``` + +## Running commands + +Running `rake` by itself will show all runnable commands. + +```bash +$ bundle exec rake +``` + +## Running tests + +Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. + +```sh +$ ./scripts/mock +``` + +```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] +``` diff --git a/Gemfile b/Gemfile new file mode 100644 index 00000000..1be178cb --- /dev/null +++ b/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +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 new file mode 100644 index 00000000..1c70163b --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,230 @@ +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: + lithic (0.16.0) + cgi + connection_pool + standardwebhooks + +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) + 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) + 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) + 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) + netrc (0.11.0) + parallel (1.27.0) + parser (3.3.10.0) + ast (~> 2.4.1) + racc + prettier_print (1.2.1) + prism (1.6.0) + public_suffix (6.0.2) + racc (1.8.1) + 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) + prism (~> 1.0) + rbs (>= 3.4.4) + rbs (3.9.5) + logger + redcarpet (3.6.1) + regexp_parser (2.11.3) + rexml (3.4.4) + rubocop (1.81.7) + json (~> 2.3) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) + parallel (~> 1.10) + 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) + 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) + 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) + erubi (>= 1.10.0) + prism (>= 0.28.0) + rbi (>= 0.3.3) + rexml (>= 3.2.6) + sorbet-static-and-runtime (>= 0.5.10187) + thor (>= 0.19.2) + standardwebhooks (1.1.0) + 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) + benchmark + bundler (>= 2.2.25) + netrc (>= 0.11.0) + parallel (>= 1.21.0) + rbi (~> 0.2) + sorbet-static-and-runtime (>= 0.5.11087) + spoom (>= 1.2.0) + 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) + 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) + 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 + +DEPENDENCIES + async + lithic! + minitest + minitest-focus + minitest-hooks + minitest-proveit + minitest-rg + rake + rbs + redcarpet + rubocop + sorbet + steep + syntax_tree + syntax_tree-rbs! + tapioca + webmock + webrick + yard + +BUNDLED WITH + 2.4.1 diff --git a/LICENSE b/LICENSE index 261eeb9e..9410347b 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2026 Lithic Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md new file mode 100644 index 00000000..f384efcd --- /dev/null +++ b/README.md @@ -0,0 +1,271 @@ +# Lithic Ruby API library + +The Lithic Ruby library provides convenient access to the Lithic 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/lithic-com/lithic-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. + +## MCP Server + +Use the Lithic MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application. + +[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=lithic-mcp&config=eyJuYW1lIjoibGl0aGljLW1jcCIsInRyYW5zcG9ydCI6Imh0dHAiLCJ1cmwiOiJodHRwczovL2xpdGhpYy5zdGxtY3AuY29tIiwiaGVhZGVycyI6eyJ4LWxpdGhpYy1hcGkta2V5IjoiTXkgTGl0aGljIEFQSSBLZXkifX0) +[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22lithic-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Flithic.stlmcp.com%22%2C%22headers%22%3A%7B%22x-lithic-api-key%22%3A%22My%20Lithic%20API%20Key%22%7D%7D) + +> Note: You may need to set environment variables in your MCP client. + +## Documentation + +Documentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/lithic). + +The REST API documentation can be found on [docs.lithic.com](https://docs.lithic.com). + +## Installation + +To use this gem, install via Bundler by adding the following to your application's `Gemfile`: + + + +```ruby +gem "lithic", "~> 0.16.0" +``` + + + +## Usage + +```ruby +require "bundler/setup" +require "lithic" + +lithic = Lithic::Client.new( + api_key: ENV["LITHIC_API_KEY"], # This is the default and can be omitted + environment: "sandbox" # defaults to "production" +) + +card = lithic.cards.create(type: "SINGLE_USE") + +puts(card.token) +``` + +### Pagination + +List methods in the Lithic API are paginated. + +This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually: + +```ruby +page = lithic.cards.list + +# Fetch single item from page. +card = page.data[0] +puts(card.product_id) + +# Automatically fetches more pages as needed. +page.auto_paging_each do |card| + puts(card.product_id) +end +``` + +Alternatively, you can use the `#next_page?` and `#next_page` methods for more granular control working with pages. + +```ruby +if page.next_page? + new_page = page.next_page + puts(new_page.data[0].product_id) +end +``` + +### Handling errors + +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 `Lithic::Errors::APIError` will be thrown: + +```ruby +begin + card = lithic.cards.create(type: "MERCHANT_LOCKED") +rescue Lithic::Errors::APIConnectionError => e + puts("The server could not be reached") + puts(e.cause) # an underlying Exception, likely raised within `net/http` +rescue Lithic::Errors::RateLimitError => e + puts("A 429 status code was received; we should back off a bit.") +rescue Lithic::Errors::APIStatusError => e + puts("Another non-200-range status code was received") + puts(e.status) +end +``` + +Error codes are as follows: + +| 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` | + +### Retries + +Certain errors will be automatically retried 2 times by default, with a short exponential backoff. + +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. + +You can use the `max_retries` option to configure or disable this: + +```ruby +# Configure the default for all requests: +lithic = Lithic::Client.new( + max_retries: 0 # default is 2 +) + +# Or, configure per-request: +lithic.cards.list(page_size: 10, request_options: {max_retries: 5}) +``` + +### Timeouts + +By default, requests will time out after 60 seconds. You can use the timeout option to configure or disable this: + +```ruby +# Configure the default for all requests: +lithic = Lithic::Client.new( + timeout: nil # default is 60 +) + +# Or, configure per-request: +lithic.cards.list(page_size: 10, request_options: {timeout: 5}) +``` + +On timeout, `Lithic::Errors::APITimeoutError` is raised. + +Note that requests that time out are retried by default. + +## Advanced concepts + +### BaseModel + +All parameter and response objects inherit from `Lithic::Internal::Type::BaseModel`, which provides several conveniences, including: + +1. All fields, including unknown ones, are accessible with `obj[:prop]` syntax, and can be destructured with `obj => {prop: prop}` or pattern-matching syntax. + +2. Structural equivalence for equality; if two API calls return the same values, comparing the responses with == will return true. + +3. Both instances and the classes themselves can be pretty-printed. + +4. Helpers such as `#to_h`, `#deep_to_h`, `#to_json`, and `#to_yaml`. + +### Making custom or undocumented requests + +#### Undocumented properties + +You can send undocumented parameters to any endpoint, and read undocumented response properties, like so: + +Note: the `extra_` parameters of the same name overrides the documented parameters. + +```ruby +page = + lithic.cards.list( + page_size: 10, + request_options: { + extra_query: {my_query_parameter: value}, + extra_body: {my_body_parameter: value}, + extra_headers: {"my-header": value} + } + ) + +puts(page[:my_undocumented_property]) +``` + +#### Undocumented request params + +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. + +#### Undocumented endpoints + +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: + +```ruby +response = client.request( + method: :post, + path: '/undocumented/endpoint', + query: {"dog": "woof"}, + headers: {"useful-header": "interesting-value"}, + body: {"hello": "world"} +) +``` + +### Concurrency & connection pooling + +The `Lithic::Client` instances are threadsafe, but are only are fork-safe when there are no in-flight HTTP requests. + +Each instance of `Lithic::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. + +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. + +Unless otherwise specified, other classes in the SDK do not have locks protecting their underlying data structure. + +## Sorbet + +This library provides comprehensive [RBI](https://sorbet.org/docs/rbi) definitions, and has no dependency on sorbet-runtime. + +You can provide typesafe request parameters like so: + +```ruby +lithic.cards.create(type: "SINGLE_USE") +``` + +Or, equivalently: + +```ruby +# Hashes work, but are not typesafe: +lithic.cards.create(type: "SINGLE_USE") + +# You can also splat a full Params class: +params = Lithic::CardCreateParams.new(type: "SINGLE_USE") +lithic.cards.create(**params) +``` + +### Enums + +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: + +```ruby +# :ACTIVE +puts(Lithic::AccountUpdateParams::State::ACTIVE) + +# Revealed type: `T.all(Lithic::AccountUpdateParams::State, Symbol)` +T.reveal_type(Lithic::AccountUpdateParams::State::ACTIVE) +``` + +Enum parameters have a "relaxed" type, so you can either pass in enum constants or their literal value: + +```ruby +# Using the enum constants preserves the tagged type information: +lithic.accounts.update( + state: Lithic::AccountUpdateParams::State::ACTIVE, + # … +) + +# Literal values are also permissible: +lithic.accounts.update( + state: :ACTIVE, + # … +) +``` + +## Versioning + +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. + +This package considers improvements to the (non-runtime) `*.rbi` and `*.rbs` type definitions to be non-breaking changes. + +## Requirements + +Ruby 3.2.0 or higher. + +## Contributing + +See [the contributing documentation](https://github.com/lithic-com/lithic-ruby/tree/main/CONTRIBUTING.md). diff --git a/Rakefile b/Rakefile new file mode 100644 index 00000000..7d530a32 --- /dev/null +++ b/Rakefile @@ -0,0 +1,172 @@ +# frozen_string_literal: true + +require "pathname" +require "securerandom" +require "shellwords" + +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]) +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")) +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 + + ruby(*%w[-w -e], rb, verbose: false) { fail unless _1 } +end + +xargs = %w[xargs --no-run-if-empty --null --max-procs=0 --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" + 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, "--"] + + 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 -- lithic.gemspec]) + rm_rf(ignore_file) +end + +desc("Release ruby gem") +multitask(release: [:"build:gem"]) do + sh(*%w[gem push], *FileList["*.gem"]) +end diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..d586eacc --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,27 @@ +# 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 Lithic, please follow the respective company's security reporting guidelines. + +### Lithic Terms and Policies + +Please contact sdk-feedback@lithic.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 new file mode 100644 index 00000000..528b48c3 --- /dev/null +++ b/Steepfile @@ -0,0 +1,15 @@ +# 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/bin/check-release-environment b/bin/check-release-environment new file mode 100644 index 00000000..c05436e8 --- /dev/null +++ b/bin/check-release-environment @@ -0,0 +1,21 @@ +#!/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 new file mode 100644 index 00000000..8444af20 --- /dev/null +++ b/bin/publish-gem @@ -0,0 +1,9 @@ +#!/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/examples/.keep b/examples/.keep new file mode 100644 index 00000000..d8c73e93 --- /dev/null +++ b/examples/.keep @@ -0,0 +1,4 @@ +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/lithic.rb b/lib/lithic.rb new file mode 100644 index 00000000..6232313d --- /dev/null +++ b/lib/lithic.rb @@ -0,0 +1,574 @@ +# 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 + +# 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 +end + +# Gems. +require "connection_pool" +require "standardwebhooks" + +# Package files. +require_relative "lithic/version" +require_relative "lithic/internal/util" +require_relative "lithic/internal/type/converter" +require_relative "lithic/internal/type/unknown" +require_relative "lithic/internal/type/boolean" +require_relative "lithic/internal/type/file_input" +require_relative "lithic/internal/type/enum" +require_relative "lithic/internal/type/union" +require_relative "lithic/internal/type/array_of" +require_relative "lithic/internal/type/hash_of" +require_relative "lithic/internal/type/base_model" +require_relative "lithic/internal/type/base_page" +require_relative "lithic/internal/type/request_parameters" +require_relative "lithic/internal" +require_relative "lithic/request_options" +require_relative "lithic/file_part" +require_relative "lithic/errors" +require_relative "lithic/internal/transport/base_client" +require_relative "lithic/internal/transport/pooled_net_requester" +require_relative "lithic/client" +require_relative "lithic/internal/cursor_page" +require_relative "lithic/internal/single_page" +require_relative "lithic/models/merchant" +require_relative "lithic/models/transaction" +require_relative "lithic/models/auth_rules/velocity_limit_filters" +require_relative "lithic/models/auth_rules/v2/backtest_results" +require_relative "lithic/models/book_transfer_response" +require_relative "lithic/models/non_pci_card" +require_relative "lithic/models/card_authorization" +require_relative "lithic/models/transactions/events/enhanced_data" +require_relative "lithic/models/dispute_evidence" +require_relative "lithic/models/dispute_v2" +require_relative "lithic/models/dispute" +require_relative "lithic/models/external_bank_account" +require_relative "lithic/models/external_payment" +require_relative "lithic/models/financial_account" +require_relative "lithic/models/financial_accounts/interest_tier_schedule" +require_relative "lithic/models/funding_event" +require_relative "lithic/models/internal_transaction" +require_relative "lithic/models/financial_accounts/loan_tape" +require_relative "lithic/models/management_operation_transaction" +require_relative "lithic/models/network_total" +require_relative "lithic/models/payment" +require_relative "lithic/models/settlement_report" +require_relative "lithic/models/financial_accounts/statement" +require_relative "lithic/models/three_ds/challenge_response" +require_relative "lithic/models/three_ds_authentication" +require_relative "lithic/models/account" +require_relative "lithic/models/account_activity_list_params" +require_relative "lithic/models/account_activity_list_response" +require_relative "lithic/models/account_activity_retrieve_transaction_params" +require_relative "lithic/models/account_activity_retrieve_transaction_response" +require_relative "lithic/models/account_financial_account_type" +require_relative "lithic/models/account_holder" +require_relative "lithic/models/account_holder_created_webhook_event" +require_relative "lithic/models/account_holder_create_params" +require_relative "lithic/models/account_holder_create_response" +require_relative "lithic/models/account_holder_document_updated_webhook_event" +require_relative "lithic/models/account_holder_list_documents_params" +require_relative "lithic/models/account_holder_list_documents_response" +require_relative "lithic/models/account_holder_list_params" +require_relative "lithic/models/account_holder_retrieve_document_params" +require_relative "lithic/models/account_holder_retrieve_params" +require_relative "lithic/models/account_holders/account_holder_entity" +require_relative "lithic/models/account_holders/entity_create_params" +require_relative "lithic/models/account_holders/entity_create_response" +require_relative "lithic/models/account_holders/entity_delete_params" +require_relative "lithic/models/account_holder_simulate_enrollment_document_review_params" +require_relative "lithic/models/account_holder_simulate_enrollment_review_params" +require_relative "lithic/models/account_holder_simulate_enrollment_review_response" +require_relative "lithic/models/account_holder_updated_webhook_event" +require_relative "lithic/models/account_holder_update_params" +require_relative "lithic/models/account_holder_update_response" +require_relative "lithic/models/account_holder_upload_document_params" +require_relative "lithic/models/account_holder_verification_webhook_event" +require_relative "lithic/models/account_list_params" +require_relative "lithic/models/account_retrieve_params" +require_relative "lithic/models/account_retrieve_signals_params" +require_relative "lithic/models/account_retrieve_spend_limits_params" +require_relative "lithic/models/account_spend_limits" +require_relative "lithic/models/account_update_params" +require_relative "lithic/models/address" +require_relative "lithic/models/address_update" +require_relative "lithic/models/api_status" +require_relative "lithic/models/auth_rules/auth_rule" +require_relative "lithic/models/auth_rules/auth_rule_condition" +require_relative "lithic/models/auth_rules/auth_rule_version" +require_relative "lithic/models/auth_rules/backtest_stats" +require_relative "lithic/models/auth_rules/card_transaction_update_action" +require_relative "lithic/models/auth_rules/conditional_3ds_action_parameters" +require_relative "lithic/models/auth_rules/conditional_ach_action_parameters" +require_relative "lithic/models/auth_rules/conditional_attribute" +require_relative "lithic/models/auth_rules/conditional_authorization_action_parameters" +require_relative "lithic/models/auth_rules/conditional_authorization_adjustment_parameters" +require_relative "lithic/models/auth_rules/conditional_block_parameters" +require_relative "lithic/models/auth_rules/conditional_card_transaction_update_action_parameters" +require_relative "lithic/models/auth_rules/conditional_operation" +require_relative "lithic/models/auth_rules/conditional_tokenization_action_parameters" +require_relative "lithic/models/auth_rules/conditional_value" +require_relative "lithic/models/auth_rules/event_stream" +require_relative "lithic/models/auth_rules/merchant_lock_parameters" +require_relative "lithic/models/auth_rules/report_stats" +require_relative "lithic/models/auth_rules/rule_feature" +require_relative "lithic/models/auth_rules/spend_velocity_filters" +require_relative "lithic/models/auth_rules/typescript_code_parameters" +require_relative "lithic/models/auth_rules/v2/backtest_create_params" +require_relative "lithic/models/auth_rules/v2/backtest_create_response" +require_relative "lithic/models/auth_rules/v2/backtest_retrieve_params" +require_relative "lithic/models/auth_rules/v2_create_params" +require_relative "lithic/models/auth_rules/v2_delete_params" +require_relative "lithic/models/auth_rules/v2_draft_params" +require_relative "lithic/models/auth_rules/v2_list_params" +require_relative "lithic/models/auth_rules/v2_list_results_params" +require_relative "lithic/models/auth_rules/v2_list_results_response" +require_relative "lithic/models/auth_rules/v2_list_versions_params" +require_relative "lithic/models/auth_rules/v2_list_versions_response" +require_relative "lithic/models/auth_rules/v2_promote_params" +require_relative "lithic/models/auth_rules/v2_retrieve_features_params" +require_relative "lithic/models/auth_rules/v2_retrieve_features_response" +require_relative "lithic/models/auth_rules/v2_retrieve_params" +require_relative "lithic/models/auth_rules/v2_retrieve_report_params" +require_relative "lithic/models/auth_rules/v2_retrieve_report_response" +require_relative "lithic/models/auth_rules/v2_update_params" +require_relative "lithic/models/auth_rules/velocity_limit_params" +require_relative "lithic/models/auth_rules/velocity_limit_period" +require_relative "lithic/models/auth_rules_backtest_report_created_webhook_event" +require_relative "lithic/models/auth_stream_enrollment_retrieve_secret_params" +require_relative "lithic/models/auth_stream_enrollment_rotate_secret_params" +require_relative "lithic/models/auth_stream_secret" +require_relative "lithic/models/balance" +require_relative "lithic/models/balance_list_params" +require_relative "lithic/models/balance_updated_webhook_event" +require_relative "lithic/models/book_transfer_create_params" +require_relative "lithic/models/book_transfer_list_params" +require_relative "lithic/models/book_transfer_retrieve_params" +require_relative "lithic/models/book_transfer_retry_params" +require_relative "lithic/models/book_transfer_reverse_params" +require_relative "lithic/models/book_transfer_transaction_created_webhook_event" +require_relative "lithic/models/book_transfer_transaction_updated_webhook_event" +require_relative "lithic/models/card" +require_relative "lithic/models/card_authorization_approval_request_webhook_event" +require_relative "lithic/models/card_authorization_challenge_response_params" +require_relative "lithic/models/card_authorization_challenge_response_webhook_event" +require_relative "lithic/models/card_authorization_challenge_webhook_event" +require_relative "lithic/models/card_bulk_order" +require_relative "lithic/models/card_bulk_order_create_params" +require_relative "lithic/models/card_bulk_order_list_params" +require_relative "lithic/models/card_bulk_order_retrieve_params" +require_relative "lithic/models/card_bulk_order_update_params" +require_relative "lithic/models/card_converted_webhook_event" +require_relative "lithic/models/card_convert_physical_params" +require_relative "lithic/models/card_created_webhook_event" +require_relative "lithic/models/card_create_params" +require_relative "lithic/models/card_embed_params" +require_relative "lithic/models/card_embed_response" +require_relative "lithic/models/cardholder_authentication" +require_relative "lithic/models/card_list_params" +require_relative "lithic/models/card_program" +require_relative "lithic/models/card_program_list_params" +require_relative "lithic/models/card_program_retrieve_params" +require_relative "lithic/models/card_provision_params" +require_relative "lithic/models/card_provision_response" +require_relative "lithic/models/card_reissued_webhook_event" +require_relative "lithic/models/card_reissue_params" +require_relative "lithic/models/card_renewed_webhook_event" +require_relative "lithic/models/card_renew_params" +require_relative "lithic/models/card_retrieve_params" +require_relative "lithic/models/card_retrieve_signals_params" +require_relative "lithic/models/card_retrieve_spend_limits_params" +require_relative "lithic/models/cards/balance_list_params" +require_relative "lithic/models/cards/financial_transaction_list_params" +require_relative "lithic/models/cards/financial_transaction_retrieve_params" +require_relative "lithic/models/card_search_by_pan_params" +require_relative "lithic/models/card_shipped_webhook_event" +require_relative "lithic/models/card_spend_limits" +require_relative "lithic/models/card_transaction_enhanced_data_created_webhook_event" +require_relative "lithic/models/card_transaction_enhanced_data_updated_webhook_event" +require_relative "lithic/models/card_transaction_updated_webhook_event" +require_relative "lithic/models/card_updated_webhook_event" +require_relative "lithic/models/card_update_params" +require_relative "lithic/models/card_web_provision_params" +require_relative "lithic/models/card_web_provision_response" +require_relative "lithic/models/carrier" +require_relative "lithic/models/category_details" +require_relative "lithic/models/client_api_status_params" +require_relative "lithic/models/credit_products/extended_credit" +require_relative "lithic/models/credit_products/extended_credit_retrieve_params" +require_relative "lithic/models/credit_products/prime_rate_create_params" +require_relative "lithic/models/credit_products/prime_rate_retrieve_params" +require_relative "lithic/models/credit_products/prime_rate_retrieve_response" +require_relative "lithic/models/currency" +require_relative "lithic/models/device" +require_relative "lithic/models/digital_card_art" +require_relative "lithic/models/digital_card_art_list_params" +require_relative "lithic/models/digital_card_art_retrieve_params" +require_relative "lithic/models/digital_wallet_tokenization_approval_request_webhook_event" +require_relative "lithic/models/digital_wallet_tokenization_result_webhook_event" +require_relative "lithic/models/digital_wallet_tokenization_two_factor_authentication_code_sent_webhook_event" +require_relative "lithic/models/digital_wallet_tokenization_two_factor_authentication_code_webhook_event" +require_relative "lithic/models/digital_wallet_tokenization_updated_webhook_event" +require_relative "lithic/models/dispute_create_params" +require_relative "lithic/models/dispute_delete_evidence_params" +require_relative "lithic/models/dispute_delete_params" +require_relative "lithic/models/dispute_evidence_upload_failed_webhook_event" +require_relative "lithic/models/dispute_initiate_evidence_upload_params" +require_relative "lithic/models/dispute_list_evidences_params" +require_relative "lithic/models/dispute_list_params" +require_relative "lithic/models/dispute_retrieve_evidence_params" +require_relative "lithic/models/dispute_retrieve_params" +require_relative "lithic/models/disputes_v2_list_params" +require_relative "lithic/models/disputes_v2_retrieve_params" +require_relative "lithic/models/dispute_transaction_created_webhook_event" +require_relative "lithic/models/dispute_transaction_updated_webhook_event" +require_relative "lithic/models/dispute_updated_webhook_event" +require_relative "lithic/models/dispute_update_params" +require_relative "lithic/models/document" +require_relative "lithic/models/event" +require_relative "lithic/models/event_list_attempts_params" +require_relative "lithic/models/event_list_params" +require_relative "lithic/models/event_retrieve_params" +require_relative "lithic/models/events/event_subscription_resend_params" +require_relative "lithic/models/events/subscription_create_params" +require_relative "lithic/models/events/subscription_delete_params" +require_relative "lithic/models/events/subscription_list_attempts_params" +require_relative "lithic/models/events/subscription_list_params" +require_relative "lithic/models/events/subscription_recover_params" +require_relative "lithic/models/events/subscription_replay_missing_params" +require_relative "lithic/models/events/subscription_retrieve_params" +require_relative "lithic/models/events/subscription_retrieve_secret_params" +require_relative "lithic/models/events/subscription_retrieve_secret_response" +require_relative "lithic/models/events/subscription_rotate_secret_params" +require_relative "lithic/models/events/subscription_send_simulated_example_params" +require_relative "lithic/models/events/subscription_update_params" +require_relative "lithic/models/event_subscription" +require_relative "lithic/models/external_bank_account_address" +require_relative "lithic/models/external_bank_account_created_webhook_event" +require_relative "lithic/models/external_bank_account_create_params" +require_relative "lithic/models/external_bank_account_create_response" +require_relative "lithic/models/external_bank_account_list_params" +require_relative "lithic/models/external_bank_account_list_response" +require_relative "lithic/models/external_bank_account_pause_params" +require_relative "lithic/models/external_bank_account_retrieve_params" +require_relative "lithic/models/external_bank_account_retrieve_response" +require_relative "lithic/models/external_bank_account_retry_micro_deposits_params" +require_relative "lithic/models/external_bank_account_retry_micro_deposits_response" +require_relative "lithic/models/external_bank_account_retry_prenote_params" +require_relative "lithic/models/external_bank_accounts/micro_deposit_create_params" +require_relative "lithic/models/external_bank_accounts/micro_deposit_create_response" +require_relative "lithic/models/external_bank_account_set_verification_method_params" +require_relative "lithic/models/external_bank_account_unpause_params" +require_relative "lithic/models/external_bank_account_updated_webhook_event" +require_relative "lithic/models/external_bank_account_update_params" +require_relative "lithic/models/external_bank_account_update_response" +require_relative "lithic/models/external_payment_cancel_params" +require_relative "lithic/models/external_payment_created_webhook_event" +require_relative "lithic/models/external_payment_create_params" +require_relative "lithic/models/external_payment_list_params" +require_relative "lithic/models/external_payment_release_params" +require_relative "lithic/models/external_payment_retrieve_params" +require_relative "lithic/models/external_payment_reverse_params" +require_relative "lithic/models/external_payment_settle_params" +require_relative "lithic/models/external_payment_updated_webhook_event" +require_relative "lithic/models/external_resource" +require_relative "lithic/models/external_resource_type" +require_relative "lithic/models/financial_account_balance" +require_relative "lithic/models/financial_account_created_webhook_event" +require_relative "lithic/models/financial_account_create_params" +require_relative "lithic/models/financial_account_list_params" +require_relative "lithic/models/financial_account_register_account_number_params" +require_relative "lithic/models/financial_account_retrieve_params" +require_relative "lithic/models/financial_accounts/balance_list_params" +require_relative "lithic/models/financial_accounts/category_balances" +require_relative "lithic/models/financial_accounts/category_tier" +require_relative "lithic/models/financial_accounts/credit_configuration_retrieve_params" +require_relative "lithic/models/financial_accounts/credit_configuration_update_params" +require_relative "lithic/models/financial_accounts/financial_account_credit_config" +require_relative "lithic/models/financial_accounts/loan_tape_configuration" +require_relative "lithic/models/financial_accounts/statements" +require_relative "lithic/models/financial_accounts/financial_transaction_list_params" +require_relative "lithic/models/financial_accounts/financial_transaction_retrieve_params" +require_relative "lithic/models/financial_accounts/interest_tier_schedule_create_params" +require_relative "lithic/models/financial_accounts/interest_tier_schedule_delete_params" +require_relative "lithic/models/financial_accounts/interest_tier_schedule_list_params" +require_relative "lithic/models/financial_accounts/interest_tier_schedule_retrieve_params" +require_relative "lithic/models/financial_accounts/interest_tier_schedule_update_params" +require_relative "lithic/models/financial_accounts/loan_tape_configuration_retrieve_params" +require_relative "lithic/models/financial_accounts/loan_tape_list_params" +require_relative "lithic/models/financial_accounts/loan_tape_rebuild_configuration" +require_relative "lithic/models/financial_accounts/loan_tape_retrieve_params" +require_relative "lithic/models/financial_accounts/statement_list_params" +require_relative "lithic/models/financial_accounts/statement_retrieve_params" +require_relative "lithic/models/financial_accounts/statements/line_item_list_params" +require_relative "lithic/models/financial_accounts/statements/statement_line_items" +require_relative "lithic/models/financial_account_updated_webhook_event" +require_relative "lithic/models/financial_account_update_params" +require_relative "lithic/models/financial_account_update_status_params" +require_relative "lithic/models/financial_event" +require_relative "lithic/models/financial_transaction" +require_relative "lithic/models/fraud/transaction_report_params" +require_relative "lithic/models/fraud/transaction_report_response" +require_relative "lithic/models/fraud/transaction_retrieve_params" +require_relative "lithic/models/fraud/transaction_retrieve_response" +require_relative "lithic/models/funding_event_created_webhook_event" +require_relative "lithic/models/funding_event_list_params" +require_relative "lithic/models/funding_event_retrieve_details_params" +require_relative "lithic/models/funding_event_retrieve_details_response" +require_relative "lithic/models/funding_event_retrieve_params" +require_relative "lithic/models/hold" +require_relative "lithic/models/hold_create_params" +require_relative "lithic/models/hold_event" +require_relative "lithic/models/hold_list_params" +require_relative "lithic/models/hold_retrieve_params" +require_relative "lithic/models/hold_void_params" +require_relative "lithic/models/instance_financial_account_type" +require_relative "lithic/models/internal_transaction_created_webhook_event" +require_relative "lithic/models/internal_transaction_updated_webhook_event" +require_relative "lithic/models/kyb" +require_relative "lithic/models/kyb_business_entity" +require_relative "lithic/models/kyc" +require_relative "lithic/models/kyc_exempt" +require_relative "lithic/models/loan_tape_created_webhook_event" +require_relative "lithic/models/loan_tape_updated_webhook_event" +require_relative "lithic/models/management_operation_created_webhook_event" +require_relative "lithic/models/management_operation_create_params" +require_relative "lithic/models/management_operation_list_params" +require_relative "lithic/models/management_operation_retrieve_params" +require_relative "lithic/models/management_operation_reverse_params" +require_relative "lithic/models/management_operation_updated_webhook_event" +require_relative "lithic/models/message_attempt" +require_relative "lithic/models/network_program" +require_relative "lithic/models/network_program_list_params" +require_relative "lithic/models/network_program_retrieve_params" +require_relative "lithic/models/network_total_created_webhook_event" +require_relative "lithic/models/network_total_updated_webhook_event" +require_relative "lithic/models/owner_type" +require_relative "lithic/models/parsed_webhook_event" +require_relative "lithic/models/payment_create_params" +require_relative "lithic/models/payment_create_response" +require_relative "lithic/models/payment_list_params" +require_relative "lithic/models/payment_retrieve_params" +require_relative "lithic/models/payment_retry_params" +require_relative "lithic/models/payment_retry_response" +require_relative "lithic/models/payment_return_params" +require_relative "lithic/models/payment_simulate_action_params" +require_relative "lithic/models/payment_simulate_action_response" +require_relative "lithic/models/payment_simulate_receipt_params" +require_relative "lithic/models/payment_simulate_receipt_response" +require_relative "lithic/models/payment_simulate_release_params" +require_relative "lithic/models/payment_simulate_release_response" +require_relative "lithic/models/payment_simulate_return_params" +require_relative "lithic/models/payment_simulate_return_response" +require_relative "lithic/models/payment_transaction_created_webhook_event" +require_relative "lithic/models/payment_transaction_updated_webhook_event" +require_relative "lithic/models/provision_response" +require_relative "lithic/models/reports/settlement/network_total_list_params" +require_relative "lithic/models/reports/settlement/network_total_retrieve_params" +require_relative "lithic/models/reports/settlement_list_details_params" +require_relative "lithic/models/reports/settlement_summary_params" +require_relative "lithic/models/required_document" +require_relative "lithic/models/responder_endpoint_check_status_params" +require_relative "lithic/models/responder_endpoint_create_params" +require_relative "lithic/models/responder_endpoint_create_response" +require_relative "lithic/models/responder_endpoint_delete_params" +require_relative "lithic/models/responder_endpoint_status" +require_relative "lithic/models/settlement_detail" +require_relative "lithic/models/settlement_report_updated_webhook_event" +require_relative "lithic/models/settlement_summary_details" +require_relative "lithic/models/shipping_address" +require_relative "lithic/models/signals_response" +require_relative "lithic/models/spend_limit_duration" +require_relative "lithic/models/statements_created_webhook_event" +require_relative "lithic/models/statement_totals" +require_relative "lithic/models/three_ds/authentication_retrieve_params" +require_relative "lithic/models/three_ds/authentication_simulate_otp_entry_params" +require_relative "lithic/models/three_ds/authentication_simulate_params" +require_relative "lithic/models/three_ds/authentication_simulate_response" +require_relative "lithic/models/three_ds/challenge_result" +require_relative "lithic/models/three_ds/decisioning_challenge_response_params" +require_relative "lithic/models/three_ds/decisioning_retrieve_secret_params" +require_relative "lithic/models/three_ds/decisioning_retrieve_secret_response" +require_relative "lithic/models/three_ds/decisioning_rotate_secret_params" +require_relative "lithic/models/three_ds_authentication_approval_request_webhook_event" +require_relative "lithic/models/three_ds_authentication_challenge_webhook_event" +require_relative "lithic/models/three_ds_authentication_created_webhook_event" +require_relative "lithic/models/three_ds_authentication_updated_webhook_event" +require_relative "lithic/models/token_info" +require_relative "lithic/models/tokenization" +require_relative "lithic/models/tokenization_activate_params" +require_relative "lithic/models/tokenization_approval_request_webhook_event" +require_relative "lithic/models/tokenization_deactivate_params" +require_relative "lithic/models/tokenization_decisioning_retrieve_secret_params" +require_relative "lithic/models/tokenization_decisioning_rotate_secret_params" +require_relative "lithic/models/tokenization_decisioning_rotate_secret_response" +require_relative "lithic/models/tokenization_decline_reason" +require_relative "lithic/models/tokenization_list_params" +require_relative "lithic/models/tokenization_pause_params" +require_relative "lithic/models/tokenization_resend_activation_code_params" +require_relative "lithic/models/tokenization_result_webhook_event" +require_relative "lithic/models/tokenization_retrieve_params" +require_relative "lithic/models/tokenization_rule_result" +require_relative "lithic/models/tokenization_secret" +require_relative "lithic/models/tokenization_simulate_params" +require_relative "lithic/models/tokenization_tfa_reason" +require_relative "lithic/models/tokenization_two_factor_authentication_code_sent_webhook_event" +require_relative "lithic/models/tokenization_two_factor_authentication_code_webhook_event" +require_relative "lithic/models/tokenization_unpause_params" +require_relative "lithic/models/tokenization_update_digital_card_art_params" +require_relative "lithic/models/tokenization_updated_webhook_event" +require_relative "lithic/models/token_metadata" +require_relative "lithic/models/transaction_expire_authorization_params" +require_relative "lithic/models/transaction_list_params" +require_relative "lithic/models/transaction_monitoring/case_activity_entry" +require_relative "lithic/models/transaction_monitoring/case_activity_type" +require_relative "lithic/models/transaction_monitoring/case_card" +require_relative "lithic/models/transaction_monitoring/case_entity" +require_relative "lithic/models/transaction_monitoring/case_list_activity_params" +require_relative "lithic/models/transaction_monitoring/case_list_params" +require_relative "lithic/models/transaction_monitoring/case_list_transactions_params" +require_relative "lithic/models/transaction_monitoring/case_priority" +require_relative "lithic/models/transaction_monitoring/case_retrieve_cards_params" +require_relative "lithic/models/transaction_monitoring/case_retrieve_cards_response" +require_relative "lithic/models/transaction_monitoring/case_retrieve_params" +require_relative "lithic/models/transaction_monitoring/cases/case_file" +require_relative "lithic/models/transaction_monitoring/cases/comment_create_params" +require_relative "lithic/models/transaction_monitoring/cases/comment_delete_params" +require_relative "lithic/models/transaction_monitoring/cases/comment_update_params" +require_relative "lithic/models/transaction_monitoring/cases/file_create_params" +require_relative "lithic/models/transaction_monitoring/cases/file_delete_params" +require_relative "lithic/models/transaction_monitoring/cases/file_list_params" +require_relative "lithic/models/transaction_monitoring/cases/file_retrieve_params" +require_relative "lithic/models/transaction_monitoring/cases/file_status" +require_relative "lithic/models/transaction_monitoring/cases/upload_constraints" +require_relative "lithic/models/transaction_monitoring/case_sort_order" +require_relative "lithic/models/transaction_monitoring/case_status" +require_relative "lithic/models/transaction_monitoring/case_transaction" +require_relative "lithic/models/transaction_monitoring/case_update_params" +require_relative "lithic/models/transaction_monitoring/entity_type" +require_relative "lithic/models/transaction_monitoring/monitoring_case" +require_relative "lithic/models/transaction_monitoring/queue" +require_relative "lithic/models/transaction_monitoring/queue_create_params" +require_relative "lithic/models/transaction_monitoring/queue_delete_params" +require_relative "lithic/models/transaction_monitoring/queue_list_params" +require_relative "lithic/models/transaction_monitoring/queue_retrieve_params" +require_relative "lithic/models/transaction_monitoring/queue_update_params" +require_relative "lithic/models/transaction_monitoring/resolution_outcome" +require_relative "lithic/models/transaction_retrieve_params" +require_relative "lithic/models/transaction_route_params" +require_relative "lithic/models/transactions/enhanced_commercial_data_retrieve_params" +require_relative "lithic/models/transactions/enhanced_commercial_data_retrieve_response" +require_relative "lithic/models/transactions/events/enhanced_commercial_data_retrieve_params" +require_relative "lithic/models/transaction_simulate_authorization_advice_params" +require_relative "lithic/models/transaction_simulate_authorization_advice_response" +require_relative "lithic/models/transaction_simulate_authorization_params" +require_relative "lithic/models/transaction_simulate_authorization_response" +require_relative "lithic/models/transaction_simulate_clearing_params" +require_relative "lithic/models/transaction_simulate_clearing_response" +require_relative "lithic/models/transaction_simulate_credit_authorization_advice_params" +require_relative "lithic/models/transaction_simulate_credit_authorization_advice_response" +require_relative "lithic/models/transaction_simulate_return_params" +require_relative "lithic/models/transaction_simulate_return_response" +require_relative "lithic/models/transaction_simulate_return_reversal_params" +require_relative "lithic/models/transaction_simulate_return_reversal_response" +require_relative "lithic/models/transaction_simulate_void_params" +require_relative "lithic/models/transaction_simulate_void_response" +require_relative "lithic/models/transfer" +require_relative "lithic/models/transfer_create_params" +require_relative "lithic/models/transfer_limit_list_params" +require_relative "lithic/models/transfer_limits_response" +require_relative "lithic/models/verification_method" +require_relative "lithic/models/wallet_decisioning_info" +require_relative "lithic/models/webhook_parsed_params" +require_relative "lithic/models/wire_party_details" +require_relative "lithic/models" +require_relative "lithic/resources/account_activity" +require_relative "lithic/resources/account_holders" +require_relative "lithic/resources/account_holders/entities" +require_relative "lithic/resources/accounts" +require_relative "lithic/resources/auth_rules" +require_relative "lithic/resources/auth_rules/v2" +require_relative "lithic/resources/auth_rules/v2/backtests" +require_relative "lithic/resources/auth_stream_enrollment" +require_relative "lithic/resources/balances" +require_relative "lithic/resources/book_transfers" +require_relative "lithic/resources/card_authorizations" +require_relative "lithic/resources/card_bulk_orders" +require_relative "lithic/resources/card_programs" +require_relative "lithic/resources/cards" +require_relative "lithic/resources/cards/balances" +require_relative "lithic/resources/cards/financial_transactions" +require_relative "lithic/resources/credit_products" +require_relative "lithic/resources/credit_products/extended_credit" +require_relative "lithic/resources/credit_products/prime_rates" +require_relative "lithic/resources/digital_card_art" +require_relative "lithic/resources/disputes" +require_relative "lithic/resources/disputes_v2" +require_relative "lithic/resources/events" +require_relative "lithic/resources/events/event_subscriptions" +require_relative "lithic/resources/events/subscriptions" +require_relative "lithic/resources/external_bank_accounts" +require_relative "lithic/resources/external_bank_accounts/micro_deposits" +require_relative "lithic/resources/external_payments" +require_relative "lithic/resources/financial_accounts" +require_relative "lithic/resources/financial_accounts/balances" +require_relative "lithic/resources/financial_accounts/credit_configuration" +require_relative "lithic/resources/financial_accounts/financial_transactions" +require_relative "lithic/resources/financial_accounts/interest_tier_schedule" +require_relative "lithic/resources/financial_accounts/loan_tape_configuration" +require_relative "lithic/resources/financial_accounts/loan_tapes" +require_relative "lithic/resources/financial_accounts/statements" +require_relative "lithic/resources/financial_accounts/statements/line_items" +require_relative "lithic/resources/fraud" +require_relative "lithic/resources/fraud/transactions" +require_relative "lithic/resources/funding_events" +require_relative "lithic/resources/holds" +require_relative "lithic/resources/internal_transaction" +require_relative "lithic/resources/management_operations" +require_relative "lithic/resources/network_programs" +require_relative "lithic/resources/payments" +require_relative "lithic/resources/reports" +require_relative "lithic/resources/reports/settlement" +require_relative "lithic/resources/reports/settlement/network_totals" +require_relative "lithic/resources/responder_endpoints" +require_relative "lithic/resources/three_ds" +require_relative "lithic/resources/three_ds/authentication" +require_relative "lithic/resources/three_ds/decisioning" +require_relative "lithic/resources/tokenization_decisioning" +require_relative "lithic/resources/tokenizations" +require_relative "lithic/resources/transaction_monitoring" +require_relative "lithic/resources/transaction_monitoring/cases" +require_relative "lithic/resources/transaction_monitoring/cases/comments" +require_relative "lithic/resources/transaction_monitoring/cases/files" +require_relative "lithic/resources/transaction_monitoring/queues" +require_relative "lithic/resources/transactions" +require_relative "lithic/resources/transactions/enhanced_commercial_data" +require_relative "lithic/resources/transactions/events" +require_relative "lithic/resources/transactions/events/enhanced_commercial_data" +require_relative "lithic/resources/transfer_limits" +require_relative "lithic/resources/transfers" +require_relative "lithic/resources/webhooks" diff --git a/lib/lithic/client.rb b/lib/lithic/client.rb new file mode 100644 index 00000000..a6e1ea35 --- /dev/null +++ b/lib/lithic/client.rb @@ -0,0 +1,262 @@ +# frozen_string_literal: true + +module Lithic + class Client < Lithic::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 + + # rubocop:disable Style/MutableConstant + # @type [Hash{Symbol=>String}] + ENVIRONMENTS = {production: "https://api.lithic.com", sandbox: "https://sandbox.lithic.com"} + # rubocop:enable Style/MutableConstant + + # @return [String] + attr_reader :api_key + + # @return [String, nil] + attr_reader :webhook_secret + + # @return [Lithic::Resources::Accounts] + attr_reader :accounts + + # @return [Lithic::Resources::AccountHolders] + attr_reader :account_holders + + # @return [Lithic::Resources::AuthRules] + attr_reader :auth_rules + + # @return [Lithic::Resources::TransactionMonitoring] + attr_reader :transaction_monitoring + + # @return [Lithic::Resources::AuthStreamEnrollment] + attr_reader :auth_stream_enrollment + + # @return [Lithic::Resources::TokenizationDecisioning] + attr_reader :tokenization_decisioning + + # @return [Lithic::Resources::Tokenizations] + attr_reader :tokenizations + + # @return [Lithic::Resources::Cards] + attr_reader :cards + + # @return [Lithic::Resources::CardAuthorizations] + attr_reader :card_authorizations + + # @return [Lithic::Resources::CardBulkOrders] + attr_reader :card_bulk_orders + + # @return [Lithic::Resources::Balances] + attr_reader :balances + + # @return [Lithic::Resources::Disputes] + attr_reader :disputes + + # @return [Lithic::Resources::DisputesV2] + attr_reader :disputes_v2 + + # @return [Lithic::Resources::Events] + attr_reader :events + + # @return [Lithic::Resources::Transfers] + attr_reader :transfers + + # @return [Lithic::Resources::FinancialAccounts] + attr_reader :financial_accounts + + # @return [Lithic::Resources::Transactions] + attr_reader :transactions + + # @return [Lithic::Resources::ResponderEndpoints] + attr_reader :responder_endpoints + + # @return [Lithic::Resources::ExternalBankAccounts] + attr_reader :external_bank_accounts + + # @return [Lithic::Resources::Payments] + attr_reader :payments + + # @return [Lithic::Resources::ThreeDS] + attr_reader :three_ds + + # @return [Lithic::Resources::Reports] + attr_reader :reports + + # @return [Lithic::Resources::CardPrograms] + attr_reader :card_programs + + # @return [Lithic::Resources::DigitalCardArt] + attr_reader :digital_card_art + + # @return [Lithic::Resources::BookTransfers] + attr_reader :book_transfers + + # @return [Lithic::Resources::CreditProducts] + attr_reader :credit_products + + # @return [Lithic::Resources::ExternalPayments] + attr_reader :external_payments + + # @return [Lithic::Resources::ManagementOperations] + attr_reader :management_operations + + # @return [Lithic::Resources::InternalTransaction] + attr_reader :internal_transaction + + # @return [Lithic::Resources::FundingEvents] + attr_reader :funding_events + + # @return [Lithic::Resources::Fraud] + attr_reader :fraud + + # @return [Lithic::Resources::NetworkPrograms] + attr_reader :network_programs + + # @return [Lithic::Resources::Holds] + attr_reader :holds + + # @return [Lithic::Resources::AccountActivity] + attr_reader :account_activity + + # @return [Lithic::Resources::TransferLimits] + attr_reader :transfer_limits + + # @return [Lithic::Resources::Webhooks] + attr_reader :webhooks + + # Status of api + # + # @overload api_status(request_options: {}) + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::APIStatus] + # + # @see Lithic::Models::ClientAPIStatusParams + def api_status(params = {}) + request(method: :get, path: "v1/status", model: Lithic::APIStatus, options: params[:request_options]) + end + + # @api private + # + # @return [Hash{String=>String}] + private def auth_headers + {"authorization" => @api_key} + end + + # Creates and returns a new client for interacting with the API. + # + # @param api_key [String, nil] Defaults to `ENV["LITHIC_API_KEY"]` + # + # @param webhook_secret [String, nil] Defaults to `ENV["LITHIC_WEBHOOK_SECRET"]` + # + # @param environment [:production, :sandbox, nil] Specifies the environment to use for the API. + # + # Each environment maps to a different base URL: + # + # - `production` corresponds to `https://api.lithic.com` + # - `sandbox` corresponds to `https://sandbox.lithic.com` + # + # @param base_url [String, nil] Override the default base URL for the API, e.g., + # `"https://api.example.com/v2/"`. Defaults to `ENV["LITHIC_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( + api_key: ENV["LITHIC_API_KEY"], + webhook_secret: ENV["LITHIC_WEBHOOK_SECRET"], + environment: nil, + base_url: ENV["LITHIC_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 ||= Lithic::Client::ENVIRONMENTS.fetch(environment&.to_sym || :production) do + message = "environment must be one of #{Lithic::Client::ENVIRONMENTS.keys}, got #{environment}" + raise ArgumentError.new(message) + end + + if api_key.nil? + raise ArgumentError.new("api_key is required, and can be set via environ: \"LITHIC_API_KEY\"") + end + + headers = {} + custom_headers_env = ENV["LITHIC_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 + + @api_key = api_key.to_s + @webhook_secret = webhook_secret&.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 + ) + + @accounts = Lithic::Resources::Accounts.new(client: self) + @account_holders = Lithic::Resources::AccountHolders.new(client: self) + @auth_rules = Lithic::Resources::AuthRules.new(client: self) + @transaction_monitoring = Lithic::Resources::TransactionMonitoring.new(client: self) + @auth_stream_enrollment = Lithic::Resources::AuthStreamEnrollment.new(client: self) + @tokenization_decisioning = Lithic::Resources::TokenizationDecisioning.new(client: self) + @tokenizations = Lithic::Resources::Tokenizations.new(client: self) + @cards = Lithic::Resources::Cards.new(client: self) + @card_authorizations = Lithic::Resources::CardAuthorizations.new(client: self) + @card_bulk_orders = Lithic::Resources::CardBulkOrders.new(client: self) + @balances = Lithic::Resources::Balances.new(client: self) + @disputes = Lithic::Resources::Disputes.new(client: self) + @disputes_v2 = Lithic::Resources::DisputesV2.new(client: self) + @events = Lithic::Resources::Events.new(client: self) + @transfers = Lithic::Resources::Transfers.new(client: self) + @financial_accounts = Lithic::Resources::FinancialAccounts.new(client: self) + @transactions = Lithic::Resources::Transactions.new(client: self) + @responder_endpoints = Lithic::Resources::ResponderEndpoints.new(client: self) + @external_bank_accounts = Lithic::Resources::ExternalBankAccounts.new(client: self) + @payments = Lithic::Resources::Payments.new(client: self) + @three_ds = Lithic::Resources::ThreeDS.new(client: self) + @reports = Lithic::Resources::Reports.new(client: self) + @card_programs = Lithic::Resources::CardPrograms.new(client: self) + @digital_card_art = Lithic::Resources::DigitalCardArt.new(client: self) + @book_transfers = Lithic::Resources::BookTransfers.new(client: self) + @credit_products = Lithic::Resources::CreditProducts.new(client: self) + @external_payments = Lithic::Resources::ExternalPayments.new(client: self) + @management_operations = Lithic::Resources::ManagementOperations.new(client: self) + @internal_transaction = Lithic::Resources::InternalTransaction.new(client: self) + @funding_events = Lithic::Resources::FundingEvents.new(client: self) + @fraud = Lithic::Resources::Fraud.new(client: self) + @network_programs = Lithic::Resources::NetworkPrograms.new(client: self) + @holds = Lithic::Resources::Holds.new(client: self) + @account_activity = Lithic::Resources::AccountActivity.new(client: self) + @transfer_limits = Lithic::Resources::TransferLimits.new(client: self) + @webhooks = Lithic::Resources::Webhooks.new(client: self) + end + end +end diff --git a/lib/lithic/errors.rb b/lib/lithic/errors.rb new file mode 100644 index 00000000..011358a5 --- /dev/null +++ b/lib/lithic/errors.rb @@ -0,0 +1,228 @@ +# frozen_string_literal: true + +module Lithic + module Errors + class Error < StandardError + # @!attribute cause + # + # @return [StandardError, nil] + end + + class ConversionError < Lithic::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 < Lithic::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 < Lithic::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 < Lithic::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 < Lithic::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 + Lithic::Errors::BadRequestError.new(**kwargs) + in 401 + Lithic::Errors::AuthenticationError.new(**kwargs) + in 403 + Lithic::Errors::PermissionDeniedError.new(**kwargs) + in 404 + Lithic::Errors::NotFoundError.new(**kwargs) + in 409 + Lithic::Errors::ConflictError.new(**kwargs) + in 422 + Lithic::Errors::UnprocessableEntityError.new(**kwargs) + in 429 + Lithic::Errors::RateLimitError.new(**kwargs) + in (500..) + Lithic::Errors::InternalServerError.new(**kwargs) + else + Lithic::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 < Lithic::Errors::APIStatusError + HTTP_STATUS = 400 + end + + class AuthenticationError < Lithic::Errors::APIStatusError + HTTP_STATUS = 401 + end + + class PermissionDeniedError < Lithic::Errors::APIStatusError + HTTP_STATUS = 403 + end + + class NotFoundError < Lithic::Errors::APIStatusError + HTTP_STATUS = 404 + end + + class ConflictError < Lithic::Errors::APIStatusError + HTTP_STATUS = 409 + end + + class UnprocessableEntityError < Lithic::Errors::APIStatusError + HTTP_STATUS = 422 + end + + class RateLimitError < Lithic::Errors::APIStatusError + HTTP_STATUS = 429 + end + + class InternalServerError < Lithic::Errors::APIStatusError + HTTP_STATUS = (500..) + end + end +end diff --git a/lib/lithic/file_part.rb b/lib/lithic/file_part.rb new file mode 100644 index 00000000..cccaeda2 --- /dev/null +++ b/lib/lithic/file_part.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +module Lithic + 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/lithic/internal.rb b/lib/lithic/internal.rb new file mode 100644 index 00000000..f70d8e15 --- /dev/null +++ b/lib/lithic/internal.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Internal + extend Lithic::Internal::Util::SorbetRuntimeSupport + + OMIT = + Object.new.tap do + _1.define_singleton_method(:inspect) { "#<#{Lithic::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, Lithic::FilePart) } + end + end +end diff --git a/lib/lithic/internal/cursor_page.rb b/lib/lithic/internal/cursor_page.rb new file mode 100644 index 00000000..269f9055 --- /dev/null +++ b/lib/lithic/internal/cursor_page.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +module Lithic + module Internal + # @generic Elem + # + # @example + # if cursor_page.has_next? + # cursor_page = cursor_page.next_page + # end + # + # @example + # cursor_page.auto_paging_each do |account| + # puts(account) + # end + class CursorPage + include Lithic::Internal::Type::BasePage + + # @return [Array>, nil] + attr_accessor :data + + # @return [Boolean] + attr_accessor :has_more + + # @return [Boolean] + def next_page? + has_more + end + + # @raise [Lithic::HTTP::Error] + # @return [self] + def next_page + unless next_page? + message = "No more pages available. Please check #next_page? before calling ##{__method__}" + raise RuntimeError.new(message) + end + + req = Lithic::Internal::Util.deep_merge(@req, {query: {starting_after: data&.last&.token}}) + @client.request(req) + end + + # @param blk [Proc] + # + # @yieldparam [generic] + def auto_paging_each(&blk) + unless block_given? + raise ArgumentError.new("A block must be given to ##{__method__}") + end + + page = self + loop do + page.data&.each(&blk) + + break unless page.next_page? + page = page.next_page + end + end + + # @api private + # + # @param client [Lithic::Internal::Transport::BaseClient] + # @param req [Hash{Symbol=>Object}] + # @param headers [Hash{String=>String}] + # @param page_data [Hash{Symbol=>Object}] + def initialize(client:, req:, headers:, page_data:) + super + + case page_data + in {data: Array => data} + @data = data.map { Lithic::Internal::Type::Converter.coerce(@model, _1) } + else + end + @has_more = page_data[:has_more] + end + + # @api private + # + # @return [String] + def inspect + model = Lithic::Internal::Type::Converter.inspect(@model, depth: 1) + + "#<#{self.class}[#{model}]:0x#{object_id.to_s(16)} has_more=#{has_more.inspect}>" + end + end + end +end diff --git a/lib/lithic/internal/single_page.rb b/lib/lithic/internal/single_page.rb new file mode 100644 index 00000000..091bef6e --- /dev/null +++ b/lib/lithic/internal/single_page.rb @@ -0,0 +1,80 @@ +# frozen_string_literal: true + +module Lithic + module Internal + # @generic Elem + # + # @example + # if single_page.has_next? + # single_page = single_page.next_page + # end + # + # @example + # single_page.auto_paging_each do |account_holder| + # puts(account_holder) + # end + class SinglePage + include Lithic::Internal::Type::BasePage + + # @return [Array>, nil] + attr_accessor :data + + # @return [Boolean] + attr_accessor :has_more + + # @return [Boolean] + def next_page? + has_more + end + + # @raise [Lithic::HTTP::Error] + # @return [self] + def next_page + RuntimeError.new("No more pages available.") + end + + # @param blk [Proc] + # + # @yieldparam [generic] + def auto_paging_each(&blk) + unless block_given? + raise ArgumentError.new("A block must be given to ##{__method__}") + end + + page = self + loop do + page.data&.each(&blk) + + break unless page.next_page? + page = page.next_page + end + end + + # @api private + # + # @param client [Lithic::Internal::Transport::BaseClient] + # @param req [Hash{Symbol=>Object}] + # @param headers [Hash{String=>String}] + # @param page_data [Array] + def initialize(client:, req:, headers:, page_data:) + super + + case page_data + in {data: Array => data} + @data = data.map { Lithic::Internal::Type::Converter.coerce(@model, _1) } + else + end + @has_more = page_data[:has_more] + end + + # @api private + # + # @return [String] + def inspect + model = Lithic::Internal::Type::Converter.inspect(@model, depth: 1) + + "#<#{self.class}[#{model}]:0x#{object_id.to_s(16)} has_more=#{has_more.inspect}>" + end + end + end +end diff --git a/lib/lithic/internal/transport/base_client.rb b/lib/lithic/internal/transport/base_client.rb new file mode 100644 index 00000000..a93fddb9 --- /dev/null +++ b/lib/lithic/internal/transport/base_client.rb @@ -0,0 +1,578 @@ +# frozen_string_literal: true + +module Lithic + module Internal + module Transport + # @api private + # + # @abstract + class BaseClient + extend Lithic::Internal::Util::SorbetRuntimeSupport + + # from whatwg fetch spec + MAX_REDIRECTS = 20 + + # rubocop:disable Style/MutableConstant + PLATFORM_HEADERS = + { + "x-stainless-arch" => Lithic::Internal::Util.arch, + "x-stainless-lang" => "ruby", + "x-stainless-os" => Lithic::Internal::Util.os, + "x-stainless-package-version" => Lithic::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 = Lithic::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 Lithic::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 Lithic::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 Lithic::Internal::Util.uri_origin(url) != Lithic::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, Lithic::Errors::APIConnectionError] + # @param stream [Enumerable, nil] + def reap_connection!(status, stream:) + case status + in (..199) | (300..499) + stream&.each { next } + in Lithic::Errors::APIConnectionError | (500..) + Lithic::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 [Lithic::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 = Lithic::Internal::Transport::PooledNetRequester.new + @headers = Lithic::Internal::Util.normalized_headers( + self.class::PLATFORM_HEADERS, + { + "accept" => "application/json", + "content-type" => "application/json", + "user-agent" => user_agent + }, + headers + ) + @base_url_components = Lithic::Internal::Util.parse_uri(base_url) + @base_url = Lithic::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 #{Lithic::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 [Lithic::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 = Lithic::Internal::Util.interpolate_path(uninterpolated_path) + + query = Lithic::Internal::Util.deep_merge(req[:query].to_h, opts[:extra_query].to_h) + + headers = Lithic::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 + Lithic::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 = Lithic::Internal::Util.join_parsed_uri( + @base_url_components, + {**req, path: path, query: query} + ) + headers, encoded = Lithic::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 [Lithic::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: Lithic::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 Lithic::Errors::APIConnectionError => e + status = e + end + headers = Lithic::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 Lithic::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 Lithic::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 + Lithic::Internal::Util.decode_content(headers, stream: stream, suppress_error: true) + ensure + self.class.reap_connection!(status, stream: stream) + end + + raise Lithic::Errors::APIStatusError.for( + url: url, + status: status, + headers: headers, + body: decoded, + request: nil, + response: response + ) + in (400..) | Lithic::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: Lithic::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 [Lithic::Internal::Type::Converter, Class, nil] + # + # @param options [Lithic::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 [Lithic::Errors::APIError] + # @return [Object] + def request(req) + self.class.validate!(req) + model = req.fetch(:model) { Lithic::Internal::Type::Unknown } + opts = req[:options].to_h + unwrap = req[:unwrap] + Lithic::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 = Lithic::Internal::Util.normalized_headers(response.each_header.to_h) + decoded = Lithic::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 = Lithic::Internal::Util.dig(decoded, unwrap) + Lithic::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[Lithic::Internal::Type::BasePage[Lithic::Internal::Type::BaseModel]]), + stream: T.nilable(T::Class[T.anything]), + model: T.nilable(Lithic::Internal::Type::Converter::Input), + options: T.nilable(Lithic::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/lithic/internal/transport/pooled_net_requester.rb b/lib/lithic/internal/transport/pooled_net_requester.rb new file mode 100644 index 00000000..19bac3b9 --- /dev/null +++ b/lib/lithic/internal/transport/pooled_net_requester.rb @@ -0,0 +1,210 @@ +# frozen_string_literal: true + +module Lithic + module Internal + module Transport + # @api private + class PooledNetRequester + extend Lithic::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 - Lithic::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 = Lithic::Internal::Util::ReadIOAdapter.new(body, &blk) + in StringIO + req["content-length"] ||= body.size.to_s unless req["transfer-encoding"] + req.body_stream = Lithic::Internal::Util::ReadIOAdapter.new(body, &blk) + in Pathname | IO | Enumerator + req["transfer-encoding"] ||= "chunked" unless req["content-length"] + req.body_stream = Lithic::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 = Lithic::Internal::Util.uri_origin(url) + timeout = deadline - Lithic::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 Lithic::Errors::APITimeoutError.new(url: url, request: req) + rescue StandardError + raise Lithic::Errors::APIConnectionError.new(url: url, request: req) + end + # rubocop:enable Metrics/BlockLength + + _, response = enum.next + body = Lithic::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/lithic/internal/type/array_of.rb b/lib/lithic/internal/type/array_of.rb new file mode 100644 index 00000000..8bf556f5 --- /dev/null +++ b/lib/lithic/internal/type/array_of.rb @@ -0,0 +1,168 @@ +# frozen_string_literal: true + +module Lithic + module Internal + module Type + # @api private + # + # @abstract + # + # @generic Elem + # + # Array of items of a given type. + class ArrayOf + include Lithic::Internal::Type::Converter + include Lithic::Internal::Util::SorbetRuntimeSupport + + private_class_method :new + + # @overload [](type_info, spec = {}) + # + # @param type_info [Hash{Symbol=>Object}, Proc, Lithic::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?(Lithic::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 + Lithic::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 + Lithic::Internal::Type::Converter.dump(target, _1, state: state) + end + else + super + end + end + + # @api private + # + # @return [Object] + def to_sorbet_type + T::Array[Lithic::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, Lithic::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 = Lithic::Internal::Type::Converter.type_info(type_info || spec) + @meta = Lithic::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 = Lithic::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/lithic/internal/type/base_model.rb b/lib/lithic/internal/type/base_model.rb new file mode 100644 index 00000000..dc45808d --- /dev/null +++ b/lib/lithic/internal/type/base_model.rb @@ -0,0 +1,531 @@ +# frozen_string_literal: true + +module Lithic + module Internal + module Type + # @abstract + class BaseModel + extend Lithic::Internal::Type::Converter + extend Lithic::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, Lithic::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 = Lithic::Internal::Type::Converter.meta_info(type_info, spec) + type_fn, info = + case type_info + in Proc | Lithic::Internal::Type::Converter | Class + [Lithic::Internal::Type::Converter.type_info({**spec, union: type_info}), spec] + in Hash + [Lithic::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, Lithic::Internal::OMIT) : Lithic::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 = Lithic::Internal::Type::Converter.new_coerce_state(translate_names: false) + coerced = Lithic::Internal::Type::Converter.coerce(target, value, state: state) + status = @coerced.store(name_sym, state.fetch(:error) || true) + stored = + case [target, status] + in [Lithic::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 Lithic::Internal::Type::Converter === target + @data.fetch(name_sym) + in ::StandardError => e + raise Lithic::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 == Lithic::Internal::OMIT ? nil : const } + state = Lithic::Internal::Type::Converter.new_coerce_state(translate_names: false) + if (nilable || !required) && value.nil? + nil + else + Lithic::Internal::Type::Converter.coerce( + target, value, state: state + ) + end + rescue StandardError => e + raise Lithic::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, Lithic::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, Lithic::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 <= Lithic::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 [Lithic::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 = Lithic::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 == Lithic::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 = Lithic::Internal::Type::Converter.coerce(target, item, state: state) + case target + in Lithic::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 = Lithic::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, Lithic::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 == Lithic::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 [Lithic::Internal::Type::BaseModel] + # @param convert [Boolean] + # + # @return [Hash{Symbol=>Object}] + def recursively_to_h(model, convert:) + rec = ->(x) do + case x + in Lithic::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 Lithic::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 + # # `address` is a `Lithic::Address` + # address => { + # address1: address1, + # city: city, + # country: country + # } + 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) = Lithic::Internal::Type::Converter.dump(self.class, self).to_json(*a) + + # @api public + # + # @param a [Object] + # + # @return [String] + def to_yaml(*a) = Lithic::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 = {} + Lithic::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 = [ + Lithic::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/lithic/internal/type/base_page.rb b/lib/lithic/internal/type/base_page.rb new file mode 100644 index 00000000..08f0b6c3 --- /dev/null +++ b/lib/lithic/internal/type/base_page.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +module Lithic + 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 [Lithic::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 [Lithic::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/lithic/internal/type/boolean.rb b/lib/lithic/internal/type/boolean.rb new file mode 100644 index 00000000..4c09b705 --- /dev/null +++ b/lib/lithic/internal/type/boolean.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +module Lithic + module Internal + module Type + # @api private + # + # @abstract + # + # Ruby has no Boolean class; this is something for models to refer to. + class Boolean + extend Lithic::Internal::Type::Converter + extend Lithic::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 <= Lithic::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/lithic/internal/type/converter.rb b/lib/lithic/internal/type/converter.rb new file mode 100644 index 00000000..dab5c034 --- /dev/null +++ b/lib/lithic/internal/type/converter.rb @@ -0,0 +1,327 @@ +# frozen_string_literal: true + +module Lithic + module Internal + module Type + # @api private + module Converter + extend Lithic::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 { Lithic::Internal::Type::Unknown.dump(_1, state: state) } + in Hash + value.transform_values { Lithic::Internal::Type::Unknown.dump(_1, state: state) } + in Lithic::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) + Lithic::FilePart.new(value) + in Lithic::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, Lithic::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 + -> { Lithic::Internal::Type::Boolean } + in Lithic::Internal::Type::Converter | Class | Symbol + -> { spec } + in NilClass | Integer | Float + -> { spec.class } + end + end + + # @api private + # + # @param type_info [Hash{Symbol=>Object}, Proc, Lithic::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, Lithic::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 [Lithic::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: Lithic::Internal::Type::Converter.new_coerce_state) + # rubocop:disable Metrics/BlockNesting + exactness = state.fetch(:exactness) + + case target + in Lithic::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 [Lithic::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 Lithic::Internal::Type::Converter + target.dump(value, state: state) + else + Lithic::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 Lithic::Internal::Type::Converter + target.inspect(depth: depth.succ) + else + target.inspect + end + end + end + + define_sorbet_constant!(:Input) do + T.type_alias { T.any(Lithic::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/lithic/internal/type/enum.rb b/lib/lithic/internal/type/enum.rb new file mode 100644 index 00000000..902b14d2 --- /dev/null +++ b/lib/lithic/internal/type/enum.rb @@ -0,0 +1,152 @@ +# frozen_string_literal: true + +module Lithic + 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. + # + # @example + # # `account_financial_account_type` is a `Lithic::AccountFinancialAccountType` + # case account_financial_account_type + # when Lithic::AccountFinancialAccountType::ISSUING + # # ... + # when Lithic::AccountFinancialAccountType::OPERATING + # # ... + # else + # puts(account_financial_account_type) + # end + # + # @example + # case account_financial_account_type + # in :ISSUING + # # ... + # in :OPERATING + # # ... + # else + # puts(account_financial_account_type) + # end + module Enum + include Lithic::Internal::Type::Converter + include Lithic::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 + Lithic::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 { Lithic::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 { Lithic::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/lithic/internal/type/file_input.rb b/lib/lithic/internal/type/file_input.rb new file mode 100644 index 00000000..0ded8cb3 --- /dev/null +++ b/lib/lithic/internal/type/file_input.rb @@ -0,0 +1,111 @@ +# frozen_string_literal: true + +module Lithic + module Internal + module Type + # @api private + # + # @abstract + # + # Either `Pathname` or `StringIO`, or `IO`, or + # `Lithic::Internal::Type::FileInput`. + # + # Note: when `IO` is used, all retries are disabled, since many IO` streams are + # not rewindable. + class FileInput + extend Lithic::Internal::Type::Converter + + private_class_method :new + + # @api public + # + # @param other [Object] + # + # @return [Boolean] + def self.===(other) + case other + in Pathname | StringIO | IO | String | Lithic::FilePart + true + else + false + end + end + + # @api public + # + # @param other [Object] + # + # @return [Boolean] + def self.==(other) = other.is_a?(Class) && other <= Lithic::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 + Lithic::FilePart.new(value, filename: "upload") + in IO + state[:can_retry] = false + value.to_path.nil? ? Lithic::FilePart.new(value, filename: "upload") : value + in Lithic::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, Lithic::FilePart) + end + end + end + end + end +end diff --git a/lib/lithic/internal/type/hash_of.rb b/lib/lithic/internal/type/hash_of.rb new file mode 100644 index 00000000..4f425f5c --- /dev/null +++ b/lib/lithic/internal/type/hash_of.rb @@ -0,0 +1,188 @@ +# frozen_string_literal: true + +module Lithic + module Internal + module Type + # @api private + # + # @abstract + # + # @generic Elem + # + # Hash of items of a given type. + class HashOf + include Lithic::Internal::Type::Converter + include Lithic::Internal::Util::SorbetRuntimeSupport + + private_class_method :new + + # @overload [](type_info, spec = {}) + # + # @param type_info [Hash{Symbol=>Object}, Proc, Lithic::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?(Lithic::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 + Lithic::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 + Lithic::Internal::Type::Converter.dump(target, _1, state: state) + end + else + super + end + end + + # @api private + # + # @return [Object] + def to_sorbet_type + T::Hash[Lithic::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, Lithic::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 = Lithic::Internal::Type::Converter.type_info(type_info || spec) + @meta = Lithic::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 = Lithic::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/lithic/internal/type/request_parameters.rb b/lib/lithic/internal/type/request_parameters.rb new file mode 100644 index 00000000..9f1e543b --- /dev/null +++ b/lib/lithic/internal/type/request_parameters.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module Lithic + module Internal + module Type + # @api private + module RequestParameters + # @!attribute request_options + # Options to specify HTTP behaviour for this request. + # + # @return [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # @param mod [Module] + def self.included(mod) + raise ArgumentError.new(mod) unless mod <= Lithic::Internal::Type::BaseModel + + mod.optional(:request_options, Lithic::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 = Lithic::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/lithic/internal/type/union.rb b/lib/lithic/internal/type/union.rb new file mode 100644 index 00000000..7cf59a53 --- /dev/null +++ b/lib/lithic/internal/type/union.rb @@ -0,0 +1,262 @@ +# frozen_string_literal: true + +module Lithic + module Internal + module Type + # @api private + # + # @example + # # `account_activity_list_response` is a `Lithic::Models::AccountActivityListResponse` + # case account_activity_list_response + # when Lithic::Models::AccountActivityListResponse::Internal + # puts(account_activity_list_response.token) + # when Lithic::BookTransferResponse + # puts(account_activity_list_response.category) + # when Lithic::Models::AccountActivityListResponse::Card + # # ... + # else + # puts(account_activity_list_response) + # end + # + # @example + # case account_activity_list_response + # in {family: :INTERNAL, token: token, category: category, created: created} + # puts(token) + # in {family: :TRANSFER, token: token, category: category, created: created} + # puts(category) + # in {family: :PAYMENT, token: token, category: category, created: created} + # puts(created) + # else + # puts(account_activity_list_response) + # end + module Union + include Lithic::Internal::Type::Converter + include Lithic::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, Lithic::Internal::Type::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}, Proc, Lithic::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 = Lithic::Internal::Type::Converter.meta_info(nil, spec) + variant_info = + case key + in Symbol + [key, Lithic::Internal::Type::Converter.type_info(spec), meta] + in Proc | Lithic::Internal::Type::Converter | Class | Hash + [nil, Lithic::Internal::Type::Converter.type_info(key), meta] + end + + known_variants << variant_info + end + + # @api private + # + # @param value [Object] + # + # @return [Lithic::Internal::Type::Converter, Class, nil] + private def resolve_variant(value) + case [@discriminator, value] + in [_, Lithic::Internal::Type::BaseModel] + value.class + in [Symbol, Hash] + key = value.fetch(@discriminator) do + value.fetch(@discriminator.to_s, Lithic::Internal::OMIT) + end + + return nil if key == Lithic::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) + Lithic::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 Lithic::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 = Lithic::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 Lithic::Internal::Type::Converter.dump(target, value, state: state) + end + + known_variants.each do + target = _2.call + return Lithic::Internal::Type::Converter.dump(target, value, state: state) if target === value + end + + super + end + + # @api private + # + # @return [Object] + def to_sorbet_type + types = variants.map { Lithic::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 { Lithic::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/lithic/internal/type/unknown.rb b/lib/lithic/internal/type/unknown.rb new file mode 100644 index 00000000..2c36f7a4 --- /dev/null +++ b/lib/lithic/internal/type/unknown.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +module Lithic + module Internal + module Type + # @api private + # + # @abstract + # + # When we don't know what to expect for the value. + class Unknown + extend Lithic::Internal::Type::Converter + extend Lithic::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 <= Lithic::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/lithic/internal/util.rb b/lib/lithic/internal/util.rb new file mode 100644 index 00000000..7f27a436 --- /dev/null +++ b/lib/lithic/internal/util.rb @@ -0,0 +1,966 @@ +# frozen_string_literal: true + +module Lithic + 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 #{Lithic::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(Lithic::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 + Lithic::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 Lithic::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 Lithic::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) || Lithic::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 [Lithic::Internal::Util::JSON_CONTENT, Hash | Array | -> { primitive?(_1) }] + [headers, JSON.generate(body)] + in [Lithic::Internal::Util::JSONL_CONTENT, Enumerable] unless Lithic::Internal::Type::FileInput === body + [headers, body.lazy.map { JSON.generate(_1) }] + in [%r{^multipart/form-data}, Hash | Lithic::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 [_, Lithic::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 Lithic::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 Lithic::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 [Lithic::Internal::Util::SorbetRuntimeSupport, Object] + # + # @return [Object] + def to_sorbet_type(type) + case type + in Lithic::Internal::Util::SorbetRuntimeSupport + type.to_sorbet_type + in Class | Module + type + in true | false + T::Boolean + else + type.class + end + end + end + end + + extend Lithic::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/lithic/models.rb b/lib/lithic/models.rb new file mode 100644 index 00000000..310ecb79 --- /dev/null +++ b/lib/lithic/models.rb @@ -0,0 +1,616 @@ +# frozen_string_literal: true + +module Lithic + [Lithic::Internal::Type::BaseModel, *Lithic::Internal::Type::BaseModel.subclasses].each do |cls| + cls.define_sorbet_constant!(:OrHash) { T.type_alias { T.any(cls, Lithic::Internal::AnyHash) } } + end + + Lithic::Internal::Util.walk_namespaces(Lithic::Models).each do |mod| + case mod + in Lithic::Internal::Type::Enum | Lithic::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 + + Lithic::Internal::Util.walk_namespaces(Lithic::Models) + .lazy + .grep(Lithic::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 + + Account = Lithic::Models::Account + + AccountActivityListParams = Lithic::Models::AccountActivityListParams + + AccountActivityRetrieveTransactionParams = Lithic::Models::AccountActivityRetrieveTransactionParams + + AccountFinancialAccountType = Lithic::Models::AccountFinancialAccountType + + AccountHolder = Lithic::Models::AccountHolder + + AccountHolderCreatedWebhookEvent = Lithic::Models::AccountHolderCreatedWebhookEvent + + AccountHolderCreateParams = Lithic::Models::AccountHolderCreateParams + + AccountHolderDocumentUpdatedWebhookEvent = Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent + + AccountHolderListDocumentsParams = Lithic::Models::AccountHolderListDocumentsParams + + AccountHolderListParams = Lithic::Models::AccountHolderListParams + + AccountHolderRetrieveDocumentParams = Lithic::Models::AccountHolderRetrieveDocumentParams + + AccountHolderRetrieveParams = Lithic::Models::AccountHolderRetrieveParams + + AccountHolders = Lithic::Models::AccountHolders + + AccountHolderSimulateEnrollmentDocumentReviewParams = + Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams + + AccountHolderSimulateEnrollmentReviewParams = Lithic::Models::AccountHolderSimulateEnrollmentReviewParams + + AccountHolderUpdatedWebhookEvent = Lithic::Models::AccountHolderUpdatedWebhookEvent + + AccountHolderUpdateParams = Lithic::Models::AccountHolderUpdateParams + + AccountHolderUploadDocumentParams = Lithic::Models::AccountHolderUploadDocumentParams + + AccountHolderVerificationWebhookEvent = Lithic::Models::AccountHolderVerificationWebhookEvent + + AccountListParams = Lithic::Models::AccountListParams + + AccountRetrieveParams = Lithic::Models::AccountRetrieveParams + + AccountRetrieveSignalsParams = Lithic::Models::AccountRetrieveSignalsParams + + AccountRetrieveSpendLimitsParams = Lithic::Models::AccountRetrieveSpendLimitsParams + + AccountSpendLimits = Lithic::Models::AccountSpendLimits + + AccountUpdateParams = Lithic::Models::AccountUpdateParams + + Address = Lithic::Models::Address + + AddressUpdate = Lithic::Models::AddressUpdate + + APIStatus = Lithic::Models::APIStatus + + AuthRules = Lithic::Models::AuthRules + + AuthRulesBacktestReportCreatedWebhookEvent = Lithic::Models::AuthRulesBacktestReportCreatedWebhookEvent + + AuthStreamEnrollmentRetrieveSecretParams = Lithic::Models::AuthStreamEnrollmentRetrieveSecretParams + + AuthStreamEnrollmentRotateSecretParams = Lithic::Models::AuthStreamEnrollmentRotateSecretParams + + AuthStreamSecret = Lithic::Models::AuthStreamSecret + + Balance = Lithic::Models::Balance + + BalanceListParams = Lithic::Models::BalanceListParams + + BalanceUpdatedWebhookEvent = Lithic::Models::BalanceUpdatedWebhookEvent + + BookTransferCreateParams = Lithic::Models::BookTransferCreateParams + + BookTransferListParams = Lithic::Models::BookTransferListParams + + BookTransferResponse = Lithic::Models::BookTransferResponse + + BookTransferRetrieveParams = Lithic::Models::BookTransferRetrieveParams + + BookTransferRetryParams = Lithic::Models::BookTransferRetryParams + + BookTransferReverseParams = Lithic::Models::BookTransferReverseParams + + BookTransferTransactionCreatedWebhookEvent = Lithic::Models::BookTransferTransactionCreatedWebhookEvent + + BookTransferTransactionUpdatedWebhookEvent = Lithic::Models::BookTransferTransactionUpdatedWebhookEvent + + Card = Lithic::Models::Card + + CardAuthorization = Lithic::Models::CardAuthorization + + CardAuthorizationApprovalRequestWebhookEvent = + Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent + + CardAuthorizationChallengeResponseParams = Lithic::Models::CardAuthorizationChallengeResponseParams + + CardAuthorizationChallengeResponseWebhookEvent = + Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent + + CardAuthorizationChallengeWebhookEvent = Lithic::Models::CardAuthorizationChallengeWebhookEvent + + CardBulkOrder = Lithic::Models::CardBulkOrder + + CardBulkOrderCreateParams = Lithic::Models::CardBulkOrderCreateParams + + CardBulkOrderListParams = Lithic::Models::CardBulkOrderListParams + + CardBulkOrderRetrieveParams = Lithic::Models::CardBulkOrderRetrieveParams + + CardBulkOrderUpdateParams = Lithic::Models::CardBulkOrderUpdateParams + + CardConvertedWebhookEvent = Lithic::Models::CardConvertedWebhookEvent + + CardConvertPhysicalParams = Lithic::Models::CardConvertPhysicalParams + + CardCreatedWebhookEvent = Lithic::Models::CardCreatedWebhookEvent + + CardCreateParams = Lithic::Models::CardCreateParams + + CardEmbedParams = Lithic::Models::CardEmbedParams + + CardholderAuthentication = Lithic::Models::CardholderAuthentication + + CardListParams = Lithic::Models::CardListParams + + CardProgram = Lithic::Models::CardProgram + + CardProgramListParams = Lithic::Models::CardProgramListParams + + CardProgramRetrieveParams = Lithic::Models::CardProgramRetrieveParams + + CardProvisionParams = Lithic::Models::CardProvisionParams + + CardReissuedWebhookEvent = Lithic::Models::CardReissuedWebhookEvent + + CardReissueParams = Lithic::Models::CardReissueParams + + CardRenewedWebhookEvent = Lithic::Models::CardRenewedWebhookEvent + + CardRenewParams = Lithic::Models::CardRenewParams + + CardRetrieveParams = Lithic::Models::CardRetrieveParams + + CardRetrieveSignalsParams = Lithic::Models::CardRetrieveSignalsParams + + CardRetrieveSpendLimitsParams = Lithic::Models::CardRetrieveSpendLimitsParams + + Cards = Lithic::Models::Cards + + CardSearchByPanParams = Lithic::Models::CardSearchByPanParams + + CardShippedWebhookEvent = Lithic::Models::CardShippedWebhookEvent + + CardSpendLimits = Lithic::Models::CardSpendLimits + + CardTransactionEnhancedDataCreatedWebhookEvent = + Lithic::Models::CardTransactionEnhancedDataCreatedWebhookEvent + + CardTransactionEnhancedDataUpdatedWebhookEvent = + Lithic::Models::CardTransactionEnhancedDataUpdatedWebhookEvent + + CardTransactionUpdatedWebhookEvent = Lithic::Models::CardTransactionUpdatedWebhookEvent + + CardUpdatedWebhookEvent = Lithic::Models::CardUpdatedWebhookEvent + + CardUpdateParams = Lithic::Models::CardUpdateParams + + CardWebProvisionParams = Lithic::Models::CardWebProvisionParams + + Carrier = Lithic::Models::Carrier + + CategoryDetails = Lithic::Models::CategoryDetails + + ClientAPIStatusParams = Lithic::Models::ClientAPIStatusParams + + CreditProducts = Lithic::Models::CreditProducts + + Currency = Lithic::Models::Currency + + Device = Lithic::Models::Device + + DigitalCardArtAPI = Lithic::Models::DigitalCardArtAPI + + DigitalCardArtListParams = Lithic::Models::DigitalCardArtListParams + + DigitalCardArtRetrieveParams = Lithic::Models::DigitalCardArtRetrieveParams + + DigitalWalletTokenizationApprovalRequestWebhookEvent = + Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent + + DigitalWalletTokenizationResultWebhookEvent = Lithic::Models::DigitalWalletTokenizationResultWebhookEvent + + DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent = + Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent + + DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent = + Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent + + DigitalWalletTokenizationUpdatedWebhookEvent = + Lithic::Models::DigitalWalletTokenizationUpdatedWebhookEvent + + Dispute = Lithic::Models::Dispute + + DisputeCreateParams = Lithic::Models::DisputeCreateParams + + DisputeDeleteEvidenceParams = Lithic::Models::DisputeDeleteEvidenceParams + + DisputeDeleteParams = Lithic::Models::DisputeDeleteParams + + DisputeEvidence = Lithic::Models::DisputeEvidence + + DisputeEvidenceUploadFailedWebhookEvent = Lithic::Models::DisputeEvidenceUploadFailedWebhookEvent + + DisputeInitiateEvidenceUploadParams = Lithic::Models::DisputeInitiateEvidenceUploadParams + + DisputeListEvidencesParams = Lithic::Models::DisputeListEvidencesParams + + DisputeListParams = Lithic::Models::DisputeListParams + + DisputeRetrieveEvidenceParams = Lithic::Models::DisputeRetrieveEvidenceParams + + DisputeRetrieveParams = Lithic::Models::DisputeRetrieveParams + + DisputesV2ListParams = Lithic::Models::DisputesV2ListParams + + DisputesV2RetrieveParams = Lithic::Models::DisputesV2RetrieveParams + + DisputeTransactionCreatedWebhookEvent = Lithic::Models::DisputeTransactionCreatedWebhookEvent + + DisputeTransactionUpdatedWebhookEvent = Lithic::Models::DisputeTransactionUpdatedWebhookEvent + + DisputeUpdatedWebhookEvent = Lithic::Models::DisputeUpdatedWebhookEvent + + DisputeUpdateParams = Lithic::Models::DisputeUpdateParams + + DisputeV2 = Lithic::Models::DisputeV2 + + Document = Lithic::Models::Document + + Event = Lithic::Models::Event + + EventListAttemptsParams = Lithic::Models::EventListAttemptsParams + + EventListParams = Lithic::Models::EventListParams + + EventRetrieveParams = Lithic::Models::EventRetrieveParams + + Events = Lithic::Models::Events + + EventSubscription = Lithic::Models::EventSubscription + + ExternalBankAccount = Lithic::Models::ExternalBankAccount + + ExternalBankAccountAddress = Lithic::Models::ExternalBankAccountAddress + + ExternalBankAccountCreatedWebhookEvent = Lithic::Models::ExternalBankAccountCreatedWebhookEvent + + ExternalBankAccountCreateParams = Lithic::Models::ExternalBankAccountCreateParams + + ExternalBankAccountListParams = Lithic::Models::ExternalBankAccountListParams + + ExternalBankAccountPauseParams = Lithic::Models::ExternalBankAccountPauseParams + + ExternalBankAccountRetrieveParams = Lithic::Models::ExternalBankAccountRetrieveParams + + ExternalBankAccountRetryMicroDepositsParams = Lithic::Models::ExternalBankAccountRetryMicroDepositsParams + + ExternalBankAccountRetryPrenoteParams = Lithic::Models::ExternalBankAccountRetryPrenoteParams + + ExternalBankAccounts = Lithic::Models::ExternalBankAccounts + + ExternalBankAccountSetVerificationMethodParams = + Lithic::Models::ExternalBankAccountSetVerificationMethodParams + + ExternalBankAccountUnpauseParams = Lithic::Models::ExternalBankAccountUnpauseParams + + ExternalBankAccountUpdatedWebhookEvent = Lithic::Models::ExternalBankAccountUpdatedWebhookEvent + + ExternalBankAccountUpdateParams = Lithic::Models::ExternalBankAccountUpdateParams + + ExternalPayment = Lithic::Models::ExternalPayment + + ExternalPaymentCancelParams = Lithic::Models::ExternalPaymentCancelParams + + ExternalPaymentCreatedWebhookEvent = Lithic::Models::ExternalPaymentCreatedWebhookEvent + + ExternalPaymentCreateParams = Lithic::Models::ExternalPaymentCreateParams + + ExternalPaymentListParams = Lithic::Models::ExternalPaymentListParams + + ExternalPaymentReleaseParams = Lithic::Models::ExternalPaymentReleaseParams + + ExternalPaymentRetrieveParams = Lithic::Models::ExternalPaymentRetrieveParams + + ExternalPaymentReverseParams = Lithic::Models::ExternalPaymentReverseParams + + ExternalPaymentSettleParams = Lithic::Models::ExternalPaymentSettleParams + + ExternalPaymentUpdatedWebhookEvent = Lithic::Models::ExternalPaymentUpdatedWebhookEvent + + ExternalResource = Lithic::Models::ExternalResource + + ExternalResourceType = Lithic::Models::ExternalResourceType + + FinancialAccount = Lithic::Models::FinancialAccount + + FinancialAccountBalance = Lithic::Models::FinancialAccountBalance + + FinancialAccountCreatedWebhookEvent = Lithic::Models::FinancialAccountCreatedWebhookEvent + + FinancialAccountCreateParams = Lithic::Models::FinancialAccountCreateParams + + FinancialAccountListParams = Lithic::Models::FinancialAccountListParams + + FinancialAccountRegisterAccountNumberParams = Lithic::Models::FinancialAccountRegisterAccountNumberParams + + FinancialAccountRetrieveParams = Lithic::Models::FinancialAccountRetrieveParams + + FinancialAccounts = Lithic::Models::FinancialAccounts + + FinancialAccountUpdatedWebhookEvent = Lithic::Models::FinancialAccountUpdatedWebhookEvent + + FinancialAccountUpdateParams = Lithic::Models::FinancialAccountUpdateParams + + FinancialAccountUpdateStatusParams = Lithic::Models::FinancialAccountUpdateStatusParams + + FinancialEvent = Lithic::Models::FinancialEvent + + FinancialTransaction = Lithic::Models::FinancialTransaction + + Fraud = Lithic::Models::Fraud + + FundingEvent = Lithic::Models::FundingEvent + + FundingEventCreatedWebhookEvent = Lithic::Models::FundingEventCreatedWebhookEvent + + FundingEventListParams = Lithic::Models::FundingEventListParams + + FundingEventRetrieveDetailsParams = Lithic::Models::FundingEventRetrieveDetailsParams + + FundingEventRetrieveParams = Lithic::Models::FundingEventRetrieveParams + + Hold = Lithic::Models::Hold + + HoldCreateParams = Lithic::Models::HoldCreateParams + + HoldEvent = Lithic::Models::HoldEvent + + HoldListParams = Lithic::Models::HoldListParams + + HoldRetrieveParams = Lithic::Models::HoldRetrieveParams + + HoldVoidParams = Lithic::Models::HoldVoidParams + + InstanceFinancialAccountType = Lithic::Models::InstanceFinancialAccountType + + InternalTransactionAPI = Lithic::Models::InternalTransactionAPI + + InternalTransactionCreatedWebhookEvent = Lithic::Models::InternalTransactionCreatedWebhookEvent + + InternalTransactionUpdatedWebhookEvent = Lithic::Models::InternalTransactionUpdatedWebhookEvent + + KYB = Lithic::Models::KYB + + KYBBusinessEntity = Lithic::Models::KYBBusinessEntity + + KYC = Lithic::Models::KYC + + KYCExempt = Lithic::Models::KYCExempt + + LoanTapeCreatedWebhookEvent = Lithic::Models::LoanTapeCreatedWebhookEvent + + LoanTapeUpdatedWebhookEvent = Lithic::Models::LoanTapeUpdatedWebhookEvent + + ManagementOperationCreatedWebhookEvent = Lithic::Models::ManagementOperationCreatedWebhookEvent + + ManagementOperationCreateParams = Lithic::Models::ManagementOperationCreateParams + + ManagementOperationListParams = Lithic::Models::ManagementOperationListParams + + ManagementOperationRetrieveParams = Lithic::Models::ManagementOperationRetrieveParams + + ManagementOperationReverseParams = Lithic::Models::ManagementOperationReverseParams + + ManagementOperationTransaction = Lithic::Models::ManagementOperationTransaction + + ManagementOperationUpdatedWebhookEvent = Lithic::Models::ManagementOperationUpdatedWebhookEvent + + Merchant = Lithic::Models::Merchant + + MessageAttempt = Lithic::Models::MessageAttempt + + NetworkProgram = Lithic::Models::NetworkProgram + + NetworkProgramListParams = Lithic::Models::NetworkProgramListParams + + NetworkProgramRetrieveParams = Lithic::Models::NetworkProgramRetrieveParams + + NetworkTotal = Lithic::Models::NetworkTotal + + NetworkTotalCreatedWebhookEvent = Lithic::Models::NetworkTotalCreatedWebhookEvent + + NetworkTotalUpdatedWebhookEvent = Lithic::Models::NetworkTotalUpdatedWebhookEvent + + NonPCICard = Lithic::Models::NonPCICard + + OwnerType = Lithic::Models::OwnerType + + ParsedWebhookEvent = Lithic::Models::ParsedWebhookEvent + + Payment = Lithic::Models::Payment + + PaymentCreateParams = Lithic::Models::PaymentCreateParams + + PaymentListParams = Lithic::Models::PaymentListParams + + PaymentRetrieveParams = Lithic::Models::PaymentRetrieveParams + + PaymentRetryParams = Lithic::Models::PaymentRetryParams + + PaymentReturnParams = Lithic::Models::PaymentReturnParams + + PaymentSimulateActionParams = Lithic::Models::PaymentSimulateActionParams + + PaymentSimulateReceiptParams = Lithic::Models::PaymentSimulateReceiptParams + + PaymentSimulateReleaseParams = Lithic::Models::PaymentSimulateReleaseParams + + PaymentSimulateReturnParams = Lithic::Models::PaymentSimulateReturnParams + + PaymentTransactionCreatedWebhookEvent = Lithic::Models::PaymentTransactionCreatedWebhookEvent + + PaymentTransactionUpdatedWebhookEvent = Lithic::Models::PaymentTransactionUpdatedWebhookEvent + + ProvisionResponse = Lithic::Models::ProvisionResponse + + Reports = Lithic::Models::Reports + + RequiredDocument = Lithic::Models::RequiredDocument + + ResponderEndpointCheckStatusParams = Lithic::Models::ResponderEndpointCheckStatusParams + + ResponderEndpointCreateParams = Lithic::Models::ResponderEndpointCreateParams + + ResponderEndpointDeleteParams = Lithic::Models::ResponderEndpointDeleteParams + + ResponderEndpointStatus = Lithic::Models::ResponderEndpointStatus + + SettlementDetail = Lithic::Models::SettlementDetail + + SettlementReport = Lithic::Models::SettlementReport + + SettlementReportUpdatedWebhookEvent = Lithic::Models::SettlementReportUpdatedWebhookEvent + + SettlementSummaryDetails = Lithic::Models::SettlementSummaryDetails + + ShippingAddress = Lithic::Models::ShippingAddress + + SignalsResponse = Lithic::Models::SignalsResponse + + SpendLimitDuration = Lithic::Models::SpendLimitDuration + + StatementsCreatedWebhookEvent = Lithic::Models::StatementsCreatedWebhookEvent + + StatementTotals = Lithic::Models::StatementTotals + + ThreeDS = Lithic::Models::ThreeDS + + ThreeDSAuthentication = Lithic::Models::ThreeDSAuthentication + + ThreeDSAuthenticationApprovalRequestWebhookEvent = + Lithic::Models::ThreeDSAuthenticationApprovalRequestWebhookEvent + + ThreeDSAuthenticationChallengeWebhookEvent = Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent + + ThreeDSAuthenticationCreatedWebhookEvent = Lithic::Models::ThreeDSAuthenticationCreatedWebhookEvent + + ThreeDSAuthenticationUpdatedWebhookEvent = Lithic::Models::ThreeDSAuthenticationUpdatedWebhookEvent + + TokenInfo = Lithic::Models::TokenInfo + + Tokenization = Lithic::Models::Tokenization + + TokenizationActivateParams = Lithic::Models::TokenizationActivateParams + + TokenizationApprovalRequestWebhookEvent = Lithic::Models::TokenizationApprovalRequestWebhookEvent + + TokenizationDeactivateParams = Lithic::Models::TokenizationDeactivateParams + + TokenizationDecisioningRetrieveSecretParams = Lithic::Models::TokenizationDecisioningRetrieveSecretParams + + TokenizationDecisioningRotateSecretParams = Lithic::Models::TokenizationDecisioningRotateSecretParams + + TokenizationDeclineReason = Lithic::Models::TokenizationDeclineReason + + TokenizationListParams = Lithic::Models::TokenizationListParams + + TokenizationPauseParams = Lithic::Models::TokenizationPauseParams + + TokenizationResendActivationCodeParams = Lithic::Models::TokenizationResendActivationCodeParams + + TokenizationResultWebhookEvent = Lithic::Models::TokenizationResultWebhookEvent + + TokenizationRetrieveParams = Lithic::Models::TokenizationRetrieveParams + + TokenizationRuleResult = Lithic::Models::TokenizationRuleResult + + TokenizationSecret = Lithic::Models::TokenizationSecret + + TokenizationSimulateParams = Lithic::Models::TokenizationSimulateParams + + TokenizationTfaReason = Lithic::Models::TokenizationTfaReason + + TokenizationTwoFactorAuthenticationCodeSentWebhookEvent = + Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent + + TokenizationTwoFactorAuthenticationCodeWebhookEvent = + Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent + + TokenizationUnpauseParams = Lithic::Models::TokenizationUnpauseParams + + TokenizationUpdateDigitalCardArtParams = Lithic::Models::TokenizationUpdateDigitalCardArtParams + + TokenizationUpdatedWebhookEvent = Lithic::Models::TokenizationUpdatedWebhookEvent + + TokenMetadata = Lithic::Models::TokenMetadata + + Transaction = Lithic::Models::Transaction + + TransactionExpireAuthorizationParams = Lithic::Models::TransactionExpireAuthorizationParams + + TransactionListParams = Lithic::Models::TransactionListParams + + TransactionMonitoring = Lithic::Models::TransactionMonitoring + + TransactionRetrieveParams = Lithic::Models::TransactionRetrieveParams + + TransactionRouteParams = Lithic::Models::TransactionRouteParams + + Transactions = Lithic::Models::Transactions + + TransactionSimulateAuthorizationAdviceParams = + Lithic::Models::TransactionSimulateAuthorizationAdviceParams + + TransactionSimulateAuthorizationParams = Lithic::Models::TransactionSimulateAuthorizationParams + + TransactionSimulateClearingParams = Lithic::Models::TransactionSimulateClearingParams + + TransactionSimulateCreditAuthorizationAdviceParams = + Lithic::Models::TransactionSimulateCreditAuthorizationAdviceParams + + TransactionSimulateReturnParams = Lithic::Models::TransactionSimulateReturnParams + + TransactionSimulateReturnReversalParams = Lithic::Models::TransactionSimulateReturnReversalParams + + TransactionSimulateVoidParams = Lithic::Models::TransactionSimulateVoidParams + + Transfer = Lithic::Models::Transfer + + TransferCreateParams = Lithic::Models::TransferCreateParams + + TransferLimitListParams = Lithic::Models::TransferLimitListParams + + TransferLimitsResponse = Lithic::Models::TransferLimitsResponse + + VerificationMethod = Lithic::Models::VerificationMethod + + WalletDecisioningInfo = Lithic::Models::WalletDecisioningInfo + + WebhookParsedParams = Lithic::Models::WebhookParsedParams + + WirePartyDetails = Lithic::Models::WirePartyDetails +end diff --git a/lib/lithic/models/account.rb b/lib/lithic/models/account.rb new file mode 100644 index 00000000..1e118c7e --- /dev/null +++ b/lib/lithic/models/account.rb @@ -0,0 +1,342 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Accounts#retrieve + class Account < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for the account. This is the same as the + # account_token returned by the enroll endpoint. If using this parameter, do not + # include pagination. + # + # @return [String] + required :token, String + + # @!attribute created + # Timestamp of when the account was created. + # + # @return [Time, nil] + required :created, Time, nil?: true + + # @!attribute spend_limit + # Spend limit information for the user containing the daily, monthly, and lifetime + # spend limit of the account. Any charges to a card owned by this account will be + # declined once their transaction volume has surpassed the value in the applicable + # time limit (rolling). A lifetime limit of 0 indicates that the lifetime limit + # feature is disabled. + # + # @return [Lithic::Models::Account::SpendLimit] + required :spend_limit, -> { Lithic::Account::SpendLimit } + + # @!attribute state + # Account state: + # + # - `ACTIVE` - Account is able to transact and create new cards. + # - `PAUSED` - Account will not be able to transact or create new cards. It can be + # set back to `ACTIVE`. + # - `CLOSED` - Account will not be able to transact or create new cards. `CLOSED` + # accounts are unable to be transitioned to `ACTIVE` or `PAUSED` states. + # Accounts can be manually set to `CLOSED`, or this can be done by Lithic due to + # failure to pass KYB/KYC or for risk/compliance reasons. Please contact + # [support.lithic.com](https://support.lithic.com/) if you believe this was done + # by mistake. + # + # @return [Symbol, Lithic::Models::Account::State] + required :state, enum: -> { Lithic::Account::State } + + # @!attribute account_holder + # + # @return [Lithic::Models::Account::AccountHolder, nil] + optional :account_holder, -> { Lithic::Account::AccountHolder } + + # @!attribute auth_rule_tokens + # @deprecated + # + # List of identifiers for the Auth Rule(s) that are applied on the account. This + # field is deprecated and will no longer be populated in the `account_holder` + # object. The key will be removed from the schema in a future release. Use the + # `/auth_rules` endpoints to fetch Auth Rule information instead. + # + # @return [Array, nil] + optional :auth_rule_tokens, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute cardholder_currency + # 3-character alphabetic ISO 4217 code for the currency of the cardholder. + # + # @return [String, nil] + optional :cardholder_currency, String + + # @!attribute comment + # Additional context or information related to the account. + # + # @return [String, nil] + optional :comment, String + + # @!attribute substatus + # Account state substatus values: + # + # - `FRAUD_IDENTIFIED` - The account has been recognized as being created or used + # with stolen or fabricated identity information, encompassing both true + # identity theft and synthetic identities. + # - `SUSPICIOUS_ACTIVITY` - The account has exhibited suspicious behavior, such as + # unauthorized access or fraudulent transactions, necessitating further + # investigation. + # - `RISK_VIOLATION` - The account has been involved in deliberate misuse by the + # legitimate account holder. Examples include disputing valid transactions + # without cause, falsely claiming non-receipt of goods, or engaging in + # intentional bust-out schemes to exploit account services. + # - `END_USER_REQUEST` - The account holder has voluntarily requested the closure + # of the account for personal reasons. This encompasses situations such as + # bankruptcy, other financial considerations, or the account holder's death. + # - `ISSUER_REQUEST` - The issuer has initiated the closure of the account due to + # business strategy, risk management, inactivity, product changes, regulatory + # concerns, or violations of terms and conditions. + # - `NOT_ACTIVE` - The account has not had any transactions or payment activity + # within a specified period. This status applies to accounts that are paused or + # closed due to inactivity. + # - `INTERNAL_REVIEW` - The account is temporarily paused pending further internal + # review. In future implementations, this status may prevent clients from + # activating the account via APIs until the review is completed. + # - `OTHER` - The reason for the account's current status does not fall into any + # of the above categories. A comment should be provided to specify the + # particular reason. + # + # @return [Symbol, Lithic::Models::Account::Substatus, nil] + optional :substatus, enum: -> { Lithic::Account::Substatus }, nil?: true + + # @!attribute verification_address + # @deprecated + # + # @return [Lithic::Models::Account::VerificationAddress, nil] + optional :verification_address, -> { Lithic::Account::VerificationAddress } + + # @!method initialize(token:, created:, spend_limit:, state:, account_holder: nil, auth_rule_tokens: nil, cardholder_currency: nil, comment: nil, substatus: nil, verification_address: nil) + # Some parameter documentations has been truncated, see {Lithic::Models::Account} + # for more details. + # + # @param token [String] Globally unique identifier for the account. This is the same as the account_toke + # + # @param created [Time, nil] Timestamp of when the account was created. + # + # @param spend_limit [Lithic::Models::Account::SpendLimit] Spend limit information for the user containing the daily, monthly, and lifetime + # + # @param state [Symbol, Lithic::Models::Account::State] Account state: + # + # @param account_holder [Lithic::Models::Account::AccountHolder] + # + # @param auth_rule_tokens [Array] List of identifiers for the Auth Rule(s) that are applied on the account. + # + # @param cardholder_currency [String] 3-character alphabetic ISO 4217 code for the currency of the cardholder. + # + # @param comment [String] Additional context or information related to the account. + # + # @param substatus [Symbol, Lithic::Models::Account::Substatus, nil] Account state substatus values: + # + # @param verification_address [Lithic::Models::Account::VerificationAddress] + + # @see Lithic::Models::Account#spend_limit + class SpendLimit < Lithic::Internal::Type::BaseModel + # @!attribute daily + # Daily spend limit (in cents). + # + # @return [Integer] + required :daily, Integer + + # @!attribute lifetime + # Total spend limit over account lifetime (in cents). + # + # @return [Integer] + required :lifetime, Integer + + # @!attribute monthly + # Monthly spend limit (in cents). + # + # @return [Integer] + required :monthly, Integer + + # @!method initialize(daily:, lifetime:, monthly:) + # Spend limit information for the user containing the daily, monthly, and lifetime + # spend limit of the account. Any charges to a card owned by this account will be + # declined once their transaction volume has surpassed the value in the applicable + # time limit (rolling). A lifetime limit of 0 indicates that the lifetime limit + # feature is disabled. + # + # @param daily [Integer] Daily spend limit (in cents). + # + # @param lifetime [Integer] Total spend limit over account lifetime (in cents). + # + # @param monthly [Integer] Monthly spend limit (in cents). + end + + # Account state: + # + # - `ACTIVE` - Account is able to transact and create new cards. + # - `PAUSED` - Account will not be able to transact or create new cards. It can be + # set back to `ACTIVE`. + # - `CLOSED` - Account will not be able to transact or create new cards. `CLOSED` + # accounts are unable to be transitioned to `ACTIVE` or `PAUSED` states. + # Accounts can be manually set to `CLOSED`, or this can be done by Lithic due to + # failure to pass KYB/KYC or for risk/compliance reasons. Please contact + # [support.lithic.com](https://support.lithic.com/) if you believe this was done + # by mistake. + # + # @see Lithic::Models::Account#state + module State + extend Lithic::Internal::Type::Enum + + ACTIVE = :ACTIVE + PAUSED = :PAUSED + CLOSED = :CLOSED + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::Account#account_holder + class AccountHolder < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for the account holder. + # + # @return [String] + required :token, String + + # @!attribute business_account_token + # Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # users of businesses. Account_token of the enrolled business associated with an + # enrolled AUTHORIZED_USER individual. + # + # @return [String] + required :business_account_token, String + + # @!attribute email + # Email address. + # + # @return [String] + required :email, String + + # @!attribute phone_number + # Phone number of the individual. + # + # @return [String] + required :phone_number, String + + # @!method initialize(token:, business_account_token:, email:, phone_number:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Account::AccountHolder} for more details. + # + # @param token [String] Globally unique identifier for the account holder. + # + # @param business_account_token [String] Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # + # @param email [String] Email address. + # + # @param phone_number [String] Phone number of the individual. + end + + # Account state substatus values: + # + # - `FRAUD_IDENTIFIED` - The account has been recognized as being created or used + # with stolen or fabricated identity information, encompassing both true + # identity theft and synthetic identities. + # - `SUSPICIOUS_ACTIVITY` - The account has exhibited suspicious behavior, such as + # unauthorized access or fraudulent transactions, necessitating further + # investigation. + # - `RISK_VIOLATION` - The account has been involved in deliberate misuse by the + # legitimate account holder. Examples include disputing valid transactions + # without cause, falsely claiming non-receipt of goods, or engaging in + # intentional bust-out schemes to exploit account services. + # - `END_USER_REQUEST` - The account holder has voluntarily requested the closure + # of the account for personal reasons. This encompasses situations such as + # bankruptcy, other financial considerations, or the account holder's death. + # - `ISSUER_REQUEST` - The issuer has initiated the closure of the account due to + # business strategy, risk management, inactivity, product changes, regulatory + # concerns, or violations of terms and conditions. + # - `NOT_ACTIVE` - The account has not had any transactions or payment activity + # within a specified period. This status applies to accounts that are paused or + # closed due to inactivity. + # - `INTERNAL_REVIEW` - The account is temporarily paused pending further internal + # review. In future implementations, this status may prevent clients from + # activating the account via APIs until the review is completed. + # - `OTHER` - The reason for the account's current status does not fall into any + # of the above categories. A comment should be provided to specify the + # particular reason. + # + # @see Lithic::Models::Account#substatus + module Substatus + extend Lithic::Internal::Type::Enum + + FRAUD_IDENTIFIED = :FRAUD_IDENTIFIED + SUSPICIOUS_ACTIVITY = :SUSPICIOUS_ACTIVITY + RISK_VIOLATION = :RISK_VIOLATION + END_USER_REQUEST = :END_USER_REQUEST + ISSUER_REQUEST = :ISSUER_REQUEST + NOT_ACTIVE = :NOT_ACTIVE + INTERNAL_REVIEW = :INTERNAL_REVIEW + OTHER = :OTHER + + # @!method self.values + # @return [Array] + end + + # @deprecated + # + # @see Lithic::Models::Account#verification_address + class VerificationAddress < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # City name. + # + # @return [String] + required :city, String + + # @!attribute country + # Country name. Only USA is currently supported. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA postal codes (ZIP codes) are currently supported, + # entered as a five-digit postal code or nine-digit postal code (ZIP+4) using the + # format 12345-1234. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!method initialize(address1:, city:, country:, postal_code:, state:, address2: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Account::VerificationAddress} for more details. + # + # @param address1 [String] Valid deliverable address (no PO boxes). + # + # @param city [String] City name. + # + # @param country [String] Country name. Only USA is currently supported. + # + # @param postal_code [String] Valid postal code. Only USA postal codes (ZIP codes) are currently supported, en + # + # @param state [String] Valid state code. Only USA state codes are currently supported, entered in upper + # + # @param address2 [String] Unit or apartment number (if applicable). + end + end + end +end diff --git a/lib/lithic/models/account_activity_list_params.rb b/lib/lithic/models/account_activity_list_params.rb new file mode 100644 index 00000000..266e2537 --- /dev/null +++ b/lib/lithic/models/account_activity_list_params.rb @@ -0,0 +1,167 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::AccountActivity#list + class AccountActivityListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute account_token + # Filter by account token + # + # @return [String, nil] + optional :account_token, String + + # @!attribute begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time + + # @!attribute business_account_token + # Filter by business account token + # + # @return [String, nil] + optional :business_account_token, String + + # @!attribute category + # Filter by transaction category + # + # @return [Symbol, Lithic::Models::AccountActivityListParams::Category, nil] + optional :category, enum: -> { Lithic::AccountActivityListParams::Category } + + # @!attribute end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute financial_account_token + # Filter by financial account token + # + # @return [String, nil] + optional :financial_account_token, String + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute result + # Filter by transaction result + # + # @return [Symbol, Lithic::Models::AccountActivityListParams::Result, nil] + optional :result, enum: -> { Lithic::AccountActivityListParams::Result } + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!attribute status + # Filter by transaction status + # + # @return [Symbol, Lithic::Models::AccountActivityListParams::Status, nil] + optional :status, enum: -> { Lithic::AccountActivityListParams::Status } + + # @!method initialize(account_token: nil, begin_: nil, business_account_token: nil, category: nil, end_: nil, ending_before: nil, financial_account_token: nil, page_size: nil, result: nil, starting_after: nil, status: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountActivityListParams} for more details. + # + # @param account_token [String] Filter by account token + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param business_account_token [String] Filter by business account token + # + # @param category [Symbol, Lithic::Models::AccountActivityListParams::Category] Filter by transaction category + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param financial_account_token [String] Filter by financial account token + # + # @param page_size [Integer] Page size (for pagination). + # + # @param result [Symbol, Lithic::Models::AccountActivityListParams::Result] Filter by transaction result + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param status [Symbol, Lithic::Models::AccountActivityListParams::Status] Filter by transaction status + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Filter by transaction category + module Category + extend Lithic::Internal::Type::Enum + + ACH = :ACH + WIRE = :WIRE + BALANCE_OR_FUNDING = :BALANCE_OR_FUNDING + FEE = :FEE + REWARD = :REWARD + ADJUSTMENT = :ADJUSTMENT + DERECOGNITION = :DERECOGNITION + DISPUTE = :DISPUTE + CARD = :CARD + EXTERNAL_ACH = :EXTERNAL_ACH + EXTERNAL_CHECK = :EXTERNAL_CHECK + EXTERNAL_FEDNOW = :EXTERNAL_FEDNOW + EXTERNAL_RTP = :EXTERNAL_RTP + EXTERNAL_TRANSFER = :EXTERNAL_TRANSFER + EXTERNAL_WIRE = :EXTERNAL_WIRE + MANAGEMENT_ADJUSTMENT = :MANAGEMENT_ADJUSTMENT + MANAGEMENT_DISPUTE = :MANAGEMENT_DISPUTE + MANAGEMENT_FEE = :MANAGEMENT_FEE + MANAGEMENT_REWARD = :MANAGEMENT_REWARD + MANAGEMENT_DISBURSEMENT = :MANAGEMENT_DISBURSEMENT + HOLD = :HOLD + PROGRAM_FUNDING = :PROGRAM_FUNDING + + # @!method self.values + # @return [Array] + end + + # Filter by transaction result + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + + # Filter by transaction status + module Status + extend Lithic::Internal::Type::Enum + + DECLINED = :DECLINED + EXPIRED = :EXPIRED + PENDING = :PENDING + RETURNED = :RETURNED + REVERSED = :REVERSED + SETTLED = :SETTLED + VOIDED = :VOIDED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/account_activity_list_response.rb b/lib/lithic/models/account_activity_list_response.rb new file mode 100644 index 00000000..b78f1541 --- /dev/null +++ b/lib/lithic/models/account_activity_list_response.rb @@ -0,0 +1,273 @@ +# frozen_string_literal: true + +module Lithic + module Models + # Response containing multiple transaction types. The `family` field determines + # which transaction type is returned: INTERNAL returns FinancialTransaction, + # TRANSFER returns BookTransferTransaction, CARD returns CardTransaction, PAYMENT + # returns PaymentTransaction, EXTERNAL_PAYMENT returns ExternalPaymentResponse, + # MANAGEMENT_OPERATION returns ManagementOperationTransaction, and HOLD returns + # HoldTransaction + # + # @see Lithic::Resources::AccountActivity#list + module AccountActivityListResponse + extend Lithic::Internal::Type::Union + + discriminator :family + + # Financial transaction with inheritance from unified base transaction + variant :INTERNAL, -> { Lithic::Models::AccountActivityListResponse::Internal } + + # Book transfer transaction + variant :TRANSFER, -> { Lithic::BookTransferResponse } + + # Card transaction with ledger base properties + variant :CARD, -> { Lithic::Models::AccountActivityListResponse::Card } + + # Payment transaction + variant :PAYMENT, -> { Lithic::Payment } + + variant :EXTERNAL_PAYMENT, -> { Lithic::ExternalPayment } + + variant :MANAGEMENT_OPERATION, -> { Lithic::ManagementOperationTransaction } + + # A hold transaction representing reserved funds on a financial account. Holds move funds from available to pending balance in anticipation of future payments. They can be resolved via settlement (linked to payment), manual release, or expiration. + variant :HOLD, -> { Lithic::Hold } + + class Internal < Lithic::Internal::Type::BaseModel + # @!attribute token + # Unique identifier for the transaction + # + # @return [String] + required :token, String + + # @!attribute category + # Transaction category + # + # @return [Symbol, Lithic::Models::AccountActivityListResponse::Internal::Category] + required :category, enum: -> { Lithic::Models::AccountActivityListResponse::Internal::Category } + + # @!attribute created + # ISO 8601 timestamp of when the transaction was created + # + # @return [Time] + required :created, Time + + # @!attribute currency + # Currency of the transaction, represented in ISO 4217 format + # + # @return [String] + required :currency, String + + # @!attribute descriptor + # Transaction descriptor + # + # @return [String] + required :descriptor, String + + # @!attribute events + # List of transaction events + # + # @return [Array] + required :events, -> { Lithic::Internal::Type::ArrayOf[Lithic::FinancialEvent] } + + # @!attribute family + # INTERNAL - Financial Transaction + # + # @return [Symbol, :INTERNAL] + required :family, const: :INTERNAL + + # @!attribute financial_account_token + # Financial account token associated with the transaction + # + # @return [String] + required :financial_account_token, String + + # @!attribute pending_amount + # Pending amount in cents + # + # @return [Integer] + required :pending_amount, Integer + + # @!attribute result + # Transaction result + # + # @return [Symbol, Lithic::Models::AccountActivityListResponse::Internal::Result] + required :result, enum: -> { Lithic::Models::AccountActivityListResponse::Internal::Result } + + # @!attribute settled_amount + # Settled amount in cents + # + # @return [Integer] + required :settled_amount, Integer + + # @!attribute status + # The status of the transaction + # + # @return [Symbol, Lithic::Models::AccountActivityListResponse::Internal::Status] + required :status, enum: -> { Lithic::Models::AccountActivityListResponse::Internal::Status } + + # @!attribute updated + # ISO 8601 timestamp of when the transaction was last updated + # + # @return [Time] + required :updated, Time + + # @!method initialize(token:, category:, created:, currency:, descriptor:, events:, financial_account_token:, pending_amount:, result:, settled_amount:, status:, updated:, family: :INTERNAL) + # Financial transaction with inheritance from unified base transaction + # + # @param token [String] Unique identifier for the transaction + # + # @param category [Symbol, Lithic::Models::AccountActivityListResponse::Internal::Category] Transaction category + # + # @param created [Time] ISO 8601 timestamp of when the transaction was created + # + # @param currency [String] Currency of the transaction, represented in ISO 4217 format + # + # @param descriptor [String] Transaction descriptor + # + # @param events [Array] List of transaction events + # + # @param financial_account_token [String] Financial account token associated with the transaction + # + # @param pending_amount [Integer] Pending amount in cents + # + # @param result [Symbol, Lithic::Models::AccountActivityListResponse::Internal::Result] Transaction result + # + # @param settled_amount [Integer] Settled amount in cents + # + # @param status [Symbol, Lithic::Models::AccountActivityListResponse::Internal::Status] The status of the transaction + # + # @param updated [Time] ISO 8601 timestamp of when the transaction was last updated + # + # @param family [Symbol, :INTERNAL] INTERNAL - Financial Transaction + + # Transaction category + # + # @see Lithic::Models::AccountActivityListResponse::Internal#category + module Category + extend Lithic::Internal::Type::Enum + + ACH = :ACH + WIRE = :WIRE + BALANCE_OR_FUNDING = :BALANCE_OR_FUNDING + FEE = :FEE + REWARD = :REWARD + ADJUSTMENT = :ADJUSTMENT + DERECOGNITION = :DERECOGNITION + DISPUTE = :DISPUTE + CARD = :CARD + EXTERNAL_ACH = :EXTERNAL_ACH + EXTERNAL_CHECK = :EXTERNAL_CHECK + EXTERNAL_FEDNOW = :EXTERNAL_FEDNOW + EXTERNAL_RTP = :EXTERNAL_RTP + EXTERNAL_TRANSFER = :EXTERNAL_TRANSFER + EXTERNAL_WIRE = :EXTERNAL_WIRE + MANAGEMENT_ADJUSTMENT = :MANAGEMENT_ADJUSTMENT + MANAGEMENT_DISPUTE = :MANAGEMENT_DISPUTE + MANAGEMENT_FEE = :MANAGEMENT_FEE + MANAGEMENT_REWARD = :MANAGEMENT_REWARD + MANAGEMENT_DISBURSEMENT = :MANAGEMENT_DISBURSEMENT + HOLD = :HOLD + PROGRAM_FUNDING = :PROGRAM_FUNDING + + # @!method self.values + # @return [Array] + end + + # Transaction result + # + # @see Lithic::Models::AccountActivityListResponse::Internal#result + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + + # The status of the transaction + # + # @see Lithic::Models::AccountActivityListResponse::Internal#status + module Status + extend Lithic::Internal::Type::Enum + + PENDING = :PENDING + SETTLED = :SETTLED + DECLINED = :DECLINED + REVERSED = :REVERSED + CANCELED = :CANCELED + RETURNED = :RETURNED + + # @!method self.values + # @return [Array] + end + end + + class Card < Lithic::Models::Transaction + # @!attribute token + # Unique identifier for the transaction + # + # @return [String] + required :token, String + + # @!attribute created + # ISO 8601 timestamp of when the transaction was created + # + # @return [Time] + required :created, Time + + # @!attribute family + # CARD - Card Transaction + # + # @return [Symbol, :CARD] + required :family, const: :CARD + + # @!attribute status + # The status of the transaction + # + # @return [Symbol, Lithic::Models::AccountActivityListResponse::Card::Status] + required :status, enum: -> { Lithic::Models::AccountActivityListResponse::Card::Status } + + # @!attribute updated + # ISO 8601 timestamp of when the transaction was last updated + # + # @return [Time] + required :updated, Time + + # @!method initialize(token:, created:, status:, updated:, family: :CARD) + # Card transaction with ledger base properties + # + # @param token [String] Unique identifier for the transaction + # + # @param created [Time] ISO 8601 timestamp of when the transaction was created + # + # @param status [Symbol, Lithic::Models::AccountActivityListResponse::Card::Status] The status of the transaction + # + # @param updated [Time] ISO 8601 timestamp of when the transaction was last updated + # + # @param family [Symbol, :CARD] CARD - Card Transaction + + # The status of the transaction + module Status + extend Lithic::Internal::Type::Enum + + PENDING = :PENDING + SETTLED = :SETTLED + DECLINED = :DECLINED + REVERSED = :REVERSED + CANCELED = :CANCELED + RETURNED = :RETURNED + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(Lithic::Models::AccountActivityListResponse::Internal, Lithic::Models::BookTransferResponse, Lithic::Models::AccountActivityListResponse::Card, Lithic::Models::Payment, Lithic::Models::ExternalPayment, Lithic::Models::ManagementOperationTransaction, Lithic::Models::Hold)] + end + end +end diff --git a/lib/lithic/models/account_activity_retrieve_transaction_params.rb b/lib/lithic/models/account_activity_retrieve_transaction_params.rb new file mode 100644 index 00000000..48b53772 --- /dev/null +++ b/lib/lithic/models/account_activity_retrieve_transaction_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::AccountActivity#retrieve_transaction + class AccountActivityRetrieveTransactionParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute transaction_token + # + # @return [String] + required :transaction_token, String + + # @!method initialize(transaction_token:, request_options: {}) + # @param transaction_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/account_activity_retrieve_transaction_response.rb b/lib/lithic/models/account_activity_retrieve_transaction_response.rb new file mode 100644 index 00000000..3ce6d9cd --- /dev/null +++ b/lib/lithic/models/account_activity_retrieve_transaction_response.rb @@ -0,0 +1,276 @@ +# frozen_string_literal: true + +module Lithic + module Models + # Response containing multiple transaction types. The `family` field determines + # which transaction type is returned: INTERNAL returns FinancialTransaction, + # TRANSFER returns BookTransferTransaction, CARD returns CardTransaction, PAYMENT + # returns PaymentTransaction, EXTERNAL_PAYMENT returns ExternalPaymentResponse, + # MANAGEMENT_OPERATION returns ManagementOperationTransaction, and HOLD returns + # HoldTransaction + # + # @see Lithic::Resources::AccountActivity#retrieve_transaction + module AccountActivityRetrieveTransactionResponse + extend Lithic::Internal::Type::Union + + discriminator :family + + # Financial transaction with inheritance from unified base transaction + variant :INTERNAL, -> { Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal } + + # Book transfer transaction + variant :TRANSFER, -> { Lithic::BookTransferResponse } + + # Card transaction with ledger base properties + variant :CARD, -> { Lithic::Models::AccountActivityRetrieveTransactionResponse::Card } + + # Payment transaction + variant :PAYMENT, -> { Lithic::Payment } + + variant :EXTERNAL_PAYMENT, -> { Lithic::ExternalPayment } + + variant :MANAGEMENT_OPERATION, -> { Lithic::ManagementOperationTransaction } + + # A hold transaction representing reserved funds on a financial account. Holds move funds from available to pending balance in anticipation of future payments. They can be resolved via settlement (linked to payment), manual release, or expiration. + variant :HOLD, -> { Lithic::Hold } + + class Internal < Lithic::Internal::Type::BaseModel + # @!attribute token + # Unique identifier for the transaction + # + # @return [String] + required :token, String + + # @!attribute category + # Transaction category + # + # @return [Symbol, Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category] + required :category, + enum: -> { Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category } + + # @!attribute created + # ISO 8601 timestamp of when the transaction was created + # + # @return [Time] + required :created, Time + + # @!attribute currency + # Currency of the transaction, represented in ISO 4217 format + # + # @return [String] + required :currency, String + + # @!attribute descriptor + # Transaction descriptor + # + # @return [String] + required :descriptor, String + + # @!attribute events + # List of transaction events + # + # @return [Array] + required :events, -> { Lithic::Internal::Type::ArrayOf[Lithic::FinancialEvent] } + + # @!attribute family + # INTERNAL - Financial Transaction + # + # @return [Symbol, :INTERNAL] + required :family, const: :INTERNAL + + # @!attribute financial_account_token + # Financial account token associated with the transaction + # + # @return [String] + required :financial_account_token, String + + # @!attribute pending_amount + # Pending amount in cents + # + # @return [Integer] + required :pending_amount, Integer + + # @!attribute result + # Transaction result + # + # @return [Symbol, Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Result] + required :result, + enum: -> { Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Result } + + # @!attribute settled_amount + # Settled amount in cents + # + # @return [Integer] + required :settled_amount, Integer + + # @!attribute status + # The status of the transaction + # + # @return [Symbol, Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Status] + required :status, + enum: -> { Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Status } + + # @!attribute updated + # ISO 8601 timestamp of when the transaction was last updated + # + # @return [Time] + required :updated, Time + + # @!method initialize(token:, category:, created:, currency:, descriptor:, events:, financial_account_token:, pending_amount:, result:, settled_amount:, status:, updated:, family: :INTERNAL) + # Financial transaction with inheritance from unified base transaction + # + # @param token [String] Unique identifier for the transaction + # + # @param category [Symbol, Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category] Transaction category + # + # @param created [Time] ISO 8601 timestamp of when the transaction was created + # + # @param currency [String] Currency of the transaction, represented in ISO 4217 format + # + # @param descriptor [String] Transaction descriptor + # + # @param events [Array] List of transaction events + # + # @param financial_account_token [String] Financial account token associated with the transaction + # + # @param pending_amount [Integer] Pending amount in cents + # + # @param result [Symbol, Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Result] Transaction result + # + # @param settled_amount [Integer] Settled amount in cents + # + # @param status [Symbol, Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Status] The status of the transaction + # + # @param updated [Time] ISO 8601 timestamp of when the transaction was last updated + # + # @param family [Symbol, :INTERNAL] INTERNAL - Financial Transaction + + # Transaction category + # + # @see Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal#category + module Category + extend Lithic::Internal::Type::Enum + + ACH = :ACH + WIRE = :WIRE + BALANCE_OR_FUNDING = :BALANCE_OR_FUNDING + FEE = :FEE + REWARD = :REWARD + ADJUSTMENT = :ADJUSTMENT + DERECOGNITION = :DERECOGNITION + DISPUTE = :DISPUTE + CARD = :CARD + EXTERNAL_ACH = :EXTERNAL_ACH + EXTERNAL_CHECK = :EXTERNAL_CHECK + EXTERNAL_FEDNOW = :EXTERNAL_FEDNOW + EXTERNAL_RTP = :EXTERNAL_RTP + EXTERNAL_TRANSFER = :EXTERNAL_TRANSFER + EXTERNAL_WIRE = :EXTERNAL_WIRE + MANAGEMENT_ADJUSTMENT = :MANAGEMENT_ADJUSTMENT + MANAGEMENT_DISPUTE = :MANAGEMENT_DISPUTE + MANAGEMENT_FEE = :MANAGEMENT_FEE + MANAGEMENT_REWARD = :MANAGEMENT_REWARD + MANAGEMENT_DISBURSEMENT = :MANAGEMENT_DISBURSEMENT + HOLD = :HOLD + PROGRAM_FUNDING = :PROGRAM_FUNDING + + # @!method self.values + # @return [Array] + end + + # Transaction result + # + # @see Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal#result + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + + # The status of the transaction + # + # @see Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal#status + module Status + extend Lithic::Internal::Type::Enum + + PENDING = :PENDING + SETTLED = :SETTLED + DECLINED = :DECLINED + REVERSED = :REVERSED + CANCELED = :CANCELED + RETURNED = :RETURNED + + # @!method self.values + # @return [Array] + end + end + + class Card < Lithic::Models::Transaction + # @!attribute token + # Unique identifier for the transaction + # + # @return [String] + required :token, String + + # @!attribute created + # ISO 8601 timestamp of when the transaction was created + # + # @return [Time] + required :created, Time + + # @!attribute family + # CARD - Card Transaction + # + # @return [Symbol, :CARD] + required :family, const: :CARD + + # @!attribute status + # The status of the transaction + # + # @return [Symbol, Lithic::Models::AccountActivityRetrieveTransactionResponse::Card::Status] + required :status, enum: -> { Lithic::Models::AccountActivityRetrieveTransactionResponse::Card::Status } + + # @!attribute updated + # ISO 8601 timestamp of when the transaction was last updated + # + # @return [Time] + required :updated, Time + + # @!method initialize(token:, created:, status:, updated:, family: :CARD) + # Card transaction with ledger base properties + # + # @param token [String] Unique identifier for the transaction + # + # @param created [Time] ISO 8601 timestamp of when the transaction was created + # + # @param status [Symbol, Lithic::Models::AccountActivityRetrieveTransactionResponse::Card::Status] The status of the transaction + # + # @param updated [Time] ISO 8601 timestamp of when the transaction was last updated + # + # @param family [Symbol, :CARD] CARD - Card Transaction + + # The status of the transaction + module Status + extend Lithic::Internal::Type::Enum + + PENDING = :PENDING + SETTLED = :SETTLED + DECLINED = :DECLINED + REVERSED = :REVERSED + CANCELED = :CANCELED + RETURNED = :RETURNED + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal, Lithic::Models::BookTransferResponse, Lithic::Models::AccountActivityRetrieveTransactionResponse::Card, Lithic::Models::Payment, Lithic::Models::ExternalPayment, Lithic::Models::ManagementOperationTransaction, Lithic::Models::Hold)] + end + end +end diff --git a/lib/lithic/models/account_financial_account_type.rb b/lib/lithic/models/account_financial_account_type.rb new file mode 100644 index 00000000..296cf70c --- /dev/null +++ b/lib/lithic/models/account_financial_account_type.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + # Type of account financial account + module AccountFinancialAccountType + extend Lithic::Internal::Type::Enum + + ISSUING = :ISSUING + OPERATING = :OPERATING + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/lithic/models/account_holder.rb b/lib/lithic/models/account_holder.rb new file mode 100644 index 00000000..8438ffe3 --- /dev/null +++ b/lib/lithic/models/account_holder.rb @@ -0,0 +1,626 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::AccountHolders#retrieve + class AccountHolder < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for the account holder. + # + # @return [String] + required :token, String + + # @!attribute created + # Timestamp of when the account holder was created. + # + # @return [Time] + required :created, Time + + # @!attribute account_token + # Globally unique identifier for the account. + # + # @return [String, nil] + optional :account_token, String + + # @!attribute beneficial_owner_individuals + # Only present when user_type == "BUSINESS". You must submit a list of all direct + # and indirect individuals with 25% or more ownership in the company. A maximum of + # 4 beneficial owners can be submitted. If no individual owns 25% of the company + # you do not need to send beneficial owner information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + # + # @return [Array, nil] + optional :beneficial_owner_individuals, + -> { Lithic::Internal::Type::ArrayOf[Lithic::AccountHolder::BeneficialOwnerIndividual] } + + # @!attribute business_account_token + # Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # users of businesses. Pass the account_token of the enrolled business associated + # with the AUTHORIZED_USER in this field. + # + # @return [String, nil] + optional :business_account_token, String + + # @!attribute business_entity + # Only present when user_type == "BUSINESS". Information about the business for + # which the account is being opened and KYB is being run. + # + # @return [Lithic::Models::AccountHolder::BusinessEntity, nil] + optional :business_entity, -> { Lithic::AccountHolder::BusinessEntity } + + # @!attribute control_person + # Only present when user_type == "BUSINESS". An individual with significant + # responsibility for managing the legal entity (e.g., a Chief Executive Officer, + # Chief Financial Officer, Chief Operating Officer, Managing Member, General + # Partner, President, Vice President, or Treasurer). This can be an executive, or + # someone who will have program-wide access to the cards that Lithic will provide. + # In some cases, this individual could also be a beneficial owner listed above. + # + # @return [Lithic::Models::AccountHolder::ControlPerson, nil] + optional :control_person, -> { Lithic::AccountHolder::ControlPerson } + + # @!attribute email + # (Deprecated. Use control_person.email when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL".) Primary email of + # Account Holder. + # + # @return [String, nil] + optional :email, String + + # @!attribute exemption_type + # The type of KYC exemption for a KYC-Exempt Account Holder. + # + # @return [Symbol, Lithic::Models::AccountHolder::ExemptionType, nil] + optional :exemption_type, enum: -> { Lithic::AccountHolder::ExemptionType } + + # @!attribute external_id + # Customer-provided token that indicates a relationship with an object outside of + # the Lithic ecosystem. + # + # @return [String, nil] + optional :external_id, String + + # @!attribute individual + # Only present when user_type == "INDIVIDUAL". Information about the individual + # for which the account is being opened and KYC is being run. + # + # @return [Lithic::Models::AccountHolder::Individual, nil] + optional :individual, -> { Lithic::AccountHolder::Individual } + + # @!attribute naics_code + # Only present when user_type == "BUSINESS". 6-digit North American Industry + # Classification System (NAICS) code for the business. + # + # @return [String, nil] + optional :naics_code, String + + # @!attribute nature_of_business + # Only present when user_type == "BUSINESS". User-submitted description of the + # business. + # + # @return [String, nil] + optional :nature_of_business, String + + # @!attribute phone_number + # (Deprecated. Use control_person.phone_number when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL".) Primary phone of + # Account Holder, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!attribute required_documents + # Only present for "KYB_BASIC" workflow. A list of documents required for the + # account holder to be approved. + # + # @return [Array, nil] + optional :required_documents, -> { Lithic::Internal::Type::ArrayOf[Lithic::RequiredDocument] } + + # @!attribute status + # (Deprecated. Use verification_application.status instead) + # + # KYC and KYB evaluation states. + # + # Note: + # + # - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. + # + # @return [Symbol, Lithic::Models::AccountHolder::Status, nil] + optional :status, enum: -> { Lithic::AccountHolder::Status } + + # @!attribute status_reasons + # (Deprecated. Use verification_application.status_reasons) + # + # Reason for the evaluation status. + # + # @return [Array, nil] + optional :status_reasons, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::AccountHolder::StatusReason] } + + # @!attribute user_type + # The type of Account Holder. If the type is "INDIVIDUAL", the "individual" + # attribute will be present. If the type is "BUSINESS" then the "business_entity", + # "control_person", "beneficial_owner_individuals", "naics_code", + # "nature_of_business", and "website_url" attributes will be present. + # + # @return [Symbol, Lithic::Models::AccountHolder::UserType, nil] + optional :user_type, enum: -> { Lithic::AccountHolder::UserType } + + # @!attribute verification_application + # Information about the most recent identity verification attempt + # + # @return [Lithic::Models::AccountHolder::VerificationApplication, nil] + optional :verification_application, -> { Lithic::AccountHolder::VerificationApplication } + + # @!attribute website_url + # Only present when user_type == "BUSINESS". Business's primary website. + # + # @return [String, nil] + optional :website_url, String + + # @!method initialize(token:, created:, account_token: nil, beneficial_owner_individuals: nil, business_account_token: nil, business_entity: nil, control_person: nil, email: nil, exemption_type: nil, external_id: nil, individual: nil, naics_code: nil, nature_of_business: nil, phone_number: nil, required_documents: nil, status: nil, status_reasons: nil, user_type: nil, verification_application: nil, website_url: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolder} for more details. + # + # @param token [String] Globally unique identifier for the account holder. + # + # @param created [Time] Timestamp of when the account holder was created. + # + # @param account_token [String] Globally unique identifier for the account. + # + # @param beneficial_owner_individuals [Array] Only present when user_type == "BUSINESS". + # + # @param business_account_token [String] Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # + # @param business_entity [Lithic::Models::AccountHolder::BusinessEntity] Only present when user_type == "BUSINESS". Information about the business for wh + # + # @param control_person [Lithic::Models::AccountHolder::ControlPerson] Only present when user_type == "BUSINESS". + # + # @param email [String] (Deprecated. Use control_person.email when user_type == "BUSINESS". Use individu + # + # @param exemption_type [Symbol, Lithic::Models::AccountHolder::ExemptionType] The type of KYC exemption for a KYC-Exempt Account Holder. + # + # @param external_id [String] Customer-provided token that indicates a relationship with an object outside of + # + # @param individual [Lithic::Models::AccountHolder::Individual] Only present when user_type == "INDIVIDUAL". Information about the individual fo + # + # @param naics_code [String] Only present when user_type == "BUSINESS". 6-digit North American Industry Class + # + # @param nature_of_business [String] Only present when user_type == "BUSINESS". User-submitted description of the bus + # + # @param phone_number [String] (Deprecated. Use control_person.phone_number when user_type == "BUSINESS". Use i + # + # @param required_documents [Array] Only present for "KYB_BASIC" workflow. A list of documents required for the acco + # + # @param status [Symbol, Lithic::Models::AccountHolder::Status] (Deprecated. Use verification_application.status instead) + # + # @param status_reasons [Array] (Deprecated. Use verification_application.status_reasons) + # + # @param user_type [Symbol, Lithic::Models::AccountHolder::UserType] The type of Account Holder. If the type is "INDIVIDUAL", the "individual" attrib + # + # @param verification_application [Lithic::Models::AccountHolder::VerificationApplication] Information about the most recent identity verification attempt + # + # @param website_url [String] Only present when user_type == "BUSINESS". Business's primary website. + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + # @!attribute address + # Individual's current address + # + # @return [Lithic::Models::Address] + required :address, -> { Lithic::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String] + required :dob, String + + # @!attribute email + # Individual's email address. + # + # @return [String] + required :email, String + + # @!attribute entity_token + # Globally unique identifier for the entity. + # + # @return [String] + required :entity_token, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String] + required :first_name, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String] + required :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String] + required :phone_number, String + + # @!method initialize(address:, dob:, email:, entity_token:, first_name:, last_name:, phone_number:) + # Information about an individual associated with an account holder. A subset of + # the information provided via KYC. For example, we do not return the government + # id. + # + # @param address [Lithic::Models::Address] Individual's current address + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. + # + # @param entity_token [String] Globally unique identifier for the entity. + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + end + + # @see Lithic::Models::AccountHolder#business_entity + class BusinessEntity < Lithic::Internal::Type::BaseModel + # @!attribute address + # Business's physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + # + # @return [Lithic::Models::Address] + required :address, -> { Lithic::Address } + + # @!attribute dba_business_name + # Any name that the business operates under that is not its legal business name + # (if applicable). + # + # @return [String] + required :dba_business_name, String + + # @!attribute entity_token + # Globally unique identifier for the entity. + # + # @return [String] + required :entity_token, String + + # @!attribute government_id + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + # + # @return [String] + required :government_id, String + + # @!attribute legal_business_name + # Legal (formal) business name. + # + # @return [String] + required :legal_business_name, String + + # @!attribute phone_numbers + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + # + # @return [Array] + required :phone_numbers, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute parent_company + # Parent company name (if applicable). + # + # @return [String, nil] + optional :parent_company, String + + # @!method initialize(address:, dba_business_name:, entity_token:, government_id:, legal_business_name:, phone_numbers:, parent_company: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolder::BusinessEntity} for more details. + # + # Only present when user_type == "BUSINESS". Information about the business for + # which the account is being opened and KYB is being run. + # + # @param address [Lithic::Models::Address] Business's physical address - PO boxes, UPS drops, and FedEx drops are not accep + # + # @param dba_business_name [String] Any name that the business operates under that is not its legal business name (i + # + # @param entity_token [String] Globally unique identifier for the entity. + # + # @param government_id [String] Government-issued identification number. US Federal Employer Identification Numb + # + # @param legal_business_name [String] Legal (formal) business name. + # + # @param phone_numbers [Array] One or more of the business's phone number(s), entered as a list in E.164 format + # + # @param parent_company [String] Parent company name (if applicable). + end + + # @see Lithic::Models::AccountHolder#control_person + class ControlPerson < Lithic::Internal::Type::BaseModel + # @!attribute address + # Individual's current address + # + # @return [Lithic::Models::Address] + required :address, -> { Lithic::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String] + required :dob, String + + # @!attribute email + # Individual's email address. + # + # @return [String] + required :email, String + + # @!attribute entity_token + # Globally unique identifier for the entity. + # + # @return [String] + required :entity_token, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String] + required :first_name, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String] + required :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String] + required :phone_number, String + + # @!method initialize(address:, dob:, email:, entity_token:, first_name:, last_name:, phone_number:) + # Only present when user_type == "BUSINESS". An individual with significant + # responsibility for managing the legal entity (e.g., a Chief Executive Officer, + # Chief Financial Officer, Chief Operating Officer, Managing Member, General + # Partner, President, Vice President, or Treasurer). This can be an executive, or + # someone who will have program-wide access to the cards that Lithic will provide. + # In some cases, this individual could also be a beneficial owner listed above. + # + # @param address [Lithic::Models::Address] Individual's current address + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. + # + # @param entity_token [String] Globally unique identifier for the entity. + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + end + + # The type of KYC exemption for a KYC-Exempt Account Holder. + # + # @see Lithic::Models::AccountHolder#exemption_type + module ExemptionType + extend Lithic::Internal::Type::Enum + + AUTHORIZED_USER = :AUTHORIZED_USER + PREPAID_CARD_USER = :PREPAID_CARD_USER + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::AccountHolder#individual + class Individual < Lithic::Internal::Type::BaseModel + # @!attribute address + # Individual's current address + # + # @return [Lithic::Models::Address] + required :address, -> { Lithic::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String] + required :dob, String + + # @!attribute email + # Individual's email address. + # + # @return [String] + required :email, String + + # @!attribute entity_token + # Globally unique identifier for the entity. + # + # @return [String] + required :entity_token, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String] + required :first_name, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String] + required :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String] + required :phone_number, String + + # @!method initialize(address:, dob:, email:, entity_token:, first_name:, last_name:, phone_number:) + # Only present when user_type == "INDIVIDUAL". Information about the individual + # for which the account is being opened and KYC is being run. + # + # @param address [Lithic::Models::Address] Individual's current address + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. + # + # @param entity_token [String] Globally unique identifier for the entity. + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + end + + # (Deprecated. Use verification_application.status instead) + # + # KYC and KYB evaluation states. + # + # Note: + # + # - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. + # + # @see Lithic::Models::AccountHolder#status + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED = :ACCEPTED + PENDING_REVIEW = :PENDING_REVIEW + PENDING_DOCUMENT = :PENDING_DOCUMENT + PENDING_RESUBMIT = :PENDING_RESUBMIT + REJECTED = :REJECTED + + # @!method self.values + # @return [Array] + end + + module StatusReason + extend Lithic::Internal::Type::Enum + + ADDRESS_VERIFICATION_FAILURE = :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE = :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE = :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE = :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE = :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS = :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS = :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE = :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE = :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE = :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE = :WATCHLIST_ALERT_FAILURE + + # @!method self.values + # @return [Array] + end + + # The type of Account Holder. If the type is "INDIVIDUAL", the "individual" + # attribute will be present. If the type is "BUSINESS" then the "business_entity", + # "control_person", "beneficial_owner_individuals", "naics_code", + # "nature_of_business", and "website_url" attributes will be present. + # + # @see Lithic::Models::AccountHolder#user_type + module UserType + extend Lithic::Internal::Type::Enum + + BUSINESS = :BUSINESS + INDIVIDUAL = :INDIVIDUAL + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::AccountHolder#verification_application + class VerificationApplication < Lithic::Internal::Type::BaseModel + # @!attribute created + # Timestamp of when the application was created. + # + # @return [Time, nil] + optional :created, Time + + # @!attribute status + # KYC and KYB evaluation states. + # + # Note: + # + # - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. + # + # @return [Symbol, Lithic::Models::AccountHolder::VerificationApplication::Status, nil] + optional :status, enum: -> { Lithic::AccountHolder::VerificationApplication::Status } + + # @!attribute status_reasons + # Reason for the evaluation status. + # + # @return [Array, nil] + optional :status_reasons, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::AccountHolder::VerificationApplication::StatusReason] } + + # @!attribute updated + # Timestamp of when the application was last updated. + # + # @return [Time, nil] + optional :updated, Time + + # @!method initialize(created: nil, status: nil, status_reasons: nil, updated: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolder::VerificationApplication} for more details. + # + # Information about the most recent identity verification attempt + # + # @param created [Time] Timestamp of when the application was created. + # + # @param status [Symbol, Lithic::Models::AccountHolder::VerificationApplication::Status] KYC and KYB evaluation states. + # + # @param status_reasons [Array] Reason for the evaluation status. + # + # @param updated [Time] Timestamp of when the application was last updated. + + # KYC and KYB evaluation states. + # + # Note: + # + # - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. + # + # @see Lithic::Models::AccountHolder::VerificationApplication#status + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED = :ACCEPTED + PENDING_REVIEW = :PENDING_REVIEW + PENDING_DOCUMENT = :PENDING_DOCUMENT + PENDING_RESUBMIT = :PENDING_RESUBMIT + REJECTED = :REJECTED + + # @!method self.values + # @return [Array] + end + + module StatusReason + extend Lithic::Internal::Type::Enum + + ADDRESS_VERIFICATION_FAILURE = :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE = :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE = :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE = :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE = :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS = :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS = :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE = :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE = :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE = :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE = :WATCHLIST_ALERT_FAILURE + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/account_holder_create_params.rb b/lib/lithic/models/account_holder_create_params.rb new file mode 100644 index 00000000..2a67c137 --- /dev/null +++ b/lib/lithic/models/account_holder_create_params.rb @@ -0,0 +1,357 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::AccountHolders#create + class AccountHolderCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute body + # + # @return [Lithic::Models::KYB, Lithic::Models::AccountHolderCreateParams::Body::KYBDelegated, Lithic::Models::KYC, Lithic::Models::KYCExempt] + required :body, union: -> { Lithic::AccountHolderCreateParams::Body } + + # @!method initialize(body:, request_options: {}) + # @param body [Lithic::Models::KYB, Lithic::Models::AccountHolderCreateParams::Body::KYBDelegated, Lithic::Models::KYC, Lithic::Models::KYCExempt] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + module Body + extend Lithic::Internal::Type::Union + + variant -> { Lithic::KYB } + + variant -> { Lithic::AccountHolderCreateParams::Body::KYBDelegated } + + variant -> { Lithic::KYC } + + variant -> { Lithic::KYCExempt } + + class KYBDelegated < Lithic::Internal::Type::BaseModel + # @!attribute business_entity + # Information for business for which the account is being opened. + # + # @return [Lithic::Models::AccountHolderCreateParams::Body::KYBDelegated::BusinessEntity] + required :business_entity, -> { Lithic::AccountHolderCreateParams::Body::KYBDelegated::BusinessEntity } + + # @!attribute beneficial_owner_individuals + # You can submit a list of all direct and indirect individuals with 25% or more + # ownership in the company. A maximum of 4 beneficial owners can be submitted. If + # no individual owns 25% of the company you do not need to send beneficial owner + # information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + # + # @return [Array, nil] + optional :beneficial_owner_individuals, + -> { Lithic::Internal::Type::ArrayOf[Lithic::AccountHolderCreateParams::Body::KYBDelegated::BeneficialOwnerIndividual] } + + # @!attribute control_person + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + # + # @return [Lithic::Models::AccountHolderCreateParams::Body::KYBDelegated::ControlPerson, nil] + optional :control_person, -> { Lithic::AccountHolderCreateParams::Body::KYBDelegated::ControlPerson } + + # @!attribute external_id + # A user provided id that can be used to link an account holder with an external + # system + # + # @return [String, nil] + optional :external_id, String + + # @!attribute naics_code + # 6-digit North American Industry Classification System (NAICS) code for the + # business. + # + # @return [String, nil] + optional :naics_code, String + + # @!attribute nature_of_business + # Short description of the company's line of business (i.e., what does the company + # do?). Values longer than 255 characters will be truncated before KYB + # verification + # + # @return [String, nil] + optional :nature_of_business, String + + # @!attribute tos_timestamp + # An RFC 3339 timestamp indicating when the account holder accepted the applicable + # legal agreements (e.g., cardholder terms) as agreed upon during API customer's + # implementation with Lithic. + # + # @return [String, nil] + optional :tos_timestamp, String + + # @!attribute website_url + # Company website URL. + # + # @return [String, nil] + optional :website_url, String + + # @!attribute workflow + # Specifies the type of KYB workflow to run. + # + # @return [Symbol, Lithic::Models::AccountHolderCreateParams::Body::KYBDelegated::Workflow, nil] + optional :workflow, enum: -> { Lithic::AccountHolderCreateParams::Body::KYBDelegated::Workflow } + + # @!method initialize(business_entity:, beneficial_owner_individuals: nil, control_person: nil, external_id: nil, naics_code: nil, nature_of_business: nil, tos_timestamp: nil, website_url: nil, workflow: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderCreateParams::Body::KYBDelegated} for more + # details. + # + # @param business_entity [Lithic::Models::AccountHolderCreateParams::Body::KYBDelegated::BusinessEntity] Information for business for which the account is being opened. + # + # @param beneficial_owner_individuals [Array] You can submit a list of all direct and indirect individuals with 25% or more ow + # + # @param control_person [Lithic::Models::AccountHolderCreateParams::Body::KYBDelegated::ControlPerson] An individual with significant responsibility for managing the legal entity (e.g + # + # @param external_id [String] A user provided id that can be used to link an account holder with an external s + # + # @param naics_code [String] 6-digit North American Industry Classification System (NAICS) code for the busin + # + # @param nature_of_business [String] Short description of the company's line of business (i.e., what does the company + # + # @param tos_timestamp [String] An RFC 3339 timestamp indicating when the account holder accepted the applicable + # + # @param website_url [String] Company website URL. + # + # @param workflow [Symbol, Lithic::Models::AccountHolderCreateParams::Body::KYBDelegated::Workflow] Specifies the type of KYB workflow to run. + + # @see Lithic::Models::AccountHolderCreateParams::Body::KYBDelegated#business_entity + class BusinessEntity < Lithic::Internal::Type::BaseModel + # @!attribute address + # Business's physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + # + # @return [Lithic::Models::Address] + required :address, -> { Lithic::Address } + + # @!attribute legal_business_name + # Legal (formal) business name. + # + # @return [String] + required :legal_business_name, String + + # @!attribute dba_business_name + # Any name that the business operates under that is not its legal business name + # (if applicable). + # + # @return [String, nil] + optional :dba_business_name, String + + # @!attribute government_id + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + # + # @return [String, nil] + optional :government_id, String + + # @!attribute parent_company + # Parent company name (if applicable). + # + # @return [String, nil] + optional :parent_company, String + + # @!attribute phone_numbers + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + # + # @return [Array, nil] + optional :phone_numbers, Lithic::Internal::Type::ArrayOf[String] + + # @!method initialize(address:, legal_business_name:, dba_business_name: nil, government_id: nil, parent_company: nil, phone_numbers: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderCreateParams::Body::KYBDelegated::BusinessEntity} + # for more details. + # + # Information for business for which the account is being opened. + # + # @param address [Lithic::Models::Address] Business's physical address - PO boxes, UPS drops, and FedEx drops are not accep + # + # @param legal_business_name [String] Legal (formal) business name. + # + # @param dba_business_name [String] Any name that the business operates under that is not its legal business name (i + # + # @param government_id [String] Government-issued identification number. US Federal Employer Identification Numb + # + # @param parent_company [String] Parent company name (if applicable). + # + # @param phone_numbers [Array] One or more of the business's phone number(s), entered as a list in E.164 format + end + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String] + required :first_name, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String] + required :last_name, String + + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::Address, nil] + optional :address, -> { Lithic::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!attribute government_id + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + # + # @return [String, nil] + optional :government_id, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!method initialize(first_name:, last_name:, address: nil, dob: nil, email: nil, government_id: nil, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderCreateParams::Body::KYBDelegated::BeneficialOwnerIndividual} + # for more details. + # + # Individuals associated with a KYB_DELEGATED application. Only first and last + # name are required. + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param address [Lithic::Models::Address] Individual's current address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. + # + # @param government_id [String] Government-issued identification number (required for identity verification and + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + end + + # @see Lithic::Models::AccountHolderCreateParams::Body::KYBDelegated#control_person + class ControlPerson < Lithic::Internal::Type::BaseModel + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String] + required :first_name, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String] + required :last_name, String + + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::Address, nil] + optional :address, -> { Lithic::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!attribute government_id + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + # + # @return [String, nil] + optional :government_id, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!method initialize(first_name:, last_name:, address: nil, dob: nil, email: nil, government_id: nil, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderCreateParams::Body::KYBDelegated::ControlPerson} + # for more details. + # + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param address [Lithic::Models::Address] Individual's current address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. + # + # @param government_id [String] Government-issued identification number (required for identity verification and + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + end + + # Specifies the type of KYB workflow to run. + # + # @see Lithic::Models::AccountHolderCreateParams::Body::KYBDelegated#workflow + module Workflow + extend Lithic::Internal::Type::Enum + + KYB_DELEGATED = :KYB_DELEGATED + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(Lithic::Models::KYB, Lithic::Models::AccountHolderCreateParams::Body::KYBDelegated, Lithic::Models::KYC, Lithic::Models::KYCExempt)] + end + end + end +end diff --git a/lib/lithic/models/account_holder_create_response.rb b/lib/lithic/models/account_holder_create_response.rb new file mode 100644 index 00000000..bbfaa1b2 --- /dev/null +++ b/lib/lithic/models/account_holder_create_response.rb @@ -0,0 +1,130 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::AccountHolders#create + class AccountHolderCreateResponse < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for the account holder. + # + # @return [String] + required :token, String + + # @!attribute account_token + # Globally unique identifier for the account. + # + # @return [String] + required :account_token, String + + # @!attribute status + # KYC and KYB evaluation states. + # + # Note: + # + # - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. + # + # @return [Symbol, Lithic::Models::AccountHolderCreateResponse::Status] + required :status, enum: -> { Lithic::Models::AccountHolderCreateResponse::Status } + + # @!attribute status_reasons + # Reason for the evaluation status. + # + # @return [Array] + required :status_reasons, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::Models::AccountHolderCreateResponse::StatusReason] } + + # @!attribute created + # Timestamp of when the account holder was created. + # + # @return [Time, nil] + optional :created, Time + + # @!attribute external_id + # Customer-provided token that indicates a relationship with an object outside of + # the Lithic ecosystem. + # + # @return [String, nil] + optional :external_id, String + + # @!attribute required_documents + # Only present for "KYB_BASIC" workflow. A list of documents required for the + # account holder to be approved. + # + # @return [Array, nil] + optional :required_documents, -> { Lithic::Internal::Type::ArrayOf[Lithic::RequiredDocument] } + + # @!method initialize(token:, account_token:, status:, status_reasons:, created: nil, external_id: nil, required_documents: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderCreateResponse} for more details. + # + # @param token [String] Globally unique identifier for the account holder. + # + # @param account_token [String] Globally unique identifier for the account. + # + # @param status [Symbol, Lithic::Models::AccountHolderCreateResponse::Status] KYC and KYB evaluation states. + # + # @param status_reasons [Array] Reason for the evaluation status. + # + # @param created [Time] Timestamp of when the account holder was created. + # + # @param external_id [String] Customer-provided token that indicates a relationship with an object outside of + # + # @param required_documents [Array] Only present for "KYB_BASIC" workflow. A list of documents required for the acco + + # KYC and KYB evaluation states. + # + # Note: + # + # - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. + # + # @see Lithic::Models::AccountHolderCreateResponse#status + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED = :ACCEPTED + PENDING_REVIEW = :PENDING_REVIEW + PENDING_DOCUMENT = :PENDING_DOCUMENT + PENDING_RESUBMIT = :PENDING_RESUBMIT + REJECTED = :REJECTED + + # @!method self.values + # @return [Array] + end + + # Status Reasons for KYC/KYB enrollment states + module StatusReason + extend Lithic::Internal::Type::Enum + + ADDRESS_VERIFICATION_FAILURE = :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE = :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE = :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE = :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE = :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS = :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS = :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE = :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE = :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE = :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE = :WATCHLIST_ALERT_FAILURE + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE = :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE = + :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE = :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED = + :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE = :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED = :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE = :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE = :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE = :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE = :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + CONTROL_PERSON_ID_VERIFICATION_FAILURE = :CONTROL_PERSON_ID_VERIFICATION_FAILURE + CONTROL_PERSON_DOB_VERIFICATION_FAILURE = :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + CONTROL_PERSON_NAME_VERIFICATION_FAILURE = :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/account_holder_created_webhook_event.rb b/lib/lithic/models/account_holder_created_webhook_event.rb new file mode 100644 index 00000000..1c673e4b --- /dev/null +++ b/lib/lithic/models/account_holder_created_webhook_event.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AccountHolderCreatedWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"account_holder.created"] + required :event_type, const: :"account_holder.created" + + # @!attribute token + # The token of the account_holder that was created. + # + # @return [String, nil] + optional :token, String + + # @!attribute account_token + # The token of the account that was created. + # + # @return [String, nil] + optional :account_token, String + + # @!attribute created + # When the account_holder was created + # + # @return [Time, nil] + optional :created, Time + + # @!attribute required_documents + # + # @return [Array, nil] + optional :required_documents, -> { Lithic::Internal::Type::ArrayOf[Lithic::RequiredDocument] } + + # @!attribute status + # The status of the account_holder that was created. + # + # @return [Symbol, Lithic::Models::AccountHolderCreatedWebhookEvent::Status, nil] + optional :status, enum: -> { Lithic::AccountHolderCreatedWebhookEvent::Status } + + # @!attribute status_reason + # + # @return [Array, nil] + optional :status_reason, Lithic::Internal::Type::ArrayOf[String] + + # @!method initialize(token: nil, account_token: nil, created: nil, required_documents: nil, status: nil, status_reason: nil, event_type: :"account_holder.created") + # @param token [String] The token of the account_holder that was created. + # + # @param account_token [String] The token of the account that was created. + # + # @param created [Time] When the account_holder was created + # + # @param required_documents [Array] + # + # @param status [Symbol, Lithic::Models::AccountHolderCreatedWebhookEvent::Status] The status of the account_holder that was created. + # + # @param status_reason [Array] + # + # @param event_type [Symbol, :"account_holder.created"] The type of event that occurred. + + # The status of the account_holder that was created. + # + # @see Lithic::Models::AccountHolderCreatedWebhookEvent#status + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED = :ACCEPTED + PENDING_REVIEW = :PENDING_REVIEW + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/account_holder_document_updated_webhook_event.rb b/lib/lithic/models/account_holder_document_updated_webhook_event.rb new file mode 100644 index 00000000..f61be2dc --- /dev/null +++ b/lib/lithic/models/account_holder_document_updated_webhook_event.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AccountHolderDocumentUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"account_holder_document.updated"] + required :event_type, const: :"account_holder_document.updated" + + # @!attribute token + # The token of the account holder document + # + # @return [String, nil] + optional :token, String + + # @!attribute account_holder_token + # The token of the account_holder that the document belongs to + # + # @return [String, nil] + optional :account_holder_token, String + + # @!attribute created + # When the account_holder was created + # + # @return [Time, nil] + optional :created, Time + + # @!attribute document_type + # Type of documentation to be submitted for verification of an account holder + # + # @return [Symbol, Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::DocumentType, nil] + optional :document_type, enum: -> { Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType } + + # @!attribute entity_token + # The token of the entity that the document belongs to + # + # @return [String, nil] + optional :entity_token, String + + # @!attribute required_document_uploads + # + # @return [Array, nil] + optional :required_document_uploads, + -> { Lithic::Internal::Type::ArrayOf[Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload] } + + # @!method initialize(token: nil, account_holder_token: nil, created: nil, document_type: nil, entity_token: nil, required_document_uploads: nil, event_type: :"account_holder_document.updated") + # @param token [String] The token of the account holder document + # + # @param account_holder_token [String] The token of the account_holder that the document belongs to + # + # @param created [Time] When the account_holder was created + # + # @param document_type [Symbol, Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::DocumentType] Type of documentation to be submitted for verification of an account holder + # + # @param entity_token [String] The token of the entity that the document belongs to + # + # @param required_document_uploads [Array] + # + # @param event_type [Symbol, :"account_holder_document.updated"] The type of event that occurred. + + # Type of documentation to be submitted for verification of an account holder + # + # @see Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent#document_type + module DocumentType + extend Lithic::Internal::Type::Enum + + DRIVERS_LICENSE = :DRIVERS_LICENSE + PASSPORT = :PASSPORT + PASSPORT_CARD = :PASSPORT_CARD + EIN_LETTER = :EIN_LETTER + TAX_RETURN = :TAX_RETURN + OPERATING_AGREEMENT = :OPERATING_AGREEMENT + CERTIFICATE_OF_FORMATION = :CERTIFICATE_OF_FORMATION + CERTIFICATE_OF_GOOD_STANDING = :CERTIFICATE_OF_GOOD_STANDING + ARTICLES_OF_INCORPORATION = :ARTICLES_OF_INCORPORATION + ARTICLES_OF_ORGANIZATION = :ARTICLES_OF_ORGANIZATION + BYLAWS = :BYLAWS + GOVERNMENT_BUSINESS_LICENSE = :GOVERNMENT_BUSINESS_LICENSE + PARTNERSHIP_AGREEMENT = :PARTNERSHIP_AGREEMENT + SS4_FORM = :SS4_FORM + BANK_STATEMENT = :BANK_STATEMENT + UTILITY_BILL_STATEMENT = :UTILITY_BILL_STATEMENT + SSN_CARD = :SSN_CARD + ITIN_LETTER = :ITIN_LETTER + FINCEN_BOI_REPORT = :FINCEN_BOI_REPORT + + # @!method self.values + # @return [Array] + end + + class RequiredDocumentUpload < Lithic::Internal::Type::BaseModel + # @!attribute token + # The token of the document upload + # + # @return [String, nil] + optional :token, String + + # @!attribute accepted_entity_status_reasons + # + # @return [Array, nil] + optional :accepted_entity_status_reasons, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute created + # When the document upload was created + # + # @return [Time, nil] + optional :created, Time + + # @!attribute image_type + # The type of image that was uploaded + # + # @return [Symbol, Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::ImageType, nil] + optional :image_type, + enum: -> { Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::ImageType } + + # @!attribute rejected_entity_status_reasons + # + # @return [Array, nil] + optional :rejected_entity_status_reasons, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute status + # The status of the document upload + # + # @return [Symbol, Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::Status, nil] + optional :status, + enum: -> { Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::Status } + + # @!attribute status_reasons + # + # @return [Array, nil] + optional :status_reasons, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute updated + # When the document upload was last updated + # + # @return [Time, nil] + optional :updated, Time + + # @!method initialize(token: nil, accepted_entity_status_reasons: nil, created: nil, image_type: nil, rejected_entity_status_reasons: nil, status: nil, status_reasons: nil, updated: nil) + # A document upload that belongs to the overall account holder document + # + # @param token [String] The token of the document upload + # + # @param accepted_entity_status_reasons [Array] + # + # @param created [Time] When the document upload was created + # + # @param image_type [Symbol, Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::ImageType] The type of image that was uploaded + # + # @param rejected_entity_status_reasons [Array] + # + # @param status [Symbol, Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::Status] The status of the document upload + # + # @param status_reasons [Array] + # + # @param updated [Time] When the document upload was last updated + + # The type of image that was uploaded + # + # @see Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload#image_type + module ImageType + extend Lithic::Internal::Type::Enum + + FRONT = :FRONT + BACK = :BACK + + # @!method self.values + # @return [Array] + end + + # The status of the document upload + # + # @see Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload#status + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED = :ACCEPTED + REJECTED = :REJECTED + PENDING_UPLOAD = :PENDING_UPLOAD + UPLOADED = :UPLOADED + PARTIAL_APPROVAL = :PARTIAL_APPROVAL + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/account_holder_list_documents_params.rb b/lib/lithic/models/account_holder_list_documents_params.rb new file mode 100644 index 00000000..dfd29794 --- /dev/null +++ b/lib/lithic/models/account_holder_list_documents_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::AccountHolders#list_documents + class AccountHolderListDocumentsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute account_holder_token + # + # @return [String] + required :account_holder_token, String + + # @!method initialize(account_holder_token:, request_options: {}) + # @param account_holder_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/account_holder_list_documents_response.rb b/lib/lithic/models/account_holder_list_documents_response.rb new file mode 100644 index 00000000..cfe8b5b0 --- /dev/null +++ b/lib/lithic/models/account_holder_list_documents_response.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::AccountHolders#list_documents + class AccountHolderListDocumentsResponse < Lithic::Internal::Type::BaseModel + # @!attribute data + # + # @return [Array, nil] + optional :data, -> { Lithic::Internal::Type::ArrayOf[Lithic::Document] } + + # @!method initialize(data: nil) + # @param data [Array] + end + end +end diff --git a/lib/lithic/models/account_holder_list_params.rb b/lib/lithic/models/account_holder_list_params.rb new file mode 100644 index 00000000..e55b7ce0 --- /dev/null +++ b/lib/lithic/models/account_holder_list_params.rb @@ -0,0 +1,113 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::AccountHolders#list + class AccountHolderListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time + + # @!attribute email + # Email address of the account holder. The query must be an exact match, case + # insensitive. + # + # @return [String, nil] + optional :email, String + + # @!attribute end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute external_id + # If applicable, represents the external_id associated with the account_holder. + # + # @return [String, nil] + optional :external_id, String + + # @!attribute first_name + # (Individual Account Holders only) The first name of the account holder. The + # query is case insensitive and supports partial matches. + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # (Individual Account Holders only) The last name of the account holder. The query + # is case insensitive and supports partial matches. + # + # @return [String, nil] + optional :last_name, String + + # @!attribute legal_business_name + # (Business Account Holders only) The legal business name of the account holder. + # The query is case insensitive and supports partial matches. + # + # @return [String, nil] + optional :legal_business_name, String + + # @!attribute limit + # The number of account_holders to limit the response to. + # + # @return [Integer, nil] + optional :limit, Integer + + # @!attribute phone_number + # Phone number of the account holder. The query must be an exact match. + # + # @return [String, nil] + optional :phone_number, String + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!method initialize(begin_: nil, email: nil, end_: nil, ending_before: nil, external_id: nil, first_name: nil, last_name: nil, legal_business_name: nil, limit: nil, phone_number: nil, starting_after: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderListParams} for more details. + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param email [String] Email address of the account holder. The query must be an exact match, case inse + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param external_id [String] If applicable, represents the external_id associated with the account_holder. + # + # @param first_name [String] (Individual Account Holders only) The first name of the account holder. The quer + # + # @param last_name [String] (Individual Account Holders only) The last name of the account holder. The query + # + # @param legal_business_name [String] (Business Account Holders only) The legal business name of the account holder. T + # + # @param limit [Integer] The number of account_holders to limit the response to. + # + # @param phone_number [String] Phone number of the account holder. The query must be an exact match. + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/account_holder_retrieve_document_params.rb b/lib/lithic/models/account_holder_retrieve_document_params.rb new file mode 100644 index 00000000..0d8a4332 --- /dev/null +++ b/lib/lithic/models/account_holder_retrieve_document_params.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::AccountHolders#retrieve_document + class AccountHolderRetrieveDocumentParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute account_holder_token + # + # @return [String] + required :account_holder_token, String + + # @!attribute document_token + # + # @return [String] + required :document_token, String + + # @!method initialize(account_holder_token:, document_token:, request_options: {}) + # @param account_holder_token [String] + # @param document_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/account_holder_retrieve_params.rb b/lib/lithic/models/account_holder_retrieve_params.rb new file mode 100644 index 00000000..b190ac35 --- /dev/null +++ b/lib/lithic/models/account_holder_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::AccountHolders#retrieve + class AccountHolderRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute account_holder_token + # + # @return [String] + required :account_holder_token, String + + # @!method initialize(account_holder_token:, request_options: {}) + # @param account_holder_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/account_holder_simulate_enrollment_document_review_params.rb b/lib/lithic/models/account_holder_simulate_enrollment_document_review_params.rb new file mode 100644 index 00000000..aaba3692 --- /dev/null +++ b/lib/lithic/models/account_holder_simulate_enrollment_document_review_params.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::AccountHolders#simulate_enrollment_document_review + class AccountHolderSimulateEnrollmentDocumentReviewParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute document_upload_token + # The account holder document upload which to perform the simulation upon. + # + # @return [String] + required :document_upload_token, String + + # @!attribute status + # An account holder document's upload status for use within the simulation. + # + # @return [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::Status] + required :status, enum: -> { Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::Status } + + # @!attribute accepted_entity_status_reasons + # A list of status reasons associated with a KYB account holder in PENDING_REVIEW + # + # @return [Array, nil] + optional :accepted_entity_status_reasons, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute status_reason + # Status reason that will be associated with the simulated account holder status. + # Only required for a `REJECTED` status or `PARTIAL_APPROVAL` status. + # + # @return [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason, nil] + optional :status_reason, + enum: -> { Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason } + + # @!method initialize(document_upload_token:, status:, accepted_entity_status_reasons: nil, status_reason: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams} for more + # details. + # + # @param document_upload_token [String] The account holder document upload which to perform the simulation upon. + # + # @param status [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::Status] An account holder document's upload status for use within the simulation. + # + # @param accepted_entity_status_reasons [Array] A list of status reasons associated with a KYB account holder in PENDING_REVIEW + # + # @param status_reason [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason] Status reason that will be associated with the simulated account holder status. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # An account holder document's upload status for use within the simulation. + module Status + extend Lithic::Internal::Type::Enum + + UPLOADED = :UPLOADED + ACCEPTED = :ACCEPTED + REJECTED = :REJECTED + PARTIAL_APPROVAL = :PARTIAL_APPROVAL + + # @!method self.values + # @return [Array] + end + + # Status reason that will be associated with the simulated account holder status. + # Only required for a `REJECTED` status or `PARTIAL_APPROVAL` status. + module StatusReason + extend Lithic::Internal::Type::Enum + + DOCUMENT_MISSING_REQUIRED_DATA = :DOCUMENT_MISSING_REQUIRED_DATA + DOCUMENT_UPLOAD_TOO_BLURRY = :DOCUMENT_UPLOAD_TOO_BLURRY + FILE_SIZE_TOO_LARGE = :FILE_SIZE_TOO_LARGE + INVALID_DOCUMENT_TYPE = :INVALID_DOCUMENT_TYPE + INVALID_DOCUMENT_UPLOAD = :INVALID_DOCUMENT_UPLOAD + INVALID_ENTITY = :INVALID_ENTITY + DOCUMENT_EXPIRED = :DOCUMENT_EXPIRED + DOCUMENT_ISSUED_GREATER_THAN_30_DAYS = :DOCUMENT_ISSUED_GREATER_THAN_30_DAYS + DOCUMENT_TYPE_NOT_SUPPORTED = :DOCUMENT_TYPE_NOT_SUPPORTED + UNKNOWN_FAILURE_REASON = :UNKNOWN_FAILURE_REASON + UNKNOWN_ERROR = :UNKNOWN_ERROR + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/account_holder_simulate_enrollment_review_params.rb b/lib/lithic/models/account_holder_simulate_enrollment_review_params.rb new file mode 100644 index 00000000..9e73e5ac --- /dev/null +++ b/lib/lithic/models/account_holder_simulate_enrollment_review_params.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::AccountHolders#simulate_enrollment_review + class AccountHolderSimulateEnrollmentReviewParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute account_holder_token + # The account holder which to perform the simulation upon. + # + # @return [String, nil] + optional :account_holder_token, String + + # @!attribute status + # An account holder's status for use within the simulation. + # + # @return [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::Status, nil] + optional :status, enum: -> { Lithic::AccountHolderSimulateEnrollmentReviewParams::Status } + + # @!attribute status_reasons + # Status reason that will be associated with the simulated account holder status. + # Only required for a `REJECTED` status. + # + # @return [Array, nil] + optional :status_reasons, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::AccountHolderSimulateEnrollmentReviewParams::StatusReason] } + + # @!method initialize(account_holder_token: nil, status: nil, status_reasons: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderSimulateEnrollmentReviewParams} for more details. + # + # @param account_holder_token [String] The account holder which to perform the simulation upon. + # + # @param status [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::Status] An account holder's status for use within the simulation. + # + # @param status_reasons [Array] Status reason that will be associated with the simulated account holder status. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # An account holder's status for use within the simulation. + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED = :ACCEPTED + REJECTED = :REJECTED + PENDING_REVIEW = :PENDING_REVIEW + + # @!method self.values + # @return [Array] + end + + module StatusReason + extend Lithic::Internal::Type::Enum + + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE = :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE = + :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE = :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED = + :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE = :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED = :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE = :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE = :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE = :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE = :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + CONTROL_PERSON_ID_VERIFICATION_FAILURE = :CONTROL_PERSON_ID_VERIFICATION_FAILURE + CONTROL_PERSON_DOB_VERIFICATION_FAILURE = :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + CONTROL_PERSON_NAME_VERIFICATION_FAILURE = :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + BENEFICIAL_OWNER_INDIVIDUAL_DOB_VERIFICATION_FAILURE = + :BENEFICIAL_OWNER_INDIVIDUAL_DOB_VERIFICATION_FAILURE + BENEFICIAL_OWNER_INDIVIDUAL_BLOCKLIST_ALERT_FAILURE = + :BENEFICIAL_OWNER_INDIVIDUAL_BLOCKLIST_ALERT_FAILURE + BENEFICIAL_OWNER_INDIVIDUAL_ID_VERIFICATION_FAILURE = + :BENEFICIAL_OWNER_INDIVIDUAL_ID_VERIFICATION_FAILURE + BENEFICIAL_OWNER_INDIVIDUAL_NAME_VERIFICATION_FAILURE = + :BENEFICIAL_OWNER_INDIVIDUAL_NAME_VERIFICATION_FAILURE + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/account_holder_simulate_enrollment_review_response.rb b/lib/lithic/models/account_holder_simulate_enrollment_review_response.rb new file mode 100644 index 00000000..6eaa7131 --- /dev/null +++ b/lib/lithic/models/account_holder_simulate_enrollment_review_response.rb @@ -0,0 +1,789 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::AccountHolders#simulate_enrollment_review + class AccountHolderSimulateEnrollmentReviewResponse < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for the account holder. + # + # @return [String, nil] + optional :token, String + + # @!attribute account_token + # Globally unique identifier for the account. + # + # @return [String, nil] + optional :account_token, String + + # @!attribute beneficial_owner_individuals + # Only present when user_type == "BUSINESS". You must submit a list of all direct + # and indirect individuals with 25% or more ownership in the company. A maximum of + # 4 beneficial owners can be submitted. If no individual owns 25% of the company + # you do not need to send beneficial owner information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + # + # @return [Array, nil] + optional :beneficial_owner_individuals, + -> { Lithic::Internal::Type::ArrayOf[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual] } + + # @!attribute business_account_token + # Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # users of businesses. Pass the account_token of the enrolled business associated + # with the AUTHORIZED_USER in this field. + # + # @return [String, nil] + optional :business_account_token, String, nil?: true + + # @!attribute business_entity + # Only present when user_type == "BUSINESS". Information about the business for + # which the account is being opened and KYB is being run. + # + # @return [Lithic::Models::KYBBusinessEntity, nil] + optional :business_entity, -> { Lithic::KYBBusinessEntity } + + # @!attribute control_person + # Only present when user_type == "BUSINESS". + # + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, + # + # Managing Member, General Partner, President, Vice President, or Treasurer). This + # can be an executive, or someone who will have program-wide access + # + # to the cards that Lithic will provide. In some cases, this individual could also + # be a beneficial owner listed above. + # + # @return [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson, nil] + optional :control_person, + -> { Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson } + + # @!attribute created + # Timestamp of when the account holder was created. + # + # @return [Time, nil] + optional :created, Time + + # @!attribute email + # (Deprecated. Use control_person.email when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL".) Primary email of + # Account Holder. + # + # @return [String, nil] + optional :email, String + + # @!attribute exemption_type + # The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account + # holder is not KYC-Exempt. + # + # @return [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType, nil] + optional :exemption_type, + enum: -> { Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType }, + nil?: true + + # @!attribute external_id + # Customer-provided token that indicates a relationship with an object outside of + # the Lithic ecosystem. + # + # @return [String, nil] + optional :external_id, String, nil?: true + + # @!attribute individual + # Only present when user_type == "INDIVIDUAL". Information about the individual + # for which the account is being opened and KYC is being run. + # + # @return [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual, nil] + optional :individual, -> { Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual } + + # @!attribute naics_code + # Only present when user_type == "BUSINESS". 6-digit North American Industry + # Classification System (NAICS) code for the business. + # + # @return [String, nil] + optional :naics_code, String, nil?: true + + # @!attribute nature_of_business + # Only present when user_type == "BUSINESS". User-submitted description of the + # business. + # + # @return [String, nil] + optional :nature_of_business, String + + # @!attribute phone_number + # (Deprecated. Use control_person.phone_number when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL".) Primary phone of + # Account Holder, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!attribute required_documents + # Only present for "KYB_BASIC" and "KYC_ADVANCED" workflows. A list of documents + # required for the account holder to be approved. + # + # @return [Array, nil] + optional :required_documents, -> { Lithic::Internal::Type::ArrayOf[Lithic::RequiredDocument] } + + # @!attribute status + # (Deprecated. Use verification_application.status instead) KYC and KYB evaluation + # states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + # + # @return [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status, nil] + optional :status, enum: -> { Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status } + + # @!attribute status_reasons + # (Deprecated. Use verification_application.status_reasons) Reason for the + # evaluation status. + # + # @return [Array, nil] + optional :status_reasons, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason] } + + # @!attribute user_type + # The type of Account Holder. If the type is "INDIVIDUAL", the "individual" + # attribute will be present. + # + # If the type is "BUSINESS" then the "business_entity", "control_person", + # "beneficial_owner_individuals", "naics_code", "nature_of_business", and + # "website_url" attributes will be present. + # + # @return [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::UserType, nil] + optional :user_type, enum: -> { Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::UserType } + + # @!attribute verification_application + # Information about the most recent identity verification attempt + # + # @return [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication, nil] + optional :verification_application, + -> { Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication } + + # @!attribute website_url + # Only present when user_type == "BUSINESS". Business's primary website. + # + # @return [String, nil] + optional :website_url, String + + # @!method initialize(token: nil, account_token: nil, beneficial_owner_individuals: nil, business_account_token: nil, business_entity: nil, control_person: nil, created: nil, email: nil, exemption_type: nil, external_id: nil, individual: nil, naics_code: nil, nature_of_business: nil, phone_number: nil, required_documents: nil, status: nil, status_reasons: nil, user_type: nil, verification_application: nil, website_url: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse} for more + # details. + # + # @param token [String] Globally unique identifier for the account holder. + # + # @param account_token [String] Globally unique identifier for the account. + # + # @param beneficial_owner_individuals [Array] Only present when user_type == "BUSINESS". You must submit a list of all direct + # + # @param business_account_token [String, nil] Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # + # @param business_entity [Lithic::Models::KYBBusinessEntity] Only present when user_type == "BUSINESS". Information about the business for wh + # + # @param control_person [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson] Only present when user_type == "BUSINESS". + # + # @param created [Time] Timestamp of when the account holder was created. + # + # @param email [String] (Deprecated. Use control_person.email when user_type == "BUSINESS". + # + # @param exemption_type [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType, nil] The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account + # + # @param external_id [String, nil] Customer-provided token that indicates a relationship with an object outside of + # + # @param individual [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual] Only present when user_type == "INDIVIDUAL". Information about the individual fo + # + # @param naics_code [String, nil] Only present when user_type == "BUSINESS". 6-digit North American Industry Class + # + # @param nature_of_business [String] Only present when user_type == "BUSINESS". User-submitted description of the bus + # + # @param phone_number [String] (Deprecated. Use control_person.phone_number when user_type == "BUSINESS". + # + # @param required_documents [Array] Only present for "KYB_BASIC" and "KYC_ADVANCED" workflows. A list of documents r + # + # @param status [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status] (Deprecated. Use verification_application.status instead) + # + # @param status_reasons [Array] (Deprecated. Use verification_application.status_reasons) + # + # @param user_type [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::UserType] The type of Account Holder. If the type is "INDIVIDUAL", the "individual" attrib + # + # @param verification_application [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication] Information about the most recent identity verification attempt + # + # @param website_url [String] Only present when user_type == "BUSINESS". Business's primary website. + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::Address, nil] + optional :address, + -> { Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!method initialize(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual} + # for more details. + # + # @param address [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::Address] Individual's current address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. If utilizing Lithic for chargeback processing, this + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + + # @see Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual#address + class Address < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!method initialize(address1:, city:, country:, postal_code:, state:, address2: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::Address} + # for more details. + # + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @param address1 [String] Valid deliverable address (no PO boxes). + # + # @param city [String] Name of city. + # + # @param country [String] Valid country code. Only USA is currently supported, entered in uppercase ISO 31 + # + # @param postal_code [String] Valid postal code. Only USA ZIP codes are currently supported, entered as a five + # + # @param state [String] Valid state code. Only USA state codes are currently supported, entered in upper + # + # @param address2 [String] Unit or apartment number (if applicable). + end + end + + # @see Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse#control_person + class ControlPerson < Lithic::Internal::Type::BaseModel + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::Address, nil] + optional :address, + -> { Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!method initialize(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson} + # for more details. + # + # Only present when user_type == "BUSINESS". + # + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, + # + # Managing Member, General Partner, President, Vice President, or Treasurer). This + # can be an executive, or someone who will have program-wide access + # + # to the cards that Lithic will provide. In some cases, this individual could also + # be a beneficial owner listed above. + # + # @param address [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::Address] Individual's current address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. If utilizing Lithic for chargeback processing, this + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + + # @see Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson#address + class Address < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!method initialize(address1:, city:, country:, postal_code:, state:, address2: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::Address} + # for more details. + # + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @param address1 [String] Valid deliverable address (no PO boxes). + # + # @param city [String] Name of city. + # + # @param country [String] Valid country code. Only USA is currently supported, entered in uppercase ISO 31 + # + # @param postal_code [String] Valid postal code. Only USA ZIP codes are currently supported, entered as a five + # + # @param state [String] Valid state code. Only USA state codes are currently supported, entered in upper + # + # @param address2 [String] Unit or apartment number (if applicable). + end + end + + # The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account + # holder is not KYC-Exempt. + # + # @see Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse#exemption_type + module ExemptionType + extend Lithic::Internal::Type::Enum + + AUTHORIZED_USER = :AUTHORIZED_USER + PREPAID_CARD_USER = :PREPAID_CARD_USER + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse#individual + class Individual < Lithic::Internal::Type::BaseModel + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::Address, nil] + optional :address, + -> { Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!method initialize(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual} for + # more details. + # + # Only present when user_type == "INDIVIDUAL". Information about the individual + # for which the account is being opened and KYC is being run. + # + # @param address [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::Address] Individual's current address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. If utilizing Lithic for chargeback processing, this + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + + # @see Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual#address + class Address < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!method initialize(address1:, city:, country:, postal_code:, state:, address2: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::Address} + # for more details. + # + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @param address1 [String] Valid deliverable address (no PO boxes). + # + # @param city [String] Name of city. + # + # @param country [String] Valid country code. Only USA is currently supported, entered in uppercase ISO 31 + # + # @param postal_code [String] Valid postal code. Only USA ZIP codes are currently supported, entered as a five + # + # @param state [String] Valid state code. Only USA state codes are currently supported, entered in upper + # + # @param address2 [String] Unit or apartment number (if applicable). + end + end + + # (Deprecated. Use verification_application.status instead) KYC and KYB evaluation + # states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + # + # @see Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse#status + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED = :ACCEPTED + PENDING_DOCUMENT = :PENDING_DOCUMENT + PENDING_RESUBMIT = :PENDING_RESUBMIT + REJECTED = :REJECTED + + # @!method self.values + # @return [Array] + end + + # Status Reasons for KYC/KYB enrollment states + module StatusReason + extend Lithic::Internal::Type::Enum + + ADDRESS_VERIFICATION_FAILURE = :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE = :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE = :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE = :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE = :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS = :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS = :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE = :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE = :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE = :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE = :WATCHLIST_ALERT_FAILURE + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE = :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE = + :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE = :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED = + :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE = :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED = :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE = :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE = :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE = :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE = :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + CONTROL_PERSON_ID_VERIFICATION_FAILURE = :CONTROL_PERSON_ID_VERIFICATION_FAILURE + CONTROL_PERSON_DOB_VERIFICATION_FAILURE = :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + CONTROL_PERSON_NAME_VERIFICATION_FAILURE = :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + # @!method self.values + # @return [Array] + end + + # The type of Account Holder. If the type is "INDIVIDUAL", the "individual" + # attribute will be present. + # + # If the type is "BUSINESS" then the "business_entity", "control_person", + # "beneficial_owner_individuals", "naics_code", "nature_of_business", and + # "website_url" attributes will be present. + # + # @see Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse#user_type + module UserType + extend Lithic::Internal::Type::Enum + + BUSINESS = :BUSINESS + INDIVIDUAL = :INDIVIDUAL + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse#verification_application + class VerificationApplication < Lithic::Internal::Type::BaseModel + # @!attribute created + # Timestamp of when the application was created. + # + # @return [Time] + required :created, Time + + # @!attribute status + # KYC and KYB evaluation states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + # + # @return [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::Status] + required :status, + enum: -> { Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::Status } + + # @!attribute status_reasons + # Reason for the evaluation status. + # + # @return [Array] + required :status_reasons, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason] } + + # @!attribute updated + # Timestamp of when the application was last updated. + # + # @return [Time] + required :updated, Time + + # @!attribute ky_passed_at + # Timestamp of when the application passed the verification process. Only present + # if `status` is `ACCEPTED` + # + # @return [Time, nil] + optional :ky_passed_at, Time + + # @!method initialize(created:, status:, status_reasons:, updated:, ky_passed_at: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication} + # for more details. + # + # Information about the most recent identity verification attempt + # + # @param created [Time] Timestamp of when the application was created. + # + # @param status [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::Status] KYC and KYB evaluation states. + # + # @param status_reasons [Array] Reason for the evaluation status. + # + # @param updated [Time] Timestamp of when the application was last updated. + # + # @param ky_passed_at [Time] Timestamp of when the application passed the verification process. Only present + + # KYC and KYB evaluation states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + # + # @see Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication#status + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED = :ACCEPTED + PENDING_DOCUMENT = :PENDING_DOCUMENT + PENDING_RESUBMIT = :PENDING_RESUBMIT + REJECTED = :REJECTED + + # @!method self.values + # @return [Array] + end + + # Status Reasons for KYC/KYB enrollment states + module StatusReason + extend Lithic::Internal::Type::Enum + + ADDRESS_VERIFICATION_FAILURE = :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE = :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE = :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE = :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE = :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS = :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS = :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE = :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE = :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE = :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE = :WATCHLIST_ALERT_FAILURE + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE = :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE = + :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE = :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED = + :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE = :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED = :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE = :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE = :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE = :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE = :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + CONTROL_PERSON_ID_VERIFICATION_FAILURE = :CONTROL_PERSON_ID_VERIFICATION_FAILURE + CONTROL_PERSON_DOB_VERIFICATION_FAILURE = :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + CONTROL_PERSON_NAME_VERIFICATION_FAILURE = :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/account_holder_update_params.rb b/lib/lithic/models/account_holder_update_params.rb new file mode 100644 index 00000000..8213b171 --- /dev/null +++ b/lib/lithic/models/account_holder_update_params.rb @@ -0,0 +1,548 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::AccountHolders#update + class AccountHolderUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute account_holder_token + # + # @return [String] + required :account_holder_token, String + + # @!attribute body + # The KYB request payload for updating a business. + # + # @return [Lithic::Models::AccountHolderUpdateParams::Body::KYBPatchRequest, Lithic::Models::AccountHolderUpdateParams::Body::KYCPatchRequest, Lithic::Models::AccountHolderUpdateParams::Body::PatchRequest] + required :body, union: -> { Lithic::AccountHolderUpdateParams::Body } + + # @!method initialize(account_holder_token:, body:, request_options: {}) + # @param account_holder_token [String] + # + # @param body [Lithic::Models::AccountHolderUpdateParams::Body::KYBPatchRequest, Lithic::Models::AccountHolderUpdateParams::Body::KYCPatchRequest, Lithic::Models::AccountHolderUpdateParams::Body::PatchRequest] The KYB request payload for updating a business. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # The KYB request payload for updating a business. + module Body + extend Lithic::Internal::Type::Union + + # The KYB request payload for updating a business. + variant -> { Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest } + + # The KYC request payload for updating an account holder. + variant -> { Lithic::AccountHolderUpdateParams::Body::KYCPatchRequest } + + # The legacy request for updating an account holder. + variant -> { Lithic::AccountHolderUpdateParams::Body::PatchRequest } + + class KYBPatchRequest < Lithic::Internal::Type::BaseModel + # @!attribute beneficial_owner_individuals + # You must submit a list of all direct and indirect individuals with 25% or more + # ownership in the company. A maximum of 4 beneficial owners can be submitted. If + # no individual owns 25% of the company you do not need to send beneficial owner + # information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + # + # @return [Array, nil] + optional :beneficial_owner_individuals, + -> { Lithic::Internal::Type::ArrayOf[Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::BeneficialOwnerIndividual] } + + # @!attribute business_entity + # Information for business for which the account is being opened and KYB is being + # run. + # + # @return [Lithic::Models::AccountHolderUpdateParams::Body::KYBPatchRequest::BusinessEntity, nil] + optional :business_entity, -> { Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::BusinessEntity } + + # @!attribute control_person + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + # + # @return [Lithic::Models::AccountHolderUpdateParams::Body::KYBPatchRequest::ControlPerson, nil] + optional :control_person, -> { Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::ControlPerson } + + # @!attribute external_id + # A user provided id that can be used to link an account holder with an external + # system + # + # @return [String, nil] + optional :external_id, String + + # @!attribute naics_code + # 6-digit North American Industry Classification System (NAICS) code for the + # business. + # + # @return [String, nil] + optional :naics_code, String + + # @!attribute nature_of_business + # Short description of the company's line of business (i.e., what does the company + # do?). Values longer than 255 characters will be truncated before KYB + # verification + # + # @return [String, nil] + optional :nature_of_business, String + + # @!attribute website_url + # Company website URL. + # + # @return [String, nil] + optional :website_url, String + + # @!method initialize(beneficial_owner_individuals: nil, business_entity: nil, control_person: nil, external_id: nil, naics_code: nil, nature_of_business: nil, website_url: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdateParams::Body::KYBPatchRequest} for more + # details. + # + # The KYB request payload for updating a business. + # + # @param beneficial_owner_individuals [Array] You must submit a list of all direct and indirect individuals with 25% or more o + # + # @param business_entity [Lithic::Models::AccountHolderUpdateParams::Body::KYBPatchRequest::BusinessEntity] Information for business for which the account is being opened and KYB is being + # + # @param control_person [Lithic::Models::AccountHolderUpdateParams::Body::KYBPatchRequest::ControlPerson] An individual with significant responsibility for managing the legal entity (e.g + # + # @param external_id [String] A user provided id that can be used to link an account holder with an external s + # + # @param naics_code [String] 6-digit North American Industry Classification System (NAICS) code for the busin + # + # @param nature_of_business [String] Short description of the company's line of business (i.e., what does the company + # + # @param website_url [String] Company website URL. + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + # @!attribute entity_token + # Globally unique identifier for an entity. + # + # @return [String] + required :entity_token, String + + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::AddressUpdate, nil] + optional :address, -> { Lithic::AddressUpdate } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + request_only do + # @!attribute government_id + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + # + # @return [String, nil] + optional :government_id, String + end + + # @!method initialize(entity_token:, address: nil, dob: nil, email: nil, first_name: nil, government_id: nil, last_name: nil, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdateParams::Body::KYBPatchRequest::BeneficialOwnerIndividual} + # for more details. + # + # Individuals associated with a KYB application. Phone number is optional. + # + # @param entity_token [String] Globally unique identifier for an entity. + # + # @param address [Lithic::Models::AddressUpdate] Individual's current address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. If utilizing Lithic for chargeback processing, this + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param government_id [String] Government-issued identification number (required for identity verification and + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + end + + # @see Lithic::Models::AccountHolderUpdateParams::Body::KYBPatchRequest#business_entity + class BusinessEntity < Lithic::Internal::Type::BaseModel + # @!attribute entity_token + # Globally unique identifier for an entity. + # + # @return [String] + required :entity_token, String + + # @!attribute address + # Business''s physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + # + # @return [Lithic::Models::AddressUpdate, nil] + optional :address, -> { Lithic::AddressUpdate } + + # @!attribute dba_business_name + # Any name that the business operates under that is not its legal business name + # (if applicable). + # + # @return [String, nil] + optional :dba_business_name, String + + # @!attribute government_id + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + # + # @return [String, nil] + optional :government_id, String + + # @!attribute legal_business_name + # Legal (formal) business name. + # + # @return [String, nil] + optional :legal_business_name, String + + # @!attribute parent_company + # Parent company name (if applicable). + # + # @return [String, nil] + optional :parent_company, String + + # @!attribute phone_numbers + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + # + # @return [Array, nil] + optional :phone_numbers, Lithic::Internal::Type::ArrayOf[String] + + # @!method initialize(entity_token:, address: nil, dba_business_name: nil, government_id: nil, legal_business_name: nil, parent_company: nil, phone_numbers: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdateParams::Body::KYBPatchRequest::BusinessEntity} + # for more details. + # + # Information for business for which the account is being opened and KYB is being + # run. + # + # @param entity_token [String] Globally unique identifier for an entity. + # + # @param address [Lithic::Models::AddressUpdate] Business''s physical address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param dba_business_name [String] Any name that the business operates under that is not its legal business name (i + # + # @param government_id [String] Government-issued identification number. US Federal Employer Identification Numb + # + # @param legal_business_name [String] Legal (formal) business name. + # + # @param parent_company [String] Parent company name (if applicable). + # + # @param phone_numbers [Array] One or more of the business's phone number(s), entered as a list in E.164 format + end + + # @see Lithic::Models::AccountHolderUpdateParams::Body::KYBPatchRequest#control_person + class ControlPerson < Lithic::Internal::Type::BaseModel + # @!attribute entity_token + # Globally unique identifier for an entity. + # + # @return [String] + required :entity_token, String + + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::AddressUpdate, nil] + optional :address, -> { Lithic::AddressUpdate } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + request_only do + # @!attribute government_id + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + # + # @return [String, nil] + optional :government_id, String + end + + # @!method initialize(entity_token:, address: nil, dob: nil, email: nil, first_name: nil, government_id: nil, last_name: nil, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdateParams::Body::KYBPatchRequest::ControlPerson} + # for more details. + # + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + # + # @param entity_token [String] Globally unique identifier for an entity. + # + # @param address [Lithic::Models::AddressUpdate] Individual's current address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. If utilizing Lithic for chargeback processing, this + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param government_id [String] Government-issued identification number (required for identity verification and + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + end + end + + class KYCPatchRequest < Lithic::Internal::Type::BaseModel + # @!attribute external_id + # A user provided id that can be used to link an account holder with an external + # system + # + # @return [String, nil] + optional :external_id, String + + # @!attribute individual + # Information on the individual for whom the account is being opened and KYC is + # being run. + # + # @return [Lithic::Models::AccountHolderUpdateParams::Body::KYCPatchRequest::Individual, nil] + optional :individual, -> { Lithic::AccountHolderUpdateParams::Body::KYCPatchRequest::Individual } + + # @!method initialize(external_id: nil, individual: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdateParams::Body::KYCPatchRequest} for more + # details. + # + # The KYC request payload for updating an account holder. + # + # @param external_id [String] A user provided id that can be used to link an account holder with an external s + # + # @param individual [Lithic::Models::AccountHolderUpdateParams::Body::KYCPatchRequest::Individual] Information on the individual for whom the account is being opened and KYC is be + + # @see Lithic::Models::AccountHolderUpdateParams::Body::KYCPatchRequest#individual + class Individual < Lithic::Internal::Type::BaseModel + # @!attribute entity_token + # Globally unique identifier for an entity. + # + # @return [String] + required :entity_token, String + + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::AddressUpdate, nil] + optional :address, -> { Lithic::AddressUpdate } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + request_only do + # @!attribute government_id + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + # + # @return [String, nil] + optional :government_id, String + end + + # @!method initialize(entity_token:, address: nil, dob: nil, email: nil, first_name: nil, government_id: nil, last_name: nil, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdateParams::Body::KYCPatchRequest::Individual} + # for more details. + # + # Information on the individual for whom the account is being opened and KYC is + # being run. + # + # @param entity_token [String] Globally unique identifier for an entity. + # + # @param address [Lithic::Models::AddressUpdate] Individual's current address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. If utilizing Lithic for chargeback processing, this + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param government_id [String] Government-issued identification number (required for identity verification and + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + end + end + + class PatchRequest < Lithic::Internal::Type::BaseModel + # @!attribute address + # Allowed for: KYC-Exempt, BYO-KYC, BYO-KYB. + # + # @return [Lithic::Models::AddressUpdate, nil] + optional :address, -> { Lithic::AddressUpdate } + + # @!attribute business_account_token + # Allowed for: KYC-Exempt, BYO-KYC. The token of the business account to which the + # account holder is associated. + # + # @return [String, nil] + optional :business_account_token, String + + # @!attribute email + # Allowed for all Account Holders. Account holder's email address. The primary + # purpose of this field is for cardholder identification and verification during + # the digital wallet tokenization process. + # + # @return [String, nil] + optional :email, String + + # @!attribute first_name + # Allowed for KYC-Exempt, BYO-KYC. Account holder's first name. + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # Allowed for KYC-Exempt, BYO-KYC. Account holder's last name. + # + # @return [String, nil] + optional :last_name, String + + # @!attribute legal_business_name + # Allowed for BYO-KYB. Legal business name of the account holder. + # + # @return [String, nil] + optional :legal_business_name, String + + # @!attribute phone_number + # Allowed for all Account Holders. Account holder's phone number, entered in E.164 + # format. The primary purpose of this field is for cardholder identification and + # verification during the digital wallet tokenization process. + # + # @return [String, nil] + optional :phone_number, String + + # @!method initialize(address: nil, business_account_token: nil, email: nil, first_name: nil, last_name: nil, legal_business_name: nil, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdateParams::Body::PatchRequest} for more + # details. + # + # The legacy request for updating an account holder. + # + # @param address [Lithic::Models::AddressUpdate] Allowed for: KYC-Exempt, BYO-KYC, BYO-KYB. + # + # @param business_account_token [String] Allowed for: KYC-Exempt, BYO-KYC. The token of the business account to which the + # + # @param email [String] Allowed for all Account Holders. Account holder's email address. The primary pur + # + # @param first_name [String] Allowed for KYC-Exempt, BYO-KYC. Account holder's first name. + # + # @param last_name [String] Allowed for KYC-Exempt, BYO-KYC. Account holder's last name. + # + # @param legal_business_name [String] Allowed for BYO-KYB. Legal business name of the account holder. + # + # @param phone_number [String] Allowed for all Account Holders. Account holder's phone number, entered in E.164 + end + + # @!method self.variants + # @return [Array(Lithic::Models::AccountHolderUpdateParams::Body::KYBPatchRequest, Lithic::Models::AccountHolderUpdateParams::Body::KYCPatchRequest, Lithic::Models::AccountHolderUpdateParams::Body::PatchRequest)] + end + end + end +end diff --git a/lib/lithic/models/account_holder_update_response.rb b/lib/lithic/models/account_holder_update_response.rb new file mode 100644 index 00000000..0f8b6b42 --- /dev/null +++ b/lib/lithic/models/account_holder_update_response.rb @@ -0,0 +1,932 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::AccountHolders#update + module AccountHolderUpdateResponse + extend Lithic::Internal::Type::Union + + variant -> { Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse } + + variant -> { Lithic::Models::AccountHolderUpdateResponse::PatchResponse } + + class KYBKYCPatchResponse < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for the account holder. + # + # @return [String, nil] + optional :token, String + + # @!attribute account_token + # Globally unique identifier for the account. + # + # @return [String, nil] + optional :account_token, String + + # @!attribute beneficial_owner_individuals + # Only present when user_type == "BUSINESS". You must submit a list of all direct + # and indirect individuals with 25% or more ownership in the company. A maximum of + # 4 beneficial owners can be submitted. If no individual owns 25% of the company + # you do not need to send beneficial owner information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + # + # @return [Array, nil] + optional :beneficial_owner_individuals, + -> { Lithic::Internal::Type::ArrayOf[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual] } + + # @!attribute business_account_token + # Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # users of businesses. Pass the account_token of the enrolled business associated + # with the AUTHORIZED_USER in this field. + # + # @return [String, nil] + optional :business_account_token, String, nil?: true + + # @!attribute business_entity + # Only present when user_type == "BUSINESS". Information about the business for + # which the account is being opened and KYB is being run. + # + # @return [Lithic::Models::KYBBusinessEntity, nil] + optional :business_entity, -> { Lithic::KYBBusinessEntity } + + # @!attribute control_person + # Only present when user_type == "BUSINESS". + # + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, + # + # Managing Member, General Partner, President, Vice President, or Treasurer). This + # can be an executive, or someone who will have program-wide access + # + # to the cards that Lithic will provide. In some cases, this individual could also + # be a beneficial owner listed above. + # + # @return [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson, nil] + optional :control_person, + -> { Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson } + + # @!attribute created + # Timestamp of when the account holder was created. + # + # @return [Time, nil] + optional :created, Time + + # @!attribute email + # (Deprecated. Use control_person.email when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL".) Primary email of + # Account Holder. + # + # @return [String, nil] + optional :email, String + + # @!attribute exemption_type + # The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account + # holder is not KYC-Exempt. + # + # @return [Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ExemptionType, nil] + optional :exemption_type, + enum: -> { Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ExemptionType } + + # @!attribute external_id + # Customer-provided token that indicates a relationship with an object outside of + # the Lithic ecosystem. + # + # @return [String, nil] + optional :external_id, String + + # @!attribute individual + # Only present when user_type == "INDIVIDUAL". Information about the individual + # for which the account is being opened and KYC is being run. + # + # @return [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual, nil] + optional :individual, -> { Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual } + + # @!attribute naics_code + # Only present when user_type == "BUSINESS". 6-digit North American Industry + # Classification System (NAICS) code for the business. + # + # @return [String, nil] + optional :naics_code, String + + # @!attribute nature_of_business + # Only present when user_type == "BUSINESS". User-submitted description of the + # business. + # + # @return [String, nil] + optional :nature_of_business, String + + # @!attribute phone_number + # (Deprecated. Use control_person.phone_number when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL".) Primary phone of + # Account Holder, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!attribute required_documents + # Only present for "KYB_BASIC" and "KYC_ADVANCED" workflows. A list of documents + # required for the account holder to be approved. + # + # @return [Array, nil] + optional :required_documents, -> { Lithic::Internal::Type::ArrayOf[Lithic::RequiredDocument] } + + # @!attribute status + # (Deprecated. Use verification_application.status instead) KYC and KYB evaluation + # states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + # + # @return [Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Status, nil] + optional :status, enum: -> { Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Status } + + # @!attribute status_reasons + # (Deprecated. Use verification_application.status_reasons) Reason for the + # evaluation status. + # + # @return [Array, nil] + optional :status_reasons, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason] } + + # @!attribute user_type + # The type of Account Holder. If the type is "INDIVIDUAL", the "individual" + # attribute will be present. + # + # If the type is "BUSINESS" then the "business_entity", "control_person", + # "beneficial_owner_individuals", "naics_code", "nature_of_business", and + # "website_url" attributes will be present. + # + # @return [Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::UserType, nil] + optional :user_type, + enum: -> { Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::UserType } + + # @!attribute verification_application + # Information about the most recent identity verification attempt + # + # @return [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication, nil] + optional :verification_application, + -> { Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication } + + # @!attribute website_url + # Only present when user_type == "BUSINESS". Business's primary website. + # + # @return [String, nil] + optional :website_url, String + + # @!method initialize(token: nil, account_token: nil, beneficial_owner_individuals: nil, business_account_token: nil, business_entity: nil, control_person: nil, created: nil, email: nil, exemption_type: nil, external_id: nil, individual: nil, naics_code: nil, nature_of_business: nil, phone_number: nil, required_documents: nil, status: nil, status_reasons: nil, user_type: nil, verification_application: nil, website_url: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse} for more + # details. + # + # @param token [String] Globally unique identifier for the account holder. + # + # @param account_token [String] Globally unique identifier for the account. + # + # @param beneficial_owner_individuals [Array] Only present when user_type == "BUSINESS". You must submit a list of all direct + # + # @param business_account_token [String, nil] Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # + # @param business_entity [Lithic::Models::KYBBusinessEntity] Only present when user_type == "BUSINESS". Information about the business for wh + # + # @param control_person [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson] Only present when user_type == "BUSINESS". + # + # @param created [Time] Timestamp of when the account holder was created. + # + # @param email [String] (Deprecated. Use control_person.email when user_type == "BUSINESS". + # + # @param exemption_type [Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ExemptionType] The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account + # + # @param external_id [String] Customer-provided token that indicates a relationship with an object outside of + # + # @param individual [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual] Only present when user_type == "INDIVIDUAL". Information about the individual fo + # + # @param naics_code [String] Only present when user_type == "BUSINESS". 6-digit North American Industry Class + # + # @param nature_of_business [String] Only present when user_type == "BUSINESS". User-submitted description of the bus + # + # @param phone_number [String] (Deprecated. Use control_person.phone_number when user_type == "BUSINESS". + # + # @param required_documents [Array] Only present for "KYB_BASIC" and "KYC_ADVANCED" workflows. A list of documents r + # + # @param status [Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Status] (Deprecated. Use verification_application.status instead) + # + # @param status_reasons [Array] (Deprecated. Use verification_application.status_reasons) + # + # @param user_type [Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::UserType] The type of Account Holder. If the type is "INDIVIDUAL", the "individual" attrib + # + # @param verification_application [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication] Information about the most recent identity verification attempt + # + # @param website_url [String] Only present when user_type == "BUSINESS". Business's primary website. + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::Address, nil] + optional :address, + -> { Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!method initialize(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual} + # for more details. + # + # @param address [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::Address] Individual's current address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. If utilizing Lithic for chargeback processing, this + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + + # @see Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual#address + class Address < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!method initialize(address1:, city:, country:, postal_code:, state:, address2: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::Address} + # for more details. + # + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @param address1 [String] Valid deliverable address (no PO boxes). + # + # @param city [String] Name of city. + # + # @param country [String] Valid country code. Only USA is currently supported, entered in uppercase ISO 31 + # + # @param postal_code [String] Valid postal code. Only USA ZIP codes are currently supported, entered as a five + # + # @param state [String] Valid state code. Only USA state codes are currently supported, entered in upper + # + # @param address2 [String] Unit or apartment number (if applicable). + end + end + + # @see Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse#control_person + class ControlPerson < Lithic::Internal::Type::BaseModel + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::Address, nil] + optional :address, + -> { Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!method initialize(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson} + # for more details. + # + # Only present when user_type == "BUSINESS". + # + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, + # + # Managing Member, General Partner, President, Vice President, or Treasurer). This + # can be an executive, or someone who will have program-wide access + # + # to the cards that Lithic will provide. In some cases, this individual could also + # be a beneficial owner listed above. + # + # @param address [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::Address] Individual's current address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. If utilizing Lithic for chargeback processing, this + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + + # @see Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson#address + class Address < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!method initialize(address1:, city:, country:, postal_code:, state:, address2: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::Address} + # for more details. + # + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @param address1 [String] Valid deliverable address (no PO boxes). + # + # @param city [String] Name of city. + # + # @param country [String] Valid country code. Only USA is currently supported, entered in uppercase ISO 31 + # + # @param postal_code [String] Valid postal code. Only USA ZIP codes are currently supported, entered as a five + # + # @param state [String] Valid state code. Only USA state codes are currently supported, entered in upper + # + # @param address2 [String] Unit or apartment number (if applicable). + end + end + + # The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account + # holder is not KYC-Exempt. + # + # @see Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse#exemption_type + module ExemptionType + extend Lithic::Internal::Type::Enum + + AUTHORIZED_USER = :AUTHORIZED_USER + PREPAID_CARD_USER = :PREPAID_CARD_USER + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse#individual + class Individual < Lithic::Internal::Type::BaseModel + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::Address, nil] + optional :address, + -> { Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!method initialize(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual} + # for more details. + # + # Only present when user_type == "INDIVIDUAL". Information about the individual + # for which the account is being opened and KYC is being run. + # + # @param address [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::Address] Individual's current address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. If utilizing Lithic for chargeback processing, this + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + + # @see Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual#address + class Address < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!method initialize(address1:, city:, country:, postal_code:, state:, address2: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::Address} + # for more details. + # + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @param address1 [String] Valid deliverable address (no PO boxes). + # + # @param city [String] Name of city. + # + # @param country [String] Valid country code. Only USA is currently supported, entered in uppercase ISO 31 + # + # @param postal_code [String] Valid postal code. Only USA ZIP codes are currently supported, entered as a five + # + # @param state [String] Valid state code. Only USA state codes are currently supported, entered in upper + # + # @param address2 [String] Unit or apartment number (if applicable). + end + end + + # (Deprecated. Use verification_application.status instead) KYC and KYB evaluation + # states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + # + # @see Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse#status + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED = :ACCEPTED + PENDING_DOCUMENT = :PENDING_DOCUMENT + PENDING_RESUBMIT = :PENDING_RESUBMIT + REJECTED = :REJECTED + + # @!method self.values + # @return [Array] + end + + # Status Reasons for KYC/KYB enrollment states + module StatusReason + extend Lithic::Internal::Type::Enum + + ADDRESS_VERIFICATION_FAILURE = :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE = :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE = :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE = :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE = :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS = :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS = :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE = :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE = :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE = :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE = :WATCHLIST_ALERT_FAILURE + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE = :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE = + :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE = :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED = + :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE = :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED = :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE = :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE = :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE = :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE = :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + CONTROL_PERSON_ID_VERIFICATION_FAILURE = :CONTROL_PERSON_ID_VERIFICATION_FAILURE + CONTROL_PERSON_DOB_VERIFICATION_FAILURE = :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + CONTROL_PERSON_NAME_VERIFICATION_FAILURE = :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + # @!method self.values + # @return [Array] + end + + # The type of Account Holder. If the type is "INDIVIDUAL", the "individual" + # attribute will be present. + # + # If the type is "BUSINESS" then the "business_entity", "control_person", + # "beneficial_owner_individuals", "naics_code", "nature_of_business", and + # "website_url" attributes will be present. + # + # @see Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse#user_type + module UserType + extend Lithic::Internal::Type::Enum + + BUSINESS = :BUSINESS + INDIVIDUAL = :INDIVIDUAL + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse#verification_application + class VerificationApplication < Lithic::Internal::Type::BaseModel + # @!attribute created + # Timestamp of when the application was created. + # + # @return [Time] + required :created, Time + + # @!attribute status + # KYC and KYB evaluation states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + # + # @return [Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::Status] + required :status, + enum: -> { Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::Status } + + # @!attribute status_reasons + # Reason for the evaluation status. + # + # @return [Array] + required :status_reasons, + -> do + Lithic::Internal::Type::ArrayOf[ + enum: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason + ] + end + + # @!attribute updated + # Timestamp of when the application was last updated. + # + # @return [Time] + required :updated, Time + + # @!attribute ky_passed_at + # Timestamp of when the application passed the verification process. Only present + # if `status` is `ACCEPTED` + # + # @return [Time, nil] + optional :ky_passed_at, Time + + # @!method initialize(created:, status:, status_reasons:, updated:, ky_passed_at: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication} + # for more details. + # + # Information about the most recent identity verification attempt + # + # @param created [Time] Timestamp of when the application was created. + # + # @param status [Symbol, Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::Status] KYC and KYB evaluation states. + # + # @param status_reasons [Array] Reason for the evaluation status. + # + # @param updated [Time] Timestamp of when the application was last updated. + # + # @param ky_passed_at [Time] Timestamp of when the application passed the verification process. Only present + + # KYC and KYB evaluation states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + # + # @see Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication#status + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED = :ACCEPTED + PENDING_DOCUMENT = :PENDING_DOCUMENT + PENDING_RESUBMIT = :PENDING_RESUBMIT + REJECTED = :REJECTED + + # @!method self.values + # @return [Array] + end + + # Status Reasons for KYC/KYB enrollment states + module StatusReason + extend Lithic::Internal::Type::Enum + + ADDRESS_VERIFICATION_FAILURE = :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE = :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE = :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE = :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE = :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS = :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS = :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE = :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE = :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE = :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE = :WATCHLIST_ALERT_FAILURE + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE = :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE = + :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE = :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED = + :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE = :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED = :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE = :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE = :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE = :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE = :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + CONTROL_PERSON_ID_VERIFICATION_FAILURE = :CONTROL_PERSON_ID_VERIFICATION_FAILURE + CONTROL_PERSON_DOB_VERIFICATION_FAILURE = :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + CONTROL_PERSON_NAME_VERIFICATION_FAILURE = :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + # @!method self.values + # @return [Array] + end + end + end + + class PatchResponse < Lithic::Internal::Type::BaseModel + # @!attribute token + # The token for the account holder that was updated + # + # @return [String, nil] + optional :token, String + + # @!attribute address + # The address for the account holder + # + # @return [Lithic::Models::AccountHolderUpdateResponse::PatchResponse::Address, nil] + optional :address, -> { Lithic::Models::AccountHolderUpdateResponse::PatchResponse::Address } + + # @!attribute business_account_token + # The token for the business account that the account holder is associated with + # + # @return [String, nil] + optional :business_account_token, String, nil?: true + + # @!attribute email + # The email for the account holder + # + # @return [String, nil] + optional :email, String + + # @!attribute first_name + # The first name for the account holder + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # The last name for the account holder + # + # @return [String, nil] + optional :last_name, String + + # @!attribute legal_business_name + # The legal business name for the account holder + # + # @return [String, nil] + optional :legal_business_name, String + + # @!attribute phone_number + # The phone_number for the account holder + # + # @return [String, nil] + optional :phone_number, String + + # @!method initialize(token: nil, address: nil, business_account_token: nil, email: nil, first_name: nil, last_name: nil, legal_business_name: nil, phone_number: nil) + # @param token [String] The token for the account holder that was updated + # + # @param address [Lithic::Models::AccountHolderUpdateResponse::PatchResponse::Address] The address for the account holder + # + # @param business_account_token [String, nil] The token for the business account that the account holder is associated with + # + # @param email [String] The email for the account holder + # + # @param first_name [String] The first name for the account holder + # + # @param last_name [String] The last name for the account holder + # + # @param legal_business_name [String] The legal business name for the account holder + # + # @param phone_number [String] The phone_number for the account holder + + # @see Lithic::Models::AccountHolderUpdateResponse::PatchResponse#address + class Address < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!method initialize(address1:, city:, country:, postal_code:, state:, address2: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdateResponse::PatchResponse::Address} for more + # details. + # + # The address for the account holder + # + # @param address1 [String] Valid deliverable address (no PO boxes). + # + # @param city [String] Name of city. + # + # @param country [String] Valid country code. Only USA is currently supported, entered in uppercase ISO 31 + # + # @param postal_code [String] Valid postal code. Only USA ZIP codes are currently supported, entered as a five + # + # @param state [String] Valid state code. Only USA state codes are currently supported, entered in upper + # + # @param address2 [String] Unit or apartment number (if applicable). + end + end + + # @!method self.variants + # @return [Array(Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse, Lithic::Models::AccountHolderUpdateResponse::PatchResponse)] + end + end +end diff --git a/lib/lithic/models/account_holder_updated_webhook_event.rb b/lib/lithic/models/account_holder_updated_webhook_event.rb new file mode 100644 index 00000000..7969a102 --- /dev/null +++ b/lib/lithic/models/account_holder_updated_webhook_event.rb @@ -0,0 +1,702 @@ +# frozen_string_literal: true + +module Lithic + module Models + # KYB payload for an updated account holder. + module AccountHolderUpdatedWebhookEvent + extend Lithic::Internal::Type::Union + + # KYB payload for an updated account holder. + variant -> { Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload } + + # KYC payload for an updated account holder. + variant -> { Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload } + + # Legacy payload for an updated account holder. + variant -> { Lithic::AccountHolderUpdatedWebhookEvent::LegacyPayload } + + class KYBPayload < Lithic::Internal::Type::BaseModel + # @!attribute token + # The token of the account_holder that was created. + # + # @return [String] + required :token, String + + # @!attribute update_request + # Original request to update the account holder. + # + # @return [Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest] + required :update_request, -> { Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest } + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::EventType, nil] + optional :event_type, enum: -> { Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::EventType } + + # @!attribute external_id + # A user provided id that can be used to link an account holder with an external + # system + # + # @return [String, nil] + optional :external_id, String + + # @!attribute naics_code + # 6-digit North American Industry Classification System (NAICS) code for the + # business. Only present if naics_code was included in the update request. + # + # @return [String, nil] + optional :naics_code, String + + # @!attribute nature_of_business + # Short description of the company's line of business (i.e., what does the company + # do?). Values longer than 255 characters will be truncated before KYB + # verification + # + # @return [String, nil] + optional :nature_of_business, String + + # @!attribute website_url + # Company website URL. + # + # @return [String, nil] + optional :website_url, String + + # @!method initialize(token:, update_request:, event_type: nil, external_id: nil, naics_code: nil, nature_of_business: nil, website_url: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload} for more details. + # + # KYB payload for an updated account holder. + # + # @param token [String] The token of the account_holder that was created. + # + # @param update_request [Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest] Original request to update the account holder. + # + # @param event_type [Symbol, Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::EventType] The type of event that occurred. + # + # @param external_id [String] A user provided id that can be used to link an account holder with an external s + # + # @param naics_code [String] 6-digit North American Industry Classification System (NAICS) code for the busin + # + # @param nature_of_business [String] Short description of the company's line of business (i.e., what does the company + # + # @param website_url [String] Company website URL. + + # @see Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload#update_request + class UpdateRequest < Lithic::Internal::Type::BaseModel + # @!attribute beneficial_owner_individuals + # You must submit a list of all direct and indirect individuals with 25% or more + # ownership in the company. A maximum of 4 beneficial owners can be submitted. If + # no individual owns 25% of the company you do not need to send beneficial owner + # information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + # + # @return [Array, nil] + optional :beneficial_owner_individuals, + -> { Lithic::Internal::Type::ArrayOf[Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual] } + + # @!attribute business_entity + # Information for business for which the account is being opened and KYB is being + # run. + # + # @return [Lithic::Models::KYBBusinessEntity, nil] + optional :business_entity, -> { Lithic::KYBBusinessEntity } + + # @!attribute control_person + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + # + # @return [Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson, nil] + optional :control_person, + -> { Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson } + + # @!method initialize(beneficial_owner_individuals: nil, business_entity: nil, control_person: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest} + # for more details. + # + # Original request to update the account holder. + # + # @param beneficial_owner_individuals [Array] You must submit a list of all direct and indirect individuals with 25% or more o + # + # @param business_entity [Lithic::Models::KYBBusinessEntity] Information for business for which the account is being opened and KYB is being + # + # @param control_person [Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson] An individual with significant responsibility for managing the legal entity (e.g + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address, nil] + optional :address, + -> { Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!method initialize(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual} + # for more details. + # + # @param address [Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address] Individual's current address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. If utilizing Lithic for chargeback processing, this + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + + # @see Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual#address + class Address < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!method initialize(address1:, city:, country:, postal_code:, state:, address2: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address} + # for more details. + # + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @param address1 [String] Valid deliverable address (no PO boxes). + # + # @param city [String] Name of city. + # + # @param country [String] Valid country code. Only USA is currently supported, entered in uppercase ISO 31 + # + # @param postal_code [String] Valid postal code. Only USA ZIP codes are currently supported, entered as a five + # + # @param state [String] Valid state code. Only USA state codes are currently supported, entered in upper + # + # @param address2 [String] Unit or apartment number (if applicable). + end + end + + # @see Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest#control_person + class ControlPerson < Lithic::Internal::Type::BaseModel + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address, nil] + optional :address, + -> { Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!method initialize(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson} + # for more details. + # + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + # + # @param address [Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address] Individual's current address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. If utilizing Lithic for chargeback processing, this + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + + # @see Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson#address + class Address < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!method initialize(address1:, city:, country:, postal_code:, state:, address2: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address} + # for more details. + # + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @param address1 [String] Valid deliverable address (no PO boxes). + # + # @param city [String] Name of city. + # + # @param country [String] Valid country code. Only USA is currently supported, entered in uppercase ISO 31 + # + # @param postal_code [String] Valid postal code. Only USA ZIP codes are currently supported, entered as a five + # + # @param state [String] Valid state code. Only USA state codes are currently supported, entered in upper + # + # @param address2 [String] Unit or apartment number (if applicable). + end + end + end + + # The type of event that occurred. + # + # @see Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload#event_type + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_UPDATED = :"account_holder.updated" + + # @!method self.values + # @return [Array] + end + end + + class KYCPayload < Lithic::Internal::Type::BaseModel + # @!attribute token + # The token of the account_holder that was created. + # + # @return [String] + required :token, String + + # @!attribute update_request + # Original request to update the account holder. + # + # @return [Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest] + required :update_request, -> { Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest } + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::EventType, nil] + optional :event_type, enum: -> { Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::EventType } + + # @!attribute external_id + # A user provided id that can be used to link an account holder with an external + # system + # + # @return [String, nil] + optional :external_id, String + + # @!method initialize(token:, update_request:, event_type: nil, external_id: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload} for more details. + # + # KYC payload for an updated account holder. + # + # @param token [String] The token of the account_holder that was created. + # + # @param update_request [Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest] Original request to update the account holder. + # + # @param event_type [Symbol, Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::EventType] The type of event that occurred. + # + # @param external_id [String] A user provided id that can be used to link an account holder with an external s + + # @see Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload#update_request + class UpdateRequest < Lithic::Internal::Type::BaseModel + # @!attribute individual + # Information on the individual for whom the account is being opened and KYC is + # being run. + # + # @return [Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual, nil] + optional :individual, + -> { Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual } + + # @!method initialize(individual: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest} + # for more details. + # + # Original request to update the account holder. + # + # @param individual [Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual] Information on the individual for whom the account is being opened and KYC is be + + # @see Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest#individual + class Individual < Lithic::Internal::Type::BaseModel + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address, nil] + optional :address, + -> { Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!method initialize(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual} + # for more details. + # + # Information on the individual for whom the account is being opened and KYC is + # being run. + # + # @param address [Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address] Individual's current address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. If utilizing Lithic for chargeback processing, this + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + + # @see Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual#address + class Address < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!method initialize(address1:, city:, country:, postal_code:, state:, address2: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address} + # for more details. + # + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @param address1 [String] Valid deliverable address (no PO boxes). + # + # @param city [String] Name of city. + # + # @param country [String] Valid country code. Only USA is currently supported, entered in uppercase ISO 31 + # + # @param postal_code [String] Valid postal code. Only USA ZIP codes are currently supported, entered as a five + # + # @param state [String] Valid state code. Only USA state codes are currently supported, entered in upper + # + # @param address2 [String] Unit or apartment number (if applicable). + end + end + end + + # The type of event that occurred. + # + # @see Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload#event_type + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_UPDATED = :"account_holder.updated" + + # @!method self.values + # @return [Array] + end + end + + class LegacyPayload < Lithic::Internal::Type::BaseModel + # @!attribute token + # The token of the account_holder that was created. + # + # @return [String] + required :token, String + + # @!attribute business_account_token + # If applicable, represents the business account token associated with the + # account_holder. + # + # @return [String, nil] + optional :business_account_token, String, nil?: true + + # @!attribute created + # When the account_holder updated event was created + # + # @return [Time, nil] + optional :created, Time + + # @!attribute email + # If updated, the newly updated email associated with the account_holder otherwise + # the existing email is provided. + # + # @return [String, nil] + optional :email, String + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, Lithic::Models::AccountHolderUpdatedWebhookEvent::LegacyPayload::EventType, nil] + optional :event_type, enum: -> { Lithic::AccountHolderUpdatedWebhookEvent::LegacyPayload::EventType } + + # @!attribute external_id + # If applicable, represents the external_id associated with the account_holder. + # + # @return [String, nil] + optional :external_id, String, nil?: true + + # @!attribute first_name + # If applicable, represents the account_holder's first name. + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # If applicable, represents the account_holder's last name. + # + # @return [String, nil] + optional :last_name, String + + # @!attribute legal_business_name + # If applicable, represents the account_holder's business name. + # + # @return [String, nil] + optional :legal_business_name, String + + # @!attribute phone_number + # If updated, the newly updated phone_number associated with the account_holder + # otherwise the existing phone_number is provided. + # + # @return [String, nil] + optional :phone_number, String + + # @!method initialize(token:, business_account_token: nil, created: nil, email: nil, event_type: nil, external_id: nil, first_name: nil, last_name: nil, legal_business_name: nil, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderUpdatedWebhookEvent::LegacyPayload} for more + # details. + # + # Legacy payload for an updated account holder. + # + # @param token [String] The token of the account_holder that was created. + # + # @param business_account_token [String, nil] If applicable, represents the business account token associated with the account + # + # @param created [Time] When the account_holder updated event was created + # + # @param email [String] If updated, the newly updated email associated with the account_holder otherwise + # + # @param event_type [Symbol, Lithic::Models::AccountHolderUpdatedWebhookEvent::LegacyPayload::EventType] The type of event that occurred. + # + # @param external_id [String, nil] If applicable, represents the external_id associated with the account_holder. + # + # @param first_name [String] If applicable, represents the account_holder's first name. + # + # @param last_name [String] If applicable, represents the account_holder's last name. + # + # @param legal_business_name [String] If applicable, represents the account_holder's business name. + # + # @param phone_number [String] If updated, the newly updated phone_number associated with the account_holder ot + + # The type of event that occurred. + # + # @see Lithic::Models::AccountHolderUpdatedWebhookEvent::LegacyPayload#event_type + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_UPDATED = :"account_holder.updated" + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload, Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload, Lithic::Models::AccountHolderUpdatedWebhookEvent::LegacyPayload)] + end + end +end diff --git a/lib/lithic/models/account_holder_upload_document_params.rb b/lib/lithic/models/account_holder_upload_document_params.rb new file mode 100644 index 00000000..471e7b5d --- /dev/null +++ b/lib/lithic/models/account_holder_upload_document_params.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::AccountHolders#upload_document + class AccountHolderUploadDocumentParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute account_holder_token + # + # @return [String] + required :account_holder_token, String + + # @!attribute document_type + # The type of document to upload + # + # @return [Symbol, Lithic::Models::AccountHolderUploadDocumentParams::DocumentType] + required :document_type, enum: -> { Lithic::AccountHolderUploadDocumentParams::DocumentType } + + # @!attribute entity_token + # Globally unique identifier for the entity. + # + # @return [String] + required :entity_token, String + + # @!method initialize(account_holder_token:, document_type:, entity_token:, request_options: {}) + # @param account_holder_token [String] + # + # @param document_type [Symbol, Lithic::Models::AccountHolderUploadDocumentParams::DocumentType] The type of document to upload + # + # @param entity_token [String] Globally unique identifier for the entity. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # The type of document to upload + module DocumentType + extend Lithic::Internal::Type::Enum + + EIN_LETTER = :EIN_LETTER + TAX_RETURN = :TAX_RETURN + OPERATING_AGREEMENT = :OPERATING_AGREEMENT + CERTIFICATE_OF_FORMATION = :CERTIFICATE_OF_FORMATION + DRIVERS_LICENSE = :DRIVERS_LICENSE + PASSPORT = :PASSPORT + PASSPORT_CARD = :PASSPORT_CARD + CERTIFICATE_OF_GOOD_STANDING = :CERTIFICATE_OF_GOOD_STANDING + ARTICLES_OF_INCORPORATION = :ARTICLES_OF_INCORPORATION + ARTICLES_OF_ORGANIZATION = :ARTICLES_OF_ORGANIZATION + BYLAWS = :BYLAWS + GOVERNMENT_BUSINESS_LICENSE = :GOVERNMENT_BUSINESS_LICENSE + PARTNERSHIP_AGREEMENT = :PARTNERSHIP_AGREEMENT + SS4_FORM = :SS4_FORM + BANK_STATEMENT = :BANK_STATEMENT + UTILITY_BILL_STATEMENT = :UTILITY_BILL_STATEMENT + SSN_CARD = :SSN_CARD + ITIN_LETTER = :ITIN_LETTER + FINCEN_BOI_REPORT = :FINCEN_BOI_REPORT + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/account_holder_verification_webhook_event.rb b/lib/lithic/models/account_holder_verification_webhook_event.rb new file mode 100644 index 00000000..0fbb60d1 --- /dev/null +++ b/lib/lithic/models/account_holder_verification_webhook_event.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AccountHolderVerificationWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"account_holder.verification"] + required :event_type, const: :"account_holder.verification" + + # @!attribute token + # The token of the account_holder being verified. + # + # @return [String, nil] + optional :token, String + + # @!attribute account_token + # The token of the account being verified. + # + # @return [String, nil] + optional :account_token, String + + # @!attribute created + # When the account_holder verification status was updated + # + # @return [Time, nil] + optional :created, Time + + # @!attribute status + # The status of the account_holder that was created + # + # @return [Symbol, Lithic::Models::AccountHolderVerificationWebhookEvent::Status, nil] + optional :status, enum: -> { Lithic::AccountHolderVerificationWebhookEvent::Status } + + # @!attribute status_reasons + # + # @return [Array, nil] + optional :status_reasons, Lithic::Internal::Type::ArrayOf[String] + + # @!method initialize(token: nil, account_token: nil, created: nil, status: nil, status_reasons: nil, event_type: :"account_holder.verification") + # @param token [String] The token of the account_holder being verified. + # + # @param account_token [String] The token of the account being verified. + # + # @param created [Time] When the account_holder verification status was updated + # + # @param status [Symbol, Lithic::Models::AccountHolderVerificationWebhookEvent::Status] The status of the account_holder that was created + # + # @param status_reasons [Array] + # + # @param event_type [Symbol, :"account_holder.verification"] The type of event that occurred. + + # The status of the account_holder that was created + # + # @see Lithic::Models::AccountHolderVerificationWebhookEvent#status + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED = :ACCEPTED + PENDING_REVIEW = :PENDING_REVIEW + REJECTED = :REJECTED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/account_holders/account_holder_entity.rb b/lib/lithic/models/account_holders/account_holder_entity.rb new file mode 100644 index 00000000..14c63cc0 --- /dev/null +++ b/lib/lithic/models/account_holders/account_holder_entity.rb @@ -0,0 +1,170 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AccountHolders + # @see Lithic::Resources::AccountHolders::Entities#delete + class AccountHolderEntity < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for the entity + # + # @return [String] + required :token, String + + # @!attribute account_holder_token + # Globally unique identifier for the account holder + # + # @return [String] + required :account_holder_token, String + + # @!attribute address + # Individual's current address + # + # @return [Lithic::Models::AccountHolders::AccountHolderEntity::Address] + required :address, -> { Lithic::AccountHolders::AccountHolderEntity::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date + # + # @return [String, nil] + required :dob, String, nil?: true + + # @!attribute email + # Individual's email address + # + # @return [String, nil] + required :email, String, nil?: true + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents + # + # @return [String, nil] + required :first_name, String, nil?: true + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents + # + # @return [String, nil] + required :last_name, String, nil?: true + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format + # + # @return [String, nil] + required :phone_number, String, nil?: true + + # @!attribute status + # The status of the entity + # + # @return [Symbol, Lithic::Models::AccountHolders::AccountHolderEntity::Status] + required :status, enum: -> { Lithic::AccountHolders::AccountHolderEntity::Status } + + # @!attribute type + # The type of entity + # + # @return [Symbol, Lithic::Models::TransactionMonitoring::EntityType] + required :type, enum: -> { Lithic::TransactionMonitoring::EntityType } + + # @!method initialize(token:, account_holder_token:, address:, dob:, email:, first_name:, last_name:, phone_number:, status:, type:) + # Information about an entity associated with an account holder + # + # @param token [String] Globally unique identifier for the entity + # + # @param account_holder_token [String] Globally unique identifier for the account holder + # + # @param address [Lithic::Models::AccountHolders::AccountHolderEntity::Address] Individual's current address + # + # @param dob [String, nil] Individual's date of birth, as an RFC 3339 date + # + # @param email [String, nil] Individual's email address + # + # @param first_name [String, nil] Individual's first name, as it appears on government-issued identity documents + # + # @param last_name [String, nil] Individual's last name, as it appears on government-issued identity documents + # + # @param phone_number [String, nil] Individual's phone number, entered in E.164 format + # + # @param status [Symbol, Lithic::Models::AccountHolders::AccountHolderEntity::Status] The status of the entity + # + # @param type [Symbol, Lithic::Models::TransactionMonitoring::EntityType] The type of entity + + # @see Lithic::Models::AccountHolders::AccountHolderEntity#address + class Address < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!method initialize(address1:, city:, country:, postal_code:, state:, address2: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolders::AccountHolderEntity::Address} for more details. + # + # Individual's current address + # + # @param address1 [String] Valid deliverable address (no PO boxes). + # + # @param city [String] Name of city. + # + # @param country [String] Valid country code. Only USA is currently supported, entered in uppercase ISO 31 + # + # @param postal_code [String] Valid postal code. Only USA ZIP codes are currently supported, entered as a five + # + # @param state [String] Valid state code. Only USA state codes are currently supported, entered in upper + # + # @param address2 [String] Unit or apartment number (if applicable). + end + + # The status of the entity + # + # @see Lithic::Models::AccountHolders::AccountHolderEntity#status + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED = :ACCEPTED + INACTIVE = :INACTIVE + PENDING_REVIEW = :PENDING_REVIEW + REJECTED = :REJECTED + + # @!method self.values + # @return [Array] + end + end + end + + AccountHolderEntity = AccountHolders::AccountHolderEntity + end +end diff --git a/lib/lithic/models/account_holders/entity_create_params.rb b/lib/lithic/models/account_holders/entity_create_params.rb new file mode 100644 index 00000000..ad236750 --- /dev/null +++ b/lib/lithic/models/account_holders/entity_create_params.rb @@ -0,0 +1,155 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AccountHolders + # @see Lithic::Resources::AccountHolders::Entities#create + class EntityCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute account_holder_token + # + # @return [String] + required :account_holder_token, String + + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::AccountHolders::EntityCreateParams::Address] + required :address, -> { Lithic::AccountHolders::EntityCreateParams::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String] + required :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String] + required :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String] + required :first_name, String + + # @!attribute government_id + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + # + # @return [String] + required :government_id, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String] + required :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String] + required :phone_number, String + + # @!attribute type + # The type of entity to create on the account holder + # + # @return [Symbol, Lithic::Models::TransactionMonitoring::EntityType] + required :type, enum: -> { Lithic::TransactionMonitoring::EntityType } + + # @!method initialize(account_holder_token:, address:, dob:, email:, first_name:, government_id:, last_name:, phone_number:, type:, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolders::EntityCreateParams} for more details. + # + # @param account_holder_token [String] + # + # @param address [Lithic::Models::AccountHolders::EntityCreateParams::Address] Individual's current address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. If utilizing Lithic for chargeback processing, this + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param government_id [String] Government-issued identification number (required for identity verification and + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + # + # @param type [Symbol, Lithic::Models::TransactionMonitoring::EntityType] The type of entity to create on the account holder + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + class Address < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!method initialize(address1:, city:, country:, postal_code:, state:, address2: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolders::EntityCreateParams::Address} for more details. + # + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @param address1 [String] Valid deliverable address (no PO boxes). + # + # @param city [String] Name of city. + # + # @param country [String] Valid country code. Only USA is currently supported, entered in uppercase ISO 31 + # + # @param postal_code [String] Valid postal code. Only USA ZIP codes are currently supported, entered as a five + # + # @param state [String] Valid state code. Only USA state codes are currently supported, entered in upper + # + # @param address2 [String] Unit or apartment number (if applicable). + end + end + end + end +end diff --git a/lib/lithic/models/account_holders/entity_create_response.rb b/lib/lithic/models/account_holders/entity_create_response.rb new file mode 100644 index 00000000..11dcff5b --- /dev/null +++ b/lib/lithic/models/account_holders/entity_create_response.rb @@ -0,0 +1,113 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AccountHolders + # @see Lithic::Resources::AccountHolders::Entities#create + class EntityCreateResponse < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for the entity + # + # @return [String] + required :token, String + + # @!attribute account_holder_token + # Globally unique identifier for the account holder + # + # @return [String] + required :account_holder_token, String + + # @!attribute created + # Timestamp of when the entity was created + # + # @return [Time] + required :created, Time + + # @!attribute required_documents + # A list of documents required for the entity to be approved + # + # @return [Array] + required :required_documents, -> { Lithic::Internal::Type::ArrayOf[Lithic::RequiredDocument] } + + # @!attribute status + # Entity verification status + # + # @return [Symbol, Lithic::Models::AccountHolders::EntityCreateResponse::Status] + required :status, enum: -> { Lithic::Models::AccountHolders::EntityCreateResponse::Status } + + # @!attribute status_reasons + # Reason for the evaluation status + # + # @return [Array] + required :status_reasons, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason] } + + # @!method initialize(token:, account_holder_token:, created:, required_documents:, status:, status_reasons:) + # Response body for creating a new beneficial owner or replacing the control + # person entity on an existing KYB account holder. + # + # @param token [String] Globally unique identifier for the entity + # + # @param account_holder_token [String] Globally unique identifier for the account holder + # + # @param created [Time] Timestamp of when the entity was created + # + # @param required_documents [Array] A list of documents required for the entity to be approved + # + # @param status [Symbol, Lithic::Models::AccountHolders::EntityCreateResponse::Status] Entity verification status + # + # @param status_reasons [Array] Reason for the evaluation status + + # Entity verification status + # + # @see Lithic::Models::AccountHolders::EntityCreateResponse#status + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED = :ACCEPTED + INACTIVE = :INACTIVE + PENDING_REVIEW = :PENDING_REVIEW + REJECTED = :REJECTED + + # @!method self.values + # @return [Array] + end + + # Status Reasons for KYC/KYB enrollment states + module StatusReason + extend Lithic::Internal::Type::Enum + + ADDRESS_VERIFICATION_FAILURE = :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE = :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE = :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE = :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE = :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS = :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS = :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE = :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE = :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE = :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE = :WATCHLIST_ALERT_FAILURE + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE = :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE = + :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE = :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED = + :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE = :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED = :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE = :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE = :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE = :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE = :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + CONTROL_PERSON_ID_VERIFICATION_FAILURE = :CONTROL_PERSON_ID_VERIFICATION_FAILURE + CONTROL_PERSON_DOB_VERIFICATION_FAILURE = :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + CONTROL_PERSON_NAME_VERIFICATION_FAILURE = :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/account_holders/entity_delete_params.rb b/lib/lithic/models/account_holders/entity_delete_params.rb new file mode 100644 index 00000000..06b88b6d --- /dev/null +++ b/lib/lithic/models/account_holders/entity_delete_params.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AccountHolders + # @see Lithic::Resources::AccountHolders::Entities#delete + class EntityDeleteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute account_holder_token + # + # @return [String] + required :account_holder_token, String + + # @!attribute entity_token + # + # @return [String] + required :entity_token, String + + # @!method initialize(account_holder_token:, entity_token:, request_options: {}) + # @param account_holder_token [String] + # @param entity_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/account_list_params.rb b/lib/lithic/models/account_list_params.rb new file mode 100644 index 00000000..28a35ca6 --- /dev/null +++ b/lib/lithic/models/account_list_params.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Accounts#list + class AccountListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time + + # @!attribute end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!method initialize(begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountListParams} for more details. + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/account_retrieve_params.rb b/lib/lithic/models/account_retrieve_params.rb new file mode 100644 index 00000000..49e05744 --- /dev/null +++ b/lib/lithic/models/account_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Accounts#retrieve + class AccountRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute account_token + # + # @return [String] + required :account_token, String + + # @!method initialize(account_token:, request_options: {}) + # @param account_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/account_retrieve_signals_params.rb b/lib/lithic/models/account_retrieve_signals_params.rb new file mode 100644 index 00000000..27465948 --- /dev/null +++ b/lib/lithic/models/account_retrieve_signals_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Accounts#retrieve_signals + class AccountRetrieveSignalsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute account_token + # + # @return [String] + required :account_token, String + + # @!method initialize(account_token:, request_options: {}) + # @param account_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/account_retrieve_spend_limits_params.rb b/lib/lithic/models/account_retrieve_spend_limits_params.rb new file mode 100644 index 00000000..5a255305 --- /dev/null +++ b/lib/lithic/models/account_retrieve_spend_limits_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Accounts#retrieve_spend_limits + class AccountRetrieveSpendLimitsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute account_token + # + # @return [String] + required :account_token, String + + # @!method initialize(account_token:, request_options: {}) + # @param account_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/account_spend_limits.rb b/lib/lithic/models/account_spend_limits.rb new file mode 100644 index 00000000..148e751d --- /dev/null +++ b/lib/lithic/models/account_spend_limits.rb @@ -0,0 +1,124 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Accounts#retrieve_spend_limits + class AccountSpendLimits < Lithic::Internal::Type::BaseModel + # @!attribute available_spend_limit + # + # @return [Lithic::Models::AccountSpendLimits::AvailableSpendLimit] + required :available_spend_limit, -> { Lithic::AccountSpendLimits::AvailableSpendLimit } + + # @!attribute spend_limit + # + # @return [Lithic::Models::AccountSpendLimits::SpendLimit, nil] + optional :spend_limit, -> { Lithic::AccountSpendLimits::SpendLimit } + + # @!attribute spend_velocity + # + # @return [Lithic::Models::AccountSpendLimits::SpendVelocity, nil] + optional :spend_velocity, -> { Lithic::AccountSpendLimits::SpendVelocity } + + # @!method initialize(available_spend_limit:, spend_limit: nil, spend_velocity: nil) + # @param available_spend_limit [Lithic::Models::AccountSpendLimits::AvailableSpendLimit] + # @param spend_limit [Lithic::Models::AccountSpendLimits::SpendLimit] + # @param spend_velocity [Lithic::Models::AccountSpendLimits::SpendVelocity] + + # @see Lithic::Models::AccountSpendLimits#available_spend_limit + class AvailableSpendLimit < Lithic::Internal::Type::BaseModel + # @!attribute daily + # The available spend limit (in cents) relative to the daily limit configured on + # the Account (e.g. 100000 would be a $1,000 limit). + # + # @return [Integer, nil] + optional :daily, Integer + + # @!attribute lifetime + # The available spend limit (in cents) relative to the lifetime limit configured + # on the Account. + # + # @return [Integer, nil] + optional :lifetime, Integer + + # @!attribute monthly + # The available spend limit (in cents) relative to the monthly limit configured on + # the Account. + # + # @return [Integer, nil] + optional :monthly, Integer + + # @!method initialize(daily: nil, lifetime: nil, monthly: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountSpendLimits::AvailableSpendLimit} for more details. + # + # @param daily [Integer] The available spend limit (in cents) relative to the daily limit configured on t + # + # @param lifetime [Integer] The available spend limit (in cents) relative to the lifetime limit configured o + # + # @param monthly [Integer] The available spend limit (in cents) relative to the monthly limit configured on + end + + # @see Lithic::Models::AccountSpendLimits#spend_limit + class SpendLimit < Lithic::Internal::Type::BaseModel + # @!attribute daily + # The configured daily spend limit (in cents) on the Account. + # + # @return [Integer, nil] + optional :daily, Integer + + # @!attribute lifetime + # The configured lifetime spend limit (in cents) on the Account. + # + # @return [Integer, nil] + optional :lifetime, Integer + + # @!attribute monthly + # The configured monthly spend limit (in cents) on the Account. + # + # @return [Integer, nil] + optional :monthly, Integer + + # @!method initialize(daily: nil, lifetime: nil, monthly: nil) + # @param daily [Integer] The configured daily spend limit (in cents) on the Account. + # + # @param lifetime [Integer] The configured lifetime spend limit (in cents) on the Account. + # + # @param monthly [Integer] The configured monthly spend limit (in cents) on the Account. + end + + # @see Lithic::Models::AccountSpendLimits#spend_velocity + class SpendVelocity < Lithic::Internal::Type::BaseModel + # @!attribute daily + # Current daily spend velocity (in cents) on the Account. Present if daily spend + # limit is set. + # + # @return [Integer, nil] + optional :daily, Integer + + # @!attribute lifetime + # Current lifetime spend velocity (in cents) on the Account. Present if lifetime + # spend limit is set. + # + # @return [Integer, nil] + optional :lifetime, Integer + + # @!attribute monthly + # Current monthly spend velocity (in cents) on the Account. Present if monthly + # spend limit is set. + # + # @return [Integer, nil] + optional :monthly, Integer + + # @!method initialize(daily: nil, lifetime: nil, monthly: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountSpendLimits::SpendVelocity} for more details. + # + # @param daily [Integer] Current daily spend velocity (in cents) on the Account. Present if daily spend l + # + # @param lifetime [Integer] Current lifetime spend velocity (in cents) on the Account. Present if lifetime s + # + # @param monthly [Integer] Current monthly spend velocity (in cents) on the Account. Present if monthly spe + end + end + end +end diff --git a/lib/lithic/models/account_update_params.rb b/lib/lithic/models/account_update_params.rb new file mode 100644 index 00000000..d73fc744 --- /dev/null +++ b/lib/lithic/models/account_update_params.rb @@ -0,0 +1,220 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Accounts#update + class AccountUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute account_token + # + # @return [String] + required :account_token, String + + # @!attribute comment + # Additional context or information related to the account. + # + # @return [String, nil] + optional :comment, String + + # @!attribute daily_spend_limit + # Amount (in cents) for the account's daily spend limit (e.g. 100000 would be a + # $1,000 limit). By default the daily spend limit is set to $1,250. + # + # @return [Integer, nil] + optional :daily_spend_limit, Integer + + # @!attribute lifetime_spend_limit + # Amount (in cents) for the account's lifetime spend limit (e.g. 100000 would be a + # $1,000 limit). Once this limit is reached, no transactions will be accepted on + # any card created for this account until the limit is updated. Note that a spend + # limit of 0 is effectively no limit, and should only be used to reset or remove a + # prior limit. Only a limit of 1 or above will result in declined transactions due + # to checks against the account limit. This behavior differs from the daily spend + # limit and the monthly spend limit. + # + # @return [Integer, nil] + optional :lifetime_spend_limit, Integer + + # @!attribute monthly_spend_limit + # Amount (in cents) for the account's monthly spend limit (e.g. 100000 would be a + # $1,000 limit). By default the monthly spend limit is set to $5,000. + # + # @return [Integer, nil] + optional :monthly_spend_limit, Integer + + # @!attribute state + # Account states. + # + # @return [Symbol, Lithic::Models::AccountUpdateParams::State, nil] + optional :state, enum: -> { Lithic::AccountUpdateParams::State } + + # @!attribute substatus + # Account state substatus values: + # + # - `FRAUD_IDENTIFIED` - The account has been recognized as being created or used + # with stolen or fabricated identity information, encompassing both true + # identity theft and synthetic identities. + # - `SUSPICIOUS_ACTIVITY` - The account has exhibited suspicious behavior, such as + # unauthorized access or fraudulent transactions, necessitating further + # investigation. + # - `RISK_VIOLATION` - The account has been involved in deliberate misuse by the + # legitimate account holder. Examples include disputing valid transactions + # without cause, falsely claiming non-receipt of goods, or engaging in + # intentional bust-out schemes to exploit account services. + # - `END_USER_REQUEST` - The account holder has voluntarily requested the closure + # of the account for personal reasons. This encompasses situations such as + # bankruptcy, other financial considerations, or the account holder's death. + # - `ISSUER_REQUEST` - The issuer has initiated the closure of the account due to + # business strategy, risk management, inactivity, product changes, regulatory + # concerns, or violations of terms and conditions. + # - `NOT_ACTIVE` - The account has not had any transactions or payment activity + # within a specified period. This status applies to accounts that are paused or + # closed due to inactivity. + # - `INTERNAL_REVIEW` - The account is temporarily paused pending further internal + # review. In future implementations, this status may prevent clients from + # activating the account via APIs until the review is completed. + # - `OTHER` - The reason for the account's current status does not fall into any + # of the above categories. A comment should be provided to specify the + # particular reason. + # + # @return [Symbol, Lithic::Models::AccountUpdateParams::Substatus, nil] + optional :substatus, enum: -> { Lithic::AccountUpdateParams::Substatus }, nil?: true + + # @!attribute verification_address + # @deprecated + # + # Address used during Address Verification Service (AVS) checks during + # transactions if enabled via Auth Rules. This field is deprecated as AVS checks + # are no longer supported by Auth Rules. The field will be removed from the schema + # in a future release. + # + # @return [Lithic::Models::AccountUpdateParams::VerificationAddress, nil] + optional :verification_address, -> { Lithic::AccountUpdateParams::VerificationAddress } + + # @!method initialize(account_token:, comment: nil, daily_spend_limit: nil, lifetime_spend_limit: nil, monthly_spend_limit: nil, state: nil, substatus: nil, verification_address: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountUpdateParams} for more details. + # + # @param account_token [String] + # + # @param comment [String] Additional context or information related to the account. + # + # @param daily_spend_limit [Integer] Amount (in cents) for the account's daily spend limit (e.g. 100000 would be a $1 + # + # @param lifetime_spend_limit [Integer] Amount (in cents) for the account's lifetime spend limit (e.g. 100000 would be a + # + # @param monthly_spend_limit [Integer] Amount (in cents) for the account's monthly spend limit (e.g. 100000 would be a + # + # @param state [Symbol, Lithic::Models::AccountUpdateParams::State] Account states. + # + # @param substatus [Symbol, Lithic::Models::AccountUpdateParams::Substatus, nil] Account state substatus values: + # + # @param verification_address [Lithic::Models::AccountUpdateParams::VerificationAddress] Address used during Address Verification Service (AVS) checks during transaction + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Account states. + module State + extend Lithic::Internal::Type::Enum + + ACTIVE = :ACTIVE + PAUSED = :PAUSED + CLOSED = :CLOSED + + # @!method self.values + # @return [Array] + end + + # Account state substatus values: + # + # - `FRAUD_IDENTIFIED` - The account has been recognized as being created or used + # with stolen or fabricated identity information, encompassing both true + # identity theft and synthetic identities. + # - `SUSPICIOUS_ACTIVITY` - The account has exhibited suspicious behavior, such as + # unauthorized access or fraudulent transactions, necessitating further + # investigation. + # - `RISK_VIOLATION` - The account has been involved in deliberate misuse by the + # legitimate account holder. Examples include disputing valid transactions + # without cause, falsely claiming non-receipt of goods, or engaging in + # intentional bust-out schemes to exploit account services. + # - `END_USER_REQUEST` - The account holder has voluntarily requested the closure + # of the account for personal reasons. This encompasses situations such as + # bankruptcy, other financial considerations, or the account holder's death. + # - `ISSUER_REQUEST` - The issuer has initiated the closure of the account due to + # business strategy, risk management, inactivity, product changes, regulatory + # concerns, or violations of terms and conditions. + # - `NOT_ACTIVE` - The account has not had any transactions or payment activity + # within a specified period. This status applies to accounts that are paused or + # closed due to inactivity. + # - `INTERNAL_REVIEW` - The account is temporarily paused pending further internal + # review. In future implementations, this status may prevent clients from + # activating the account via APIs until the review is completed. + # - `OTHER` - The reason for the account's current status does not fall into any + # of the above categories. A comment should be provided to specify the + # particular reason. + module Substatus + extend Lithic::Internal::Type::Enum + + FRAUD_IDENTIFIED = :FRAUD_IDENTIFIED + SUSPICIOUS_ACTIVITY = :SUSPICIOUS_ACTIVITY + RISK_VIOLATION = :RISK_VIOLATION + END_USER_REQUEST = :END_USER_REQUEST + ISSUER_REQUEST = :ISSUER_REQUEST + NOT_ACTIVE = :NOT_ACTIVE + INTERNAL_REVIEW = :INTERNAL_REVIEW + OTHER = :OTHER + + # @!method self.values + # @return [Array] + end + + # @deprecated + class VerificationAddress < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # + # @return [String, nil] + optional :address1, String + + # @!attribute address2 + # + # @return [String, nil] + optional :address2, String + + # @!attribute city + # + # @return [String, nil] + optional :city, String + + # @!attribute country + # + # @return [String, nil] + optional :country, String + + # @!attribute postal_code + # + # @return [String, nil] + optional :postal_code, String + + # @!attribute state + # + # @return [String, nil] + optional :state, String + + # @!method initialize(address1: nil, address2: nil, city: nil, country: nil, postal_code: nil, state: nil) + # Address used during Address Verification Service (AVS) checks during + # transactions if enabled via Auth Rules. This field is deprecated as AVS checks + # are no longer supported by Auth Rules. The field will be removed from the schema + # in a future release. + # + # @param address1 [String] + # @param address2 [String] + # @param city [String] + # @param country [String] + # @param postal_code [String] + # @param state [String] + end + end + end +end diff --git a/lib/lithic/models/address.rb b/lib/lithic/models/address.rb new file mode 100644 index 00000000..2e0a0382 --- /dev/null +++ b/lib/lithic/models/address.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +module Lithic + module Models + class Address < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code, entered in uppercase ISO 3166-1 alpha-3 three-character + # format. Only USA is currently supported for all workflows. KYC_EXEMPT supports + # CAN additionally. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. USA postal codes (ZIP codes) are supported, entered as a + # five-digit postal code or nine-digit postal code (ZIP+4) using the format + # 12345-1234. KYC_EXEMPT supports Canadian postal codes. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. USA state codes are supported, entered in uppercase ISO 3166-2 + # two-character format. KYC_EXEMPT supports Canadian province codes. + # + # @return [String] + required :state, String + + # @!attribute address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!method initialize(address1:, city:, country:, postal_code:, state:, address2: nil) + # Some parameter documentations has been truncated, see {Lithic::Models::Address} + # for more details. + # + # @param address1 [String] Valid deliverable address (no PO boxes). + # + # @param city [String] Name of city. + # + # @param country [String] Valid country code, entered in uppercase ISO 3166-1 alpha-3 three-character form + # + # @param postal_code [String] Valid postal code. USA postal codes (ZIP codes) are supported, entered as a five + # + # @param state [String] Valid state code. USA state codes are supported, entered in uppercase ISO 3166-2 + # + # @param address2 [String] Unit or apartment number (if applicable). + end + end +end diff --git a/lib/lithic/models/address_update.rb b/lib/lithic/models/address_update.rb new file mode 100644 index 00000000..cdebceaf --- /dev/null +++ b/lib/lithic/models/address_update.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AddressUpdate < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String, nil] + optional :address1, String + + # @!attribute address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!attribute city + # Name of city. + # + # @return [String, nil] + optional :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String, nil] + optional :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String, nil] + optional :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String, nil] + optional :state, String + + # @!method initialize(address1: nil, address2: nil, city: nil, country: nil, postal_code: nil, state: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AddressUpdate} for more details. + # + # @param address1 [String] Valid deliverable address (no PO boxes). + # + # @param address2 [String] Unit or apartment number (if applicable). + # + # @param city [String] Name of city. + # + # @param country [String] Valid country code. Only USA is currently supported, entered in uppercase ISO 31 + # + # @param postal_code [String] Valid postal code. Only USA ZIP codes are currently supported, entered as a five + # + # @param state [String] Valid state code. Only USA state codes are currently supported, entered in upper + end + end +end diff --git a/lib/lithic/models/api_status.rb b/lib/lithic/models/api_status.rb new file mode 100644 index 00000000..d1f13fce --- /dev/null +++ b/lib/lithic/models/api_status.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Client#api_status + class APIStatus < Lithic::Internal::Type::BaseModel + # @!attribute message + # + # @return [String, nil] + optional :message, String + + # @!method initialize(message: nil) + # @param message [String] + end + end +end diff --git a/lib/lithic/models/auth_rules/auth_rule.rb b/lib/lithic/models/auth_rules/auth_rule.rb new file mode 100644 index 00000000..9b24fea8 --- /dev/null +++ b/lib/lithic/models/auth_rules/auth_rule.rb @@ -0,0 +1,357 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + # @see Lithic::Resources::AuthRules::V2#create + class AuthRule < Lithic::Internal::Type::BaseModel + # @!attribute token + # Auth Rule Token + # + # @return [String] + required :token, String + + # @!attribute account_tokens + # Account tokens to which the Auth Rule applies. + # + # @return [Array] + required :account_tokens, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute business_account_tokens + # Business Account tokens to which the Auth Rule applies. + # + # @return [Array] + required :business_account_tokens, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute card_tokens + # Card tokens to which the Auth Rule applies. + # + # @return [Array] + required :card_tokens, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute current_version + # + # @return [Lithic::Models::AuthRules::AuthRule::CurrentVersion, nil] + required :current_version, -> { Lithic::AuthRules::AuthRule::CurrentVersion }, nil?: true + + # @!attribute draft_version + # + # @return [Lithic::Models::AuthRules::AuthRule::DraftVersion, nil] + required :draft_version, -> { Lithic::AuthRules::AuthRule::DraftVersion }, nil?: true + + # @!attribute event_stream + # The event stream during which the rule will be evaluated. + # + # @return [Symbol, Lithic::Models::AuthRules::EventStream] + required :event_stream, enum: -> { Lithic::AuthRules::EventStream } + + # @!attribute lithic_managed + # Indicates whether this auth rule is managed by Lithic. If true, the rule cannot + # be modified or deleted by the user + # + # @return [Boolean] + required :lithic_managed, Lithic::Internal::Type::Boolean + + # @!attribute name + # Auth Rule Name + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute program_level + # Whether the Auth Rule applies to all authorizations on the card program. + # + # @return [Boolean] + required :program_level, Lithic::Internal::Type::Boolean + + # @!attribute state + # The state of the Auth Rule + # + # @return [Symbol, Lithic::Models::AuthRules::AuthRule::State] + required :state, enum: -> { Lithic::AuthRules::AuthRule::State } + + # @!attribute type + # The type of Auth Rule. For certain rule types, this determines the event stream + # during which it will be evaluated. For rules that can be applied to one of + # several event streams, the effective one is defined by the separate + # `event_stream` field. + # + # - `CONDITIONAL_BLOCK`: Deprecated. Use `CONDITIONAL_ACTION` instead. + # AUTHORIZATION event stream. + # - `VELOCITY_LIMIT`: AUTHORIZATION event stream. + # - `MERCHANT_LOCK`: AUTHORIZATION event stream. + # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + # + # @return [Symbol, Lithic::Models::AuthRules::AuthRule::Type] + required :type, enum: -> { Lithic::AuthRules::AuthRule::Type } + + # @!attribute excluded_account_tokens + # Account tokens to which the Auth Rule does not apply. + # + # @return [Array, nil] + optional :excluded_account_tokens, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute excluded_business_account_tokens + # Business account tokens to which the Auth Rule does not apply. + # + # @return [Array, nil] + optional :excluded_business_account_tokens, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute excluded_card_tokens + # Card tokens to which the Auth Rule does not apply. + # + # @return [Array, nil] + optional :excluded_card_tokens, Lithic::Internal::Type::ArrayOf[String] + + # @!method initialize(token:, account_tokens:, business_account_tokens:, card_tokens:, current_version:, draft_version:, event_stream:, lithic_managed:, name:, program_level:, state:, type:, excluded_account_tokens: nil, excluded_business_account_tokens: nil, excluded_card_tokens: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::AuthRule} for more details. + # + # @param token [String] Auth Rule Token + # + # @param account_tokens [Array] Account tokens to which the Auth Rule applies. + # + # @param business_account_tokens [Array] Business Account tokens to which the Auth Rule applies. + # + # @param card_tokens [Array] Card tokens to which the Auth Rule applies. + # + # @param current_version [Lithic::Models::AuthRules::AuthRule::CurrentVersion, nil] + # + # @param draft_version [Lithic::Models::AuthRules::AuthRule::DraftVersion, nil] + # + # @param event_stream [Symbol, Lithic::Models::AuthRules::EventStream] The event stream during which the rule will be evaluated. + # + # @param lithic_managed [Boolean] Indicates whether this auth rule is managed by Lithic. If true, the rule cannot + # + # @param name [String, nil] Auth Rule Name + # + # @param program_level [Boolean] Whether the Auth Rule applies to all authorizations on the card program. + # + # @param state [Symbol, Lithic::Models::AuthRules::AuthRule::State] The state of the Auth Rule + # + # @param type [Symbol, Lithic::Models::AuthRules::AuthRule::Type] The type of Auth Rule. For certain rule types, this determines the event stream + # + # @param excluded_account_tokens [Array] Account tokens to which the Auth Rule does not apply. + # + # @param excluded_business_account_tokens [Array] Business account tokens to which the Auth Rule does not apply. + # + # @param excluded_card_tokens [Array] Card tokens to which the Auth Rule does not apply. + + # @see Lithic::Models::AuthRules::AuthRule#current_version + class CurrentVersion < Lithic::Internal::Type::BaseModel + # @!attribute parameters + # Parameters for the Auth Rule + # + # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters] + required :parameters, union: -> { Lithic::AuthRules::AuthRule::CurrentVersion::Parameters } + + response_only do + # @!attribute version + # The version of the rule, this is incremented whenever the rule's parameters + # change. + # + # @return [Integer] + required :version, Integer + end + + # @!method initialize(parameters:, version:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::AuthRule::CurrentVersion} for more details. + # + # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters] Parameters for the Auth Rule + # + # @param version [Integer] The version of the rule, this is incremented whenever the rule's parameters chan + + # Parameters for the Auth Rule + # + # @see Lithic::Models::AuthRules::AuthRule::CurrentVersion#parameters + module Parameters + extend Lithic::Internal::Type::Union + + # Deprecated: Use CONDITIONAL_ACTION instead. + variant -> { Lithic::AuthRules::ConditionalBlockParameters } + + variant -> { Lithic::AuthRules::VelocityLimitParams } + + variant -> { Lithic::AuthRules::MerchantLockParameters } + + variant -> { Lithic::AuthRules::Conditional3DSActionParameters } + + variant -> { Lithic::AuthRules::ConditionalAuthorizationActionParameters } + + variant -> { Lithic::AuthRules::ConditionalACHActionParameters } + + variant -> { Lithic::AuthRules::ConditionalTokenizationActionParameters } + + variant -> { Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters } + + # Parameters for defining a TypeScript code rule + variant -> { Lithic::AuthRules::TypescriptCodeParameters } + + variant -> { Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters } + + # @!method self.variants + # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters)] + end + end + + # @see Lithic::Models::AuthRules::AuthRule#draft_version + class DraftVersion < Lithic::Internal::Type::BaseModel + # @!attribute error + # An error message if the draft version failed compilation. Populated when `state` + # is `ERROR`, `null` otherwise. + # + # @return [String, nil] + required :error, String, nil?: true + + # @!attribute parameters + # Parameters for the Auth Rule + # + # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters] + required :parameters, union: -> { Lithic::AuthRules::AuthRule::DraftVersion::Parameters } + + # @!attribute state + # The state of the draft version. Most rules are created synchronously and the + # state is immediately `SHADOWING`. Rules backed by TypeScript code are compiled + # asynchronously — the state starts as `PENDING` and transitions to `SHADOWING` on + # success or `ERROR` on failure. + # + # - `PENDING`: Compilation of the rule is in progress (TypeScript rules only). + # - `SHADOWING`: The draft version is ready and evaluating in shadow mode + # alongside the current active version. It can be promoted to the active + # version. + # - `ERROR`: Compilation of the rule failed. Check the `error` field for details. + # + # @return [Symbol, Lithic::Models::AuthRules::AuthRule::DraftVersion::State] + required :state, enum: -> { Lithic::AuthRules::AuthRule::DraftVersion::State } + + response_only do + # @!attribute version + # The version of the rule, this is incremented whenever the rule's parameters + # change. + # + # @return [Integer] + required :version, Integer + end + + # @!method initialize(error:, parameters:, state:, version:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::AuthRule::DraftVersion} for more details. + # + # @param error [String, nil] An error message if the draft version failed compilation. Populated when `state` + # + # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters] Parameters for the Auth Rule + # + # @param state [Symbol, Lithic::Models::AuthRules::AuthRule::DraftVersion::State] The state of the draft version. Most rules are created synchronously and the sta + # + # @param version [Integer] The version of the rule, this is incremented whenever the rule's parameters chan + + # Parameters for the Auth Rule + # + # @see Lithic::Models::AuthRules::AuthRule::DraftVersion#parameters + module Parameters + extend Lithic::Internal::Type::Union + + # Deprecated: Use CONDITIONAL_ACTION instead. + variant -> { Lithic::AuthRules::ConditionalBlockParameters } + + variant -> { Lithic::AuthRules::VelocityLimitParams } + + variant -> { Lithic::AuthRules::MerchantLockParameters } + + variant -> { Lithic::AuthRules::Conditional3DSActionParameters } + + variant -> { Lithic::AuthRules::ConditionalAuthorizationActionParameters } + + variant -> { Lithic::AuthRules::ConditionalACHActionParameters } + + variant -> { Lithic::AuthRules::ConditionalTokenizationActionParameters } + + variant -> { Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters } + + # Parameters for defining a TypeScript code rule + variant -> { Lithic::AuthRules::TypescriptCodeParameters } + + variant -> { Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters } + + # @!method self.variants + # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters)] + end + + # The state of the draft version. Most rules are created synchronously and the + # state is immediately `SHADOWING`. Rules backed by TypeScript code are compiled + # asynchronously — the state starts as `PENDING` and transitions to `SHADOWING` on + # success or `ERROR` on failure. + # + # - `PENDING`: Compilation of the rule is in progress (TypeScript rules only). + # - `SHADOWING`: The draft version is ready and evaluating in shadow mode + # alongside the current active version. It can be promoted to the active + # version. + # - `ERROR`: Compilation of the rule failed. Check the `error` field for details. + # + # @see Lithic::Models::AuthRules::AuthRule::DraftVersion#state + module State + extend Lithic::Internal::Type::Enum + + PENDING = :PENDING + SHADOWING = :SHADOWING + ERROR = :ERROR + + # @!method self.values + # @return [Array] + end + end + + # The state of the Auth Rule + # + # @see Lithic::Models::AuthRules::AuthRule#state + module State + extend Lithic::Internal::Type::Enum + + ACTIVE = :ACTIVE + INACTIVE = :INACTIVE + + # @!method self.values + # @return [Array] + end + + # The type of Auth Rule. For certain rule types, this determines the event stream + # during which it will be evaluated. For rules that can be applied to one of + # several event streams, the effective one is defined by the separate + # `event_stream` field. + # + # - `CONDITIONAL_BLOCK`: Deprecated. Use `CONDITIONAL_ACTION` instead. + # AUTHORIZATION event stream. + # - `VELOCITY_LIMIT`: AUTHORIZATION event stream. + # - `MERCHANT_LOCK`: AUTHORIZATION event stream. + # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + # + # @see Lithic::Models::AuthRules::AuthRule#type + module Type + extend Lithic::Internal::Type::Enum + + CONDITIONAL_BLOCK = :CONDITIONAL_BLOCK + VELOCITY_LIMIT = :VELOCITY_LIMIT + MERCHANT_LOCK = :MERCHANT_LOCK + CONDITIONAL_ACTION = :CONDITIONAL_ACTION + TYPESCRIPT_CODE = :TYPESCRIPT_CODE + + # @!method self.values + # @return [Array] + end + end + end + + AuthRule = AuthRules::AuthRule + end +end diff --git a/lib/lithic/models/auth_rules/auth_rule_condition.rb b/lib/lithic/models/auth_rules/auth_rule_condition.rb new file mode 100644 index 00000000..421d9d61 --- /dev/null +++ b/lib/lithic/models/auth_rules/auth_rule_condition.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class AuthRuleCondition < Lithic::Internal::Type::BaseModel + # @!attribute attribute + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + # business by the types of goods or services it provides. + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + # Netherlands Antilles. + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + # the transaction. + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + # (merchant). + # - `DESCRIPTOR`: Short description of card acceptor. + # - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer + # applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + # `TOKEN_AUTHENTICATED`. + # - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number + # (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, + # `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, + # `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, + # `UNKNOWN`, `CREDENTIAL_ON_FILE`, or `ECOMMERCE`. + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + # fee field in the settlement/cardholder billing currency. This is the amount + # the issuer should authorize against unless the issuer is paying the acquirer + # fee on behalf of the cardholder. + # - `RISK_SCORE`: Network-provided score assessing risk level associated with a + # given authorization. Scores are on a range of 0-999, with 0 representing the + # lowest risk and 999 representing the highest risk. For Visa transactions, + # where the raw score has a range of 0-99, Lithic will normalize the score by + # multiplying the raw score by 10x. + # - `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in the + # trailing 15 minutes before the authorization. + # - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the + # trailing hour up and until the authorization. + # - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the + # trailing 24 hours up and until the authorization. + # - `CARD_STATE`: The current state of the card associated with the transaction. + # Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, + # `PENDING_FULFILLMENT`. + # - `PIN_ENTERED`: Indicates whether a PIN was entered during the transaction. + # Valid values are `TRUE`, `FALSE`. + # - `PIN_STATUS`: The current state of card's PIN. Valid values are `NOT_SET`, + # `OK`, `BLOCKED`. + # - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the + # source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, + # `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. + # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address + # data with the cardholder KYC data if it exists. Valid values are `MATCH`, + # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`. + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalAttribute] + required :attribute, enum: -> { Lithic::AuthRules::ConditionalAttribute } + + # @!attribute operation + # The operation to apply to the attribute + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalOperation] + required :operation, enum: -> { Lithic::AuthRules::ConditionalOperation } + + # @!attribute value + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + # + # @return [String, Integer, Float, Array, Time] + required :value, union: -> { Lithic::AuthRules::ConditionalValue } + + # @!method initialize(attribute:, operation:, value:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::AuthRuleCondition} for more details. + # + # @param attribute [Symbol, Lithic::Models::AuthRules::ConditionalAttribute] The attribute to target. + # + # @param operation [Symbol, Lithic::Models::AuthRules::ConditionalOperation] The operation to apply to the attribute + # + # @param value [String, Integer, Float, Array, Time] A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + end + end + + AuthRuleCondition = AuthRules::AuthRuleCondition + end +end diff --git a/lib/lithic/models/auth_rules/auth_rule_version.rb b/lib/lithic/models/auth_rules/auth_rule_version.rb new file mode 100644 index 00000000..4bf970ef --- /dev/null +++ b/lib/lithic/models/auth_rules/auth_rule_version.rb @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class AuthRuleVersion < Lithic::Internal::Type::BaseModel + # @!attribute created + # Timestamp of when this version was created. + # + # @return [Time] + required :created, Time + + # @!attribute parameters + # Parameters for the Auth Rule + # + # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters] + required :parameters, union: -> { Lithic::AuthRules::AuthRuleVersion::Parameters } + + # @!attribute state + # The current state of this version. + # + # @return [Symbol, Lithic::Models::AuthRules::AuthRuleVersion::State] + required :state, enum: -> { Lithic::AuthRules::AuthRuleVersion::State } + + response_only do + # @!attribute version + # The version of the rule, this is incremented whenever the rule's parameters + # change. + # + # @return [Integer] + required :version, Integer + end + + # @!method initialize(created:, parameters:, state:, version:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::AuthRuleVersion} for more details. + # + # @param created [Time] Timestamp of when this version was created. + # + # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters] Parameters for the Auth Rule + # + # @param state [Symbol, Lithic::Models::AuthRules::AuthRuleVersion::State] The current state of this version. + # + # @param version [Integer] The version of the rule, this is incremented whenever the rule's parameters chan + + # Parameters for the Auth Rule + # + # @see Lithic::Models::AuthRules::AuthRuleVersion#parameters + module Parameters + extend Lithic::Internal::Type::Union + + # Deprecated: Use CONDITIONAL_ACTION instead. + variant -> { Lithic::AuthRules::ConditionalBlockParameters } + + variant -> { Lithic::AuthRules::VelocityLimitParams } + + variant -> { Lithic::AuthRules::MerchantLockParameters } + + variant -> { Lithic::AuthRules::Conditional3DSActionParameters } + + variant -> { Lithic::AuthRules::ConditionalAuthorizationActionParameters } + + variant -> { Lithic::AuthRules::ConditionalACHActionParameters } + + variant -> { Lithic::AuthRules::ConditionalTokenizationActionParameters } + + variant -> { Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters } + + # Parameters for defining a TypeScript code rule + variant -> { Lithic::AuthRules::TypescriptCodeParameters } + + variant -> { Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters } + + # @!method self.variants + # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters)] + end + + # The current state of this version. + # + # @see Lithic::Models::AuthRules::AuthRuleVersion#state + module State + extend Lithic::Internal::Type::Enum + + ACTIVE = :ACTIVE + SHADOW = :SHADOW + INACTIVE = :INACTIVE + + # @!method self.values + # @return [Array] + end + end + end + + AuthRuleVersion = AuthRules::AuthRuleVersion + end +end diff --git a/lib/lithic/models/auth_rules/backtest_stats.rb b/lib/lithic/models/auth_rules/backtest_stats.rb new file mode 100644 index 00000000..cf6992b0 --- /dev/null +++ b/lib/lithic/models/auth_rules/backtest_stats.rb @@ -0,0 +1,112 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class BacktestStats < Lithic::Internal::Type::BaseModel + # @!attribute approved + # The total number of historical transactions approved by this rule during the + # backtest period, or the number of transactions that would have been approved if + # the rule was evaluated in shadow mode. + # + # @return [Integer, nil] + optional :approved, Integer + + # @!attribute challenged + # The total number of historical transactions challenged by this rule during the + # backtest period, or the number of transactions that would have been challenged + # if the rule was evaluated in shadow mode. Currently applicable only for 3DS Auth + # Rules. + # + # @return [Integer, nil] + optional :challenged, Integer + + # @!attribute declined + # The total number of historical transactions declined by this rule during the + # backtest period, or the number of transactions that would have been declined if + # the rule was evaluated in shadow mode. + # + # @return [Integer, nil] + optional :declined, Integer + + # @!attribute examples + # Example events and their outcomes. + # + # @return [Array, nil] + optional :examples, -> { Lithic::Internal::Type::ArrayOf[Lithic::AuthRules::BacktestStats::Example] } + + response_only do + # @!attribute version + # The version of the rule, this is incremented whenever the rule's parameters + # change. + # + # @return [Integer, nil] + optional :version, Integer + end + + # @!method initialize(approved: nil, challenged: nil, declined: nil, examples: nil, version: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::BacktestStats} for more details. + # + # @param approved [Integer] The total number of historical transactions approved by this rule during the bac + # + # @param challenged [Integer] The total number of historical transactions challenged by this rule during the b + # + # @param declined [Integer] The total number of historical transactions declined by this rule during the bac + # + # @param examples [Array] Example events and their outcomes. + # + # @param version [Integer] The version of the rule, this is incremented whenever the rule's parameters chan + + class Example < Lithic::Internal::Type::BaseModel + # @!attribute decision + # The decision made by the rule for this event. + # + # @return [Symbol, Lithic::Models::AuthRules::BacktestStats::Example::Decision, nil] + optional :decision, enum: -> { Lithic::AuthRules::BacktestStats::Example::Decision } + + # @!attribute event_token + # The event token. + # + # @return [String, nil] + optional :event_token, String + + # @!attribute timestamp + # The timestamp of the event. + # + # @return [Time, nil] + optional :timestamp, Time + + # @!attribute transaction_token + # The token of the transaction associated with the event + # + # @return [String, nil] + optional :transaction_token, String, nil?: true + + # @!method initialize(decision: nil, event_token: nil, timestamp: nil, transaction_token: nil) + # @param decision [Symbol, Lithic::Models::AuthRules::BacktestStats::Example::Decision] The decision made by the rule for this event. + # + # @param event_token [String] The event token. + # + # @param timestamp [Time] The timestamp of the event. + # + # @param transaction_token [String, nil] The token of the transaction associated with the event + + # The decision made by the rule for this event. + # + # @see Lithic::Models::AuthRules::BacktestStats::Example#decision + module Decision + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + CHALLENGED = :CHALLENGED + + # @!method self.values + # @return [Array] + end + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/card_transaction_update_action.rb b/lib/lithic/models/auth_rules/card_transaction_update_action.rb new file mode 100644 index 00000000..774eaa3d --- /dev/null +++ b/lib/lithic/models/auth_rules/card_transaction_update_action.rb @@ -0,0 +1,109 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + module CardTransactionUpdateAction + extend Lithic::Internal::Type::Union + + variant -> { Lithic::AuthRules::CardTransactionUpdateAction::TagAction } + + variant -> { Lithic::AuthRules::CardTransactionUpdateAction::CreateCaseAction } + + class TagAction < Lithic::Internal::Type::BaseModel + # @!attribute key + # The key of the tag to apply to the transaction + # + # @return [String] + required :key, String + + # @!attribute type + # Tag the transaction with key-value metadata + # + # @return [Symbol, Lithic::Models::AuthRules::CardTransactionUpdateAction::TagAction::Type] + required :type, enum: -> { Lithic::AuthRules::CardTransactionUpdateAction::TagAction::Type } + + # @!attribute value + # The value of the tag to apply to the transaction + # + # @return [String] + required :value, String + + # @!method initialize(key:, type:, value:) + # @param key [String] The key of the tag to apply to the transaction + # + # @param type [Symbol, Lithic::Models::AuthRules::CardTransactionUpdateAction::TagAction::Type] Tag the transaction with key-value metadata + # + # @param value [String] The value of the tag to apply to the transaction + + # Tag the transaction with key-value metadata + # + # @see Lithic::Models::AuthRules::CardTransactionUpdateAction::TagAction#type + module Type + extend Lithic::Internal::Type::Enum + + TAG = :TAG + + # @!method self.values + # @return [Array] + end + end + + class CreateCaseAction < Lithic::Internal::Type::BaseModel + # @!attribute queue_token + # The token of the queue to create the case in + # + # @return [String] + required :queue_token, String + + # @!attribute scope + # The scope of the case to create + # + # @return [Symbol, Lithic::Models::AuthRules::CardTransactionUpdateAction::CreateCaseAction::Scope] + required :scope, enum: -> { Lithic::AuthRules::CardTransactionUpdateAction::CreateCaseAction::Scope } + + # @!attribute type + # Create a case for the transaction + # + # @return [Symbol, Lithic::Models::AuthRules::CardTransactionUpdateAction::CreateCaseAction::Type] + required :type, enum: -> { Lithic::AuthRules::CardTransactionUpdateAction::CreateCaseAction::Type } + + # @!method initialize(queue_token:, scope:, type:) + # @param queue_token [String] The token of the queue to create the case in + # + # @param scope [Symbol, Lithic::Models::AuthRules::CardTransactionUpdateAction::CreateCaseAction::Scope] The scope of the case to create + # + # @param type [Symbol, Lithic::Models::AuthRules::CardTransactionUpdateAction::CreateCaseAction::Type] Create a case for the transaction + + # The scope of the case to create + # + # @see Lithic::Models::AuthRules::CardTransactionUpdateAction::CreateCaseAction#scope + module Scope + extend Lithic::Internal::Type::Enum + + CARD = :CARD + ACCOUNT = :ACCOUNT + + # @!method self.values + # @return [Array] + end + + # Create a case for the transaction + # + # @see Lithic::Models::AuthRules::CardTransactionUpdateAction::CreateCaseAction#type + module Type + extend Lithic::Internal::Type::Enum + + CREATE_CASE = :CREATE_CASE + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(Lithic::Models::AuthRules::CardTransactionUpdateAction::TagAction, Lithic::Models::AuthRules::CardTransactionUpdateAction::CreateCaseAction)] + end + end + end +end diff --git a/lib/lithic/models/auth_rules/conditional_3ds_action_parameters.rb b/lib/lithic/models/auth_rules/conditional_3ds_action_parameters.rb new file mode 100644 index 00000000..273af606 --- /dev/null +++ b/lib/lithic/models/auth_rules/conditional_3ds_action_parameters.rb @@ -0,0 +1,138 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class Conditional3DSActionParameters < Lithic::Internal::Type::BaseModel + # @!attribute action + # The action to take if the conditions are met. + # + # @return [Symbol, Lithic::Models::AuthRules::Conditional3DSActionParameters::Action] + required :action, enum: -> { Lithic::AuthRules::Conditional3DSActionParameters::Action } + + # @!attribute conditions + # + # @return [Array] + required :conditions, + -> { Lithic::Internal::Type::ArrayOf[Lithic::AuthRules::Conditional3DSActionParameters::Condition] } + + # @!method initialize(action:, conditions:) + # @param action [Symbol, Lithic::Models::AuthRules::Conditional3DSActionParameters::Action] The action to take if the conditions are met. + # + # @param conditions [Array] + + # The action to take if the conditions are met. + # + # @see Lithic::Models::AuthRules::Conditional3DSActionParameters#action + module Action + extend Lithic::Internal::Type::Enum + + DECLINE = :DECLINE + CHALLENGE = :CHALLENGE + + # @!method self.values + # @return [Array] + end + + class Condition < Lithic::Internal::Type::BaseModel + # @!attribute attribute + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + # business by the types of goods or services it provides. + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + # Netherlands Antilles. + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + # the transaction. + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + # (merchant). + # - `DESCRIPTOR`: Short description of card acceptor. + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + # fee field in the settlement/cardholder billing currency. This is the amount + # the issuer should authorize against unless the issuer is paying the acquirer + # fee on behalf of the cardholder. Use an integer value. + # - `RISK_SCORE`: Mastercard only: Assessment by the network of the authentication + # risk level, with a higher value indicating a higher amount of risk. Use an + # integer value. + # - `MESSAGE_CATEGORY`: The category of the authentication being processed. + # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address + # data with the cardholder KYC data if it exists. Valid values are `MATCH`, + # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`. + # + # @return [Symbol, Lithic::Models::AuthRules::Conditional3DSActionParameters::Condition::Attribute] + required :attribute, enum: -> { Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute } + + # @!attribute operation + # The operation to apply to the attribute + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalOperation] + required :operation, enum: -> { Lithic::AuthRules::ConditionalOperation } + + # @!attribute value + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + # + # @return [String, Integer, Float, Array, Time] + required :value, union: -> { Lithic::AuthRules::ConditionalValue } + + # @!method initialize(attribute:, operation:, value:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::Conditional3DSActionParameters::Condition} for more + # details. + # + # @param attribute [Symbol, Lithic::Models::AuthRules::Conditional3DSActionParameters::Condition::Attribute] The attribute to target. + # + # @param operation [Symbol, Lithic::Models::AuthRules::ConditionalOperation] The operation to apply to the attribute + # + # @param value [String, Integer, Float, Array, Time] A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + # business by the types of goods or services it provides. + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + # Netherlands Antilles. + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + # the transaction. + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + # (merchant). + # - `DESCRIPTOR`: Short description of card acceptor. + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + # fee field in the settlement/cardholder billing currency. This is the amount + # the issuer should authorize against unless the issuer is paying the acquirer + # fee on behalf of the cardholder. Use an integer value. + # - `RISK_SCORE`: Mastercard only: Assessment by the network of the authentication + # risk level, with a higher value indicating a higher amount of risk. Use an + # integer value. + # - `MESSAGE_CATEGORY`: The category of the authentication being processed. + # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address + # data with the cardholder KYC data if it exists. Valid values are `MATCH`, + # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`. + # + # @see Lithic::Models::AuthRules::Conditional3DSActionParameters::Condition#attribute + module Attribute + extend Lithic::Internal::Type::Enum + + MCC = :MCC + COUNTRY = :COUNTRY + CURRENCY = :CURRENCY + MERCHANT_ID = :MERCHANT_ID + DESCRIPTOR = :DESCRIPTOR + TRANSACTION_AMOUNT = :TRANSACTION_AMOUNT + RISK_SCORE = :RISK_SCORE + MESSAGE_CATEGORY = :MESSAGE_CATEGORY + ADDRESS_MATCH = :ADDRESS_MATCH + + # @!method self.values + # @return [Array] + end + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/conditional_ach_action_parameters.rb b/lib/lithic/models/auth_rules/conditional_ach_action_parameters.rb new file mode 100644 index 00000000..1a19e416 --- /dev/null +++ b/lib/lithic/models/auth_rules/conditional_ach_action_parameters.rb @@ -0,0 +1,260 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class ConditionalACHActionParameters < Lithic::Internal::Type::BaseModel + # @!attribute action + # The action to take if the conditions are met. + # + # @return [Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH, Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ReturnAction] + required :action, union: -> { Lithic::AuthRules::ConditionalACHActionParameters::Action } + + # @!attribute conditions + # + # @return [Array] + required :conditions, + -> { Lithic::Internal::Type::ArrayOf[Lithic::AuthRules::ConditionalACHActionParameters::Condition] } + + # @!method initialize(action:, conditions:) + # @param action [Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH, Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ReturnAction] The action to take if the conditions are met. + # + # @param conditions [Array] + + # The action to take if the conditions are met. + # + # @see Lithic::Models::AuthRules::ConditionalACHActionParameters#action + module Action + extend Lithic::Internal::Type::Union + + variant -> { Lithic::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH } + + variant -> { Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction } + + class ApproveActionACH < Lithic::Internal::Type::BaseModel + # @!attribute type + # Approve the ACH transaction + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH::Type] + required :type, + enum: -> { Lithic::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH::Type } + + # @!method initialize(type:) + # @param type [Symbol, Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH::Type] Approve the ACH transaction + + # Approve the ACH transaction + # + # @see Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH#type + module Type + extend Lithic::Internal::Type::Enum + + APPROVE = :APPROVE + + # @!method self.values + # @return [Array] + end + end + + class ReturnAction < Lithic::Internal::Type::BaseModel + # @!attribute code + # NACHA return code to use when returning the transaction. Note that the list of + # available return codes is subject to an allowlist configured at the program + # level + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code] + required :code, enum: -> { Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code } + + # @!attribute type + # Return the ACH transaction + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Type] + required :type, enum: -> { Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Type } + + # @!method initialize(code:, type:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ReturnAction} + # for more details. + # + # @param code [Symbol, Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code] NACHA return code to use when returning the transaction. Note that the list of a + # + # @param type [Symbol, Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Type] Return the ACH transaction + + # NACHA return code to use when returning the transaction. Note that the list of + # available return codes is subject to an allowlist configured at the program + # level + # + # @see Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ReturnAction#code + module Code + extend Lithic::Internal::Type::Enum + + R01 = :R01 + R02 = :R02 + R03 = :R03 + R04 = :R04 + R05 = :R05 + R06 = :R06 + R07 = :R07 + R08 = :R08 + R09 = :R09 + R10 = :R10 + R11 = :R11 + R12 = :R12 + R13 = :R13 + R14 = :R14 + R15 = :R15 + R16 = :R16 + R17 = :R17 + R18 = :R18 + R19 = :R19 + R20 = :R20 + R21 = :R21 + R22 = :R22 + R23 = :R23 + R24 = :R24 + R25 = :R25 + R26 = :R26 + R27 = :R27 + R28 = :R28 + R29 = :R29 + R30 = :R30 + R31 = :R31 + R32 = :R32 + R33 = :R33 + R34 = :R34 + R35 = :R35 + R36 = :R36 + R37 = :R37 + R38 = :R38 + R39 = :R39 + R40 = :R40 + R41 = :R41 + R42 = :R42 + R43 = :R43 + R44 = :R44 + R45 = :R45 + R46 = :R46 + R47 = :R47 + R50 = :R50 + R51 = :R51 + R52 = :R52 + R53 = :R53 + R61 = :R61 + R62 = :R62 + R67 = :R67 + R68 = :R68 + R69 = :R69 + R70 = :R70 + R71 = :R71 + R72 = :R72 + R73 = :R73 + R74 = :R74 + R75 = :R75 + R76 = :R76 + R77 = :R77 + R80 = :R80 + R81 = :R81 + R82 = :R82 + R83 = :R83 + R84 = :R84 + R85 = :R85 + + # @!method self.values + # @return [Array] + end + + # Return the ACH transaction + # + # @see Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ReturnAction#type + module Type + extend Lithic::Internal::Type::Enum + + RETURN = :RETURN + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH, Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ReturnAction)] + end + + class Condition < Lithic::Internal::Type::BaseModel + # @!attribute attribute + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `COMPANY_NAME`: The name of the company initiating the ACH transaction. + # - `COMPANY_ID`: The company ID (also known as Standard Entry Class (SEC) Company + # ID) of the entity initiating the ACH transaction. + # - `TIMESTAMP`: The timestamp of the ACH transaction in ISO 8601 format. + # - `TRANSACTION_AMOUNT`: The amount of the ACH transaction in minor units + # (cents). Use an integer value. + # - `SEC_CODE`: Standard Entry Class code indicating the type of ACH transaction. + # Valid values include PPD (Prearranged Payment and Deposit Entry), CCD + # (Corporate Credit or Debit Entry), WEB (Internet-Initiated/Mobile Entry), TEL + # (Telephone-Initiated Entry), and others. + # - `MEMO`: Optional memo or description field included with the ACH transaction. + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalACHActionParameters::Condition::Attribute] + required :attribute, enum: -> { Lithic::AuthRules::ConditionalACHActionParameters::Condition::Attribute } + + # @!attribute operation + # The operation to apply to the attribute + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalOperation] + required :operation, enum: -> { Lithic::AuthRules::ConditionalOperation } + + # @!attribute value + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + # + # @return [String, Integer, Float, Array, Time] + required :value, union: -> { Lithic::AuthRules::ConditionalValue } + + # @!method initialize(attribute:, operation:, value:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::ConditionalACHActionParameters::Condition} for more + # details. + # + # @param attribute [Symbol, Lithic::Models::AuthRules::ConditionalACHActionParameters::Condition::Attribute] The attribute to target. + # + # @param operation [Symbol, Lithic::Models::AuthRules::ConditionalOperation] The operation to apply to the attribute + # + # @param value [String, Integer, Float, Array, Time] A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `COMPANY_NAME`: The name of the company initiating the ACH transaction. + # - `COMPANY_ID`: The company ID (also known as Standard Entry Class (SEC) Company + # ID) of the entity initiating the ACH transaction. + # - `TIMESTAMP`: The timestamp of the ACH transaction in ISO 8601 format. + # - `TRANSACTION_AMOUNT`: The amount of the ACH transaction in minor units + # (cents). Use an integer value. + # - `SEC_CODE`: Standard Entry Class code indicating the type of ACH transaction. + # Valid values include PPD (Prearranged Payment and Deposit Entry), CCD + # (Corporate Credit or Debit Entry), WEB (Internet-Initiated/Mobile Entry), TEL + # (Telephone-Initiated Entry), and others. + # - `MEMO`: Optional memo or description field included with the ACH transaction. + # + # @see Lithic::Models::AuthRules::ConditionalACHActionParameters::Condition#attribute + module Attribute + extend Lithic::Internal::Type::Enum + + COMPANY_NAME = :COMPANY_NAME + COMPANY_ID = :COMPANY_ID + TIMESTAMP = :TIMESTAMP + TRANSACTION_AMOUNT = :TRANSACTION_AMOUNT + SEC_CODE = :SEC_CODE + MEMO = :MEMO + + # @!method self.values + # @return [Array] + end + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/conditional_attribute.rb b/lib/lithic/models/auth_rules/conditional_attribute.rb new file mode 100644 index 00000000..35d19d0a --- /dev/null +++ b/lib/lithic/models/auth_rules/conditional_attribute.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + # business by the types of goods or services it provides. + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + # Netherlands Antilles. + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + # the transaction. + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + # (merchant). + # - `DESCRIPTOR`: Short description of card acceptor. + # - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer + # applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + # `TOKEN_AUTHENTICATED`. + # - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number + # (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, + # `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, + # `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, + # `UNKNOWN`, `CREDENTIAL_ON_FILE`, or `ECOMMERCE`. + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + # fee field in the settlement/cardholder billing currency. This is the amount + # the issuer should authorize against unless the issuer is paying the acquirer + # fee on behalf of the cardholder. + # - `RISK_SCORE`: Network-provided score assessing risk level associated with a + # given authorization. Scores are on a range of 0-999, with 0 representing the + # lowest risk and 999 representing the highest risk. For Visa transactions, + # where the raw score has a range of 0-99, Lithic will normalize the score by + # multiplying the raw score by 10x. + # - `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in the + # trailing 15 minutes before the authorization. + # - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the + # trailing hour up and until the authorization. + # - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the + # trailing 24 hours up and until the authorization. + # - `CARD_STATE`: The current state of the card associated with the transaction. + # Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, + # `PENDING_FULFILLMENT`. + # - `PIN_ENTERED`: Indicates whether a PIN was entered during the transaction. + # Valid values are `TRUE`, `FALSE`. + # - `PIN_STATUS`: The current state of card's PIN. Valid values are `NOT_SET`, + # `OK`, `BLOCKED`. + # - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the + # source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, + # `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. + # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address + # data with the cardholder KYC data if it exists. Valid values are `MATCH`, + # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`. + module ConditionalAttribute + extend Lithic::Internal::Type::Enum + + MCC = :MCC + COUNTRY = :COUNTRY + CURRENCY = :CURRENCY + MERCHANT_ID = :MERCHANT_ID + DESCRIPTOR = :DESCRIPTOR + LIABILITY_SHIFT = :LIABILITY_SHIFT + PAN_ENTRY_MODE = :PAN_ENTRY_MODE + TRANSACTION_AMOUNT = :TRANSACTION_AMOUNT + RISK_SCORE = :RISK_SCORE + CARD_TRANSACTION_COUNT_15_M = :CARD_TRANSACTION_COUNT_15M + CARD_TRANSACTION_COUNT_1_H = :CARD_TRANSACTION_COUNT_1H + CARD_TRANSACTION_COUNT_24_H = :CARD_TRANSACTION_COUNT_24H + CARD_STATE = :CARD_STATE + PIN_ENTERED = :PIN_ENTERED + PIN_STATUS = :PIN_STATUS + WALLET_TYPE = :WALLET_TYPE + ADDRESS_MATCH = :ADDRESS_MATCH + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/auth_rules/conditional_authorization_action_parameters.rb b/lib/lithic/models/auth_rules/conditional_authorization_action_parameters.rb new file mode 100644 index 00000000..70a315e6 --- /dev/null +++ b/lib/lithic/models/auth_rules/conditional_authorization_action_parameters.rb @@ -0,0 +1,474 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class ConditionalAuthorizationActionParameters < Lithic::Internal::Type::BaseModel + # @!attribute action + # The action to take if the conditions are met. + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Action] + required :action, enum: -> { Lithic::AuthRules::ConditionalAuthorizationActionParameters::Action } + + # @!attribute conditions + # + # @return [Array] + required :conditions, + -> { Lithic::Internal::Type::ArrayOf[Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition] } + + # @!method initialize(action:, conditions:) + # @param action [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Action] The action to take if the conditions are met. + # + # @param conditions [Array] + + # The action to take if the conditions are met. + # + # @see Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters#action + module Action + extend Lithic::Internal::Type::Enum + + DECLINE = :DECLINE + CHALLENGE = :CHALLENGE + + # @!method self.values + # @return [Array] + end + + class Condition < Lithic::Internal::Type::BaseModel + # @!attribute attribute + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + # business by the types of goods or services it provides. + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + # Netherlands Antilles. + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + # the transaction. + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + # (merchant). + # - `DESCRIPTOR`: Short description of card acceptor. + # - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer + # applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + # `TOKEN_AUTHENTICATED`. + # - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number + # (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, + # `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, + # `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, + # `UNKNOWN`, `CREDENTIAL_ON_FILE`, or `ECOMMERCE`. + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + # fee field in the settlement/cardholder billing currency. This is the amount + # the issuer should authorize against unless the issuer is paying the acquirer + # fee on behalf of the cardholder. Use an integer value. + # - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This + # represents the amount of cash being withdrawn or advanced. Use an integer + # value. + # - `RISK_SCORE`: Network-provided score assessing risk level associated with a + # given authorization. Scores are on a range of 0-999, with 0 representing the + # lowest risk and 999 representing the highest risk. For Visa transactions, + # where the raw score has a range of 0-99, Lithic will normalize the score by + # multiplying the raw score by 10x. Use an integer value. + # - `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in the + # trailing 15 minutes before the authorization. Use an integer value. + # - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the + # trailing hour up and until the authorization. Use an integer value. + # - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the + # trailing 24 hours up and until the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_15M`: The number of declined transactions on the card in + # the trailing 15 minutes before the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_1H`: The number of declined transactions on the card in + # the trailing hour up and until the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_24H`: The number of declined transactions on the card in + # the trailing 24 hours up and until the authorization. Use an integer value. + # - `CARD_STATE`: The current state of the card associated with the transaction. + # Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, + # `PENDING_FULFILLMENT`. + # - `PIN_ENTERED`: Indicates whether a PIN was entered during the transaction. + # Valid values are `TRUE`, `FALSE`. + # - `PIN_STATUS`: The current state of card's PIN. Valid values are `NOT_SET`, + # `OK`, `BLOCKED`. + # - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the + # source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, + # `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. + # - `TRANSACTION_INITIATOR`: The entity that initiated the transaction indicates + # the source of the token. Valid values are `CARDHOLDER`, `MERCHANT`, `UNKNOWN`. + # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address + # data with the cardholder KYC data if it exists. Valid values are `MATCH`, + # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`. + # - `SERVICE_LOCATION_STATE`: The state/province code (ISO 3166-2) where the + # cardholder received the service, e.g. "NY". When a service location is present + # in the network data, the service location state is used. Otherwise, falls back + # to the card acceptor state. + # - `SERVICE_LOCATION_POSTAL_CODE`: The postal code where the cardholder received + # the service, e.g. "10001". When a service location is present in the network + # data, the service location postal code is used. Otherwise, falls back to the + # card acceptor postal code. + # - `CARD_AGE`: The age of the card in seconds at the time of the authorization. + # Use an integer value. + # - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time + # of the authorization. Use an integer value. For programs where Lithic does not + # manage or retain account holder data, this attribute does not evaluate. + # - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the + # entity's transaction history. Null if fewer than 30 approved transactions in + # the specified window. Requires `parameters.scope` and `parameters.interval`. + # Use a decimal value. + # - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the + # entity over the specified window, in cents. Requires `parameters.scope` and + # `parameters.interval`. Use a decimal value. + # - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction + # amounts for the entity over the specified window, in cents. Null if fewer than + # 30 approved transactions in the specified window. Requires `parameters.scope` + # and `parameters.interval`. Use a decimal value. + # - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen + # in the entity's transaction history. Valid values are `TRUE`, `FALSE`. + # Requires `parameters.scope`. + # - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's + # transaction history. Valid values are `TRUE`, `FALSE`. Requires + # `parameters.scope`. + # - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity. + # Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`. + # - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for + # the entity over the last 30 days (rolling). Requires `parameters.scope`. Not + # supported for `BUSINESS_ACCOUNT` scope. Use an integer value. + # - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved + # transaction for the entity, rounded to the nearest whole day. Requires + # `parameters.scope`. Use an integer value. + # - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in + # the entity's transaction history. Requires `parameters.scope`. Use an integer + # value. + # - `IS_NEW_MERCHANT`: Whether the card acceptor ID has not been seen in the + # card's approved transaction history (capped at the 1000 most recently seen + # merchants). Valid values are `TRUE`, `FALSE`. Card-scoped only; no + # `parameters` required. + # - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as + # a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required. + # Use a decimal value. + # - `TRAVEL_SPEED`: The estimated speed of travel derived from the distance + # between the postal code centers of the last card-present transaction and the + # current transaction, divided by the elapsed time. Null if there is no prior + # card-present transaction, if either postal code cannot be geocoded, or if + # elapsed time is zero. Requires `parameters.unit` set to `MPH` or `KPH`. Use a + # decimal value. + # - `DISTANCE_FROM_LAST_TRANSACTION`: The estimated distance between the postal + # code centers of the last card-present transaction and the current transaction. + # Null if there is no prior card-present transaction or if either postal code + # cannot be geocoded. Requires `parameters.unit` set to `MILES` or `KILOMETERS`. + # Use a decimal value. + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute] + required :attribute, + enum: -> { Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute } + + # @!attribute operation + # The operation to apply to the attribute + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalOperation] + required :operation, enum: -> { Lithic::AuthRules::ConditionalOperation } + + # @!attribute value + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + # + # @return [String, Integer, Float, Array, Time] + required :value, union: -> { Lithic::AuthRules::ConditionalValue } + + # @!attribute parameters + # Additional parameters for certain attributes. Required when `attribute` is one + # of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`, + # `IS_NEW_COUNTRY`, `IS_NEW_MCC`, `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, + # `TIME_SINCE_LAST_TRANSACTION`, or `DISTINCT_COUNTRY_COUNT` (require `scope`); or + # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`). Not used + # for other attributes. + # + # @return [Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters, nil] + optional :parameters, + -> { Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters } + + # @!method initialize(attribute:, operation:, value:, parameters: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition} + # for more details. + # + # @param attribute [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute] The attribute to target. + # + # @param operation [Symbol, Lithic::Models::AuthRules::ConditionalOperation] The operation to apply to the attribute + # + # @param value [String, Integer, Float, Array, Time] A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + # + # @param parameters [Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters] Additional parameters for certain attributes. Required when `attribute` is one o + + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + # business by the types of goods or services it provides. + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + # Netherlands Antilles. + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + # the transaction. + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + # (merchant). + # - `DESCRIPTOR`: Short description of card acceptor. + # - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer + # applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + # `TOKEN_AUTHENTICATED`. + # - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number + # (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, + # `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, + # `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, + # `UNKNOWN`, `CREDENTIAL_ON_FILE`, or `ECOMMERCE`. + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + # fee field in the settlement/cardholder billing currency. This is the amount + # the issuer should authorize against unless the issuer is paying the acquirer + # fee on behalf of the cardholder. Use an integer value. + # - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This + # represents the amount of cash being withdrawn or advanced. Use an integer + # value. + # - `RISK_SCORE`: Network-provided score assessing risk level associated with a + # given authorization. Scores are on a range of 0-999, with 0 representing the + # lowest risk and 999 representing the highest risk. For Visa transactions, + # where the raw score has a range of 0-99, Lithic will normalize the score by + # multiplying the raw score by 10x. Use an integer value. + # - `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in the + # trailing 15 minutes before the authorization. Use an integer value. + # - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the + # trailing hour up and until the authorization. Use an integer value. + # - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the + # trailing 24 hours up and until the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_15M`: The number of declined transactions on the card in + # the trailing 15 minutes before the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_1H`: The number of declined transactions on the card in + # the trailing hour up and until the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_24H`: The number of declined transactions on the card in + # the trailing 24 hours up and until the authorization. Use an integer value. + # - `CARD_STATE`: The current state of the card associated with the transaction. + # Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, + # `PENDING_FULFILLMENT`. + # - `PIN_ENTERED`: Indicates whether a PIN was entered during the transaction. + # Valid values are `TRUE`, `FALSE`. + # - `PIN_STATUS`: The current state of card's PIN. Valid values are `NOT_SET`, + # `OK`, `BLOCKED`. + # - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the + # source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, + # `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. + # - `TRANSACTION_INITIATOR`: The entity that initiated the transaction indicates + # the source of the token. Valid values are `CARDHOLDER`, `MERCHANT`, `UNKNOWN`. + # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address + # data with the cardholder KYC data if it exists. Valid values are `MATCH`, + # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`. + # - `SERVICE_LOCATION_STATE`: The state/province code (ISO 3166-2) where the + # cardholder received the service, e.g. "NY". When a service location is present + # in the network data, the service location state is used. Otherwise, falls back + # to the card acceptor state. + # - `SERVICE_LOCATION_POSTAL_CODE`: The postal code where the cardholder received + # the service, e.g. "10001". When a service location is present in the network + # data, the service location postal code is used. Otherwise, falls back to the + # card acceptor postal code. + # - `CARD_AGE`: The age of the card in seconds at the time of the authorization. + # Use an integer value. + # - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time + # of the authorization. Use an integer value. For programs where Lithic does not + # manage or retain account holder data, this attribute does not evaluate. + # - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the + # entity's transaction history. Null if fewer than 30 approved transactions in + # the specified window. Requires `parameters.scope` and `parameters.interval`. + # Use a decimal value. + # - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the + # entity over the specified window, in cents. Requires `parameters.scope` and + # `parameters.interval`. Use a decimal value. + # - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction + # amounts for the entity over the specified window, in cents. Null if fewer than + # 30 approved transactions in the specified window. Requires `parameters.scope` + # and `parameters.interval`. Use a decimal value. + # - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen + # in the entity's transaction history. Valid values are `TRUE`, `FALSE`. + # Requires `parameters.scope`. + # - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's + # transaction history. Valid values are `TRUE`, `FALSE`. Requires + # `parameters.scope`. + # - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity. + # Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`. + # - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for + # the entity over the last 30 days (rolling). Requires `parameters.scope`. Not + # supported for `BUSINESS_ACCOUNT` scope. Use an integer value. + # - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved + # transaction for the entity, rounded to the nearest whole day. Requires + # `parameters.scope`. Use an integer value. + # - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in + # the entity's transaction history. Requires `parameters.scope`. Use an integer + # value. + # - `IS_NEW_MERCHANT`: Whether the card acceptor ID has not been seen in the + # card's approved transaction history (capped at the 1000 most recently seen + # merchants). Valid values are `TRUE`, `FALSE`. Card-scoped only; no + # `parameters` required. + # - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as + # a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required. + # Use a decimal value. + # - `TRAVEL_SPEED`: The estimated speed of travel derived from the distance + # between the postal code centers of the last card-present transaction and the + # current transaction, divided by the elapsed time. Null if there is no prior + # card-present transaction, if either postal code cannot be geocoded, or if + # elapsed time is zero. Requires `parameters.unit` set to `MPH` or `KPH`. Use a + # decimal value. + # - `DISTANCE_FROM_LAST_TRANSACTION`: The estimated distance between the postal + # code centers of the last card-present transaction and the current transaction. + # Null if there is no prior card-present transaction or if either postal code + # cannot be geocoded. Requires `parameters.unit` set to `MILES` or `KILOMETERS`. + # Use a decimal value. + # + # @see Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition#attribute + module Attribute + extend Lithic::Internal::Type::Enum + + MCC = :MCC + COUNTRY = :COUNTRY + CURRENCY = :CURRENCY + MERCHANT_ID = :MERCHANT_ID + DESCRIPTOR = :DESCRIPTOR + LIABILITY_SHIFT = :LIABILITY_SHIFT + PAN_ENTRY_MODE = :PAN_ENTRY_MODE + TRANSACTION_AMOUNT = :TRANSACTION_AMOUNT + CASH_AMOUNT = :CASH_AMOUNT + RISK_SCORE = :RISK_SCORE + CARD_TRANSACTION_COUNT_15_M = :CARD_TRANSACTION_COUNT_15M + CARD_TRANSACTION_COUNT_1_H = :CARD_TRANSACTION_COUNT_1H + CARD_TRANSACTION_COUNT_24_H = :CARD_TRANSACTION_COUNT_24H + CARD_DECLINE_COUNT_15_M = :CARD_DECLINE_COUNT_15M + CARD_DECLINE_COUNT_1_H = :CARD_DECLINE_COUNT_1H + CARD_DECLINE_COUNT_24_H = :CARD_DECLINE_COUNT_24H + CARD_STATE = :CARD_STATE + PIN_ENTERED = :PIN_ENTERED + PIN_STATUS = :PIN_STATUS + WALLET_TYPE = :WALLET_TYPE + TRANSACTION_INITIATOR = :TRANSACTION_INITIATOR + ADDRESS_MATCH = :ADDRESS_MATCH + SERVICE_LOCATION_STATE = :SERVICE_LOCATION_STATE + SERVICE_LOCATION_POSTAL_CODE = :SERVICE_LOCATION_POSTAL_CODE + CARD_AGE = :CARD_AGE + ACCOUNT_AGE = :ACCOUNT_AGE + AMOUNT_Z_SCORE = :AMOUNT_Z_SCORE + AVG_TRANSACTION_AMOUNT = :AVG_TRANSACTION_AMOUNT + STDEV_TRANSACTION_AMOUNT = :STDEV_TRANSACTION_AMOUNT + IS_NEW_COUNTRY = :IS_NEW_COUNTRY + IS_NEW_MCC = :IS_NEW_MCC + IS_FIRST_TRANSACTION = :IS_FIRST_TRANSACTION + CONSECUTIVE_DECLINES = :CONSECUTIVE_DECLINES + TIME_SINCE_LAST_TRANSACTION = :TIME_SINCE_LAST_TRANSACTION + DISTINCT_COUNTRY_COUNT = :DISTINCT_COUNTRY_COUNT + IS_NEW_MERCHANT = :IS_NEW_MERCHANT + THREE_DS_SUCCESS_RATE = :THREE_DS_SUCCESS_RATE + TRAVEL_SPEED = :TRAVEL_SPEED + DISTANCE_FROM_LAST_TRANSACTION = :DISTANCE_FROM_LAST_TRANSACTION + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition#parameters + class Parameters < Lithic::Internal::Type::BaseModel + # @!attribute interval + # The time window for statistical attributes (`AMOUNT_Z_SCORE`, + # `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for + # all-time history or a specific window (`7D`, `30D`, `90D`). + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval, nil] + optional :interval, + enum: -> { Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval } + + # @!attribute scope + # The entity scope to evaluate the attribute against. + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope, nil] + optional :scope, + enum: -> { Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope } + + # @!attribute unit + # The unit for impossible travel attributes. Required when `attribute` is + # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION`. + # + # For `TRAVEL_SPEED`: `MPH` (miles per hour) or `KPH` (kilometers per hour). + # + # For `DISTANCE_FROM_LAST_TRANSACTION`: `MILES` or `KILOMETERS`. + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Unit, nil] + optional :unit, + enum: -> { Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Unit } + + # @!method initialize(interval: nil, scope: nil, unit: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters} + # for more details. + # + # Additional parameters for certain attributes. Required when `attribute` is one + # of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`, + # `IS_NEW_COUNTRY`, `IS_NEW_MCC`, `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, + # `TIME_SINCE_LAST_TRANSACTION`, or `DISTINCT_COUNTRY_COUNT` (require `scope`); or + # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`). Not used + # for other attributes. + # + # @param interval [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval] The time window for statistical attributes (`AMOUNT_Z_SCORE`, `AVG_TRANSACTION_A + # + # @param scope [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope] The entity scope to evaluate the attribute against. + # + # @param unit [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Unit] The unit for impossible travel attributes. Required when `attribute` is + # `TRAVEL\_ + + # The time window for statistical attributes (`AMOUNT_Z_SCORE`, + # `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for + # all-time history or a specific window (`7D`, `30D`, `90D`). + # + # @see Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters#interval + module Interval + extend Lithic::Internal::Type::Enum + + LIFETIME = :LIFETIME + INTERVAL_7_D = :"7D" + INTERVAL_30_D = :"30D" + INTERVAL_90_D = :"90D" + + # @!method self.values + # @return [Array] + end + + # The entity scope to evaluate the attribute against. + # + # @see Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters#scope + module Scope + extend Lithic::Internal::Type::Enum + + CARD = :CARD + ACCOUNT = :ACCOUNT + BUSINESS_ACCOUNT = :BUSINESS_ACCOUNT + + # @!method self.values + # @return [Array] + end + + # The unit for impossible travel attributes. Required when `attribute` is + # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION`. + # + # For `TRAVEL_SPEED`: `MPH` (miles per hour) or `KPH` (kilometers per hour). + # + # For `DISTANCE_FROM_LAST_TRANSACTION`: `MILES` or `KILOMETERS`. + # + # @see Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters#unit + module Unit + extend Lithic::Internal::Type::Enum + + MPH = :MPH + KPH = :KPH + MILES = :MILES + KILOMETERS = :KILOMETERS + + # @!method self.values + # @return [Array] + end + end + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/conditional_authorization_adjustment_parameters.rb b/lib/lithic/models/auth_rules/conditional_authorization_adjustment_parameters.rb new file mode 100644 index 00000000..6f6178fc --- /dev/null +++ b/lib/lithic/models/auth_rules/conditional_authorization_adjustment_parameters.rb @@ -0,0 +1,531 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class ConditionalAuthorizationAdjustmentParameters < Lithic::Internal::Type::BaseModel + # @!attribute action + # The hold adjustment to apply if the conditions are met. + # + # @return [Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action] + required :action, -> { Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action } + + # @!attribute conditions + # + # @return [Array] + required :conditions, + -> { Lithic::Internal::Type::ArrayOf[Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition] } + + # @!method initialize(action:, conditions:) + # @param action [Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action] The hold adjustment to apply if the conditions are met. + # + # @param conditions [Array] + + # @see Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters#action + class Action < Lithic::Internal::Type::BaseModel + # @!attribute mode + # The mode of the hold adjustment, determining how the value is interpreted: + # + # - `REPLACE_WITH_AMOUNT`: The value is the approved hold amount in cents. + # - `ADD_PERCENTAGE`: The value adjusts the hold amount by a percentage. 1000 + # represents a 10% increase, 0 represents no change. + # - `ADD_AMOUNT`: The value is added to the hold amount in cents. + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::Mode] + required :mode, enum: -> { Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::Mode } + + # @!attribute type + # The type of adjustment to apply + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::Type] + required :type, enum: -> { Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::Type } + + # @!attribute value + # The value used for the hold adjustment, interpreted based on the mode + # + # @return [Integer] + required :value, Integer + + # @!method initialize(mode:, type:, value:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action} + # for more details. + # + # The hold adjustment to apply if the conditions are met. + # + # @param mode [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::Mode] The mode of the hold adjustment, determining how the value is interpreted: + # + # @param type [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::Type] The type of adjustment to apply + # + # @param value [Integer] The value used for the hold adjustment, interpreted based on the mode + + # The mode of the hold adjustment, determining how the value is interpreted: + # + # - `REPLACE_WITH_AMOUNT`: The value is the approved hold amount in cents. + # - `ADD_PERCENTAGE`: The value adjusts the hold amount by a percentage. 1000 + # represents a 10% increase, 0 represents no change. + # - `ADD_AMOUNT`: The value is added to the hold amount in cents. + # + # @see Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action#mode + module Mode + extend Lithic::Internal::Type::Enum + + REPLACE_WITH_AMOUNT = :REPLACE_WITH_AMOUNT + ADD_PERCENTAGE = :ADD_PERCENTAGE + ADD_AMOUNT = :ADD_AMOUNT + + # @!method self.values + # @return [Array] + end + + # The type of adjustment to apply + # + # @see Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action#type + module Type + extend Lithic::Internal::Type::Enum + + HOLD_ADJUSTMENT = :HOLD_ADJUSTMENT + + # @!method self.values + # @return [Array] + end + end + + class Condition < Lithic::Internal::Type::BaseModel + # @!attribute attribute + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + # business by the types of goods or services it provides. + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + # Netherlands Antilles. + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + # the transaction. + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + # (merchant). + # - `DESCRIPTOR`: Short description of card acceptor. + # - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer + # applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + # `TOKEN_AUTHENTICATED`. + # - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number + # (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, + # `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, + # `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, + # `UNKNOWN`, `CREDENTIAL_ON_FILE`, or `ECOMMERCE`. + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + # fee field in the settlement/cardholder billing currency. This is the amount + # the issuer should authorize against unless the issuer is paying the acquirer + # fee on behalf of the cardholder. Use an integer value. + # - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This + # represents the amount of cash being withdrawn or advanced. Use an integer + # value. + # - `RISK_SCORE`: Network-provided score assessing risk level associated with a + # given authorization. Scores are on a range of 0-999, with 0 representing the + # lowest risk and 999 representing the highest risk. For Visa transactions, + # where the raw score has a range of 0-99, Lithic will normalize the score by + # multiplying the raw score by 10x. Use an integer value. + # - `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in the + # trailing 15 minutes before the authorization. Use an integer value. + # - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the + # trailing hour up and until the authorization. Use an integer value. + # - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the + # trailing 24 hours up and until the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_15M`: The number of declined transactions on the card in + # the trailing 15 minutes before the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_1H`: The number of declined transactions on the card in + # the trailing hour up and until the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_24H`: The number of declined transactions on the card in + # the trailing 24 hours up and until the authorization. Use an integer value. + # - `CARD_STATE`: The current state of the card associated with the transaction. + # Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, + # `PENDING_FULFILLMENT`. + # - `PIN_ENTERED`: Indicates whether a PIN was entered during the transaction. + # Valid values are `TRUE`, `FALSE`. + # - `PIN_STATUS`: The current state of card's PIN. Valid values are `NOT_SET`, + # `OK`, `BLOCKED`. + # - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the + # source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, + # `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. + # - `TRANSACTION_INITIATOR`: The entity that initiated the transaction indicates + # the source of the token. Valid values are `CARDHOLDER`, `MERCHANT`, `UNKNOWN`. + # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address + # data with the cardholder KYC data if it exists. Valid values are `MATCH`, + # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`. + # - `SERVICE_LOCATION_STATE`: The state/province code (ISO 3166-2) where the + # cardholder received the service, e.g. "NY". When a service location is present + # in the network data, the service location state is used. Otherwise, falls back + # to the card acceptor state. + # - `SERVICE_LOCATION_POSTAL_CODE`: The postal code where the cardholder received + # the service, e.g. "10001". When a service location is present in the network + # data, the service location postal code is used. Otherwise, falls back to the + # card acceptor postal code. + # - `CARD_AGE`: The age of the card in seconds at the time of the authorization. + # Use an integer value. + # - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time + # of the authorization. Use an integer value. For programs where Lithic does not + # manage or retain account holder data, this attribute does not evaluate. + # - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the + # entity's transaction history. Null if fewer than 30 approved transactions in + # the specified window. Requires `parameters.scope` and `parameters.interval`. + # Use a decimal value. + # - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the + # entity over the specified window, in cents. Requires `parameters.scope` and + # `parameters.interval`. Use a decimal value. + # - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction + # amounts for the entity over the specified window, in cents. Null if fewer than + # 30 approved transactions in the specified window. Requires `parameters.scope` + # and `parameters.interval`. Use a decimal value. + # - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen + # in the entity's transaction history. Valid values are `TRUE`, `FALSE`. + # Requires `parameters.scope`. + # - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's + # transaction history. Valid values are `TRUE`, `FALSE`. Requires + # `parameters.scope`. + # - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity. + # Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`. + # - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for + # the entity over the last 30 days (rolling). Requires `parameters.scope`. Not + # supported for `BUSINESS_ACCOUNT` scope. Use an integer value. + # - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved + # transaction for the entity, rounded to the nearest whole day. Requires + # `parameters.scope`. Use an integer value. + # - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in + # the entity's transaction history. Requires `parameters.scope`. Use an integer + # value. + # - `IS_NEW_MERCHANT`: Whether the card acceptor ID has not been seen in the + # card's approved transaction history (capped at the 1000 most recently seen + # merchants). Valid values are `TRUE`, `FALSE`. Card-scoped only; no + # `parameters` required. + # - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as + # a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required. + # Use a decimal value. + # - `TRAVEL_SPEED`: The estimated speed of travel derived from the distance + # between the postal code centers of the last card-present transaction and the + # current transaction, divided by the elapsed time. Null if there is no prior + # card-present transaction, if either postal code cannot be geocoded, or if + # elapsed time is zero. Requires `parameters.unit` set to `MPH` or `KPH`. Use a + # decimal value. + # - `DISTANCE_FROM_LAST_TRANSACTION`: The estimated distance between the postal + # code centers of the last card-present transaction and the current transaction. + # Null if there is no prior card-present transaction or if either postal code + # cannot be geocoded. Requires `parameters.unit` set to `MILES` or `KILOMETERS`. + # Use a decimal value. + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute] + required :attribute, + enum: -> { Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute } + + # @!attribute operation + # The operation to apply to the attribute + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalOperation] + required :operation, enum: -> { Lithic::AuthRules::ConditionalOperation } + + # @!attribute value + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + # + # @return [String, Integer, Float, Array, Time] + required :value, union: -> { Lithic::AuthRules::ConditionalValue } + + # @!attribute parameters + # Additional parameters for certain attributes. Required when `attribute` is one + # of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`, + # `IS_NEW_COUNTRY`, `IS_NEW_MCC`, `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, + # `TIME_SINCE_LAST_TRANSACTION`, or `DISTINCT_COUNTRY_COUNT` (require `scope`); or + # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`). Not used + # for other attributes. + # + # @return [Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters, nil] + optional :parameters, + -> { Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters } + + # @!method initialize(attribute:, operation:, value:, parameters: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition} + # for more details. + # + # @param attribute [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute] The attribute to target. + # + # @param operation [Symbol, Lithic::Models::AuthRules::ConditionalOperation] The operation to apply to the attribute + # + # @param value [String, Integer, Float, Array, Time] A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + # + # @param parameters [Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters] Additional parameters for certain attributes. Required when `attribute` is one o + + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + # business by the types of goods or services it provides. + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + # Netherlands Antilles. + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + # the transaction. + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + # (merchant). + # - `DESCRIPTOR`: Short description of card acceptor. + # - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer + # applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + # `TOKEN_AUTHENTICATED`. + # - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number + # (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, + # `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, + # `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, + # `UNKNOWN`, `CREDENTIAL_ON_FILE`, or `ECOMMERCE`. + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + # fee field in the settlement/cardholder billing currency. This is the amount + # the issuer should authorize against unless the issuer is paying the acquirer + # fee on behalf of the cardholder. Use an integer value. + # - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This + # represents the amount of cash being withdrawn or advanced. Use an integer + # value. + # - `RISK_SCORE`: Network-provided score assessing risk level associated with a + # given authorization. Scores are on a range of 0-999, with 0 representing the + # lowest risk and 999 representing the highest risk. For Visa transactions, + # where the raw score has a range of 0-99, Lithic will normalize the score by + # multiplying the raw score by 10x. Use an integer value. + # - `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in the + # trailing 15 minutes before the authorization. Use an integer value. + # - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the + # trailing hour up and until the authorization. Use an integer value. + # - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the + # trailing 24 hours up and until the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_15M`: The number of declined transactions on the card in + # the trailing 15 minutes before the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_1H`: The number of declined transactions on the card in + # the trailing hour up and until the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_24H`: The number of declined transactions on the card in + # the trailing 24 hours up and until the authorization. Use an integer value. + # - `CARD_STATE`: The current state of the card associated with the transaction. + # Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, + # `PENDING_FULFILLMENT`. + # - `PIN_ENTERED`: Indicates whether a PIN was entered during the transaction. + # Valid values are `TRUE`, `FALSE`. + # - `PIN_STATUS`: The current state of card's PIN. Valid values are `NOT_SET`, + # `OK`, `BLOCKED`. + # - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the + # source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, + # `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. + # - `TRANSACTION_INITIATOR`: The entity that initiated the transaction indicates + # the source of the token. Valid values are `CARDHOLDER`, `MERCHANT`, `UNKNOWN`. + # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address + # data with the cardholder KYC data if it exists. Valid values are `MATCH`, + # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`. + # - `SERVICE_LOCATION_STATE`: The state/province code (ISO 3166-2) where the + # cardholder received the service, e.g. "NY". When a service location is present + # in the network data, the service location state is used. Otherwise, falls back + # to the card acceptor state. + # - `SERVICE_LOCATION_POSTAL_CODE`: The postal code where the cardholder received + # the service, e.g. "10001". When a service location is present in the network + # data, the service location postal code is used. Otherwise, falls back to the + # card acceptor postal code. + # - `CARD_AGE`: The age of the card in seconds at the time of the authorization. + # Use an integer value. + # - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time + # of the authorization. Use an integer value. For programs where Lithic does not + # manage or retain account holder data, this attribute does not evaluate. + # - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the + # entity's transaction history. Null if fewer than 30 approved transactions in + # the specified window. Requires `parameters.scope` and `parameters.interval`. + # Use a decimal value. + # - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the + # entity over the specified window, in cents. Requires `parameters.scope` and + # `parameters.interval`. Use a decimal value. + # - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction + # amounts for the entity over the specified window, in cents. Null if fewer than + # 30 approved transactions in the specified window. Requires `parameters.scope` + # and `parameters.interval`. Use a decimal value. + # - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen + # in the entity's transaction history. Valid values are `TRUE`, `FALSE`. + # Requires `parameters.scope`. + # - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's + # transaction history. Valid values are `TRUE`, `FALSE`. Requires + # `parameters.scope`. + # - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity. + # Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`. + # - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for + # the entity over the last 30 days (rolling). Requires `parameters.scope`. Not + # supported for `BUSINESS_ACCOUNT` scope. Use an integer value. + # - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved + # transaction for the entity, rounded to the nearest whole day. Requires + # `parameters.scope`. Use an integer value. + # - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in + # the entity's transaction history. Requires `parameters.scope`. Use an integer + # value. + # - `IS_NEW_MERCHANT`: Whether the card acceptor ID has not been seen in the + # card's approved transaction history (capped at the 1000 most recently seen + # merchants). Valid values are `TRUE`, `FALSE`. Card-scoped only; no + # `parameters` required. + # - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as + # a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required. + # Use a decimal value. + # - `TRAVEL_SPEED`: The estimated speed of travel derived from the distance + # between the postal code centers of the last card-present transaction and the + # current transaction, divided by the elapsed time. Null if there is no prior + # card-present transaction, if either postal code cannot be geocoded, or if + # elapsed time is zero. Requires `parameters.unit` set to `MPH` or `KPH`. Use a + # decimal value. + # - `DISTANCE_FROM_LAST_TRANSACTION`: The estimated distance between the postal + # code centers of the last card-present transaction and the current transaction. + # Null if there is no prior card-present transaction or if either postal code + # cannot be geocoded. Requires `parameters.unit` set to `MILES` or `KILOMETERS`. + # Use a decimal value. + # + # @see Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition#attribute + module Attribute + extend Lithic::Internal::Type::Enum + + MCC = :MCC + COUNTRY = :COUNTRY + CURRENCY = :CURRENCY + MERCHANT_ID = :MERCHANT_ID + DESCRIPTOR = :DESCRIPTOR + LIABILITY_SHIFT = :LIABILITY_SHIFT + PAN_ENTRY_MODE = :PAN_ENTRY_MODE + TRANSACTION_AMOUNT = :TRANSACTION_AMOUNT + CASH_AMOUNT = :CASH_AMOUNT + RISK_SCORE = :RISK_SCORE + CARD_TRANSACTION_COUNT_15_M = :CARD_TRANSACTION_COUNT_15M + CARD_TRANSACTION_COUNT_1_H = :CARD_TRANSACTION_COUNT_1H + CARD_TRANSACTION_COUNT_24_H = :CARD_TRANSACTION_COUNT_24H + CARD_DECLINE_COUNT_15_M = :CARD_DECLINE_COUNT_15M + CARD_DECLINE_COUNT_1_H = :CARD_DECLINE_COUNT_1H + CARD_DECLINE_COUNT_24_H = :CARD_DECLINE_COUNT_24H + CARD_STATE = :CARD_STATE + PIN_ENTERED = :PIN_ENTERED + PIN_STATUS = :PIN_STATUS + WALLET_TYPE = :WALLET_TYPE + TRANSACTION_INITIATOR = :TRANSACTION_INITIATOR + ADDRESS_MATCH = :ADDRESS_MATCH + SERVICE_LOCATION_STATE = :SERVICE_LOCATION_STATE + SERVICE_LOCATION_POSTAL_CODE = :SERVICE_LOCATION_POSTAL_CODE + CARD_AGE = :CARD_AGE + ACCOUNT_AGE = :ACCOUNT_AGE + AMOUNT_Z_SCORE = :AMOUNT_Z_SCORE + AVG_TRANSACTION_AMOUNT = :AVG_TRANSACTION_AMOUNT + STDEV_TRANSACTION_AMOUNT = :STDEV_TRANSACTION_AMOUNT + IS_NEW_COUNTRY = :IS_NEW_COUNTRY + IS_NEW_MCC = :IS_NEW_MCC + IS_FIRST_TRANSACTION = :IS_FIRST_TRANSACTION + CONSECUTIVE_DECLINES = :CONSECUTIVE_DECLINES + TIME_SINCE_LAST_TRANSACTION = :TIME_SINCE_LAST_TRANSACTION + DISTINCT_COUNTRY_COUNT = :DISTINCT_COUNTRY_COUNT + IS_NEW_MERCHANT = :IS_NEW_MERCHANT + THREE_DS_SUCCESS_RATE = :THREE_DS_SUCCESS_RATE + TRAVEL_SPEED = :TRAVEL_SPEED + DISTANCE_FROM_LAST_TRANSACTION = :DISTANCE_FROM_LAST_TRANSACTION + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition#parameters + class Parameters < Lithic::Internal::Type::BaseModel + # @!attribute interval + # The time window for statistical attributes (`AMOUNT_Z_SCORE`, + # `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for + # all-time history or a specific window (`7D`, `30D`, `90D`). + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Interval, nil] + optional :interval, + enum: -> { Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Interval } + + # @!attribute scope + # The entity scope to evaluate the attribute against. + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Scope, nil] + optional :scope, + enum: -> { Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Scope } + + # @!attribute unit + # The unit for impossible travel attributes. Required when `attribute` is + # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION`. + # + # For `TRAVEL_SPEED`: `MPH` (miles per hour) or `KPH` (kilometers per hour). + # + # For `DISTANCE_FROM_LAST_TRANSACTION`: `MILES` or `KILOMETERS`. + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Unit, nil] + optional :unit, + enum: -> { Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Unit } + + # @!method initialize(interval: nil, scope: nil, unit: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters} + # for more details. + # + # Additional parameters for certain attributes. Required when `attribute` is one + # of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`, + # `IS_NEW_COUNTRY`, `IS_NEW_MCC`, `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, + # `TIME_SINCE_LAST_TRANSACTION`, or `DISTINCT_COUNTRY_COUNT` (require `scope`); or + # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`). Not used + # for other attributes. + # + # @param interval [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Interval] The time window for statistical attributes (`AMOUNT_Z_SCORE`, `AVG_TRANSACTION_A + # + # @param scope [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Scope] The entity scope to evaluate the attribute against. + # + # @param unit [Symbol, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Unit] The unit for impossible travel attributes. Required when `attribute` is + # `TRAVEL\_ + + # The time window for statistical attributes (`AMOUNT_Z_SCORE`, + # `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for + # all-time history or a specific window (`7D`, `30D`, `90D`). + # + # @see Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters#interval + module Interval + extend Lithic::Internal::Type::Enum + + LIFETIME = :LIFETIME + INTERVAL_7_D = :"7D" + INTERVAL_30_D = :"30D" + INTERVAL_90_D = :"90D" + + # @!method self.values + # @return [Array] + end + + # The entity scope to evaluate the attribute against. + # + # @see Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters#scope + module Scope + extend Lithic::Internal::Type::Enum + + CARD = :CARD + ACCOUNT = :ACCOUNT + BUSINESS_ACCOUNT = :BUSINESS_ACCOUNT + + # @!method self.values + # @return [Array] + end + + # The unit for impossible travel attributes. Required when `attribute` is + # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION`. + # + # For `TRAVEL_SPEED`: `MPH` (miles per hour) or `KPH` (kilometers per hour). + # + # For `DISTANCE_FROM_LAST_TRANSACTION`: `MILES` or `KILOMETERS`. + # + # @see Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters#unit + module Unit + extend Lithic::Internal::Type::Enum + + MPH = :MPH + KPH = :KPH + MILES = :MILES + KILOMETERS = :KILOMETERS + + # @!method self.values + # @return [Array] + end + end + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/conditional_block_parameters.rb b/lib/lithic/models/auth_rules/conditional_block_parameters.rb new file mode 100644 index 00000000..2126c459 --- /dev/null +++ b/lib/lithic/models/auth_rules/conditional_block_parameters.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + # @deprecated + class ConditionalBlockParameters < Lithic::Internal::Type::BaseModel + # @!attribute conditions + # + # @return [Array] + required :conditions, -> { Lithic::Internal::Type::ArrayOf[Lithic::AuthRules::AuthRuleCondition] } + + # @!method initialize(conditions:) + # Deprecated: Use CONDITIONAL_ACTION instead. + # + # @param conditions [Array] + end + end + end +end diff --git a/lib/lithic/models/auth_rules/conditional_card_transaction_update_action_parameters.rb b/lib/lithic/models/auth_rules/conditional_card_transaction_update_action_parameters.rb new file mode 100644 index 00000000..a0e0646f --- /dev/null +++ b/lib/lithic/models/auth_rules/conditional_card_transaction_update_action_parameters.rb @@ -0,0 +1,434 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class ConditionalCardTransactionUpdateActionParameters < Lithic::Internal::Type::BaseModel + # @!attribute action + # The action to take if the conditions are met. + # + # @return [Lithic::Models::AuthRules::CardTransactionUpdateAction::TagAction, Lithic::Models::AuthRules::CardTransactionUpdateAction::CreateCaseAction] + required :action, union: -> { Lithic::AuthRules::CardTransactionUpdateAction } + + # @!attribute conditions + # + # @return [Array] + required :conditions, + -> { Lithic::Internal::Type::ArrayOf[Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition] } + + # @!method initialize(action:, conditions:) + # @param action [Lithic::Models::AuthRules::CardTransactionUpdateAction::TagAction, Lithic::Models::AuthRules::CardTransactionUpdateAction::CreateCaseAction] The action to take if the conditions are met. + # + # @param conditions [Array] + + class Condition < Lithic::Internal::Type::BaseModel + # @!attribute attribute + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + # business by the types of goods or services it provides. + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + # Netherlands Antilles. + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + # the transaction. + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + # (merchant). + # - `DESCRIPTOR`: Short description of card acceptor. + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + # fee field in the settlement/cardholder billing currency. This is the amount + # the issuer should authorize against unless the issuer is paying the acquirer + # fee on behalf of the cardholder. Use an integer value. + # - `RISK_SCORE`: Network-provided score assessing risk level associated with a + # given authorization. Scores are on a range of 0-999, with 0 representing the + # lowest risk and 999 representing the highest risk. For Visa transactions, + # where the raw score has a range of 0-99, Lithic will normalize the score by + # multiplying the raw score by 10x. Use an integer value. + # - `TRANSACTION_STATUS`: The status of the transaction. Valid values are + # `PENDING`, `VOIDED`, `SETTLING`, `SETTLED`, `BOUNCED`, `RETURNED`, `DECLINED`, + # `EXPIRED`. + # - `LAST_EVENT_TYPE`: The type of the most recent event on the transaction. Valid + # values are `AUTHORIZATION`, `AUTHORIZATION_ADVICE`, `AUTHORIZATION_EXPIRY`, + # `AUTHORIZATION_REVERSAL`, `BALANCE_INQUIRY`, `CLEARING`, `CORRECTION_CREDIT`, + # `CORRECTION_DEBIT`, `CREDIT_AUTHORIZATION`, `CREDIT_AUTHORIZATION_ADVICE`, + # `FINANCIAL_AUTHORIZATION`, `FINANCIAL_CREDIT_AUTHORIZATION`, `RETURN`, + # `RETURN_REVERSAL`. + # - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer + # applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + # `TOKEN_AUTHENTICATED`. + # - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number + # (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, + # `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, + # `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, + # `UNKNOWN`, or `CREDENTIAL_ON_FILE`. + # - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the + # source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, + # `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. + # - `CARD_AGE`: The age of the card in seconds at the time of the transaction. Use + # an integer value. + # - `ACCOUNT_AGE`: The age of the account in seconds at the time of the + # transaction. Use an integer value. For programs where Lithic does not manage + # or retain account holder data, this attribute does not evaluate. + # - `SPEND_VELOCITY_COUNT`: The number of transactions matching the specified + # filters within the given period. Requires `parameters` with `scope`, `period`, + # and optional `filters`. Use an integer value. + # - `SPEND_VELOCITY_AMOUNT`: The total spend amount (in cents) of transactions + # matching the specified filters within the given period. Requires `parameters` + # with `scope`, `period`, and optional `filters`. Use an integer value. + # - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the + # entity's transaction history. Null if fewer than 30 approved transactions in + # the specified window. Requires `parameters.scope` and `parameters.interval`. + # Use a decimal value. + # - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the + # entity over the specified window, in cents. Requires `parameters.scope` and + # `parameters.interval`. Use a decimal value. + # - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction + # amounts for the entity over the specified window, in cents. Null if fewer than + # 30 approved transactions in the specified window. Requires `parameters.scope` + # and `parameters.interval`. Use a decimal value. + # - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen + # in the entity's transaction history. Valid values are `TRUE`, `FALSE`. + # Requires `parameters.scope`. + # - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's + # transaction history. Valid values are `TRUE`, `FALSE`. Requires + # `parameters.scope`. + # - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity. + # Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`. + # - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for + # the entity over the last 30 days (rolling). Requires `parameters.scope`. Use + # an integer value. + # - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved + # transaction for the entity, rounded to the nearest whole day. Requires + # `parameters.scope`. Use an integer value. + # - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in + # the entity's transaction history. Requires `parameters.scope`. Use an integer + # value. + # - `IS_NEW_MERCHANT`: Whether the card acceptor ID has not been seen in the + # card's approved transaction history (capped at the 1000 most recently seen + # merchants). Valid values are `TRUE`, `FALSE`. Card-scoped only; no + # `parameters` required. + # - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as + # a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required. + # Use a decimal value. + # - `TRAVEL_SPEED`: The estimated speed of travel derived from the distance + # between the postal code centers of the last card-present transaction and the + # current transaction, divided by the elapsed time. Null if there is no prior + # card-present transaction, if either postal code cannot be geocoded, or if + # elapsed time is zero. Requires `parameters.unit` set to `MPH` or `KPH`. Use a + # decimal value. + # - `DISTANCE_FROM_LAST_TRANSACTION`: The estimated distance between the postal + # code centers of the last card-present transaction and the current transaction. + # Null if there is no prior card-present transaction or if either postal code + # cannot be geocoded. Requires `parameters.unit` set to `MILES` or `KILOMETERS`. + # Use a decimal value. + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute] + required :attribute, + enum: -> { Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute } + + # @!attribute operation + # The operation to apply to the attribute + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalOperation] + required :operation, enum: -> { Lithic::AuthRules::ConditionalOperation } + + # @!attribute value + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + # + # @return [String, Integer, Float, Array, Time] + required :value, union: -> { Lithic::AuthRules::ConditionalValue } + + # @!attribute parameters + # Additional parameters for certain attributes. Required when `attribute` is + # `SPEND_VELOCITY_COUNT` or `SPEND_VELOCITY_AMOUNT` (require `scope`, `period`, + # and optional `filters`); `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, + # `STDEV_TRANSACTION_AMOUNT`, `IS_NEW_COUNTRY`, `IS_NEW_MCC`, + # `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, `TIME_SINCE_LAST_TRANSACTION`, + # or `DISTINCT_COUNTRY_COUNT` (require `scope`, and additionally `interval` for + # the statistical attributes); or `TRAVEL_SPEED` or + # `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`). Not used for other + # attributes. + # + # @return [Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters, nil] + optional :parameters, + -> { Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters } + + # @!method initialize(attribute:, operation:, value:, parameters: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition} + # for more details. + # + # @param attribute [Symbol, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute] The attribute to target. + # + # @param operation [Symbol, Lithic::Models::AuthRules::ConditionalOperation] The operation to apply to the attribute + # + # @param value [String, Integer, Float, Array, Time] A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + # + # @param parameters [Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters] Additional parameters for certain attributes. Required when `attribute` is + + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + # business by the types of goods or services it provides. + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + # Netherlands Antilles. + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + # the transaction. + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + # (merchant). + # - `DESCRIPTOR`: Short description of card acceptor. + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + # fee field in the settlement/cardholder billing currency. This is the amount + # the issuer should authorize against unless the issuer is paying the acquirer + # fee on behalf of the cardholder. Use an integer value. + # - `RISK_SCORE`: Network-provided score assessing risk level associated with a + # given authorization. Scores are on a range of 0-999, with 0 representing the + # lowest risk and 999 representing the highest risk. For Visa transactions, + # where the raw score has a range of 0-99, Lithic will normalize the score by + # multiplying the raw score by 10x. Use an integer value. + # - `TRANSACTION_STATUS`: The status of the transaction. Valid values are + # `PENDING`, `VOIDED`, `SETTLING`, `SETTLED`, `BOUNCED`, `RETURNED`, `DECLINED`, + # `EXPIRED`. + # - `LAST_EVENT_TYPE`: The type of the most recent event on the transaction. Valid + # values are `AUTHORIZATION`, `AUTHORIZATION_ADVICE`, `AUTHORIZATION_EXPIRY`, + # `AUTHORIZATION_REVERSAL`, `BALANCE_INQUIRY`, `CLEARING`, `CORRECTION_CREDIT`, + # `CORRECTION_DEBIT`, `CREDIT_AUTHORIZATION`, `CREDIT_AUTHORIZATION_ADVICE`, + # `FINANCIAL_AUTHORIZATION`, `FINANCIAL_CREDIT_AUTHORIZATION`, `RETURN`, + # `RETURN_REVERSAL`. + # - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer + # applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + # `TOKEN_AUTHENTICATED`. + # - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number + # (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, + # `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, + # `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, + # `UNKNOWN`, or `CREDENTIAL_ON_FILE`. + # - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the + # source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, + # `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. + # - `CARD_AGE`: The age of the card in seconds at the time of the transaction. Use + # an integer value. + # - `ACCOUNT_AGE`: The age of the account in seconds at the time of the + # transaction. Use an integer value. For programs where Lithic does not manage + # or retain account holder data, this attribute does not evaluate. + # - `SPEND_VELOCITY_COUNT`: The number of transactions matching the specified + # filters within the given period. Requires `parameters` with `scope`, `period`, + # and optional `filters`. Use an integer value. + # - `SPEND_VELOCITY_AMOUNT`: The total spend amount (in cents) of transactions + # matching the specified filters within the given period. Requires `parameters` + # with `scope`, `period`, and optional `filters`. Use an integer value. + # - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the + # entity's transaction history. Null if fewer than 30 approved transactions in + # the specified window. Requires `parameters.scope` and `parameters.interval`. + # Use a decimal value. + # - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the + # entity over the specified window, in cents. Requires `parameters.scope` and + # `parameters.interval`. Use a decimal value. + # - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction + # amounts for the entity over the specified window, in cents. Null if fewer than + # 30 approved transactions in the specified window. Requires `parameters.scope` + # and `parameters.interval`. Use a decimal value. + # - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen + # in the entity's transaction history. Valid values are `TRUE`, `FALSE`. + # Requires `parameters.scope`. + # - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's + # transaction history. Valid values are `TRUE`, `FALSE`. Requires + # `parameters.scope`. + # - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity. + # Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`. + # - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for + # the entity over the last 30 days (rolling). Requires `parameters.scope`. Use + # an integer value. + # - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved + # transaction for the entity, rounded to the nearest whole day. Requires + # `parameters.scope`. Use an integer value. + # - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in + # the entity's transaction history. Requires `parameters.scope`. Use an integer + # value. + # - `IS_NEW_MERCHANT`: Whether the card acceptor ID has not been seen in the + # card's approved transaction history (capped at the 1000 most recently seen + # merchants). Valid values are `TRUE`, `FALSE`. Card-scoped only; no + # `parameters` required. + # - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as + # a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required. + # Use a decimal value. + # - `TRAVEL_SPEED`: The estimated speed of travel derived from the distance + # between the postal code centers of the last card-present transaction and the + # current transaction, divided by the elapsed time. Null if there is no prior + # card-present transaction, if either postal code cannot be geocoded, or if + # elapsed time is zero. Requires `parameters.unit` set to `MPH` or `KPH`. Use a + # decimal value. + # - `DISTANCE_FROM_LAST_TRANSACTION`: The estimated distance between the postal + # code centers of the last card-present transaction and the current transaction. + # Null if there is no prior card-present transaction or if either postal code + # cannot be geocoded. Requires `parameters.unit` set to `MILES` or `KILOMETERS`. + # Use a decimal value. + # + # @see Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition#attribute + module Attribute + extend Lithic::Internal::Type::Enum + + MCC = :MCC + COUNTRY = :COUNTRY + CURRENCY = :CURRENCY + MERCHANT_ID = :MERCHANT_ID + DESCRIPTOR = :DESCRIPTOR + TRANSACTION_AMOUNT = :TRANSACTION_AMOUNT + RISK_SCORE = :RISK_SCORE + TRANSACTION_STATUS = :TRANSACTION_STATUS + LAST_EVENT_TYPE = :LAST_EVENT_TYPE + LIABILITY_SHIFT = :LIABILITY_SHIFT + PAN_ENTRY_MODE = :PAN_ENTRY_MODE + WALLET_TYPE = :WALLET_TYPE + CARD_AGE = :CARD_AGE + ACCOUNT_AGE = :ACCOUNT_AGE + SPEND_VELOCITY_COUNT = :SPEND_VELOCITY_COUNT + SPEND_VELOCITY_AMOUNT = :SPEND_VELOCITY_AMOUNT + AMOUNT_Z_SCORE = :AMOUNT_Z_SCORE + AVG_TRANSACTION_AMOUNT = :AVG_TRANSACTION_AMOUNT + STDEV_TRANSACTION_AMOUNT = :STDEV_TRANSACTION_AMOUNT + IS_NEW_COUNTRY = :IS_NEW_COUNTRY + IS_NEW_MCC = :IS_NEW_MCC + IS_FIRST_TRANSACTION = :IS_FIRST_TRANSACTION + CONSECUTIVE_DECLINES = :CONSECUTIVE_DECLINES + TIME_SINCE_LAST_TRANSACTION = :TIME_SINCE_LAST_TRANSACTION + DISTINCT_COUNTRY_COUNT = :DISTINCT_COUNTRY_COUNT + IS_NEW_MERCHANT = :IS_NEW_MERCHANT + THREE_DS_SUCCESS_RATE = :THREE_DS_SUCCESS_RATE + TRAVEL_SPEED = :TRAVEL_SPEED + DISTANCE_FROM_LAST_TRANSACTION = :DISTANCE_FROM_LAST_TRANSACTION + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition#parameters + class Parameters < Lithic::Internal::Type::BaseModel + # @!attribute filters + # + # @return [Lithic::Models::AuthRules::SpendVelocityFilters, nil] + optional :filters, -> { Lithic::AuthRules::SpendVelocityFilters } + + # @!attribute interval + # The time window for statistical attributes (`AMOUNT_Z_SCORE`, + # `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for + # all-time history or a specific window (`7D`, `30D`, `90D`). + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Interval, nil] + optional :interval, + enum: -> { Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Interval } + + # @!attribute period + # The time period over which to calculate the spend velocity. + # + # @return [Lithic::Models::AuthRules::VelocityLimitPeriod::TrailingWindowObject, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowDay, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowWeek, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowMonth, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowYear, nil] + optional :period, union: -> { Lithic::AuthRules::VelocityLimitPeriod } + + # @!attribute scope + # The entity scope to evaluate the attribute against. `GLOBAL` is only valid for + # spend velocity attributes. + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Scope, nil] + optional :scope, + enum: -> { Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Scope } + + # @!attribute unit + # The unit for impossible travel attributes. Required when `attribute` is + # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION`. + # + # For `TRAVEL_SPEED`: `MPH` (miles per hour) or `KPH` (kilometers per hour). + # + # For `DISTANCE_FROM_LAST_TRANSACTION`: `MILES` or `KILOMETERS`. + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Unit, nil] + optional :unit, + enum: -> { Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Unit } + + # @!method initialize(filters: nil, interval: nil, period: nil, scope: nil, unit: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters} + # for more details. + # + # Additional parameters for certain attributes. Required when `attribute` is + # `SPEND_VELOCITY_COUNT` or `SPEND_VELOCITY_AMOUNT` (require `scope`, `period`, + # and optional `filters`); `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, + # `STDEV_TRANSACTION_AMOUNT`, `IS_NEW_COUNTRY`, `IS_NEW_MCC`, + # `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, `TIME_SINCE_LAST_TRANSACTION`, + # or `DISTINCT_COUNTRY_COUNT` (require `scope`, and additionally `interval` for + # the statistical attributes); or `TRAVEL_SPEED` or + # `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`). Not used for other + # attributes. + # + # @param filters [Lithic::Models::AuthRules::SpendVelocityFilters] + # + # @param interval [Symbol, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Interval] The time window for statistical attributes (`AMOUNT_Z_SCORE`, `AVG_TRANSACTION_A + # + # @param period [Lithic::Models::AuthRules::VelocityLimitPeriod::TrailingWindowObject, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowDay, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowWeek, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowMonth, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowYear] The time period over which to calculate the spend velocity. + # + # @param scope [Symbol, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Scope] The entity scope to evaluate the attribute against. `GLOBAL` is only valid for + # + # @param unit [Symbol, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Unit] The unit for impossible travel attributes. Required when `attribute` is + # `TRAVEL\_ + + # The time window for statistical attributes (`AMOUNT_Z_SCORE`, + # `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for + # all-time history or a specific window (`7D`, `30D`, `90D`). + # + # @see Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters#interval + module Interval + extend Lithic::Internal::Type::Enum + + LIFETIME = :LIFETIME + INTERVAL_7_D = :"7D" + INTERVAL_30_D = :"30D" + INTERVAL_90_D = :"90D" + + # @!method self.values + # @return [Array] + end + + # The entity scope to evaluate the attribute against. `GLOBAL` is only valid for + # spend velocity attributes. + # + # @see Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters#scope + module Scope + extend Lithic::Internal::Type::Enum + + CARD = :CARD + ACCOUNT = :ACCOUNT + GLOBAL = :GLOBAL + + # @!method self.values + # @return [Array] + end + + # The unit for impossible travel attributes. Required when `attribute` is + # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION`. + # + # For `TRAVEL_SPEED`: `MPH` (miles per hour) or `KPH` (kilometers per hour). + # + # For `DISTANCE_FROM_LAST_TRANSACTION`: `MILES` or `KILOMETERS`. + # + # @see Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters#unit + module Unit + extend Lithic::Internal::Type::Enum + + MPH = :MPH + KPH = :KPH + MILES = :MILES + KILOMETERS = :KILOMETERS + + # @!method self.values + # @return [Array] + end + end + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/conditional_operation.rb b/lib/lithic/models/auth_rules/conditional_operation.rb new file mode 100644 index 00000000..90ef4f4d --- /dev/null +++ b/lib/lithic/models/auth_rules/conditional_operation.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + # The operation to apply to the attribute + module ConditionalOperation + extend Lithic::Internal::Type::Enum + + IS_ONE_OF = :IS_ONE_OF + IS_NOT_ONE_OF = :IS_NOT_ONE_OF + MATCHES = :MATCHES + DOES_NOT_MATCH = :DOES_NOT_MATCH + IS_EQUAL_TO = :IS_EQUAL_TO + IS_NOT_EQUAL_TO = :IS_NOT_EQUAL_TO + IS_GREATER_THAN = :IS_GREATER_THAN + IS_GREATER_THAN_OR_EQUAL_TO = :IS_GREATER_THAN_OR_EQUAL_TO + IS_LESS_THAN = :IS_LESS_THAN + IS_LESS_THAN_OR_EQUAL_TO = :IS_LESS_THAN_OR_EQUAL_TO + IS_AFTER = :IS_AFTER + IS_BEFORE = :IS_BEFORE + CONTAINS_ANY = :CONTAINS_ANY + CONTAINS_ALL = :CONTAINS_ALL + CONTAINS_NONE = :CONTAINS_NONE + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/auth_rules/conditional_tokenization_action_parameters.rb b/lib/lithic/models/auth_rules/conditional_tokenization_action_parameters.rb new file mode 100644 index 00000000..097ce37f --- /dev/null +++ b/lib/lithic/models/auth_rules/conditional_tokenization_action_parameters.rb @@ -0,0 +1,302 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class ConditionalTokenizationActionParameters < Lithic::Internal::Type::BaseModel + # @!attribute action + # The action to take if the conditions are met. + # + # @return [Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction] + required :action, union: -> { Lithic::AuthRules::ConditionalTokenizationActionParameters::Action } + + # @!attribute conditions + # + # @return [Array] + required :conditions, + -> { Lithic::Internal::Type::ArrayOf[Lithic::AuthRules::ConditionalTokenizationActionParameters::Condition] } + + # @!method initialize(action:, conditions:) + # @param action [Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction] The action to take if the conditions are met. + # + # @param conditions [Array] + + # The action to take if the conditions are met. + # + # @see Lithic::Models::AuthRules::ConditionalTokenizationActionParameters#action + module Action + extend Lithic::Internal::Type::Union + + variant -> { Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization } + + variant -> { Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction } + + class DeclineActionTokenization < Lithic::Internal::Type::BaseModel + # @!attribute type + # Decline the tokenization request + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Type] + required :type, + enum: -> { Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Type } + + # @!attribute reason + # Reason code for declining the tokenization request + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Reason, nil] + optional :reason, + enum: -> { Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Reason } + + # @!method initialize(type:, reason: nil) + # @param type [Symbol, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Type] Decline the tokenization request + # + # @param reason [Symbol, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Reason] Reason code for declining the tokenization request + + # Decline the tokenization request + # + # @see Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization#type + module Type + extend Lithic::Internal::Type::Enum + + DECLINE = :DECLINE + + # @!method self.values + # @return [Array] + end + + # Reason code for declining the tokenization request + # + # @see Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization#reason + module Reason + extend Lithic::Internal::Type::Enum + + ACCOUNT_SCORE_1 = :ACCOUNT_SCORE_1 + DEVICE_SCORE_1 = :DEVICE_SCORE_1 + ALL_WALLET_DECLINE_REASONS_PRESENT = :ALL_WALLET_DECLINE_REASONS_PRESENT + WALLET_RECOMMENDED_DECISION_RED = :WALLET_RECOMMENDED_DECISION_RED + CVC_MISMATCH = :CVC_MISMATCH + CARD_EXPIRY_MONTH_MISMATCH = :CARD_EXPIRY_MONTH_MISMATCH + CARD_EXPIRY_YEAR_MISMATCH = :CARD_EXPIRY_YEAR_MISMATCH + CARD_INVALID_STATE = :CARD_INVALID_STATE + CUSTOMER_RED_PATH = :CUSTOMER_RED_PATH + INVALID_CUSTOMER_RESPONSE = :INVALID_CUSTOMER_RESPONSE + NETWORK_FAILURE = :NETWORK_FAILURE + GENERIC_DECLINE = :GENERIC_DECLINE + DIGITAL_CARD_ART_REQUIRED = :DIGITAL_CARD_ART_REQUIRED + + # @!method self.values + # @return [Array] + end + end + + class RequireTfaAction < Lithic::Internal::Type::BaseModel + # @!attribute type + # Require two-factor authentication for the tokenization request + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Type] + required :type, + enum: -> { Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Type } + + # @!attribute reason + # Reason code for requiring two-factor authentication + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Reason, nil] + optional :reason, + enum: -> { Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Reason } + + # @!method initialize(type:, reason: nil) + # @param type [Symbol, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Type] Require two-factor authentication for the tokenization request + # + # @param reason [Symbol, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Reason] Reason code for requiring two-factor authentication + + # Require two-factor authentication for the tokenization request + # + # @see Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction#type + module Type + extend Lithic::Internal::Type::Enum + + REQUIRE_TFA = :REQUIRE_TFA + + # @!method self.values + # @return [Array] + end + + # Reason code for requiring two-factor authentication + # + # @see Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction#reason + module Reason + extend Lithic::Internal::Type::Enum + + WALLET_RECOMMENDED_TFA = :WALLET_RECOMMENDED_TFA + SUSPICIOUS_ACTIVITY = :SUSPICIOUS_ACTIVITY + DEVICE_RECENTLY_LOST = :DEVICE_RECENTLY_LOST + TOO_MANY_RECENT_ATTEMPTS = :TOO_MANY_RECENT_ATTEMPTS + TOO_MANY_RECENT_TOKENS = :TOO_MANY_RECENT_TOKENS + TOO_MANY_DIFFERENT_CARDHOLDERS = :TOO_MANY_DIFFERENT_CARDHOLDERS + OUTSIDE_HOME_TERRITORY = :OUTSIDE_HOME_TERRITORY + HAS_SUSPENDED_TOKENS = :HAS_SUSPENDED_TOKENS + HIGH_RISK = :HIGH_RISK + ACCOUNT_SCORE_LOW = :ACCOUNT_SCORE_LOW + DEVICE_SCORE_LOW = :DEVICE_SCORE_LOW + CARD_STATE_TFA = :CARD_STATE_TFA + HARDCODED_TFA = :HARDCODED_TFA + CUSTOMER_RULE_TFA = :CUSTOMER_RULE_TFA + DEVICE_HOST_CARD_EMULATION = :DEVICE_HOST_CARD_EMULATION + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction)] + end + + class Condition < Lithic::Internal::Type::BaseModel + # @!attribute attribute + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `TIMESTAMP`: The timestamp of the tokenization request in ISO 8601 format. + # - `TOKENIZATION_CHANNEL`: The channel through which the tokenization request was + # initiated. Valid values are `DIGITAL_WALLET`, `MERCHANT`. + # - `TOKENIZATION_SOURCE`: The source of the tokenization request. Valid values + # are `ACCOUNT_ON_FILE`, `MANUAL_PROVISION`, `PUSH_PROVISION`, `CHIP_DIP`, + # `CONTACTLESS_TAP`, `TOKEN`, `UNKNOWN`. + # - `TOKEN_REQUESTOR_NAME`: The name of the entity requesting the token. Valid + # values are `ALT_ID`, `AMAZON_ONE`, `AMERICAN_EXPRESS_TOKEN_SERVICE`, + # `ANDROID_PAY`, `APPLE_PAY`, `FACEBOOK`, `FITBIT_PAY`, `GARMIN_PAY`, + # `GOOGLE_PAY`, `GOOGLE_VCN`, `ISSUER_HCE`, `MICROSOFT_PAY`, `NETFLIX`, + # `SAMSUNG_PAY`, `UNKNOWN`, `VISA_CHECKOUT`. + # - `WALLET_ACCOUNT_SCORE`: Risk score for the account in the digital wallet. + # Numeric value where lower numbers indicate higher risk (e.g., 1 = high risk, 2 + # = medium risk). Use an integer value. + # - `WALLET_DEVICE_SCORE`: Risk score for the device in the digital wallet. + # Numeric value where lower numbers indicate higher risk (e.g., 1 = high risk, 2 + # = medium risk). Use an integer value. + # - `WALLET_RECOMMENDED_DECISION`: The decision recommended by the digital wallet + # provider. Valid values include APPROVE, DECLINE, + # REQUIRE_ADDITIONAL_AUTHENTICATION. + # - `WALLET_RECOMMENDATION_REASONS`: List of reasons provided by the digital + # wallet provider for the recommended decision. Valid values are: + # - Common: `ACCOUNT_CARD_TOO_NEW`, `ACCOUNT_RECENTLY_CHANGED`, + # `ACCOUNT_TOO_NEW`, `ACCOUNT_TOO_NEW_SINCE_LAUNCH`, `DEVICE_RECENTLY_LOST`, + # `HAS_SUSPENDED_TOKENS`, `HIGH_RISK`, `INACTIVE_ACCOUNT`, + # `LOW_ACCOUNT_SCORE`, `LOW_DEVICE_SCORE`, `OUTSIDE_HOME_TERRITORY`, + # `SUSPICIOUS_ACTIVITY`, `TOO_MANY_DIFFERENT_CARDHOLDERS`, + # `TOO_MANY_RECENT_ATTEMPTS`, `TOO_MANY_RECENT_TOKENS`, `UNABLE_TO_ASSESS` + # - Visa only: `ACCOUNT_DATA_RECENTLY_CHANGED`, `ACCOUNT_PAN_PAIRING_TOO_NEW`, + # `LOW_TRANSACTION_VOLUME`, `USER_ACCOUNT_DEVICE_TOO_NEW`, + # `WALLET_ACCOUNT_TOO_NEW` + # - Amex only: `DEVICE_USING_VPN_PROXY`, + # `EXCESSIVE_BILLING_NAME_ATTEMPTS_MODERATE`, + # `EXCESSIVE_BILLING_NAME_ATTEMPTS_SEVERE`, + # `EXCESSIVE_CARD_PROVISION_ATTEMPTS_MODERATE`, + # `EXCESSIVE_CARD_PROVISION_ATTEMPTS_SEVERE`, `EXCESSIVE_WALLET_RESETS`, + # `EXCESSIVE_ZIP_ATTEMPTS_MODERATE`, `EXCESSIVE_ZIP_ATTEMPTS_SEVERE`, + # `USER_ID_CARD_PAIRING_TOO_NEW`, `USER_ID_DEVICE_ID_PAIRING_TOO_NEW`, + # `USER_ID_OS_ID_PAIRING_TOO_NEW`, `USER_ID_TOO_NEW` + # - `TOKEN_REQUESTOR_ID`: Unique identifier for the entity requesting the token. + # - `WALLET_TOKEN_STATUS`: The current status of the wallet token. + # - `CARD_STATE`: The state of the card being tokenized. Valid values are + # `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, `PENDING_FULFILLMENT`. + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Condition::Attribute] + required :attribute, + enum: -> { Lithic::AuthRules::ConditionalTokenizationActionParameters::Condition::Attribute } + + # @!attribute operation + # The operation to apply to the attribute + # + # @return [Symbol, Lithic::Models::AuthRules::ConditionalOperation] + required :operation, enum: -> { Lithic::AuthRules::ConditionalOperation } + + # @!attribute value + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + # + # @return [String, Integer, Float, Array, Time] + required :value, union: -> { Lithic::AuthRules::ConditionalValue } + + # @!method initialize(attribute:, operation:, value:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Condition} + # for more details. + # + # @param attribute [Symbol, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Condition::Attribute] The attribute to target. + # + # @param operation [Symbol, Lithic::Models::AuthRules::ConditionalOperation] The operation to apply to the attribute + # + # @param value [String, Integer, Float, Array, Time] A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `TIMESTAMP`: The timestamp of the tokenization request in ISO 8601 format. + # - `TOKENIZATION_CHANNEL`: The channel through which the tokenization request was + # initiated. Valid values are `DIGITAL_WALLET`, `MERCHANT`. + # - `TOKENIZATION_SOURCE`: The source of the tokenization request. Valid values + # are `ACCOUNT_ON_FILE`, `MANUAL_PROVISION`, `PUSH_PROVISION`, `CHIP_DIP`, + # `CONTACTLESS_TAP`, `TOKEN`, `UNKNOWN`. + # - `TOKEN_REQUESTOR_NAME`: The name of the entity requesting the token. Valid + # values are `ALT_ID`, `AMAZON_ONE`, `AMERICAN_EXPRESS_TOKEN_SERVICE`, + # `ANDROID_PAY`, `APPLE_PAY`, `FACEBOOK`, `FITBIT_PAY`, `GARMIN_PAY`, + # `GOOGLE_PAY`, `GOOGLE_VCN`, `ISSUER_HCE`, `MICROSOFT_PAY`, `NETFLIX`, + # `SAMSUNG_PAY`, `UNKNOWN`, `VISA_CHECKOUT`. + # - `WALLET_ACCOUNT_SCORE`: Risk score for the account in the digital wallet. + # Numeric value where lower numbers indicate higher risk (e.g., 1 = high risk, 2 + # = medium risk). Use an integer value. + # - `WALLET_DEVICE_SCORE`: Risk score for the device in the digital wallet. + # Numeric value where lower numbers indicate higher risk (e.g., 1 = high risk, 2 + # = medium risk). Use an integer value. + # - `WALLET_RECOMMENDED_DECISION`: The decision recommended by the digital wallet + # provider. Valid values include APPROVE, DECLINE, + # REQUIRE_ADDITIONAL_AUTHENTICATION. + # - `WALLET_RECOMMENDATION_REASONS`: List of reasons provided by the digital + # wallet provider for the recommended decision. Valid values are: + # - Common: `ACCOUNT_CARD_TOO_NEW`, `ACCOUNT_RECENTLY_CHANGED`, + # `ACCOUNT_TOO_NEW`, `ACCOUNT_TOO_NEW_SINCE_LAUNCH`, `DEVICE_RECENTLY_LOST`, + # `HAS_SUSPENDED_TOKENS`, `HIGH_RISK`, `INACTIVE_ACCOUNT`, + # `LOW_ACCOUNT_SCORE`, `LOW_DEVICE_SCORE`, `OUTSIDE_HOME_TERRITORY`, + # `SUSPICIOUS_ACTIVITY`, `TOO_MANY_DIFFERENT_CARDHOLDERS`, + # `TOO_MANY_RECENT_ATTEMPTS`, `TOO_MANY_RECENT_TOKENS`, `UNABLE_TO_ASSESS` + # - Visa only: `ACCOUNT_DATA_RECENTLY_CHANGED`, `ACCOUNT_PAN_PAIRING_TOO_NEW`, + # `LOW_TRANSACTION_VOLUME`, `USER_ACCOUNT_DEVICE_TOO_NEW`, + # `WALLET_ACCOUNT_TOO_NEW` + # - Amex only: `DEVICE_USING_VPN_PROXY`, + # `EXCESSIVE_BILLING_NAME_ATTEMPTS_MODERATE`, + # `EXCESSIVE_BILLING_NAME_ATTEMPTS_SEVERE`, + # `EXCESSIVE_CARD_PROVISION_ATTEMPTS_MODERATE`, + # `EXCESSIVE_CARD_PROVISION_ATTEMPTS_SEVERE`, `EXCESSIVE_WALLET_RESETS`, + # `EXCESSIVE_ZIP_ATTEMPTS_MODERATE`, `EXCESSIVE_ZIP_ATTEMPTS_SEVERE`, + # `USER_ID_CARD_PAIRING_TOO_NEW`, `USER_ID_DEVICE_ID_PAIRING_TOO_NEW`, + # `USER_ID_OS_ID_PAIRING_TOO_NEW`, `USER_ID_TOO_NEW` + # - `TOKEN_REQUESTOR_ID`: Unique identifier for the entity requesting the token. + # - `WALLET_TOKEN_STATUS`: The current status of the wallet token. + # - `CARD_STATE`: The state of the card being tokenized. Valid values are + # `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, `PENDING_FULFILLMENT`. + # + # @see Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Condition#attribute + module Attribute + extend Lithic::Internal::Type::Enum + + TIMESTAMP = :TIMESTAMP + TOKENIZATION_CHANNEL = :TOKENIZATION_CHANNEL + TOKENIZATION_SOURCE = :TOKENIZATION_SOURCE + TOKEN_REQUESTOR_NAME = :TOKEN_REQUESTOR_NAME + WALLET_ACCOUNT_SCORE = :WALLET_ACCOUNT_SCORE + WALLET_DEVICE_SCORE = :WALLET_DEVICE_SCORE + WALLET_RECOMMENDED_DECISION = :WALLET_RECOMMENDED_DECISION + WALLET_RECOMMENDATION_REASONS = :WALLET_RECOMMENDATION_REASONS + TOKEN_REQUESTOR_ID = :TOKEN_REQUESTOR_ID + WALLET_TOKEN_STATUS = :WALLET_TOKEN_STATUS + CARD_STATE = :CARD_STATE + + # @!method self.values + # @return [Array] + end + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/conditional_value.rb b/lib/lithic/models/auth_rules/conditional_value.rb new file mode 100644 index 00000000..4d590fc5 --- /dev/null +++ b/lib/lithic/models/auth_rules/conditional_value.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + module ConditionalValue + extend Lithic::Internal::Type::Union + + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + variant String + + variant Integer + + variant Float + + # An array of strings, to be used with `IS_ONE_OF` or `IS_NOT_ONE_OF` + variant -> { Lithic::Models::AuthRules::ConditionalValue::StringArray } + + # A timestamp, to be used with `IS_AFTER` or `IS_BEFORE` + variant Time + + # @!method self.variants + # @return [Array(String, Integer, Float, Array, Time)] + + # @type [Lithic::Internal::Type::Converter] + StringArray = Lithic::Internal::Type::ArrayOf[String] + end + end + end +end diff --git a/lib/lithic/models/auth_rules/event_stream.rb b/lib/lithic/models/auth_rules/event_stream.rb new file mode 100644 index 00000000..8b9f023b --- /dev/null +++ b/lib/lithic/models/auth_rules/event_stream.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + # The event stream during which the rule will be evaluated. + module EventStream + extend Lithic::Internal::Type::Enum + + AUTHORIZATION = :AUTHORIZATION + THREE_DS_AUTHENTICATION = :THREE_DS_AUTHENTICATION + TOKENIZATION = :TOKENIZATION + ACH_CREDIT_RECEIPT = :ACH_CREDIT_RECEIPT + ACH_DEBIT_RECEIPT = :ACH_DEBIT_RECEIPT + CARD_TRANSACTION_UPDATE = :CARD_TRANSACTION_UPDATE + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/auth_rules/merchant_lock_parameters.rb b/lib/lithic/models/auth_rules/merchant_lock_parameters.rb new file mode 100644 index 00000000..af0ebba8 --- /dev/null +++ b/lib/lithic/models/auth_rules/merchant_lock_parameters.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class MerchantLockParameters < Lithic::Internal::Type::BaseModel + # @!attribute merchants + # A list of merchant locks defining specific merchants or groups of merchants + # (based on descriptors or IDs) that the lock applies to. + # + # @return [Array] + required :merchants, + -> { Lithic::Internal::Type::ArrayOf[Lithic::AuthRules::MerchantLockParameters::Merchant] } + + # @!method initialize(merchants:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::MerchantLockParameters} for more details. + # + # @param merchants [Array] A list of merchant locks defining specific merchants or groups of merchants (bas + + class Merchant < Lithic::Internal::Type::BaseModel + # @!attribute comment + # A comment or explanation about the merchant, used internally for rule management + # purposes. + # + # @return [String, nil] + optional :comment, String + + # @!attribute descriptor + # Short description of the merchant, often used to provide more human-readable + # context about the transaction merchant. This is typically the name or label + # shown on transaction summaries. + # + # @return [String, nil] + optional :descriptor, String + + # @!attribute merchant_id + # Unique alphanumeric identifier for the payment card acceptor (merchant). This + # attribute specifies the merchant entity that will be locked or referenced for + # authorization rules. + # + # @return [String, nil] + optional :merchant_id, String + + # @!method initialize(comment: nil, descriptor: nil, merchant_id: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::MerchantLockParameters::Merchant} for more details. + # + # Represents a specific merchant lock based on their ID or descriptor. Each + # merchant object allows transaction rules to work at a granular level and + # requires at least one of merchant_id or descriptor. + # + # @param comment [String] A comment or explanation about the merchant, used internally for rule management + # + # @param descriptor [String] Short description of the merchant, often used to provide more human-readable con + # + # @param merchant_id [String] Unique alphanumeric identifier for the payment card acceptor (merchant). This at + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/report_stats.rb b/lib/lithic/models/auth_rules/report_stats.rb new file mode 100644 index 00000000..1898b0a9 --- /dev/null +++ b/lib/lithic/models/auth_rules/report_stats.rb @@ -0,0 +1,517 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class ReportStats < Lithic::Internal::Type::BaseModel + # @!attribute action_counts + # A mapping of action types to the number of times that action was returned by + # this version during the relevant period. Actions are the possible outcomes of a + # rule evaluation, such as DECLINE, CHALLENGE, REQUIRE_TFA, etc. In case rule + # didn't trigger any action, it's counted under NO_ACTION key. + # + # @return [Hash{Symbol=>Integer}] + required :action_counts, Lithic::Internal::Type::HashOf[Integer] + + # @!attribute examples + # Example events and their outcomes for this version. + # + # @return [Array] + required :examples, -> { Lithic::Internal::Type::ArrayOf[Lithic::AuthRules::ReportStats::Example] } + + # @!attribute state + # The evaluation mode of this version during the reported period. + # + # @return [Symbol, Lithic::Models::AuthRules::ReportStats::State] + required :state, enum: -> { Lithic::AuthRules::ReportStats::State } + + # @!attribute version + # The rule version number. + # + # @return [Integer] + required :version, Integer + + # @!method initialize(action_counts:, examples:, state:, version:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::ReportStats} for more details. + # + # @param action_counts [Hash{Symbol=>Integer}] A mapping of action types to the number of times that action was returned by thi + # + # @param examples [Array] Example events and their outcomes for this version. + # + # @param state [Symbol, Lithic::Models::AuthRules::ReportStats::State] The evaluation mode of this version during the reported period. + # + # @param version [Integer] The rule version number. + + class Example < Lithic::Internal::Type::BaseModel + # @!attribute actions + # The actions taken by this version for this event. + # + # @return [Array] + required :actions, + -> { Lithic::Internal::Type::ArrayOf[union: Lithic::AuthRules::ReportStats::Example::Action] } + + # @!attribute event_token + # The event token. + # + # @return [String] + required :event_token, String + + # @!attribute timestamp + # The timestamp of the event. + # + # @return [Time] + required :timestamp, Time + + # @!attribute transaction_token + # The token of the transaction associated with the event + # + # @return [String, nil] + optional :transaction_token, String, nil?: true + + # @!method initialize(actions:, event_token:, timestamp:, transaction_token: nil) + # @param actions [Array] The actions taken by this version for this event. + # + # @param event_token [String] The event token. + # + # @param timestamp [Time] The timestamp of the event. + # + # @param transaction_token [String, nil] The token of the transaction associated with the event + + module Action + extend Lithic::Internal::Type::Union + + variant -> { Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization } + + variant -> { Lithic::AuthRules::ReportStats::Example::Action::ChallengeActionAuthorization } + + variant -> { Lithic::AuthRules::ReportStats::Example::Action::ResultAuthentication3DSAction } + + variant -> { Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization } + + variant -> { Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction } + + variant -> { Lithic::AuthRules::ReportStats::Example::Action::ApproveActionACH } + + variant -> { Lithic::AuthRules::ReportStats::Example::Action::ReturnAction } + + class DeclineActionAuthorization < Lithic::Internal::Type::BaseModel + # @!attribute code + # The detailed result code explaining the specific reason for the decline + # + # @return [Symbol, Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code] + required :code, + enum: -> { Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code } + + # @!attribute type + # + # @return [Symbol, Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Type] + required :type, + enum: -> { Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Type } + + # @!method initialize(code:, type:) + # @param code [Symbol, Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code] The detailed result code explaining the specific reason for the decline + # + # @param type [Symbol, Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Type] + + # The detailed result code explaining the specific reason for the decline + # + # @see Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization#code + module Code + extend Lithic::Internal::Type::Enum + + ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED = :ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED + ACCOUNT_DELINQUENT = :ACCOUNT_DELINQUENT + ACCOUNT_INACTIVE = :ACCOUNT_INACTIVE + ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED = :ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED + ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED = :ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED + ACCOUNT_PAUSED = :ACCOUNT_PAUSED + ACCOUNT_UNDER_REVIEW = :ACCOUNT_UNDER_REVIEW + ADDRESS_INCORRECT = :ADDRESS_INCORRECT + APPROVED = :APPROVED + AUTH_RULE_ALLOWED_COUNTRY = :AUTH_RULE_ALLOWED_COUNTRY + AUTH_RULE_ALLOWED_MCC = :AUTH_RULE_ALLOWED_MCC + AUTH_RULE_BLOCKED_COUNTRY = :AUTH_RULE_BLOCKED_COUNTRY + AUTH_RULE_BLOCKED_MCC = :AUTH_RULE_BLOCKED_MCC + AUTH_RULE = :AUTH_RULE + CARD_CLOSED = :CARD_CLOSED + CARD_CRYPTOGRAM_VALIDATION_FAILURE = :CARD_CRYPTOGRAM_VALIDATION_FAILURE + CARD_EXPIRED = :CARD_EXPIRED + CARD_EXPIRY_DATE_INCORRECT = :CARD_EXPIRY_DATE_INCORRECT + CARD_INVALID = :CARD_INVALID + CARD_NOT_ACTIVATED = :CARD_NOT_ACTIVATED + CARD_PAUSED = :CARD_PAUSED + CARD_PIN_INCORRECT = :CARD_PIN_INCORRECT + CARD_RESTRICTED = :CARD_RESTRICTED + CARD_SECURITY_CODE_INCORRECT = :CARD_SECURITY_CODE_INCORRECT + CARD_SPEND_LIMIT_EXCEEDED = :CARD_SPEND_LIMIT_EXCEEDED + CONTACT_CARD_ISSUER = :CONTACT_CARD_ISSUER + CUSTOMER_ASA_TIMEOUT = :CUSTOMER_ASA_TIMEOUT + CUSTOM_ASA_RESULT = :CUSTOM_ASA_RESULT + DECLINED = :DECLINED + DO_NOT_HONOR = :DO_NOT_HONOR + DRIVER_NUMBER_INVALID = :DRIVER_NUMBER_INVALID + FORMAT_ERROR = :FORMAT_ERROR + INSUFFICIENT_FUNDING_SOURCE_BALANCE = :INSUFFICIENT_FUNDING_SOURCE_BALANCE + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + LITHIC_SYSTEM_ERROR = :LITHIC_SYSTEM_ERROR + LITHIC_SYSTEM_RATE_LIMIT = :LITHIC_SYSTEM_RATE_LIMIT + MALFORMED_ASA_RESPONSE = :MALFORMED_ASA_RESPONSE + MERCHANT_INVALID = :MERCHANT_INVALID + MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE = :MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE + MERCHANT_NOT_PERMITTED = :MERCHANT_NOT_PERMITTED + OVER_REVERSAL_ATTEMPTED = :OVER_REVERSAL_ATTEMPTED + PIN_BLOCKED = :PIN_BLOCKED + PROGRAM_CARD_SPEND_LIMIT_EXCEEDED = :PROGRAM_CARD_SPEND_LIMIT_EXCEEDED + PROGRAM_SUSPENDED = :PROGRAM_SUSPENDED + PROGRAM_USAGE_RESTRICTION = :PROGRAM_USAGE_RESTRICTION + REVERSAL_UNMATCHED = :REVERSAL_UNMATCHED + SECURITY_VIOLATION = :SECURITY_VIOLATION + SINGLE_USE_CARD_REATTEMPTED = :SINGLE_USE_CARD_REATTEMPTED + SUSPECTED_FRAUD = :SUSPECTED_FRAUD + TRANSACTION_INVALID = :TRANSACTION_INVALID + TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL = :TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL + TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER = :TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER + TRANSACTION_PREVIOUSLY_COMPLETED = :TRANSACTION_PREVIOUSLY_COMPLETED + UNAUTHORIZED_MERCHANT = :UNAUTHORIZED_MERCHANT + VEHICLE_NUMBER_INVALID = :VEHICLE_NUMBER_INVALID + CARDHOLDER_CHALLENGED = :CARDHOLDER_CHALLENGED + CARDHOLDER_CHALLENGE_FAILED = :CARDHOLDER_CHALLENGE_FAILED + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization#type + module Type + extend Lithic::Internal::Type::Enum + + DECLINE = :DECLINE + + # @!method self.values + # @return [Array] + end + end + + class ChallengeActionAuthorization < Lithic::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, Lithic::Models::AuthRules::ReportStats::Example::Action::ChallengeActionAuthorization::Type] + required :type, + enum: -> { Lithic::AuthRules::ReportStats::Example::Action::ChallengeActionAuthorization::Type } + + # @!method initialize(type:) + # @param type [Symbol, Lithic::Models::AuthRules::ReportStats::Example::Action::ChallengeActionAuthorization::Type] + + # @see Lithic::Models::AuthRules::ReportStats::Example::Action::ChallengeActionAuthorization#type + module Type + extend Lithic::Internal::Type::Enum + + CHALLENGE = :CHALLENGE + + # @!method self.values + # @return [Array] + end + end + + class ResultAuthentication3DSAction < Lithic::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, Lithic::Models::AuthRules::ReportStats::Example::Action::ResultAuthentication3DSAction::Type] + required :type, + enum: -> { Lithic::AuthRules::ReportStats::Example::Action::ResultAuthentication3DSAction::Type } + + # @!method initialize(type:) + # @param type [Symbol, Lithic::Models::AuthRules::ReportStats::Example::Action::ResultAuthentication3DSAction::Type] + + # @see Lithic::Models::AuthRules::ReportStats::Example::Action::ResultAuthentication3DSAction#type + module Type + extend Lithic::Internal::Type::Enum + + DECLINE = :DECLINE + CHALLENGE = :CHALLENGE + + # @!method self.values + # @return [Array] + end + end + + class DeclineActionTokenization < Lithic::Internal::Type::BaseModel + # @!attribute type + # Decline the tokenization request + # + # @return [Symbol, Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Type] + required :type, + enum: -> { Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Type } + + # @!attribute reason + # Reason code for declining the tokenization request + # + # @return [Symbol, Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Reason, nil] + optional :reason, + enum: -> { Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Reason } + + # @!method initialize(type:, reason: nil) + # @param type [Symbol, Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Type] Decline the tokenization request + # + # @param reason [Symbol, Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Reason] Reason code for declining the tokenization request + + # Decline the tokenization request + # + # @see Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionTokenization#type + module Type + extend Lithic::Internal::Type::Enum + + DECLINE = :DECLINE + + # @!method self.values + # @return [Array] + end + + # Reason code for declining the tokenization request + # + # @see Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionTokenization#reason + module Reason + extend Lithic::Internal::Type::Enum + + ACCOUNT_SCORE_1 = :ACCOUNT_SCORE_1 + DEVICE_SCORE_1 = :DEVICE_SCORE_1 + ALL_WALLET_DECLINE_REASONS_PRESENT = :ALL_WALLET_DECLINE_REASONS_PRESENT + WALLET_RECOMMENDED_DECISION_RED = :WALLET_RECOMMENDED_DECISION_RED + CVC_MISMATCH = :CVC_MISMATCH + CARD_EXPIRY_MONTH_MISMATCH = :CARD_EXPIRY_MONTH_MISMATCH + CARD_EXPIRY_YEAR_MISMATCH = :CARD_EXPIRY_YEAR_MISMATCH + CARD_INVALID_STATE = :CARD_INVALID_STATE + CUSTOMER_RED_PATH = :CUSTOMER_RED_PATH + INVALID_CUSTOMER_RESPONSE = :INVALID_CUSTOMER_RESPONSE + NETWORK_FAILURE = :NETWORK_FAILURE + GENERIC_DECLINE = :GENERIC_DECLINE + DIGITAL_CARD_ART_REQUIRED = :DIGITAL_CARD_ART_REQUIRED + + # @!method self.values + # @return [Array] + end + end + + class RequireTfaAction < Lithic::Internal::Type::BaseModel + # @!attribute type + # Require two-factor authentication for the tokenization request + # + # @return [Symbol, Lithic::Models::AuthRules::ReportStats::Example::Action::RequireTfaAction::Type] + required :type, enum: -> { Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::Type } + + # @!attribute reason + # Reason code for requiring two-factor authentication + # + # @return [Symbol, Lithic::Models::AuthRules::ReportStats::Example::Action::RequireTfaAction::Reason, nil] + optional :reason, enum: -> { Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::Reason } + + # @!method initialize(type:, reason: nil) + # @param type [Symbol, Lithic::Models::AuthRules::ReportStats::Example::Action::RequireTfaAction::Type] Require two-factor authentication for the tokenization request + # + # @param reason [Symbol, Lithic::Models::AuthRules::ReportStats::Example::Action::RequireTfaAction::Reason] Reason code for requiring two-factor authentication + + # Require two-factor authentication for the tokenization request + # + # @see Lithic::Models::AuthRules::ReportStats::Example::Action::RequireTfaAction#type + module Type + extend Lithic::Internal::Type::Enum + + REQUIRE_TFA = :REQUIRE_TFA + + # @!method self.values + # @return [Array] + end + + # Reason code for requiring two-factor authentication + # + # @see Lithic::Models::AuthRules::ReportStats::Example::Action::RequireTfaAction#reason + module Reason + extend Lithic::Internal::Type::Enum + + WALLET_RECOMMENDED_TFA = :WALLET_RECOMMENDED_TFA + SUSPICIOUS_ACTIVITY = :SUSPICIOUS_ACTIVITY + DEVICE_RECENTLY_LOST = :DEVICE_RECENTLY_LOST + TOO_MANY_RECENT_ATTEMPTS = :TOO_MANY_RECENT_ATTEMPTS + TOO_MANY_RECENT_TOKENS = :TOO_MANY_RECENT_TOKENS + TOO_MANY_DIFFERENT_CARDHOLDERS = :TOO_MANY_DIFFERENT_CARDHOLDERS + OUTSIDE_HOME_TERRITORY = :OUTSIDE_HOME_TERRITORY + HAS_SUSPENDED_TOKENS = :HAS_SUSPENDED_TOKENS + HIGH_RISK = :HIGH_RISK + ACCOUNT_SCORE_LOW = :ACCOUNT_SCORE_LOW + DEVICE_SCORE_LOW = :DEVICE_SCORE_LOW + CARD_STATE_TFA = :CARD_STATE_TFA + HARDCODED_TFA = :HARDCODED_TFA + CUSTOMER_RULE_TFA = :CUSTOMER_RULE_TFA + DEVICE_HOST_CARD_EMULATION = :DEVICE_HOST_CARD_EMULATION + + # @!method self.values + # @return [Array] + end + end + + class ApproveActionACH < Lithic::Internal::Type::BaseModel + # @!attribute type + # Approve the ACH transaction + # + # @return [Symbol, Lithic::Models::AuthRules::ReportStats::Example::Action::ApproveActionACH::Type] + required :type, enum: -> { Lithic::AuthRules::ReportStats::Example::Action::ApproveActionACH::Type } + + # @!method initialize(type:) + # @param type [Symbol, Lithic::Models::AuthRules::ReportStats::Example::Action::ApproveActionACH::Type] Approve the ACH transaction + + # Approve the ACH transaction + # + # @see Lithic::Models::AuthRules::ReportStats::Example::Action::ApproveActionACH#type + module Type + extend Lithic::Internal::Type::Enum + + APPROVE = :APPROVE + + # @!method self.values + # @return [Array] + end + end + + class ReturnAction < Lithic::Internal::Type::BaseModel + # @!attribute code + # NACHA return code to use when returning the transaction. Note that the list of + # available return codes is subject to an allowlist configured at the program + # level + # + # @return [Symbol, Lithic::Models::AuthRules::ReportStats::Example::Action::ReturnAction::Code] + required :code, enum: -> { Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code } + + # @!attribute type + # Return the ACH transaction + # + # @return [Symbol, Lithic::Models::AuthRules::ReportStats::Example::Action::ReturnAction::Type] + required :type, enum: -> { Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Type } + + # @!method initialize(code:, type:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::ReportStats::Example::Action::ReturnAction} for more + # details. + # + # @param code [Symbol, Lithic::Models::AuthRules::ReportStats::Example::Action::ReturnAction::Code] NACHA return code to use when returning the transaction. Note that the list of a + # + # @param type [Symbol, Lithic::Models::AuthRules::ReportStats::Example::Action::ReturnAction::Type] Return the ACH transaction + + # NACHA return code to use when returning the transaction. Note that the list of + # available return codes is subject to an allowlist configured at the program + # level + # + # @see Lithic::Models::AuthRules::ReportStats::Example::Action::ReturnAction#code + module Code + extend Lithic::Internal::Type::Enum + + R01 = :R01 + R02 = :R02 + R03 = :R03 + R04 = :R04 + R05 = :R05 + R06 = :R06 + R07 = :R07 + R08 = :R08 + R09 = :R09 + R10 = :R10 + R11 = :R11 + R12 = :R12 + R13 = :R13 + R14 = :R14 + R15 = :R15 + R16 = :R16 + R17 = :R17 + R18 = :R18 + R19 = :R19 + R20 = :R20 + R21 = :R21 + R22 = :R22 + R23 = :R23 + R24 = :R24 + R25 = :R25 + R26 = :R26 + R27 = :R27 + R28 = :R28 + R29 = :R29 + R30 = :R30 + R31 = :R31 + R32 = :R32 + R33 = :R33 + R34 = :R34 + R35 = :R35 + R36 = :R36 + R37 = :R37 + R38 = :R38 + R39 = :R39 + R40 = :R40 + R41 = :R41 + R42 = :R42 + R43 = :R43 + R44 = :R44 + R45 = :R45 + R46 = :R46 + R47 = :R47 + R50 = :R50 + R51 = :R51 + R52 = :R52 + R53 = :R53 + R61 = :R61 + R62 = :R62 + R67 = :R67 + R68 = :R68 + R69 = :R69 + R70 = :R70 + R71 = :R71 + R72 = :R72 + R73 = :R73 + R74 = :R74 + R75 = :R75 + R76 = :R76 + R77 = :R77 + R80 = :R80 + R81 = :R81 + R82 = :R82 + R83 = :R83 + R84 = :R84 + R85 = :R85 + + # @!method self.values + # @return [Array] + end + + # Return the ACH transaction + # + # @see Lithic::Models::AuthRules::ReportStats::Example::Action::ReturnAction#type + module Type + extend Lithic::Internal::Type::Enum + + RETURN = :RETURN + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization, Lithic::Models::AuthRules::ReportStats::Example::Action::ChallengeActionAuthorization, Lithic::Models::AuthRules::ReportStats::Example::Action::ResultAuthentication3DSAction, Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionTokenization, Lithic::Models::AuthRules::ReportStats::Example::Action::RequireTfaAction, Lithic::Models::AuthRules::ReportStats::Example::Action::ApproveActionACH, Lithic::Models::AuthRules::ReportStats::Example::Action::ReturnAction)] + end + end + + # The evaluation mode of this version during the reported period. + # + # @see Lithic::Models::AuthRules::ReportStats#state + module State + extend Lithic::Internal::Type::Enum + + ACTIVE = :ACTIVE + SHADOW = :SHADOW + INACTIVE = :INACTIVE + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/rule_feature.rb b/lib/lithic/models/auth_rules/rule_feature.rb new file mode 100644 index 00000000..c14f90c3 --- /dev/null +++ b/lib/lithic/models/auth_rules/rule_feature.rb @@ -0,0 +1,300 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + # A feature made available to the rule. The `name` field is the variable name used + # in the rule function signature. The `type` field determines which data the + # feature provides to the rule at evaluation time. + # + # - `AUTHORIZATION`: The authorization request being evaluated. Only available for + # AUTHORIZATION event stream rules. + # - `AUTHENTICATION`: The 3DS authentication request being evaluated. Only + # available for THREE_DS_AUTHENTICATION event stream rules. + # - `TOKENIZATION`: The tokenization request being evaluated. Only available for + # TOKENIZATION event stream rules. + # - `ACH_RECEIPT`: The ACH receipt being evaluated. Only available for + # ACH_CREDIT_RECEIPT and ACH_DEBIT_RECEIPT event stream rules. + # - `CARD_TRANSACTION`: The card transaction being evaluated. Only available for + # CARD_TRANSACTION_UPDATE event stream rules. + # - `CARD`: The card associated with the event. Available for AUTHORIZATION, + # THREE_DS_AUTHENTICATION, and CARD_TRANSACTION_UPDATE event stream rules. + # - `ACCOUNT_HOLDER`: The account holder associated with the card. Available for + # AUTHORIZATION, THREE_DS_AUTHENTICATION, and CARD_TRANSACTION_UPDATE event + # stream rules. + # - `IP_METADATA`: IP address metadata for the request. Available for + # THREE_DS_AUTHENTICATION event stream rules. + # - `SPEND_VELOCITY`: Spend velocity data for the card or account. Requires + # `scope`, `period`, and optionally `filters` to configure the velocity + # calculation. Available for AUTHORIZATION event stream rules. + # - `TRANSACTION_HISTORY_SIGNALS`: Behavioral feature state derived from the + # entity's transaction history. Requires `scope` to specify whether to load + # card, account, or business account history. Available for AUTHORIZATION and + # CARD_TRANSACTION_UPDATE event stream rules. + module RuleFeature + extend Lithic::Internal::Type::Union + + variant -> { Lithic::AuthRules::RuleFeature::AuthorizationFeature } + + variant -> { Lithic::AuthRules::RuleFeature::AuthenticationFeature } + + variant -> { Lithic::AuthRules::RuleFeature::TokenizationFeature } + + variant -> { Lithic::AuthRules::RuleFeature::ACHReceiptFeature } + + variant -> { Lithic::AuthRules::RuleFeature::CardTransactionFeature } + + variant -> { Lithic::AuthRules::RuleFeature::CardFeature } + + variant -> { Lithic::AuthRules::RuleFeature::AccountHolderFeature } + + variant -> { Lithic::AuthRules::RuleFeature::IPMetadataFeature } + + variant -> { Lithic::AuthRules::RuleFeature::SpendVelocityFeature } + + variant -> { Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature } + + class AuthorizationFeature < Lithic::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, :AUTHORIZATION] + required :type, const: :AUTHORIZATION + + # @!attribute name + # The variable name for this feature in the rule function signature + # + # @return [String, nil] + optional :name, String + + # @!method initialize(name: nil, type: :AUTHORIZATION) + # @param name [String] The variable name for this feature in the rule function signature + # + # @param type [Symbol, :AUTHORIZATION] + end + + class AuthenticationFeature < Lithic::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, :AUTHENTICATION] + required :type, const: :AUTHENTICATION + + # @!attribute name + # The variable name for this feature in the rule function signature + # + # @return [String, nil] + optional :name, String + + # @!method initialize(name: nil, type: :AUTHENTICATION) + # @param name [String] The variable name for this feature in the rule function signature + # + # @param type [Symbol, :AUTHENTICATION] + end + + class TokenizationFeature < Lithic::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, :TOKENIZATION] + required :type, const: :TOKENIZATION + + # @!attribute name + # The variable name for this feature in the rule function signature + # + # @return [String, nil] + optional :name, String + + # @!method initialize(name: nil, type: :TOKENIZATION) + # @param name [String] The variable name for this feature in the rule function signature + # + # @param type [Symbol, :TOKENIZATION] + end + + class ACHReceiptFeature < Lithic::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, :ACH_RECEIPT] + required :type, const: :ACH_RECEIPT + + # @!attribute name + # The variable name for this feature in the rule function signature + # + # @return [String, nil] + optional :name, String + + # @!method initialize(name: nil, type: :ACH_RECEIPT) + # @param name [String] The variable name for this feature in the rule function signature + # + # @param type [Symbol, :ACH_RECEIPT] + end + + class CardTransactionFeature < Lithic::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, :CARD_TRANSACTION] + required :type, const: :CARD_TRANSACTION + + # @!attribute name + # The variable name for this feature in the rule function signature + # + # @return [String, nil] + optional :name, String + + # @!method initialize(name: nil, type: :CARD_TRANSACTION) + # @param name [String] The variable name for this feature in the rule function signature + # + # @param type [Symbol, :CARD_TRANSACTION] + end + + class CardFeature < Lithic::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, :CARD] + required :type, const: :CARD + + # @!attribute name + # The variable name for this feature in the rule function signature + # + # @return [String, nil] + optional :name, String + + # @!method initialize(name: nil, type: :CARD) + # @param name [String] The variable name for this feature in the rule function signature + # + # @param type [Symbol, :CARD] + end + + class AccountHolderFeature < Lithic::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, :ACCOUNT_HOLDER] + required :type, const: :ACCOUNT_HOLDER + + # @!attribute name + # The variable name for this feature in the rule function signature + # + # @return [String, nil] + optional :name, String + + # @!method initialize(name: nil, type: :ACCOUNT_HOLDER) + # @param name [String] The variable name for this feature in the rule function signature + # + # @param type [Symbol, :ACCOUNT_HOLDER] + end + + class IPMetadataFeature < Lithic::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, :IP_METADATA] + required :type, const: :IP_METADATA + + # @!attribute name + # The variable name for this feature in the rule function signature + # + # @return [String, nil] + optional :name, String + + # @!method initialize(name: nil, type: :IP_METADATA) + # @param name [String] The variable name for this feature in the rule function signature + # + # @param type [Symbol, :IP_METADATA] + end + + class SpendVelocityFeature < Lithic::Internal::Type::BaseModel + # @!attribute period + # Velocity over the current day since 00:00 / 12 AM in Eastern Time + # + # @return [Lithic::Models::AuthRules::VelocityLimitPeriod::TrailingWindowObject, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowDay, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowWeek, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowMonth, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowYear] + required :period, union: -> { Lithic::AuthRules::VelocityLimitPeriod } + + # @!attribute scope + # The scope the velocity is calculated for + # + # @return [Symbol, Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature::Scope] + required :scope, enum: -> { Lithic::AuthRules::RuleFeature::SpendVelocityFeature::Scope } + + # @!attribute type + # + # @return [Symbol, :SPEND_VELOCITY] + required :type, const: :SPEND_VELOCITY + + # @!attribute filters + # + # @return [Lithic::Models::AuthRules::VelocityLimitFilters, nil] + optional :filters, -> { Lithic::AuthRules::VelocityLimitFilters } + + # @!attribute name + # The variable name for this feature in the rule function signature + # + # @return [String, nil] + optional :name, String + + # @!method initialize(period:, scope:, filters: nil, name: nil, type: :SPEND_VELOCITY) + # @param period [Lithic::Models::AuthRules::VelocityLimitPeriod::TrailingWindowObject, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowDay, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowWeek, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowMonth, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowYear] Velocity over the current day since 00:00 / 12 AM in Eastern Time + # + # @param scope [Symbol, Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature::Scope] The scope the velocity is calculated for + # + # @param filters [Lithic::Models::AuthRules::VelocityLimitFilters] + # + # @param name [String] The variable name for this feature in the rule function signature + # + # @param type [Symbol, :SPEND_VELOCITY] + + # The scope the velocity is calculated for + # + # @see Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature#scope + module Scope + extend Lithic::Internal::Type::Enum + + CARD = :CARD + ACCOUNT = :ACCOUNT + + # @!method self.values + # @return [Array] + end + end + + class TransactionHistorySignalsFeature < Lithic::Internal::Type::BaseModel + # @!attribute scope + # The entity scope to load transaction history signals for. + # + # @return [Symbol, Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature::Scope] + required :scope, enum: -> { Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature::Scope } + + # @!attribute type + # + # @return [Symbol, :TRANSACTION_HISTORY_SIGNALS] + required :type, const: :TRANSACTION_HISTORY_SIGNALS + + # @!attribute name + # The variable name for this feature in the rule function signature + # + # @return [String, nil] + optional :name, String + + # @!method initialize(scope:, name: nil, type: :TRANSACTION_HISTORY_SIGNALS) + # @param scope [Symbol, Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature::Scope] The entity scope to load transaction history signals for. + # + # @param name [String] The variable name for this feature in the rule function signature + # + # @param type [Symbol, :TRANSACTION_HISTORY_SIGNALS] + + # The entity scope to load transaction history signals for. + # + # @see Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature#scope + module Scope + extend Lithic::Internal::Type::Enum + + CARD = :CARD + ACCOUNT = :ACCOUNT + BUSINESS_ACCOUNT = :BUSINESS_ACCOUNT + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(Lithic::Models::AuthRules::RuleFeature::AuthorizationFeature, Lithic::Models::AuthRules::RuleFeature::AuthenticationFeature, Lithic::Models::AuthRules::RuleFeature::TokenizationFeature, Lithic::Models::AuthRules::RuleFeature::ACHReceiptFeature, Lithic::Models::AuthRules::RuleFeature::CardTransactionFeature, Lithic::Models::AuthRules::RuleFeature::CardFeature, Lithic::Models::AuthRules::RuleFeature::AccountHolderFeature, Lithic::Models::AuthRules::RuleFeature::IPMetadataFeature, Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature, Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature)] + end + end + end +end diff --git a/lib/lithic/models/auth_rules/spend_velocity_filters.rb b/lib/lithic/models/auth_rules/spend_velocity_filters.rb new file mode 100644 index 00000000..b5dfaaa4 --- /dev/null +++ b/lib/lithic/models/auth_rules/spend_velocity_filters.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class SpendVelocityFilters < Lithic::Models::AuthRules::VelocityLimitFilters + # @!attribute exclude_tags + # Tag key-value pairs to exclude from the velocity calculation. Transactions + # matching all specified tag key-value pairs will be excluded from the calculated + # velocity. + # + # @return [Hash{Symbol=>String}, nil] + optional :exclude_tags, Lithic::Internal::Type::HashOf[String], nil?: true + + # @!attribute include_tags + # Tag key-value pairs to include in the velocity calculation. Only transactions + # matching all specified tag key-value pairs will be included in the calculated + # velocity. + # + # @return [Hash{Symbol=>String}, nil] + optional :include_tags, Lithic::Internal::Type::HashOf[String], nil?: true + + # @!method initialize(exclude_tags: nil, include_tags: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::SpendVelocityFilters} for more details. + # + # @param exclude_tags [Hash{Symbol=>String}, nil] Tag key-value pairs to exclude from the velocity calculation. Transactions match + # + # @param include_tags [Hash{Symbol=>String}, nil] Tag key-value pairs to include in the velocity calculation. Only transactions ma + end + end + end +end diff --git a/lib/lithic/models/auth_rules/typescript_code_parameters.rb b/lib/lithic/models/auth_rules/typescript_code_parameters.rb new file mode 100644 index 00000000..f490923a --- /dev/null +++ b/lib/lithic/models/auth_rules/typescript_code_parameters.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class TypescriptCodeParameters < Lithic::Internal::Type::BaseModel + # @!attribute code + # The TypeScript source code of the rule. Must define a `rule()` function that + # accepts the declared features as positional arguments (in the same order as the + # `features` array) and returns an array of actions. + # + # @return [String] + required :code, String + + # @!attribute features + # Features available to the TypeScript code at evaluation time + # + # @return [Array] + required :features, -> { Lithic::Internal::Type::ArrayOf[union: Lithic::AuthRules::RuleFeature] } + + # @!method initialize(code:, features:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::TypescriptCodeParameters} for more details. + # + # Parameters for defining a TypeScript code rule + # + # @param code [String] The TypeScript source code of the rule. Must define a `rule()` function that acc + # + # @param features [Array] Features available to the TypeScript code at evaluation time + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2/backtest_create_params.rb b/lib/lithic/models/auth_rules/v2/backtest_create_params.rb new file mode 100644 index 00000000..f5924631 --- /dev/null +++ b/lib/lithic/models/auth_rules/v2/backtest_create_params.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + module V2 + # @see Lithic::Resources::AuthRules::V2::Backtests#create + class BacktestCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute auth_rule_token + # + # @return [String] + required :auth_rule_token, String + + # @!attribute end_ + # The end time of the backtest. + # + # @return [Time, nil] + optional :end_, Time, api_name: :end + + # @!attribute start + # The start time of the backtest. + # + # @return [Time, nil] + optional :start, Time + + # @!method initialize(auth_rule_token:, end_: nil, start: nil, request_options: {}) + # @param auth_rule_token [String] + # + # @param end_ [Time] The end time of the backtest. + # + # @param start [Time] The start time of the backtest. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2/backtest_create_response.rb b/lib/lithic/models/auth_rules/v2/backtest_create_response.rb new file mode 100644 index 00000000..0c719543 --- /dev/null +++ b/lib/lithic/models/auth_rules/v2/backtest_create_response.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + module V2 + # @see Lithic::Resources::AuthRules::V2::Backtests#create + class BacktestCreateResponse < Lithic::Internal::Type::BaseModel + # @!attribute backtest_token + # Auth Rule Backtest Token + # + # @return [String, nil] + optional :backtest_token, String + + # @!method initialize(backtest_token: nil) + # @param backtest_token [String] Auth Rule Backtest Token + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2/backtest_results.rb b/lib/lithic/models/auth_rules/v2/backtest_results.rb new file mode 100644 index 00000000..3b3e50bf --- /dev/null +++ b/lib/lithic/models/auth_rules/v2/backtest_results.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + module V2 + # @see Lithic::Resources::AuthRules::V2::Backtests#retrieve + class BacktestResults < Lithic::Internal::Type::BaseModel + # @!attribute backtest_token + # Auth Rule Backtest Token + # + # @return [String] + required :backtest_token, String + + # @!attribute results + # + # @return [Lithic::Models::AuthRules::V2::BacktestResults::Results] + required :results, -> { Lithic::AuthRules::V2::BacktestResults::Results } + + # @!attribute simulation_parameters + # + # @return [Lithic::Models::AuthRules::V2::BacktestResults::SimulationParameters] + required :simulation_parameters, -> { Lithic::AuthRules::V2::BacktestResults::SimulationParameters } + + # @!method initialize(backtest_token:, results:, simulation_parameters:) + # @param backtest_token [String] Auth Rule Backtest Token + # + # @param results [Lithic::Models::AuthRules::V2::BacktestResults::Results] + # + # @param simulation_parameters [Lithic::Models::AuthRules::V2::BacktestResults::SimulationParameters] + + # @see Lithic::Models::AuthRules::V2::BacktestResults#results + class Results < Lithic::Internal::Type::BaseModel + # @!attribute current_version + # + # @return [Lithic::Models::AuthRules::BacktestStats, nil] + optional :current_version, -> { Lithic::AuthRules::BacktestStats }, nil?: true + + # @!attribute draft_version + # + # @return [Lithic::Models::AuthRules::BacktestStats, nil] + optional :draft_version, -> { Lithic::AuthRules::BacktestStats }, nil?: true + + # @!method initialize(current_version: nil, draft_version: nil) + # @param current_version [Lithic::Models::AuthRules::BacktestStats, nil] + # @param draft_version [Lithic::Models::AuthRules::BacktestStats, nil] + end + + # @see Lithic::Models::AuthRules::V2::BacktestResults#simulation_parameters + class SimulationParameters < Lithic::Internal::Type::BaseModel + # @!attribute end_ + # The end time of the simulation + # + # @return [Time] + required :end_, Time, api_name: :end + + # @!attribute start + # The start time of the simulation + # + # @return [Time] + required :start, Time + + # @!method initialize(end_:, start:) + # @param end_ [Time] The end time of the simulation + # + # @param start [Time] The start time of the simulation + end + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2/backtest_retrieve_params.rb b/lib/lithic/models/auth_rules/v2/backtest_retrieve_params.rb new file mode 100644 index 00000000..724c829d --- /dev/null +++ b/lib/lithic/models/auth_rules/v2/backtest_retrieve_params.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + module V2 + # @see Lithic::Resources::AuthRules::V2::Backtests#retrieve + class BacktestRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute auth_rule_token + # + # @return [String] + required :auth_rule_token, String + + # @!attribute auth_rule_backtest_token + # + # @return [String] + required :auth_rule_backtest_token, String + + # @!method initialize(auth_rule_token:, auth_rule_backtest_token:, request_options: {}) + # @param auth_rule_token [String] + # @param auth_rule_backtest_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_create_params.rb b/lib/lithic/models/auth_rules/v2_create_params.rb new file mode 100644 index 00000000..7486510b --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_create_params.rb @@ -0,0 +1,436 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + # @see Lithic::Resources::AuthRules::V2#create + class V2CreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute body + # + # @return [Lithic::Models::AuthRules::V2CreateParams::Body::AccountLevelRule, Lithic::Models::AuthRules::V2CreateParams::Body::CardLevelRule, Lithic::Models::AuthRules::V2CreateParams::Body::ProgramLevelRule] + required :body, union: -> { Lithic::AuthRules::V2CreateParams::Body } + + # @!method initialize(body:, request_options: {}) + # @param body [Lithic::Models::AuthRules::V2CreateParams::Body::AccountLevelRule, Lithic::Models::AuthRules::V2CreateParams::Body::CardLevelRule, Lithic::Models::AuthRules::V2CreateParams::Body::ProgramLevelRule] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + module Body + extend Lithic::Internal::Type::Union + + variant -> { Lithic::AuthRules::V2CreateParams::Body::AccountLevelRule } + + variant -> { Lithic::AuthRules::V2CreateParams::Body::CardLevelRule } + + variant -> { Lithic::AuthRules::V2CreateParams::Body::ProgramLevelRule } + + class AccountLevelRule < Lithic::Internal::Type::BaseModel + # @!attribute parameters + # Parameters for the Auth Rule + # + # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters] + required :parameters, union: -> { Lithic::AuthRules::V2CreateParams::Body::AccountLevelRule::Parameters } + + # @!attribute type + # The type of Auth Rule. For certain rule types, this determines the event stream + # during which it will be evaluated. For rules that can be applied to one of + # several event streams, the effective one is defined by the separate + # `event_stream` field. + # + # - `CONDITIONAL_BLOCK`: Deprecated. Use `CONDITIONAL_ACTION` instead. + # AUTHORIZATION event stream. + # - `VELOCITY_LIMIT`: AUTHORIZATION event stream. + # - `MERCHANT_LOCK`: AUTHORIZATION event stream. + # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + # + # @return [Symbol, Lithic::Models::AuthRules::V2CreateParams::Body::AccountLevelRule::Type] + required :type, enum: -> { Lithic::AuthRules::V2CreateParams::Body::AccountLevelRule::Type } + + # @!attribute account_tokens + # Account tokens to which the Auth Rule applies. + # + # @return [Array, nil] + optional :account_tokens, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute business_account_tokens + # Business Account tokens to which the Auth Rule applies. + # + # @return [Array, nil] + optional :business_account_tokens, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute event_stream + # The event stream during which the rule will be evaluated. + # + # @return [Symbol, Lithic::Models::AuthRules::EventStream, nil] + optional :event_stream, enum: -> { Lithic::AuthRules::EventStream } + + # @!attribute name + # Auth Rule Name + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!method initialize(parameters:, type:, account_tokens: nil, business_account_tokens: nil, event_stream: nil, name: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::V2CreateParams::Body::AccountLevelRule} for more + # details. + # + # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters] Parameters for the Auth Rule + # + # @param type [Symbol, Lithic::Models::AuthRules::V2CreateParams::Body::AccountLevelRule::Type] The type of Auth Rule. For certain rule types, this determines the event stream + # + # @param account_tokens [Array] Account tokens to which the Auth Rule applies. + # + # @param business_account_tokens [Array] Business Account tokens to which the Auth Rule applies. + # + # @param event_stream [Symbol, Lithic::Models::AuthRules::EventStream] The event stream during which the rule will be evaluated. + # + # @param name [String, nil] Auth Rule Name + + # Parameters for the Auth Rule + # + # @see Lithic::Models::AuthRules::V2CreateParams::Body::AccountLevelRule#parameters + module Parameters + extend Lithic::Internal::Type::Union + + # Deprecated: Use CONDITIONAL_ACTION instead. + variant -> { Lithic::AuthRules::ConditionalBlockParameters } + + variant -> { Lithic::AuthRules::VelocityLimitParams } + + variant -> { Lithic::AuthRules::MerchantLockParameters } + + variant -> { Lithic::AuthRules::Conditional3DSActionParameters } + + variant -> { Lithic::AuthRules::ConditionalAuthorizationActionParameters } + + variant -> { Lithic::AuthRules::ConditionalACHActionParameters } + + variant -> { Lithic::AuthRules::ConditionalTokenizationActionParameters } + + variant -> { Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters } + + # Parameters for defining a TypeScript code rule + variant -> { Lithic::AuthRules::TypescriptCodeParameters } + + variant -> { Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters } + + # @!method self.variants + # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters)] + end + + # The type of Auth Rule. For certain rule types, this determines the event stream + # during which it will be evaluated. For rules that can be applied to one of + # several event streams, the effective one is defined by the separate + # `event_stream` field. + # + # - `CONDITIONAL_BLOCK`: Deprecated. Use `CONDITIONAL_ACTION` instead. + # AUTHORIZATION event stream. + # - `VELOCITY_LIMIT`: AUTHORIZATION event stream. + # - `MERCHANT_LOCK`: AUTHORIZATION event stream. + # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + # + # @see Lithic::Models::AuthRules::V2CreateParams::Body::AccountLevelRule#type + module Type + extend Lithic::Internal::Type::Enum + + CONDITIONAL_BLOCK = :CONDITIONAL_BLOCK + VELOCITY_LIMIT = :VELOCITY_LIMIT + MERCHANT_LOCK = :MERCHANT_LOCK + CONDITIONAL_ACTION = :CONDITIONAL_ACTION + TYPESCRIPT_CODE = :TYPESCRIPT_CODE + + # @!method self.values + # @return [Array] + end + end + + class CardLevelRule < Lithic::Internal::Type::BaseModel + # @!attribute card_tokens + # Card tokens to which the Auth Rule applies. + # + # @return [Array] + required :card_tokens, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute parameters + # Parameters for the Auth Rule + # + # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters] + required :parameters, union: -> { Lithic::AuthRules::V2CreateParams::Body::CardLevelRule::Parameters } + + # @!attribute type + # The type of Auth Rule. For certain rule types, this determines the event stream + # during which it will be evaluated. For rules that can be applied to one of + # several event streams, the effective one is defined by the separate + # `event_stream` field. + # + # - `CONDITIONAL_BLOCK`: Deprecated. Use `CONDITIONAL_ACTION` instead. + # AUTHORIZATION event stream. + # - `VELOCITY_LIMIT`: AUTHORIZATION event stream. + # - `MERCHANT_LOCK`: AUTHORIZATION event stream. + # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + # + # @return [Symbol, Lithic::Models::AuthRules::V2CreateParams::Body::CardLevelRule::Type] + required :type, enum: -> { Lithic::AuthRules::V2CreateParams::Body::CardLevelRule::Type } + + # @!attribute event_stream + # The event stream during which the rule will be evaluated. + # + # @return [Symbol, Lithic::Models::AuthRules::EventStream, nil] + optional :event_stream, enum: -> { Lithic::AuthRules::EventStream } + + # @!attribute name + # Auth Rule Name + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!method initialize(card_tokens:, parameters:, type:, event_stream: nil, name: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::V2CreateParams::Body::CardLevelRule} for more + # details. + # + # @param card_tokens [Array] Card tokens to which the Auth Rule applies. + # + # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters] Parameters for the Auth Rule + # + # @param type [Symbol, Lithic::Models::AuthRules::V2CreateParams::Body::CardLevelRule::Type] The type of Auth Rule. For certain rule types, this determines the event stream + # + # @param event_stream [Symbol, Lithic::Models::AuthRules::EventStream] The event stream during which the rule will be evaluated. + # + # @param name [String, nil] Auth Rule Name + + # Parameters for the Auth Rule + # + # @see Lithic::Models::AuthRules::V2CreateParams::Body::CardLevelRule#parameters + module Parameters + extend Lithic::Internal::Type::Union + + # Deprecated: Use CONDITIONAL_ACTION instead. + variant -> { Lithic::AuthRules::ConditionalBlockParameters } + + variant -> { Lithic::AuthRules::VelocityLimitParams } + + variant -> { Lithic::AuthRules::MerchantLockParameters } + + variant -> { Lithic::AuthRules::Conditional3DSActionParameters } + + variant -> { Lithic::AuthRules::ConditionalAuthorizationActionParameters } + + variant -> { Lithic::AuthRules::ConditionalACHActionParameters } + + variant -> { Lithic::AuthRules::ConditionalTokenizationActionParameters } + + variant -> { Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters } + + # Parameters for defining a TypeScript code rule + variant -> { Lithic::AuthRules::TypescriptCodeParameters } + + variant -> { Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters } + + # @!method self.variants + # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters)] + end + + # The type of Auth Rule. For certain rule types, this determines the event stream + # during which it will be evaluated. For rules that can be applied to one of + # several event streams, the effective one is defined by the separate + # `event_stream` field. + # + # - `CONDITIONAL_BLOCK`: Deprecated. Use `CONDITIONAL_ACTION` instead. + # AUTHORIZATION event stream. + # - `VELOCITY_LIMIT`: AUTHORIZATION event stream. + # - `MERCHANT_LOCK`: AUTHORIZATION event stream. + # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + # + # @see Lithic::Models::AuthRules::V2CreateParams::Body::CardLevelRule#type + module Type + extend Lithic::Internal::Type::Enum + + CONDITIONAL_BLOCK = :CONDITIONAL_BLOCK + VELOCITY_LIMIT = :VELOCITY_LIMIT + MERCHANT_LOCK = :MERCHANT_LOCK + CONDITIONAL_ACTION = :CONDITIONAL_ACTION + TYPESCRIPT_CODE = :TYPESCRIPT_CODE + + # @!method self.values + # @return [Array] + end + end + + class ProgramLevelRule < Lithic::Internal::Type::BaseModel + # @!attribute parameters + # Parameters for the Auth Rule + # + # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters] + required :parameters, union: -> { Lithic::AuthRules::V2CreateParams::Body::ProgramLevelRule::Parameters } + + # @!attribute program_level + # Whether the Auth Rule applies to all authorizations on the card program. + # + # @return [Boolean] + required :program_level, Lithic::Internal::Type::Boolean + + # @!attribute type + # The type of Auth Rule. For certain rule types, this determines the event stream + # during which it will be evaluated. For rules that can be applied to one of + # several event streams, the effective one is defined by the separate + # `event_stream` field. + # + # - `CONDITIONAL_BLOCK`: Deprecated. Use `CONDITIONAL_ACTION` instead. + # AUTHORIZATION event stream. + # - `VELOCITY_LIMIT`: AUTHORIZATION event stream. + # - `MERCHANT_LOCK`: AUTHORIZATION event stream. + # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + # + # @return [Symbol, Lithic::Models::AuthRules::V2CreateParams::Body::ProgramLevelRule::Type] + required :type, enum: -> { Lithic::AuthRules::V2CreateParams::Body::ProgramLevelRule::Type } + + # @!attribute event_stream + # The event stream during which the rule will be evaluated. + # + # @return [Symbol, Lithic::Models::AuthRules::EventStream, nil] + optional :event_stream, enum: -> { Lithic::AuthRules::EventStream } + + # @!attribute excluded_account_tokens + # Account tokens to which the Auth Rule does not apply. + # + # @return [Array, nil] + optional :excluded_account_tokens, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute excluded_business_account_tokens + # Business account tokens to which the Auth Rule does not apply. + # + # @return [Array, nil] + optional :excluded_business_account_tokens, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute excluded_card_tokens + # Card tokens to which the Auth Rule does not apply. + # + # @return [Array, nil] + optional :excluded_card_tokens, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute name + # Auth Rule Name + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!method initialize(parameters:, program_level:, type:, event_stream: nil, excluded_account_tokens: nil, excluded_business_account_tokens: nil, excluded_card_tokens: nil, name: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::V2CreateParams::Body::ProgramLevelRule} for more + # details. + # + # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters] Parameters for the Auth Rule + # + # @param program_level [Boolean] Whether the Auth Rule applies to all authorizations on the card program. + # + # @param type [Symbol, Lithic::Models::AuthRules::V2CreateParams::Body::ProgramLevelRule::Type] The type of Auth Rule. For certain rule types, this determines the event stream + # + # @param event_stream [Symbol, Lithic::Models::AuthRules::EventStream] The event stream during which the rule will be evaluated. + # + # @param excluded_account_tokens [Array] Account tokens to which the Auth Rule does not apply. + # + # @param excluded_business_account_tokens [Array] Business account tokens to which the Auth Rule does not apply. + # + # @param excluded_card_tokens [Array] Card tokens to which the Auth Rule does not apply. + # + # @param name [String, nil] Auth Rule Name + + # Parameters for the Auth Rule + # + # @see Lithic::Models::AuthRules::V2CreateParams::Body::ProgramLevelRule#parameters + module Parameters + extend Lithic::Internal::Type::Union + + # Deprecated: Use CONDITIONAL_ACTION instead. + variant -> { Lithic::AuthRules::ConditionalBlockParameters } + + variant -> { Lithic::AuthRules::VelocityLimitParams } + + variant -> { Lithic::AuthRules::MerchantLockParameters } + + variant -> { Lithic::AuthRules::Conditional3DSActionParameters } + + variant -> { Lithic::AuthRules::ConditionalAuthorizationActionParameters } + + variant -> { Lithic::AuthRules::ConditionalACHActionParameters } + + variant -> { Lithic::AuthRules::ConditionalTokenizationActionParameters } + + variant -> { Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters } + + # Parameters for defining a TypeScript code rule + variant -> { Lithic::AuthRules::TypescriptCodeParameters } + + variant -> { Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters } + + # @!method self.variants + # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters)] + end + + # The type of Auth Rule. For certain rule types, this determines the event stream + # during which it will be evaluated. For rules that can be applied to one of + # several event streams, the effective one is defined by the separate + # `event_stream` field. + # + # - `CONDITIONAL_BLOCK`: Deprecated. Use `CONDITIONAL_ACTION` instead. + # AUTHORIZATION event stream. + # - `VELOCITY_LIMIT`: AUTHORIZATION event stream. + # - `MERCHANT_LOCK`: AUTHORIZATION event stream. + # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + # + # @see Lithic::Models::AuthRules::V2CreateParams::Body::ProgramLevelRule#type + module Type + extend Lithic::Internal::Type::Enum + + CONDITIONAL_BLOCK = :CONDITIONAL_BLOCK + VELOCITY_LIMIT = :VELOCITY_LIMIT + MERCHANT_LOCK = :MERCHANT_LOCK + CONDITIONAL_ACTION = :CONDITIONAL_ACTION + TYPESCRIPT_CODE = :TYPESCRIPT_CODE + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(Lithic::Models::AuthRules::V2CreateParams::Body::AccountLevelRule, Lithic::Models::AuthRules::V2CreateParams::Body::CardLevelRule, Lithic::Models::AuthRules::V2CreateParams::Body::ProgramLevelRule)] + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_delete_params.rb b/lib/lithic/models/auth_rules/v2_delete_params.rb new file mode 100644 index 00000000..076f6545 --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_delete_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + # @see Lithic::Resources::AuthRules::V2#delete + class V2DeleteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute auth_rule_token + # + # @return [String] + required :auth_rule_token, String + + # @!method initialize(auth_rule_token:, request_options: {}) + # @param auth_rule_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_draft_params.rb b/lib/lithic/models/auth_rules/v2_draft_params.rb new file mode 100644 index 00000000..12ea00a4 --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_draft_params.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + # @see Lithic::Resources::AuthRules::V2#draft + class V2DraftParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute auth_rule_token + # + # @return [String] + required :auth_rule_token, String + + # @!attribute parameters + # Parameters for the Auth Rule + # + # @return [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters, nil] + optional :parameters, union: -> { Lithic::AuthRules::V2DraftParams::Parameters }, nil?: true + + # @!method initialize(auth_rule_token:, parameters: nil, request_options: {}) + # @param auth_rule_token [String] + # + # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters, nil] Parameters for the Auth Rule + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Internal::Type::Union + + # Deprecated: Use CONDITIONAL_ACTION instead. + variant -> { Lithic::AuthRules::ConditionalBlockParameters } + + variant -> { Lithic::AuthRules::VelocityLimitParams } + + variant -> { Lithic::AuthRules::MerchantLockParameters } + + variant -> { Lithic::AuthRules::Conditional3DSActionParameters } + + variant -> { Lithic::AuthRules::ConditionalAuthorizationActionParameters } + + variant -> { Lithic::AuthRules::ConditionalACHActionParameters } + + variant -> { Lithic::AuthRules::ConditionalTokenizationActionParameters } + + variant -> { Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters } + + # Parameters for defining a TypeScript code rule + variant -> { Lithic::AuthRules::TypescriptCodeParameters } + + variant -> { Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters } + + # @!method self.variants + # @return [Array(Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters)] + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_list_params.rb b/lib/lithic/models/auth_rules/v2_list_params.rb new file mode 100644 index 00000000..8973a75a --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_list_params.rb @@ -0,0 +1,110 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + # @see Lithic::Resources::AuthRules::V2#list + class V2ListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute account_token + # Only return Auth Rules that are bound to the provided account token. + # + # @return [String, nil] + optional :account_token, String + + # @!attribute business_account_token + # Only return Auth Rules that are bound to the provided business account token. + # + # @return [String, nil] + optional :business_account_token, String + + # @!attribute card_token + # Only return Auth Rules that are bound to the provided card token. + # + # @return [String, nil] + optional :card_token, String + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute event_stream + # Deprecated: Use event_streams instead. Only return Auth rules that are executed + # during the provided event stream. + # + # @return [Symbol, Lithic::Models::AuthRules::EventStream, nil] + optional :event_stream, enum: -> { Lithic::AuthRules::EventStream } + + # @!attribute event_streams + # Only return Auth rules that are executed during any of the provided event + # streams. If event_streams and event_stream are specified, the values will be + # combined. + # + # @return [Array, nil] + optional :event_streams, -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::AuthRules::EventStream] } + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute scope + # Only return Auth Rules that are bound to the provided scope. + # + # @return [Symbol, Lithic::Models::AuthRules::V2ListParams::Scope, nil] + optional :scope, enum: -> { Lithic::AuthRules::V2ListParams::Scope } + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!method initialize(account_token: nil, business_account_token: nil, card_token: nil, ending_before: nil, event_stream: nil, event_streams: nil, page_size: nil, scope: nil, starting_after: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::V2ListParams} for more details. + # + # @param account_token [String] Only return Auth Rules that are bound to the provided account token. + # + # @param business_account_token [String] Only return Auth Rules that are bound to the provided business account token. + # + # @param card_token [String] Only return Auth Rules that are bound to the provided card token. + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param event_stream [Symbol, Lithic::Models::AuthRules::EventStream] Deprecated: Use event_streams instead. Only return Auth rules that are executed + # + # @param event_streams [Array] Only return Auth rules that are executed during any of the provided event stream + # + # @param page_size [Integer] Page size (for pagination). + # + # @param scope [Symbol, Lithic::Models::AuthRules::V2ListParams::Scope] Only return Auth Rules that are bound to the provided scope. + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Only return Auth Rules that are bound to the provided scope. + module Scope + extend Lithic::Internal::Type::Enum + + PROGRAM = :PROGRAM + ACCOUNT = :ACCOUNT + BUSINESS_ACCOUNT = :BUSINESS_ACCOUNT + CARD = :CARD + ANY = :ANY + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_list_results_params.rb b/lib/lithic/models/auth_rules/v2_list_results_params.rb new file mode 100644 index 00000000..f30fc6a6 --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_list_results_params.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + # @see Lithic::Resources::AuthRules::V2#list_results + class V2ListResultsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute auth_rule_token + # Filter by Auth Rule token + # + # @return [String, nil] + optional :auth_rule_token, String + + # @!attribute begin_ + # Date string in RFC 3339 format. Only events evaluated after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time + + # @!attribute end_ + # Date string in RFC 3339 format. Only events evaluated before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute event_token + # Filter by event token + # + # @return [String, nil] + optional :event_token, String + + # @!attribute has_actions + # Filter by whether the rule evaluation produced any actions. When not provided, + # all results are returned. + # + # @return [Boolean, nil] + optional :has_actions, Lithic::Internal::Type::Boolean + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!method initialize(auth_rule_token: nil, begin_: nil, end_: nil, ending_before: nil, event_token: nil, has_actions: nil, page_size: nil, starting_after: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::V2ListResultsParams} for more details. + # + # @param auth_rule_token [String] Filter by Auth Rule token + # + # @param begin_ [Time] Date string in RFC 3339 format. Only events evaluated after the specified time w + # + # @param end_ [Time] Date string in RFC 3339 format. Only events evaluated before the specified time + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param event_token [String] Filter by event token + # + # @param has_actions [Boolean] Filter by whether the rule evaluation produced any actions. When not provided, a + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_list_results_response.rb b/lib/lithic/models/auth_rules/v2_list_results_response.rb new file mode 100644 index 00000000..0afce322 --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_list_results_response.rb @@ -0,0 +1,888 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + # Result of an Auth Rule evaluation + # + # @see Lithic::Resources::AuthRules::V2#list_results + module V2ListResultsResponse + extend Lithic::Internal::Type::Union + + variant -> { Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult } + + variant -> { Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult } + + variant -> { Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult } + + variant -> { Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult } + + class AuthorizationResult < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for the evaluation + # + # @return [String] + required :token, String + + # @!attribute actions + # Actions returned by the rule evaluation + # + # @return [Array] + required :actions, + -> { Lithic::Internal::Type::ArrayOf[union: Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action] } + + # @!attribute auth_rule_token + # The Auth Rule token + # + # @return [String] + required :auth_rule_token, String + + # @!attribute evaluation_time + # Timestamp of the rule evaluation + # + # @return [Time] + required :evaluation_time, Time + + # @!attribute event_stream + # The event stream during which the rule was evaluated + # + # @return [Symbol, :AUTHORIZATION] + required :event_stream, const: :AUTHORIZATION + + # @!attribute event_token + # Token of the event that triggered the evaluation + # + # @return [String] + required :event_token, String + + # @!attribute mode + # The state of the Auth Rule + # + # @return [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Mode] + required :mode, enum: -> { Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Mode } + + # @!attribute rule_version + # Version of the rule that was evaluated + # + # @return [Integer] + required :rule_version, Integer + + # @!attribute transaction_token + # The token of the transaction that triggered the rule evaluation + # + # @return [String, nil] + required :transaction_token, String, nil?: true + + # @!method initialize(token:, actions:, auth_rule_token:, evaluation_time:, event_token:, mode:, rule_version:, transaction_token:, event_stream: :AUTHORIZATION) + # @param token [String] Globally unique identifier for the evaluation + # + # @param actions [Array] Actions returned by the rule evaluation + # + # @param auth_rule_token [String] The Auth Rule token + # + # @param evaluation_time [Time] Timestamp of the rule evaluation + # + # @param event_token [String] Token of the event that triggered the evaluation + # + # @param mode [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Mode] The state of the Auth Rule + # + # @param rule_version [Integer] Version of the rule that was evaluated + # + # @param transaction_token [String, nil] The token of the transaction that triggered the rule evaluation + # + # @param event_stream [Symbol, :AUTHORIZATION] The event stream during which the rule was evaluated + + module Action + extend Lithic::Internal::Type::Union + + variant -> { Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization } + + variant -> { Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::ChallengeActionAuthorization } + + class DeclineActionAuthorization < Lithic::Internal::Type::BaseModel + # @!attribute code + # The detailed result code explaining the specific reason for the decline + # + # @return [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code] + required :code, + enum: -> { Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code } + + # @!attribute type + # + # @return [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Type] + required :type, + enum: -> { Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Type } + + # @!attribute explanation + # Optional explanation for why this action was taken + # + # @return [String, nil] + optional :explanation, String + + # @!method initialize(code:, type:, explanation: nil) + # @param code [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code] The detailed result code explaining the specific reason for the decline + # + # @param type [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Type] + # + # @param explanation [String] Optional explanation for why this action was taken + + # The detailed result code explaining the specific reason for the decline + # + # @see Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization#code + module Code + extend Lithic::Internal::Type::Enum + + ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED = :ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED + ACCOUNT_DELINQUENT = :ACCOUNT_DELINQUENT + ACCOUNT_INACTIVE = :ACCOUNT_INACTIVE + ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED = :ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED + ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED = :ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED + ACCOUNT_PAUSED = :ACCOUNT_PAUSED + ACCOUNT_UNDER_REVIEW = :ACCOUNT_UNDER_REVIEW + ADDRESS_INCORRECT = :ADDRESS_INCORRECT + APPROVED = :APPROVED + AUTH_RULE_ALLOWED_COUNTRY = :AUTH_RULE_ALLOWED_COUNTRY + AUTH_RULE_ALLOWED_MCC = :AUTH_RULE_ALLOWED_MCC + AUTH_RULE_BLOCKED_COUNTRY = :AUTH_RULE_BLOCKED_COUNTRY + AUTH_RULE_BLOCKED_MCC = :AUTH_RULE_BLOCKED_MCC + AUTH_RULE = :AUTH_RULE + CARD_CLOSED = :CARD_CLOSED + CARD_CRYPTOGRAM_VALIDATION_FAILURE = :CARD_CRYPTOGRAM_VALIDATION_FAILURE + CARD_EXPIRED = :CARD_EXPIRED + CARD_EXPIRY_DATE_INCORRECT = :CARD_EXPIRY_DATE_INCORRECT + CARD_INVALID = :CARD_INVALID + CARD_NOT_ACTIVATED = :CARD_NOT_ACTIVATED + CARD_PAUSED = :CARD_PAUSED + CARD_PIN_INCORRECT = :CARD_PIN_INCORRECT + CARD_RESTRICTED = :CARD_RESTRICTED + CARD_SECURITY_CODE_INCORRECT = :CARD_SECURITY_CODE_INCORRECT + CARD_SPEND_LIMIT_EXCEEDED = :CARD_SPEND_LIMIT_EXCEEDED + CONTACT_CARD_ISSUER = :CONTACT_CARD_ISSUER + CUSTOMER_ASA_TIMEOUT = :CUSTOMER_ASA_TIMEOUT + CUSTOM_ASA_RESULT = :CUSTOM_ASA_RESULT + DECLINED = :DECLINED + DO_NOT_HONOR = :DO_NOT_HONOR + DRIVER_NUMBER_INVALID = :DRIVER_NUMBER_INVALID + FORMAT_ERROR = :FORMAT_ERROR + INSUFFICIENT_FUNDING_SOURCE_BALANCE = :INSUFFICIENT_FUNDING_SOURCE_BALANCE + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + LITHIC_SYSTEM_ERROR = :LITHIC_SYSTEM_ERROR + LITHIC_SYSTEM_RATE_LIMIT = :LITHIC_SYSTEM_RATE_LIMIT + MALFORMED_ASA_RESPONSE = :MALFORMED_ASA_RESPONSE + MERCHANT_INVALID = :MERCHANT_INVALID + MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE = :MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE + MERCHANT_NOT_PERMITTED = :MERCHANT_NOT_PERMITTED + OVER_REVERSAL_ATTEMPTED = :OVER_REVERSAL_ATTEMPTED + PIN_BLOCKED = :PIN_BLOCKED + PROGRAM_CARD_SPEND_LIMIT_EXCEEDED = :PROGRAM_CARD_SPEND_LIMIT_EXCEEDED + PROGRAM_SUSPENDED = :PROGRAM_SUSPENDED + PROGRAM_USAGE_RESTRICTION = :PROGRAM_USAGE_RESTRICTION + REVERSAL_UNMATCHED = :REVERSAL_UNMATCHED + SECURITY_VIOLATION = :SECURITY_VIOLATION + SINGLE_USE_CARD_REATTEMPTED = :SINGLE_USE_CARD_REATTEMPTED + SUSPECTED_FRAUD = :SUSPECTED_FRAUD + TRANSACTION_INVALID = :TRANSACTION_INVALID + TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL = :TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL + TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER = :TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER + TRANSACTION_PREVIOUSLY_COMPLETED = :TRANSACTION_PREVIOUSLY_COMPLETED + UNAUTHORIZED_MERCHANT = :UNAUTHORIZED_MERCHANT + VEHICLE_NUMBER_INVALID = :VEHICLE_NUMBER_INVALID + CARDHOLDER_CHALLENGED = :CARDHOLDER_CHALLENGED + CARDHOLDER_CHALLENGE_FAILED = :CARDHOLDER_CHALLENGE_FAILED + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization#type + module Type + extend Lithic::Internal::Type::Enum + + DECLINE = :DECLINE + + # @!method self.values + # @return [Array] + end + end + + class ChallengeActionAuthorization < Lithic::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::ChallengeActionAuthorization::Type] + required :type, + enum: -> { Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::ChallengeActionAuthorization::Type } + + # @!attribute explanation + # Optional explanation for why this action was taken + # + # @return [String, nil] + optional :explanation, String + + # @!method initialize(type:, explanation: nil) + # @param type [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::ChallengeActionAuthorization::Type] + # + # @param explanation [String] Optional explanation for why this action was taken + + # @see Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::ChallengeActionAuthorization#type + module Type + extend Lithic::Internal::Type::Enum + + CHALLENGE = :CHALLENGE + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization, Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::ChallengeActionAuthorization)] + end + + # The state of the Auth Rule + # + # @see Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult#mode + module Mode + extend Lithic::Internal::Type::Enum + + ACTIVE = :ACTIVE + INACTIVE = :INACTIVE + + # @!method self.values + # @return [Array] + end + end + + class Authentication3DSResult < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for the evaluation + # + # @return [String] + required :token, String + + # @!attribute actions + # Actions returned by the rule evaluation + # + # @return [Array] + required :actions, + -> { Lithic::Internal::Type::ArrayOf[Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Action] } + + # @!attribute auth_rule_token + # The Auth Rule token + # + # @return [String] + required :auth_rule_token, String + + # @!attribute evaluation_time + # Timestamp of the rule evaluation + # + # @return [Time] + required :evaluation_time, Time + + # @!attribute event_stream + # The event stream during which the rule was evaluated + # + # @return [Symbol, :THREE_DS_AUTHENTICATION] + required :event_stream, const: :THREE_DS_AUTHENTICATION + + # @!attribute event_token + # Token of the event that triggered the evaluation + # + # @return [String] + required :event_token, String + + # @!attribute mode + # The state of the Auth Rule + # + # @return [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Mode] + required :mode, + enum: -> { Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Mode } + + # @!attribute rule_version + # Version of the rule that was evaluated + # + # @return [Integer] + required :rule_version, Integer + + # @!attribute transaction_token + # The token of the transaction that triggered the rule evaluation + # + # @return [String, nil] + required :transaction_token, String, nil?: true + + # @!method initialize(token:, actions:, auth_rule_token:, evaluation_time:, event_token:, mode:, rule_version:, transaction_token:, event_stream: :THREE_DS_AUTHENTICATION) + # @param token [String] Globally unique identifier for the evaluation + # + # @param actions [Array] Actions returned by the rule evaluation + # + # @param auth_rule_token [String] The Auth Rule token + # + # @param evaluation_time [Time] Timestamp of the rule evaluation + # + # @param event_token [String] Token of the event that triggered the evaluation + # + # @param mode [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Mode] The state of the Auth Rule + # + # @param rule_version [Integer] Version of the rule that was evaluated + # + # @param transaction_token [String, nil] The token of the transaction that triggered the rule evaluation + # + # @param event_stream [Symbol, :THREE_DS_AUTHENTICATION] The event stream during which the rule was evaluated + + class Action < Lithic::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Action::Type] + required :type, + enum: -> { Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Action::Type } + + # @!attribute explanation + # Optional explanation for why this action was taken + # + # @return [String, nil] + optional :explanation, String + + # @!method initialize(type:, explanation: nil) + # @param type [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Action::Type] + # + # @param explanation [String] Optional explanation for why this action was taken + + # @see Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Action#type + module Type + extend Lithic::Internal::Type::Enum + + DECLINE = :DECLINE + CHALLENGE = :CHALLENGE + + # @!method self.values + # @return [Array] + end + end + + # The state of the Auth Rule + # + # @see Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult#mode + module Mode + extend Lithic::Internal::Type::Enum + + ACTIVE = :ACTIVE + INACTIVE = :INACTIVE + + # @!method self.values + # @return [Array] + end + end + + class TokenizationResult < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for the evaluation + # + # @return [String] + required :token, String + + # @!attribute actions + # Actions returned by the rule evaluation + # + # @return [Array] + required :actions, + -> { Lithic::Internal::Type::ArrayOf[union: Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action] } + + # @!attribute auth_rule_token + # The Auth Rule token + # + # @return [String] + required :auth_rule_token, String + + # @!attribute evaluation_time + # Timestamp of the rule evaluation + # + # @return [Time] + required :evaluation_time, Time + + # @!attribute event_stream + # The event stream during which the rule was evaluated + # + # @return [Symbol, :TOKENIZATION] + required :event_stream, const: :TOKENIZATION + + # @!attribute event_token + # Token of the event that triggered the evaluation + # + # @return [String] + required :event_token, String + + # @!attribute mode + # The state of the Auth Rule + # + # @return [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Mode] + required :mode, enum: -> { Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Mode } + + # @!attribute rule_version + # Version of the rule that was evaluated + # + # @return [Integer] + required :rule_version, Integer + + # @!attribute transaction_token + # The token of the transaction that triggered the rule evaluation + # + # @return [String, nil] + required :transaction_token, String, nil?: true + + # @!method initialize(token:, actions:, auth_rule_token:, evaluation_time:, event_token:, mode:, rule_version:, transaction_token:, event_stream: :TOKENIZATION) + # @param token [String] Globally unique identifier for the evaluation + # + # @param actions [Array] Actions returned by the rule evaluation + # + # @param auth_rule_token [String] The Auth Rule token + # + # @param evaluation_time [Time] Timestamp of the rule evaluation + # + # @param event_token [String] Token of the event that triggered the evaluation + # + # @param mode [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Mode] The state of the Auth Rule + # + # @param rule_version [Integer] Version of the rule that was evaluated + # + # @param transaction_token [String, nil] The token of the transaction that triggered the rule evaluation + # + # @param event_stream [Symbol, :TOKENIZATION] The event stream during which the rule was evaluated + + module Action + extend Lithic::Internal::Type::Union + + variant -> { Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization } + + variant -> { Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction } + + class DeclineActionTokenization < Lithic::Internal::Type::BaseModel + # @!attribute type + # Decline the tokenization request + # + # @return [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Type] + required :type, + enum: -> { Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Type } + + # @!attribute explanation + # Optional explanation for why this action was taken + # + # @return [String, nil] + optional :explanation, String + + # @!attribute reason + # Reason code for declining the tokenization request + # + # @return [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Reason, nil] + optional :reason, + enum: -> { Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Reason } + + # @!method initialize(type:, explanation: nil, reason: nil) + # @param type [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Type] Decline the tokenization request + # + # @param explanation [String] Optional explanation for why this action was taken + # + # @param reason [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Reason] Reason code for declining the tokenization request + + # Decline the tokenization request + # + # @see Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization#type + module Type + extend Lithic::Internal::Type::Enum + + DECLINE = :DECLINE + + # @!method self.values + # @return [Array] + end + + # Reason code for declining the tokenization request + # + # @see Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization#reason + module Reason + extend Lithic::Internal::Type::Enum + + ACCOUNT_SCORE_1 = :ACCOUNT_SCORE_1 + DEVICE_SCORE_1 = :DEVICE_SCORE_1 + ALL_WALLET_DECLINE_REASONS_PRESENT = :ALL_WALLET_DECLINE_REASONS_PRESENT + WALLET_RECOMMENDED_DECISION_RED = :WALLET_RECOMMENDED_DECISION_RED + CVC_MISMATCH = :CVC_MISMATCH + CARD_EXPIRY_MONTH_MISMATCH = :CARD_EXPIRY_MONTH_MISMATCH + CARD_EXPIRY_YEAR_MISMATCH = :CARD_EXPIRY_YEAR_MISMATCH + CARD_INVALID_STATE = :CARD_INVALID_STATE + CUSTOMER_RED_PATH = :CUSTOMER_RED_PATH + INVALID_CUSTOMER_RESPONSE = :INVALID_CUSTOMER_RESPONSE + NETWORK_FAILURE = :NETWORK_FAILURE + GENERIC_DECLINE = :GENERIC_DECLINE + DIGITAL_CARD_ART_REQUIRED = :DIGITAL_CARD_ART_REQUIRED + + # @!method self.values + # @return [Array] + end + end + + class RequireTfaAction < Lithic::Internal::Type::BaseModel + # @!attribute type + # Require two-factor authentication for the tokenization request + # + # @return [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Type] + required :type, + enum: -> { Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Type } + + # @!attribute explanation + # Optional explanation for why this action was taken + # + # @return [String, nil] + optional :explanation, String + + # @!attribute reason + # Reason code for requiring two-factor authentication + # + # @return [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Reason, nil] + optional :reason, + enum: -> { Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Reason } + + # @!method initialize(type:, explanation: nil, reason: nil) + # @param type [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Type] Require two-factor authentication for the tokenization request + # + # @param explanation [String] Optional explanation for why this action was taken + # + # @param reason [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Reason] Reason code for requiring two-factor authentication + + # Require two-factor authentication for the tokenization request + # + # @see Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction#type + module Type + extend Lithic::Internal::Type::Enum + + REQUIRE_TFA = :REQUIRE_TFA + + # @!method self.values + # @return [Array] + end + + # Reason code for requiring two-factor authentication + # + # @see Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction#reason + module Reason + extend Lithic::Internal::Type::Enum + + WALLET_RECOMMENDED_TFA = :WALLET_RECOMMENDED_TFA + SUSPICIOUS_ACTIVITY = :SUSPICIOUS_ACTIVITY + DEVICE_RECENTLY_LOST = :DEVICE_RECENTLY_LOST + TOO_MANY_RECENT_ATTEMPTS = :TOO_MANY_RECENT_ATTEMPTS + TOO_MANY_RECENT_TOKENS = :TOO_MANY_RECENT_TOKENS + TOO_MANY_DIFFERENT_CARDHOLDERS = :TOO_MANY_DIFFERENT_CARDHOLDERS + OUTSIDE_HOME_TERRITORY = :OUTSIDE_HOME_TERRITORY + HAS_SUSPENDED_TOKENS = :HAS_SUSPENDED_TOKENS + HIGH_RISK = :HIGH_RISK + ACCOUNT_SCORE_LOW = :ACCOUNT_SCORE_LOW + DEVICE_SCORE_LOW = :DEVICE_SCORE_LOW + CARD_STATE_TFA = :CARD_STATE_TFA + HARDCODED_TFA = :HARDCODED_TFA + CUSTOMER_RULE_TFA = :CUSTOMER_RULE_TFA + DEVICE_HOST_CARD_EMULATION = :DEVICE_HOST_CARD_EMULATION + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization, Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction)] + end + + # The state of the Auth Rule + # + # @see Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult#mode + module Mode + extend Lithic::Internal::Type::Enum + + ACTIVE = :ACTIVE + INACTIVE = :INACTIVE + + # @!method self.values + # @return [Array] + end + end + + class ACHResult < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for the evaluation + # + # @return [String] + required :token, String + + # @!attribute actions + # Actions returned by the rule evaluation + # + # @return [Array] + required :actions, + -> { Lithic::Internal::Type::ArrayOf[union: Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action] } + + # @!attribute auth_rule_token + # The Auth Rule token + # + # @return [String] + required :auth_rule_token, String + + # @!attribute evaluation_time + # Timestamp of the rule evaluation + # + # @return [Time] + required :evaluation_time, Time + + # @!attribute event_stream + # The event stream during which the rule was evaluated + # + # @return [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::EventStream] + required :event_stream, + enum: -> { Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::EventStream } + + # @!attribute event_token + # Token of the event that triggered the evaluation + # + # @return [String] + required :event_token, String + + # @!attribute mode + # The state of the Auth Rule + # + # @return [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Mode] + required :mode, enum: -> { Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Mode } + + # @!attribute rule_version + # Version of the rule that was evaluated + # + # @return [Integer] + required :rule_version, Integer + + # @!attribute transaction_token + # The token of the transaction that triggered the rule evaluation + # + # @return [String, nil] + required :transaction_token, String, nil?: true + + # @!method initialize(token:, actions:, auth_rule_token:, evaluation_time:, event_stream:, event_token:, mode:, rule_version:, transaction_token:) + # @param token [String] Globally unique identifier for the evaluation + # + # @param actions [Array] Actions returned by the rule evaluation + # + # @param auth_rule_token [String] The Auth Rule token + # + # @param evaluation_time [Time] Timestamp of the rule evaluation + # + # @param event_stream [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::EventStream] The event stream during which the rule was evaluated + # + # @param event_token [String] Token of the event that triggered the evaluation + # + # @param mode [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Mode] The state of the Auth Rule + # + # @param rule_version [Integer] Version of the rule that was evaluated + # + # @param transaction_token [String, nil] The token of the transaction that triggered the rule evaluation + + module Action + extend Lithic::Internal::Type::Union + + variant -> { Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ApproveActionACH } + + variant -> { Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction } + + class ApproveActionACH < Lithic::Internal::Type::BaseModel + # @!attribute type + # Approve the ACH transaction + # + # @return [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ApproveActionACH::Type] + required :type, + enum: -> { Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ApproveActionACH::Type } + + # @!attribute explanation + # Optional explanation for why this action was taken + # + # @return [String, nil] + optional :explanation, String + + # @!method initialize(type:, explanation: nil) + # @param type [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ApproveActionACH::Type] Approve the ACH transaction + # + # @param explanation [String] Optional explanation for why this action was taken + + # Approve the ACH transaction + # + # @see Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ApproveActionACH#type + module Type + extend Lithic::Internal::Type::Enum + + APPROVE = :APPROVE + + # @!method self.values + # @return [Array] + end + end + + class ReturnAction < Lithic::Internal::Type::BaseModel + # @!attribute code + # NACHA return code to use when returning the transaction. Note that the list of + # available return codes is subject to an allowlist configured at the program + # level + # + # @return [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code] + required :code, + enum: -> { Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code } + + # @!attribute type + # Return the ACH transaction + # + # @return [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Type] + required :type, + enum: -> { Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Type } + + # @!attribute explanation + # Optional explanation for why this action was taken + # + # @return [String, nil] + optional :explanation, String + + # @!method initialize(code:, type:, explanation: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction} + # for more details. + # + # @param code [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code] NACHA return code to use when returning the transaction. Note that the list of a + # + # @param type [Symbol, Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Type] Return the ACH transaction + # + # @param explanation [String] Optional explanation for why this action was taken + + # NACHA return code to use when returning the transaction. Note that the list of + # available return codes is subject to an allowlist configured at the program + # level + # + # @see Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction#code + module Code + extend Lithic::Internal::Type::Enum + + R01 = :R01 + R02 = :R02 + R03 = :R03 + R04 = :R04 + R05 = :R05 + R06 = :R06 + R07 = :R07 + R08 = :R08 + R09 = :R09 + R10 = :R10 + R11 = :R11 + R12 = :R12 + R13 = :R13 + R14 = :R14 + R15 = :R15 + R16 = :R16 + R17 = :R17 + R18 = :R18 + R19 = :R19 + R20 = :R20 + R21 = :R21 + R22 = :R22 + R23 = :R23 + R24 = :R24 + R25 = :R25 + R26 = :R26 + R27 = :R27 + R28 = :R28 + R29 = :R29 + R30 = :R30 + R31 = :R31 + R32 = :R32 + R33 = :R33 + R34 = :R34 + R35 = :R35 + R36 = :R36 + R37 = :R37 + R38 = :R38 + R39 = :R39 + R40 = :R40 + R41 = :R41 + R42 = :R42 + R43 = :R43 + R44 = :R44 + R45 = :R45 + R46 = :R46 + R47 = :R47 + R50 = :R50 + R51 = :R51 + R52 = :R52 + R53 = :R53 + R61 = :R61 + R62 = :R62 + R67 = :R67 + R68 = :R68 + R69 = :R69 + R70 = :R70 + R71 = :R71 + R72 = :R72 + R73 = :R73 + R74 = :R74 + R75 = :R75 + R76 = :R76 + R77 = :R77 + R80 = :R80 + R81 = :R81 + R82 = :R82 + R83 = :R83 + R84 = :R84 + R85 = :R85 + + # @!method self.values + # @return [Array] + end + + # Return the ACH transaction + # + # @see Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction#type + module Type + extend Lithic::Internal::Type::Enum + + RETURN = :RETURN + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ApproveActionACH, Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction)] + end + + # The event stream during which the rule was evaluated + # + # @see Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult#event_stream + module EventStream + extend Lithic::Internal::Type::Enum + + ACH_CREDIT_RECEIPT = :ACH_CREDIT_RECEIPT + ACH_DEBIT_RECEIPT = :ACH_DEBIT_RECEIPT + + # @!method self.values + # @return [Array] + end + + # The state of the Auth Rule + # + # @see Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult#mode + module Mode + extend Lithic::Internal::Type::Enum + + ACTIVE = :ACTIVE + INACTIVE = :INACTIVE + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult, Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult, Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult, Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult)] + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_list_versions_params.rb b/lib/lithic/models/auth_rules/v2_list_versions_params.rb new file mode 100644 index 00000000..1047a2f7 --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_list_versions_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + # @see Lithic::Resources::AuthRules::V2#list_versions + class V2ListVersionsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute auth_rule_token + # + # @return [String] + required :auth_rule_token, String + + # @!method initialize(auth_rule_token:, request_options: {}) + # @param auth_rule_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_list_versions_response.rb b/lib/lithic/models/auth_rules/v2_list_versions_response.rb new file mode 100644 index 00000000..12deccd7 --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_list_versions_response.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + # @see Lithic::Resources::AuthRules::V2#list_versions + class V2ListVersionsResponse < Lithic::Internal::Type::BaseModel + # @!attribute data + # + # @return [Array] + required :data, -> { Lithic::Internal::Type::ArrayOf[Lithic::AuthRules::AuthRuleVersion] } + + # @!method initialize(data:) + # @param data [Array] + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_promote_params.rb b/lib/lithic/models/auth_rules/v2_promote_params.rb new file mode 100644 index 00000000..86f6bf46 --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_promote_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + # @see Lithic::Resources::AuthRules::V2#promote + class V2PromoteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute auth_rule_token + # + # @return [String] + required :auth_rule_token, String + + # @!method initialize(auth_rule_token:, request_options: {}) + # @param auth_rule_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_retrieve_features_params.rb b/lib/lithic/models/auth_rules/v2_retrieve_features_params.rb new file mode 100644 index 00000000..490d36c2 --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_retrieve_features_params.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + # @see Lithic::Resources::AuthRules::V2#retrieve_features + class V2RetrieveFeaturesParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute auth_rule_token + # + # @return [String] + required :auth_rule_token, String + + # @!attribute account_token + # + # @return [String, nil] + optional :account_token, String + + # @!attribute card_token + # + # @return [String, nil] + optional :card_token, String + + # @!method initialize(auth_rule_token:, account_token: nil, card_token: nil, request_options: {}) + # @param auth_rule_token [String] + # @param account_token [String] + # @param card_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_retrieve_features_response.rb b/lib/lithic/models/auth_rules/v2_retrieve_features_response.rb new file mode 100644 index 00000000..0b651932 --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_retrieve_features_response.rb @@ -0,0 +1,101 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + # @see Lithic::Resources::AuthRules::V2#retrieve_features + class V2RetrieveFeaturesResponse < Lithic::Internal::Type::BaseModel + # @!attribute evaluated + # Timestamp at which the Features were evaluated + # + # @return [Time] + required :evaluated, Time + + # @!attribute features + # Calculated Features used for evaluation of the provided Auth Rule + # + # @return [Array] + required :features, + -> { Lithic::Internal::Type::ArrayOf[Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature] } + + # @!method initialize(evaluated:, features:) + # @param evaluated [Time] Timestamp at which the Features were evaluated + # + # @param features [Array] Calculated Features used for evaluation of the provided Auth Rule + + class Feature < Lithic::Internal::Type::BaseModel + # @!attribute filters + # + # @return [Lithic::Models::AuthRules::VelocityLimitFilters] + required :filters, -> { Lithic::AuthRules::VelocityLimitFilters } + + # @!attribute period + # Velocity over the current day since 00:00 / 12 AM in Eastern Time + # + # @return [Lithic::Models::AuthRules::VelocityLimitPeriod::TrailingWindowObject, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowDay, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowWeek, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowMonth, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowYear] + required :period, union: -> { Lithic::AuthRules::VelocityLimitPeriod } + + # @!attribute scope + # The scope the velocity is calculated for + # + # @return [Symbol, Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Scope] + required :scope, enum: -> { Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Scope } + + # @!attribute value + # + # @return [Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Value] + required :value, -> { Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Value } + + # @!method initialize(filters:, period:, scope:, value:) + # @param filters [Lithic::Models::AuthRules::VelocityLimitFilters] + # + # @param period [Lithic::Models::AuthRules::VelocityLimitPeriod::TrailingWindowObject, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowDay, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowWeek, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowMonth, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowYear] Velocity over the current day since 00:00 / 12 AM in Eastern Time + # + # @param scope [Symbol, Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Scope] The scope the velocity is calculated for + # + # @param value [Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Value] + + # The scope the velocity is calculated for + # + # @see Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature#scope + module Scope + extend Lithic::Internal::Type::Enum + + CARD = :CARD + ACCOUNT = :ACCOUNT + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature#value + class Value < Lithic::Internal::Type::BaseModel + # @!attribute amount + # Amount (in cents) for the given Auth Rule that is used as input for calculating + # the rule. For Velocity Limit rules this would be the calculated Velocity. For + # Conditional Rules using CARD*TRANSACTION_COUNT*\* this will be 0 + # + # @return [Integer] + required :amount, Integer + + # @!attribute count + # Number of velocity impacting transactions matching the given scope, period and + # filters + # + # @return [Integer] + required :count, Integer + + # @!method initialize(amount:, count:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Value} for more + # details. + # + # @param amount [Integer] Amount (in cents) for the given Auth Rule that is used as input for calculating + # + # @param count [Integer] Number of velocity impacting transactions matching the given scope, period and f + end + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_retrieve_params.rb b/lib/lithic/models/auth_rules/v2_retrieve_params.rb new file mode 100644 index 00000000..fc1943c2 --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_retrieve_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + # @see Lithic::Resources::AuthRules::V2#retrieve + class V2RetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute auth_rule_token + # + # @return [String] + required :auth_rule_token, String + + # @!method initialize(auth_rule_token:, request_options: {}) + # @param auth_rule_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_retrieve_report_params.rb b/lib/lithic/models/auth_rules/v2_retrieve_report_params.rb new file mode 100644 index 00000000..d32236fb --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_retrieve_report_params.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + # @see Lithic::Resources::AuthRules::V2#retrieve_report + class V2RetrieveReportParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute auth_rule_token + # + # @return [String] + required :auth_rule_token, String + + # @!attribute begin_ + # Start date for the report + # + # @return [Date] + required :begin_, Date + + # @!attribute end_ + # End date for the report + # + # @return [Date] + required :end_, Date + + # @!method initialize(auth_rule_token:, begin_:, end_:, request_options: {}) + # @param auth_rule_token [String] + # + # @param begin_ [Date] Start date for the report + # + # @param end_ [Date] End date for the report + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_retrieve_report_response.rb b/lib/lithic/models/auth_rules/v2_retrieve_report_response.rb new file mode 100644 index 00000000..6fbe7f1e --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_retrieve_report_response.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + # @see Lithic::Resources::AuthRules::V2#retrieve_report + class V2RetrieveReportResponse < Lithic::Internal::Type::BaseModel + # @!attribute auth_rule_token + # Auth Rule Token + # + # @return [String] + required :auth_rule_token, String + + # @!attribute begin_ + # The start date (UTC) of the report. + # + # @return [Date] + required :begin_, Date, api_name: :begin + + # @!attribute daily_statistics + # Daily evaluation statistics for the Auth Rule. + # + # @return [Array] + required :daily_statistics, + -> { Lithic::Internal::Type::ArrayOf[Lithic::Models::AuthRules::V2RetrieveReportResponse::DailyStatistic] } + + # @!attribute end_ + # The end date (UTC) of the report. + # + # @return [Date] + required :end_, Date, api_name: :end + + # @!method initialize(auth_rule_token:, begin_:, daily_statistics:, end_:) + # @param auth_rule_token [String] Auth Rule Token + # + # @param begin_ [Date] The start date (UTC) of the report. + # + # @param daily_statistics [Array] Daily evaluation statistics for the Auth Rule. + # + # @param end_ [Date] The end date (UTC) of the report. + + class DailyStatistic < Lithic::Internal::Type::BaseModel + # @!attribute date + # The date (UTC) for which the statistics are reported. + # + # @return [Date] + required :date, Date + + # @!attribute versions + # Statistics for each version of the rule that was evaluated during the reported + # day. + # + # @return [Array] + required :versions, -> { Lithic::Internal::Type::ArrayOf[Lithic::AuthRules::ReportStats] } + + # @!method initialize(date:, versions:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::V2RetrieveReportResponse::DailyStatistic} for more + # details. + # + # @param date [Date] The date (UTC) for which the statistics are reported. + # + # @param versions [Array] Statistics for each version of the rule that was evaluated during the reported d + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/v2_update_params.rb b/lib/lithic/models/auth_rules/v2_update_params.rb new file mode 100644 index 00000000..3964f810 --- /dev/null +++ b/lib/lithic/models/auth_rules/v2_update_params.rb @@ -0,0 +1,226 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + # @see Lithic::Resources::AuthRules::V2#update + class V2UpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute auth_rule_token + # + # @return [String] + required :auth_rule_token, String + + # @!attribute body + # + # @return [Lithic::Models::AuthRules::V2UpdateParams::Body::AccountLevelRule, Lithic::Models::AuthRules::V2UpdateParams::Body::CardLevelRule, Lithic::Models::AuthRules::V2UpdateParams::Body::ProgramLevelRule] + required :body, union: -> { Lithic::AuthRules::V2UpdateParams::Body } + + # @!method initialize(auth_rule_token:, body:, request_options: {}) + # @param auth_rule_token [String] + # @param body [Lithic::Models::AuthRules::V2UpdateParams::Body::AccountLevelRule, Lithic::Models::AuthRules::V2UpdateParams::Body::CardLevelRule, Lithic::Models::AuthRules::V2UpdateParams::Body::ProgramLevelRule] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + module Body + extend Lithic::Internal::Type::Union + + variant -> { Lithic::AuthRules::V2UpdateParams::Body::AccountLevelRule } + + variant -> { Lithic::AuthRules::V2UpdateParams::Body::CardLevelRule } + + variant -> { Lithic::AuthRules::V2UpdateParams::Body::ProgramLevelRule } + + class AccountLevelRule < Lithic::Internal::Type::BaseModel + # @!attribute account_tokens + # Account tokens to which the Auth Rule applies. + # + # @return [Array, nil] + optional :account_tokens, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute business_account_tokens + # Business Account tokens to which the Auth Rule applies. + # + # @return [Array, nil] + optional :business_account_tokens, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute name + # Auth Rule Name + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute state + # The desired state of the Auth Rule. + # + # Note that only deactivating an Auth Rule through this endpoint is supported at + # this time. If you need to (re-)activate an Auth Rule the /promote endpoint + # should be used to promote a draft to the currently active version. + # + # @return [Symbol, Lithic::Models::AuthRules::V2UpdateParams::Body::AccountLevelRule::State, nil] + optional :state, enum: -> { Lithic::AuthRules::V2UpdateParams::Body::AccountLevelRule::State } + + # @!method initialize(account_tokens: nil, business_account_tokens: nil, name: nil, state: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::V2UpdateParams::Body::AccountLevelRule} for more + # details. + # + # @param account_tokens [Array] Account tokens to which the Auth Rule applies. + # + # @param business_account_tokens [Array] Business Account tokens to which the Auth Rule applies. + # + # @param name [String, nil] Auth Rule Name + # + # @param state [Symbol, Lithic::Models::AuthRules::V2UpdateParams::Body::AccountLevelRule::State] The desired state of the Auth Rule. + + # The desired state of the Auth Rule. + # + # Note that only deactivating an Auth Rule through this endpoint is supported at + # this time. If you need to (re-)activate an Auth Rule the /promote endpoint + # should be used to promote a draft to the currently active version. + # + # @see Lithic::Models::AuthRules::V2UpdateParams::Body::AccountLevelRule#state + module State + extend Lithic::Internal::Type::Enum + + INACTIVE = :INACTIVE + + # @!method self.values + # @return [Array] + end + end + + class CardLevelRule < Lithic::Internal::Type::BaseModel + # @!attribute card_tokens + # Card tokens to which the Auth Rule applies. + # + # @return [Array, nil] + optional :card_tokens, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute name + # Auth Rule Name + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute state + # The desired state of the Auth Rule. + # + # Note that only deactivating an Auth Rule through this endpoint is supported at + # this time. If you need to (re-)activate an Auth Rule the /promote endpoint + # should be used to promote a draft to the currently active version. + # + # @return [Symbol, Lithic::Models::AuthRules::V2UpdateParams::Body::CardLevelRule::State, nil] + optional :state, enum: -> { Lithic::AuthRules::V2UpdateParams::Body::CardLevelRule::State } + + # @!method initialize(card_tokens: nil, name: nil, state: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::V2UpdateParams::Body::CardLevelRule} for more + # details. + # + # @param card_tokens [Array] Card tokens to which the Auth Rule applies. + # + # @param name [String, nil] Auth Rule Name + # + # @param state [Symbol, Lithic::Models::AuthRules::V2UpdateParams::Body::CardLevelRule::State] The desired state of the Auth Rule. + + # The desired state of the Auth Rule. + # + # Note that only deactivating an Auth Rule through this endpoint is supported at + # this time. If you need to (re-)activate an Auth Rule the /promote endpoint + # should be used to promote a draft to the currently active version. + # + # @see Lithic::Models::AuthRules::V2UpdateParams::Body::CardLevelRule#state + module State + extend Lithic::Internal::Type::Enum + + INACTIVE = :INACTIVE + + # @!method self.values + # @return [Array] + end + end + + class ProgramLevelRule < Lithic::Internal::Type::BaseModel + # @!attribute excluded_account_tokens + # Account tokens to which the Auth Rule does not apply. + # + # @return [Array, nil] + optional :excluded_account_tokens, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute excluded_business_account_tokens + # Business account tokens to which the Auth Rule does not apply. + # + # @return [Array, nil] + optional :excluded_business_account_tokens, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute excluded_card_tokens + # Card tokens to which the Auth Rule does not apply. + # + # @return [Array, nil] + optional :excluded_card_tokens, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute name + # Auth Rule Name + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute program_level + # Whether the Auth Rule applies to all authorizations on the card program. + # + # @return [Boolean, nil] + optional :program_level, Lithic::Internal::Type::Boolean + + # @!attribute state + # The desired state of the Auth Rule. + # + # Note that only deactivating an Auth Rule through this endpoint is supported at + # this time. If you need to (re-)activate an Auth Rule the /promote endpoint + # should be used to promote a draft to the currently active version. + # + # @return [Symbol, Lithic::Models::AuthRules::V2UpdateParams::Body::ProgramLevelRule::State, nil] + optional :state, enum: -> { Lithic::AuthRules::V2UpdateParams::Body::ProgramLevelRule::State } + + # @!method initialize(excluded_account_tokens: nil, excluded_business_account_tokens: nil, excluded_card_tokens: nil, name: nil, program_level: nil, state: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::V2UpdateParams::Body::ProgramLevelRule} for more + # details. + # + # @param excluded_account_tokens [Array] Account tokens to which the Auth Rule does not apply. + # + # @param excluded_business_account_tokens [Array] Business account tokens to which the Auth Rule does not apply. + # + # @param excluded_card_tokens [Array] Card tokens to which the Auth Rule does not apply. + # + # @param name [String, nil] Auth Rule Name + # + # @param program_level [Boolean] Whether the Auth Rule applies to all authorizations on the card program. + # + # @param state [Symbol, Lithic::Models::AuthRules::V2UpdateParams::Body::ProgramLevelRule::State] The desired state of the Auth Rule. + + # The desired state of the Auth Rule. + # + # Note that only deactivating an Auth Rule through this endpoint is supported at + # this time. If you need to (re-)activate an Auth Rule the /promote endpoint + # should be used to promote a draft to the currently active version. + # + # @see Lithic::Models::AuthRules::V2UpdateParams::Body::ProgramLevelRule#state + module State + extend Lithic::Internal::Type::Enum + + INACTIVE = :INACTIVE + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(Lithic::Models::AuthRules::V2UpdateParams::Body::AccountLevelRule, Lithic::Models::AuthRules::V2UpdateParams::Body::CardLevelRule, Lithic::Models::AuthRules::V2UpdateParams::Body::ProgramLevelRule)] + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/velocity_limit_filters.rb b/lib/lithic/models/auth_rules/velocity_limit_filters.rb new file mode 100644 index 00000000..7966a44b --- /dev/null +++ b/lib/lithic/models/auth_rules/velocity_limit_filters.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class VelocityLimitFilters < Lithic::Internal::Type::BaseModel + # @!attribute exclude_countries + # ISO-3166-1 alpha-3 Country Codes to exclude from the velocity calculation. + # Transactions matching any of the provided will be excluded from the calculated + # velocity. + # + # @return [Array, nil] + optional :exclude_countries, Lithic::Internal::Type::ArrayOf[String], nil?: true + + # @!attribute exclude_mccs + # Merchant Category Codes to exclude from the velocity calculation. Transactions + # matching this MCC will be excluded from the calculated velocity. + # + # @return [Array, nil] + optional :exclude_mccs, Lithic::Internal::Type::ArrayOf[String], nil?: true + + # @!attribute include_countries + # ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. + # Transactions not matching any of the provided will not be included in the + # calculated velocity. + # + # @return [Array, nil] + optional :include_countries, Lithic::Internal::Type::ArrayOf[String], nil?: true + + # @!attribute include_mccs + # Merchant Category Codes to include in the velocity calculation. Transactions not + # matching this MCC will not be included in the calculated velocity. + # + # @return [Array, nil] + optional :include_mccs, Lithic::Internal::Type::ArrayOf[String], nil?: true + + # @!attribute include_pan_entry_modes + # PAN entry modes to include in the velocity calculation. Transactions not + # matching any of the provided will not be included in the calculated velocity. + # + # @return [Array, nil] + optional :include_pan_entry_modes, + -> { + Lithic::Internal::Type::ArrayOf[enum: Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode] + }, + nil?: true + + # @!method initialize(exclude_countries: nil, exclude_mccs: nil, include_countries: nil, include_mccs: nil, include_pan_entry_modes: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::VelocityLimitFilters} for more details. + # + # @param exclude_countries [Array, nil] ISO-3166-1 alpha-3 Country Codes to exclude from the velocity calculation. Trans + # + # @param exclude_mccs [Array, nil] Merchant Category Codes to exclude from the velocity calculation. Transactions m + # + # @param include_countries [Array, nil] ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. Transac + # + # @param include_mccs [Array, nil] Merchant Category Codes to include in the velocity calculation. Transactions not + # + # @param include_pan_entry_modes [Array, nil] PAN entry modes to include in the velocity calculation. Transactions not matchin + + module IncludePanEntryMode + extend Lithic::Internal::Type::Enum + + AUTO_ENTRY = :AUTO_ENTRY + BAR_CODE = :BAR_CODE + CONTACTLESS = :CONTACTLESS + CREDENTIAL_ON_FILE = :CREDENTIAL_ON_FILE + ECOMMERCE = :ECOMMERCE + ERROR_KEYED = :ERROR_KEYED + ERROR_MAGNETIC_STRIPE = :ERROR_MAGNETIC_STRIPE + ICC = :ICC + KEY_ENTERED = :KEY_ENTERED + MAGNETIC_STRIPE = :MAGNETIC_STRIPE + MANUAL = :MANUAL + OCR = :OCR + SECURE_CARDLESS = :SECURE_CARDLESS + UNSPECIFIED = :UNSPECIFIED + UNKNOWN = :UNKNOWN + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/velocity_limit_params.rb b/lib/lithic/models/auth_rules/velocity_limit_params.rb new file mode 100644 index 00000000..fab01fca --- /dev/null +++ b/lib/lithic/models/auth_rules/velocity_limit_params.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + class VelocityLimitParams < Lithic::Internal::Type::BaseModel + # @!attribute period + # Velocity over the current day since 00:00 / 12 AM in Eastern Time + # + # @return [Lithic::Models::AuthRules::VelocityLimitPeriod::TrailingWindowObject, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowDay, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowWeek, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowMonth, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowYear] + required :period, union: -> { Lithic::AuthRules::VelocityLimitPeriod } + + # @!attribute scope + # The scope the velocity is calculated for + # + # @return [Symbol, Lithic::Models::AuthRules::VelocityLimitParams::Scope] + required :scope, enum: -> { Lithic::AuthRules::VelocityLimitParams::Scope } + + # @!attribute filters + # + # @return [Lithic::Models::AuthRules::VelocityLimitFilters, nil] + optional :filters, -> { Lithic::AuthRules::VelocityLimitFilters } + + # @!attribute limit_amount + # The maximum amount of spend velocity allowed in the period in minor units (the + # smallest unit of a currency, e.g. cents for USD). Transactions exceeding this + # limit will be declined. + # + # @return [Integer, nil] + optional :limit_amount, Integer, nil?: true + + # @!attribute limit_count + # The number of spend velocity impacting transactions may not exceed this limit in + # the period. Transactions exceeding this limit will be declined. A spend velocity + # impacting transaction is a transaction that has been authorized, and optionally + # settled, or a force post (a transaction that settled without prior + # authorization). + # + # @return [Integer, nil] + optional :limit_count, Integer, nil?: true + + # @!method initialize(period:, scope:, filters: nil, limit_amount: nil, limit_count: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::VelocityLimitParams} for more details. + # + # @param period [Lithic::Models::AuthRules::VelocityLimitPeriod::TrailingWindowObject, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowDay, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowWeek, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowMonth, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowYear] Velocity over the current day since 00:00 / 12 AM in Eastern Time + # + # @param scope [Symbol, Lithic::Models::AuthRules::VelocityLimitParams::Scope] The scope the velocity is calculated for + # + # @param filters [Lithic::Models::AuthRules::VelocityLimitFilters] + # + # @param limit_amount [Integer, nil] The maximum amount of spend velocity allowed in the period in minor units (the s + # + # @param limit_count [Integer, nil] The number of spend velocity impacting transactions may not exceed this limit in + + # The scope the velocity is calculated for + # + # @see Lithic::Models::AuthRules::VelocityLimitParams#scope + module Scope + extend Lithic::Internal::Type::Enum + + CARD = :CARD + ACCOUNT = :ACCOUNT + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/auth_rules/velocity_limit_period.rb b/lib/lithic/models/auth_rules/velocity_limit_period.rb new file mode 100644 index 00000000..ce2811f8 --- /dev/null +++ b/lib/lithic/models/auth_rules/velocity_limit_period.rb @@ -0,0 +1,154 @@ +# frozen_string_literal: true + +module Lithic + module Models + module AuthRules + # Velocity over the current day since 00:00 / 12 AM in Eastern Time + module VelocityLimitPeriod + extend Lithic::Internal::Type::Union + + variant -> { Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject } + + # Velocity over the current day since 00:00 / 12 AM in Eastern Time + variant -> { Lithic::AuthRules::VelocityLimitPeriod::FixedWindowDay } + + # Velocity over the current week since 00:00 / 12 AM in Eastern Time on specified `day_of_week` + variant -> { Lithic::AuthRules::VelocityLimitPeriod::FixedWindowWeek } + + # Velocity over the current month since 00:00 / 12 AM in Eastern Time on specified `day_of_month`. + variant -> { Lithic::AuthRules::VelocityLimitPeriod::FixedWindowMonth } + + # Velocity over the current year since 00:00 / 12 AM in Eastern Time on specified `month` and `day_of_month`. This validates the month and day of the year to start from is a real date. In the event that February 29th is selected, in non-leap years, the window will start from February 28th. + variant -> { Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear } + + class TrailingWindowObject < Lithic::Internal::Type::BaseModel + # @!attribute duration + # The size of the trailing window to calculate Spend Velocity over in seconds. The + # minimum value is 10 seconds, and the maximum value is 2678400 seconds (31 days). + # + # @return [Integer] + required :duration, Integer + + # @!attribute type + # + # @return [Symbol, :CUSTOM] + required :type, const: :CUSTOM + + # @!method initialize(duration:, type: :CUSTOM) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::VelocityLimitPeriod::TrailingWindowObject} for more + # details. + # + # @param duration [Integer] The size of the trailing window to calculate Spend Velocity over in seconds. The + # + # @param type [Symbol, :CUSTOM] + end + + class FixedWindowDay < Lithic::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, :DAY] + required :type, const: :DAY + + # @!method initialize(type: :DAY) + # Velocity over the current day since 00:00 / 12 AM in Eastern Time + # + # @param type [Symbol, :DAY] + end + + class FixedWindowWeek < Lithic::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, :WEEK] + required :type, const: :WEEK + + # @!attribute day_of_week + # The day of the week to start the week from. Following ISO-8601, 1 is Monday and + # 7 is Sunday. Defaults to Monday if not specified. + # + # @return [Integer, nil] + optional :day_of_week, Integer + + # @!method initialize(day_of_week: nil, type: :WEEK) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowWeek} for more + # details. + # + # Velocity over the current week since 00:00 / 12 AM in Eastern Time on specified + # `day_of_week` + # + # @param day_of_week [Integer] The day of the week to start the week from. Following ISO-8601, 1 is Monday and + # + # @param type [Symbol, :WEEK] + end + + class FixedWindowMonth < Lithic::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, :MONTH] + required :type, const: :MONTH + + # @!attribute day_of_month + # The day of the month to start from. Accepts values from 1 to 31, and will reset + # at the end of the month if the day exceeds the number of days in the month. + # Defaults to the 1st of the month if not specified. + # + # @return [Integer, nil] + optional :day_of_month, Integer + + # @!method initialize(day_of_month: nil, type: :MONTH) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowMonth} for more + # details. + # + # Velocity over the current month since 00:00 / 12 AM in Eastern Time on specified + # `day_of_month`. + # + # @param day_of_month [Integer] The day of the month to start from. Accepts values from 1 to 31, and will reset + # + # @param type [Symbol, :MONTH] + end + + class FixedWindowYear < Lithic::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, :YEAR] + required :type, const: :YEAR + + # @!attribute day_of_month + # The day of the month to start from. Defaults to the 1st of the month if not + # specified. + # + # @return [Integer, nil] + optional :day_of_month, Integer + + # @!attribute month + # The month to start from. 1 is January and 12 is December. Defaults to January if + # not specified. + # + # @return [Integer, nil] + optional :month, Integer + + # @!method initialize(day_of_month: nil, month: nil, type: :YEAR) + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowYear} for more + # details. + # + # Velocity over the current year since 00:00 / 12 AM in Eastern Time on specified + # `month` and `day_of_month`. This validates the month and day of the year to + # start from is a real date. In the event that February 29th is selected, in + # non-leap years, the window will start from February 28th. + # + # @param day_of_month [Integer] The day of the month to start from. Defaults to the 1st of the month if not spec + # + # @param month [Integer] The month to start from. 1 is January and 12 is December. Defaults to January if + # + # @param type [Symbol, :YEAR] + end + + # @!method self.variants + # @return [Array(Lithic::Models::AuthRules::VelocityLimitPeriod::TrailingWindowObject, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowDay, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowWeek, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowMonth, Lithic::Models::AuthRules::VelocityLimitPeriod::FixedWindowYear)] + end + end + end +end diff --git a/lib/lithic/models/auth_rules_backtest_report_created_webhook_event.rb b/lib/lithic/models/auth_rules_backtest_report_created_webhook_event.rb new file mode 100644 index 00000000..7d203e6e --- /dev/null +++ b/lib/lithic/models/auth_rules_backtest_report_created_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class AuthRulesBacktestReportCreatedWebhookEvent < Lithic::Models::AuthRules::V2::BacktestResults + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"auth_rules.backtest_report.created"] + required :event_type, const: :"auth_rules.backtest_report.created" + + # @!method initialize(event_type: :"auth_rules.backtest_report.created") + # @param event_type [Symbol, :"auth_rules.backtest_report.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/auth_stream_enrollment_retrieve_secret_params.rb b/lib/lithic/models/auth_stream_enrollment_retrieve_secret_params.rb new file mode 100644 index 00000000..e59ca0bf --- /dev/null +++ b/lib/lithic/models/auth_stream_enrollment_retrieve_secret_params.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::AuthStreamEnrollment#retrieve_secret + class AuthStreamEnrollmentRetrieveSecretParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/auth_stream_enrollment_rotate_secret_params.rb b/lib/lithic/models/auth_stream_enrollment_rotate_secret_params.rb new file mode 100644 index 00000000..198f7a8a --- /dev/null +++ b/lib/lithic/models/auth_stream_enrollment_rotate_secret_params.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::AuthStreamEnrollment#rotate_secret + class AuthStreamEnrollmentRotateSecretParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/auth_stream_secret.rb b/lib/lithic/models/auth_stream_secret.rb new file mode 100644 index 00000000..7ca514c1 --- /dev/null +++ b/lib/lithic/models/auth_stream_secret.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::AuthStreamEnrollment#retrieve_secret + class AuthStreamSecret < Lithic::Internal::Type::BaseModel + # @!attribute secret + # The shared HMAC ASA secret + # + # @return [String, nil] + optional :secret, String + + # @!method initialize(secret: nil) + # @param secret [String] The shared HMAC ASA secret + end + end +end diff --git a/lib/lithic/models/balance.rb b/lib/lithic/models/balance.rb new file mode 100644 index 00000000..ce561c2c --- /dev/null +++ b/lib/lithic/models/balance.rb @@ -0,0 +1,115 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Balances#list + class Balance < Lithic::Internal::Type::BaseModel + # @!attribute available_amount + # Funds available for spend in the currency's smallest unit (e.g., cents for USD) + # + # @return [Integer] + required :available_amount, Integer + + # @!attribute created + # Date and time for when the balance was first created. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # 3-character alphabetic ISO 4217 code for the local currency of the balance. + # + # @return [String] + required :currency, String + + # @!attribute financial_account_token + # Globally unique identifier for the financial account that holds this balance. + # + # @return [String] + required :financial_account_token, String + + # @!attribute financial_account_type + # Type of financial account. + # + # @return [Symbol, Lithic::Models::Balance::FinancialAccountType] + required :financial_account_type, enum: -> { Lithic::Balance::FinancialAccountType } + + # @!attribute last_transaction_event_token + # Globally unique identifier for the last financial transaction event that + # impacted this balance. + # + # @return [String, nil] + required :last_transaction_event_token, String, nil?: true + + # @!attribute last_transaction_token + # Globally unique identifier for the last financial transaction that impacted this + # balance. + # + # @return [String, nil] + required :last_transaction_token, String, nil?: true + + # @!attribute pending_amount + # Funds not available for spend due to card authorizations or pending ACH release. + # Shown in the currency's smallest unit (e.g., cents for USD). + # + # @return [Integer] + required :pending_amount, Integer + + # @!attribute total_amount + # The sum of available and pending balance in the currency's smallest unit (e.g., + # cents for USD). + # + # @return [Integer] + required :total_amount, Integer + + # @!attribute updated + # Date and time for when the balance was last updated. + # + # @return [Time] + required :updated, Time + + # @!method initialize(available_amount:, created:, currency:, financial_account_token:, financial_account_type:, last_transaction_event_token:, last_transaction_token:, pending_amount:, total_amount:, updated:) + # Some parameter documentations has been truncated, see {Lithic::Models::Balance} + # for more details. + # + # Balance + # + # @param available_amount [Integer] Funds available for spend in the currency's smallest unit (e.g., cents for USD) + # + # @param created [Time] Date and time for when the balance was first created. + # + # @param currency [String] 3-character alphabetic ISO 4217 code for the local currency of the balance. + # + # @param financial_account_token [String] Globally unique identifier for the financial account that holds this balance. + # + # @param financial_account_type [Symbol, Lithic::Models::Balance::FinancialAccountType] Type of financial account. + # + # @param last_transaction_event_token [String, nil] Globally unique identifier for the last financial transaction event that impacte + # + # @param last_transaction_token [String, nil] Globally unique identifier for the last financial transaction that impacted this + # + # @param pending_amount [Integer] Funds not available for spend due to card authorizations or pending ACH release. + # + # @param total_amount [Integer] The sum of available and pending balance in the currency's smallest unit (e.g., + # + # @param updated [Time] Date and time for when the balance was last updated. + + # Type of financial account. + # + # @see Lithic::Models::Balance#financial_account_type + module FinancialAccountType + extend Lithic::Internal::Type::Enum + + CARD = :CARD + ISSUING = :ISSUING + OPERATING = :OPERATING + PROGRAM_RECEIVABLES = :PROGRAM_RECEIVABLES + RESERVE = :RESERVE + SECURITY = :SECURITY + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/balance_list_params.rb b/lib/lithic/models/balance_list_params.rb new file mode 100644 index 00000000..e8b727eb --- /dev/null +++ b/lib/lithic/models/balance_list_params.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Balances#list + class BalanceListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute account_token + # List balances for all financial accounts of a given account_token. + # + # @return [String, nil] + optional :account_token, String + + # @!attribute balance_date + # UTC date and time of the balances to retrieve. Defaults to latest available + # balances + # + # @return [Time, nil] + optional :balance_date, Time + + # @!attribute business_account_token + # List balances for all financial accounts of a given business_account_token. + # + # @return [String, nil] + optional :business_account_token, String + + # @!attribute financial_account_type + # List balances for a given Financial Account type. + # + # @return [Symbol, Lithic::Models::BalanceListParams::FinancialAccountType, nil] + optional :financial_account_type, enum: -> { Lithic::BalanceListParams::FinancialAccountType } + + # @!method initialize(account_token: nil, balance_date: nil, business_account_token: nil, financial_account_type: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::BalanceListParams} for more details. + # + # @param account_token [String] List balances for all financial accounts of a given account_token. + # + # @param balance_date [Time] UTC date and time of the balances to retrieve. Defaults to latest available bala + # + # @param business_account_token [String] List balances for all financial accounts of a given business_account_token. + # + # @param financial_account_type [Symbol, Lithic::Models::BalanceListParams::FinancialAccountType] List balances for a given Financial Account type. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # List balances for a given Financial Account type. + module FinancialAccountType + extend Lithic::Internal::Type::Enum + + ISSUING = :ISSUING + OPERATING = :OPERATING + RESERVE = :RESERVE + SECURITY = :SECURITY + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/balance_updated_webhook_event.rb b/lib/lithic/models/balance_updated_webhook_event.rb new file mode 100644 index 00000000..b6ad7255 --- /dev/null +++ b/lib/lithic/models/balance_updated_webhook_event.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Lithic + module Models + class BalanceUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute data + # + # @return [Array] + required :data, -> { Lithic::Internal::Type::ArrayOf[Lithic::FinancialAccountBalance] } + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"balance.updated"] + required :event_type, const: :"balance.updated" + + # @!method initialize(data:, event_type: :"balance.updated") + # @param data [Array] + # + # @param event_type [Symbol, :"balance.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/book_transfer_create_params.rb b/lib/lithic/models/book_transfer_create_params.rb new file mode 100644 index 00000000..529d2a34 --- /dev/null +++ b/lib/lithic/models/book_transfer_create_params.rb @@ -0,0 +1,180 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::BookTransfers#create + class BookTransferCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute amount + # Amount to be transferred in the currency's smallest unit (e.g., cents for USD). + # This should always be a positive value. + # + # @return [Integer] + required :amount, Integer + + # @!attribute category + # + # @return [Symbol, Lithic::Models::BookTransferCreateParams::Category] + required :category, enum: -> { Lithic::BookTransferCreateParams::Category } + + # @!attribute from_financial_account_token + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + # + # @return [String] + required :from_financial_account_token, String + + # @!attribute subtype + # The program specific subtype code for the specified category/type. + # + # @return [String] + required :subtype, String + + # @!attribute to_financial_account_token + # Globally unique identifier for the financial account or card that will receive + # the funds. Accepted type dependent on the program's use case. + # + # @return [String] + required :to_financial_account_token, String + + # @!attribute type + # Type of the book transfer + # + # @return [Symbol, Lithic::Models::BookTransferCreateParams::Type] + required :type, enum: -> { Lithic::BookTransferCreateParams::Type } + + # @!attribute token + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + # + # @return [String, nil] + optional :token, String + + # @!attribute external_id + # External ID defined by the customer + # + # @return [String, nil] + optional :external_id, String + + # @!attribute hold_token + # Token of an existing hold to settle when this transfer is initiated + # + # @return [String, nil] + optional :hold_token, String + + # @!attribute memo + # Optional descriptor for the transfer. + # + # @return [String, nil] + optional :memo, String + + # @!attribute on_closed_account + # What to do if the financial account is closed when posting an operation + # + # @return [Symbol, Lithic::Models::BookTransferCreateParams::OnClosedAccount, nil] + optional :on_closed_account, enum: -> { Lithic::BookTransferCreateParams::OnClosedAccount } + + # @!method initialize(amount:, category:, from_financial_account_token:, subtype:, to_financial_account_token:, type:, token: nil, external_id: nil, hold_token: nil, memo: nil, on_closed_account: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::BookTransferCreateParams} for more details. + # + # @param amount [Integer] Amount to be transferred in the currency's smallest unit (e.g., cents for USD). + # + # @param category [Symbol, Lithic::Models::BookTransferCreateParams::Category] + # + # @param from_financial_account_token [String] Globally unique identifier for the financial account or card that will send the + # + # @param subtype [String] The program specific subtype code for the specified category/type. + # + # @param to_financial_account_token [String] Globally unique identifier for the financial account or card that will receive t + # + # @param type [Symbol, Lithic::Models::BookTransferCreateParams::Type] Type of the book transfer + # + # @param token [String] Customer-provided token that will serve as an idempotency token. This token will + # + # @param external_id [String] External ID defined by the customer + # + # @param hold_token [String] Token of an existing hold to settle when this transfer is initiated + # + # @param memo [String] Optional descriptor for the transfer. + # + # @param on_closed_account [Symbol, Lithic::Models::BookTransferCreateParams::OnClosedAccount] What to do if the financial account is closed when posting an operation + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + module Category + extend Lithic::Internal::Type::Enum + + ADJUSTMENT = :ADJUSTMENT + BALANCE_OR_FUNDING = :BALANCE_OR_FUNDING + DERECOGNITION = :DERECOGNITION + DISPUTE = :DISPUTE + FEE = :FEE + INTERNAL = :INTERNAL + REWARD = :REWARD + PROGRAM_FUNDING = :PROGRAM_FUNDING + TRANSFER = :TRANSFER + + # @!method self.values + # @return [Array] + end + + # Type of the book transfer + module Type + extend Lithic::Internal::Type::Enum + + ATM_BALANCE_INQUIRY = :ATM_BALANCE_INQUIRY + ATM_WITHDRAWAL = :ATM_WITHDRAWAL + ATM_DECLINE = :ATM_DECLINE + INTERNATIONAL_ATM_WITHDRAWAL = :INTERNATIONAL_ATM_WITHDRAWAL + INACTIVITY = :INACTIVITY + STATEMENT = :STATEMENT + MONTHLY = :MONTHLY + QUARTERLY = :QUARTERLY + ANNUAL = :ANNUAL + CUSTOMER_SERVICE = :CUSTOMER_SERVICE + ACCOUNT_MAINTENANCE = :ACCOUNT_MAINTENANCE + ACCOUNT_ACTIVATION = :ACCOUNT_ACTIVATION + ACCOUNT_CLOSURE = :ACCOUNT_CLOSURE + CARD_REPLACEMENT = :CARD_REPLACEMENT + CARD_DELIVERY = :CARD_DELIVERY + CARD_CREATE = :CARD_CREATE + CURRENCY_CONVERSION = :CURRENCY_CONVERSION + INTEREST = :INTEREST + LATE_PAYMENT = :LATE_PAYMENT + BILL_PAYMENT = :BILL_PAYMENT + CASH_BACK = :CASH_BACK + ACCOUNT_TO_ACCOUNT = :ACCOUNT_TO_ACCOUNT + CARD_TO_CARD = :CARD_TO_CARD + DISBURSE = :DISBURSE + BILLING_ERROR = :BILLING_ERROR + LOSS_WRITE_OFF = :LOSS_WRITE_OFF + EXPIRED_CARD = :EXPIRED_CARD + EARLY_DERECOGNITION = :EARLY_DERECOGNITION + ESCHEATMENT = :ESCHEATMENT + INACTIVITY_FEE_DOWN = :INACTIVITY_FEE_DOWN + PROVISIONAL_CREDIT = :PROVISIONAL_CREDIT + DISPUTE_WON = :DISPUTE_WON + SERVICE = :SERVICE + TRANSFER = :TRANSFER + COLLECTION = :COLLECTION + + # @!method self.values + # @return [Array] + end + + # What to do if the financial account is closed when posting an operation + module OnClosedAccount + extend Lithic::Internal::Type::Enum + + FAIL = :FAIL + USE_SUSPENSE = :USE_SUSPENSE + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/book_transfer_list_params.rb b/lib/lithic/models/book_transfer_list_params.rb new file mode 100644 index 00000000..770e78ac --- /dev/null +++ b/lib/lithic/models/book_transfer_list_params.rb @@ -0,0 +1,148 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::BookTransfers#list + class BookTransferListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute account_token + # + # @return [String, nil] + optional :account_token, String + + # @!attribute begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time + + # @!attribute business_account_token + # + # @return [String, nil] + optional :business_account_token, String + + # @!attribute category + # Book Transfer category to be returned. + # + # @return [Symbol, Lithic::Models::BookTransferListParams::Category, nil] + optional :category, enum: -> { Lithic::BookTransferListParams::Category } + + # @!attribute end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute financial_account_token + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + # + # @return [String, nil] + optional :financial_account_token, String + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute result + # Book transfer result to be returned. + # + # @return [Symbol, Lithic::Models::BookTransferListParams::Result, nil] + optional :result, enum: -> { Lithic::BookTransferListParams::Result } + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!attribute status + # Book transfer status to be returned. + # + # @return [Symbol, Lithic::Models::BookTransferListParams::Status, nil] + optional :status, enum: -> { Lithic::BookTransferListParams::Status } + + # @!method initialize(account_token: nil, begin_: nil, business_account_token: nil, category: nil, end_: nil, ending_before: nil, financial_account_token: nil, page_size: nil, result: nil, starting_after: nil, status: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::BookTransferListParams} for more details. + # + # @param account_token [String] + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param business_account_token [String] + # + # @param category [Symbol, Lithic::Models::BookTransferListParams::Category] Book Transfer category to be returned. + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param financial_account_token [String] Globally unique identifier for the financial account or card that will send the + # + # @param page_size [Integer] Page size (for pagination). + # + # @param result [Symbol, Lithic::Models::BookTransferListParams::Result] Book transfer result to be returned. + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param status [Symbol, Lithic::Models::BookTransferListParams::Status] Book transfer status to be returned. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Book Transfer category to be returned. + module Category + extend Lithic::Internal::Type::Enum + + ADJUSTMENT = :ADJUSTMENT + BALANCE_OR_FUNDING = :BALANCE_OR_FUNDING + DERECOGNITION = :DERECOGNITION + DISPUTE = :DISPUTE + FEE = :FEE + INTERNAL = :INTERNAL + REWARD = :REWARD + PROGRAM_FUNDING = :PROGRAM_FUNDING + TRANSFER = :TRANSFER + + # @!method self.values + # @return [Array] + end + + # Book transfer result to be returned. + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + + # Book transfer status to be returned. + module Status + extend Lithic::Internal::Type::Enum + + DECLINED = :DECLINED + SETTLED = :SETTLED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/book_transfer_response.rb b/lib/lithic/models/book_transfer_response.rb new file mode 100644 index 00000000..3059d390 --- /dev/null +++ b/lib/lithic/models/book_transfer_response.rb @@ -0,0 +1,363 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::BookTransfers#create + class BookTransferResponse < Lithic::Internal::Type::BaseModel + # @!attribute token + # Unique identifier for the transaction + # + # @return [String] + required :token, String + + # @!attribute category + # + # @return [Symbol, Lithic::Models::BookTransferResponse::Category] + required :category, enum: -> { Lithic::BookTransferResponse::Category } + + # @!attribute created + # ISO 8601 timestamp of when the transaction was created + # + # @return [Time] + required :created, Time + + # @!attribute currency + # 3-character alphabetic ISO 4217 code for the settling currency of the + # transaction + # + # @return [String] + required :currency, String + + # @!attribute events + # A list of all financial events that have modified this transfer + # + # @return [Array] + required :events, -> { Lithic::Internal::Type::ArrayOf[Lithic::BookTransferResponse::Event] } + + # @!attribute family + # TRANSFER - Book Transfer Transaction + # + # @return [Symbol, :TRANSFER] + required :family, const: :TRANSFER + + # @!attribute from_financial_account_token + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case + # + # @return [String] + required :from_financial_account_token, String + + # @!attribute pending_amount + # Pending amount of the transaction in the currency's smallest unit (e.g., cents), + # including any acquirer fees. + # + # The value of this field will go to zero over time once the financial transaction + # is settled. + # + # @return [Integer] + required :pending_amount, Integer + + # @!attribute result + # + # @return [Symbol, Lithic::Models::BookTransferResponse::Result] + required :result, enum: -> { Lithic::BookTransferResponse::Result } + + # @!attribute settled_amount + # Amount of the transaction that has been settled in the currency's smallest unit + # (e.g., cents) + # + # @return [Integer] + required :settled_amount, Integer + + # @!attribute status + # The status of the transaction + # + # @return [Symbol, Lithic::Models::BookTransferResponse::Status] + required :status, enum: -> { Lithic::BookTransferResponse::Status } + + # @!attribute to_financial_account_token + # Globally unique identifier for the financial account or card that will receive + # the funds. Accepted type dependent on the program's use case + # + # @return [String] + required :to_financial_account_token, String + + # @!attribute updated + # ISO 8601 timestamp of when the transaction was last updated + # + # @return [Time] + required :updated, Time + + # @!attribute external_id + # External ID defined by the customer + # + # @return [String, nil] + optional :external_id, String, nil?: true + + # @!attribute external_resource + # External resource associated with the management operation + # + # @return [Lithic::Models::ExternalResource, nil] + optional :external_resource, -> { Lithic::ExternalResource }, nil?: true + + # @!attribute transaction_series + # A series of transactions that are grouped together + # + # @return [Lithic::Models::BookTransferResponse::TransactionSeries, nil] + optional :transaction_series, -> { Lithic::BookTransferResponse::TransactionSeries }, nil?: true + + # @!method initialize(token:, category:, created:, currency:, events:, from_financial_account_token:, pending_amount:, result:, settled_amount:, status:, to_financial_account_token:, updated:, external_id: nil, external_resource: nil, transaction_series: nil, family: :TRANSFER) + # Some parameter documentations has been truncated, see + # {Lithic::Models::BookTransferResponse} for more details. + # + # Book transfer transaction + # + # @param token [String] Unique identifier for the transaction + # + # @param category [Symbol, Lithic::Models::BookTransferResponse::Category] + # + # @param created [Time] ISO 8601 timestamp of when the transaction was created + # + # @param currency [String] 3-character alphabetic ISO 4217 code for the settling currency of the transactio + # + # @param events [Array] A list of all financial events that have modified this transfer + # + # @param from_financial_account_token [String] Globally unique identifier for the financial account or card that will send the + # + # @param pending_amount [Integer] Pending amount of the transaction in the currency's smallest unit (e.g., cents), + # + # @param result [Symbol, Lithic::Models::BookTransferResponse::Result] + # + # @param settled_amount [Integer] Amount of the transaction that has been settled in the currency's smallest unit + # + # @param status [Symbol, Lithic::Models::BookTransferResponse::Status] The status of the transaction + # + # @param to_financial_account_token [String] Globally unique identifier for the financial account or card that will receive t + # + # @param updated [Time] ISO 8601 timestamp of when the transaction was last updated + # + # @param external_id [String, nil] External ID defined by the customer + # + # @param external_resource [Lithic::Models::ExternalResource, nil] External resource associated with the management operation + # + # @param transaction_series [Lithic::Models::BookTransferResponse::TransactionSeries, nil] A series of transactions that are grouped together + # + # @param family [Symbol, :TRANSFER] TRANSFER - Book Transfer Transaction + + # @see Lithic::Models::BookTransferResponse#category + module Category + extend Lithic::Internal::Type::Enum + + ADJUSTMENT = :ADJUSTMENT + BALANCE_OR_FUNDING = :BALANCE_OR_FUNDING + DERECOGNITION = :DERECOGNITION + DISPUTE = :DISPUTE + FEE = :FEE + INTERNAL = :INTERNAL + REWARD = :REWARD + PROGRAM_FUNDING = :PROGRAM_FUNDING + TRANSFER = :TRANSFER + + # @!method self.values + # @return [Array] + end + + class Event < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier. + # + # @return [String] + required :token, String + + # @!attribute amount + # Amount of the financial event that has been settled in the currency's smallest + # unit (e.g., cents). + # + # @return [Integer] + required :amount, Integer + + # @!attribute created + # Date and time when the financial event occurred. UTC time zone. + # + # @return [Time] + required :created, Time + + # @!attribute detailed_results + # + # @return [Array] + required :detailed_results, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::BookTransferResponse::Event::DetailedResult] } + + # @!attribute memo + # Memo for the transfer. + # + # @return [String] + required :memo, String + + # @!attribute result + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + # + # @return [Symbol, Lithic::Models::BookTransferResponse::Event::Result] + required :result, enum: -> { Lithic::BookTransferResponse::Event::Result } + + # @!attribute subtype + # The program specific subtype code for the specified category/type. + # + # @return [String] + required :subtype, String + + # @!attribute type + # Type of the book transfer + # + # @return [Symbol, Lithic::Models::BookTransferResponse::Event::Type] + required :type, enum: -> { Lithic::BookTransferResponse::Event::Type } + + # @!method initialize(token:, amount:, created:, detailed_results:, memo:, result:, subtype:, type:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::BookTransferResponse::Event} for more details. + # + # Book transfer Event + # + # @param token [String] Globally unique identifier. + # + # @param amount [Integer] Amount of the financial event that has been settled in the currency's smallest u + # + # @param created [Time] Date and time when the financial event occurred. UTC time zone. + # + # @param detailed_results [Array] + # + # @param memo [String] Memo for the transfer. + # + # @param result [Symbol, Lithic::Models::BookTransferResponse::Event::Result] APPROVED financial events were successful while DECLINED financial events were d + # + # @param subtype [String] The program specific subtype code for the specified category/type. + # + # @param type [Symbol, Lithic::Models::BookTransferResponse::Event::Type] Type of the book transfer + + module DetailedResult + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + FUNDS_INSUFFICIENT = :FUNDS_INSUFFICIENT + + # @!method self.values + # @return [Array] + end + + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + # + # @see Lithic::Models::BookTransferResponse::Event#result + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + + # Type of the book transfer + # + # @see Lithic::Models::BookTransferResponse::Event#type + module Type + extend Lithic::Internal::Type::Enum + + ATM_BALANCE_INQUIRY = :ATM_BALANCE_INQUIRY + ATM_WITHDRAWAL = :ATM_WITHDRAWAL + ATM_DECLINE = :ATM_DECLINE + INTERNATIONAL_ATM_WITHDRAWAL = :INTERNATIONAL_ATM_WITHDRAWAL + INACTIVITY = :INACTIVITY + STATEMENT = :STATEMENT + MONTHLY = :MONTHLY + QUARTERLY = :QUARTERLY + ANNUAL = :ANNUAL + CUSTOMER_SERVICE = :CUSTOMER_SERVICE + ACCOUNT_MAINTENANCE = :ACCOUNT_MAINTENANCE + ACCOUNT_ACTIVATION = :ACCOUNT_ACTIVATION + ACCOUNT_CLOSURE = :ACCOUNT_CLOSURE + CARD_REPLACEMENT = :CARD_REPLACEMENT + CARD_DELIVERY = :CARD_DELIVERY + CARD_CREATE = :CARD_CREATE + CURRENCY_CONVERSION = :CURRENCY_CONVERSION + INTEREST = :INTEREST + LATE_PAYMENT = :LATE_PAYMENT + BILL_PAYMENT = :BILL_PAYMENT + CASH_BACK = :CASH_BACK + ACCOUNT_TO_ACCOUNT = :ACCOUNT_TO_ACCOUNT + CARD_TO_CARD = :CARD_TO_CARD + DISBURSE = :DISBURSE + BILLING_ERROR = :BILLING_ERROR + LOSS_WRITE_OFF = :LOSS_WRITE_OFF + EXPIRED_CARD = :EXPIRED_CARD + EARLY_DERECOGNITION = :EARLY_DERECOGNITION + ESCHEATMENT = :ESCHEATMENT + INACTIVITY_FEE_DOWN = :INACTIVITY_FEE_DOWN + PROVISIONAL_CREDIT = :PROVISIONAL_CREDIT + DISPUTE_WON = :DISPUTE_WON + SERVICE = :SERVICE + TRANSFER = :TRANSFER + COLLECTION = :COLLECTION + + # @!method self.values + # @return [Array] + end + end + + # @see Lithic::Models::BookTransferResponse#result + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + + # The status of the transaction + # + # @see Lithic::Models::BookTransferResponse#status + module Status + extend Lithic::Internal::Type::Enum + + PENDING = :PENDING + SETTLED = :SETTLED + DECLINED = :DECLINED + REVERSED = :REVERSED + CANCELED = :CANCELED + RETURNED = :RETURNED + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::BookTransferResponse#transaction_series + class TransactionSeries < Lithic::Internal::Type::BaseModel + # @!attribute related_transaction_event_token + # + # @return [String, nil] + required :related_transaction_event_token, String, nil?: true + + # @!attribute related_transaction_token + # + # @return [String, nil] + required :related_transaction_token, String, nil?: true + + # @!attribute type + # + # @return [String] + required :type, String + + # @!method initialize(related_transaction_event_token:, related_transaction_token:, type:) + # A series of transactions that are grouped together + # + # @param related_transaction_event_token [String, nil] + # @param related_transaction_token [String, nil] + # @param type [String] + end + end + end +end diff --git a/lib/lithic/models/book_transfer_retrieve_params.rb b/lib/lithic/models/book_transfer_retrieve_params.rb new file mode 100644 index 00000000..ddd26e57 --- /dev/null +++ b/lib/lithic/models/book_transfer_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::BookTransfers#retrieve + class BookTransferRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute book_transfer_token + # + # @return [String] + required :book_transfer_token, String + + # @!method initialize(book_transfer_token:, request_options: {}) + # @param book_transfer_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/book_transfer_retry_params.rb b/lib/lithic/models/book_transfer_retry_params.rb new file mode 100644 index 00000000..ff195831 --- /dev/null +++ b/lib/lithic/models/book_transfer_retry_params.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::BookTransfers#retry_ + class BookTransferRetryParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute book_transfer_token + # + # @return [String] + required :book_transfer_token, String + + # @!attribute retry_token + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + # + # @return [String] + required :retry_token, String + + # @!method initialize(book_transfer_token:, retry_token:, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::BookTransferRetryParams} for more details. + # + # @param book_transfer_token [String] + # + # @param retry_token [String] Customer-provided token that will serve as an idempotency token. This token will + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/book_transfer_reverse_params.rb b/lib/lithic/models/book_transfer_reverse_params.rb new file mode 100644 index 00000000..02b4b543 --- /dev/null +++ b/lib/lithic/models/book_transfer_reverse_params.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::BookTransfers#reverse + class BookTransferReverseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute book_transfer_token + # + # @return [String] + required :book_transfer_token, String + + # @!attribute memo + # Optional descriptor for the reversal. + # + # @return [String, nil] + optional :memo, String + + # @!method initialize(book_transfer_token:, memo: nil, request_options: {}) + # @param book_transfer_token [String] + # + # @param memo [String] Optional descriptor for the reversal. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/book_transfer_transaction_created_webhook_event.rb b/lib/lithic/models/book_transfer_transaction_created_webhook_event.rb new file mode 100644 index 00000000..09b7bf67 --- /dev/null +++ b/lib/lithic/models/book_transfer_transaction_created_webhook_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class BookTransferTransactionCreatedWebhookEvent < Lithic::Models::BookTransferResponse + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"book_transfer_transaction.created"] + required :event_type, const: :"book_transfer_transaction.created" + + # @!method initialize(event_type: :"book_transfer_transaction.created") + # Book transfer transaction + # + # @param event_type [Symbol, :"book_transfer_transaction.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/book_transfer_transaction_updated_webhook_event.rb b/lib/lithic/models/book_transfer_transaction_updated_webhook_event.rb new file mode 100644 index 00000000..2e51f986 --- /dev/null +++ b/lib/lithic/models/book_transfer_transaction_updated_webhook_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class BookTransferTransactionUpdatedWebhookEvent < Lithic::Models::BookTransferResponse + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"book_transfer_transaction.updated"] + required :event_type, const: :"book_transfer_transaction.updated" + + # @!method initialize(event_type: :"book_transfer_transaction.updated") + # Book transfer transaction + # + # @param event_type [Symbol, :"book_transfer_transaction.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/card.rb b/lib/lithic/models/card.rb new file mode 100644 index 00000000..cf117a9b --- /dev/null +++ b/lib/lithic/models/card.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Cards#create + class Card < Lithic::Models::NonPCICard + # @!attribute cvv + # Three digit cvv printed on the back of the card. + # + # @return [String, nil] + optional :cvv, String + + # @!attribute pan + # Primary Account Number (PAN) (i.e. the card number). Customers must be PCI + # compliant to have PAN returned as a field in production. Please contact + # https://support.lithic.com/ for questions. + # + # @return [String, nil] + optional :pan, String + + # @!method initialize(cvv: nil, pan: nil) + # Some parameter documentations has been truncated, see {Lithic::Models::Card} for + # more details. + # + # Card details with potentially PCI sensitive information for Enterprise customers + # + # @param cvv [String] Three digit cvv printed on the back of the card. + # + # @param pan [String] Primary Account Number (PAN) (i.e. the card number). Customers must be PCI compl + end + end +end diff --git a/lib/lithic/models/card_authorization.rb b/lib/lithic/models/card_authorization.rb new file mode 100644 index 00000000..b77e9ec0 --- /dev/null +++ b/lib/lithic/models/card_authorization.rb @@ -0,0 +1,1372 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardAuthorization < Lithic::Internal::Type::BaseModel + # @!attribute token + # The provisional transaction group uuid associated with the authorization + # + # @return [String] + required :token, String + + # @!attribute acquirer_fee + # Fee (in cents) assessed by the merchant and paid for by the cardholder. Will be + # zero if no fee is assessed. Rebates may be transmitted as a negative value to + # indicate credited fees. + # + # @return [Integer] + required :acquirer_fee, Integer + + # @!attribute amount + # @deprecated + # + # Deprecated, use `amounts`. Authorization amount of the transaction (in cents), + # including any acquirer fees. The contents of this field are identical to + # `authorization_amount`. + # + # @return [Integer] + required :amount, Integer + + # @!attribute amounts + # Structured amounts for this authorization. The `cardholder` and `merchant` + # amounts reflect the original network authorization values. For programs with + # hold adjustments enabled (e.g., automated fuel dispensers or tipping MCCs), the + # `hold` amount may exceed the `cardholder` and `merchant` amounts to account for + # anticipated final transaction amounts such as tips or fuel fill-ups + # + # @return [Lithic::Models::CardAuthorization::Amounts] + required :amounts, -> { Lithic::CardAuthorization::Amounts } + + # @!attribute authorization_amount + # @deprecated + # + # Deprecated, use `amounts`. The base transaction amount (in cents) plus the + # acquirer fee field. This is the amount the issuer should authorize against + # unless the issuer is paying the acquirer fee on behalf of the cardholder. + # + # @return [Integer] + required :authorization_amount, Integer + + # @!attribute avs + # + # @return [Lithic::Models::CardAuthorization::Avs] + required :avs, -> { Lithic::CardAuthorization::Avs } + + # @!attribute card + # Card object in ASA + # + # @return [Lithic::Models::CardAuthorization::Card] + required :card, -> { Lithic::CardAuthorization::Card } + + # @!attribute cardholder_currency + # @deprecated + # + # Deprecated, use `amounts`. 3-character alphabetic ISO 4217 code for cardholder's + # billing currency. + # + # @return [String] + required :cardholder_currency, String + + # @!attribute cash_amount + # The portion of the transaction requested as cash back by the cardholder, and + # does not include any acquirer fees. The amount field includes the purchase + # amount, the requested cash back amount, and any acquirer fees. + # + # If no cash back was requested, the value of this field will be 0, and the field + # will always be present. + # + # @return [Integer] + required :cash_amount, Integer + + # @!attribute created + # Date and time when the transaction first occurred in UTC. + # + # @return [Time] + required :created, Time + + # @!attribute merchant + # Merchant information including full location details. + # + # @return [Lithic::Models::CardAuthorization::Merchant] + required :merchant, -> { Lithic::CardAuthorization::Merchant } + + # @!attribute merchant_amount + # @deprecated + # + # Deprecated, use `amounts`. The amount that the merchant will receive, + # denominated in `merchant_currency` and in the smallest currency unit. Note the + # amount includes `acquirer_fee`, similar to `authorization_amount`. It will be + # different from `authorization_amount` if the merchant is taking payment in a + # different currency. + # + # @return [Integer] + required :merchant_amount, Integer + + # @!attribute merchant_currency + # @deprecated + # + # 3-character alphabetic ISO 4217 code for the local currency of the transaction. + # + # @return [String] + required :merchant_currency, String + + # @!attribute name_validation + # Network name validation data, present when the card network requested name + # validation for this transaction. Contains the cardholder name provided by the + # network and Lithic's computed match result against KYC data on file. + # + # @return [Lithic::Models::CardAuthorization::NameValidation, nil] + required :name_validation, -> { Lithic::CardAuthorization::NameValidation }, nil?: true + + # @!attribute service_location + # Where the cardholder received the service, when different from the card acceptor + # location. This is populated from network data elements such as Mastercard DE-122 + # SE1 SF9-14 and Visa F34 DS02. + # + # @return [Lithic::Models::CardAuthorization::ServiceLocation, nil] + required :service_location, -> { Lithic::CardAuthorization::ServiceLocation }, nil?: true + + # @!attribute settled_amount + # @deprecated + # + # Deprecated, use `amounts`. Amount (in cents) of the transaction that has been + # settled, including any acquirer fees. + # + # @return [Integer] + required :settled_amount, Integer + + # @!attribute status + # The type of authorization request that this request is for. Note that + # `CREDIT_AUTHORIZATION` and `FINANCIAL_CREDIT_AUTHORIZATION` is only available to + # users with credit decisioning via ASA enabled. + # + # @return [Symbol, Lithic::Models::CardAuthorization::Status] + required :status, enum: -> { Lithic::CardAuthorization::Status } + + # @!attribute transaction_initiator + # The entity that initiated the transaction. + # + # @return [Symbol, Lithic::Models::CardAuthorization::TransactionInitiator] + required :transaction_initiator, enum: -> { Lithic::CardAuthorization::TransactionInitiator } + + # @!attribute account_type + # + # @return [Symbol, Lithic::Models::CardAuthorization::AccountType, nil] + optional :account_type, enum: -> { Lithic::CardAuthorization::AccountType } + + # @!attribute cardholder_authentication + # + # @return [Lithic::Models::CardholderAuthentication, nil] + optional :cardholder_authentication, -> { Lithic::CardholderAuthentication } + + # @!attribute cashback + # Deprecated, use `cash_amount`. + # + # @return [Integer, nil] + optional :cashback, Integer + + # @!attribute conversion_rate + # @deprecated + # + # Deprecated, use `amounts`. If the transaction was requested in a currency other + # than the settlement currency, this field will be populated to indicate the rate + # used to translate the merchant_amount to the amount (i.e., `merchant_amount` x + # `conversion_rate` = `amount`). Note that the `merchant_amount` is in the local + # currency and the amount is in the settlement currency. + # + # @return [Float, nil] + optional :conversion_rate, Float + + # @!attribute event_token + # The event token associated with the authorization. This field is only set for + # programs enrolled into the beta. + # + # @return [String, nil] + optional :event_token, String + + # @!attribute fleet_info + # Optional Object containing information if the Card is a part of a Fleet managed + # program + # + # @return [Lithic::Models::CardAuthorization::FleetInfo, nil] + optional :fleet_info, -> { Lithic::CardAuthorization::FleetInfo }, nil?: true + + # @!attribute latest_challenge + # The latest Authorization Challenge that was issued to the cardholder for this + # merchant. + # + # @return [Lithic::Models::CardAuthorization::LatestChallenge, nil] + optional :latest_challenge, -> { Lithic::CardAuthorization::LatestChallenge } + + # @!attribute network + # Card network of the authorization. + # + # @return [Symbol, Lithic::Models::CardAuthorization::Network, nil] + optional :network, enum: -> { Lithic::CardAuthorization::Network } + + # @!attribute network_risk_score + # Network-provided score assessing risk level associated with a given + # authorization. Scores are on a range of 0-999, with 0 representing the lowest + # risk and 999 representing the highest risk. For Visa transactions, where the raw + # score has a range of 0-99, Lithic will normalize the score by multiplying the + # raw score by 10x. + # + # @return [Integer, nil] + optional :network_risk_score, Integer, nil?: true + + # @!attribute network_specific_data + # Contains raw data provided by the card network, including attributes that + # provide further context about the authorization. If populated by the network, + # data is organized by Lithic and passed through without further modification. + # Please consult the official network documentation for more details about these + # values and how to use them. This object is only available to certain programs- + # contact your Customer Success Manager to discuss enabling access. + # + # @return [Lithic::Models::CardAuthorization::NetworkSpecificData, nil] + optional :network_specific_data, -> { Lithic::CardAuthorization::NetworkSpecificData }, nil?: true + + # @!attribute pos + # + # @return [Lithic::Models::CardAuthorization::Pos, nil] + optional :pos, -> { Lithic::CardAuthorization::Pos } + + # @!attribute token_info + # + # @return [Lithic::Models::TokenInfo, nil] + optional :token_info, -> { Lithic::TokenInfo }, nil?: true + + # @!attribute ttl + # Deprecated: approximate time-to-live for the authorization. + # + # @return [Time, nil] + optional :ttl, Time + + # @!method initialize(token:, acquirer_fee:, amount:, amounts:, authorization_amount:, avs:, card:, cardholder_currency:, cash_amount:, created:, merchant:, merchant_amount:, merchant_currency:, name_validation:, service_location:, settled_amount:, status:, transaction_initiator:, account_type: nil, cardholder_authentication: nil, cashback: nil, conversion_rate: nil, event_token: nil, fleet_info: nil, latest_challenge: nil, network: nil, network_risk_score: nil, network_specific_data: nil, pos: nil, token_info: nil, ttl: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardAuthorization} for more details. + # + # Card Authorization + # + # @param token [String] The provisional transaction group uuid associated with the authorization + # + # @param acquirer_fee [Integer] Fee (in cents) assessed by the merchant and paid for by the cardholder. Will be + # + # @param amount [Integer] Deprecated, use `amounts`. Authorization amount of the transaction (in cents), i + # + # @param amounts [Lithic::Models::CardAuthorization::Amounts] Structured amounts for this authorization. The `cardholder` and `merchant` amoun + # + # @param authorization_amount [Integer] Deprecated, use `amounts`. The base transaction amount (in cents) plus the acqui + # + # @param avs [Lithic::Models::CardAuthorization::Avs] + # + # @param card [Lithic::Models::CardAuthorization::Card] Card object in ASA + # + # @param cardholder_currency [String] Deprecated, use `amounts`. 3-character alphabetic ISO 4217 code for cardholder's + # + # @param cash_amount [Integer] The portion of the transaction requested as cash back by the cardholder, and doe + # + # @param created [Time] Date and time when the transaction first occurred in UTC. + # + # @param merchant [Lithic::Models::CardAuthorization::Merchant] Merchant information including full location details. + # + # @param merchant_amount [Integer] Deprecated, use `amounts`. The amount that the merchant will receive, denominate + # + # @param merchant_currency [String] 3-character alphabetic ISO 4217 code for the local currency of the transaction. + # + # @param name_validation [Lithic::Models::CardAuthorization::NameValidation, nil] Network name validation data, present when the card network requested name valid + # + # @param service_location [Lithic::Models::CardAuthorization::ServiceLocation, nil] Where the cardholder received the service, when different from the card acceptor + # + # @param settled_amount [Integer] Deprecated, use `amounts`. Amount (in cents) of the transaction that has been se + # + # @param status [Symbol, Lithic::Models::CardAuthorization::Status] The type of authorization request that this request is for. Note that `CREDIT_AU + # + # @param transaction_initiator [Symbol, Lithic::Models::CardAuthorization::TransactionInitiator] The entity that initiated the transaction. + # + # @param account_type [Symbol, Lithic::Models::CardAuthorization::AccountType] + # + # @param cardholder_authentication [Lithic::Models::CardholderAuthentication] + # + # @param cashback [Integer] Deprecated, use `cash_amount`. + # + # @param conversion_rate [Float] Deprecated, use `amounts`. If the transaction was requested in a currency other + # + # @param event_token [String] The event token associated with the authorization. This field is only set for pr + # + # @param fleet_info [Lithic::Models::CardAuthorization::FleetInfo, nil] Optional Object containing information if the Card is a part of a Fleet managed + # + # @param latest_challenge [Lithic::Models::CardAuthorization::LatestChallenge] The latest Authorization Challenge that was issued to the cardholder for this me + # + # @param network [Symbol, Lithic::Models::CardAuthorization::Network] Card network of the authorization. + # + # @param network_risk_score [Integer, nil] Network-provided score assessing risk level associated with a given authorizatio + # + # @param network_specific_data [Lithic::Models::CardAuthorization::NetworkSpecificData, nil] Contains raw data provided by the card network, including attributes that provid + # + # @param pos [Lithic::Models::CardAuthorization::Pos] + # + # @param token_info [Lithic::Models::TokenInfo, nil] + # + # @param ttl [Time] Deprecated: approximate time-to-live for the authorization. + + # @see Lithic::Models::CardAuthorization#amounts + class Amounts < Lithic::Internal::Type::BaseModel + # @!attribute cardholder + # + # @return [Lithic::Models::CardAuthorization::Amounts::Cardholder] + required :cardholder, -> { Lithic::CardAuthorization::Amounts::Cardholder } + + # @!attribute hold + # + # @return [Lithic::Models::CardAuthorization::Amounts::Hold, nil] + required :hold, -> { Lithic::CardAuthorization::Amounts::Hold }, nil?: true + + # @!attribute merchant + # + # @return [Lithic::Models::CardAuthorization::Amounts::Merchant] + required :merchant, -> { Lithic::CardAuthorization::Amounts::Merchant } + + # @!attribute settlement + # + # @return [Lithic::Models::CardAuthorization::Amounts::Settlement, nil] + required :settlement, -> { Lithic::CardAuthorization::Amounts::Settlement }, nil?: true + + # @!method initialize(cardholder:, hold:, merchant:, settlement:) + # Structured amounts for this authorization. The `cardholder` and `merchant` + # amounts reflect the original network authorization values. For programs with + # hold adjustments enabled (e.g., automated fuel dispensers or tipping MCCs), the + # `hold` amount may exceed the `cardholder` and `merchant` amounts to account for + # anticipated final transaction amounts such as tips or fuel fill-ups + # + # @param cardholder [Lithic::Models::CardAuthorization::Amounts::Cardholder] + # @param hold [Lithic::Models::CardAuthorization::Amounts::Hold, nil] + # @param merchant [Lithic::Models::CardAuthorization::Amounts::Merchant] + # @param settlement [Lithic::Models::CardAuthorization::Amounts::Settlement, nil] + + # @see Lithic::Models::CardAuthorization::Amounts#cardholder + class Cardholder < Lithic::Internal::Type::BaseModel + # @!attribute amount + # Amount in the smallest unit of the applicable currency (e.g., cents) + # + # @return [Integer] + required :amount, Integer + + # @!attribute conversion_rate + # Exchange rate used for currency conversion + # + # @return [String] + required :conversion_rate, String + + # @!attribute currency + # 3-character alphabetic ISO 4217 currency + # + # @return [String] + required :currency, String + + # @!method initialize(amount:, conversion_rate:, currency:) + # @param amount [Integer] Amount in the smallest unit of the applicable currency (e.g., cents) + # + # @param conversion_rate [String] Exchange rate used for currency conversion + # + # @param currency [String] 3-character alphabetic ISO 4217 currency + end + + # @see Lithic::Models::CardAuthorization::Amounts#hold + class Hold < Lithic::Internal::Type::BaseModel + # @!attribute amount + # Amount in the smallest unit of the applicable currency (e.g., cents) + # + # @return [Integer] + required :amount, Integer + + # @!attribute currency + # 3-character alphabetic ISO 4217 currency + # + # @return [String] + required :currency, String + + # @!method initialize(amount:, currency:) + # @param amount [Integer] Amount in the smallest unit of the applicable currency (e.g., cents) + # + # @param currency [String] 3-character alphabetic ISO 4217 currency + end + + # @see Lithic::Models::CardAuthorization::Amounts#merchant + class Merchant < Lithic::Internal::Type::BaseModel + # @!attribute amount + # Amount in the smallest unit of the applicable currency (e.g., cents) + # + # @return [Integer] + required :amount, Integer + + # @!attribute currency + # 3-character alphabetic ISO 4217 currency + # + # @return [String] + required :currency, String + + # @!method initialize(amount:, currency:) + # @param amount [Integer] Amount in the smallest unit of the applicable currency (e.g., cents) + # + # @param currency [String] 3-character alphabetic ISO 4217 currency + end + + # @see Lithic::Models::CardAuthorization::Amounts#settlement + class Settlement < Lithic::Internal::Type::BaseModel + # @!attribute amount + # Amount in the smallest unit of the applicable currency (e.g., cents) + # + # @return [Integer] + required :amount, Integer + + # @!attribute currency + # 3-character alphabetic ISO 4217 currency + # + # @return [String] + required :currency, String + + # @!method initialize(amount:, currency:) + # @param amount [Integer] Amount in the smallest unit of the applicable currency (e.g., cents) + # + # @param currency [String] 3-character alphabetic ISO 4217 currency + end + end + + # @see Lithic::Models::CardAuthorization#avs + class Avs < Lithic::Internal::Type::BaseModel + # @!attribute address + # Cardholder address + # + # @return [String] + required :address, String + + # @!attribute address_on_file_match + # Lithic's evaluation result comparing the transaction's address data with the + # cardholder KYC data if it exists. In the event Lithic does not have any + # Cardholder KYC data, or the transaction does not contain any address data, + # NOT_PRESENT will be returned + # + # @return [Symbol, Lithic::Models::CardAuthorization::Avs::AddressOnFileMatch] + required :address_on_file_match, enum: -> { Lithic::CardAuthorization::Avs::AddressOnFileMatch } + + # @!attribute zipcode + # Cardholder ZIP code + # + # @return [String] + required :zipcode, String + + # @!method initialize(address:, address_on_file_match:, zipcode:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardAuthorization::Avs} for more details. + # + # @param address [String] Cardholder address + # + # @param address_on_file_match [Symbol, Lithic::Models::CardAuthorization::Avs::AddressOnFileMatch] Lithic's evaluation result comparing the transaction's address data with the car + # + # @param zipcode [String] Cardholder ZIP code + + # Lithic's evaluation result comparing the transaction's address data with the + # cardholder KYC data if it exists. In the event Lithic does not have any + # Cardholder KYC data, or the transaction does not contain any address data, + # NOT_PRESENT will be returned + # + # @see Lithic::Models::CardAuthorization::Avs#address_on_file_match + module AddressOnFileMatch + extend Lithic::Internal::Type::Enum + + MATCH = :MATCH + MATCH_ADDRESS_ONLY = :MATCH_ADDRESS_ONLY + MATCH_ZIP_ONLY = :MATCH_ZIP_ONLY + MISMATCH = :MISMATCH + NOT_PRESENT = :NOT_PRESENT + + # @!method self.values + # @return [Array] + end + end + + # @see Lithic::Models::CardAuthorization#card + class Card < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for the card. + # + # @return [String] + required :token, String + + # @!attribute last_four + # Last four digits of the card number + # + # @return [String] + required :last_four, String + + # @!attribute memo + # Customizable name to identify the card + # + # @return [String] + required :memo, String + + # @!attribute spend_limit + # Amount (in cents) to limit approved authorizations. Purchase requests above the + # spend limit will be declined (refunds and credits will be approved). + # + # Note that while spend limits are enforced based on authorized and settled volume + # on a card, they are not recommended to be used for balance or + # reconciliation-level accuracy. Spend limits also cannot block force posted + # charges (i.e., when a merchant sends a clearing message without a prior + # authorization). + # + # @return [Integer] + required :spend_limit, Integer + + # @!attribute spend_limit_duration + # Note that to support recurring monthly payments, which can occur on different + # day every month, the time window we consider for MONTHLY velocity starts 6 days + # after the current calendar date one month prior. + # + # @return [Symbol, Lithic::Models::CardAuthorization::Card::SpendLimitDuration] + required :spend_limit_duration, enum: -> { Lithic::CardAuthorization::Card::SpendLimitDuration } + + # @!attribute state + # + # @return [Symbol, Lithic::Models::CardAuthorization::Card::State] + required :state, enum: -> { Lithic::CardAuthorization::Card::State } + + # @!attribute type + # + # @return [Symbol, Lithic::Models::CardAuthorization::Card::Type] + required :type, enum: -> { Lithic::CardAuthorization::Card::Type } + + # @!method initialize(token:, last_four:, memo:, spend_limit:, spend_limit_duration:, state:, type:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardAuthorization::Card} for more details. + # + # Card object in ASA + # + # @param token [String] Globally unique identifier for the card. + # + # @param last_four [String] Last four digits of the card number + # + # @param memo [String] Customizable name to identify the card + # + # @param spend_limit [Integer] Amount (in cents) to limit approved authorizations. Purchase requests above the + # + # @param spend_limit_duration [Symbol, Lithic::Models::CardAuthorization::Card::SpendLimitDuration] Note that to support recurring monthly payments, which can occur on different da + # + # @param state [Symbol, Lithic::Models::CardAuthorization::Card::State] + # + # @param type [Symbol, Lithic::Models::CardAuthorization::Card::Type] + + # Note that to support recurring monthly payments, which can occur on different + # day every month, the time window we consider for MONTHLY velocity starts 6 days + # after the current calendar date one month prior. + # + # @see Lithic::Models::CardAuthorization::Card#spend_limit_duration + module SpendLimitDuration + extend Lithic::Internal::Type::Enum + + ANNUALLY = :ANNUALLY + FOREVER = :FOREVER + MONTHLY = :MONTHLY + TRANSACTION = :TRANSACTION + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::CardAuthorization::Card#state + module State + extend Lithic::Internal::Type::Enum + + CLOSED = :CLOSED + OPEN = :OPEN + PAUSED = :PAUSED + PENDING_ACTIVATION = :PENDING_ACTIVATION + PENDING_FULFILLMENT = :PENDING_FULFILLMENT + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::CardAuthorization::Card#type + module Type + extend Lithic::Internal::Type::Enum + + SINGLE_USE = :SINGLE_USE + MERCHANT_LOCKED = :MERCHANT_LOCKED + UNLOCKED = :UNLOCKED + PHYSICAL = :PHYSICAL + DIGITAL_WALLET = :DIGITAL_WALLET + VIRTUAL = :VIRTUAL + + # @!method self.values + # @return [Array] + end + end + + # @see Lithic::Models::CardAuthorization#merchant + class Merchant < Lithic::Models::Merchant + # @!attribute phone_number + # Phone number of card acceptor. + # + # @return [String, nil] + required :phone_number, String, nil?: true + + # @!attribute postal_code + # Postal code of card acceptor. + # + # @return [String, nil] + required :postal_code, String, nil?: true + + # @!attribute street_address + # Street address of card acceptor. + # + # @return [String, nil] + required :street_address, String, nil?: true + + # @!method initialize(phone_number:, postal_code:, street_address:) + # Merchant information including full location details. + # + # @param phone_number [String, nil] Phone number of card acceptor. + # + # @param postal_code [String, nil] Postal code of card acceptor. + # + # @param street_address [String, nil] Street address of card acceptor. + end + + # @see Lithic::Models::CardAuthorization#name_validation + class NameValidation < Lithic::Internal::Type::BaseModel + # @!attribute name + # Cardholder name as provided by the card network. + # + # @return [Lithic::Models::CardAuthorization::NameValidation::Name] + required :name, -> { Lithic::CardAuthorization::NameValidation::Name } + + # @!attribute name_on_file_match + # Lithic's computed match result comparing the network-provided name to the name + # on file. + # + # @return [Lithic::Models::CardAuthorization::NameValidation::NameOnFileMatch] + required :name_on_file_match, -> { Lithic::CardAuthorization::NameValidation::NameOnFileMatch } + + # @!method initialize(name:, name_on_file_match:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardAuthorization::NameValidation} for more details. + # + # Network name validation data, present when the card network requested name + # validation for this transaction. Contains the cardholder name provided by the + # network and Lithic's computed match result against KYC data on file. + # + # @param name [Lithic::Models::CardAuthorization::NameValidation::Name] Cardholder name as provided by the card network. + # + # @param name_on_file_match [Lithic::Models::CardAuthorization::NameValidation::NameOnFileMatch] Lithic's computed match result comparing the network-provided name to the name o + + # @see Lithic::Models::CardAuthorization::NameValidation#name + class Name < Lithic::Internal::Type::BaseModel + # @!attribute first + # First name + # + # @return [String] + required :first, String + + # @!attribute last + # Last name + # + # @return [String] + required :last, String + + # @!attribute middle + # Middle name + # + # @return [String, nil] + required :middle, String, nil?: true + + # @!method initialize(first:, last:, middle:) + # Cardholder name as provided by the card network. + # + # @param first [String] First name + # + # @param last [String] Last name + # + # @param middle [String, nil] Middle name + end + + # @see Lithic::Models::CardAuthorization::NameValidation#name_on_file_match + class NameOnFileMatch < Lithic::Internal::Type::BaseModel + # @!attribute full_name + # Overall name match result. + # + # @return [Symbol, Lithic::Models::CardAuthorization::NameValidation::NameOnFileMatch::FullName] + required :full_name, enum: -> { Lithic::CardAuthorization::NameValidation::NameOnFileMatch::FullName } + + # @!method initialize(full_name:) + # Lithic's computed match result comparing the network-provided name to the name + # on file. + # + # @param full_name [Symbol, Lithic::Models::CardAuthorization::NameValidation::NameOnFileMatch::FullName] Overall name match result. + + # Overall name match result. + # + # @see Lithic::Models::CardAuthorization::NameValidation::NameOnFileMatch#full_name + module FullName + extend Lithic::Internal::Type::Enum + + MATCH = :MATCH + PARTIAL_MATCH = :PARTIAL_MATCH + NO_MATCH = :NO_MATCH + UNVERIFIED = :UNVERIFIED + + # @!method self.values + # @return [Array] + end + end + end + + # @see Lithic::Models::CardAuthorization#service_location + class ServiceLocation < Lithic::Internal::Type::BaseModel + # @!attribute city + # City of service location. + # + # @return [String, nil] + required :city, String, nil?: true + + # @!attribute country + # Country code of service location, ISO 3166-1 alpha-3. + # + # @return [String, nil] + required :country, String, nil?: true + + # @!attribute postal_code + # Postal code of service location. + # + # @return [String, nil] + required :postal_code, String, nil?: true + + # @!attribute state + # State/province code of service location, ISO 3166-2. + # + # @return [String, nil] + required :state, String, nil?: true + + # @!attribute street_address + # Street address of service location. + # + # @return [String, nil] + required :street_address, String, nil?: true + + # @!method initialize(city:, country:, postal_code:, state:, street_address:) + # Where the cardholder received the service, when different from the card acceptor + # location. This is populated from network data elements such as Mastercard DE-122 + # SE1 SF9-14 and Visa F34 DS02. + # + # @param city [String, nil] City of service location. + # + # @param country [String, nil] Country code of service location, ISO 3166-1 alpha-3. + # + # @param postal_code [String, nil] Postal code of service location. + # + # @param state [String, nil] State/province code of service location, ISO 3166-2. + # + # @param street_address [String, nil] Street address of service location. + end + + # The type of authorization request that this request is for. Note that + # `CREDIT_AUTHORIZATION` and `FINANCIAL_CREDIT_AUTHORIZATION` is only available to + # users with credit decisioning via ASA enabled. + # + # @see Lithic::Models::CardAuthorization#status + module Status + extend Lithic::Internal::Type::Enum + + AUTHORIZATION = :AUTHORIZATION + CREDIT_AUTHORIZATION = :CREDIT_AUTHORIZATION + FINANCIAL_AUTHORIZATION = :FINANCIAL_AUTHORIZATION + FINANCIAL_CREDIT_AUTHORIZATION = :FINANCIAL_CREDIT_AUTHORIZATION + BALANCE_INQUIRY = :BALANCE_INQUIRY + + # @!method self.values + # @return [Array] + end + + # The entity that initiated the transaction. + # + # @see Lithic::Models::CardAuthorization#transaction_initiator + module TransactionInitiator + extend Lithic::Internal::Type::Enum + + CARDHOLDER = :CARDHOLDER + MERCHANT = :MERCHANT + UNKNOWN = :UNKNOWN + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::CardAuthorization#account_type + module AccountType + extend Lithic::Internal::Type::Enum + + CHECKING = :CHECKING + SAVINGS = :SAVINGS + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::CardAuthorization#fleet_info + class FleetInfo < Lithic::Internal::Type::BaseModel + # @!attribute fleet_prompt_code + # Code indicating what the driver was prompted to enter at time of purchase. This + # is configured at a program level and is a static configuration, and does not + # change on a request to request basis + # + # @return [Symbol, Lithic::Models::CardAuthorization::FleetInfo::FleetPromptCode] + required :fleet_prompt_code, enum: -> { Lithic::CardAuthorization::FleetInfo::FleetPromptCode } + + # @!attribute fleet_restriction_code + # Code indicating which restrictions, if any, there are on purchase. This is + # configured at a program level and is a static configuration, and does not change + # on a request to request basis + # + # @return [Symbol, Lithic::Models::CardAuthorization::FleetInfo::FleetRestrictionCode] + required :fleet_restriction_code, enum: -> { Lithic::CardAuthorization::FleetInfo::FleetRestrictionCode } + + # @!attribute driver_number + # Number representing the driver + # + # @return [String, nil] + optional :driver_number, String, nil?: true + + # @!attribute vehicle_number + # Number associated with the vehicle + # + # @return [String, nil] + optional :vehicle_number, String, nil?: true + + # @!method initialize(fleet_prompt_code:, fleet_restriction_code:, driver_number: nil, vehicle_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardAuthorization::FleetInfo} for more details. + # + # Optional Object containing information if the Card is a part of a Fleet managed + # program + # + # @param fleet_prompt_code [Symbol, Lithic::Models::CardAuthorization::FleetInfo::FleetPromptCode] Code indicating what the driver was prompted to enter at time of purchase. This + # + # @param fleet_restriction_code [Symbol, Lithic::Models::CardAuthorization::FleetInfo::FleetRestrictionCode] Code indicating which restrictions, if any, there are on purchase. This is confi + # + # @param driver_number [String, nil] Number representing the driver + # + # @param vehicle_number [String, nil] Number associated with the vehicle + + # Code indicating what the driver was prompted to enter at time of purchase. This + # is configured at a program level and is a static configuration, and does not + # change on a request to request basis + # + # @see Lithic::Models::CardAuthorization::FleetInfo#fleet_prompt_code + module FleetPromptCode + extend Lithic::Internal::Type::Enum + + NO_PROMPT = :NO_PROMPT + VEHICLE_NUMBER = :VEHICLE_NUMBER + DRIVER_NUMBER = :DRIVER_NUMBER + + # @!method self.values + # @return [Array] + end + + # Code indicating which restrictions, if any, there are on purchase. This is + # configured at a program level and is a static configuration, and does not change + # on a request to request basis + # + # @see Lithic::Models::CardAuthorization::FleetInfo#fleet_restriction_code + module FleetRestrictionCode + extend Lithic::Internal::Type::Enum + + NO_RESTRICTIONS = :NO_RESTRICTIONS + FUEL_ONLY = :FUEL_ONLY + + # @!method self.values + # @return [Array] + end + end + + # @see Lithic::Models::CardAuthorization#latest_challenge + class LatestChallenge < Lithic::Internal::Type::BaseModel + # @!attribute completed_at + # The date and time when the Authorization Challenge was completed in UTC. Filled + # only if the challenge has been completed. + # + # @return [Time, nil] + required :completed_at, Time, nil?: true + + # @!attribute created + # The date and time when the Authorization Challenge was created in UTC + # + # @return [Time] + required :created, Time + + # @!attribute method_ + # The method used to deliver the challenge to the cardholder + # + # - `SMS` - Challenge was delivered via SMS + # - `OUT_OF_BAND` - Challenge was delivered via an out-of-band method + # + # @return [Symbol, Lithic::Models::CardAuthorization::LatestChallenge::Method] + required :method_, enum: -> { Lithic::CardAuthorization::LatestChallenge::Method }, api_name: :method + + # @!attribute phone_number + # The phone number used for sending the Authorization Challenge. Present only when + # the challenge method is `SMS`. + # + # @return [String, nil] + required :phone_number, String, nil?: true + + # @!attribute status + # The status of the Authorization Challenge + # + # - `COMPLETED` - Challenge was successfully completed by the cardholder + # - `DECLINED` - Challenge was declined by the cardholder + # - `PENDING` - Challenge is still open + # - `EXPIRED` - Challenge has expired without being completed + # - `ERROR` - There was an error processing the challenge + # + # @return [Symbol, Lithic::Models::CardAuthorization::LatestChallenge::Status] + required :status, enum: -> { Lithic::CardAuthorization::LatestChallenge::Status } + + # @!method initialize(completed_at:, created:, method_:, phone_number:, status:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardAuthorization::LatestChallenge} for more details. + # + # The latest Authorization Challenge that was issued to the cardholder for this + # merchant. + # + # @param completed_at [Time, nil] The date and time when the Authorization Challenge was completed in UTC. Filled + # + # @param created [Time] The date and time when the Authorization Challenge was created in UTC + # + # @param method_ [Symbol, Lithic::Models::CardAuthorization::LatestChallenge::Method] The method used to deliver the challenge to the cardholder + # + # @param phone_number [String, nil] The phone number used for sending the Authorization Challenge. Present only when + # + # @param status [Symbol, Lithic::Models::CardAuthorization::LatestChallenge::Status] The status of the Authorization Challenge + + # The method used to deliver the challenge to the cardholder + # + # - `SMS` - Challenge was delivered via SMS + # - `OUT_OF_BAND` - Challenge was delivered via an out-of-band method + # + # @see Lithic::Models::CardAuthorization::LatestChallenge#method_ + module Method + extend Lithic::Internal::Type::Enum + + SMS = :SMS + OUT_OF_BAND = :OUT_OF_BAND + + # @!method self.values + # @return [Array] + end + + # The status of the Authorization Challenge + # + # - `COMPLETED` - Challenge was successfully completed by the cardholder + # - `DECLINED` - Challenge was declined by the cardholder + # - `PENDING` - Challenge is still open + # - `EXPIRED` - Challenge has expired without being completed + # - `ERROR` - There was an error processing the challenge + # + # @see Lithic::Models::CardAuthorization::LatestChallenge#status + module Status + extend Lithic::Internal::Type::Enum + + COMPLETED = :COMPLETED + DECLINED = :DECLINED + PENDING = :PENDING + EXPIRED = :EXPIRED + ERROR = :ERROR + + # @!method self.values + # @return [Array] + end + end + + # Card network of the authorization. + # + # @see Lithic::Models::CardAuthorization#network + module Network + extend Lithic::Internal::Type::Enum + + AMEX = :AMEX + INTERLINK = :INTERLINK + MAESTRO = :MAESTRO + MASTERCARD = :MASTERCARD + UNKNOWN = :UNKNOWN + VISA = :VISA + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::CardAuthorization#network_specific_data + class NetworkSpecificData < Lithic::Internal::Type::BaseModel + # @!attribute mastercard + # + # @return [Lithic::Models::CardAuthorization::NetworkSpecificData::Mastercard, nil] + optional :mastercard, -> { Lithic::CardAuthorization::NetworkSpecificData::Mastercard }, nil?: true + + # @!attribute visa + # + # @return [Lithic::Models::CardAuthorization::NetworkSpecificData::Visa, nil] + optional :visa, -> { Lithic::CardAuthorization::NetworkSpecificData::Visa }, nil?: true + + # @!method initialize(mastercard: nil, visa: nil) + # Contains raw data provided by the card network, including attributes that + # provide further context about the authorization. If populated by the network, + # data is organized by Lithic and passed through without further modification. + # Please consult the official network documentation for more details about these + # values and how to use them. This object is only available to certain programs- + # contact your Customer Success Manager to discuss enabling access. + # + # @param mastercard [Lithic::Models::CardAuthorization::NetworkSpecificData::Mastercard, nil] + # @param visa [Lithic::Models::CardAuthorization::NetworkSpecificData::Visa, nil] + + # @see Lithic::Models::CardAuthorization::NetworkSpecificData#mastercard + class Mastercard < Lithic::Internal::Type::BaseModel + # @!attribute ecommerce_security_level_indicator + # Indicates the electronic commerce security level and UCAF collection. + # + # @return [String, nil] + optional :ecommerce_security_level_indicator, String, nil?: true + + # @!attribute on_behalf_service_result + # The On-behalf Service performed on the transaction and the results. Contains all + # applicable, on-behalf service results that were performed on a given + # transaction. + # + # @return [Array, nil] + optional :on_behalf_service_result, + -> { + Lithic::Internal::Type::ArrayOf[Lithic::CardAuthorization::NetworkSpecificData::Mastercard::OnBehalfServiceResult] + }, + nil?: true + + # @!attribute transaction_type_identifier + # Indicates the type of additional transaction purpose. + # + # @return [String, nil] + optional :transaction_type_identifier, String, nil?: true + + # @!method initialize(ecommerce_security_level_indicator: nil, on_behalf_service_result: nil, transaction_type_identifier: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardAuthorization::NetworkSpecificData::Mastercard} for more + # details. + # + # @param ecommerce_security_level_indicator [String, nil] Indicates the electronic commerce security level and UCAF collection. + # + # @param on_behalf_service_result [Array, nil] The On-behalf Service performed on the transaction and the results. Contains all + # + # @param transaction_type_identifier [String, nil] Indicates the type of additional transaction purpose. + + class OnBehalfServiceResult < Lithic::Internal::Type::BaseModel + # @!attribute result_1 + # Indicates the results of the service processing. + # + # @return [String] + required :result_1, String + + # @!attribute result_2 + # Identifies the results of the service processing. + # + # @return [String] + required :result_2, String + + # @!attribute service + # Indicates the service performed on the transaction. + # + # @return [String] + required :service, String + + # @!method initialize(result_1:, result_2:, service:) + # @param result_1 [String] Indicates the results of the service processing. + # + # @param result_2 [String] Identifies the results of the service processing. + # + # @param service [String] Indicates the service performed on the transaction. + end + end + + # @see Lithic::Models::CardAuthorization::NetworkSpecificData#visa + class Visa < Lithic::Internal::Type::BaseModel + # @!attribute business_application_identifier + # Identifies the purpose or category of a transaction, used to classify and + # process transactions according to Visa’s rules. + # + # @return [String, nil] + optional :business_application_identifier, String, nil?: true + + # @!method initialize(business_application_identifier: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardAuthorization::NetworkSpecificData::Visa} for more details. + # + # @param business_application_identifier [String, nil] Identifies the purpose or category of a transaction, used to classify and proces + end + end + + # @see Lithic::Models::CardAuthorization#pos + class Pos < Lithic::Internal::Type::BaseModel + # @!attribute entry_mode + # POS > Entry Mode object in ASA + # + # @return [Lithic::Models::CardAuthorization::Pos::EntryMode, nil] + optional :entry_mode, -> { Lithic::CardAuthorization::Pos::EntryMode } + + # @!attribute terminal + # + # @return [Lithic::Models::CardAuthorization::Pos::Terminal, nil] + optional :terminal, -> { Lithic::CardAuthorization::Pos::Terminal } + + # @!method initialize(entry_mode: nil, terminal: nil) + # @param entry_mode [Lithic::Models::CardAuthorization::Pos::EntryMode] POS > Entry Mode object in ASA + # + # @param terminal [Lithic::Models::CardAuthorization::Pos::Terminal] + + # @see Lithic::Models::CardAuthorization::Pos#entry_mode + class EntryMode < Lithic::Internal::Type::BaseModel + # @!attribute card + # Card Presence Indicator + # + # @return [Symbol, Lithic::Models::CardAuthorization::Pos::EntryMode::Card, nil] + optional :card, enum: -> { Lithic::CardAuthorization::Pos::EntryMode::Card } + + # @!attribute cardholder + # Cardholder Presence Indicator + # + # @return [Symbol, Lithic::Models::CardAuthorization::Pos::EntryMode::Cardholder, nil] + optional :cardholder, enum: -> { Lithic::CardAuthorization::Pos::EntryMode::Cardholder } + + # @!attribute pan + # Method of entry for the PAN + # + # @return [Symbol, Lithic::Models::CardAuthorization::Pos::EntryMode::Pan, nil] + optional :pan, enum: -> { Lithic::CardAuthorization::Pos::EntryMode::Pan } + + # @!attribute pin_entered + # Indicates whether the cardholder entered the PIN. True if the PIN was entered. + # + # @return [Boolean, nil] + optional :pin_entered, Lithic::Internal::Type::Boolean + + # @!method initialize(card: nil, cardholder: nil, pan: nil, pin_entered: nil) + # POS > Entry Mode object in ASA + # + # @param card [Symbol, Lithic::Models::CardAuthorization::Pos::EntryMode::Card] Card Presence Indicator + # + # @param cardholder [Symbol, Lithic::Models::CardAuthorization::Pos::EntryMode::Cardholder] Cardholder Presence Indicator + # + # @param pan [Symbol, Lithic::Models::CardAuthorization::Pos::EntryMode::Pan] Method of entry for the PAN + # + # @param pin_entered [Boolean] Indicates whether the cardholder entered the PIN. True if the PIN was entered. + + # Card Presence Indicator + # + # @see Lithic::Models::CardAuthorization::Pos::EntryMode#card + module Card + extend Lithic::Internal::Type::Enum + + PRESENT = :PRESENT + NOT_PRESENT = :NOT_PRESENT + UNKNOWN = :UNKNOWN + + # @!method self.values + # @return [Array] + end + + # Cardholder Presence Indicator + # + # @see Lithic::Models::CardAuthorization::Pos::EntryMode#cardholder + module Cardholder + extend Lithic::Internal::Type::Enum + + DEFERRED_BILLING = :DEFERRED_BILLING + ELECTRONIC_ORDER = :ELECTRONIC_ORDER + INSTALLMENT = :INSTALLMENT + MAIL_ORDER = :MAIL_ORDER + NOT_PRESENT = :NOT_PRESENT + PRESENT = :PRESENT + REOCCURRING = :REOCCURRING + TELEPHONE_ORDER = :TELEPHONE_ORDER + UNKNOWN = :UNKNOWN + + # @!method self.values + # @return [Array] + end + + # Method of entry for the PAN + # + # @see Lithic::Models::CardAuthorization::Pos::EntryMode#pan + module Pan + extend Lithic::Internal::Type::Enum + + AUTO_ENTRY = :AUTO_ENTRY + BAR_CODE = :BAR_CODE + CONTACTLESS = :CONTACTLESS + ECOMMERCE = :ECOMMERCE + ERROR_KEYED = :ERROR_KEYED + ERROR_MAGNETIC_STRIPE = :ERROR_MAGNETIC_STRIPE + ICC = :ICC + KEY_ENTERED = :KEY_ENTERED + MAGNETIC_STRIPE = :MAGNETIC_STRIPE + MANUAL = :MANUAL + OCR = :OCR + SECURE_CARDLESS = :SECURE_CARDLESS + UNSPECIFIED = :UNSPECIFIED + UNKNOWN = :UNKNOWN + CREDENTIAL_ON_FILE = :CREDENTIAL_ON_FILE + + # @!method self.values + # @return [Array] + end + end + + # @see Lithic::Models::CardAuthorization::Pos#terminal + class Terminal < Lithic::Internal::Type::BaseModel + # @!attribute attended + # True if a clerk is present at the sale. + # + # @return [Boolean] + required :attended, Lithic::Internal::Type::Boolean + + # @!attribute card_retention_capable + # True if the terminal is capable of retaining the card. + # + # @return [Boolean] + required :card_retention_capable, Lithic::Internal::Type::Boolean + + # @!attribute on_premise + # True if the sale was made at the place of business (vs. mobile). + # + # @return [Boolean] + required :on_premise, Lithic::Internal::Type::Boolean + + # @!attribute operator + # The person that is designated to swipe the card + # + # @return [Symbol, Lithic::Models::CardAuthorization::Pos::Terminal::Operator] + required :operator, enum: -> { Lithic::CardAuthorization::Pos::Terminal::Operator } + + # @!attribute partial_approval_capable + # True if the terminal is capable of partial approval. Partial approval is when + # part of a transaction is approved and another payment must be used for the + # remainder. Example scenario: A $40 transaction is attempted on a prepaid card + # with a $25 balance. If partial approval is enabled, $25 can be authorized, at + # which point the POS will prompt the user for an additional payment of $15. + # + # @return [Boolean] + required :partial_approval_capable, Lithic::Internal::Type::Boolean + + # @!attribute pin_capability + # Status of whether the POS is able to accept PINs + # + # @return [Symbol, Lithic::Models::CardAuthorization::Pos::Terminal::PinCapability] + required :pin_capability, enum: -> { Lithic::CardAuthorization::Pos::Terminal::PinCapability } + + # @!attribute type + # POS Type + # + # @return [Symbol, Lithic::Models::CardAuthorization::Pos::Terminal::Type] + required :type, enum: -> { Lithic::CardAuthorization::Pos::Terminal::Type } + + # @!attribute acceptor_terminal_id + # Uniquely identifies a terminal at the card acceptor location of acquiring + # institutions or merchant POS Systems. Left justified with trailing spaces. + # + # @return [String, nil] + optional :acceptor_terminal_id, String, nil?: true + + # @!method initialize(attended:, card_retention_capable:, on_premise:, operator:, partial_approval_capable:, pin_capability:, type:, acceptor_terminal_id: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardAuthorization::Pos::Terminal} for more details. + # + # @param attended [Boolean] True if a clerk is present at the sale. + # + # @param card_retention_capable [Boolean] True if the terminal is capable of retaining the card. + # + # @param on_premise [Boolean] True if the sale was made at the place of business (vs. mobile). + # + # @param operator [Symbol, Lithic::Models::CardAuthorization::Pos::Terminal::Operator] The person that is designated to swipe the card + # + # @param partial_approval_capable [Boolean] True if the terminal is capable of partial approval. Partial approval is when pa + # + # @param pin_capability [Symbol, Lithic::Models::CardAuthorization::Pos::Terminal::PinCapability] Status of whether the POS is able to accept PINs + # + # @param type [Symbol, Lithic::Models::CardAuthorization::Pos::Terminal::Type] POS Type + # + # @param acceptor_terminal_id [String, nil] Uniquely identifies a terminal at the card acceptor location of acquiring instit + + # The person that is designated to swipe the card + # + # @see Lithic::Models::CardAuthorization::Pos::Terminal#operator + module Operator + extend Lithic::Internal::Type::Enum + + ADMINISTRATIVE = :ADMINISTRATIVE + CARDHOLDER = :CARDHOLDER + CARD_ACCEPTOR = :CARD_ACCEPTOR + UNKNOWN = :UNKNOWN + + # @!method self.values + # @return [Array] + end + + # Status of whether the POS is able to accept PINs + # + # @see Lithic::Models::CardAuthorization::Pos::Terminal#pin_capability + module PinCapability + extend Lithic::Internal::Type::Enum + + CAPABLE = :CAPABLE + INOPERATIVE = :INOPERATIVE + NOT_CAPABLE = :NOT_CAPABLE + UNSPECIFIED = :UNSPECIFIED + + # @!method self.values + # @return [Array] + end + + # POS Type + # + # @see Lithic::Models::CardAuthorization::Pos::Terminal#type + module Type + extend Lithic::Internal::Type::Enum + + ADMINISTRATIVE = :ADMINISTRATIVE + ATM = :ATM + AUTHORIZATION = :AUTHORIZATION + COUPON_MACHINE = :COUPON_MACHINE + DIAL_TERMINAL = :DIAL_TERMINAL + ECOMMERCE = :ECOMMERCE + ECR = :ECR + FUEL_MACHINE = :FUEL_MACHINE + HOME_TERMINAL = :HOME_TERMINAL + MICR = :MICR + OFF_PREMISE = :OFF_PREMISE + PAYMENT = :PAYMENT + PDA = :PDA + PHONE = :PHONE + POINT = :POINT + POS_TERMINAL = :POS_TERMINAL + PUBLIC_UTILITY = :PUBLIC_UTILITY + SELF_SERVICE = :SELF_SERVICE + TELEVISION = :TELEVISION + TELLER = :TELLER + TRAVELERS_CHECK_MACHINE = :TRAVELERS_CHECK_MACHINE + VENDING = :VENDING + VOICE = :VOICE + UNKNOWN = :UNKNOWN + + # @!method self.values + # @return [Array] + end + end + end + end + end +end diff --git a/lib/lithic/models/card_authorization_approval_request_webhook_event.rb b/lib/lithic/models/card_authorization_approval_request_webhook_event.rb new file mode 100644 index 00000000..fd63274e --- /dev/null +++ b/lib/lithic/models/card_authorization_approval_request_webhook_event.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardAuthorizationApprovalRequestWebhookEvent < Lithic::Models::CardAuthorization + # @!attribute event_type + # + # @return [Symbol, :"card_authorization.approval_request"] + required :event_type, const: :"card_authorization.approval_request" + + # @!method initialize(event_type: :"card_authorization.approval_request") + # The Auth Stream Access request payload that was sent to the ASA responder. + # + # @param event_type [Symbol, :"card_authorization.approval_request"] + end + end +end diff --git a/lib/lithic/models/card_authorization_challenge_response_params.rb b/lib/lithic/models/card_authorization_challenge_response_params.rb new file mode 100644 index 00000000..0b70fcef --- /dev/null +++ b/lib/lithic/models/card_authorization_challenge_response_params.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::CardAuthorizations#challenge_response + class CardAuthorizationChallengeResponseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute event_token + # + # @return [String] + required :event_token, String + + # @!attribute response + # Whether the cardholder has approved or declined the issued challenge + # + # @return [Symbol, Lithic::Models::CardAuthorizationChallengeResponseParams::Response] + required :response, enum: -> { Lithic::CardAuthorizationChallengeResponseParams::Response } + + # @!method initialize(event_token:, response:, request_options: {}) + # @param event_token [String] + # + # @param response [Symbol, Lithic::Models::CardAuthorizationChallengeResponseParams::Response] Whether the cardholder has approved or declined the issued challenge + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Whether the cardholder has approved or declined the issued challenge + module Response + extend Lithic::Internal::Type::Enum + + APPROVE = :APPROVE + DECLINE = :DECLINE + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/card_authorization_challenge_response_webhook_event.rb b/lib/lithic/models/card_authorization_challenge_response_webhook_event.rb new file mode 100644 index 00000000..da5de964 --- /dev/null +++ b/lib/lithic/models/card_authorization_challenge_response_webhook_event.rb @@ -0,0 +1,104 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardAuthorizationChallengeResponseWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute card_token + # The token of the card associated with the challenge + # + # @return [String, nil] + required :card_token, String, nil?: true + + # @!attribute challenge_method + # The method used to deliver the challenge to the cardholder + # + # @return [Symbol, Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent::ChallengeMethod] + required :challenge_method, + enum: -> { Lithic::CardAuthorizationChallengeResponseWebhookEvent::ChallengeMethod } + + # @!attribute completed + # The timestamp of when the challenge was completed + # + # @return [Time, nil] + required :completed, Time, nil?: true + + # @!attribute created + # The timestamp of when the challenge was created + # + # @return [Time] + required :created, Time + + # @!attribute event_token + # Globally unique identifier for the event + # + # @return [String] + required :event_token, String + + # @!attribute event_type + # Event type + # + # @return [Symbol, :"card_authorization.challenge_response"] + required :event_type, const: :"card_authorization.challenge_response" + + # @!attribute response + # The cardholder's response to the challenge + # + # @return [Symbol, Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent::Response] + required :response, enum: -> { Lithic::CardAuthorizationChallengeResponseWebhookEvent::Response } + + # @!attribute transaction_token + # The token of the transaction associated with the authorization event being + # challenged + # + # @return [String, nil] + required :transaction_token, String, nil?: true + + # @!method initialize(card_token:, challenge_method:, completed:, created:, event_token:, response:, transaction_token:, event_type: :"card_authorization.challenge_response") + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent} for more + # details. + # + # @param card_token [String, nil] The token of the card associated with the challenge + # + # @param challenge_method [Symbol, Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent::ChallengeMethod] The method used to deliver the challenge to the cardholder + # + # @param completed [Time, nil] The timestamp of when the challenge was completed + # + # @param created [Time] The timestamp of when the challenge was created + # + # @param event_token [String] Globally unique identifier for the event + # + # @param response [Symbol, Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent::Response] The cardholder's response to the challenge + # + # @param transaction_token [String, nil] The token of the transaction associated with the authorization event being chall + # + # @param event_type [Symbol, :"card_authorization.challenge_response"] Event type + + # The method used to deliver the challenge to the cardholder + # + # @see Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent#challenge_method + module ChallengeMethod + extend Lithic::Internal::Type::Enum + + SMS = :SMS + OUT_OF_BAND = :OUT_OF_BAND + + # @!method self.values + # @return [Array] + end + + # The cardholder's response to the challenge + # + # @see Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent#response + module Response + extend Lithic::Internal::Type::Enum + + APPROVE = :APPROVE + DECLINE = :DECLINE + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/card_authorization_challenge_webhook_event.rb b/lib/lithic/models/card_authorization_challenge_webhook_event.rb new file mode 100644 index 00000000..48b95d5f --- /dev/null +++ b/lib/lithic/models/card_authorization_challenge_webhook_event.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardAuthorizationChallengeWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute authorization + # The authorization that triggered the challenge + # + # @return [Lithic::Models::CardAuthorization] + required :authorization, -> { Lithic::CardAuthorization } + + # @!attribute challenge + # Details of the Authorization Challenge issued during card authorization + # + # @return [Lithic::Models::CardAuthorizationChallengeWebhookEvent::Challenge] + required :challenge, -> { Lithic::CardAuthorizationChallengeWebhookEvent::Challenge } + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"card_authorization.challenge"] + required :event_type, const: :"card_authorization.challenge" + + # @!method initialize(authorization:, challenge:, event_type: :"card_authorization.challenge") + # @param authorization [Lithic::Models::CardAuthorization] The authorization that triggered the challenge + # + # @param challenge [Lithic::Models::CardAuthorizationChallengeWebhookEvent::Challenge] Details of the Authorization Challenge issued during card authorization + # + # @param event_type [Symbol, :"card_authorization.challenge"] The type of event that occurred. + + # @see Lithic::Models::CardAuthorizationChallengeWebhookEvent#challenge + class Challenge < Lithic::Internal::Type::BaseModel + # @!attribute event_token + # Globally unique identifier for the event that triggered the challenge. Use this + # token when calling the challenge response endpoint + # + # @return [String] + required :event_token, String + + # @!attribute expiry_time + # ISO-8601 time at which the challenge expires + # + # @return [Time] + required :expiry_time, Time + + # @!attribute start_time + # ISO-8601 time at which the challenge was issued + # + # @return [Time] + required :start_time, Time + + # @!method initialize(event_token:, expiry_time:, start_time:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardAuthorizationChallengeWebhookEvent::Challenge} for more + # details. + # + # Details of the Authorization Challenge issued during card authorization + # + # @param event_token [String] Globally unique identifier for the event that triggered the challenge. Use this + # + # @param expiry_time [Time] ISO-8601 time at which the challenge expires + # + # @param start_time [Time] ISO-8601 time at which the challenge was issued + end + end + end +end diff --git a/lib/lithic/models/card_bulk_order.rb b/lib/lithic/models/card_bulk_order.rb new file mode 100644 index 00000000..798f03be --- /dev/null +++ b/lib/lithic/models/card_bulk_order.rb @@ -0,0 +1,111 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::CardBulkOrders#create + class CardBulkOrder < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for the bulk order + # + # @return [String] + required :token, String + + # @!attribute card_tokens + # List of card tokens associated with this bulk order + # + # @return [Array] + required :card_tokens, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute created + # An RFC 3339 timestamp for when the bulk order was created. UTC time zone + # + # @return [Time] + required :created, Time + + # @!attribute customer_product_id + # Customer-specified product configuration for physical card manufacturing. This + # must be configured with Lithic before use + # + # @return [String, nil] + required :customer_product_id, String, nil?: true + + # @!attribute shipping_address + # Shipping address for all cards in this bulk order + # + # @return [Object] + required :shipping_address, Lithic::Internal::Type::Unknown + + # @!attribute shipping_method + # Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and + # BULK_EXPRESS are only available with Perfect Plastic Printing + # + # @return [Symbol, Lithic::Models::CardBulkOrder::ShippingMethod] + required :shipping_method, enum: -> { Lithic::CardBulkOrder::ShippingMethod } + + # @!attribute status + # Status of the bulk order. OPEN indicates the order is accepting cards. LOCKED + # indicates the order is finalized and no more cards can be added + # + # @return [Symbol, Lithic::Models::CardBulkOrder::Status] + required :status, enum: -> { Lithic::CardBulkOrder::Status } + + # @!attribute updated + # An RFC 3339 timestamp for when the bulk order was last updated. UTC time zone + # + # @return [Time] + required :updated, Time + + # @!method initialize(token:, card_tokens:, created:, customer_product_id:, shipping_address:, shipping_method:, status:, updated:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardBulkOrder} for more details. + # + # Represents a bulk order for physical card shipments + # + # @param token [String] Globally unique identifier for the bulk order + # + # @param card_tokens [Array] List of card tokens associated with this bulk order + # + # @param created [Time] An RFC 3339 timestamp for when the bulk order was created. UTC time zone + # + # @param customer_product_id [String, nil] Customer-specified product configuration for physical card manufacturing. This m + # + # @param shipping_address [Object] Shipping address for all cards in this bulk order + # + # @param shipping_method [Symbol, Lithic::Models::CardBulkOrder::ShippingMethod] Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and + # + # @param status [Symbol, Lithic::Models::CardBulkOrder::Status] Status of the bulk order. OPEN indicates the order is accepting cards. LOCKED in + # + # @param updated [Time] An RFC 3339 timestamp for when the bulk order was last updated. UTC time zone + + # Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and + # BULK_EXPRESS are only available with Perfect Plastic Printing + # + # @see Lithic::Models::CardBulkOrder#shipping_method + module ShippingMethod + extend Lithic::Internal::Type::Enum + + BULK_EXPEDITED = :BULK_EXPEDITED + BULK_PRIORITY = :BULK_PRIORITY + BULK_2_DAY = :BULK_2_DAY + BULK_EXPRESS = :BULK_EXPRESS + + # @!method self.values + # @return [Array] + end + + # Status of the bulk order. OPEN indicates the order is accepting cards. LOCKED + # indicates the order is finalized and no more cards can be added + # + # @see Lithic::Models::CardBulkOrder#status + module Status + extend Lithic::Internal::Type::Enum + + OPEN = :OPEN + LOCKED = :LOCKED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/card_bulk_order_create_params.rb b/lib/lithic/models/card_bulk_order_create_params.rb new file mode 100644 index 00000000..40b2d649 --- /dev/null +++ b/lib/lithic/models/card_bulk_order_create_params.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::CardBulkOrders#create + class CardBulkOrderCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute customer_product_id + # Customer-specified product configuration for physical card manufacturing. This + # must be configured with Lithic before use + # + # @return [String] + required :customer_product_id, String + + # @!attribute shipping_address + # Shipping address for all cards in this bulk order + # + # @return [Object] + required :shipping_address, Lithic::Internal::Type::Unknown + + # @!attribute shipping_method + # Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and + # BULK_EXPRESS are only available with Perfect Plastic Printing + # + # @return [Symbol, Lithic::Models::CardBulkOrderCreateParams::ShippingMethod] + required :shipping_method, enum: -> { Lithic::CardBulkOrderCreateParams::ShippingMethod } + + # @!method initialize(customer_product_id:, shipping_address:, shipping_method:, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardBulkOrderCreateParams} for more details. + # + # @param customer_product_id [String] Customer-specified product configuration for physical card manufacturing. This m + # + # @param shipping_address [Object] Shipping address for all cards in this bulk order + # + # @param shipping_method [Symbol, Lithic::Models::CardBulkOrderCreateParams::ShippingMethod] Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and + # BULK_EXPRESS are only available with Perfect Plastic Printing + module ShippingMethod + extend Lithic::Internal::Type::Enum + + BULK_EXPEDITED = :BULK_EXPEDITED + BULK_PRIORITY = :BULK_PRIORITY + BULK_2_DAY = :BULK_2_DAY + BULK_EXPRESS = :BULK_EXPRESS + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/card_bulk_order_list_params.rb b/lib/lithic/models/card_bulk_order_list_params.rb new file mode 100644 index 00000000..ef807c92 --- /dev/null +++ b/lib/lithic/models/card_bulk_order_list_params.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::CardBulkOrders#list + class CardBulkOrderListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time + + # @!attribute end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!method initialize(begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardBulkOrderListParams} for more details. + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/card_bulk_order_retrieve_params.rb b/lib/lithic/models/card_bulk_order_retrieve_params.rb new file mode 100644 index 00000000..792e719d --- /dev/null +++ b/lib/lithic/models/card_bulk_order_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::CardBulkOrders#retrieve + class CardBulkOrderRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute bulk_order_token + # + # @return [String] + required :bulk_order_token, String + + # @!method initialize(bulk_order_token:, request_options: {}) + # @param bulk_order_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/card_bulk_order_update_params.rb b/lib/lithic/models/card_bulk_order_update_params.rb new file mode 100644 index 00000000..eb159acd --- /dev/null +++ b/lib/lithic/models/card_bulk_order_update_params.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::CardBulkOrders#update + class CardBulkOrderUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute bulk_order_token + # + # @return [String] + required :bulk_order_token, String + + # @!attribute status + # Status to update the bulk order to. Use LOCKED to finalize the order + # + # @return [Symbol, Lithic::Models::CardBulkOrderUpdateParams::Status] + required :status, enum: -> { Lithic::CardBulkOrderUpdateParams::Status } + + # @!method initialize(bulk_order_token:, status:, request_options: {}) + # @param bulk_order_token [String] + # + # @param status [Symbol, Lithic::Models::CardBulkOrderUpdateParams::Status] Status to update the bulk order to. Use LOCKED to finalize the order + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Status to update the bulk order to. Use LOCKED to finalize the order + module Status + extend Lithic::Internal::Type::Enum + + LOCKED = :LOCKED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/card_convert_physical_params.rb b/lib/lithic/models/card_convert_physical_params.rb new file mode 100644 index 00000000..efae78ae --- /dev/null +++ b/lib/lithic/models/card_convert_physical_params.rb @@ -0,0 +1,104 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Cards#convert_physical + class CardConvertPhysicalParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute card_token + # + # @return [String] + required :card_token, String + + # @!attribute shipping_address + # The shipping address this card will be sent to. + # + # @return [Lithic::Models::ShippingAddress] + required :shipping_address, -> { Lithic::ShippingAddress } + + # @!attribute carrier + # If omitted, the previous carrier will be used. + # + # @return [Lithic::Models::Carrier, nil] + optional :carrier, -> { Lithic::Carrier } + + # @!attribute product_id + # Specifies the configuration (e.g. physical card art) that the card should be + # manufactured with, and only applies to cards of type `PHYSICAL`. This must be + # configured with Lithic before use. + # + # @return [String, nil] + optional :product_id, String + + # @!attribute shipping_method + # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of + # options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx or UPS depending on card manufacturer, Express, 3-day + # shipping, with tracking + # - `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with + # tracking + # - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight + # or similar international option, with tracking + # - `BULK` - Card will be shipped as part of a bulk fulfillment order. The + # shipping method and timeline are inherited from the parent bulk order. + # + # @return [Symbol, Lithic::Models::CardConvertPhysicalParams::ShippingMethod, nil] + optional :shipping_method, enum: -> { Lithic::CardConvertPhysicalParams::ShippingMethod } + + # @!method initialize(card_token:, shipping_address:, carrier: nil, product_id: nil, shipping_method: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardConvertPhysicalParams} for more details. + # + # @param card_token [String] + # + # @param shipping_address [Lithic::Models::ShippingAddress] The shipping address this card will be sent to. + # + # @param carrier [Lithic::Models::Carrier] If omitted, the previous carrier will be used. + # + # @param product_id [String] Specifies the configuration (e.g. physical card art) that the card should be man + # + # @param shipping_method [Symbol, Lithic::Models::CardConvertPhysicalParams::ShippingMethod] Shipping method for the card. Only applies to cards of type PHYSICAL. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of + # options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx or UPS depending on card manufacturer, Express, 3-day + # shipping, with tracking + # - `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with + # tracking + # - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight + # or similar international option, with tracking + # - `BULK` - Card will be shipped as part of a bulk fulfillment order. The + # shipping method and timeline are inherited from the parent bulk order. + module ShippingMethod + extend Lithic::Internal::Type::Enum + + SHIPPING_METHOD_2_DAY = :"2_DAY" + BULK = :BULK + EXPEDITED = :EXPEDITED + EXPRESS = :EXPRESS + PRIORITY = :PRIORITY + STANDARD = :STANDARD + STANDARD_WITH_TRACKING = :STANDARD_WITH_TRACKING + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/card_converted_webhook_event.rb b/lib/lithic/models/card_converted_webhook_event.rb new file mode 100644 index 00000000..4aca6451 --- /dev/null +++ b/lib/lithic/models/card_converted_webhook_event.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardConvertedWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute card_token + # The token of the card that was created. + # + # @return [String] + required :card_token, String + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"card.converted"] + required :event_type, const: :"card.converted" + + # @!method initialize(card_token:, event_type: :"card.converted") + # @param card_token [String] The token of the card that was created. + # + # @param event_type [Symbol, :"card.converted"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/card_create_params.rb b/lib/lithic/models/card_create_params.rb new file mode 100644 index 00000000..eebe84a7 --- /dev/null +++ b/lib/lithic/models/card_create_params.rb @@ -0,0 +1,409 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Cards#create + class CardCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute type + # Card types: + # + # - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital + # wallet like Apple Pay or Google Pay (if the card program is digital + # wallet-enabled). + # - `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label + # branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality. + # Reach out at [lithic.com/contact](https://lithic.com/contact) for more + # information. + # - `SINGLE_USE` - Card is closed upon first successful authorization. + # - `MERCHANT_LOCKED` - Card is locked to the first merchant that successfully + # authorizes the card. + # - `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use + # VIRTUAL instead. + # - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please + # use VIRTUAL instead. + # + # @return [Symbol, Lithic::Models::CardCreateParams::Type] + required :type, enum: -> { Lithic::CardCreateParams::Type } + + # @!attribute account_token + # Globally unique identifier for the account that the card will be associated + # with. Required for programs enrolling users using the + # [/account_holders endpoint](https://docs.lithic.com/docs/account-holders-kyc). + # See [Managing Your Program](doc:managing-your-program) for more information. + # + # @return [String, nil] + optional :account_token, String + + # @!attribute bulk_order_token + # Globally unique identifier for an existing bulk order to associate this card + # with. When specified, the card will be added to the bulk order for batch + # shipment. Only applicable to cards of type PHYSICAL + # + # @return [String, nil] + optional :bulk_order_token, String + + # @!attribute card_program_token + # For card programs with more than one BIN range. This must be configured with + # Lithic before use. Identifies the card program/BIN range under which to create + # the card. If omitted, will utilize the program's default `card_program_token`. + # In Sandbox, use 00000000-0000-0000-1000-000000000000 and + # 00000000-0000-0000-2000-000000000000 to test creating cards on specific card + # programs. + # + # @return [String, nil] + optional :card_program_token, String + + # @!attribute carrier + # + # @return [Lithic::Models::Carrier, nil] + optional :carrier, -> { Lithic::Carrier } + + # @!attribute digital_card_art_token + # Specifies the digital card art to be displayed in the user’s digital wallet + # after tokenization. This artwork must be approved by Mastercard and configured + # by Lithic to use. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + # + # @return [String, nil] + optional :digital_card_art_token, String + + # @!attribute exp_month + # Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, + # an expiration date five years in the future will be generated. Five years is the + # maximum expiration date. + # + # @return [String, nil] + optional :exp_month, String + + # @!attribute exp_year + # Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is + # provided, an expiration date five years in the future will be generated. Five + # years is the maximum expiration date. + # + # @return [String, nil] + optional :exp_year, String + + # @!attribute memo + # Friendly name to identify the card. + # + # @return [String, nil] + optional :memo, String + + # @!attribute pin + # Encrypted PIN block (in base64). Applies to cards of type `PHYSICAL` and + # `VIRTUAL`. See + # [Encrypted PIN Block](https://docs.lithic.com/docs/cards#encrypted-pin-block). + # + # @return [String, nil] + optional :pin, String + + # @!attribute product_id + # Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic + # before use. Specifies the configuration (i.e., physical card art) that the card + # should be manufactured with. + # + # @return [String, nil] + optional :product_id, String + + # @!attribute replacement_account_token + # Restricted field limited to select use cases. Lithic will reach out directly if + # this field should be used. Globally unique identifier for the replacement card's + # account. If this field is specified, `replacement_for` must also be specified. + # If `replacement_for` is specified and this field is omitted, the replacement + # card's account will be inferred from the card being replaced. + # + # @return [String, nil] + optional :replacement_account_token, String + + # @!attribute replacement_comment + # Additional context or information related to the card that this card will + # replace. + # + # @return [String, nil] + optional :replacement_comment, String + + # @!attribute replacement_for + # Globally unique identifier for the card that this card will replace. If the card + # type is `PHYSICAL` it will be replaced by a `PHYSICAL` card. If the card type is + # `VIRTUAL` it will be replaced by a `VIRTUAL` card. + # + # @return [String, nil] + optional :replacement_for, String + + # @!attribute replacement_substatus + # Card state substatus values for the card that this card will replace: + # + # - `LOST` - The physical card is no longer in the cardholder's possession due to + # being lost or never received by the cardholder. + # - `COMPROMISED` - Card information has been exposed, potentially leading to + # unauthorized access. This may involve physical card theft, cloning, or online + # data breaches. + # - `DAMAGED` - The physical card is not functioning properly, such as having chip + # failures or a demagnetized magnetic stripe. + # - `END_USER_REQUEST` - The cardholder requested the closure of the card for + # reasons unrelated to fraud or damage, such as switching to a different product + # or closing the account. + # - `ISSUER_REQUEST` - The issuer closed the card for reasons unrelated to fraud + # or damage, such as account inactivity, product or policy changes, or + # technology upgrades. + # - `NOT_ACTIVE` - The card hasn’t had any transaction activity for a specified + # period, applicable to statuses like `PAUSED` or `CLOSED`. + # - `SUSPICIOUS_ACTIVITY` - The card has one or more suspicious transactions or + # activities that require review. This can involve prompting the cardholder to + # confirm legitimate use or report confirmed fraud. + # - `INTERNAL_REVIEW` - The card is temporarily paused pending further internal + # review. + # - `EXPIRED` - The card has expired and has been closed without being reissued. + # - `UNDELIVERABLE` - The card cannot be delivered to the cardholder and has been + # returned. + # - `OTHER` - The reason for the status does not fall into any of the above + # categories. A comment should be provided to specify the reason. + # + # @return [Symbol, Lithic::Models::CardCreateParams::ReplacementSubstatus, nil] + optional :replacement_substatus, enum: -> { Lithic::CardCreateParams::ReplacementSubstatus } + + # @!attribute shipping_address + # + # @return [Lithic::Models::ShippingAddress, nil] + optional :shipping_address, -> { Lithic::ShippingAddress } + + # @!attribute shipping_method + # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of + # options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx or UPS depending on card manufacturer, Express, 3-day + # shipping, with tracking + # - `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with + # tracking + # - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight + # or similar international option, with tracking + # - `BULK` - Card will be shipped as part of a bulk fulfillment order. The + # shipping method and timeline are inherited from the parent bulk order. + # + # @return [Symbol, Lithic::Models::CardCreateParams::ShippingMethod, nil] + optional :shipping_method, enum: -> { Lithic::CardCreateParams::ShippingMethod } + + # @!attribute spend_limit + # Amount (in cents) to limit approved authorizations (e.g. 100000 would be a + # $1,000 limit). Transaction requests above the spend limit will be declined. Note + # that a spend limit of 0 is effectively no limit, and should only be used to + # reset or remove a prior limit. Only a limit of 1 or above will result in + # declined transactions due to checks against the card limit. + # + # @return [Integer, nil] + optional :spend_limit, Integer + + # @!attribute spend_limit_duration + # Spend limit duration values: + # + # - `ANNUALLY` - Card will authorize transactions up to spend limit for the + # trailing year. + # - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime + # of the card. + # - `MONTHLY` - Card will authorize transactions up to spend limit for the + # trailing month. To support recurring monthly payments, which can occur on + # different day every month, the time window we consider for monthly velocity + # starts 6 days after the current calendar date one month prior. + # - `TRANSACTION` - Card will authorize multiple transactions if each individual + # transaction is under the spend limit. + # + # @return [Symbol, Lithic::Models::SpendLimitDuration, nil] + optional :spend_limit_duration, enum: -> { Lithic::SpendLimitDuration } + + # @!attribute state + # Card state values: + # + # - `OPEN` - Card will approve authorizations (if they match card and account + # parameters). + # - `PAUSED` - Card will decline authorizations, but can be resumed at a later + # time. + # + # @return [Symbol, Lithic::Models::CardCreateParams::State, nil] + optional :state, enum: -> { Lithic::CardCreateParams::State } + + # @!attribute idempotency_key + # + # @return [String, nil] + optional :idempotency_key, String + + # @!method initialize(type:, account_token: nil, bulk_order_token: nil, card_program_token: nil, carrier: nil, digital_card_art_token: nil, exp_month: nil, exp_year: nil, memo: nil, pin: nil, product_id: nil, replacement_account_token: nil, replacement_comment: nil, replacement_for: nil, replacement_substatus: nil, shipping_address: nil, shipping_method: nil, spend_limit: nil, spend_limit_duration: nil, state: nil, idempotency_key: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardCreateParams} for more details. + # + # @param type [Symbol, Lithic::Models::CardCreateParams::Type] Card types: + # + # @param account_token [String] Globally unique identifier for the account that the card will be associated with + # + # @param bulk_order_token [String] Globally unique identifier for an existing bulk order to associate this card wit + # + # @param card_program_token [String] For card programs with more than one BIN range. This must be configured with Lit + # + # @param carrier [Lithic::Models::Carrier] + # + # @param digital_card_art_token [String] Specifies the digital card art to be displayed in the user’s digital wallet afte + # + # @param exp_month [String] Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, + # + # @param exp_year [String] Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is provided + # + # @param memo [String] Friendly name to identify the card. + # + # @param pin [String] Encrypted PIN block (in base64). Applies to cards of type `PHYSICAL` and `VIRTUA + # + # @param product_id [String] Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic + # + # @param replacement_account_token [String] Restricted field limited to select use cases. Lithic will reach out directly if + # + # @param replacement_comment [String] Additional context or information related to the card that this card will replac + # + # @param replacement_for [String] Globally unique identifier for the card that this card will replace. If the card + # + # @param replacement_substatus [Symbol, Lithic::Models::CardCreateParams::ReplacementSubstatus] Card state substatus values for the card that this card will replace: + # + # @param shipping_address [Lithic::Models::ShippingAddress] + # + # @param shipping_method [Symbol, Lithic::Models::CardCreateParams::ShippingMethod] Shipping method for the card. Only applies to cards of type PHYSICAL. + # + # @param spend_limit [Integer] Amount (in cents) to limit approved authorizations (e.g. 100000 would be a $1,00 + # + # @param spend_limit_duration [Symbol, Lithic::Models::SpendLimitDuration] Spend limit duration values: + # + # @param state [Symbol, Lithic::Models::CardCreateParams::State] Card state values: + # + # @param idempotency_key [String] + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Card types: + # + # - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital + # wallet like Apple Pay or Google Pay (if the card program is digital + # wallet-enabled). + # - `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label + # branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality. + # Reach out at [lithic.com/contact](https://lithic.com/contact) for more + # information. + # - `SINGLE_USE` - Card is closed upon first successful authorization. + # - `MERCHANT_LOCKED` - Card is locked to the first merchant that successfully + # authorizes the card. + # - `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use + # VIRTUAL instead. + # - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please + # use VIRTUAL instead. + module Type + extend Lithic::Internal::Type::Enum + + MERCHANT_LOCKED = :MERCHANT_LOCKED + PHYSICAL = :PHYSICAL + SINGLE_USE = :SINGLE_USE + VIRTUAL = :VIRTUAL + UNLOCKED = :UNLOCKED + DIGITAL_WALLET = :DIGITAL_WALLET + + # @!method self.values + # @return [Array] + end + + # Card state substatus values for the card that this card will replace: + # + # - `LOST` - The physical card is no longer in the cardholder's possession due to + # being lost or never received by the cardholder. + # - `COMPROMISED` - Card information has been exposed, potentially leading to + # unauthorized access. This may involve physical card theft, cloning, or online + # data breaches. + # - `DAMAGED` - The physical card is not functioning properly, such as having chip + # failures or a demagnetized magnetic stripe. + # - `END_USER_REQUEST` - The cardholder requested the closure of the card for + # reasons unrelated to fraud or damage, such as switching to a different product + # or closing the account. + # - `ISSUER_REQUEST` - The issuer closed the card for reasons unrelated to fraud + # or damage, such as account inactivity, product or policy changes, or + # technology upgrades. + # - `NOT_ACTIVE` - The card hasn’t had any transaction activity for a specified + # period, applicable to statuses like `PAUSED` or `CLOSED`. + # - `SUSPICIOUS_ACTIVITY` - The card has one or more suspicious transactions or + # activities that require review. This can involve prompting the cardholder to + # confirm legitimate use or report confirmed fraud. + # - `INTERNAL_REVIEW` - The card is temporarily paused pending further internal + # review. + # - `EXPIRED` - The card has expired and has been closed without being reissued. + # - `UNDELIVERABLE` - The card cannot be delivered to the cardholder and has been + # returned. + # - `OTHER` - The reason for the status does not fall into any of the above + # categories. A comment should be provided to specify the reason. + module ReplacementSubstatus + extend Lithic::Internal::Type::Enum + + LOST = :LOST + COMPROMISED = :COMPROMISED + DAMAGED = :DAMAGED + END_USER_REQUEST = :END_USER_REQUEST + ISSUER_REQUEST = :ISSUER_REQUEST + NOT_ACTIVE = :NOT_ACTIVE + SUSPICIOUS_ACTIVITY = :SUSPICIOUS_ACTIVITY + INTERNAL_REVIEW = :INTERNAL_REVIEW + EXPIRED = :EXPIRED + UNDELIVERABLE = :UNDELIVERABLE + OTHER = :OTHER + + # @!method self.values + # @return [Array] + end + + # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of + # options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx or UPS depending on card manufacturer, Express, 3-day + # shipping, with tracking + # - `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with + # tracking + # - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight + # or similar international option, with tracking + # - `BULK` - Card will be shipped as part of a bulk fulfillment order. The + # shipping method and timeline are inherited from the parent bulk order. + module ShippingMethod + extend Lithic::Internal::Type::Enum + + SHIPPING_METHOD_2_DAY = :"2_DAY" + BULK = :BULK + EXPEDITED = :EXPEDITED + EXPRESS = :EXPRESS + PRIORITY = :PRIORITY + STANDARD = :STANDARD + STANDARD_WITH_TRACKING = :STANDARD_WITH_TRACKING + + # @!method self.values + # @return [Array] + end + + # Card state values: + # + # - `OPEN` - Card will approve authorizations (if they match card and account + # parameters). + # - `PAUSED` - Card will decline authorizations, but can be resumed at a later + # time. + module State + extend Lithic::Internal::Type::Enum + + OPEN = :OPEN + PAUSED = :PAUSED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/card_created_webhook_event.rb b/lib/lithic/models/card_created_webhook_event.rb new file mode 100644 index 00000000..485bb488 --- /dev/null +++ b/lib/lithic/models/card_created_webhook_event.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardCreatedWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute card_token + # The token of the card that was created. + # + # @return [String] + required :card_token, String + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"card.created"] + required :event_type, const: :"card.created" + + # @!attribute replacement_for + # The token of the card that was replaced, if the new card is a replacement card. + # + # @return [String, nil] + optional :replacement_for, String, nil?: true + + # @!method initialize(card_token:, replacement_for: nil, event_type: :"card.created") + # @param card_token [String] The token of the card that was created. + # + # @param replacement_for [String, nil] The token of the card that was replaced, if the new card is a replacement card. + # + # @param event_type [Symbol, :"card.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/card_embed_params.rb b/lib/lithic/models/card_embed_params.rb new file mode 100644 index 00000000..7c962486 --- /dev/null +++ b/lib/lithic/models/card_embed_params.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Cards#embed + class CardEmbedParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute embed_request + # A base64 encoded JSON string of an EmbedRequest to specify which card to load. + # + # @return [String] + required :embed_request, String + + # @!attribute hmac + # SHA256 HMAC of the embed_request JSON string with base64 digest. + # + # @return [String] + required :hmac, String + + # @!method initialize(embed_request:, hmac:, request_options: {}) + # @param embed_request [String] A base64 encoded JSON string of an EmbedRequest to specify which card to load. + # + # @param hmac [String] SHA256 HMAC of the embed_request JSON string with base64 digest. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/card_embed_response.rb b/lib/lithic/models/card_embed_response.rb new file mode 100644 index 00000000..0c7be4a1 --- /dev/null +++ b/lib/lithic/models/card_embed_response.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Lithic + module Models + CardEmbedResponse = String + end +end diff --git a/lib/lithic/models/card_list_params.rb b/lib/lithic/models/card_list_params.rb new file mode 100644 index 00000000..ed2b3b65 --- /dev/null +++ b/lib/lithic/models/card_list_params.rb @@ -0,0 +1,99 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Cards#list + class CardListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute account_token + # Returns cards associated with the specified account. + # + # @return [String, nil] + optional :account_token, String + + # @!attribute begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time + + # @!attribute end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute memo + # Returns cards containing the specified partial or full memo text. + # + # @return [String, nil] + optional :memo, String + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!attribute state + # Returns cards with the specified state. + # + # @return [Symbol, Lithic::Models::CardListParams::State, nil] + optional :state, enum: -> { Lithic::CardListParams::State } + + # @!method initialize(account_token: nil, begin_: nil, end_: nil, ending_before: nil, memo: nil, page_size: nil, starting_after: nil, state: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardListParams} for more details. + # + # @param account_token [String] Returns cards associated with the specified account. + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param memo [String] Returns cards containing the specified partial or full memo text. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param state [Symbol, Lithic::Models::CardListParams::State] Returns cards with the specified state. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Returns cards with the specified state. + module State + extend Lithic::Internal::Type::Enum + + CLOSED = :CLOSED + OPEN = :OPEN + PAUSED = :PAUSED + PENDING_ACTIVATION = :PENDING_ACTIVATION + PENDING_FULFILLMENT = :PENDING_FULFILLMENT + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/card_program.rb b/lib/lithic/models/card_program.rb new file mode 100644 index 00000000..098bebb9 --- /dev/null +++ b/lib/lithic/models/card_program.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::CardPrograms#retrieve + class CardProgram < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier. + # + # @return [String] + required :token, String + + # @!attribute account_level_management_enabled + # Whether the card program is participating in Account Level Management. Currently + # applicable to Visa card programs only. + # + # @return [Boolean] + required :account_level_management_enabled, Lithic::Internal::Type::Boolean + + # @!attribute created + # Timestamp of when the card program was created. + # + # @return [Time] + required :created, Time + + # @!attribute name + # The name of the card program. + # + # @return [String] + required :name, String + + # @!attribute pan_range_end + # The first digits of the card number that this card program ends with. + # + # @return [String] + required :pan_range_end, String + + # @!attribute pan_range_start + # The first digits of the card number that this card program starts with. + # + # @return [String] + required :pan_range_start, String + + # @!attribute cardholder_currency + # 3-character alphabetic ISO 4217 code for the currency of the cardholder. + # + # @return [String, nil] + optional :cardholder_currency, String, nil?: true + + # @!attribute settlement_currencies + # List of 3-character alphabetic ISO 4217 codes for the currencies that the card + # program supports for settlement. + # + # @return [Array, nil] + optional :settlement_currencies, Lithic::Internal::Type::ArrayOf[String] + + # @!method initialize(token:, account_level_management_enabled:, created:, name:, pan_range_end:, pan_range_start:, cardholder_currency: nil, settlement_currencies: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardProgram} for more details. + # + # @param token [String] Globally unique identifier. + # + # @param account_level_management_enabled [Boolean] Whether the card program is participating in Account Level Management. Currently + # + # @param created [Time] Timestamp of when the card program was created. + # + # @param name [String] The name of the card program. + # + # @param pan_range_end [String] The first digits of the card number that this card program ends with. + # + # @param pan_range_start [String] The first digits of the card number that this card program starts with. + # + # @param cardholder_currency [String, nil] 3-character alphabetic ISO 4217 code for the currency of the cardholder. + # + # @param settlement_currencies [Array] List of 3-character alphabetic ISO 4217 codes for the currencies that the card p + end + end +end diff --git a/lib/lithic/models/card_program_list_params.rb b/lib/lithic/models/card_program_list_params.rb new file mode 100644 index 00000000..dd925574 --- /dev/null +++ b/lib/lithic/models/card_program_list_params.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::CardPrograms#list + class CardProgramListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!method initialize(ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardProgramListParams} for more details. + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/card_program_retrieve_params.rb b/lib/lithic/models/card_program_retrieve_params.rb new file mode 100644 index 00000000..5f9059eb --- /dev/null +++ b/lib/lithic/models/card_program_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::CardPrograms#retrieve + class CardProgramRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute card_program_token + # + # @return [String] + required :card_program_token, String + + # @!method initialize(card_program_token:, request_options: {}) + # @param card_program_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/card_provision_params.rb b/lib/lithic/models/card_provision_params.rb new file mode 100644 index 00000000..e50c318b --- /dev/null +++ b/lib/lithic/models/card_provision_params.rb @@ -0,0 +1,95 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Cards#provision + class CardProvisionParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute card_token + # + # @return [String] + required :card_token, String + + # @!attribute certificate + # Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only + # `activationData` in the response. Apple's public leaf certificate. Base64 + # encoded in PEM format with headers `(-----BEGIN CERTIFICATE-----)` and trailers + # omitted. Provided by the device's wallet. + # + # @return [String, nil] + optional :certificate, String + + # @!attribute client_device_id + # Only applicable if `digital_wallet` is `GOOGLE_PAY` or `SAMSUNG_PAY` and the + # card is on the Visa network. Stable device identification set by the wallet + # provider. + # + # @return [String, nil] + optional :client_device_id, String + + # @!attribute client_wallet_account_id + # Only applicable if `digital_wallet` is `GOOGLE_PAY` or `SAMSUNG_PAY` and the + # card is on the Visa network. Consumer ID that identifies the wallet account + # holder entity. + # + # @return [String, nil] + optional :client_wallet_account_id, String + + # @!attribute digital_wallet + # Name of digital wallet provider. + # + # @return [Symbol, Lithic::Models::CardProvisionParams::DigitalWallet, nil] + optional :digital_wallet, enum: -> { Lithic::CardProvisionParams::DigitalWallet } + + # @!attribute nonce + # Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only + # `activationData` in the response. Base64 cryptographic nonce provided by the + # device's wallet. + # + # @return [String, nil] + optional :nonce, String + + # @!attribute nonce_signature + # Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only + # `activationData` in the response. Base64 cryptographic nonce provided by the + # device's wallet. + # + # @return [String, nil] + optional :nonce_signature, String + + # @!method initialize(card_token:, certificate: nil, client_device_id: nil, client_wallet_account_id: nil, digital_wallet: nil, nonce: nil, nonce_signature: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardProvisionParams} for more details. + # + # @param card_token [String] + # + # @param certificate [String] Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only `activa + # + # @param client_device_id [String] Only applicable if `digital_wallet` is `GOOGLE_PAY` or `SAMSUNG_PAY` and the car + # + # @param client_wallet_account_id [String] Only applicable if `digital_wallet` is `GOOGLE_PAY` or `SAMSUNG_PAY` and the car + # + # @param digital_wallet [Symbol, Lithic::Models::CardProvisionParams::DigitalWallet] Name of digital wallet provider. + # + # @param nonce [String] Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only `activa + # + # @param nonce_signature [String] Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only `activa + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Name of digital wallet provider. + module DigitalWallet + extend Lithic::Internal::Type::Enum + + APPLE_PAY = :APPLE_PAY + GOOGLE_PAY = :GOOGLE_PAY + SAMSUNG_PAY = :SAMSUNG_PAY + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/card_provision_response.rb b/lib/lithic/models/card_provision_response.rb new file mode 100644 index 00000000..02a1e785 --- /dev/null +++ b/lib/lithic/models/card_provision_response.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Cards#provision + class CardProvisionResponse < Lithic::Internal::Type::BaseModel + # @!attribute provisioning_payload + # Base64 encoded JSON payload representing a payment card that can be passed to a + # device's digital wallet. Applies to Google and Samsung Pay wallets. + # + # @return [String, Lithic::Models::ProvisionResponse, nil] + optional :provisioning_payload, union: -> { Lithic::Models::CardProvisionResponse::ProvisioningPayload } + + # @!method initialize(provisioning_payload: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardProvisionResponse} for more details. + # + # @param provisioning_payload [String, Lithic::Models::ProvisionResponse] Base64 encoded JSON payload representing a payment card that can be passed to a + + # Base64 encoded JSON payload representing a payment card that can be passed to a + # device's digital wallet. Applies to Google and Samsung Pay wallets. + # + # @see Lithic::Models::CardProvisionResponse#provisioning_payload + module ProvisioningPayload + extend Lithic::Internal::Type::Union + + # Base64 encoded JSON payload representing a payment card that can be passed to a device's digital wallet. Applies to Google and Samsung Pay wallets. + variant String + + # Object containing the fields required to add a card to Apple Pay. Applies only to Apple Pay wallet. + variant -> { Lithic::ProvisionResponse } + + # @!method self.variants + # @return [Array(String, Lithic::Models::ProvisionResponse)] + end + end + end +end diff --git a/lib/lithic/models/card_reissue_params.rb b/lib/lithic/models/card_reissue_params.rb new file mode 100644 index 00000000..c0e07ceb --- /dev/null +++ b/lib/lithic/models/card_reissue_params.rb @@ -0,0 +1,104 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Cards#reissue + class CardReissueParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute card_token + # + # @return [String] + required :card_token, String + + # @!attribute carrier + # If omitted, the previous carrier will be used. + # + # @return [Lithic::Models::Carrier, nil] + optional :carrier, -> { Lithic::Carrier } + + # @!attribute product_id + # Specifies the configuration (e.g. physical card art) that the card should be + # manufactured with, and only applies to cards of type `PHYSICAL`. This must be + # configured with Lithic before use. + # + # @return [String, nil] + optional :product_id, String + + # @!attribute shipping_address + # If omitted, the previous shipping address will be used. + # + # @return [Lithic::Models::ShippingAddress, nil] + optional :shipping_address, -> { Lithic::ShippingAddress } + + # @!attribute shipping_method + # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of + # options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx or UPS depending on card manufacturer, Express, 3-day + # shipping, with tracking + # - `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with + # tracking + # - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight + # or similar international option, with tracking + # - `BULK` - Card will be shipped as part of a bulk fulfillment order. The + # shipping method and timeline are inherited from the parent bulk order. + # + # @return [Symbol, Lithic::Models::CardReissueParams::ShippingMethod, nil] + optional :shipping_method, enum: -> { Lithic::CardReissueParams::ShippingMethod } + + # @!method initialize(card_token:, carrier: nil, product_id: nil, shipping_address: nil, shipping_method: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardReissueParams} for more details. + # + # @param card_token [String] + # + # @param carrier [Lithic::Models::Carrier] If omitted, the previous carrier will be used. + # + # @param product_id [String] Specifies the configuration (e.g. physical card art) that the card should be man + # + # @param shipping_address [Lithic::Models::ShippingAddress] If omitted, the previous shipping address will be used. + # + # @param shipping_method [Symbol, Lithic::Models::CardReissueParams::ShippingMethod] Shipping method for the card. Only applies to cards of type PHYSICAL. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of + # options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx or UPS depending on card manufacturer, Express, 3-day + # shipping, with tracking + # - `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with + # tracking + # - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight + # or similar international option, with tracking + # - `BULK` - Card will be shipped as part of a bulk fulfillment order. The + # shipping method and timeline are inherited from the parent bulk order. + module ShippingMethod + extend Lithic::Internal::Type::Enum + + SHIPPING_METHOD_2_DAY = :"2_DAY" + BULK = :BULK + EXPEDITED = :EXPEDITED + EXPRESS = :EXPRESS + PRIORITY = :PRIORITY + STANDARD = :STANDARD + STANDARD_WITH_TRACKING = :STANDARD_WITH_TRACKING + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/card_reissued_webhook_event.rb b/lib/lithic/models/card_reissued_webhook_event.rb new file mode 100644 index 00000000..278c751e --- /dev/null +++ b/lib/lithic/models/card_reissued_webhook_event.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardReissuedWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"card.reissued"] + required :event_type, const: :"card.reissued" + + # @!attribute card_token + # The token of the card that was reissued. + # + # @return [String, nil] + optional :card_token, String + + # @!method initialize(card_token: nil, event_type: :"card.reissued") + # @param card_token [String] The token of the card that was reissued. + # + # @param event_type [Symbol, :"card.reissued"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/card_renew_params.rb b/lib/lithic/models/card_renew_params.rb new file mode 100644 index 00000000..6f591929 --- /dev/null +++ b/lib/lithic/models/card_renew_params.rb @@ -0,0 +1,124 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Cards#renew + class CardRenewParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute card_token + # + # @return [String] + required :card_token, String + + # @!attribute shipping_address + # The shipping address this card will be sent to. + # + # @return [Lithic::Models::ShippingAddress] + required :shipping_address, -> { Lithic::ShippingAddress } + + # @!attribute carrier + # If omitted, the previous carrier will be used. + # + # @return [Lithic::Models::Carrier, nil] + optional :carrier, -> { Lithic::Carrier } + + # @!attribute exp_month + # Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, + # an expiration date five years in the future will be generated. Five years is the + # maximum expiration date. + # + # @return [String, nil] + optional :exp_month, String + + # @!attribute exp_year + # Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is + # provided, an expiration date five years in the future will be generated. Five + # years is the maximum expiration date. + # + # @return [String, nil] + optional :exp_year, String + + # @!attribute product_id + # Specifies the configuration (e.g. physical card art) that the card should be + # manufactured with, and only applies to cards of type `PHYSICAL`. This must be + # configured with Lithic before use. + # + # @return [String, nil] + optional :product_id, String + + # @!attribute shipping_method + # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of + # options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx or UPS depending on card manufacturer, Express, 3-day + # shipping, with tracking + # - `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with + # tracking + # - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight + # or similar international option, with tracking + # - `BULK` - Card will be shipped as part of a bulk fulfillment order. The + # shipping method and timeline are inherited from the parent bulk order. + # + # @return [Symbol, Lithic::Models::CardRenewParams::ShippingMethod, nil] + optional :shipping_method, enum: -> { Lithic::CardRenewParams::ShippingMethod } + + # @!method initialize(card_token:, shipping_address:, carrier: nil, exp_month: nil, exp_year: nil, product_id: nil, shipping_method: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardRenewParams} for more details. + # + # @param card_token [String] + # + # @param shipping_address [Lithic::Models::ShippingAddress] The shipping address this card will be sent to. + # + # @param carrier [Lithic::Models::Carrier] If omitted, the previous carrier will be used. + # + # @param exp_month [String] Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, + # + # @param exp_year [String] Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is provided + # + # @param product_id [String] Specifies the configuration (e.g. physical card art) that the card should be man + # + # @param shipping_method [Symbol, Lithic::Models::CardRenewParams::ShippingMethod] Shipping method for the card. Only applies to cards of type PHYSICAL. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of + # options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx or UPS depending on card manufacturer, Express, 3-day + # shipping, with tracking + # - `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with + # tracking + # - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight + # or similar international option, with tracking + # - `BULK` - Card will be shipped as part of a bulk fulfillment order. The + # shipping method and timeline are inherited from the parent bulk order. + module ShippingMethod + extend Lithic::Internal::Type::Enum + + SHIPPING_METHOD_2_DAY = :"2_DAY" + BULK = :BULK + EXPEDITED = :EXPEDITED + EXPRESS = :EXPRESS + PRIORITY = :PRIORITY + STANDARD = :STANDARD + STANDARD_WITH_TRACKING = :STANDARD_WITH_TRACKING + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/card_renewed_webhook_event.rb b/lib/lithic/models/card_renewed_webhook_event.rb new file mode 100644 index 00000000..786ab5e5 --- /dev/null +++ b/lib/lithic/models/card_renewed_webhook_event.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardRenewedWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"card.renewed"] + required :event_type, const: :"card.renewed" + + # @!attribute card_token + # The token of the card that was renewed. + # + # @return [String, nil] + optional :card_token, String + + # @!attribute exp_month + # The new expiration month of the card. + # + # @return [String, nil] + optional :exp_month, String + + # @!attribute exp_year + # The new expiration year of the card. + # + # @return [String, nil] + optional :exp_year, String + + # @!attribute previous_exp_month + # The previous expiration month of the card. + # + # @return [String, nil] + optional :previous_exp_month, String + + # @!attribute previous_exp_year + # The previous expiration year of the card. + # + # @return [String, nil] + optional :previous_exp_year, String + + # @!method initialize(card_token: nil, exp_month: nil, exp_year: nil, previous_exp_month: nil, previous_exp_year: nil, event_type: :"card.renewed") + # @param card_token [String] The token of the card that was renewed. + # + # @param exp_month [String] The new expiration month of the card. + # + # @param exp_year [String] The new expiration year of the card. + # + # @param previous_exp_month [String] The previous expiration month of the card. + # + # @param previous_exp_year [String] The previous expiration year of the card. + # + # @param event_type [Symbol, :"card.renewed"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/card_retrieve_params.rb b/lib/lithic/models/card_retrieve_params.rb new file mode 100644 index 00000000..5849737a --- /dev/null +++ b/lib/lithic/models/card_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Cards#retrieve + class CardRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute card_token + # + # @return [String] + required :card_token, String + + # @!method initialize(card_token:, request_options: {}) + # @param card_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/card_retrieve_signals_params.rb b/lib/lithic/models/card_retrieve_signals_params.rb new file mode 100644 index 00000000..dfed450c --- /dev/null +++ b/lib/lithic/models/card_retrieve_signals_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Cards#retrieve_signals + class CardRetrieveSignalsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute card_token + # + # @return [String] + required :card_token, String + + # @!method initialize(card_token:, request_options: {}) + # @param card_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/card_retrieve_spend_limits_params.rb b/lib/lithic/models/card_retrieve_spend_limits_params.rb new file mode 100644 index 00000000..54f39d40 --- /dev/null +++ b/lib/lithic/models/card_retrieve_spend_limits_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Cards#retrieve_spend_limits + class CardRetrieveSpendLimitsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute card_token + # + # @return [String] + required :card_token, String + + # @!method initialize(card_token:, request_options: {}) + # @param card_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/card_search_by_pan_params.rb b/lib/lithic/models/card_search_by_pan_params.rb new file mode 100644 index 00000000..dfcee345 --- /dev/null +++ b/lib/lithic/models/card_search_by_pan_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Cards#search_by_pan + class CardSearchByPanParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute pan + # The PAN for the card being retrieved. + # + # @return [String] + required :pan, String + + # @!method initialize(pan:, request_options: {}) + # @param pan [String] The PAN for the card being retrieved. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/card_shipped_webhook_event.rb b/lib/lithic/models/card_shipped_webhook_event.rb new file mode 100644 index 00000000..197c09e4 --- /dev/null +++ b/lib/lithic/models/card_shipped_webhook_event.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardShippedWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute bulk_order_token + # The token of the bulk order associated with this card shipment, if applicable. + # + # @return [String, nil] + required :bulk_order_token, String, nil?: true + + # @!attribute card_token + # The token of the card that was shipped. + # + # @return [String] + required :card_token, String + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"card.shipped"] + required :event_type, const: :"card.shipped" + + # @!attribute shipping_method + # The specific shipping method used to ship the card. + # + # @return [Symbol, Lithic::Models::CardShippedWebhookEvent::ShippingMethod] + required :shipping_method, enum: -> { Lithic::CardShippedWebhookEvent::ShippingMethod } + + # @!attribute tracking_number + # The tracking number of the shipment. + # + # @return [String, nil] + required :tracking_number, String, nil?: true + + # @!method initialize(bulk_order_token:, card_token:, shipping_method:, tracking_number:, event_type: :"card.shipped") + # @param bulk_order_token [String, nil] The token of the bulk order associated with this card shipment, if applicable. + # + # @param card_token [String] The token of the card that was shipped. + # + # @param shipping_method [Symbol, Lithic::Models::CardShippedWebhookEvent::ShippingMethod] The specific shipping method used to ship the card. + # + # @param tracking_number [String, nil] The tracking number of the shipment. + # + # @param event_type [Symbol, :"card.shipped"] The type of event that occurred. + + # The specific shipping method used to ship the card. + # + # @see Lithic::Models::CardShippedWebhookEvent#shipping_method + module ShippingMethod + extend Lithic::Internal::Type::Enum + + EX_US_EXPEDITED_WITH_TRACKING = :"Ex-US expedited with tracking" + EX_US_STANDARD_WITH_TRACKING = :"Ex-US standard with tracking" + EX_US_STANDARD_WITHOUT_TRACKING = :"Ex-US standard without tracking" + FED_EX_2_DAYS = :"FedEx 2 days" + FED_EX_EXPRESS = :"FedEx express" + FED_EX_OVERNIGHT = :"FedEx overnight" + USPS_PRIORITY = :"USPS priority" + USPS_WITH_TRACKING = :"USPS with tracking" + USPS_WITHOUT_TRACKING_ENVELOPE = :"USPS without tracking envelope" + USPS_WITHOUT_TRACKING_ENVELOPE_NON_MACHINE = :"USPS without tracking envelope non-machine" + USPS_WITHOUT_TRACKING_FLAT = :"USPS without tracking flat" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/card_spend_limits.rb b/lib/lithic/models/card_spend_limits.rb new file mode 100644 index 00000000..c96edc41 --- /dev/null +++ b/lib/lithic/models/card_spend_limits.rb @@ -0,0 +1,124 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Cards#retrieve_spend_limits + class CardSpendLimits < Lithic::Internal::Type::BaseModel + # @!attribute available_spend_limit + # + # @return [Lithic::Models::CardSpendLimits::AvailableSpendLimit] + required :available_spend_limit, -> { Lithic::CardSpendLimits::AvailableSpendLimit } + + # @!attribute spend_limit + # + # @return [Lithic::Models::CardSpendLimits::SpendLimit, nil] + optional :spend_limit, -> { Lithic::CardSpendLimits::SpendLimit } + + # @!attribute spend_velocity + # + # @return [Lithic::Models::CardSpendLimits::SpendVelocity, nil] + optional :spend_velocity, -> { Lithic::CardSpendLimits::SpendVelocity } + + # @!method initialize(available_spend_limit:, spend_limit: nil, spend_velocity: nil) + # @param available_spend_limit [Lithic::Models::CardSpendLimits::AvailableSpendLimit] + # @param spend_limit [Lithic::Models::CardSpendLimits::SpendLimit] + # @param spend_velocity [Lithic::Models::CardSpendLimits::SpendVelocity] + + # @see Lithic::Models::CardSpendLimits#available_spend_limit + class AvailableSpendLimit < Lithic::Internal::Type::BaseModel + # @!attribute annually + # The available spend limit (in cents) relative to the annual limit configured on + # the Card (e.g. 100000 would be a $1,000 limit). + # + # @return [Integer, nil] + optional :annually, Integer + + # @!attribute forever + # The available spend limit (in cents) relative to the forever limit configured on + # the Card. + # + # @return [Integer, nil] + optional :forever, Integer + + # @!attribute monthly + # The available spend limit (in cents) relative to the monthly limit configured on + # the Card. + # + # @return [Integer, nil] + optional :monthly, Integer + + # @!method initialize(annually: nil, forever: nil, monthly: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardSpendLimits::AvailableSpendLimit} for more details. + # + # @param annually [Integer] The available spend limit (in cents) relative to the annual limit configured on + # + # @param forever [Integer] The available spend limit (in cents) relative to the forever limit configured on + # + # @param monthly [Integer] The available spend limit (in cents) relative to the monthly limit configured on + end + + # @see Lithic::Models::CardSpendLimits#spend_limit + class SpendLimit < Lithic::Internal::Type::BaseModel + # @!attribute annually + # The configured annual spend limit (in cents) on the Card. + # + # @return [Integer, nil] + optional :annually, Integer + + # @!attribute forever + # The configured forever spend limit (in cents) on the Card. + # + # @return [Integer, nil] + optional :forever, Integer + + # @!attribute monthly + # The configured monthly spend limit (in cents) on the Card. + # + # @return [Integer, nil] + optional :monthly, Integer + + # @!method initialize(annually: nil, forever: nil, monthly: nil) + # @param annually [Integer] The configured annual spend limit (in cents) on the Card. + # + # @param forever [Integer] The configured forever spend limit (in cents) on the Card. + # + # @param monthly [Integer] The configured monthly spend limit (in cents) on the Card. + end + + # @see Lithic::Models::CardSpendLimits#spend_velocity + class SpendVelocity < Lithic::Internal::Type::BaseModel + # @!attribute annually + # Current annual spend velocity (in cents) on the Card. Present if annual spend + # limit is set. + # + # @return [Integer, nil] + optional :annually, Integer + + # @!attribute forever + # Current forever spend velocity (in cents) on the Card. Present if forever spend + # limit is set. + # + # @return [Integer, nil] + optional :forever, Integer + + # @!attribute monthly + # Current monthly spend velocity (in cents) on the Card. Present if monthly spend + # limit is set. + # + # @return [Integer, nil] + optional :monthly, Integer + + # @!method initialize(annually: nil, forever: nil, monthly: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardSpendLimits::SpendVelocity} for more details. + # + # @param annually [Integer] Current annual spend velocity (in cents) on the Card. Present if annual spend li + # + # @param forever [Integer] Current forever spend velocity (in cents) on the Card. Present if forever spend + # + # @param monthly [Integer] Current monthly spend velocity (in cents) on the Card. Present if monthly spend + end + end + end +end diff --git a/lib/lithic/models/card_transaction_enhanced_data_created_webhook_event.rb b/lib/lithic/models/card_transaction_enhanced_data_created_webhook_event.rb new file mode 100644 index 00000000..ecba5563 --- /dev/null +++ b/lib/lithic/models/card_transaction_enhanced_data_created_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardTransactionEnhancedDataCreatedWebhookEvent < Lithic::Models::Transactions::Events::EnhancedData + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"card_transaction.enhanced_data.created"] + required :event_type, const: :"card_transaction.enhanced_data.created" + + # @!method initialize(event_type: :"card_transaction.enhanced_data.created") + # @param event_type [Symbol, :"card_transaction.enhanced_data.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/card_transaction_enhanced_data_updated_webhook_event.rb b/lib/lithic/models/card_transaction_enhanced_data_updated_webhook_event.rb new file mode 100644 index 00000000..9ae7c516 --- /dev/null +++ b/lib/lithic/models/card_transaction_enhanced_data_updated_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardTransactionEnhancedDataUpdatedWebhookEvent < Lithic::Models::Transactions::Events::EnhancedData + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"card_transaction.enhanced_data.updated"] + required :event_type, const: :"card_transaction.enhanced_data.updated" + + # @!method initialize(event_type: :"card_transaction.enhanced_data.updated") + # @param event_type [Symbol, :"card_transaction.enhanced_data.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/card_transaction_updated_webhook_event.rb b/lib/lithic/models/card_transaction_updated_webhook_event.rb new file mode 100644 index 00000000..77b6a66b --- /dev/null +++ b/lib/lithic/models/card_transaction_updated_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardTransactionUpdatedWebhookEvent < Lithic::Models::Transaction + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"card_transaction.updated"] + required :event_type, const: :"card_transaction.updated" + + # @!method initialize(event_type: :"card_transaction.updated") + # @param event_type [Symbol, :"card_transaction.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/card_update_params.rb b/lib/lithic/models/card_update_params.rb new file mode 100644 index 00000000..25e64130 --- /dev/null +++ b/lib/lithic/models/card_update_params.rb @@ -0,0 +1,235 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Cards#update + class CardUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute card_token + # + # @return [String] + required :card_token, String + + # @!attribute comment + # Additional context or information related to the card. + # + # @return [String, nil] + optional :comment, String + + # @!attribute digital_card_art_token + # Specifies the digital card art to be displayed in the user’s digital wallet + # after tokenization. This artwork must be approved by Mastercard and configured + # by Lithic to use. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + # + # @return [String, nil] + optional :digital_card_art_token, String + + # @!attribute memo + # Friendly name to identify the card. + # + # @return [String, nil] + optional :memo, String + + # @!attribute network_program_token + # Globally unique identifier for the card's network program. Currently applicable + # to Visa cards participating in Account Level Management only. + # + # @return [String, nil] + optional :network_program_token, String + + # @!attribute pin + # Encrypted PIN block (in base64). Only applies to cards of type `PHYSICAL` and + # `VIRTUAL`. Changing PIN also resets PIN status to `OK`. See + # [Encrypted PIN Block](https://docs.lithic.com/docs/cards#encrypted-pin-block). + # + # @return [String, nil] + optional :pin, String + + # @!attribute pin_status + # Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect + # attempts). Can only be set to `OK` to unblock a card. + # + # @return [Symbol, Lithic::Models::CardUpdateParams::PinStatus, nil] + optional :pin_status, enum: -> { Lithic::CardUpdateParams::PinStatus } + + # @!attribute spend_limit + # Amount (in cents) to limit approved authorizations (e.g. 100000 would be a + # $1,000 limit). Transaction requests above the spend limit will be declined. Note + # that a spend limit of 0 is effectively no limit, and should only be used to + # reset or remove a prior limit. Only a limit of 1 or above will result in + # declined transactions due to checks against the card limit. + # + # @return [Integer, nil] + optional :spend_limit, Integer + + # @!attribute spend_limit_duration + # Spend limit duration values: + # + # - `ANNUALLY` - Card will authorize transactions up to spend limit for the + # trailing year. + # - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime + # of the card. + # - `MONTHLY` - Card will authorize transactions up to spend limit for the + # trailing month. To support recurring monthly payments, which can occur on + # different day every month, the time window we consider for monthly velocity + # starts 6 days after the current calendar date one month prior. + # - `TRANSACTION` - Card will authorize multiple transactions if each individual + # transaction is under the spend limit. + # + # @return [Symbol, Lithic::Models::SpendLimitDuration, nil] + optional :spend_limit_duration, enum: -> { Lithic::SpendLimitDuration } + + # @!attribute state + # Card state values: + # + # - `CLOSED` - Card will no longer approve authorizations. Closing a card cannot + # be undone. + # - `OPEN` - Card will approve authorizations (if they match card and account + # parameters). + # - `PAUSED` - Card will decline authorizations, but can be resumed at a later + # time. + # + # @return [Symbol, Lithic::Models::CardUpdateParams::State, nil] + optional :state, enum: -> { Lithic::CardUpdateParams::State } + + # @!attribute substatus + # Card state substatus values: + # + # - `LOST` - The physical card is no longer in the cardholder's possession due to + # being lost or never received by the cardholder. + # - `COMPROMISED` - Card information has been exposed, potentially leading to + # unauthorized access. This may involve physical card theft, cloning, or online + # data breaches. + # - `DAMAGED` - The physical card is not functioning properly, such as having chip + # failures or a demagnetized magnetic stripe. + # - `END_USER_REQUEST` - The cardholder requested the closure of the card for + # reasons unrelated to fraud or damage, such as switching to a different product + # or closing the account. + # - `ISSUER_REQUEST` - The issuer closed the card for reasons unrelated to fraud + # or damage, such as account inactivity, product or policy changes, or + # technology upgrades. + # - `NOT_ACTIVE` - The card hasn’t had any transaction activity for a specified + # period, applicable to statuses like `PAUSED` or `CLOSED`. + # - `SUSPICIOUS_ACTIVITY` - The card has one or more suspicious transactions or + # activities that require review. This can involve prompting the cardholder to + # confirm legitimate use or report confirmed fraud. + # - `INTERNAL_REVIEW` - The card is temporarily paused pending further internal + # review. + # - `EXPIRED` - The card has expired and has been closed without being reissued. + # - `UNDELIVERABLE` - The card cannot be delivered to the cardholder and has been + # returned. + # - `OTHER` - The reason for the status does not fall into any of the above + # categories. A comment should be provided to specify the reason. + # + # @return [Symbol, Lithic::Models::CardUpdateParams::Substatus, nil] + optional :substatus, enum: -> { Lithic::CardUpdateParams::Substatus } + + # @!method initialize(card_token:, comment: nil, digital_card_art_token: nil, memo: nil, network_program_token: nil, pin: nil, pin_status: nil, spend_limit: nil, spend_limit_duration: nil, state: nil, substatus: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardUpdateParams} for more details. + # + # @param card_token [String] + # + # @param comment [String] Additional context or information related to the card. + # + # @param digital_card_art_token [String] Specifies the digital card art to be displayed in the user’s digital wallet afte + # + # @param memo [String] Friendly name to identify the card. + # + # @param network_program_token [String] Globally unique identifier for the card's network program. Currently applicable + # + # @param pin [String] Encrypted PIN block (in base64). Only applies to cards of type `PHYSICAL` and `V + # + # @param pin_status [Symbol, Lithic::Models::CardUpdateParams::PinStatus] Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect + # + # @param spend_limit [Integer] Amount (in cents) to limit approved authorizations (e.g. 100000 would be a $1,00 + # + # @param spend_limit_duration [Symbol, Lithic::Models::SpendLimitDuration] Spend limit duration values: + # + # @param state [Symbol, Lithic::Models::CardUpdateParams::State] Card state values: + # + # @param substatus [Symbol, Lithic::Models::CardUpdateParams::Substatus] Card state substatus values: + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect + # attempts). Can only be set to `OK` to unblock a card. + module PinStatus + extend Lithic::Internal::Type::Enum + + OK = :OK + + # @!method self.values + # @return [Array] + end + + # Card state values: + # + # - `CLOSED` - Card will no longer approve authorizations. Closing a card cannot + # be undone. + # - `OPEN` - Card will approve authorizations (if they match card and account + # parameters). + # - `PAUSED` - Card will decline authorizations, but can be resumed at a later + # time. + module State + extend Lithic::Internal::Type::Enum + + CLOSED = :CLOSED + OPEN = :OPEN + PAUSED = :PAUSED + + # @!method self.values + # @return [Array] + end + + # Card state substatus values: + # + # - `LOST` - The physical card is no longer in the cardholder's possession due to + # being lost or never received by the cardholder. + # - `COMPROMISED` - Card information has been exposed, potentially leading to + # unauthorized access. This may involve physical card theft, cloning, or online + # data breaches. + # - `DAMAGED` - The physical card is not functioning properly, such as having chip + # failures or a demagnetized magnetic stripe. + # - `END_USER_REQUEST` - The cardholder requested the closure of the card for + # reasons unrelated to fraud or damage, such as switching to a different product + # or closing the account. + # - `ISSUER_REQUEST` - The issuer closed the card for reasons unrelated to fraud + # or damage, such as account inactivity, product or policy changes, or + # technology upgrades. + # - `NOT_ACTIVE` - The card hasn’t had any transaction activity for a specified + # period, applicable to statuses like `PAUSED` or `CLOSED`. + # - `SUSPICIOUS_ACTIVITY` - The card has one or more suspicious transactions or + # activities that require review. This can involve prompting the cardholder to + # confirm legitimate use or report confirmed fraud. + # - `INTERNAL_REVIEW` - The card is temporarily paused pending further internal + # review. + # - `EXPIRED` - The card has expired and has been closed without being reissued. + # - `UNDELIVERABLE` - The card cannot be delivered to the cardholder and has been + # returned. + # - `OTHER` - The reason for the status does not fall into any of the above + # categories. A comment should be provided to specify the reason. + module Substatus + extend Lithic::Internal::Type::Enum + + LOST = :LOST + COMPROMISED = :COMPROMISED + DAMAGED = :DAMAGED + END_USER_REQUEST = :END_USER_REQUEST + ISSUER_REQUEST = :ISSUER_REQUEST + NOT_ACTIVE = :NOT_ACTIVE + SUSPICIOUS_ACTIVITY = :SUSPICIOUS_ACTIVITY + INTERNAL_REVIEW = :INTERNAL_REVIEW + EXPIRED = :EXPIRED + UNDELIVERABLE = :UNDELIVERABLE + OTHER = :OTHER + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/card_updated_webhook_event.rb b/lib/lithic/models/card_updated_webhook_event.rb new file mode 100644 index 00000000..31f52e69 --- /dev/null +++ b/lib/lithic/models/card_updated_webhook_event.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute card_token + # The token of the card that was updated. + # + # @return [String] + required :card_token, String + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"card.updated"] + required :event_type, const: :"card.updated" + + # @!attribute previous_fields + # The previous values of the fields that were updated. + # + # @return [Object] + required :previous_fields, Lithic::Internal::Type::Unknown + + # @!attribute state + # The current state of the card. + # + # @return [String] + required :state, String + + # @!method initialize(card_token:, previous_fields:, state:, event_type: :"card.updated") + # @param card_token [String] The token of the card that was updated. + # + # @param previous_fields [Object] The previous values of the fields that were updated. + # + # @param state [String] The current state of the card. + # + # @param event_type [Symbol, :"card.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/card_web_provision_params.rb b/lib/lithic/models/card_web_provision_params.rb new file mode 100644 index 00000000..9ecd1d68 --- /dev/null +++ b/lib/lithic/models/card_web_provision_params.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Cards#web_provision + class CardWebProvisionParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute card_token + # + # @return [String] + required :card_token, String + + # @!attribute client_device_id + # Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push + # Provisioning device identifier required for the tokenization flow + # + # @return [String, nil] + optional :client_device_id, String + + # @!attribute client_wallet_account_id + # Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push + # Provisioning wallet account identifier required for the tokenization flow + # + # @return [String, nil] + optional :client_wallet_account_id, String + + # @!attribute digital_wallet + # Name of digital wallet provider. + # + # @return [Symbol, Lithic::Models::CardWebProvisionParams::DigitalWallet, nil] + optional :digital_wallet, enum: -> { Lithic::CardWebProvisionParams::DigitalWallet } + + # @!attribute server_session_id + # Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push + # Provisioning session identifier required for the FPAN flow. + # + # @return [String, nil] + optional :server_session_id, String + + # @!method initialize(card_token:, client_device_id: nil, client_wallet_account_id: nil, digital_wallet: nil, server_session_id: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardWebProvisionParams} for more details. + # + # @param card_token [String] + # + # @param client_device_id [String] Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push Provision + # + # @param client_wallet_account_id [String] Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push Provision + # + # @param digital_wallet [Symbol, Lithic::Models::CardWebProvisionParams::DigitalWallet] Name of digital wallet provider. + # + # @param server_session_id [String] Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push Provision + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Name of digital wallet provider. + module DigitalWallet + extend Lithic::Internal::Type::Enum + + APPLE_PAY = :APPLE_PAY + GOOGLE_PAY = :GOOGLE_PAY + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/card_web_provision_response.rb b/lib/lithic/models/card_web_provision_response.rb new file mode 100644 index 00000000..2f20b874 --- /dev/null +++ b/lib/lithic/models/card_web_provision_response.rb @@ -0,0 +1,121 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Cards#web_provision + module CardWebProvisionResponse + extend Lithic::Internal::Type::Union + + variant -> { Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse } + + variant -> { Lithic::Models::CardWebProvisionResponse::GoogleWebPushProvisioningResponse } + + class AppleWebPushProvisioningResponse < Lithic::Internal::Type::BaseModel + # @!attribute jws + # JWS object required for handoff to Apple's script. + # + # @return [Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws] + required :jws, -> { Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws } + + # @!attribute state + # A unique identifier for the JWS object. + # + # @return [String] + required :state, String + + # @!method initialize(jws:, state:) + # @param jws [Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws] JWS object required for handoff to Apple's script. + # + # @param state [String] A unique identifier for the JWS object. + + # @see Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse#jws + class Jws < Lithic::Internal::Type::BaseModel + # @!attribute header + # JWS unprotected headers containing header parameters that aren't + # integrity-protected by the JWS signature. + # + # @return [Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws::Header, nil] + optional :header, + -> { Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws::Header } + + # @!attribute payload + # Base64url encoded JSON object containing the provisioning payload. + # + # @return [String, nil] + optional :payload, String + + # @!attribute protected + # Base64url encoded JWS protected headers containing the header parameters that + # are integrity-protected by the JWS signature. + # + # @return [String, nil] + optional :protected, String + + # @!attribute signature + # Base64url encoded signature of the JWS object. + # + # @return [String, nil] + optional :signature, String + + # @!method initialize(header: nil, payload: nil, protected: nil, signature: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws} + # for more details. + # + # JWS object required for handoff to Apple's script. + # + # @param header [Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws::Header] JWS unprotected headers containing header parameters that aren't integrity-prote + # + # @param payload [String] Base64url encoded JSON object containing the provisioning payload. + # + # @param protected [String] Base64url encoded JWS protected headers containing the header parameters that ar + # + # @param signature [String] Base64url encoded signature of the JWS object. + + # @see Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws#header + class Header < Lithic::Internal::Type::BaseModel + # @!attribute kid + # The ID for the JWS Public Key of the key pair used to generate the signature. + # + # @return [String, nil] + optional :kid, String + + # @!method initialize(kid: nil) + # JWS unprotected headers containing header parameters that aren't + # integrity-protected by the JWS signature. + # + # @param kid [String] The ID for the JWS Public Key of the key pair used to generate the signature. + end + end + end + + class GoogleWebPushProvisioningResponse < Lithic::Internal::Type::BaseModel + # @!attribute google_opc + # A base64 encoded and encrypted payload representing card data for the Google Pay + # UWPP FPAN flow. + # + # @return [String, nil] + optional :google_opc, String + + # @!attribute tsp_opc + # A base64 encoded and encrypted payload representing card data for the Google Pay + # UWPP tokenization flow. + # + # @return [String, nil] + optional :tsp_opc, String + + # @!method initialize(google_opc: nil, tsp_opc: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardWebProvisionResponse::GoogleWebPushProvisioningResponse} + # for more details. + # + # @param google_opc [String] A base64 encoded and encrypted payload representing card data for the Google Pay + # + # @param tsp_opc [String] A base64 encoded and encrypted payload representing card data for the Google Pay + end + + # @!method self.variants + # @return [Array(Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse, Lithic::Models::CardWebProvisionResponse::GoogleWebPushProvisioningResponse)] + end + end +end diff --git a/lib/lithic/models/cardholder_authentication.rb b/lib/lithic/models/cardholder_authentication.rb new file mode 100644 index 00000000..a5a54772 --- /dev/null +++ b/lib/lithic/models/cardholder_authentication.rb @@ -0,0 +1,132 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CardholderAuthentication < Lithic::Internal::Type::BaseModel + # @!attribute authentication_method + # Indicates the method used to authenticate the cardholder. + # + # @return [Symbol, Lithic::Models::CardholderAuthentication::AuthenticationMethod] + required :authentication_method, enum: -> { Lithic::CardholderAuthentication::AuthenticationMethod } + + # @!attribute authentication_result + # Indicates the outcome of the 3DS authentication process. + # + # @return [Symbol, Lithic::Models::CardholderAuthentication::AuthenticationResult] + required :authentication_result, enum: -> { Lithic::CardholderAuthentication::AuthenticationResult } + + # @!attribute decision_made_by + # Indicates which party made the 3DS authentication decision. + # + # @return [Symbol, Lithic::Models::CardholderAuthentication::DecisionMadeBy] + required :decision_made_by, enum: -> { Lithic::CardholderAuthentication::DecisionMadeBy } + + # @!attribute liability_shift + # Indicates whether chargeback liability shift applies to the transaction. + # Possible enum values: + # + # - `3DS_AUTHENTICATED`: The transaction was fully authenticated through a 3-D + # Secure flow, chargeback liability shift applies. + # - `NONE`: Chargeback liability shift has not shifted to the issuer, i.e. the + # merchant is liable. + # - `TOKEN_AUTHENTICATED`: The transaction was a tokenized payment with validated + # cryptography, possibly recurring. Chargeback liability shift to the issuer + # applies. + # + # @return [Symbol, Lithic::Models::CardholderAuthentication::LiabilityShift] + required :liability_shift, enum: -> { Lithic::CardholderAuthentication::LiabilityShift } + + # @!attribute three_ds_authentication_token + # Unique identifier you can use to match a given 3DS authentication (available via + # the three_ds_authentication.created event webhook) and the transaction. Note + # that in cases where liability shift does not occur, this token is matched to the + # transaction on a best-effort basis. + # + # @return [String, nil] + required :three_ds_authentication_token, String, nil?: true + + # @!method initialize(authentication_method:, authentication_result:, decision_made_by:, liability_shift:, three_ds_authentication_token:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardholderAuthentication} for more details. + # + # @param authentication_method [Symbol, Lithic::Models::CardholderAuthentication::AuthenticationMethod] Indicates the method used to authenticate the cardholder. + # + # @param authentication_result [Symbol, Lithic::Models::CardholderAuthentication::AuthenticationResult] Indicates the outcome of the 3DS authentication process. + # + # @param decision_made_by [Symbol, Lithic::Models::CardholderAuthentication::DecisionMadeBy] Indicates which party made the 3DS authentication decision. + # + # @param liability_shift [Symbol, Lithic::Models::CardholderAuthentication::LiabilityShift] Indicates whether chargeback liability shift applies to the transaction. Possibl + # + # @param three_ds_authentication_token [String, nil] Unique identifier you can use to match a given 3DS authentication (available via + + # Indicates the method used to authenticate the cardholder. + # + # @see Lithic::Models::CardholderAuthentication#authentication_method + module AuthenticationMethod + extend Lithic::Internal::Type::Enum + + FRICTIONLESS = :FRICTIONLESS + CHALLENGE = :CHALLENGE + NONE = :NONE + + # @!method self.values + # @return [Array] + end + + # Indicates the outcome of the 3DS authentication process. + # + # @see Lithic::Models::CardholderAuthentication#authentication_result + module AuthenticationResult + extend Lithic::Internal::Type::Enum + + ATTEMPTS = :ATTEMPTS + DECLINE = :DECLINE + NONE = :NONE + SUCCESS = :SUCCESS + + # @!method self.values + # @return [Array] + end + + # Indicates which party made the 3DS authentication decision. + # + # @see Lithic::Models::CardholderAuthentication#decision_made_by + module DecisionMadeBy + extend Lithic::Internal::Type::Enum + + CUSTOMER_RULES = :CUSTOMER_RULES + CUSTOMER_ENDPOINT = :CUSTOMER_ENDPOINT + LITHIC_DEFAULT = :LITHIC_DEFAULT + LITHIC_RULES = :LITHIC_RULES + NETWORK = :NETWORK + UNKNOWN = :UNKNOWN + + # @!method self.values + # @return [Array] + end + + # Indicates whether chargeback liability shift applies to the transaction. + # Possible enum values: + # + # - `3DS_AUTHENTICATED`: The transaction was fully authenticated through a 3-D + # Secure flow, chargeback liability shift applies. + # - `NONE`: Chargeback liability shift has not shifted to the issuer, i.e. the + # merchant is liable. + # - `TOKEN_AUTHENTICATED`: The transaction was a tokenized payment with validated + # cryptography, possibly recurring. Chargeback liability shift to the issuer + # applies. + # + # @see Lithic::Models::CardholderAuthentication#liability_shift + module LiabilityShift + extend Lithic::Internal::Type::Enum + + LIABILITY_SHIFT_3DS_AUTHENTICATED = :"3DS_AUTHENTICATED" + TOKEN_AUTHENTICATED = :TOKEN_AUTHENTICATED + NONE = :NONE + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/cards/balance_list_params.rb b/lib/lithic/models/cards/balance_list_params.rb new file mode 100644 index 00000000..1dce25a3 --- /dev/null +++ b/lib/lithic/models/cards/balance_list_params.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Cards + # @see Lithic::Resources::Cards::Balances#list + class BalanceListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute card_token + # + # @return [String] + required :card_token, String + + # @!attribute balance_date + # UTC date of the balance to retrieve. Defaults to latest available balance + # + # @return [Time, nil] + optional :balance_date, Time + + # @!attribute last_transaction_event_token + # Balance after a given financial event occured. For example, passing the + # event_token of a $5 CARD_CLEARING financial event will return a balance + # decreased by $5 + # + # @return [String, nil] + optional :last_transaction_event_token, String + + # @!method initialize(card_token:, balance_date: nil, last_transaction_event_token: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Cards::BalanceListParams} for more details. + # + # @param card_token [String] + # + # @param balance_date [Time] UTC date of the balance to retrieve. Defaults to latest available balance + # + # @param last_transaction_event_token [String] Balance after a given financial event occured. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/cards/financial_transaction_list_params.rb b/lib/lithic/models/cards/financial_transaction_list_params.rb new file mode 100644 index 00000000..940e506d --- /dev/null +++ b/lib/lithic/models/cards/financial_transaction_list_params.rb @@ -0,0 +1,123 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Cards + # @see Lithic::Resources::Cards::FinancialTransactions#list + class FinancialTransactionListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute card_token + # + # @return [String] + required :card_token, String + + # @!attribute begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time + + # @!attribute category + # Financial Transaction category to be returned. + # + # @return [Symbol, Lithic::Models::Cards::FinancialTransactionListParams::Category, nil] + optional :category, enum: -> { Lithic::Cards::FinancialTransactionListParams::Category } + + # @!attribute end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute result + # Financial Transaction result to be returned. + # + # @return [Symbol, Lithic::Models::Cards::FinancialTransactionListParams::Result, nil] + optional :result, enum: -> { Lithic::Cards::FinancialTransactionListParams::Result } + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!attribute status + # Financial Transaction status to be returned. + # + # @return [Symbol, Lithic::Models::Cards::FinancialTransactionListParams::Status, nil] + optional :status, enum: -> { Lithic::Cards::FinancialTransactionListParams::Status } + + # @!method initialize(card_token:, begin_: nil, category: nil, end_: nil, ending_before: nil, result: nil, starting_after: nil, status: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Cards::FinancialTransactionListParams} for more details. + # + # @param card_token [String] + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param category [Symbol, Lithic::Models::Cards::FinancialTransactionListParams::Category] Financial Transaction category to be returned. + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param result [Symbol, Lithic::Models::Cards::FinancialTransactionListParams::Result] Financial Transaction result to be returned. + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param status [Symbol, Lithic::Models::Cards::FinancialTransactionListParams::Status] Financial Transaction status to be returned. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Financial Transaction category to be returned. + module Category + extend Lithic::Internal::Type::Enum + + CARD = :CARD + TRANSFER = :TRANSFER + + # @!method self.values + # @return [Array] + end + + # Financial Transaction result to be returned. + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + + # Financial Transaction status to be returned. + module Status + extend Lithic::Internal::Type::Enum + + DECLINED = :DECLINED + EXPIRED = :EXPIRED + PENDING = :PENDING + RETURNED = :RETURNED + SETTLED = :SETTLED + VOIDED = :VOIDED + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/cards/financial_transaction_retrieve_params.rb b/lib/lithic/models/cards/financial_transaction_retrieve_params.rb new file mode 100644 index 00000000..467aa8d4 --- /dev/null +++ b/lib/lithic/models/cards/financial_transaction_retrieve_params.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Cards + # @see Lithic::Resources::Cards::FinancialTransactions#retrieve + class FinancialTransactionRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute card_token + # + # @return [String] + required :card_token, String + + # @!attribute financial_transaction_token + # + # @return [String] + required :financial_transaction_token, String + + # @!method initialize(card_token:, financial_transaction_token:, request_options: {}) + # @param card_token [String] + # @param financial_transaction_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/carrier.rb b/lib/lithic/models/carrier.rb new file mode 100644 index 00000000..74caca59 --- /dev/null +++ b/lib/lithic/models/carrier.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Lithic + module Models + class Carrier < Lithic::Internal::Type::BaseModel + # @!attribute qr_code_url + # QR code URL to display on the card carrier. The `qr_code_url` field requires + # your domain to be allowlisted by Lithic before use. Contact Support to configure + # your QR code domain + # + # @return [String, nil] + optional :qr_code_url, String + + # @!method initialize(qr_code_url: nil) + # Some parameter documentations has been truncated, see {Lithic::Models::Carrier} + # for more details. + # + # @param qr_code_url [String] QR code URL to display on the card carrier. The `qr_code_url` field requires you + end + end +end diff --git a/lib/lithic/models/category_details.rb b/lib/lithic/models/category_details.rb new file mode 100644 index 00000000..a6e58dcb --- /dev/null +++ b/lib/lithic/models/category_details.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Lithic + module Models + class CategoryDetails < Lithic::Internal::Type::BaseModel + # @!attribute balance_transfers + # + # @return [String] + required :balance_transfers, String + + # @!attribute cash_advances + # + # @return [String] + required :cash_advances, String + + # @!attribute purchases + # + # @return [String] + required :purchases, String + + # @!method initialize(balance_transfers:, cash_advances:, purchases:) + # @param balance_transfers [String] + # @param cash_advances [String] + # @param purchases [String] + end + end +end diff --git a/lib/lithic/models/client_api_status_params.rb b/lib/lithic/models/client_api_status_params.rb new file mode 100644 index 00000000..e6e8bf29 --- /dev/null +++ b/lib/lithic/models/client_api_status_params.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Client#api_status + class ClientAPIStatusParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/credit_products/extended_credit.rb b/lib/lithic/models/credit_products/extended_credit.rb new file mode 100644 index 00000000..309e425d --- /dev/null +++ b/lib/lithic/models/credit_products/extended_credit.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + module CreditProducts + # @see Lithic::Resources::CreditProducts::ExtendedCredit#retrieve + class CreditProductsExtendedCredit < Lithic::Internal::Type::BaseModel + # @!attribute credit_extended + # + # @return [Integer] + required :credit_extended, Integer + + # @!method initialize(credit_extended:) + # @param credit_extended [Integer] + end + end + end +end diff --git a/lib/lithic/models/credit_products/extended_credit_retrieve_params.rb b/lib/lithic/models/credit_products/extended_credit_retrieve_params.rb new file mode 100644 index 00000000..cad980c2 --- /dev/null +++ b/lib/lithic/models/credit_products/extended_credit_retrieve_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Models + module CreditProducts + # @see Lithic::Resources::CreditProducts::ExtendedCredit#retrieve + class ExtendedCreditRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute credit_product_token + # + # @return [String] + required :credit_product_token, String + + # @!method initialize(credit_product_token:, request_options: {}) + # @param credit_product_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/credit_products/prime_rate_create_params.rb b/lib/lithic/models/credit_products/prime_rate_create_params.rb new file mode 100644 index 00000000..5103b3b1 --- /dev/null +++ b/lib/lithic/models/credit_products/prime_rate_create_params.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module Lithic + module Models + module CreditProducts + # @see Lithic::Resources::CreditProducts::PrimeRates#create + class PrimeRateCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute credit_product_token + # Globally unique identifier for credit products. + # + # @return [String] + required :credit_product_token, String + + # @!attribute effective_date + # Date the rate goes into effect + # + # @return [Date] + required :effective_date, Date + + # @!attribute rate + # The rate in decimal format + # + # @return [String] + required :rate, String + + # @!method initialize(credit_product_token:, effective_date:, rate:, request_options: {}) + # @param credit_product_token [String] Globally unique identifier for credit products. + # + # @param effective_date [Date] Date the rate goes into effect + # + # @param rate [String] The rate in decimal format + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/credit_products/prime_rate_retrieve_params.rb b/lib/lithic/models/credit_products/prime_rate_retrieve_params.rb new file mode 100644 index 00000000..1b27e145 --- /dev/null +++ b/lib/lithic/models/credit_products/prime_rate_retrieve_params.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module Lithic + module Models + module CreditProducts + # @see Lithic::Resources::CreditProducts::PrimeRates#retrieve + class PrimeRateRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute credit_product_token + # Globally unique identifier for credit products. + # + # @return [String] + required :credit_product_token, String + + # @!attribute ending_before + # The effective date that the prime rates ends before + # + # @return [Date, nil] + optional :ending_before, Date + + # @!attribute starting_after + # The effective date that the prime rate starts after + # + # @return [Date, nil] + optional :starting_after, Date + + # @!method initialize(credit_product_token:, ending_before: nil, starting_after: nil, request_options: {}) + # @param credit_product_token [String] Globally unique identifier for credit products. + # + # @param ending_before [Date] The effective date that the prime rates ends before + # + # @param starting_after [Date] The effective date that the prime rate starts after + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/credit_products/prime_rate_retrieve_response.rb b/lib/lithic/models/credit_products/prime_rate_retrieve_response.rb new file mode 100644 index 00000000..5c1d4801 --- /dev/null +++ b/lib/lithic/models/credit_products/prime_rate_retrieve_response.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +module Lithic + module Models + module CreditProducts + # @see Lithic::Resources::CreditProducts::PrimeRates#retrieve + class PrimeRateRetrieveResponse < Lithic::Internal::Type::BaseModel + # @!attribute data + # List of prime rates + # + # @return [Array] + required :data, + -> { Lithic::Internal::Type::ArrayOf[Lithic::Models::CreditProducts::PrimeRateRetrieveResponse::Data] } + + # @!attribute has_more + # Whether there are more prime rates + # + # @return [Boolean] + required :has_more, Lithic::Internal::Type::Boolean + + # @!method initialize(data:, has_more:) + # @param data [Array] List of prime rates + # + # @param has_more [Boolean] Whether there are more prime rates + + class Data < Lithic::Internal::Type::BaseModel + # @!attribute effective_date + # Date the rate goes into effect + # + # @return [Date] + required :effective_date, Date + + # @!attribute rate + # The rate in decimal format + # + # @return [String] + required :rate, String + + # @!method initialize(effective_date:, rate:) + # @param effective_date [Date] Date the rate goes into effect + # + # @param rate [String] The rate in decimal format + end + end + end + end +end diff --git a/lib/lithic/models/currency.rb b/lib/lithic/models/currency.rb new file mode 100644 index 00000000..e48d2fd8 --- /dev/null +++ b/lib/lithic/models/currency.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Lithic + module Models + Currency = String + end +end diff --git a/lib/lithic/models/device.rb b/lib/lithic/models/device.rb new file mode 100644 index 00000000..6c888554 --- /dev/null +++ b/lib/lithic/models/device.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module Lithic + module Models + class Device < Lithic::Internal::Type::BaseModel + # @!attribute imei + # The IMEI number of the device being provisioned. For Amex, this field contains + # device ID instead as IMEI is not provided + # + # @return [String, nil] + required :imei, String, nil?: true + + # @!attribute ip_address + # The IP address of the device initiating the request + # + # @return [String, nil] + required :ip_address, String, nil?: true + + # @!attribute location + # Latitude and longitude where the device is located during the authorization + # attempt + # + # @return [String, nil] + required :location, String, nil?: true + + # @!method initialize(imei:, ip_address:, location:) + # Some parameter documentations has been truncated, see {Lithic::Models::Device} + # for more details. + # + # @param imei [String, nil] The IMEI number of the device being provisioned. For Amex, this field contains d + # + # @param ip_address [String, nil] The IP address of the device initiating the request + # + # @param location [String, nil] Latitude and longitude where the device is located during the authorization atte + end + end +end diff --git a/lib/lithic/models/digital_card_art.rb b/lib/lithic/models/digital_card_art.rb new file mode 100644 index 00000000..46c87dcb --- /dev/null +++ b/lib/lithic/models/digital_card_art.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::DigitalCardArt#retrieve + class DigitalCardArtAPI < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for the card art. + # + # @return [String] + required :token, String + + # @!attribute card_program_token + # Globally unique identifier for the card program. + # + # @return [String] + required :card_program_token, String + + # @!attribute created + # Timestamp of when card art was created. + # + # @return [Time] + required :created, Time + + # @!attribute description + # Description of the card art. + # + # @return [String] + required :description, String + + # @!attribute is_enabled + # Whether the card art is enabled. + # + # @return [Boolean] + required :is_enabled, Lithic::Internal::Type::Boolean + + # @!attribute network + # Card network. + # + # @return [Symbol, Lithic::Models::DigitalCardArtAPI::Network] + required :network, enum: -> { Lithic::DigitalCardArtAPI::Network } + + # @!attribute is_card_program_default + # Whether the card art is the default card art to be added upon tokenization. + # + # @return [Boolean, nil] + optional :is_card_program_default, Lithic::Internal::Type::Boolean + + # @!method initialize(token:, card_program_token:, created:, description:, is_enabled:, network:, is_card_program_default: nil) + # @param token [String] Globally unique identifier for the card art. + # + # @param card_program_token [String] Globally unique identifier for the card program. + # + # @param created [Time] Timestamp of when card art was created. + # + # @param description [String] Description of the card art. + # + # @param is_enabled [Boolean] Whether the card art is enabled. + # + # @param network [Symbol, Lithic::Models::DigitalCardArtAPI::Network] Card network. + # + # @param is_card_program_default [Boolean] Whether the card art is the default card art to be added upon tokenization. + + # Card network. + # + # @see Lithic::Models::DigitalCardArtAPI#network + module Network + extend Lithic::Internal::Type::Enum + + MASTERCARD = :MASTERCARD + VISA = :VISA + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/digital_card_art_list_params.rb b/lib/lithic/models/digital_card_art_list_params.rb new file mode 100644 index 00000000..9e1b99d9 --- /dev/null +++ b/lib/lithic/models/digital_card_art_list_params.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::DigitalCardArt#list + class DigitalCardArtListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!method initialize(ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::DigitalCardArtListParams} for more details. + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/digital_card_art_retrieve_params.rb b/lib/lithic/models/digital_card_art_retrieve_params.rb new file mode 100644 index 00000000..207e434a --- /dev/null +++ b/lib/lithic/models/digital_card_art_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::DigitalCardArt#retrieve + class DigitalCardArtRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute digital_card_art_token + # + # @return [String] + required :digital_card_art_token, String + + # @!method initialize(digital_card_art_token:, request_options: {}) + # @param digital_card_art_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/digital_wallet_tokenization_approval_request_webhook_event.rb b/lib/lithic/models/digital_wallet_tokenization_approval_request_webhook_event.rb new file mode 100644 index 00000000..cb2b150b --- /dev/null +++ b/lib/lithic/models/digital_wallet_tokenization_approval_request_webhook_event.rb @@ -0,0 +1,263 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DigitalWalletTokenizationApprovalRequestWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute account_token + # Unique identifier for the user tokenizing a card + # + # @return [String] + required :account_token, String + + # @!attribute card_token + # Unique identifier for the card being tokenized + # + # @return [String] + required :card_token, String + + # @!attribute created + # Indicate when the request was received from Mastercard or Visa + # + # @return [Time] + required :created, Time + + # @!attribute digital_wallet_token_metadata + # Contains the metadata for the digital wallet being tokenized. + # + # @return [Lithic::Models::TokenMetadata] + required :digital_wallet_token_metadata, -> { Lithic::TokenMetadata } + + # @!attribute event_type + # The name of this event + # + # @return [Symbol, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::EventType] + required :event_type, enum: -> { Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::EventType } + + # @!attribute issuer_decision + # Whether Lithic decisioned on the token, and if so, what the decision was. + # APPROVED/VERIFICATION_REQUIRED/DENIED. + # + # @return [Symbol, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::IssuerDecision] + required :issuer_decision, + enum: -> { Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::IssuerDecision } + + # @!attribute tokenization_channel + # The channel through which the tokenization was made. + # + # @return [Symbol, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationChannel] + required :tokenization_channel, + enum: -> { Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationChannel } + + # @!attribute tokenization_token + # Unique identifier for the digital wallet token attempt + # + # @return [String] + required :tokenization_token, String + + # @!attribute wallet_decisioning_info + # + # @return [Lithic::Models::WalletDecisioningInfo] + required :wallet_decisioning_info, -> { Lithic::WalletDecisioningInfo } + + # @!attribute customer_tokenization_decision + # Contains the metadata for the customer tokenization decision. + # + # @return [Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision, nil] + optional :customer_tokenization_decision, + -> { + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision + }, + nil?: true + + # @!attribute device + # + # @return [Lithic::Models::Device, nil] + optional :device, -> { Lithic::Device } + + # @!attribute rule_results + # Results from rules that were evaluated for this tokenization. Only populated in + # webhook events, not in the initial decisioning request + # + # @return [Array, nil] + optional :rule_results, -> { Lithic::Internal::Type::ArrayOf[Lithic::TokenizationRuleResult] } + + # @!attribute tokenization_decline_reasons + # List of reasons why the tokenization was declined. Only populated in webhook + # events, not in the initial decisioning request + # + # @return [Array, nil] + optional :tokenization_decline_reasons, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::TokenizationDeclineReason] } + + # @!attribute tokenization_source + # The source of the tokenization. + # + # @return [Symbol, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource, nil] + optional :tokenization_source, + enum: -> { Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource } + + # @!attribute tokenization_tfa_reasons + # List of reasons why two-factor authentication was required. Only populated in + # webhook events, not in the initial decisioning request + # + # @return [Array, nil] + optional :tokenization_tfa_reasons, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::TokenizationTfaReason] } + + # @!method initialize(account_token:, card_token:, created:, digital_wallet_token_metadata:, event_type:, issuer_decision:, tokenization_channel:, tokenization_token:, wallet_decisioning_info:, customer_tokenization_decision: nil, device: nil, rule_results: nil, tokenization_decline_reasons: nil, tokenization_source: nil, tokenization_tfa_reasons: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent} for more + # details. + # + # Payload for digital wallet tokenization approval requests. Used for both the + # decisioning responder request (sent to the customer's endpoint for a real-time + # decision) and the subsequent webhook event (sent after the decision is made). + # Fields like customer_tokenization_decision, tokenization_decline_reasons, + # tokenization_tfa_reasons, and rule_results are only populated in the webhook + # event, not in the initial decisioning request. + # + # @param account_token [String] Unique identifier for the user tokenizing a card + # + # @param card_token [String] Unique identifier for the card being tokenized + # + # @param created [Time] Indicate when the request was received from Mastercard or Visa + # + # @param digital_wallet_token_metadata [Lithic::Models::TokenMetadata] Contains the metadata for the digital wallet being tokenized. + # + # @param event_type [Symbol, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::EventType] The name of this event + # + # @param issuer_decision [Symbol, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::IssuerDecision] Whether Lithic decisioned on the token, and if so, what the decision was. APPROV + # + # @param tokenization_channel [Symbol, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationChannel] The channel through which the tokenization was made. + # + # @param tokenization_token [String] Unique identifier for the digital wallet token attempt + # + # @param wallet_decisioning_info [Lithic::Models::WalletDecisioningInfo] + # + # @param customer_tokenization_decision [Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision, nil] Contains the metadata for the customer tokenization decision. + # + # @param device [Lithic::Models::Device] + # + # @param rule_results [Array] Results from rules that were evaluated for this tokenization. Only populated in + # + # @param tokenization_decline_reasons [Array] List of reasons why the tokenization was declined. Only populated in webhook eve + # + # @param tokenization_source [Symbol, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource] The source of the tokenization. + # + # @param tokenization_tfa_reasons [Array] List of reasons why two-factor authentication was required. Only populated in we + + # The name of this event + # + # @see Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent#event_type + module EventType + extend Lithic::Internal::Type::Enum + + DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = :"digital_wallet.tokenization_approval_request" + + # @!method self.values + # @return [Array] + end + + # Whether Lithic decisioned on the token, and if so, what the decision was. + # APPROVED/VERIFICATION_REQUIRED/DENIED. + # + # @see Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent#issuer_decision + module IssuerDecision + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DENIED = :DENIED + VERIFICATION_REQUIRED = :VERIFICATION_REQUIRED + + # @!method self.values + # @return [Array] + end + + # The channel through which the tokenization was made. + # + # @see Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent#tokenization_channel + module TokenizationChannel + extend Lithic::Internal::Type::Enum + + DIGITAL_WALLET = :DIGITAL_WALLET + MERCHANT = :MERCHANT + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent#customer_tokenization_decision + class CustomerTokenizationDecision < Lithic::Internal::Type::BaseModel + # @!attribute outcome + # The outcome of the customer's decision + # + # @return [Symbol, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome] + required :outcome, + enum: -> { Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome } + + # @!attribute responder_url + # The customer's subscribed URL + # + # @return [String] + required :responder_url, String + + # @!attribute latency + # Time in ms it took for the customer's URL to respond + # + # @return [String, nil] + optional :latency, String + + # @!attribute response_code + # The response code that the customer provided + # + # @return [String, nil] + optional :response_code, String + + # @!method initialize(outcome:, responder_url:, latency: nil, response_code: nil) + # Contains the metadata for the customer tokenization decision. + # + # @param outcome [Symbol, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome] The outcome of the customer's decision + # + # @param responder_url [String] The customer's subscribed URL + # + # @param latency [String] Time in ms it took for the customer's URL to respond + # + # @param response_code [String] The response code that the customer provided + + # The outcome of the customer's decision + # + # @see Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision#outcome + module Outcome + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + ERROR = :ERROR + INVALID_RESPONSE = :INVALID_RESPONSE + REQUIRE_ADDITIONAL_AUTHENTICATION = :REQUIRE_ADDITIONAL_AUTHENTICATION + TIMEOUT = :TIMEOUT + + # @!method self.values + # @return [Array] + end + end + + # The source of the tokenization. + # + # @see Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent#tokenization_source + module TokenizationSource + extend Lithic::Internal::Type::Enum + + ACCOUNT_ON_FILE = :ACCOUNT_ON_FILE + CONTACTLESS_TAP = :CONTACTLESS_TAP + MANUAL_PROVISION = :MANUAL_PROVISION + PUSH_PROVISION = :PUSH_PROVISION + TOKEN = :TOKEN + UNKNOWN = :UNKNOWN + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/digital_wallet_tokenization_result_webhook_event.rb b/lib/lithic/models/digital_wallet_tokenization_result_webhook_event.rb new file mode 100644 index 00000000..9b6f621a --- /dev/null +++ b/lib/lithic/models/digital_wallet_tokenization_result_webhook_event.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DigitalWalletTokenizationResultWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute account_token + # Account token + # + # @return [String] + required :account_token, String + + # @!attribute card_token + # Card token + # + # @return [String] + required :card_token, String + + # @!attribute created + # Created date + # + # @return [Time] + required :created, Time + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"digital_wallet.tokenization_result"] + required :event_type, const: :"digital_wallet.tokenization_result" + + # @!attribute tokenization_result_details + # The result of the tokenization request. + # + # @return [Lithic::Models::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails] + required :tokenization_result_details, + -> { Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails } + + # @!attribute tokenization_token + # Tokenization token + # + # @return [String] + required :tokenization_token, String + + # @!method initialize(account_token:, card_token:, created:, tokenization_result_details:, tokenization_token:, event_type: :"digital_wallet.tokenization_result") + # @param account_token [String] Account token + # + # @param card_token [String] Card token + # + # @param created [Time] Created date + # + # @param tokenization_result_details [Lithic::Models::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails] The result of the tokenization request. + # + # @param tokenization_token [String] Tokenization token + # + # @param event_type [Symbol, :"digital_wallet.tokenization_result"] The type of event that occurred. + + # @see Lithic::Models::DigitalWalletTokenizationResultWebhookEvent#tokenization_result_details + class TokenizationResultDetails < Lithic::Internal::Type::BaseModel + # @!attribute issuer_decision + # Lithic's tokenization decision. + # + # @return [String] + required :issuer_decision, String + + # @!attribute tokenization_decline_reasons + # List of reasons why the tokenization was declined + # + # @return [Array] + required :tokenization_decline_reasons, + -> do + Lithic::Internal::Type::ArrayOf[ + enum: Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason + ] + end + + # @!attribute customer_decision + # The customer's tokenization decision if applicable. + # + # @return [String, nil] + optional :customer_decision, String, nil?: true + + # @!attribute rule_results + # Results from rules that were evaluated for this tokenization + # + # @return [Array, nil] + optional :rule_results, -> { Lithic::Internal::Type::ArrayOf[Lithic::TokenizationRuleResult] } + + # @!attribute token_activated_date_time + # An RFC 3339 timestamp indicating when the tokenization succeeded. + # + # @return [Time, nil] + optional :token_activated_date_time, Time, nil?: true + + # @!attribute tokenization_tfa_reasons + # List of reasons why two-factor authentication was required + # + # @return [Array, nil] + optional :tokenization_tfa_reasons, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::TokenizationTfaReason] } + + # @!attribute wallet_decision + # The wallet's recommended decision. + # + # @return [String, nil] + optional :wallet_decision, String, nil?: true + + # @!method initialize(issuer_decision:, tokenization_decline_reasons:, customer_decision: nil, rule_results: nil, token_activated_date_time: nil, tokenization_tfa_reasons: nil, wallet_decision: nil) + # The result of the tokenization request. + # + # @param issuer_decision [String] Lithic's tokenization decision. + # + # @param tokenization_decline_reasons [Array] List of reasons why the tokenization was declined + # + # @param customer_decision [String, nil] The customer's tokenization decision if applicable. + # + # @param rule_results [Array] Results from rules that were evaluated for this tokenization + # + # @param token_activated_date_time [Time, nil] An RFC 3339 timestamp indicating when the tokenization succeeded. + # + # @param tokenization_tfa_reasons [Array] List of reasons why two-factor authentication was required + # + # @param wallet_decision [String, nil] The wallet's recommended decision. + + module TokenizationDeclineReason + extend Lithic::Internal::Type::Enum + + ACCOUNT_SCORE_1 = :ACCOUNT_SCORE_1 + ALL_WALLET_DECLINE_REASONS_PRESENT = :ALL_WALLET_DECLINE_REASONS_PRESENT + CARD_EXPIRY_MONTH_MISMATCH = :CARD_EXPIRY_MONTH_MISMATCH + CARD_EXPIRY_YEAR_MISMATCH = :CARD_EXPIRY_YEAR_MISMATCH + CARD_INVALID_STATE = :CARD_INVALID_STATE + CUSTOMER_RED_PATH = :CUSTOMER_RED_PATH + CVC_MISMATCH = :CVC_MISMATCH + DEVICE_SCORE_1 = :DEVICE_SCORE_1 + GENERIC_DECLINE = :GENERIC_DECLINE + INVALID_CUSTOMER_RESPONSE = :INVALID_CUSTOMER_RESPONSE + NETWORK_FAILURE = :NETWORK_FAILURE + WALLET_RECOMMENDED_DECISION_RED = :WALLET_RECOMMENDED_DECISION_RED + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_sent_webhook_event.rb b/lib/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_sent_webhook_event.rb new file mode 100644 index 00000000..287fdeab --- /dev/null +++ b/lib/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_sent_webhook_event.rb @@ -0,0 +1,100 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute account_token + # Unique identifier for the user tokenizing a card + # + # @return [String] + required :account_token, String + + # @!attribute activation_method + # + # @return [Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod] + required :activation_method, + -> { Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod } + + # @!attribute card_token + # Unique identifier for the card being tokenized + # + # @return [String] + required :card_token, String + + # @!attribute created + # Indicate when the request was received from Mastercard or Visa + # + # @return [Time] + required :created, Time + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"digital_wallet.tokenization_two_factor_authentication_code_sent"] + required :event_type, const: :"digital_wallet.tokenization_two_factor_authentication_code_sent" + + # @!attribute tokenization_token + # Unique identifier for the tokenization + # + # @return [String] + required :tokenization_token, String + + # @!method initialize(account_token:, activation_method:, card_token:, created:, tokenization_token:, event_type: :"digital_wallet.tokenization_two_factor_authentication_code_sent") + # @param account_token [String] Unique identifier for the user tokenizing a card + # + # @param activation_method [Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod] + # + # @param card_token [String] Unique identifier for the card being tokenized + # + # @param created [Time] Indicate when the request was received from Mastercard or Visa + # + # @param tokenization_token [String] Unique identifier for the tokenization + # + # @param event_type [Symbol, :"digital_wallet.tokenization_two_factor_authentication_code_sent"] The type of event that occurred. + + # @see Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent#activation_method + class ActivationMethod < Lithic::Internal::Type::BaseModel + # @!attribute type + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + # + # @return [Symbol, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type] + required :type, + enum: -> { Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type } + + # @!attribute value + # The location to which the authentication code was sent. The format depends on + # the ActivationMethod.Type field. If Type is Email, the Value will be the email + # address. If the Type is Sms, the Value will be the phone number. + # + # @return [String] + required :value, String + + # @!method initialize(type:, value:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod} + # for more details. + # + # @param type [Symbol, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type] The communication method that the user has selected to use to receive the authen + # + # @param value [String] The location to which the authentication code was sent. + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + # + # @see Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod#type + module Type + extend Lithic::Internal::Type::Enum + + EMAIL_TO_CARDHOLDER_ADDRESS = :EMAIL_TO_CARDHOLDER_ADDRESS + TEXT_TO_CARDHOLDER_NUMBER = :TEXT_TO_CARDHOLDER_NUMBER + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_webhook_event.rb b/lib/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_webhook_event.rb new file mode 100644 index 00000000..3b354398 --- /dev/null +++ b/lib/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_webhook_event.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute account_token + # Unique identifier for the user tokenizing a card + # + # @return [String] + required :account_token, String + + # @!attribute activation_method + # + # @return [Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod] + required :activation_method, + -> { Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod } + + # @!attribute authentication_code + # Authentication code to provide to the user tokenizing a card. + # + # @return [String] + required :authentication_code, String + + # @!attribute card_token + # Unique identifier for the card being tokenized + # + # @return [String] + required :card_token, String + + # @!attribute created + # Indicate when the request was received from Mastercard or Visa + # + # @return [Time] + required :created, Time + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"digital_wallet.tokenization_two_factor_authentication_code"] + required :event_type, const: :"digital_wallet.tokenization_two_factor_authentication_code" + + # @!attribute tokenization_token + # Unique identifier for the tokenization + # + # @return [String] + required :tokenization_token, String + + # @!method initialize(account_token:, activation_method:, authentication_code:, card_token:, created:, tokenization_token:, event_type: :"digital_wallet.tokenization_two_factor_authentication_code") + # @param account_token [String] Unique identifier for the user tokenizing a card + # + # @param activation_method [Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod] + # + # @param authentication_code [String] Authentication code to provide to the user tokenizing a card. + # + # @param card_token [String] Unique identifier for the card being tokenized + # + # @param created [Time] Indicate when the request was received from Mastercard or Visa + # + # @param tokenization_token [String] Unique identifier for the tokenization + # + # @param event_type [Symbol, :"digital_wallet.tokenization_two_factor_authentication_code"] The type of event that occurred. + + # @see Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent#activation_method + class ActivationMethod < Lithic::Internal::Type::BaseModel + # @!attribute type + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + # + # @return [Symbol, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type] + required :type, + enum: -> { Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type } + + # @!attribute value + # The location where the user wants to receive the authentication code. The format + # depends on the ActivationMethod.Type field. If Type is Email, the Value will be + # the email address. If the Type is Sms, the Value will be the phone number. + # + # @return [String] + required :value, String + + # @!method initialize(type:, value:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod} + # for more details. + # + # @param type [Symbol, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type] The communication method that the user has selected to use to receive the authen + # + # @param value [String] The location where the user wants to receive the authentication code. + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + # + # @see Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod#type + module Type + extend Lithic::Internal::Type::Enum + + EMAIL_TO_CARDHOLDER_ADDRESS = :EMAIL_TO_CARDHOLDER_ADDRESS + TEXT_TO_CARDHOLDER_NUMBER = :TEXT_TO_CARDHOLDER_NUMBER + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/digital_wallet_tokenization_updated_webhook_event.rb b/lib/lithic/models/digital_wallet_tokenization_updated_webhook_event.rb new file mode 100644 index 00000000..869e9d2a --- /dev/null +++ b/lib/lithic/models/digital_wallet_tokenization_updated_webhook_event.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DigitalWalletTokenizationUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute account_token + # Account token + # + # @return [String] + required :account_token, String + + # @!attribute card_token + # Card token + # + # @return [String] + required :card_token, String + + # @!attribute created + # Created date + # + # @return [Time] + required :created, Time + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"digital_wallet.tokenization_updated"] + required :event_type, const: :"digital_wallet.tokenization_updated" + + # @!attribute tokenization + # + # @return [Lithic::Models::Tokenization] + required :tokenization, -> { Lithic::Tokenization } + + # @!method initialize(account_token:, card_token:, created:, tokenization:, event_type: :"digital_wallet.tokenization_updated") + # @param account_token [String] Account token + # + # @param card_token [String] Card token + # + # @param created [Time] Created date + # + # @param tokenization [Lithic::Models::Tokenization] + # + # @param event_type [Symbol, :"digital_wallet.tokenization_updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/dispute.rb b/lib/lithic/models/dispute.rb new file mode 100644 index 00000000..fb4d28fc --- /dev/null +++ b/lib/lithic/models/dispute.rb @@ -0,0 +1,324 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Disputes#create + class Dispute < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier. + # + # @return [String] + required :token, String + + # @!attribute amount + # Amount under dispute. May be different from the original transaction amount. + # + # @return [Integer] + required :amount, Integer + + # @!attribute arbitration_date + # Date dispute entered arbitration. + # + # @return [Time, nil] + required :arbitration_date, Time, nil?: true + + # @!attribute created + # Timestamp of when first Dispute was reported. + # + # @return [Time] + required :created, Time + + # @!attribute customer_filed_date + # Date that the dispute was filed by the customer making the dispute. + # + # @return [Time, nil] + required :customer_filed_date, Time, nil?: true + + # @!attribute customer_note + # End customer description of the reason for the dispute. + # + # @return [String, nil] + required :customer_note, String, nil?: true + + # @!attribute network_claim_ids + # Unique identifiers for the dispute from the network. + # + # @return [Array, nil] + required :network_claim_ids, Lithic::Internal::Type::ArrayOf[String], nil?: true + + # @!attribute network_filed_date + # Date that the dispute was submitted to the network. + # + # @return [Time, nil] + required :network_filed_date, Time, nil?: true + + # @!attribute network_reason_code + # Network reason code used to file the dispute. + # + # @return [String, nil] + required :network_reason_code, String, nil?: true + + # @!attribute prearbitration_date + # Date dispute entered pre-arbitration. + # + # @return [Time, nil] + required :prearbitration_date, Time, nil?: true + + # @!attribute primary_claim_id + # Unique identifier for the dispute from the network. If there are multiple, this + # will be the first claim id set by the network + # + # @return [String, nil] + required :primary_claim_id, String, nil?: true + + # @!attribute reason + # Dispute reason: + # + # - `ATM_CASH_MISDISPENSE`: ATM cash misdispense. + # - `CANCELLED`: Transaction was cancelled by the customer. + # - `DUPLICATED`: The transaction was a duplicate. + # - `FRAUD_CARD_NOT_PRESENT`: Fraudulent transaction, card not present. + # - `FRAUD_CARD_PRESENT`: Fraudulent transaction, card present. + # - `FRAUD_OTHER`: Fraudulent transaction, other types such as questionable + # merchant activity. + # - `GOODS_SERVICES_NOT_AS_DESCRIBED`: The goods or services were not as + # described. + # - `GOODS_SERVICES_NOT_RECEIVED`: The goods or services were not received. + # - `INCORRECT_AMOUNT`: The transaction amount was incorrect. + # - `MISSING_AUTH`: The transaction was missing authorization. + # - `OTHER`: Other reason. + # - `PROCESSING_ERROR`: Processing error. + # - `REFUND_NOT_PROCESSED`: The refund was not processed. + # - `RECURRING_TRANSACTION_NOT_CANCELLED`: The recurring transaction was not + # cancelled. + # + # @return [Symbol, Lithic::Models::Dispute::Reason] + required :reason, enum: -> { Lithic::Dispute::Reason } + + # @!attribute representment_date + # Date the representment was received. + # + # @return [Time, nil] + required :representment_date, Time, nil?: true + + # @!attribute resolution_date + # Date that the dispute was resolved. + # + # @return [Time, nil] + required :resolution_date, Time, nil?: true + + # @!attribute resolution_note + # Note by Dispute team on the case resolution. + # + # @return [String, nil] + required :resolution_note, String, nil?: true + + # @!attribute resolution_reason + # Reason for the dispute resolution: + # + # - `CASE_LOST`: This case was lost at final arbitration. + # - `NETWORK_REJECTED`: Network rejected. + # - `NO_DISPUTE_RIGHTS_3DS`: No dispute rights, 3DS. + # - `NO_DISPUTE_RIGHTS_BELOW_THRESHOLD`: No dispute rights, below threshold. + # - `NO_DISPUTE_RIGHTS_CONTACTLESS`: No dispute rights, contactless. + # - `NO_DISPUTE_RIGHTS_HYBRID`: No dispute rights, hybrid. + # - `NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS`: No dispute rights, max chargebacks. + # - `NO_DISPUTE_RIGHTS_OTHER`: No dispute rights, other. + # - `PAST_FILING_DATE`: Past filing date. + # - `PREARBITRATION_REJECTED`: Prearbitration rejected. + # - `PROCESSOR_REJECTED_OTHER`: Processor rejected, other. + # - `REFUNDED`: Refunded. + # - `REFUNDED_AFTER_CHARGEBACK`: Refunded after chargeback. + # - `WITHDRAWN`: Withdrawn. + # - `WON_ARBITRATION`: Won arbitration. + # - `WON_FIRST_CHARGEBACK`: Won first chargeback. + # - `WON_PREARBITRATION`: Won prearbitration. + # + # @return [Symbol, Lithic::Models::Dispute::ResolutionReason, nil] + required :resolution_reason, enum: -> { Lithic::Dispute::ResolutionReason }, nil?: true + + # @!attribute status + # Status types: + # + # - `NEW` - New dispute case is opened. + # - `PENDING_CUSTOMER` - Lithic is waiting for customer to provide more + # information. + # - `SUBMITTED` - Dispute is submitted to the card network. + # - `REPRESENTMENT` - Case has entered second presentment. + # - `PREARBITRATION` - Case has entered prearbitration. + # - `ARBITRATION` - Case has entered arbitration. + # - `CASE_WON` - Case was won and credit will be issued. + # - `CASE_CLOSED` - Case was lost or withdrawn. + # + # @return [Symbol, Lithic::Models::Dispute::Status] + required :status, enum: -> { Lithic::Dispute::Status } + + # @!attribute transaction_token + # The transaction that is being disputed. A transaction can only be disputed once + # but may have multiple dispute cases. + # + # @return [String] + required :transaction_token, String + + # @!method initialize(token:, amount:, arbitration_date:, created:, customer_filed_date:, customer_note:, network_claim_ids:, network_filed_date:, network_reason_code:, prearbitration_date:, primary_claim_id:, reason:, representment_date:, resolution_date:, resolution_note:, resolution_reason:, status:, transaction_token:) + # Some parameter documentations has been truncated, see {Lithic::Models::Dispute} + # for more details. + # + # Dispute. + # + # @param token [String] Globally unique identifier. + # + # @param amount [Integer] Amount under dispute. May be different from the original transaction amount. + # + # @param arbitration_date [Time, nil] Date dispute entered arbitration. + # + # @param created [Time] Timestamp of when first Dispute was reported. + # + # @param customer_filed_date [Time, nil] Date that the dispute was filed by the customer making the dispute. + # + # @param customer_note [String, nil] End customer description of the reason for the dispute. + # + # @param network_claim_ids [Array, nil] Unique identifiers for the dispute from the network. + # + # @param network_filed_date [Time, nil] Date that the dispute was submitted to the network. + # + # @param network_reason_code [String, nil] Network reason code used to file the dispute. + # + # @param prearbitration_date [Time, nil] Date dispute entered pre-arbitration. + # + # @param primary_claim_id [String, nil] Unique identifier for the dispute from the network. If there are multiple, this + # + # @param reason [Symbol, Lithic::Models::Dispute::Reason] Dispute reason: + # + # @param representment_date [Time, nil] Date the representment was received. + # + # @param resolution_date [Time, nil] Date that the dispute was resolved. + # + # @param resolution_note [String, nil] Note by Dispute team on the case resolution. + # + # @param resolution_reason [Symbol, Lithic::Models::Dispute::ResolutionReason, nil] Reason for the dispute resolution: + # + # @param status [Symbol, Lithic::Models::Dispute::Status] Status types: + # + # @param transaction_token [String] The transaction that is being disputed. A transaction can only be disputed once + + # Dispute reason: + # + # - `ATM_CASH_MISDISPENSE`: ATM cash misdispense. + # - `CANCELLED`: Transaction was cancelled by the customer. + # - `DUPLICATED`: The transaction was a duplicate. + # - `FRAUD_CARD_NOT_PRESENT`: Fraudulent transaction, card not present. + # - `FRAUD_CARD_PRESENT`: Fraudulent transaction, card present. + # - `FRAUD_OTHER`: Fraudulent transaction, other types such as questionable + # merchant activity. + # - `GOODS_SERVICES_NOT_AS_DESCRIBED`: The goods or services were not as + # described. + # - `GOODS_SERVICES_NOT_RECEIVED`: The goods or services were not received. + # - `INCORRECT_AMOUNT`: The transaction amount was incorrect. + # - `MISSING_AUTH`: The transaction was missing authorization. + # - `OTHER`: Other reason. + # - `PROCESSING_ERROR`: Processing error. + # - `REFUND_NOT_PROCESSED`: The refund was not processed. + # - `RECURRING_TRANSACTION_NOT_CANCELLED`: The recurring transaction was not + # cancelled. + # + # @see Lithic::Models::Dispute#reason + module Reason + extend Lithic::Internal::Type::Enum + + ATM_CASH_MISDISPENSE = :ATM_CASH_MISDISPENSE + CANCELLED = :CANCELLED + DUPLICATED = :DUPLICATED + FRAUD_CARD_NOT_PRESENT = :FRAUD_CARD_NOT_PRESENT + FRAUD_CARD_PRESENT = :FRAUD_CARD_PRESENT + FRAUD_OTHER = :FRAUD_OTHER + GOODS_SERVICES_NOT_AS_DESCRIBED = :GOODS_SERVICES_NOT_AS_DESCRIBED + GOODS_SERVICES_NOT_RECEIVED = :GOODS_SERVICES_NOT_RECEIVED + INCORRECT_AMOUNT = :INCORRECT_AMOUNT + MISSING_AUTH = :MISSING_AUTH + OTHER = :OTHER + PROCESSING_ERROR = :PROCESSING_ERROR + RECURRING_TRANSACTION_NOT_CANCELLED = :RECURRING_TRANSACTION_NOT_CANCELLED + REFUND_NOT_PROCESSED = :REFUND_NOT_PROCESSED + + # @!method self.values + # @return [Array] + end + + # Reason for the dispute resolution: + # + # - `CASE_LOST`: This case was lost at final arbitration. + # - `NETWORK_REJECTED`: Network rejected. + # - `NO_DISPUTE_RIGHTS_3DS`: No dispute rights, 3DS. + # - `NO_DISPUTE_RIGHTS_BELOW_THRESHOLD`: No dispute rights, below threshold. + # - `NO_DISPUTE_RIGHTS_CONTACTLESS`: No dispute rights, contactless. + # - `NO_DISPUTE_RIGHTS_HYBRID`: No dispute rights, hybrid. + # - `NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS`: No dispute rights, max chargebacks. + # - `NO_DISPUTE_RIGHTS_OTHER`: No dispute rights, other. + # - `PAST_FILING_DATE`: Past filing date. + # - `PREARBITRATION_REJECTED`: Prearbitration rejected. + # - `PROCESSOR_REJECTED_OTHER`: Processor rejected, other. + # - `REFUNDED`: Refunded. + # - `REFUNDED_AFTER_CHARGEBACK`: Refunded after chargeback. + # - `WITHDRAWN`: Withdrawn. + # - `WON_ARBITRATION`: Won arbitration. + # - `WON_FIRST_CHARGEBACK`: Won first chargeback. + # - `WON_PREARBITRATION`: Won prearbitration. + # + # @see Lithic::Models::Dispute#resolution_reason + module ResolutionReason + extend Lithic::Internal::Type::Enum + + CASE_LOST = :CASE_LOST + NETWORK_REJECTED = :NETWORK_REJECTED + NO_DISPUTE_RIGHTS_3DS = :NO_DISPUTE_RIGHTS_3DS + NO_DISPUTE_RIGHTS_BELOW_THRESHOLD = :NO_DISPUTE_RIGHTS_BELOW_THRESHOLD + NO_DISPUTE_RIGHTS_CONTACTLESS = :NO_DISPUTE_RIGHTS_CONTACTLESS + NO_DISPUTE_RIGHTS_HYBRID = :NO_DISPUTE_RIGHTS_HYBRID + NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS = :NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS + NO_DISPUTE_RIGHTS_OTHER = :NO_DISPUTE_RIGHTS_OTHER + PAST_FILING_DATE = :PAST_FILING_DATE + PREARBITRATION_REJECTED = :PREARBITRATION_REJECTED + PROCESSOR_REJECTED_OTHER = :PROCESSOR_REJECTED_OTHER + REFUNDED = :REFUNDED + REFUNDED_AFTER_CHARGEBACK = :REFUNDED_AFTER_CHARGEBACK + WITHDRAWN = :WITHDRAWN + WON_ARBITRATION = :WON_ARBITRATION + WON_FIRST_CHARGEBACK = :WON_FIRST_CHARGEBACK + WON_PREARBITRATION = :WON_PREARBITRATION + + # @!method self.values + # @return [Array] + end + + # Status types: + # + # - `NEW` - New dispute case is opened. + # - `PENDING_CUSTOMER` - Lithic is waiting for customer to provide more + # information. + # - `SUBMITTED` - Dispute is submitted to the card network. + # - `REPRESENTMENT` - Case has entered second presentment. + # - `PREARBITRATION` - Case has entered prearbitration. + # - `ARBITRATION` - Case has entered arbitration. + # - `CASE_WON` - Case was won and credit will be issued. + # - `CASE_CLOSED` - Case was lost or withdrawn. + # + # @see Lithic::Models::Dispute#status + module Status + extend Lithic::Internal::Type::Enum + + ARBITRATION = :ARBITRATION + CASE_CLOSED = :CASE_CLOSED + CASE_WON = :CASE_WON + NEW = :NEW + PENDING_CUSTOMER = :PENDING_CUSTOMER + PREARBITRATION = :PREARBITRATION + REPRESENTMENT = :REPRESENTMENT + SUBMITTED = :SUBMITTED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/dispute_create_params.rb b/lib/lithic/models/dispute_create_params.rb new file mode 100644 index 00000000..f56fd597 --- /dev/null +++ b/lib/lithic/models/dispute_create_params.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Disputes#create + class DisputeCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute amount + # Amount for chargeback + # + # @return [Integer] + required :amount, Integer + + # @!attribute reason + # Reason for chargeback + # + # @return [Symbol, Lithic::Models::DisputeCreateParams::Reason] + required :reason, enum: -> { Lithic::DisputeCreateParams::Reason } + + # @!attribute transaction_token + # Transaction for chargeback + # + # @return [String] + required :transaction_token, String + + # @!attribute customer_filed_date + # Date the customer filed the chargeback request + # + # @return [Time, nil] + optional :customer_filed_date, Time + + # @!attribute customer_note + # Customer description + # + # @return [String, nil] + optional :customer_note, String + + # @!method initialize(amount:, reason:, transaction_token:, customer_filed_date: nil, customer_note: nil, request_options: {}) + # @param amount [Integer] Amount for chargeback + # + # @param reason [Symbol, Lithic::Models::DisputeCreateParams::Reason] Reason for chargeback + # + # @param transaction_token [String] Transaction for chargeback + # + # @param customer_filed_date [Time] Date the customer filed the chargeback request + # + # @param customer_note [String] Customer description + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Reason for chargeback + module Reason + extend Lithic::Internal::Type::Enum + + ATM_CASH_MISDISPENSE = :ATM_CASH_MISDISPENSE + CANCELLED = :CANCELLED + DUPLICATED = :DUPLICATED + FRAUD_CARD_NOT_PRESENT = :FRAUD_CARD_NOT_PRESENT + FRAUD_CARD_PRESENT = :FRAUD_CARD_PRESENT + FRAUD_OTHER = :FRAUD_OTHER + GOODS_SERVICES_NOT_AS_DESCRIBED = :GOODS_SERVICES_NOT_AS_DESCRIBED + GOODS_SERVICES_NOT_RECEIVED = :GOODS_SERVICES_NOT_RECEIVED + INCORRECT_AMOUNT = :INCORRECT_AMOUNT + MISSING_AUTH = :MISSING_AUTH + OTHER = :OTHER + PROCESSING_ERROR = :PROCESSING_ERROR + RECURRING_TRANSACTION_NOT_CANCELLED = :RECURRING_TRANSACTION_NOT_CANCELLED + REFUND_NOT_PROCESSED = :REFUND_NOT_PROCESSED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/dispute_delete_evidence_params.rb b/lib/lithic/models/dispute_delete_evidence_params.rb new file mode 100644 index 00000000..27d813bd --- /dev/null +++ b/lib/lithic/models/dispute_delete_evidence_params.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Disputes#delete_evidence + class DisputeDeleteEvidenceParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute dispute_token + # + # @return [String] + required :dispute_token, String + + # @!attribute evidence_token + # + # @return [String] + required :evidence_token, String + + # @!method initialize(dispute_token:, evidence_token:, request_options: {}) + # @param dispute_token [String] + # @param evidence_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/dispute_delete_params.rb b/lib/lithic/models/dispute_delete_params.rb new file mode 100644 index 00000000..5ec3dcbb --- /dev/null +++ b/lib/lithic/models/dispute_delete_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Disputes#delete + class DisputeDeleteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute dispute_token + # + # @return [String] + required :dispute_token, String + + # @!method initialize(dispute_token:, request_options: {}) + # @param dispute_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/dispute_evidence.rb b/lib/lithic/models/dispute_evidence.rb new file mode 100644 index 00000000..37fbec57 --- /dev/null +++ b/lib/lithic/models/dispute_evidence.rb @@ -0,0 +1,99 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Disputes#delete_evidence + class DisputeEvidence < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier. + # + # @return [String] + required :token, String + + # @!attribute created + # Timestamp of when dispute evidence was created. + # + # @return [Time] + required :created, Time + + # @!attribute dispute_token + # Dispute token evidence is attached to. + # + # @return [String] + required :dispute_token, String + + # @!attribute upload_status + # Upload status types: + # + # - `DELETED` - Evidence was deleted. + # - `ERROR` - Evidence upload failed. + # - `PENDING` - Evidence is pending upload. + # - `REJECTED` - Evidence was rejected. + # - `UPLOADED` - Evidence was uploaded. + # + # @return [Symbol, Lithic::Models::DisputeEvidence::UploadStatus] + required :upload_status, enum: -> { Lithic::DisputeEvidence::UploadStatus } + + # @!attribute download_url + # URL to download evidence. Only shown when `upload_status` is `UPLOADED`. + # + # @return [String, nil] + optional :download_url, String + + # @!attribute filename + # File name of evidence. Recommended to give the dispute evidence a human-readable + # identifier. + # + # @return [String, nil] + optional :filename, String + + # @!attribute upload_url + # URL to upload evidence. Only shown when `upload_status` is `PENDING`. + # + # @return [String, nil] + optional :upload_url, String + + # @!method initialize(token:, created:, dispute_token:, upload_status:, download_url: nil, filename: nil, upload_url: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::DisputeEvidence} for more details. + # + # Dispute evidence. + # + # @param token [String] Globally unique identifier. + # + # @param created [Time] Timestamp of when dispute evidence was created. + # + # @param dispute_token [String] Dispute token evidence is attached to. + # + # @param upload_status [Symbol, Lithic::Models::DisputeEvidence::UploadStatus] Upload status types: + # + # @param download_url [String] URL to download evidence. Only shown when `upload_status` is `UPLOADED`. + # + # @param filename [String] File name of evidence. Recommended to give the dispute evidence a human-readable + # + # @param upload_url [String] URL to upload evidence. Only shown when `upload_status` is `PENDING`. + + # Upload status types: + # + # - `DELETED` - Evidence was deleted. + # - `ERROR` - Evidence upload failed. + # - `PENDING` - Evidence is pending upload. + # - `REJECTED` - Evidence was rejected. + # - `UPLOADED` - Evidence was uploaded. + # + # @see Lithic::Models::DisputeEvidence#upload_status + module UploadStatus + extend Lithic::Internal::Type::Enum + + DELETED = :DELETED + ERROR = :ERROR + PENDING = :PENDING + REJECTED = :REJECTED + UPLOADED = :UPLOADED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/dispute_evidence_upload_failed_webhook_event.rb b/lib/lithic/models/dispute_evidence_upload_failed_webhook_event.rb new file mode 100644 index 00000000..bf9f5ec4 --- /dev/null +++ b/lib/lithic/models/dispute_evidence_upload_failed_webhook_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DisputeEvidenceUploadFailedWebhookEvent < Lithic::Models::DisputeEvidence + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"dispute_evidence.upload_failed"] + required :event_type, const: :"dispute_evidence.upload_failed" + + # @!method initialize(event_type: :"dispute_evidence.upload_failed") + # Dispute evidence. + # + # @param event_type [Symbol, :"dispute_evidence.upload_failed"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/dispute_initiate_evidence_upload_params.rb b/lib/lithic/models/dispute_initiate_evidence_upload_params.rb new file mode 100644 index 00000000..e2bcfd9e --- /dev/null +++ b/lib/lithic/models/dispute_initiate_evidence_upload_params.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Disputes#initiate_evidence_upload + class DisputeInitiateEvidenceUploadParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute dispute_token + # + # @return [String] + required :dispute_token, String + + # @!attribute filename + # Filename of the evidence. + # + # @return [String, nil] + optional :filename, String + + # @!method initialize(dispute_token:, filename: nil, request_options: {}) + # @param dispute_token [String] + # + # @param filename [String] Filename of the evidence. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/dispute_list_evidences_params.rb b/lib/lithic/models/dispute_list_evidences_params.rb new file mode 100644 index 00000000..f94a3257 --- /dev/null +++ b/lib/lithic/models/dispute_list_evidences_params.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Disputes#list_evidences + class DisputeListEvidencesParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute dispute_token + # + # @return [String] + required :dispute_token, String + + # @!attribute begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time + + # @!attribute end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!method initialize(dispute_token:, begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::DisputeListEvidencesParams} for more details. + # + # @param dispute_token [String] + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/dispute_list_params.rb b/lib/lithic/models/dispute_list_params.rb new file mode 100644 index 00000000..57b4403a --- /dev/null +++ b/lib/lithic/models/dispute_list_params.rb @@ -0,0 +1,94 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Disputes#list + class DisputeListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time + + # @!attribute end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!attribute status + # Filter by status. + # + # @return [Symbol, Lithic::Models::DisputeListParams::Status, nil] + optional :status, enum: -> { Lithic::DisputeListParams::Status } + + # @!attribute transaction_tokens + # Transaction tokens to filter by. + # + # @return [Array, nil] + optional :transaction_tokens, Lithic::Internal::Type::ArrayOf[String] + + # @!method initialize(begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, status: nil, transaction_tokens: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::DisputeListParams} for more details. + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param status [Symbol, Lithic::Models::DisputeListParams::Status] Filter by status. + # + # @param transaction_tokens [Array] Transaction tokens to filter by. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Filter by status. + module Status + extend Lithic::Internal::Type::Enum + + ARBITRATION = :ARBITRATION + CASE_CLOSED = :CASE_CLOSED + CASE_WON = :CASE_WON + NEW = :NEW + PENDING_CUSTOMER = :PENDING_CUSTOMER + PREARBITRATION = :PREARBITRATION + REPRESENTMENT = :REPRESENTMENT + SUBMITTED = :SUBMITTED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/dispute_retrieve_evidence_params.rb b/lib/lithic/models/dispute_retrieve_evidence_params.rb new file mode 100644 index 00000000..df8a3ddb --- /dev/null +++ b/lib/lithic/models/dispute_retrieve_evidence_params.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Disputes#retrieve_evidence + class DisputeRetrieveEvidenceParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute dispute_token + # + # @return [String] + required :dispute_token, String + + # @!attribute evidence_token + # + # @return [String] + required :evidence_token, String + + # @!method initialize(dispute_token:, evidence_token:, request_options: {}) + # @param dispute_token [String] + # @param evidence_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/dispute_retrieve_params.rb b/lib/lithic/models/dispute_retrieve_params.rb new file mode 100644 index 00000000..c48de5df --- /dev/null +++ b/lib/lithic/models/dispute_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Disputes#retrieve + class DisputeRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute dispute_token + # + # @return [String] + required :dispute_token, String + + # @!method initialize(dispute_token:, request_options: {}) + # @param dispute_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/dispute_transaction_created_webhook_event.rb b/lib/lithic/models/dispute_transaction_created_webhook_event.rb new file mode 100644 index 00000000..b04fdb6b --- /dev/null +++ b/lib/lithic/models/dispute_transaction_created_webhook_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DisputeTransactionCreatedWebhookEvent < Lithic::Models::DisputeV2 + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"dispute_transaction.created"] + required :event_type, const: :"dispute_transaction.created" + + # @!method initialize(event_type: :"dispute_transaction.created") + # The Dispute object tracks the progression of a dispute throughout its lifecycle. + # + # @param event_type [Symbol, :"dispute_transaction.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/dispute_transaction_updated_webhook_event.rb b/lib/lithic/models/dispute_transaction_updated_webhook_event.rb new file mode 100644 index 00000000..d08ddb0d --- /dev/null +++ b/lib/lithic/models/dispute_transaction_updated_webhook_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DisputeTransactionUpdatedWebhookEvent < Lithic::Models::DisputeV2 + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"dispute_transaction.updated"] + required :event_type, const: :"dispute_transaction.updated" + + # @!method initialize(event_type: :"dispute_transaction.updated") + # The Dispute object tracks the progression of a dispute throughout its lifecycle. + # + # @param event_type [Symbol, :"dispute_transaction.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/dispute_update_params.rb b/lib/lithic/models/dispute_update_params.rb new file mode 100644 index 00000000..7912db42 --- /dev/null +++ b/lib/lithic/models/dispute_update_params.rb @@ -0,0 +1,76 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Disputes#update + class DisputeUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute dispute_token + # + # @return [String] + required :dispute_token, String + + # @!attribute amount + # Amount for chargeback + # + # @return [Integer, nil] + optional :amount, Integer + + # @!attribute customer_filed_date + # Date the customer filed the chargeback request + # + # @return [Time, nil] + optional :customer_filed_date, Time + + # @!attribute customer_note + # Customer description + # + # @return [String, nil] + optional :customer_note, String + + # @!attribute reason + # Reason for chargeback + # + # @return [Symbol, Lithic::Models::DisputeUpdateParams::Reason, nil] + optional :reason, enum: -> { Lithic::DisputeUpdateParams::Reason } + + # @!method initialize(dispute_token:, amount: nil, customer_filed_date: nil, customer_note: nil, reason: nil, request_options: {}) + # @param dispute_token [String] + # + # @param amount [Integer] Amount for chargeback + # + # @param customer_filed_date [Time] Date the customer filed the chargeback request + # + # @param customer_note [String] Customer description + # + # @param reason [Symbol, Lithic::Models::DisputeUpdateParams::Reason] Reason for chargeback + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Reason for chargeback + module Reason + extend Lithic::Internal::Type::Enum + + ATM_CASH_MISDISPENSE = :ATM_CASH_MISDISPENSE + CANCELLED = :CANCELLED + DUPLICATED = :DUPLICATED + FRAUD_CARD_NOT_PRESENT = :FRAUD_CARD_NOT_PRESENT + FRAUD_CARD_PRESENT = :FRAUD_CARD_PRESENT + FRAUD_OTHER = :FRAUD_OTHER + GOODS_SERVICES_NOT_AS_DESCRIBED = :GOODS_SERVICES_NOT_AS_DESCRIBED + GOODS_SERVICES_NOT_RECEIVED = :GOODS_SERVICES_NOT_RECEIVED + INCORRECT_AMOUNT = :INCORRECT_AMOUNT + MISSING_AUTH = :MISSING_AUTH + OTHER = :OTHER + PROCESSING_ERROR = :PROCESSING_ERROR + RECURRING_TRANSACTION_NOT_CANCELLED = :RECURRING_TRANSACTION_NOT_CANCELLED + REFUND_NOT_PROCESSED = :REFUND_NOT_PROCESSED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/dispute_updated_webhook_event.rb b/lib/lithic/models/dispute_updated_webhook_event.rb new file mode 100644 index 00000000..68d7a869 --- /dev/null +++ b/lib/lithic/models/dispute_updated_webhook_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class DisputeUpdatedWebhookEvent < Lithic::Models::Dispute + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"dispute.updated"] + required :event_type, const: :"dispute.updated" + + # @!method initialize(event_type: :"dispute.updated") + # Dispute. + # + # @param event_type [Symbol, :"dispute.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/dispute_v2.rb b/lib/lithic/models/dispute_v2.rb new file mode 100644 index 00000000..33775e17 --- /dev/null +++ b/lib/lithic/models/dispute_v2.rb @@ -0,0 +1,555 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::DisputesV2#retrieve + class DisputeV2 < Lithic::Internal::Type::BaseModel + # @!attribute token + # Token assigned by Lithic for the dispute, in UUID format. + # + # @return [String] + required :token, String + + # @!attribute account_token + # Token for the account associated with the dispute, in UUID format. + # + # @return [String] + required :account_token, String + + # @!attribute card_token + # Token for the card used in the dispute, in UUID format. + # + # @return [String] + required :card_token, String + + # @!attribute case_id + # Identifier assigned by the network for this dispute. + # + # @return [String, nil] + required :case_id, String, nil?: true + + # @!attribute created + # When the dispute was created. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # Three-letter ISO 4217 currency code. + # + # @return [String] + required :currency, String + + # @!attribute disposition + # Dispute resolution outcome + # + # @return [Symbol, Lithic::Models::DisputeV2::Disposition, nil] + required :disposition, enum: -> { Lithic::DisputeV2::Disposition }, nil?: true + + # @!attribute events + # Chronological list of events that have occurred in the dispute lifecycle + # + # @return [Array] + required :events, -> { Lithic::Internal::Type::ArrayOf[Lithic::DisputeV2::Event] } + + # @!attribute liability_allocation + # Current breakdown of how liability is allocated for the disputed amount + # + # @return [Lithic::Models::DisputeV2::LiabilityAllocation] + required :liability_allocation, -> { Lithic::DisputeV2::LiabilityAllocation } + + # @!attribute merchant + # + # @return [Lithic::Models::Merchant] + required :merchant, -> { Lithic::Merchant } + + # @!attribute network + # Card network handling the dispute. + # + # @return [Symbol, Lithic::Models::DisputeV2::Network] + required :network, enum: -> { Lithic::DisputeV2::Network } + + # @!attribute status + # Current status of the dispute. + # + # @return [Symbol, Lithic::Models::DisputeV2::Status, nil] + required :status, enum: -> { Lithic::DisputeV2::Status }, nil?: true + + # @!attribute transaction_series + # Contains identifiers for the transaction and specific event within being + # disputed; null if no transaction can be identified + # + # @return [Lithic::Models::DisputeV2::TransactionSeries, nil] + required :transaction_series, -> { Lithic::DisputeV2::TransactionSeries }, nil?: true + + # @!attribute updated + # When the dispute was last updated. + # + # @return [Time] + required :updated, Time + + # @!method initialize(token:, account_token:, card_token:, case_id:, created:, currency:, disposition:, events:, liability_allocation:, merchant:, network:, status:, transaction_series:, updated:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::DisputeV2} for more details. + # + # The Dispute object tracks the progression of a dispute throughout its lifecycle. + # + # @param token [String] Token assigned by Lithic for the dispute, in UUID format. + # + # @param account_token [String] Token for the account associated with the dispute, in UUID format. + # + # @param card_token [String] Token for the card used in the dispute, in UUID format. + # + # @param case_id [String, nil] Identifier assigned by the network for this dispute. + # + # @param created [Time] When the dispute was created. + # + # @param currency [String] Three-letter ISO 4217 currency code. + # + # @param disposition [Symbol, Lithic::Models::DisputeV2::Disposition, nil] Dispute resolution outcome + # + # @param events [Array] Chronological list of events that have occurred in the dispute lifecycle + # + # @param liability_allocation [Lithic::Models::DisputeV2::LiabilityAllocation] Current breakdown of how liability is allocated for the disputed amount + # + # @param merchant [Lithic::Models::Merchant] + # + # @param network [Symbol, Lithic::Models::DisputeV2::Network] Card network handling the dispute. + # + # @param status [Symbol, Lithic::Models::DisputeV2::Status, nil] Current status of the dispute. + # + # @param transaction_series [Lithic::Models::DisputeV2::TransactionSeries, nil] Contains identifiers for the transaction and specific event within being dispute + # + # @param updated [Time] When the dispute was last updated. + + # Dispute resolution outcome + # + # @see Lithic::Models::DisputeV2#disposition + module Disposition + extend Lithic::Internal::Type::Enum + + WON = :WON + LOST = :LOST + PARTIALLY_WON = :PARTIALLY_WON + WITHDRAWN = :WITHDRAWN + DENIED = :DENIED + + # @!method self.values + # @return [Array] + end + + class Event < Lithic::Internal::Type::BaseModel + # @!attribute token + # Unique identifier for the event, in UUID format + # + # @return [String] + required :token, String + + # @!attribute created + # When the event occurred + # + # @return [Time] + required :created, Time + + # @!attribute data + # Details specific to the event type + # + # @return [Lithic::Models::DisputeV2::Event::Data::Workflow, Lithic::Models::DisputeV2::Event::Data::Financial, Lithic::Models::DisputeV2::Event::Data::CardholderLiability] + required :data, union: -> { Lithic::DisputeV2::Event::Data } + + # @!attribute type + # Type of event + # + # @return [Symbol, Lithic::Models::DisputeV2::Event::Type] + required :type, enum: -> { Lithic::DisputeV2::Event::Type } + + # @!method initialize(token:, created:, data:, type:) + # Event that occurred in the dispute lifecycle + # + # @param token [String] Unique identifier for the event, in UUID format + # + # @param created [Time] When the event occurred + # + # @param data [Lithic::Models::DisputeV2::Event::Data::Workflow, Lithic::Models::DisputeV2::Event::Data::Financial, Lithic::Models::DisputeV2::Event::Data::CardholderLiability] Details specific to the event type + # + # @param type [Symbol, Lithic::Models::DisputeV2::Event::Type] Type of event + + # Details specific to the event type + # + # @see Lithic::Models::DisputeV2::Event#data + module Data + extend Lithic::Internal::Type::Union + + discriminator :type + + # Details specific to workflow events + variant :WORKFLOW, -> { Lithic::DisputeV2::Event::Data::Workflow } + + # Details specific to financial events + variant :FINANCIAL, -> { Lithic::DisputeV2::Event::Data::Financial } + + # Details specific to cardholder liability events + variant :CARDHOLDER_LIABILITY, -> { Lithic::DisputeV2::Event::Data::CardholderLiability } + + class Workflow < Lithic::Internal::Type::BaseModel + # @!attribute action + # Action taken in this stage + # + # @return [Symbol, Lithic::Models::DisputeV2::Event::Data::Workflow::Action] + required :action, enum: -> { Lithic::DisputeV2::Event::Data::Workflow::Action } + + # @!attribute amount + # Amount in minor units + # + # @return [Integer, nil] + required :amount, Integer, nil?: true + + # @!attribute disposition + # Dispute resolution outcome + # + # @return [Symbol, Lithic::Models::DisputeV2::Event::Data::Workflow::Disposition, nil] + required :disposition, + enum: -> { + Lithic::DisputeV2::Event::Data::Workflow::Disposition + }, + nil?: true + + # @!attribute reason + # Reason for the action + # + # @return [String, nil] + required :reason, String, nil?: true + + # @!attribute stage + # Current stage of the dispute workflow + # + # @return [Symbol, Lithic::Models::DisputeV2::Event::Data::Workflow::Stage] + required :stage, enum: -> { Lithic::DisputeV2::Event::Data::Workflow::Stage } + + # @!attribute type + # Event type discriminator + # + # @return [Symbol, :WORKFLOW] + required :type, const: :WORKFLOW + + # @!method initialize(action:, amount:, disposition:, reason:, stage:, type: :WORKFLOW) + # Details specific to workflow events + # + # @param action [Symbol, Lithic::Models::DisputeV2::Event::Data::Workflow::Action] Action taken in this stage + # + # @param amount [Integer, nil] Amount in minor units + # + # @param disposition [Symbol, Lithic::Models::DisputeV2::Event::Data::Workflow::Disposition, nil] Dispute resolution outcome + # + # @param reason [String, nil] Reason for the action + # + # @param stage [Symbol, Lithic::Models::DisputeV2::Event::Data::Workflow::Stage] Current stage of the dispute workflow + # + # @param type [Symbol, :WORKFLOW] Event type discriminator + + # Action taken in this stage + # + # @see Lithic::Models::DisputeV2::Event::Data::Workflow#action + module Action + extend Lithic::Internal::Type::Enum + + OPENED = :OPENED + CLOSED = :CLOSED + REOPENED = :REOPENED + + # @!method self.values + # @return [Array] + end + + # Dispute resolution outcome + # + # @see Lithic::Models::DisputeV2::Event::Data::Workflow#disposition + module Disposition + extend Lithic::Internal::Type::Enum + + WON = :WON + LOST = :LOST + PARTIALLY_WON = :PARTIALLY_WON + WITHDRAWN = :WITHDRAWN + DENIED = :DENIED + + # @!method self.values + # @return [Array] + end + + # Current stage of the dispute workflow + # + # @see Lithic::Models::DisputeV2::Event::Data::Workflow#stage + module Stage + extend Lithic::Internal::Type::Enum + + CLAIM = :CLAIM + + # @!method self.values + # @return [Array] + end + end + + class Financial < Lithic::Internal::Type::BaseModel + # @!attribute amount + # Amount in minor units + # + # @return [Integer] + required :amount, Integer + + # @!attribute polarity + # Direction of funds flow + # + # @return [Symbol, Lithic::Models::DisputeV2::Event::Data::Financial::Polarity] + required :polarity, enum: -> { Lithic::DisputeV2::Event::Data::Financial::Polarity } + + # @!attribute stage + # Stage at which the financial event occurred + # + # @return [Symbol, Lithic::Models::DisputeV2::Event::Data::Financial::Stage] + required :stage, enum: -> { Lithic::DisputeV2::Event::Data::Financial::Stage } + + # @!attribute type + # Event type discriminator + # + # @return [Symbol, :FINANCIAL] + required :type, const: :FINANCIAL + + # @!method initialize(amount:, polarity:, stage:, type: :FINANCIAL) + # Details specific to financial events + # + # @param amount [Integer] Amount in minor units + # + # @param polarity [Symbol, Lithic::Models::DisputeV2::Event::Data::Financial::Polarity] Direction of funds flow + # + # @param stage [Symbol, Lithic::Models::DisputeV2::Event::Data::Financial::Stage] Stage at which the financial event occurred + # + # @param type [Symbol, :FINANCIAL] Event type discriminator + + # Direction of funds flow + # + # @see Lithic::Models::DisputeV2::Event::Data::Financial#polarity + module Polarity + extend Lithic::Internal::Type::Enum + + CREDIT = :CREDIT + DEBIT = :DEBIT + + # @!method self.values + # @return [Array] + end + + # Stage at which the financial event occurred + # + # @see Lithic::Models::DisputeV2::Event::Data::Financial#stage + module Stage + extend Lithic::Internal::Type::Enum + + CHARGEBACK = :CHARGEBACK + REPRESENTMENT = :REPRESENTMENT + PREARBITRATION = :PREARBITRATION + ARBITRATION = :ARBITRATION + COLLABORATION = :COLLABORATION + + # @!method self.values + # @return [Array] + end + end + + class CardholderLiability < Lithic::Internal::Type::BaseModel + # @!attribute action + # Action taken regarding cardholder liability + # + # @return [Symbol, Lithic::Models::DisputeV2::Event::Data::CardholderLiability::Action] + required :action, enum: -> { Lithic::DisputeV2::Event::Data::CardholderLiability::Action } + + # @!attribute amount + # Amount in minor units + # + # @return [Integer] + required :amount, Integer + + # @!attribute reason + # Reason for the action + # + # @return [String] + required :reason, String + + # @!attribute type + # Event type discriminator + # + # @return [Symbol, :CARDHOLDER_LIABILITY] + required :type, const: :CARDHOLDER_LIABILITY + + # @!method initialize(action:, amount:, reason:, type: :CARDHOLDER_LIABILITY) + # Details specific to cardholder liability events + # + # @param action [Symbol, Lithic::Models::DisputeV2::Event::Data::CardholderLiability::Action] Action taken regarding cardholder liability + # + # @param amount [Integer] Amount in minor units + # + # @param reason [String] Reason for the action + # + # @param type [Symbol, :CARDHOLDER_LIABILITY] Event type discriminator + + # Action taken regarding cardholder liability + # + # @see Lithic::Models::DisputeV2::Event::Data::CardholderLiability#action + module Action + extend Lithic::Internal::Type::Enum + + PROVISIONAL_CREDIT_GRANTED = :PROVISIONAL_CREDIT_GRANTED + PROVISIONAL_CREDIT_REVERSED = :PROVISIONAL_CREDIT_REVERSED + WRITTEN_OFF = :WRITTEN_OFF + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(Lithic::Models::DisputeV2::Event::Data::Workflow, Lithic::Models::DisputeV2::Event::Data::Financial, Lithic::Models::DisputeV2::Event::Data::CardholderLiability)] + end + + # Type of event + # + # @see Lithic::Models::DisputeV2::Event#type + module Type + extend Lithic::Internal::Type::Enum + + WORKFLOW = :WORKFLOW + FINANCIAL = :FINANCIAL + CARDHOLDER_LIABILITY = :CARDHOLDER_LIABILITY + + # @!method self.values + # @return [Array] + end + end + + # @see Lithic::Models::DisputeV2#liability_allocation + class LiabilityAllocation < Lithic::Internal::Type::BaseModel + # @!attribute denied_amount + # The amount that has been denied to the cardholder + # + # @return [Integer] + required :denied_amount, Integer + + # @!attribute original_amount + # The initial amount disputed + # + # @return [Integer] + required :original_amount, Integer + + # @!attribute recovered_amount + # The amount that has been recovered from the merchant through the dispute process + # + # @return [Integer] + required :recovered_amount, Integer + + # @!attribute remaining_amount + # Any disputed amount that is still outstanding, i.e. has not been recovered, + # written off, or denied + # + # @return [Integer] + required :remaining_amount, Integer + + # @!attribute written_off_amount + # The amount the issuer has chosen to write off + # + # @return [Integer] + required :written_off_amount, Integer + + # @!method initialize(denied_amount:, original_amount:, recovered_amount:, remaining_amount:, written_off_amount:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::DisputeV2::LiabilityAllocation} for more details. + # + # Current breakdown of how liability is allocated for the disputed amount + # + # @param denied_amount [Integer] The amount that has been denied to the cardholder + # + # @param original_amount [Integer] The initial amount disputed + # + # @param recovered_amount [Integer] The amount that has been recovered from the merchant through the dispute process + # + # @param remaining_amount [Integer] Any disputed amount that is still outstanding, i.e. has not been recovered, writ + # + # @param written_off_amount [Integer] The amount the issuer has chosen to write off + end + + # Card network handling the dispute. + # + # @see Lithic::Models::DisputeV2#network + module Network + extend Lithic::Internal::Type::Enum + + VISA = :VISA + MASTERCARD = :MASTERCARD + + # @!method self.values + # @return [Array] + end + + # Current status of the dispute. + # + # @see Lithic::Models::DisputeV2#status + module Status + extend Lithic::Internal::Type::Enum + + OPEN = :OPEN + CLOSED = :CLOSED + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::DisputeV2#transaction_series + class TransactionSeries < Lithic::Internal::Type::BaseModel + # @!attribute related_transaction_event_token + # Token of the specific event in the original transaction being disputed, in UUID + # format; null if no event can be identified + # + # @return [String, nil] + required :related_transaction_event_token, String, nil?: true + + # @!attribute related_transaction_token + # Token of the original transaction being disputed, in UUID format + # + # @return [String] + required :related_transaction_token, String + + # @!attribute type + # The type of transaction series associating the dispute and the original + # transaction. Always set to DISPUTE + # + # @return [Symbol, Lithic::Models::DisputeV2::TransactionSeries::Type] + required :type, enum: -> { Lithic::DisputeV2::TransactionSeries::Type } + + # @!method initialize(related_transaction_event_token:, related_transaction_token:, type:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::DisputeV2::TransactionSeries} for more details. + # + # Contains identifiers for the transaction and specific event within being + # disputed; null if no transaction can be identified + # + # @param related_transaction_event_token [String, nil] Token of the specific event in the original transaction being disputed, in UUID + # + # @param related_transaction_token [String] Token of the original transaction being disputed, in UUID format + # + # @param type [Symbol, Lithic::Models::DisputeV2::TransactionSeries::Type] The type of transaction series associating the dispute and the original transact + + # The type of transaction series associating the dispute and the original + # transaction. Always set to DISPUTE + # + # @see Lithic::Models::DisputeV2::TransactionSeries#type + module Type + extend Lithic::Internal::Type::Enum + + DISPUTE = :DISPUTE + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/disputes_v2_list_params.rb b/lib/lithic/models/disputes_v2_list_params.rb new file mode 100644 index 00000000..04be824a --- /dev/null +++ b/lib/lithic/models/disputes_v2_list_params.rb @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::DisputesV2#list + class DisputesV2ListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute account_token + # Filter by account token. + # + # @return [String, nil] + optional :account_token, String + + # @!attribute begin_ + # RFC 3339 timestamp for filtering by created date, inclusive. + # + # @return [Time, nil] + optional :begin_, Time + + # @!attribute card_token + # Filter by card token. + # + # @return [String, nil] + optional :card_token, String + + # @!attribute disputed_transaction_token + # Filter by the token of the transaction being disputed. Corresponds with + # transaction_series.related_transaction_token in the Dispute. + # + # @return [String, nil] + optional :disputed_transaction_token, String + + # @!attribute end_ + # RFC 3339 timestamp for filtering by created date, inclusive. + # + # @return [Time, nil] + optional :end_, Time + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute page_size + # Number of items to return. + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!method initialize(account_token: nil, begin_: nil, card_token: nil, disputed_transaction_token: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::DisputesV2ListParams} for more details. + # + # @param account_token [String] Filter by account token. + # + # @param begin_ [Time] RFC 3339 timestamp for filtering by created date, inclusive. + # + # @param card_token [String] Filter by card token. + # + # @param disputed_transaction_token [String] Filter by the token of the transaction being disputed. Corresponds with transact + # + # @param end_ [Time] RFC 3339 timestamp for filtering by created date, inclusive. + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Number of items to return. + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/disputes_v2_retrieve_params.rb b/lib/lithic/models/disputes_v2_retrieve_params.rb new file mode 100644 index 00000000..36d2940c --- /dev/null +++ b/lib/lithic/models/disputes_v2_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::DisputesV2#retrieve + class DisputesV2RetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute dispute_token + # + # @return [String] + required :dispute_token, String + + # @!method initialize(dispute_token:, request_options: {}) + # @param dispute_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/document.rb b/lib/lithic/models/document.rb new file mode 100644 index 00000000..f8a8bf48 --- /dev/null +++ b/lib/lithic/models/document.rb @@ -0,0 +1,218 @@ +# frozen_string_literal: true + +module Lithic + module Models + class Document < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for the document. + # + # @return [String] + required :token, String + + # @!attribute account_holder_token + # Globally unique identifier for the account holder. + # + # @return [String] + required :account_holder_token, String + + # @!attribute document_type + # Type of documentation to be submitted for verification of an account holder + # + # @return [Symbol, Lithic::Models::Document::DocumentType] + required :document_type, enum: -> { Lithic::Document::DocumentType } + + # @!attribute entity_token + # Globally unique identifier for an entity. + # + # @return [String] + required :entity_token, String + + # @!attribute required_document_uploads + # Represents a single image of the document to upload. + # + # @return [Array] + required :required_document_uploads, + -> { Lithic::Internal::Type::ArrayOf[Lithic::Document::RequiredDocumentUpload] } + + # @!method initialize(token:, account_holder_token:, document_type:, entity_token:, required_document_uploads:) + # Describes the document and the required document image uploads required to + # re-run KYC + # + # @param token [String] Globally unique identifier for the document. + # + # @param account_holder_token [String] Globally unique identifier for the account holder. + # + # @param document_type [Symbol, Lithic::Models::Document::DocumentType] Type of documentation to be submitted for verification of an account holder + # + # @param entity_token [String] Globally unique identifier for an entity. + # + # @param required_document_uploads [Array] Represents a single image of the document to upload. + + # Type of documentation to be submitted for verification of an account holder + # + # @see Lithic::Models::Document#document_type + module DocumentType + extend Lithic::Internal::Type::Enum + + DRIVERS_LICENSE = :DRIVERS_LICENSE + PASSPORT = :PASSPORT + PASSPORT_CARD = :PASSPORT_CARD + EIN_LETTER = :EIN_LETTER + TAX_RETURN = :TAX_RETURN + OPERATING_AGREEMENT = :OPERATING_AGREEMENT + CERTIFICATE_OF_FORMATION = :CERTIFICATE_OF_FORMATION + CERTIFICATE_OF_GOOD_STANDING = :CERTIFICATE_OF_GOOD_STANDING + ARTICLES_OF_INCORPORATION = :ARTICLES_OF_INCORPORATION + ARTICLES_OF_ORGANIZATION = :ARTICLES_OF_ORGANIZATION + BYLAWS = :BYLAWS + GOVERNMENT_BUSINESS_LICENSE = :GOVERNMENT_BUSINESS_LICENSE + PARTNERSHIP_AGREEMENT = :PARTNERSHIP_AGREEMENT + SS4_FORM = :SS4_FORM + BANK_STATEMENT = :BANK_STATEMENT + UTILITY_BILL_STATEMENT = :UTILITY_BILL_STATEMENT + SSN_CARD = :SSN_CARD + ITIN_LETTER = :ITIN_LETTER + FINCEN_BOI_REPORT = :FINCEN_BOI_REPORT + + # @!method self.values + # @return [Array] + end + + class RequiredDocumentUpload < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for the document upload. + # + # @return [String] + required :token, String + + # @!attribute accepted_entity_status_reasons + # A list of status reasons associated with a KYB account holder that have been + # satisfied by the document upload + # + # @return [Array] + required :accepted_entity_status_reasons, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute created + # When the document upload was created + # + # @return [Time] + required :created, Time + + # @!attribute image_type + # Type of image to upload. + # + # @return [Symbol, Lithic::Models::Document::RequiredDocumentUpload::ImageType] + required :image_type, enum: -> { Lithic::Document::RequiredDocumentUpload::ImageType } + + # @!attribute rejected_entity_status_reasons + # A list of status reasons associated with a KYB account holder that have not been + # satisfied by the document upload + # + # @return [Array] + required :rejected_entity_status_reasons, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute status + # Status of an account holder's document upload. + # + # @return [Symbol, Lithic::Models::Document::RequiredDocumentUpload::Status] + required :status, enum: -> { Lithic::Document::RequiredDocumentUpload::Status } + + # @!attribute status_reasons + # Reasons for document image upload status. + # + # @return [Array] + required :status_reasons, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::Document::RequiredDocumentUpload::StatusReason] } + + # @!attribute updated + # When the document upload was last updated + # + # @return [Time] + required :updated, Time + + # @!attribute upload_url + # URL to upload document image to. + # + # Note that the upload URLs expire after 7 days. If an upload URL expires, you can + # refresh the URLs by retrieving the document upload from + # `GET /account_holders/{account_holder_token}/documents`. + # + # @return [String] + required :upload_url, String + + # @!method initialize(token:, accepted_entity_status_reasons:, created:, image_type:, rejected_entity_status_reasons:, status:, status_reasons:, updated:, upload_url:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Document::RequiredDocumentUpload} for more details. + # + # Represents a single image of the document to upload. + # + # @param token [String] Globally unique identifier for the document upload. + # + # @param accepted_entity_status_reasons [Array] A list of status reasons associated with a KYB account holder that have been sat + # + # @param created [Time] When the document upload was created + # + # @param image_type [Symbol, Lithic::Models::Document::RequiredDocumentUpload::ImageType] Type of image to upload. + # + # @param rejected_entity_status_reasons [Array] A list of status reasons associated with a KYB account holder that have not been + # + # @param status [Symbol, Lithic::Models::Document::RequiredDocumentUpload::Status] Status of an account holder's document upload. + # + # @param status_reasons [Array] Reasons for document image upload status. + # + # @param updated [Time] When the document upload was last updated + # + # @param upload_url [String] URL to upload document image to. + + # Type of image to upload. + # + # @see Lithic::Models::Document::RequiredDocumentUpload#image_type + module ImageType + extend Lithic::Internal::Type::Enum + + FRONT = :FRONT + BACK = :BACK + + # @!method self.values + # @return [Array] + end + + # Status of an account holder's document upload. + # + # @see Lithic::Models::Document::RequiredDocumentUpload#status + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED = :ACCEPTED + REJECTED = :REJECTED + PENDING_UPLOAD = :PENDING_UPLOAD + UPLOADED = :UPLOADED + PARTIAL_APPROVAL = :PARTIAL_APPROVAL + + # @!method self.values + # @return [Array] + end + + # The status reasons for an account holder document upload that is not ACCEPTED + module StatusReason + extend Lithic::Internal::Type::Enum + + DOCUMENT_MISSING_REQUIRED_DATA = :DOCUMENT_MISSING_REQUIRED_DATA + DOCUMENT_UPLOAD_TOO_BLURRY = :DOCUMENT_UPLOAD_TOO_BLURRY + FILE_SIZE_TOO_LARGE = :FILE_SIZE_TOO_LARGE + INVALID_DOCUMENT_TYPE = :INVALID_DOCUMENT_TYPE + INVALID_DOCUMENT_UPLOAD = :INVALID_DOCUMENT_UPLOAD + INVALID_ENTITY = :INVALID_ENTITY + DOCUMENT_EXPIRED = :DOCUMENT_EXPIRED + DOCUMENT_ISSUED_GREATER_THAN_30_DAYS = :DOCUMENT_ISSUED_GREATER_THAN_30_DAYS + DOCUMENT_TYPE_NOT_SUPPORTED = :DOCUMENT_TYPE_NOT_SUPPORTED + UNKNOWN_FAILURE_REASON = :UNKNOWN_FAILURE_REASON + UNKNOWN_ERROR = :UNKNOWN_ERROR + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/event.rb b/lib/lithic/models/event.rb new file mode 100644 index 00000000..81f4fe74 --- /dev/null +++ b/lib/lithic/models/event.rb @@ -0,0 +1,320 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Events#retrieve + class Event < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier. + # + # @return [String] + required :token, String + + # @!attribute created + # An RFC 3339 timestamp for when the event was created. UTC time zone. + # + # If no timezone is specified, UTC will be used. + # + # @return [Time] + required :created, Time + + # @!attribute event_type + # The type of event that occurred. Possible values: + # + # - account_holder_document.updated: Occurs when an account holder's document + # upload status has been updated + # - account_holder.created: Occurs when a new account_holder is created. + # - account_holder.updated: Occurs when an account_holder is updated. + # - account_holder.verification: Occurs when an asynchronous account_holder's + # verification is completed. + # - auth_rules.backtest_report.created: Auth Rules backtest report created. + # - balance.updated: Financial Account Balance Update + # - book_transfer_transaction.created: Occurs when a book transfer transaction is + # created. + # - book_transfer_transaction.updated: Occurs when a book transfer transaction is + # updated. + # - card_authorization.challenge: Occurs when an Out of Band challenge is issued + # during card authorization. The card program should issue its own challenge to + # the cardholder and then respond via + # [/v1/card_authorizations/{event_token}/challenge_response](https://docs.lithic.com/reference/respondtoauthorizationchallenge). + # - card_authorization.challenge_response: Occurs when a cardholder responds to a + # challenge during card authorization. + # - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial + # data is processed for a transaction event. + # - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial + # data is reprocessed for a transaction event. + # - card_transaction.updated: Occurs when a card transaction happens. + # - card.converted: Occurs when a card is converted from virtual to physical + # cards. + # - card.created: Occurs when a new card is created. + # - card.reissued: Occurs when a card is reissued. + # - card.renewed: Occurs when a card is renewed. + # - card.shipped: Occurs when a card is shipped. + # - card.updated: Occurs when a card is updated. + # - digital_wallet.tokenization_result: Occurs when a tokenization request + # succeeded or failed. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.result` instead. + # + # - digital_wallet.tokenization_two_factor_authentication_code: Occurs when a + # tokenization request 2FA code is sent to the Lithic customer for self serve + # delivery. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.two_factor_authentication_code` instead. + # + # - digital_wallet.tokenization_two_factor_authentication_code_sent: Occurs when a + # tokenization request 2FA code is sent to our downstream messaging providers + # for delivery. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.two_factor_authentication_code_sent` instead. + # + # - digital_wallet.tokenization_updated: Occurs when a tokenization's status has + # changed. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.updated` instead. + # + # - dispute_evidence.upload_failed: Occurs when a dispute evidence upload fails. + # - dispute_transaction.created: Occurs when a new dispute transaction is created + # - dispute_transaction.updated: Occurs when a dispute transaction is updated + # - dispute.updated: Occurs when a dispute is updated. + # - external_bank_account.created: Occurs when an external bank account is + # created. + # - external_bank_account.updated: Occurs when an external bank account is + # updated. + # - external_payment.created: Occurs when an external payment is created. + # - external_payment.updated: Occurs when an external payment is updated. + # - financial_account.created: Occurs when a financial account is created. + # - financial_account.updated: Occurs when a financial account is updated. + # - funding_event.created: Occurs when a funding event is created. + # - internal_transaction.created: Occurs when an internal adjustment is created. + # - internal_transaction.updated: Occurs when an internal adjustment is updated. + # - loan_tape.created: Occurs when a loan tape is created. + # - loan_tape.updated: Occurs when a loan tape is updated. + # - management_operation.created: Occurs when an management operation is created. + # - management_operation.updated: Occurs when an management operation is updated. + # - network_total.created: Occurs when a network total is created. + # - network_total.updated: Occurs when a network total is updated. + # - payment_transaction.created: Occurs when a payment transaction is created. + # - payment_transaction.updated: Occurs when a payment transaction is updated. + # - settlement_report.updated: Occurs when a settlement report is created or + # updated. + # - statements.created: Occurs when a statement has been created + # - three_ds_authentication.challenge: The `three_ds_authentication.challenge` + # event. Upon receiving this request, the Card Program should issue its own + # challenge to the cardholder. After a cardholder challenge is successfully + # completed, the Card Program needs to respond back to Lithic by call to + # [/v1/three_ds_decisioning/challenge_response](https://docs.lithic.com/reference/post_v1-three-ds-decisioning-challenge-response). + # Then the cardholder must navigate back to the merchant checkout flow to + # complete the transaction. Some merchants will include an `app_requestor_url` + # for app-based purchases; Lithic recommends triggering a redirect to that URL + # after the cardholder completes an app-based challenge. + # - three_ds_authentication.created: Occurs when a 3DS authentication is created. + # - three_ds_authentication.updated: Occurs when a 3DS authentication is updated + # (eg. challenge is completed). + # - tokenization.approval_request: Occurs when a tokenization approval request is + # made. + # - tokenization.result: Occurs when a tokenization request succeeded or failed. + # - tokenization.two_factor_authentication_code: Occurs when a tokenization + # request 2FA code is sent to the Lithic customer for self serve delivery. + # - tokenization.two_factor_authentication_code_sent: Occurs when a tokenization + # request 2FA code is sent to our downstream messaging providers for delivery. + # - tokenization.updated: Occurs when a tokenization's status has changed. + # + # @return [Symbol, Lithic::Models::Event::EventType] + required :event_type, enum: -> { Lithic::Event::EventType } + + # @!attribute payload + # + # @return [Hash{Symbol=>Object}] + required :payload, Lithic::Internal::Type::HashOf[Lithic::Internal::Type::Unknown] + + # @!method initialize(token:, created:, event_type:, payload:) + # Some parameter documentations has been truncated, see {Lithic::Models::Event} + # for more details. + # + # A single event that affects the transaction state and lifecycle. + # + # @param token [String] Globally unique identifier. + # + # @param created [Time] An RFC 3339 timestamp for when the event was created. UTC time zone. + # + # @param event_type [Symbol, Lithic::Models::Event::EventType] The type of event that occurred. Possible values: + # + # @param payload [Hash{Symbol=>Object}] + + # The type of event that occurred. Possible values: + # + # - account_holder_document.updated: Occurs when an account holder's document + # upload status has been updated + # - account_holder.created: Occurs when a new account_holder is created. + # - account_holder.updated: Occurs when an account_holder is updated. + # - account_holder.verification: Occurs when an asynchronous account_holder's + # verification is completed. + # - auth_rules.backtest_report.created: Auth Rules backtest report created. + # - balance.updated: Financial Account Balance Update + # - book_transfer_transaction.created: Occurs when a book transfer transaction is + # created. + # - book_transfer_transaction.updated: Occurs when a book transfer transaction is + # updated. + # - card_authorization.challenge: Occurs when an Out of Band challenge is issued + # during card authorization. The card program should issue its own challenge to + # the cardholder and then respond via + # [/v1/card_authorizations/{event_token}/challenge_response](https://docs.lithic.com/reference/respondtoauthorizationchallenge). + # - card_authorization.challenge_response: Occurs when a cardholder responds to a + # challenge during card authorization. + # - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial + # data is processed for a transaction event. + # - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial + # data is reprocessed for a transaction event. + # - card_transaction.updated: Occurs when a card transaction happens. + # - card.converted: Occurs when a card is converted from virtual to physical + # cards. + # - card.created: Occurs when a new card is created. + # - card.reissued: Occurs when a card is reissued. + # - card.renewed: Occurs when a card is renewed. + # - card.shipped: Occurs when a card is shipped. + # - card.updated: Occurs when a card is updated. + # - digital_wallet.tokenization_result: Occurs when a tokenization request + # succeeded or failed. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.result` instead. + # + # - digital_wallet.tokenization_two_factor_authentication_code: Occurs when a + # tokenization request 2FA code is sent to the Lithic customer for self serve + # delivery. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.two_factor_authentication_code` instead. + # + # - digital_wallet.tokenization_two_factor_authentication_code_sent: Occurs when a + # tokenization request 2FA code is sent to our downstream messaging providers + # for delivery. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.two_factor_authentication_code_sent` instead. + # + # - digital_wallet.tokenization_updated: Occurs when a tokenization's status has + # changed. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.updated` instead. + # + # - dispute_evidence.upload_failed: Occurs when a dispute evidence upload fails. + # - dispute_transaction.created: Occurs when a new dispute transaction is created + # - dispute_transaction.updated: Occurs when a dispute transaction is updated + # - dispute.updated: Occurs when a dispute is updated. + # - external_bank_account.created: Occurs when an external bank account is + # created. + # - external_bank_account.updated: Occurs when an external bank account is + # updated. + # - external_payment.created: Occurs when an external payment is created. + # - external_payment.updated: Occurs when an external payment is updated. + # - financial_account.created: Occurs when a financial account is created. + # - financial_account.updated: Occurs when a financial account is updated. + # - funding_event.created: Occurs when a funding event is created. + # - internal_transaction.created: Occurs when an internal adjustment is created. + # - internal_transaction.updated: Occurs when an internal adjustment is updated. + # - loan_tape.created: Occurs when a loan tape is created. + # - loan_tape.updated: Occurs when a loan tape is updated. + # - management_operation.created: Occurs when an management operation is created. + # - management_operation.updated: Occurs when an management operation is updated. + # - network_total.created: Occurs when a network total is created. + # - network_total.updated: Occurs when a network total is updated. + # - payment_transaction.created: Occurs when a payment transaction is created. + # - payment_transaction.updated: Occurs when a payment transaction is updated. + # - settlement_report.updated: Occurs when a settlement report is created or + # updated. + # - statements.created: Occurs when a statement has been created + # - three_ds_authentication.challenge: The `three_ds_authentication.challenge` + # event. Upon receiving this request, the Card Program should issue its own + # challenge to the cardholder. After a cardholder challenge is successfully + # completed, the Card Program needs to respond back to Lithic by call to + # [/v1/three_ds_decisioning/challenge_response](https://docs.lithic.com/reference/post_v1-three-ds-decisioning-challenge-response). + # Then the cardholder must navigate back to the merchant checkout flow to + # complete the transaction. Some merchants will include an `app_requestor_url` + # for app-based purchases; Lithic recommends triggering a redirect to that URL + # after the cardholder completes an app-based challenge. + # - three_ds_authentication.created: Occurs when a 3DS authentication is created. + # - three_ds_authentication.updated: Occurs when a 3DS authentication is updated + # (eg. challenge is completed). + # - tokenization.approval_request: Occurs when a tokenization approval request is + # made. + # - tokenization.result: Occurs when a tokenization request succeeded or failed. + # - tokenization.two_factor_authentication_code: Occurs when a tokenization + # request 2FA code is sent to the Lithic customer for self serve delivery. + # - tokenization.two_factor_authentication_code_sent: Occurs when a tokenization + # request 2FA code is sent to our downstream messaging providers for delivery. + # - tokenization.updated: Occurs when a tokenization's status has changed. + # + # @see Lithic::Models::Event#event_type + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_DOCUMENT_UPDATED = :"account_holder_document.updated" + ACCOUNT_HOLDER_CREATED = :"account_holder.created" + ACCOUNT_HOLDER_UPDATED = :"account_holder.updated" + ACCOUNT_HOLDER_VERIFICATION = :"account_holder.verification" + AUTH_RULES_BACKTEST_REPORT_CREATED = :"auth_rules.backtest_report.created" + BALANCE_UPDATED = :"balance.updated" + BOOK_TRANSFER_TRANSACTION_CREATED = :"book_transfer_transaction.created" + BOOK_TRANSFER_TRANSACTION_UPDATED = :"book_transfer_transaction.updated" + CARD_AUTHORIZATION_CHALLENGE = :"card_authorization.challenge" + CARD_AUTHORIZATION_CHALLENGE_RESPONSE = :"card_authorization.challenge_response" + CARD_TRANSACTION_ENHANCED_DATA_CREATED = :"card_transaction.enhanced_data.created" + CARD_TRANSACTION_ENHANCED_DATA_UPDATED = :"card_transaction.enhanced_data.updated" + CARD_TRANSACTION_UPDATED = :"card_transaction.updated" + CARD_CONVERTED = :"card.converted" + CARD_CREATED = :"card.created" + CARD_REISSUED = :"card.reissued" + CARD_RENEWED = :"card.renewed" + CARD_SHIPPED = :"card.shipped" + CARD_UPDATED = :"card.updated" + DIGITAL_WALLET_TOKENIZATION_RESULT = :"digital_wallet.tokenization_result" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + :"digital_wallet.tokenization_two_factor_authentication_code" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + :"digital_wallet.tokenization_two_factor_authentication_code_sent" + DIGITAL_WALLET_TOKENIZATION_UPDATED = :"digital_wallet.tokenization_updated" + DISPUTE_EVIDENCE_UPLOAD_FAILED = :"dispute_evidence.upload_failed" + DISPUTE_TRANSACTION_CREATED = :"dispute_transaction.created" + DISPUTE_TRANSACTION_UPDATED = :"dispute_transaction.updated" + DISPUTE_UPDATED = :"dispute.updated" + EXTERNAL_BANK_ACCOUNT_CREATED = :"external_bank_account.created" + EXTERNAL_BANK_ACCOUNT_UPDATED = :"external_bank_account.updated" + EXTERNAL_PAYMENT_CREATED = :"external_payment.created" + EXTERNAL_PAYMENT_UPDATED = :"external_payment.updated" + FINANCIAL_ACCOUNT_CREATED = :"financial_account.created" + FINANCIAL_ACCOUNT_UPDATED = :"financial_account.updated" + FUNDING_EVENT_CREATED = :"funding_event.created" + INTERNAL_TRANSACTION_CREATED = :"internal_transaction.created" + INTERNAL_TRANSACTION_UPDATED = :"internal_transaction.updated" + LOAN_TAPE_CREATED = :"loan_tape.created" + LOAN_TAPE_UPDATED = :"loan_tape.updated" + MANAGEMENT_OPERATION_CREATED = :"management_operation.created" + MANAGEMENT_OPERATION_UPDATED = :"management_operation.updated" + NETWORK_TOTAL_CREATED = :"network_total.created" + NETWORK_TOTAL_UPDATED = :"network_total.updated" + PAYMENT_TRANSACTION_CREATED = :"payment_transaction.created" + PAYMENT_TRANSACTION_UPDATED = :"payment_transaction.updated" + SETTLEMENT_REPORT_UPDATED = :"settlement_report.updated" + STATEMENTS_CREATED = :"statements.created" + THREE_DS_AUTHENTICATION_CHALLENGE = :"three_ds_authentication.challenge" + THREE_DS_AUTHENTICATION_CREATED = :"three_ds_authentication.created" + THREE_DS_AUTHENTICATION_UPDATED = :"three_ds_authentication.updated" + TOKENIZATION_APPROVAL_REQUEST = :"tokenization.approval_request" + TOKENIZATION_RESULT = :"tokenization.result" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = :"tokenization.two_factor_authentication_code" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = :"tokenization.two_factor_authentication_code_sent" + TOKENIZATION_UPDATED = :"tokenization.updated" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/event_list_attempts_params.rb b/lib/lithic/models/event_list_attempts_params.rb new file mode 100644 index 00000000..b4e9094f --- /dev/null +++ b/lib/lithic/models/event_list_attempts_params.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Events#list_attempts + class EventListAttemptsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute event_token + # + # @return [String] + required :event_token, String + + # @!attribute begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time + + # @!attribute end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!attribute status + # + # @return [Symbol, Lithic::Models::EventListAttemptsParams::Status, nil] + optional :status, enum: -> { Lithic::EventListAttemptsParams::Status } + + # @!method initialize(event_token:, begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, status: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::EventListAttemptsParams} for more details. + # + # @param event_token [String] + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param status [Symbol, Lithic::Models::EventListAttemptsParams::Status] + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + module Status + extend Lithic::Internal::Type::Enum + + FAILED = :FAILED + PENDING = :PENDING + SENDING = :SENDING + SUCCESS = :SUCCESS + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/event_list_params.rb b/lib/lithic/models/event_list_params.rb new file mode 100644 index 00000000..c7d4136b --- /dev/null +++ b/lib/lithic/models/event_list_params.rb @@ -0,0 +1,245 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Events#list + class EventListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time + + # @!attribute end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute event_types + # Event types to filter events by. + # + # @return [Array, nil] + optional :event_types, -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::EventListParams::EventType] } + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!attribute with_content + # Whether to include the event payload content in the response. + # + # @return [Boolean, nil] + optional :with_content, Lithic::Internal::Type::Boolean + + # @!method initialize(begin_: nil, end_: nil, ending_before: nil, event_types: nil, page_size: nil, starting_after: nil, with_content: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::EventListParams} for more details. + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param event_types [Array] Event types to filter events by. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param with_content [Boolean] Whether to include the event payload content in the response. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # The type of event that occurred. Possible values: + # + # - account_holder_document.updated: Occurs when an account holder's document + # upload status has been updated + # - account_holder.created: Occurs when a new account_holder is created. + # - account_holder.updated: Occurs when an account_holder is updated. + # - account_holder.verification: Occurs when an asynchronous account_holder's + # verification is completed. + # - auth_rules.backtest_report.created: Auth Rules backtest report created. + # - balance.updated: Financial Account Balance Update + # - book_transfer_transaction.created: Occurs when a book transfer transaction is + # created. + # - book_transfer_transaction.updated: Occurs when a book transfer transaction is + # updated. + # - card_authorization.challenge: Occurs when an Out of Band challenge is issued + # during card authorization. The card program should issue its own challenge to + # the cardholder and then respond via + # [/v1/card_authorizations/{event_token}/challenge_response](https://docs.lithic.com/reference/respondtoauthorizationchallenge). + # - card_authorization.challenge_response: Occurs when a cardholder responds to a + # challenge during card authorization. + # - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial + # data is processed for a transaction event. + # - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial + # data is reprocessed for a transaction event. + # - card_transaction.updated: Occurs when a card transaction happens. + # - card.converted: Occurs when a card is converted from virtual to physical + # cards. + # - card.created: Occurs when a new card is created. + # - card.reissued: Occurs when a card is reissued. + # - card.renewed: Occurs when a card is renewed. + # - card.shipped: Occurs when a card is shipped. + # - card.updated: Occurs when a card is updated. + # - digital_wallet.tokenization_result: Occurs when a tokenization request + # succeeded or failed. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.result` instead. + # + # - digital_wallet.tokenization_two_factor_authentication_code: Occurs when a + # tokenization request 2FA code is sent to the Lithic customer for self serve + # delivery. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.two_factor_authentication_code` instead. + # + # - digital_wallet.tokenization_two_factor_authentication_code_sent: Occurs when a + # tokenization request 2FA code is sent to our downstream messaging providers + # for delivery. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.two_factor_authentication_code_sent` instead. + # + # - digital_wallet.tokenization_updated: Occurs when a tokenization's status has + # changed. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.updated` instead. + # + # - dispute_evidence.upload_failed: Occurs when a dispute evidence upload fails. + # - dispute_transaction.created: Occurs when a new dispute transaction is created + # - dispute_transaction.updated: Occurs when a dispute transaction is updated + # - dispute.updated: Occurs when a dispute is updated. + # - external_bank_account.created: Occurs when an external bank account is + # created. + # - external_bank_account.updated: Occurs when an external bank account is + # updated. + # - external_payment.created: Occurs when an external payment is created. + # - external_payment.updated: Occurs when an external payment is updated. + # - financial_account.created: Occurs when a financial account is created. + # - financial_account.updated: Occurs when a financial account is updated. + # - funding_event.created: Occurs when a funding event is created. + # - internal_transaction.created: Occurs when an internal adjustment is created. + # - internal_transaction.updated: Occurs when an internal adjustment is updated. + # - loan_tape.created: Occurs when a loan tape is created. + # - loan_tape.updated: Occurs when a loan tape is updated. + # - management_operation.created: Occurs when an management operation is created. + # - management_operation.updated: Occurs when an management operation is updated. + # - network_total.created: Occurs when a network total is created. + # - network_total.updated: Occurs when a network total is updated. + # - payment_transaction.created: Occurs when a payment transaction is created. + # - payment_transaction.updated: Occurs when a payment transaction is updated. + # - settlement_report.updated: Occurs when a settlement report is created or + # updated. + # - statements.created: Occurs when a statement has been created + # - three_ds_authentication.challenge: The `three_ds_authentication.challenge` + # event. Upon receiving this request, the Card Program should issue its own + # challenge to the cardholder. After a cardholder challenge is successfully + # completed, the Card Program needs to respond back to Lithic by call to + # [/v1/three_ds_decisioning/challenge_response](https://docs.lithic.com/reference/post_v1-three-ds-decisioning-challenge-response). + # Then the cardholder must navigate back to the merchant checkout flow to + # complete the transaction. Some merchants will include an `app_requestor_url` + # for app-based purchases; Lithic recommends triggering a redirect to that URL + # after the cardholder completes an app-based challenge. + # - three_ds_authentication.created: Occurs when a 3DS authentication is created. + # - three_ds_authentication.updated: Occurs when a 3DS authentication is updated + # (eg. challenge is completed). + # - tokenization.approval_request: Occurs when a tokenization approval request is + # made. + # - tokenization.result: Occurs when a tokenization request succeeded or failed. + # - tokenization.two_factor_authentication_code: Occurs when a tokenization + # request 2FA code is sent to the Lithic customer for self serve delivery. + # - tokenization.two_factor_authentication_code_sent: Occurs when a tokenization + # request 2FA code is sent to our downstream messaging providers for delivery. + # - tokenization.updated: Occurs when a tokenization's status has changed. + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_DOCUMENT_UPDATED = :"account_holder_document.updated" + ACCOUNT_HOLDER_CREATED = :"account_holder.created" + ACCOUNT_HOLDER_UPDATED = :"account_holder.updated" + ACCOUNT_HOLDER_VERIFICATION = :"account_holder.verification" + AUTH_RULES_BACKTEST_REPORT_CREATED = :"auth_rules.backtest_report.created" + BALANCE_UPDATED = :"balance.updated" + BOOK_TRANSFER_TRANSACTION_CREATED = :"book_transfer_transaction.created" + BOOK_TRANSFER_TRANSACTION_UPDATED = :"book_transfer_transaction.updated" + CARD_AUTHORIZATION_CHALLENGE = :"card_authorization.challenge" + CARD_AUTHORIZATION_CHALLENGE_RESPONSE = :"card_authorization.challenge_response" + CARD_TRANSACTION_ENHANCED_DATA_CREATED = :"card_transaction.enhanced_data.created" + CARD_TRANSACTION_ENHANCED_DATA_UPDATED = :"card_transaction.enhanced_data.updated" + CARD_TRANSACTION_UPDATED = :"card_transaction.updated" + CARD_CONVERTED = :"card.converted" + CARD_CREATED = :"card.created" + CARD_REISSUED = :"card.reissued" + CARD_RENEWED = :"card.renewed" + CARD_SHIPPED = :"card.shipped" + CARD_UPDATED = :"card.updated" + DIGITAL_WALLET_TOKENIZATION_RESULT = :"digital_wallet.tokenization_result" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + :"digital_wallet.tokenization_two_factor_authentication_code" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + :"digital_wallet.tokenization_two_factor_authentication_code_sent" + DIGITAL_WALLET_TOKENIZATION_UPDATED = :"digital_wallet.tokenization_updated" + DISPUTE_EVIDENCE_UPLOAD_FAILED = :"dispute_evidence.upload_failed" + DISPUTE_TRANSACTION_CREATED = :"dispute_transaction.created" + DISPUTE_TRANSACTION_UPDATED = :"dispute_transaction.updated" + DISPUTE_UPDATED = :"dispute.updated" + EXTERNAL_BANK_ACCOUNT_CREATED = :"external_bank_account.created" + EXTERNAL_BANK_ACCOUNT_UPDATED = :"external_bank_account.updated" + EXTERNAL_PAYMENT_CREATED = :"external_payment.created" + EXTERNAL_PAYMENT_UPDATED = :"external_payment.updated" + FINANCIAL_ACCOUNT_CREATED = :"financial_account.created" + FINANCIAL_ACCOUNT_UPDATED = :"financial_account.updated" + FUNDING_EVENT_CREATED = :"funding_event.created" + INTERNAL_TRANSACTION_CREATED = :"internal_transaction.created" + INTERNAL_TRANSACTION_UPDATED = :"internal_transaction.updated" + LOAN_TAPE_CREATED = :"loan_tape.created" + LOAN_TAPE_UPDATED = :"loan_tape.updated" + MANAGEMENT_OPERATION_CREATED = :"management_operation.created" + MANAGEMENT_OPERATION_UPDATED = :"management_operation.updated" + NETWORK_TOTAL_CREATED = :"network_total.created" + NETWORK_TOTAL_UPDATED = :"network_total.updated" + PAYMENT_TRANSACTION_CREATED = :"payment_transaction.created" + PAYMENT_TRANSACTION_UPDATED = :"payment_transaction.updated" + SETTLEMENT_REPORT_UPDATED = :"settlement_report.updated" + STATEMENTS_CREATED = :"statements.created" + THREE_DS_AUTHENTICATION_CHALLENGE = :"three_ds_authentication.challenge" + THREE_DS_AUTHENTICATION_CREATED = :"three_ds_authentication.created" + THREE_DS_AUTHENTICATION_UPDATED = :"three_ds_authentication.updated" + TOKENIZATION_APPROVAL_REQUEST = :"tokenization.approval_request" + TOKENIZATION_RESULT = :"tokenization.result" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = :"tokenization.two_factor_authentication_code" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = :"tokenization.two_factor_authentication_code_sent" + TOKENIZATION_UPDATED = :"tokenization.updated" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/event_retrieve_params.rb b/lib/lithic/models/event_retrieve_params.rb new file mode 100644 index 00000000..80ceaaac --- /dev/null +++ b/lib/lithic/models/event_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Events#retrieve + class EventRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute event_token + # + # @return [String] + required :event_token, String + + # @!method initialize(event_token:, request_options: {}) + # @param event_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/event_subscription.rb b/lib/lithic/models/event_subscription.rb new file mode 100644 index 00000000..1fa8ace5 --- /dev/null +++ b/lib/lithic/models/event_subscription.rb @@ -0,0 +1,218 @@ +# frozen_string_literal: true + +module Lithic + module Models + class EventSubscription < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier. + # + # @return [String] + required :token, String + + # @!attribute description + # A description of the subscription. + # + # @return [String] + required :description, String + + # @!attribute disabled + # Whether the subscription is disabled. + # + # @return [Boolean] + required :disabled, Lithic::Internal::Type::Boolean + + # @!attribute url + # + # @return [String] + required :url, String + + # @!attribute event_types + # + # @return [Array, nil] + optional :event_types, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::EventSubscription::EventType] }, + nil?: true + + # @!method initialize(token:, description:, disabled:, url:, event_types: nil) + # A subscription to specific event types. + # + # @param token [String] Globally unique identifier. + # + # @param description [String] A description of the subscription. + # + # @param disabled [Boolean] Whether the subscription is disabled. + # + # @param url [String] + # + # @param event_types [Array, nil] + + # The type of event that occurred. Possible values: + # + # - account_holder_document.updated: Occurs when an account holder's document + # upload status has been updated + # - account_holder.created: Occurs when a new account_holder is created. + # - account_holder.updated: Occurs when an account_holder is updated. + # - account_holder.verification: Occurs when an asynchronous account_holder's + # verification is completed. + # - auth_rules.backtest_report.created: Auth Rules backtest report created. + # - balance.updated: Financial Account Balance Update + # - book_transfer_transaction.created: Occurs when a book transfer transaction is + # created. + # - book_transfer_transaction.updated: Occurs when a book transfer transaction is + # updated. + # - card_authorization.challenge: Occurs when an Out of Band challenge is issued + # during card authorization. The card program should issue its own challenge to + # the cardholder and then respond via + # [/v1/card_authorizations/{event_token}/challenge_response](https://docs.lithic.com/reference/respondtoauthorizationchallenge). + # - card_authorization.challenge_response: Occurs when a cardholder responds to a + # challenge during card authorization. + # - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial + # data is processed for a transaction event. + # - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial + # data is reprocessed for a transaction event. + # - card_transaction.updated: Occurs when a card transaction happens. + # - card.converted: Occurs when a card is converted from virtual to physical + # cards. + # - card.created: Occurs when a new card is created. + # - card.reissued: Occurs when a card is reissued. + # - card.renewed: Occurs when a card is renewed. + # - card.shipped: Occurs when a card is shipped. + # - card.updated: Occurs when a card is updated. + # - digital_wallet.tokenization_result: Occurs when a tokenization request + # succeeded or failed. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.result` instead. + # + # - digital_wallet.tokenization_two_factor_authentication_code: Occurs when a + # tokenization request 2FA code is sent to the Lithic customer for self serve + # delivery. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.two_factor_authentication_code` instead. + # + # - digital_wallet.tokenization_two_factor_authentication_code_sent: Occurs when a + # tokenization request 2FA code is sent to our downstream messaging providers + # for delivery. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.two_factor_authentication_code_sent` instead. + # + # - digital_wallet.tokenization_updated: Occurs when a tokenization's status has + # changed. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.updated` instead. + # + # - dispute_evidence.upload_failed: Occurs when a dispute evidence upload fails. + # - dispute_transaction.created: Occurs when a new dispute transaction is created + # - dispute_transaction.updated: Occurs when a dispute transaction is updated + # - dispute.updated: Occurs when a dispute is updated. + # - external_bank_account.created: Occurs when an external bank account is + # created. + # - external_bank_account.updated: Occurs when an external bank account is + # updated. + # - external_payment.created: Occurs when an external payment is created. + # - external_payment.updated: Occurs when an external payment is updated. + # - financial_account.created: Occurs when a financial account is created. + # - financial_account.updated: Occurs when a financial account is updated. + # - funding_event.created: Occurs when a funding event is created. + # - internal_transaction.created: Occurs when an internal adjustment is created. + # - internal_transaction.updated: Occurs when an internal adjustment is updated. + # - loan_tape.created: Occurs when a loan tape is created. + # - loan_tape.updated: Occurs when a loan tape is updated. + # - management_operation.created: Occurs when an management operation is created. + # - management_operation.updated: Occurs when an management operation is updated. + # - network_total.created: Occurs when a network total is created. + # - network_total.updated: Occurs when a network total is updated. + # - payment_transaction.created: Occurs when a payment transaction is created. + # - payment_transaction.updated: Occurs when a payment transaction is updated. + # - settlement_report.updated: Occurs when a settlement report is created or + # updated. + # - statements.created: Occurs when a statement has been created + # - three_ds_authentication.challenge: The `three_ds_authentication.challenge` + # event. Upon receiving this request, the Card Program should issue its own + # challenge to the cardholder. After a cardholder challenge is successfully + # completed, the Card Program needs to respond back to Lithic by call to + # [/v1/three_ds_decisioning/challenge_response](https://docs.lithic.com/reference/post_v1-three-ds-decisioning-challenge-response). + # Then the cardholder must navigate back to the merchant checkout flow to + # complete the transaction. Some merchants will include an `app_requestor_url` + # for app-based purchases; Lithic recommends triggering a redirect to that URL + # after the cardholder completes an app-based challenge. + # - three_ds_authentication.created: Occurs when a 3DS authentication is created. + # - three_ds_authentication.updated: Occurs when a 3DS authentication is updated + # (eg. challenge is completed). + # - tokenization.approval_request: Occurs when a tokenization approval request is + # made. + # - tokenization.result: Occurs when a tokenization request succeeded or failed. + # - tokenization.two_factor_authentication_code: Occurs when a tokenization + # request 2FA code is sent to the Lithic customer for self serve delivery. + # - tokenization.two_factor_authentication_code_sent: Occurs when a tokenization + # request 2FA code is sent to our downstream messaging providers for delivery. + # - tokenization.updated: Occurs when a tokenization's status has changed. + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_DOCUMENT_UPDATED = :"account_holder_document.updated" + ACCOUNT_HOLDER_CREATED = :"account_holder.created" + ACCOUNT_HOLDER_UPDATED = :"account_holder.updated" + ACCOUNT_HOLDER_VERIFICATION = :"account_holder.verification" + AUTH_RULES_BACKTEST_REPORT_CREATED = :"auth_rules.backtest_report.created" + BALANCE_UPDATED = :"balance.updated" + BOOK_TRANSFER_TRANSACTION_CREATED = :"book_transfer_transaction.created" + BOOK_TRANSFER_TRANSACTION_UPDATED = :"book_transfer_transaction.updated" + CARD_AUTHORIZATION_CHALLENGE = :"card_authorization.challenge" + CARD_AUTHORIZATION_CHALLENGE_RESPONSE = :"card_authorization.challenge_response" + CARD_TRANSACTION_ENHANCED_DATA_CREATED = :"card_transaction.enhanced_data.created" + CARD_TRANSACTION_ENHANCED_DATA_UPDATED = :"card_transaction.enhanced_data.updated" + CARD_TRANSACTION_UPDATED = :"card_transaction.updated" + CARD_CONVERTED = :"card.converted" + CARD_CREATED = :"card.created" + CARD_REISSUED = :"card.reissued" + CARD_RENEWED = :"card.renewed" + CARD_SHIPPED = :"card.shipped" + CARD_UPDATED = :"card.updated" + DIGITAL_WALLET_TOKENIZATION_RESULT = :"digital_wallet.tokenization_result" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + :"digital_wallet.tokenization_two_factor_authentication_code" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + :"digital_wallet.tokenization_two_factor_authentication_code_sent" + DIGITAL_WALLET_TOKENIZATION_UPDATED = :"digital_wallet.tokenization_updated" + DISPUTE_EVIDENCE_UPLOAD_FAILED = :"dispute_evidence.upload_failed" + DISPUTE_TRANSACTION_CREATED = :"dispute_transaction.created" + DISPUTE_TRANSACTION_UPDATED = :"dispute_transaction.updated" + DISPUTE_UPDATED = :"dispute.updated" + EXTERNAL_BANK_ACCOUNT_CREATED = :"external_bank_account.created" + EXTERNAL_BANK_ACCOUNT_UPDATED = :"external_bank_account.updated" + EXTERNAL_PAYMENT_CREATED = :"external_payment.created" + EXTERNAL_PAYMENT_UPDATED = :"external_payment.updated" + FINANCIAL_ACCOUNT_CREATED = :"financial_account.created" + FINANCIAL_ACCOUNT_UPDATED = :"financial_account.updated" + FUNDING_EVENT_CREATED = :"funding_event.created" + INTERNAL_TRANSACTION_CREATED = :"internal_transaction.created" + INTERNAL_TRANSACTION_UPDATED = :"internal_transaction.updated" + LOAN_TAPE_CREATED = :"loan_tape.created" + LOAN_TAPE_UPDATED = :"loan_tape.updated" + MANAGEMENT_OPERATION_CREATED = :"management_operation.created" + MANAGEMENT_OPERATION_UPDATED = :"management_operation.updated" + NETWORK_TOTAL_CREATED = :"network_total.created" + NETWORK_TOTAL_UPDATED = :"network_total.updated" + PAYMENT_TRANSACTION_CREATED = :"payment_transaction.created" + PAYMENT_TRANSACTION_UPDATED = :"payment_transaction.updated" + SETTLEMENT_REPORT_UPDATED = :"settlement_report.updated" + STATEMENTS_CREATED = :"statements.created" + THREE_DS_AUTHENTICATION_CHALLENGE = :"three_ds_authentication.challenge" + THREE_DS_AUTHENTICATION_CREATED = :"three_ds_authentication.created" + THREE_DS_AUTHENTICATION_UPDATED = :"three_ds_authentication.updated" + TOKENIZATION_APPROVAL_REQUEST = :"tokenization.approval_request" + TOKENIZATION_RESULT = :"tokenization.result" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = :"tokenization.two_factor_authentication_code" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = :"tokenization.two_factor_authentication_code_sent" + TOKENIZATION_UPDATED = :"tokenization.updated" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/events/event_subscription_resend_params.rb b/lib/lithic/models/events/event_subscription_resend_params.rb new file mode 100644 index 00000000..e36f6576 --- /dev/null +++ b/lib/lithic/models/events/event_subscription_resend_params.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Events + # @see Lithic::Resources::Events::EventSubscriptions#resend + class EventSubscriptionResendParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute event_token + # + # @return [String] + required :event_token, String + + # @!attribute event_subscription_token + # + # @return [String] + required :event_subscription_token, String + + # @!method initialize(event_token:, event_subscription_token:, request_options: {}) + # @param event_token [String] + # @param event_subscription_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/events/subscription_create_params.rb b/lib/lithic/models/events/subscription_create_params.rb new file mode 100644 index 00000000..ca2cb392 --- /dev/null +++ b/lib/lithic/models/events/subscription_create_params.rb @@ -0,0 +1,221 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Events + # @see Lithic::Resources::Events::Subscriptions#create + class SubscriptionCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute url + # URL to which event webhooks will be sent. URL must be a valid HTTPS address. + # + # @return [String] + required :url, String + + # @!attribute description + # Event subscription description. + # + # @return [String, nil] + optional :description, String + + # @!attribute disabled + # Whether the event subscription is active (false) or inactive (true). + # + # @return [Boolean, nil] + optional :disabled, Lithic::Internal::Type::Boolean + + # @!attribute event_types + # Indicates types of events that will be sent to this subscription. If left blank, + # all types will be sent. + # + # @return [Array, nil] + optional :event_types, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::Events::SubscriptionCreateParams::EventType] } + + # @!method initialize(url:, description: nil, disabled: nil, event_types: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Events::SubscriptionCreateParams} for more details. + # + # @param url [String] URL to which event webhooks will be sent. URL must be a valid HTTPS address. + # + # @param description [String] Event subscription description. + # + # @param disabled [Boolean] Whether the event subscription is active (false) or inactive (true). + # + # @param event_types [Array] Indicates types of events that will be sent to this subscription. If left blank, + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # The type of event that occurred. Possible values: + # + # - account_holder_document.updated: Occurs when an account holder's document + # upload status has been updated + # - account_holder.created: Occurs when a new account_holder is created. + # - account_holder.updated: Occurs when an account_holder is updated. + # - account_holder.verification: Occurs when an asynchronous account_holder's + # verification is completed. + # - auth_rules.backtest_report.created: Auth Rules backtest report created. + # - balance.updated: Financial Account Balance Update + # - book_transfer_transaction.created: Occurs when a book transfer transaction is + # created. + # - book_transfer_transaction.updated: Occurs when a book transfer transaction is + # updated. + # - card_authorization.challenge: Occurs when an Out of Band challenge is issued + # during card authorization. The card program should issue its own challenge to + # the cardholder and then respond via + # [/v1/card_authorizations/{event_token}/challenge_response](https://docs.lithic.com/reference/respondtoauthorizationchallenge). + # - card_authorization.challenge_response: Occurs when a cardholder responds to a + # challenge during card authorization. + # - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial + # data is processed for a transaction event. + # - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial + # data is reprocessed for a transaction event. + # - card_transaction.updated: Occurs when a card transaction happens. + # - card.converted: Occurs when a card is converted from virtual to physical + # cards. + # - card.created: Occurs when a new card is created. + # - card.reissued: Occurs when a card is reissued. + # - card.renewed: Occurs when a card is renewed. + # - card.shipped: Occurs when a card is shipped. + # - card.updated: Occurs when a card is updated. + # - digital_wallet.tokenization_result: Occurs when a tokenization request + # succeeded or failed. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.result` instead. + # + # - digital_wallet.tokenization_two_factor_authentication_code: Occurs when a + # tokenization request 2FA code is sent to the Lithic customer for self serve + # delivery. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.two_factor_authentication_code` instead. + # + # - digital_wallet.tokenization_two_factor_authentication_code_sent: Occurs when a + # tokenization request 2FA code is sent to our downstream messaging providers + # for delivery. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.two_factor_authentication_code_sent` instead. + # + # - digital_wallet.tokenization_updated: Occurs when a tokenization's status has + # changed. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.updated` instead. + # + # - dispute_evidence.upload_failed: Occurs when a dispute evidence upload fails. + # - dispute_transaction.created: Occurs when a new dispute transaction is created + # - dispute_transaction.updated: Occurs when a dispute transaction is updated + # - dispute.updated: Occurs when a dispute is updated. + # - external_bank_account.created: Occurs when an external bank account is + # created. + # - external_bank_account.updated: Occurs when an external bank account is + # updated. + # - external_payment.created: Occurs when an external payment is created. + # - external_payment.updated: Occurs when an external payment is updated. + # - financial_account.created: Occurs when a financial account is created. + # - financial_account.updated: Occurs when a financial account is updated. + # - funding_event.created: Occurs when a funding event is created. + # - internal_transaction.created: Occurs when an internal adjustment is created. + # - internal_transaction.updated: Occurs when an internal adjustment is updated. + # - loan_tape.created: Occurs when a loan tape is created. + # - loan_tape.updated: Occurs when a loan tape is updated. + # - management_operation.created: Occurs when an management operation is created. + # - management_operation.updated: Occurs when an management operation is updated. + # - network_total.created: Occurs when a network total is created. + # - network_total.updated: Occurs when a network total is updated. + # - payment_transaction.created: Occurs when a payment transaction is created. + # - payment_transaction.updated: Occurs when a payment transaction is updated. + # - settlement_report.updated: Occurs when a settlement report is created or + # updated. + # - statements.created: Occurs when a statement has been created + # - three_ds_authentication.challenge: The `three_ds_authentication.challenge` + # event. Upon receiving this request, the Card Program should issue its own + # challenge to the cardholder. After a cardholder challenge is successfully + # completed, the Card Program needs to respond back to Lithic by call to + # [/v1/three_ds_decisioning/challenge_response](https://docs.lithic.com/reference/post_v1-three-ds-decisioning-challenge-response). + # Then the cardholder must navigate back to the merchant checkout flow to + # complete the transaction. Some merchants will include an `app_requestor_url` + # for app-based purchases; Lithic recommends triggering a redirect to that URL + # after the cardholder completes an app-based challenge. + # - three_ds_authentication.created: Occurs when a 3DS authentication is created. + # - three_ds_authentication.updated: Occurs when a 3DS authentication is updated + # (eg. challenge is completed). + # - tokenization.approval_request: Occurs when a tokenization approval request is + # made. + # - tokenization.result: Occurs when a tokenization request succeeded or failed. + # - tokenization.two_factor_authentication_code: Occurs when a tokenization + # request 2FA code is sent to the Lithic customer for self serve delivery. + # - tokenization.two_factor_authentication_code_sent: Occurs when a tokenization + # request 2FA code is sent to our downstream messaging providers for delivery. + # - tokenization.updated: Occurs when a tokenization's status has changed. + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_DOCUMENT_UPDATED = :"account_holder_document.updated" + ACCOUNT_HOLDER_CREATED = :"account_holder.created" + ACCOUNT_HOLDER_UPDATED = :"account_holder.updated" + ACCOUNT_HOLDER_VERIFICATION = :"account_holder.verification" + AUTH_RULES_BACKTEST_REPORT_CREATED = :"auth_rules.backtest_report.created" + BALANCE_UPDATED = :"balance.updated" + BOOK_TRANSFER_TRANSACTION_CREATED = :"book_transfer_transaction.created" + BOOK_TRANSFER_TRANSACTION_UPDATED = :"book_transfer_transaction.updated" + CARD_AUTHORIZATION_CHALLENGE = :"card_authorization.challenge" + CARD_AUTHORIZATION_CHALLENGE_RESPONSE = :"card_authorization.challenge_response" + CARD_TRANSACTION_ENHANCED_DATA_CREATED = :"card_transaction.enhanced_data.created" + CARD_TRANSACTION_ENHANCED_DATA_UPDATED = :"card_transaction.enhanced_data.updated" + CARD_TRANSACTION_UPDATED = :"card_transaction.updated" + CARD_CONVERTED = :"card.converted" + CARD_CREATED = :"card.created" + CARD_REISSUED = :"card.reissued" + CARD_RENEWED = :"card.renewed" + CARD_SHIPPED = :"card.shipped" + CARD_UPDATED = :"card.updated" + DIGITAL_WALLET_TOKENIZATION_RESULT = :"digital_wallet.tokenization_result" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + :"digital_wallet.tokenization_two_factor_authentication_code" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + :"digital_wallet.tokenization_two_factor_authentication_code_sent" + DIGITAL_WALLET_TOKENIZATION_UPDATED = :"digital_wallet.tokenization_updated" + DISPUTE_EVIDENCE_UPLOAD_FAILED = :"dispute_evidence.upload_failed" + DISPUTE_TRANSACTION_CREATED = :"dispute_transaction.created" + DISPUTE_TRANSACTION_UPDATED = :"dispute_transaction.updated" + DISPUTE_UPDATED = :"dispute.updated" + EXTERNAL_BANK_ACCOUNT_CREATED = :"external_bank_account.created" + EXTERNAL_BANK_ACCOUNT_UPDATED = :"external_bank_account.updated" + EXTERNAL_PAYMENT_CREATED = :"external_payment.created" + EXTERNAL_PAYMENT_UPDATED = :"external_payment.updated" + FINANCIAL_ACCOUNT_CREATED = :"financial_account.created" + FINANCIAL_ACCOUNT_UPDATED = :"financial_account.updated" + FUNDING_EVENT_CREATED = :"funding_event.created" + INTERNAL_TRANSACTION_CREATED = :"internal_transaction.created" + INTERNAL_TRANSACTION_UPDATED = :"internal_transaction.updated" + LOAN_TAPE_CREATED = :"loan_tape.created" + LOAN_TAPE_UPDATED = :"loan_tape.updated" + MANAGEMENT_OPERATION_CREATED = :"management_operation.created" + MANAGEMENT_OPERATION_UPDATED = :"management_operation.updated" + NETWORK_TOTAL_CREATED = :"network_total.created" + NETWORK_TOTAL_UPDATED = :"network_total.updated" + PAYMENT_TRANSACTION_CREATED = :"payment_transaction.created" + PAYMENT_TRANSACTION_UPDATED = :"payment_transaction.updated" + SETTLEMENT_REPORT_UPDATED = :"settlement_report.updated" + STATEMENTS_CREATED = :"statements.created" + THREE_DS_AUTHENTICATION_CHALLENGE = :"three_ds_authentication.challenge" + THREE_DS_AUTHENTICATION_CREATED = :"three_ds_authentication.created" + THREE_DS_AUTHENTICATION_UPDATED = :"three_ds_authentication.updated" + TOKENIZATION_APPROVAL_REQUEST = :"tokenization.approval_request" + TOKENIZATION_RESULT = :"tokenization.result" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = :"tokenization.two_factor_authentication_code" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = :"tokenization.two_factor_authentication_code_sent" + TOKENIZATION_UPDATED = :"tokenization.updated" + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/events/subscription_delete_params.rb b/lib/lithic/models/events/subscription_delete_params.rb new file mode 100644 index 00000000..c9cab5e7 --- /dev/null +++ b/lib/lithic/models/events/subscription_delete_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Events + # @see Lithic::Resources::Events::Subscriptions#delete + class SubscriptionDeleteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute event_subscription_token + # + # @return [String] + required :event_subscription_token, String + + # @!method initialize(event_subscription_token:, request_options: {}) + # @param event_subscription_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/events/subscription_list_attempts_params.rb b/lib/lithic/models/events/subscription_list_attempts_params.rb new file mode 100644 index 00000000..3b4c120f --- /dev/null +++ b/lib/lithic/models/events/subscription_list_attempts_params.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Events + # @see Lithic::Resources::Events::Subscriptions#list_attempts + class SubscriptionListAttemptsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute event_subscription_token + # + # @return [String] + required :event_subscription_token, String + + # @!attribute begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time + + # @!attribute end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!attribute status + # + # @return [Symbol, Lithic::Models::Events::SubscriptionListAttemptsParams::Status, nil] + optional :status, enum: -> { Lithic::Events::SubscriptionListAttemptsParams::Status } + + # @!method initialize(event_subscription_token:, begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, status: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Events::SubscriptionListAttemptsParams} for more details. + # + # @param event_subscription_token [String] + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param status [Symbol, Lithic::Models::Events::SubscriptionListAttemptsParams::Status] + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + module Status + extend Lithic::Internal::Type::Enum + + FAILED = :FAILED + PENDING = :PENDING + SENDING = :SENDING + SUCCESS = :SUCCESS + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/events/subscription_list_params.rb b/lib/lithic/models/events/subscription_list_params.rb new file mode 100644 index 00000000..bfbb8e0b --- /dev/null +++ b/lib/lithic/models/events/subscription_list_params.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Events + # @see Lithic::Resources::Events::Subscriptions#list + class SubscriptionListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!method initialize(ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Events::SubscriptionListParams} for more details. + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/events/subscription_recover_params.rb b/lib/lithic/models/events/subscription_recover_params.rb new file mode 100644 index 00000000..d8dc5741 --- /dev/null +++ b/lib/lithic/models/events/subscription_recover_params.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Events + # @see Lithic::Resources::Events::Subscriptions#recover + class SubscriptionRecoverParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute event_subscription_token + # + # @return [String] + required :event_subscription_token, String + + # @!attribute begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time + + # @!attribute end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time + + # @!method initialize(event_subscription_token:, begin_: nil, end_: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Events::SubscriptionRecoverParams} for more details. + # + # @param event_subscription_token [String] + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/events/subscription_replay_missing_params.rb b/lib/lithic/models/events/subscription_replay_missing_params.rb new file mode 100644 index 00000000..cd15f9e7 --- /dev/null +++ b/lib/lithic/models/events/subscription_replay_missing_params.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Events + # @see Lithic::Resources::Events::Subscriptions#replay_missing + class SubscriptionReplayMissingParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute event_subscription_token + # + # @return [String] + required :event_subscription_token, String + + # @!attribute begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time + + # @!attribute end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time + + # @!method initialize(event_subscription_token:, begin_: nil, end_: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Events::SubscriptionReplayMissingParams} for more details. + # + # @param event_subscription_token [String] + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/events/subscription_retrieve_params.rb b/lib/lithic/models/events/subscription_retrieve_params.rb new file mode 100644 index 00000000..3ec6a45d --- /dev/null +++ b/lib/lithic/models/events/subscription_retrieve_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Events + # @see Lithic::Resources::Events::Subscriptions#retrieve + class SubscriptionRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute event_subscription_token + # + # @return [String] + required :event_subscription_token, String + + # @!method initialize(event_subscription_token:, request_options: {}) + # @param event_subscription_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/events/subscription_retrieve_secret_params.rb b/lib/lithic/models/events/subscription_retrieve_secret_params.rb new file mode 100644 index 00000000..eaa8c145 --- /dev/null +++ b/lib/lithic/models/events/subscription_retrieve_secret_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Events + # @see Lithic::Resources::Events::Subscriptions#retrieve_secret + class SubscriptionRetrieveSecretParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute event_subscription_token + # + # @return [String] + required :event_subscription_token, String + + # @!method initialize(event_subscription_token:, request_options: {}) + # @param event_subscription_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/events/subscription_retrieve_secret_response.rb b/lib/lithic/models/events/subscription_retrieve_secret_response.rb new file mode 100644 index 00000000..776939a2 --- /dev/null +++ b/lib/lithic/models/events/subscription_retrieve_secret_response.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Events + # @see Lithic::Resources::Events::Subscriptions#retrieve_secret + class SubscriptionRetrieveSecretResponse < Lithic::Internal::Type::BaseModel + # @!attribute secret + # The secret for the event subscription. + # + # @return [String, nil] + optional :secret, String + + # @!method initialize(secret: nil) + # @param secret [String] The secret for the event subscription. + end + end + end +end diff --git a/lib/lithic/models/events/subscription_rotate_secret_params.rb b/lib/lithic/models/events/subscription_rotate_secret_params.rb new file mode 100644 index 00000000..d19c87a7 --- /dev/null +++ b/lib/lithic/models/events/subscription_rotate_secret_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Events + # @see Lithic::Resources::Events::Subscriptions#rotate_secret + class SubscriptionRotateSecretParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute event_subscription_token + # + # @return [String] + required :event_subscription_token, String + + # @!method initialize(event_subscription_token:, request_options: {}) + # @param event_subscription_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/events/subscription_send_simulated_example_params.rb b/lib/lithic/models/events/subscription_send_simulated_example_params.rb new file mode 100644 index 00000000..9219f6c0 --- /dev/null +++ b/lib/lithic/models/events/subscription_send_simulated_example_params.rb @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Events + # @see Lithic::Resources::Events::Subscriptions#send_simulated_example + class SubscriptionSendSimulatedExampleParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute event_subscription_token + # + # @return [String] + required :event_subscription_token, String + + # @!attribute event_type + # Event type to send example message for. + # + # @return [Symbol, Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType, nil] + optional :event_type, enum: -> { Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType } + + # @!method initialize(event_subscription_token:, event_type: nil, request_options: {}) + # @param event_subscription_token [String] + # + # @param event_type [Symbol, Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType] Event type to send example message for. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Event type to send example message for. + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_DOCUMENT_UPDATED = :"account_holder_document.updated" + ACCOUNT_HOLDER_CREATED = :"account_holder.created" + ACCOUNT_HOLDER_UPDATED = :"account_holder.updated" + ACCOUNT_HOLDER_VERIFICATION = :"account_holder.verification" + AUTH_RULES_BACKTEST_REPORT_CREATED = :"auth_rules.backtest_report.created" + BALANCE_UPDATED = :"balance.updated" + BOOK_TRANSFER_TRANSACTION_CREATED = :"book_transfer_transaction.created" + BOOK_TRANSFER_TRANSACTION_UPDATED = :"book_transfer_transaction.updated" + CARD_AUTHORIZATION_CHALLENGE = :"card_authorization.challenge" + CARD_AUTHORIZATION_CHALLENGE_RESPONSE = :"card_authorization.challenge_response" + CARD_TRANSACTION_ENHANCED_DATA_CREATED = :"card_transaction.enhanced_data.created" + CARD_TRANSACTION_ENHANCED_DATA_UPDATED = :"card_transaction.enhanced_data.updated" + CARD_TRANSACTION_UPDATED = :"card_transaction.updated" + CARD_CONVERTED = :"card.converted" + CARD_CREATED = :"card.created" + CARD_REISSUED = :"card.reissued" + CARD_RENEWED = :"card.renewed" + CARD_SHIPPED = :"card.shipped" + CARD_UPDATED = :"card.updated" + DIGITAL_WALLET_TOKENIZATION_RESULT = :"digital_wallet.tokenization_result" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + :"digital_wallet.tokenization_two_factor_authentication_code" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + :"digital_wallet.tokenization_two_factor_authentication_code_sent" + DIGITAL_WALLET_TOKENIZATION_UPDATED = :"digital_wallet.tokenization_updated" + DISPUTE_EVIDENCE_UPLOAD_FAILED = :"dispute_evidence.upload_failed" + DISPUTE_TRANSACTION_CREATED = :"dispute_transaction.created" + DISPUTE_TRANSACTION_UPDATED = :"dispute_transaction.updated" + DISPUTE_UPDATED = :"dispute.updated" + EXTERNAL_BANK_ACCOUNT_CREATED = :"external_bank_account.created" + EXTERNAL_BANK_ACCOUNT_UPDATED = :"external_bank_account.updated" + EXTERNAL_PAYMENT_CREATED = :"external_payment.created" + EXTERNAL_PAYMENT_UPDATED = :"external_payment.updated" + FINANCIAL_ACCOUNT_CREATED = :"financial_account.created" + FINANCIAL_ACCOUNT_UPDATED = :"financial_account.updated" + FUNDING_EVENT_CREATED = :"funding_event.created" + INTERNAL_TRANSACTION_CREATED = :"internal_transaction.created" + INTERNAL_TRANSACTION_UPDATED = :"internal_transaction.updated" + LOAN_TAPE_CREATED = :"loan_tape.created" + LOAN_TAPE_UPDATED = :"loan_tape.updated" + MANAGEMENT_OPERATION_CREATED = :"management_operation.created" + MANAGEMENT_OPERATION_UPDATED = :"management_operation.updated" + NETWORK_TOTAL_CREATED = :"network_total.created" + NETWORK_TOTAL_UPDATED = :"network_total.updated" + PAYMENT_TRANSACTION_CREATED = :"payment_transaction.created" + PAYMENT_TRANSACTION_UPDATED = :"payment_transaction.updated" + SETTLEMENT_REPORT_UPDATED = :"settlement_report.updated" + STATEMENTS_CREATED = :"statements.created" + THREE_DS_AUTHENTICATION_CHALLENGE = :"three_ds_authentication.challenge" + THREE_DS_AUTHENTICATION_CREATED = :"three_ds_authentication.created" + THREE_DS_AUTHENTICATION_UPDATED = :"three_ds_authentication.updated" + TOKENIZATION_APPROVAL_REQUEST = :"tokenization.approval_request" + TOKENIZATION_RESULT = :"tokenization.result" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = :"tokenization.two_factor_authentication_code" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = :"tokenization.two_factor_authentication_code_sent" + TOKENIZATION_UPDATED = :"tokenization.updated" + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/events/subscription_update_params.rb b/lib/lithic/models/events/subscription_update_params.rb new file mode 100644 index 00000000..99170b15 --- /dev/null +++ b/lib/lithic/models/events/subscription_update_params.rb @@ -0,0 +1,228 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Events + # @see Lithic::Resources::Events::Subscriptions#update + class SubscriptionUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute event_subscription_token + # + # @return [String] + required :event_subscription_token, String + + # @!attribute url + # URL to which event webhooks will be sent. URL must be a valid HTTPS address. + # + # @return [String] + required :url, String + + # @!attribute description + # Event subscription description. + # + # @return [String, nil] + optional :description, String + + # @!attribute disabled + # Whether the event subscription is active (false) or inactive (true). + # + # @return [Boolean, nil] + optional :disabled, Lithic::Internal::Type::Boolean + + # @!attribute event_types + # Indicates types of events that will be sent to this subscription. If left blank, + # all types will be sent. + # + # @return [Array, nil] + optional :event_types, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::Events::SubscriptionUpdateParams::EventType] } + + # @!method initialize(event_subscription_token:, url:, description: nil, disabled: nil, event_types: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Events::SubscriptionUpdateParams} for more details. + # + # @param event_subscription_token [String] + # + # @param url [String] URL to which event webhooks will be sent. URL must be a valid HTTPS address. + # + # @param description [String] Event subscription description. + # + # @param disabled [Boolean] Whether the event subscription is active (false) or inactive (true). + # + # @param event_types [Array] Indicates types of events that will be sent to this subscription. If left blank, + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # The type of event that occurred. Possible values: + # + # - account_holder_document.updated: Occurs when an account holder's document + # upload status has been updated + # - account_holder.created: Occurs when a new account_holder is created. + # - account_holder.updated: Occurs when an account_holder is updated. + # - account_holder.verification: Occurs when an asynchronous account_holder's + # verification is completed. + # - auth_rules.backtest_report.created: Auth Rules backtest report created. + # - balance.updated: Financial Account Balance Update + # - book_transfer_transaction.created: Occurs when a book transfer transaction is + # created. + # - book_transfer_transaction.updated: Occurs when a book transfer transaction is + # updated. + # - card_authorization.challenge: Occurs when an Out of Band challenge is issued + # during card authorization. The card program should issue its own challenge to + # the cardholder and then respond via + # [/v1/card_authorizations/{event_token}/challenge_response](https://docs.lithic.com/reference/respondtoauthorizationchallenge). + # - card_authorization.challenge_response: Occurs when a cardholder responds to a + # challenge during card authorization. + # - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial + # data is processed for a transaction event. + # - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial + # data is reprocessed for a transaction event. + # - card_transaction.updated: Occurs when a card transaction happens. + # - card.converted: Occurs when a card is converted from virtual to physical + # cards. + # - card.created: Occurs when a new card is created. + # - card.reissued: Occurs when a card is reissued. + # - card.renewed: Occurs when a card is renewed. + # - card.shipped: Occurs when a card is shipped. + # - card.updated: Occurs when a card is updated. + # - digital_wallet.tokenization_result: Occurs when a tokenization request + # succeeded or failed. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.result` instead. + # + # - digital_wallet.tokenization_two_factor_authentication_code: Occurs when a + # tokenization request 2FA code is sent to the Lithic customer for self serve + # delivery. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.two_factor_authentication_code` instead. + # + # - digital_wallet.tokenization_two_factor_authentication_code_sent: Occurs when a + # tokenization request 2FA code is sent to our downstream messaging providers + # for delivery. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.two_factor_authentication_code_sent` instead. + # + # - digital_wallet.tokenization_updated: Occurs when a tokenization's status has + # changed. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.updated` instead. + # + # - dispute_evidence.upload_failed: Occurs when a dispute evidence upload fails. + # - dispute_transaction.created: Occurs when a new dispute transaction is created + # - dispute_transaction.updated: Occurs when a dispute transaction is updated + # - dispute.updated: Occurs when a dispute is updated. + # - external_bank_account.created: Occurs when an external bank account is + # created. + # - external_bank_account.updated: Occurs when an external bank account is + # updated. + # - external_payment.created: Occurs when an external payment is created. + # - external_payment.updated: Occurs when an external payment is updated. + # - financial_account.created: Occurs when a financial account is created. + # - financial_account.updated: Occurs when a financial account is updated. + # - funding_event.created: Occurs when a funding event is created. + # - internal_transaction.created: Occurs when an internal adjustment is created. + # - internal_transaction.updated: Occurs when an internal adjustment is updated. + # - loan_tape.created: Occurs when a loan tape is created. + # - loan_tape.updated: Occurs when a loan tape is updated. + # - management_operation.created: Occurs when an management operation is created. + # - management_operation.updated: Occurs when an management operation is updated. + # - network_total.created: Occurs when a network total is created. + # - network_total.updated: Occurs when a network total is updated. + # - payment_transaction.created: Occurs when a payment transaction is created. + # - payment_transaction.updated: Occurs when a payment transaction is updated. + # - settlement_report.updated: Occurs when a settlement report is created or + # updated. + # - statements.created: Occurs when a statement has been created + # - three_ds_authentication.challenge: The `three_ds_authentication.challenge` + # event. Upon receiving this request, the Card Program should issue its own + # challenge to the cardholder. After a cardholder challenge is successfully + # completed, the Card Program needs to respond back to Lithic by call to + # [/v1/three_ds_decisioning/challenge_response](https://docs.lithic.com/reference/post_v1-three-ds-decisioning-challenge-response). + # Then the cardholder must navigate back to the merchant checkout flow to + # complete the transaction. Some merchants will include an `app_requestor_url` + # for app-based purchases; Lithic recommends triggering a redirect to that URL + # after the cardholder completes an app-based challenge. + # - three_ds_authentication.created: Occurs when a 3DS authentication is created. + # - three_ds_authentication.updated: Occurs when a 3DS authentication is updated + # (eg. challenge is completed). + # - tokenization.approval_request: Occurs when a tokenization approval request is + # made. + # - tokenization.result: Occurs when a tokenization request succeeded or failed. + # - tokenization.two_factor_authentication_code: Occurs when a tokenization + # request 2FA code is sent to the Lithic customer for self serve delivery. + # - tokenization.two_factor_authentication_code_sent: Occurs when a tokenization + # request 2FA code is sent to our downstream messaging providers for delivery. + # - tokenization.updated: Occurs when a tokenization's status has changed. + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_DOCUMENT_UPDATED = :"account_holder_document.updated" + ACCOUNT_HOLDER_CREATED = :"account_holder.created" + ACCOUNT_HOLDER_UPDATED = :"account_holder.updated" + ACCOUNT_HOLDER_VERIFICATION = :"account_holder.verification" + AUTH_RULES_BACKTEST_REPORT_CREATED = :"auth_rules.backtest_report.created" + BALANCE_UPDATED = :"balance.updated" + BOOK_TRANSFER_TRANSACTION_CREATED = :"book_transfer_transaction.created" + BOOK_TRANSFER_TRANSACTION_UPDATED = :"book_transfer_transaction.updated" + CARD_AUTHORIZATION_CHALLENGE = :"card_authorization.challenge" + CARD_AUTHORIZATION_CHALLENGE_RESPONSE = :"card_authorization.challenge_response" + CARD_TRANSACTION_ENHANCED_DATA_CREATED = :"card_transaction.enhanced_data.created" + CARD_TRANSACTION_ENHANCED_DATA_UPDATED = :"card_transaction.enhanced_data.updated" + CARD_TRANSACTION_UPDATED = :"card_transaction.updated" + CARD_CONVERTED = :"card.converted" + CARD_CREATED = :"card.created" + CARD_REISSUED = :"card.reissued" + CARD_RENEWED = :"card.renewed" + CARD_SHIPPED = :"card.shipped" + CARD_UPDATED = :"card.updated" + DIGITAL_WALLET_TOKENIZATION_RESULT = :"digital_wallet.tokenization_result" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + :"digital_wallet.tokenization_two_factor_authentication_code" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + :"digital_wallet.tokenization_two_factor_authentication_code_sent" + DIGITAL_WALLET_TOKENIZATION_UPDATED = :"digital_wallet.tokenization_updated" + DISPUTE_EVIDENCE_UPLOAD_FAILED = :"dispute_evidence.upload_failed" + DISPUTE_TRANSACTION_CREATED = :"dispute_transaction.created" + DISPUTE_TRANSACTION_UPDATED = :"dispute_transaction.updated" + DISPUTE_UPDATED = :"dispute.updated" + EXTERNAL_BANK_ACCOUNT_CREATED = :"external_bank_account.created" + EXTERNAL_BANK_ACCOUNT_UPDATED = :"external_bank_account.updated" + EXTERNAL_PAYMENT_CREATED = :"external_payment.created" + EXTERNAL_PAYMENT_UPDATED = :"external_payment.updated" + FINANCIAL_ACCOUNT_CREATED = :"financial_account.created" + FINANCIAL_ACCOUNT_UPDATED = :"financial_account.updated" + FUNDING_EVENT_CREATED = :"funding_event.created" + INTERNAL_TRANSACTION_CREATED = :"internal_transaction.created" + INTERNAL_TRANSACTION_UPDATED = :"internal_transaction.updated" + LOAN_TAPE_CREATED = :"loan_tape.created" + LOAN_TAPE_UPDATED = :"loan_tape.updated" + MANAGEMENT_OPERATION_CREATED = :"management_operation.created" + MANAGEMENT_OPERATION_UPDATED = :"management_operation.updated" + NETWORK_TOTAL_CREATED = :"network_total.created" + NETWORK_TOTAL_UPDATED = :"network_total.updated" + PAYMENT_TRANSACTION_CREATED = :"payment_transaction.created" + PAYMENT_TRANSACTION_UPDATED = :"payment_transaction.updated" + SETTLEMENT_REPORT_UPDATED = :"settlement_report.updated" + STATEMENTS_CREATED = :"statements.created" + THREE_DS_AUTHENTICATION_CHALLENGE = :"three_ds_authentication.challenge" + THREE_DS_AUTHENTICATION_CREATED = :"three_ds_authentication.created" + THREE_DS_AUTHENTICATION_UPDATED = :"three_ds_authentication.updated" + TOKENIZATION_APPROVAL_REQUEST = :"tokenization.approval_request" + TOKENIZATION_RESULT = :"tokenization.result" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = :"tokenization.two_factor_authentication_code" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = :"tokenization.two_factor_authentication_code_sent" + TOKENIZATION_UPDATED = :"tokenization.updated" + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/external_bank_account.rb b/lib/lithic/models/external_bank_account.rb new file mode 100644 index 00000000..ecbd2c53 --- /dev/null +++ b/lib/lithic/models/external_bank_account.rb @@ -0,0 +1,241 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ExternalBankAccounts#pause + class ExternalBankAccount < Lithic::Internal::Type::BaseModel + # @!attribute token + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + # + # @return [String] + required :token, String + + # @!attribute country + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + # + # @return [String] + required :country, String + + # @!attribute created + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # currency of the external account 3-character alphabetic ISO 4217 code + # + # @return [String] + required :currency, String + + # @!attribute last_four + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + # + # @return [String] + required :last_four, String + + # @!attribute owner + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + # + # @return [String] + required :owner, String + + # @!attribute owner_type + # Owner Type + # + # @return [Symbol, Lithic::Models::OwnerType] + required :owner_type, enum: -> { Lithic::OwnerType } + + # @!attribute routing_number + # Routing Number + # + # @return [String] + required :routing_number, String + + # @!attribute state + # Account State + # + # @return [Symbol, Lithic::Models::ExternalBankAccount::State] + required :state, enum: -> { Lithic::ExternalBankAccount::State } + + # @!attribute type + # Account Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccount::Type] + required :type, enum: -> { Lithic::ExternalBankAccount::Type } + + # @!attribute verification_attempts + # The number of attempts at verification + # + # @return [Integer] + required :verification_attempts, Integer + + # @!attribute verification_method + # Verification Method + # + # @return [Symbol, Lithic::Models::VerificationMethod] + required :verification_method, enum: -> { Lithic::VerificationMethod } + + # @!attribute verification_state + # Verification State + # + # @return [Symbol, Lithic::Models::ExternalBankAccount::VerificationState] + required :verification_state, enum: -> { Lithic::ExternalBankAccount::VerificationState } + + # @!attribute account_token + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + # + # @return [String, nil] + optional :account_token, String, nil?: true + + # @!attribute address + # Address + # + # @return [Lithic::Models::ExternalBankAccountAddress, nil] + optional :address, -> { Lithic::ExternalBankAccountAddress }, nil?: true + + # @!attribute company_id + # Optional field that helps identify bank accounts in receipts + # + # @return [String, nil] + optional :company_id, String, nil?: true + + # @!attribute dob + # Date of Birth of the Individual that owns the external bank account + # + # @return [Date, nil] + optional :dob, Date, nil?: true + + # @!attribute doing_business_as + # Doing Business As + # + # @return [String, nil] + optional :doing_business_as, String, nil?: true + + # @!attribute financial_account_token + # The financial account token of the operating account to fund the micro deposits + # + # @return [String, nil] + optional :financial_account_token, String, nil?: true + + # @!attribute name + # The nickname for this External Bank Account + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute user_defined_id + # User Defined ID + # + # @return [String, nil] + optional :user_defined_id, String, nil?: true + + # @!attribute verification_failed_reason + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + # + # @return [String, nil] + optional :verification_failed_reason, String, nil?: true + + # @!method initialize(token:, country:, created:, currency:, last_four:, owner:, owner_type:, routing_number:, state:, type:, verification_attempts:, verification_method:, verification_state:, account_token: nil, address: nil, company_id: nil, dob: nil, doing_business_as: nil, financial_account_token: nil, name: nil, user_defined_id: nil, verification_failed_reason: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ExternalBankAccount} for more details. + # + # @param token [String] A globally unique identifier for this record of an external bank account associa + # + # @param country [String] The country that the bank account is located in using ISO 3166-1. We will only a + # + # @param created [Time] An ISO 8601 string representing when this funding source was added to the Lithic + # + # @param currency [String] currency of the external account 3-character alphabetic ISO 4217 code + # + # @param last_four [String] The last 4 digits of the bank account. Derived by Lithic from the account number + # + # @param owner [String] Legal Name of the business or individual who owns the external account. This wil + # + # @param owner_type [Symbol, Lithic::Models::OwnerType] Owner Type + # + # @param routing_number [String] Routing Number + # + # @param state [Symbol, Lithic::Models::ExternalBankAccount::State] Account State + # + # @param type [Symbol, Lithic::Models::ExternalBankAccount::Type] Account Type + # + # @param verification_attempts [Integer] The number of attempts at verification + # + # @param verification_method [Symbol, Lithic::Models::VerificationMethod] Verification Method + # + # @param verification_state [Symbol, Lithic::Models::ExternalBankAccount::VerificationState] Verification State + # + # @param account_token [String, nil] Indicates which Lithic account the external account is associated with. For exte + # + # @param address [Lithic::Models::ExternalBankAccountAddress, nil] Address + # + # @param company_id [String, nil] Optional field that helps identify bank accounts in receipts + # + # @param dob [Date, nil] Date of Birth of the Individual that owns the external bank account + # + # @param doing_business_as [String, nil] Doing Business As + # + # @param financial_account_token [String, nil] The financial account token of the operating account to fund the micro deposits + # + # @param name [String, nil] The nickname for this External Bank Account + # + # @param user_defined_id [String, nil] User Defined ID + # + # @param verification_failed_reason [String, nil] Optional free text description of the reason for the failed verification. For AC + + # Account State + # + # @see Lithic::Models::ExternalBankAccount#state + module State + extend Lithic::Internal::Type::Enum + + ENABLED = :ENABLED + CLOSED = :CLOSED + PAUSED = :PAUSED + + # @!method self.values + # @return [Array] + end + + # Account Type + # + # @see Lithic::Models::ExternalBankAccount#type + module Type + extend Lithic::Internal::Type::Enum + + CHECKING = :CHECKING + SAVINGS = :SAVINGS + + # @!method self.values + # @return [Array] + end + + # Verification State + # + # @see Lithic::Models::ExternalBankAccount#verification_state + module VerificationState + extend Lithic::Internal::Type::Enum + + PENDING = :PENDING + ENABLED = :ENABLED + FAILED_VERIFICATION = :FAILED_VERIFICATION + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/external_bank_account_address.rb b/lib/lithic/models/external_bank_account_address.rb new file mode 100644 index 00000000..79bb3355 --- /dev/null +++ b/lib/lithic/models/external_bank_account_address.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalBankAccountAddress < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # + # @return [String] + required :address1, String + + # @!attribute city + # + # @return [String] + required :city, String + + # @!attribute country + # + # @return [String] + required :country, String + + # @!attribute postal_code + # + # @return [String] + required :postal_code, String + + # @!attribute state + # + # @return [String] + required :state, String + + # @!attribute address2 + # + # @return [String, nil] + optional :address2, String, nil?: true + + # @!method initialize(address1:, city:, country:, postal_code:, state:, address2: nil) + # @param address1 [String] + # @param city [String] + # @param country [String] + # @param postal_code [String] + # @param state [String] + # @param address2 [String, nil] + end + end +end diff --git a/lib/lithic/models/external_bank_account_create_params.rb b/lib/lithic/models/external_bank_account_create_params.rb new file mode 100644 index 00000000..3125045e --- /dev/null +++ b/lib/lithic/models/external_bank_account_create_params.rb @@ -0,0 +1,483 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ExternalBankAccounts#create + class ExternalBankAccountCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute body + # + # @return [Lithic::Models::ExternalBankAccountCreateParams::Body::ExternallyVerified, Lithic::Models::ExternalBankAccountCreateParams::Body::Unverified, Lithic::Models::ExternalBankAccountCreateParams::Body::BankVerifiedCreateBankAccountAPIRequest] + required :body, union: -> { Lithic::ExternalBankAccountCreateParams::Body } + + # @!method initialize(body:, request_options: {}) + # @param body [Lithic::Models::ExternalBankAccountCreateParams::Body::ExternallyVerified, Lithic::Models::ExternalBankAccountCreateParams::Body::Unverified, Lithic::Models::ExternalBankAccountCreateParams::Body::BankVerifiedCreateBankAccountAPIRequest] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + module Body + extend Lithic::Internal::Type::Union + + discriminator :verification_method + + variant :EXTERNALLY_VERIFIED, -> { Lithic::ExternalBankAccountCreateParams::Body::ExternallyVerified } + + variant :UNVERIFIED, -> { Lithic::ExternalBankAccountCreateParams::Body::Unverified } + + variant -> { Lithic::ExternalBankAccountCreateParams::Body::BankVerifiedCreateBankAccountAPIRequest } + + class BankVerifiedCreateBankAccountAPIRequest < Lithic::Internal::Type::BaseModel + # @!attribute account_number + # Account Number + # + # @return [String] + required :account_number, String + + # @!attribute country + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + # + # @return [String] + required :country, String + + # @!attribute currency + # currency of the external account 3-character alphabetic ISO 4217 code + # + # @return [String] + required :currency, String + + # @!attribute financial_account_token + # The financial account token of the operating account to fund the micro deposits + # + # @return [String] + required :financial_account_token, String + + # @!attribute owner + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + # + # @return [String] + required :owner, String + + # @!attribute owner_type + # Owner Type + # + # @return [Symbol, Lithic::Models::OwnerType] + required :owner_type, enum: -> { Lithic::OwnerType } + + # @!attribute routing_number + # Routing Number + # + # @return [String] + required :routing_number, String + + # @!attribute type + # Account Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccountCreateParams::Body::BankVerifiedCreateBankAccountAPIRequest::Type] + required :type, + enum: -> { Lithic::ExternalBankAccountCreateParams::Body::BankVerifiedCreateBankAccountAPIRequest::Type } + + # @!attribute verification_method + # Verification Method + # + # @return [Symbol, Lithic::Models::VerificationMethod] + required :verification_method, enum: -> { Lithic::VerificationMethod } + + # @!attribute account_token + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + # + # @return [String, nil] + optional :account_token, String + + # @!attribute address + # Address + # + # @return [Lithic::Models::ExternalBankAccountAddress, nil] + optional :address, -> { Lithic::ExternalBankAccountAddress } + + # @!attribute company_id + # Optional field that helps identify bank accounts in receipts + # + # @return [String, nil] + optional :company_id, String + + # @!attribute dob + # Date of Birth of the Individual that owns the external bank account + # + # @return [Date, nil] + optional :dob, Date + + # @!attribute doing_business_as + # Doing Business As + # + # @return [String, nil] + optional :doing_business_as, String + + # @!attribute name + # The nickname for this External Bank Account + # + # @return [String, nil] + optional :name, String + + # @!attribute user_defined_id + # User Defined ID + # + # @return [String, nil] + optional :user_defined_id, String + + # @!attribute verification_enforcement + # + # @return [Boolean, nil] + optional :verification_enforcement, Lithic::Internal::Type::Boolean + + # @!method initialize(account_number:, country:, currency:, financial_account_token:, owner:, owner_type:, routing_number:, type:, verification_method:, account_token: nil, address: nil, company_id: nil, dob: nil, doing_business_as: nil, name: nil, user_defined_id: nil, verification_enforcement: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ExternalBankAccountCreateParams::Body::BankVerifiedCreateBankAccountAPIRequest} + # for more details. + # + # @param account_number [String] Account Number + # + # @param country [String] The country that the bank account is located in using ISO 3166-1. We will only a + # + # @param currency [String] currency of the external account 3-character alphabetic ISO 4217 code + # + # @param financial_account_token [String] The financial account token of the operating account to fund the micro deposits + # + # @param owner [String] Legal Name of the business or individual who owns the external account. This wil + # + # @param owner_type [Symbol, Lithic::Models::OwnerType] Owner Type + # + # @param routing_number [String] Routing Number + # + # @param type [Symbol, Lithic::Models::ExternalBankAccountCreateParams::Body::BankVerifiedCreateBankAccountAPIRequest::Type] Account Type + # + # @param verification_method [Symbol, Lithic::Models::VerificationMethod] Verification Method + # + # @param account_token [String] Indicates which Lithic account the external account is associated with. For exte + # + # @param address [Lithic::Models::ExternalBankAccountAddress] Address + # + # @param company_id [String] Optional field that helps identify bank accounts in receipts + # + # @param dob [Date] Date of Birth of the Individual that owns the external bank account + # + # @param doing_business_as [String] Doing Business As + # + # @param name [String] The nickname for this External Bank Account + # + # @param user_defined_id [String] User Defined ID + # + # @param verification_enforcement [Boolean] + + # Account Type + # + # @see Lithic::Models::ExternalBankAccountCreateParams::Body::BankVerifiedCreateBankAccountAPIRequest#type + module Type + extend Lithic::Internal::Type::Enum + + CHECKING = :CHECKING + SAVINGS = :SAVINGS + + # @!method self.values + # @return [Array] + end + end + + class ExternallyVerified < Lithic::Internal::Type::BaseModel + # @!attribute account_number + # Account Number + # + # @return [String] + required :account_number, String + + # @!attribute country + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + # + # @return [String] + required :country, String + + # @!attribute currency + # currency of the external account 3-character alphabetic ISO 4217 code + # + # @return [String] + required :currency, String + + # @!attribute owner + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + # + # @return [String] + required :owner, String + + # @!attribute owner_type + # Owner Type + # + # @return [Symbol, Lithic::Models::OwnerType] + required :owner_type, enum: -> { Lithic::OwnerType } + + # @!attribute routing_number + # Routing Number + # + # @return [String] + required :routing_number, String + + # @!attribute type + # Account Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccountCreateParams::Body::ExternallyVerified::Type] + required :type, enum: -> { Lithic::ExternalBankAccountCreateParams::Body::ExternallyVerified::Type } + + # @!attribute verification_method + # Verification Method + # + # @return [Symbol, :EXTERNALLY_VERIFIED] + required :verification_method, const: :EXTERNALLY_VERIFIED + + # @!attribute account_token + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + # + # @return [String, nil] + optional :account_token, String + + # @!attribute address + # Address + # + # @return [Lithic::Models::ExternalBankAccountAddress, nil] + optional :address, -> { Lithic::ExternalBankAccountAddress } + + # @!attribute company_id + # Optional field that helps identify bank accounts in receipts + # + # @return [String, nil] + optional :company_id, String + + # @!attribute dob + # Date of Birth of the Individual that owns the external bank account + # + # @return [Date, nil] + optional :dob, Date + + # @!attribute doing_business_as + # Doing Business As + # + # @return [String, nil] + optional :doing_business_as, String + + # @!attribute name + # The nickname for this External Bank Account + # + # @return [String, nil] + optional :name, String + + # @!attribute user_defined_id + # User Defined ID + # + # @return [String, nil] + optional :user_defined_id, String + + # @!method initialize(account_number:, country:, currency:, owner:, owner_type:, routing_number:, type:, account_token: nil, address: nil, company_id: nil, dob: nil, doing_business_as: nil, name: nil, user_defined_id: nil, verification_method: :EXTERNALLY_VERIFIED) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ExternalBankAccountCreateParams::Body::ExternallyVerified} for + # more details. + # + # @param account_number [String] Account Number + # + # @param country [String] The country that the bank account is located in using ISO 3166-1. We will only a + # + # @param currency [String] currency of the external account 3-character alphabetic ISO 4217 code + # + # @param owner [String] Legal Name of the business or individual who owns the external account. This wil + # + # @param owner_type [Symbol, Lithic::Models::OwnerType] Owner Type + # + # @param routing_number [String] Routing Number + # + # @param type [Symbol, Lithic::Models::ExternalBankAccountCreateParams::Body::ExternallyVerified::Type] Account Type + # + # @param account_token [String] Indicates which Lithic account the external account is associated with. For exte + # + # @param address [Lithic::Models::ExternalBankAccountAddress] Address + # + # @param company_id [String] Optional field that helps identify bank accounts in receipts + # + # @param dob [Date] Date of Birth of the Individual that owns the external bank account + # + # @param doing_business_as [String] Doing Business As + # + # @param name [String] The nickname for this External Bank Account + # + # @param user_defined_id [String] User Defined ID + # + # @param verification_method [Symbol, :EXTERNALLY_VERIFIED] Verification Method + + # Account Type + # + # @see Lithic::Models::ExternalBankAccountCreateParams::Body::ExternallyVerified#type + module Type + extend Lithic::Internal::Type::Enum + + CHECKING = :CHECKING + SAVINGS = :SAVINGS + + # @!method self.values + # @return [Array] + end + end + + class Unverified < Lithic::Internal::Type::BaseModel + # @!attribute account_number + # Account Number + # + # @return [String] + required :account_number, String + + # @!attribute country + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + # + # @return [String] + required :country, String + + # @!attribute currency + # currency of the external account 3-character alphabetic ISO 4217 code + # + # @return [String] + required :currency, String + + # @!attribute owner + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + # + # @return [String] + required :owner, String + + # @!attribute owner_type + # Owner Type + # + # @return [Symbol, Lithic::Models::OwnerType] + required :owner_type, enum: -> { Lithic::OwnerType } + + # @!attribute routing_number + # Routing Number + # + # @return [String] + required :routing_number, String + + # @!attribute type + # Account Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccountCreateParams::Body::Unverified::Type] + required :type, enum: -> { Lithic::ExternalBankAccountCreateParams::Body::Unverified::Type } + + # @!attribute verification_method + # Verification Method + # + # @return [Symbol, :UNVERIFIED] + required :verification_method, const: :UNVERIFIED + + # @!attribute account_token + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + # + # @return [String, nil] + optional :account_token, String + + # @!attribute address + # Address + # + # @return [Lithic::Models::ExternalBankAccountAddress, nil] + optional :address, -> { Lithic::ExternalBankAccountAddress } + + # @!attribute company_id + # Optional field that helps identify bank accounts in receipts + # + # @return [String, nil] + optional :company_id, String + + # @!attribute dob + # Date of Birth of the Individual that owns the external bank account + # + # @return [Date, nil] + optional :dob, Date + + # @!attribute doing_business_as + # Doing Business As + # + # @return [String, nil] + optional :doing_business_as, String + + # @!attribute name + # The nickname for this External Bank Account + # + # @return [String, nil] + optional :name, String + + # @!attribute user_defined_id + # User Defined ID + # + # @return [String, nil] + optional :user_defined_id, String + + # @!method initialize(account_number:, country:, currency:, owner:, owner_type:, routing_number:, type:, account_token: nil, address: nil, company_id: nil, dob: nil, doing_business_as: nil, name: nil, user_defined_id: nil, verification_method: :UNVERIFIED) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ExternalBankAccountCreateParams::Body::Unverified} for more + # details. + # + # @param account_number [String] Account Number + # + # @param country [String] The country that the bank account is located in using ISO 3166-1. We will only a + # + # @param currency [String] currency of the external account 3-character alphabetic ISO 4217 code + # + # @param owner [String] Legal Name of the business or individual who owns the external account. This wil + # + # @param owner_type [Symbol, Lithic::Models::OwnerType] Owner Type + # + # @param routing_number [String] Routing Number + # + # @param type [Symbol, Lithic::Models::ExternalBankAccountCreateParams::Body::Unverified::Type] Account Type + # + # @param account_token [String] Indicates which Lithic account the external account is associated with. For exte + # + # @param address [Lithic::Models::ExternalBankAccountAddress] Address + # + # @param company_id [String] Optional field that helps identify bank accounts in receipts + # + # @param dob [Date] Date of Birth of the Individual that owns the external bank account + # + # @param doing_business_as [String] Doing Business As + # + # @param name [String] The nickname for this External Bank Account + # + # @param user_defined_id [String] User Defined ID + # + # @param verification_method [Symbol, :UNVERIFIED] Verification Method + + # Account Type + # + # @see Lithic::Models::ExternalBankAccountCreateParams::Body::Unverified#type + module Type + extend Lithic::Internal::Type::Enum + + CHECKING = :CHECKING + SAVINGS = :SAVINGS + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(Lithic::Models::ExternalBankAccountCreateParams::Body::ExternallyVerified, Lithic::Models::ExternalBankAccountCreateParams::Body::Unverified, Lithic::Models::ExternalBankAccountCreateParams::Body::BankVerifiedCreateBankAccountAPIRequest)] + end + end + end +end diff --git a/lib/lithic/models/external_bank_account_create_response.rb b/lib/lithic/models/external_bank_account_create_response.rb new file mode 100644 index 00000000..88db5ccb --- /dev/null +++ b/lib/lithic/models/external_bank_account_create_response.rb @@ -0,0 +1,271 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ExternalBankAccounts#create + class ExternalBankAccountCreateResponse < Lithic::Internal::Type::BaseModel + # @!attribute token + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + # + # @return [String] + required :token, String + + # @!attribute country + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + # + # @return [String] + required :country, String + + # @!attribute created + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # currency of the external account 3-character alphabetic ISO 4217 code + # + # @return [String] + required :currency, String + + # @!attribute last_four + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + # + # @return [String] + required :last_four, String + + # @!attribute owner + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + # + # @return [String] + required :owner, String + + # @!attribute owner_type + # Owner Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccountCreateResponse::OwnerType] + required :owner_type, enum: -> { Lithic::Models::ExternalBankAccountCreateResponse::OwnerType } + + # @!attribute routing_number + # Routing Number + # + # @return [String] + required :routing_number, String + + # @!attribute state + # Account State + # + # @return [Symbol, Lithic::Models::ExternalBankAccountCreateResponse::State] + required :state, enum: -> { Lithic::Models::ExternalBankAccountCreateResponse::State } + + # @!attribute type + # Account Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccountCreateResponse::Type] + required :type, enum: -> { Lithic::Models::ExternalBankAccountCreateResponse::Type } + + # @!attribute verification_attempts + # The number of attempts at verification + # + # @return [Integer] + required :verification_attempts, Integer + + # @!attribute verification_method + # Verification Method + # + # @return [Symbol, Lithic::Models::ExternalBankAccountCreateResponse::VerificationMethod] + required :verification_method, + enum: -> { Lithic::Models::ExternalBankAccountCreateResponse::VerificationMethod } + + # @!attribute verification_state + # Verification State + # + # @return [Symbol, Lithic::Models::ExternalBankAccountCreateResponse::VerificationState] + required :verification_state, + enum: -> { Lithic::Models::ExternalBankAccountCreateResponse::VerificationState } + + # @!attribute account_token + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + # + # @return [String, nil] + optional :account_token, String, nil?: true + + # @!attribute address + # Address + # + # @return [Lithic::Models::ExternalBankAccountAddress, nil] + optional :address, -> { Lithic::ExternalBankAccountAddress }, nil?: true + + # @!attribute company_id + # Optional field that helps identify bank accounts in receipts + # + # @return [String, nil] + optional :company_id, String, nil?: true + + # @!attribute dob + # Date of Birth of the Individual that owns the external bank account + # + # @return [Date, nil] + optional :dob, Date, nil?: true + + # @!attribute doing_business_as + # Doing Business As + # + # @return [String, nil] + optional :doing_business_as, String, nil?: true + + # @!attribute financial_account_token + # The financial account token of the operating account to fund the micro deposits + # + # @return [String, nil] + optional :financial_account_token, String, nil?: true + + # @!attribute name + # The nickname for this External Bank Account + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute user_defined_id + # User Defined ID + # + # @return [String, nil] + optional :user_defined_id, String, nil?: true + + # @!attribute verification_failed_reason + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + # + # @return [String, nil] + optional :verification_failed_reason, String, nil?: true + + # @!method initialize(token:, country:, created:, currency:, last_four:, owner:, owner_type:, routing_number:, state:, type:, verification_attempts:, verification_method:, verification_state:, account_token: nil, address: nil, company_id: nil, dob: nil, doing_business_as: nil, financial_account_token: nil, name: nil, user_defined_id: nil, verification_failed_reason: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ExternalBankAccountCreateResponse} for more details. + # + # @param token [String] A globally unique identifier for this record of an external bank account associa + # + # @param country [String] The country that the bank account is located in using ISO 3166-1. We will only a + # + # @param created [Time] An ISO 8601 string representing when this funding source was added to the Lithic + # + # @param currency [String] currency of the external account 3-character alphabetic ISO 4217 code + # + # @param last_four [String] The last 4 digits of the bank account. Derived by Lithic from the account number + # + # @param owner [String] Legal Name of the business or individual who owns the external account. This wil + # + # @param owner_type [Symbol, Lithic::Models::ExternalBankAccountCreateResponse::OwnerType] Owner Type + # + # @param routing_number [String] Routing Number + # + # @param state [Symbol, Lithic::Models::ExternalBankAccountCreateResponse::State] Account State + # + # @param type [Symbol, Lithic::Models::ExternalBankAccountCreateResponse::Type] Account Type + # + # @param verification_attempts [Integer] The number of attempts at verification + # + # @param verification_method [Symbol, Lithic::Models::ExternalBankAccountCreateResponse::VerificationMethod] Verification Method + # + # @param verification_state [Symbol, Lithic::Models::ExternalBankAccountCreateResponse::VerificationState] Verification State + # + # @param account_token [String, nil] Indicates which Lithic account the external account is associated with. For exte + # + # @param address [Lithic::Models::ExternalBankAccountAddress, nil] Address + # + # @param company_id [String, nil] Optional field that helps identify bank accounts in receipts + # + # @param dob [Date, nil] Date of Birth of the Individual that owns the external bank account + # + # @param doing_business_as [String, nil] Doing Business As + # + # @param financial_account_token [String, nil] The financial account token of the operating account to fund the micro deposits + # + # @param name [String, nil] The nickname for this External Bank Account + # + # @param user_defined_id [String, nil] User Defined ID + # + # @param verification_failed_reason [String, nil] Optional free text description of the reason for the failed verification. For AC + + # Owner Type + # + # @see Lithic::Models::ExternalBankAccountCreateResponse#owner_type + module OwnerType + extend Lithic::Internal::Type::Enum + + BUSINESS = :BUSINESS + INDIVIDUAL = :INDIVIDUAL + + # @!method self.values + # @return [Array] + end + + # Account State + # + # @see Lithic::Models::ExternalBankAccountCreateResponse#state + module State + extend Lithic::Internal::Type::Enum + + ENABLED = :ENABLED + CLOSED = :CLOSED + PAUSED = :PAUSED + + # @!method self.values + # @return [Array] + end + + # Account Type + # + # @see Lithic::Models::ExternalBankAccountCreateResponse#type + module Type + extend Lithic::Internal::Type::Enum + + CHECKING = :CHECKING + SAVINGS = :SAVINGS + + # @!method self.values + # @return [Array] + end + + # Verification Method + # + # @see Lithic::Models::ExternalBankAccountCreateResponse#verification_method + module VerificationMethod + extend Lithic::Internal::Type::Enum + + MANUAL = :MANUAL + MICRO_DEPOSIT = :MICRO_DEPOSIT + PLAID = :PLAID + PRENOTE = :PRENOTE + + # @!method self.values + # @return [Array] + end + + # Verification State + # + # @see Lithic::Models::ExternalBankAccountCreateResponse#verification_state + module VerificationState + extend Lithic::Internal::Type::Enum + + PENDING = :PENDING + ENABLED = :ENABLED + FAILED_VERIFICATION = :FAILED_VERIFICATION + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/external_bank_account_created_webhook_event.rb b/lib/lithic/models/external_bank_account_created_webhook_event.rb new file mode 100644 index 00000000..61680c3c --- /dev/null +++ b/lib/lithic/models/external_bank_account_created_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalBankAccountCreatedWebhookEvent < Lithic::Models::ExternalBankAccount + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"external_bank_account.created"] + required :event_type, const: :"external_bank_account.created" + + # @!method initialize(event_type: :"external_bank_account.created") + # @param event_type [Symbol, :"external_bank_account.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/external_bank_account_list_params.rb b/lib/lithic/models/external_bank_account_list_params.rb new file mode 100644 index 00000000..f28cc975 --- /dev/null +++ b/lib/lithic/models/external_bank_account_list_params.rb @@ -0,0 +1,121 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ExternalBankAccounts#list + class ExternalBankAccountListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute account_token + # + # @return [String, nil] + optional :account_token, String + + # @!attribute account_types + # + # @return [Array, nil] + optional :account_types, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::ExternalBankAccountListParams::AccountType] } + + # @!attribute countries + # + # @return [Array, nil] + optional :countries, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute owner_types + # + # @return [Array, nil] + optional :owner_types, -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::OwnerType] } + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!attribute states + # + # @return [Array, nil] + optional :states, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::ExternalBankAccountListParams::State] } + + # @!attribute verification_states + # + # @return [Array, nil] + optional :verification_states, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::ExternalBankAccountListParams::VerificationState] } + + # @!method initialize(account_token: nil, account_types: nil, countries: nil, ending_before: nil, owner_types: nil, page_size: nil, starting_after: nil, states: nil, verification_states: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ExternalBankAccountListParams} for more details. + # + # @param account_token [String] + # + # @param account_types [Array] + # + # @param countries [Array] + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param owner_types [Array] + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param states [Array] + # + # @param verification_states [Array] + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + module AccountType + extend Lithic::Internal::Type::Enum + + CHECKING = :CHECKING + SAVINGS = :SAVINGS + + # @!method self.values + # @return [Array] + end + + module State + extend Lithic::Internal::Type::Enum + + ENABLED = :ENABLED + CLOSED = :CLOSED + PAUSED = :PAUSED + + # @!method self.values + # @return [Array] + end + + module VerificationState + extend Lithic::Internal::Type::Enum + + PENDING = :PENDING + ENABLED = :ENABLED + FAILED_VERIFICATION = :FAILED_VERIFICATION + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/external_bank_account_list_response.rb b/lib/lithic/models/external_bank_account_list_response.rb new file mode 100644 index 00000000..fa2f6307 --- /dev/null +++ b/lib/lithic/models/external_bank_account_list_response.rb @@ -0,0 +1,271 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ExternalBankAccounts#list + class ExternalBankAccountListResponse < Lithic::Internal::Type::BaseModel + # @!attribute token + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + # + # @return [String] + required :token, String + + # @!attribute country + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + # + # @return [String] + required :country, String + + # @!attribute created + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # currency of the external account 3-character alphabetic ISO 4217 code + # + # @return [String] + required :currency, String + + # @!attribute last_four + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + # + # @return [String] + required :last_four, String + + # @!attribute owner + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + # + # @return [String] + required :owner, String + + # @!attribute owner_type + # Owner Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccountListResponse::OwnerType] + required :owner_type, enum: -> { Lithic::Models::ExternalBankAccountListResponse::OwnerType } + + # @!attribute routing_number + # Routing Number + # + # @return [String] + required :routing_number, String + + # @!attribute state + # Account State + # + # @return [Symbol, Lithic::Models::ExternalBankAccountListResponse::State] + required :state, enum: -> { Lithic::Models::ExternalBankAccountListResponse::State } + + # @!attribute type + # Account Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccountListResponse::Type] + required :type, enum: -> { Lithic::Models::ExternalBankAccountListResponse::Type } + + # @!attribute verification_attempts + # The number of attempts at verification + # + # @return [Integer] + required :verification_attempts, Integer + + # @!attribute verification_method + # Verification Method + # + # @return [Symbol, Lithic::Models::ExternalBankAccountListResponse::VerificationMethod] + required :verification_method, + enum: -> { Lithic::Models::ExternalBankAccountListResponse::VerificationMethod } + + # @!attribute verification_state + # Verification State + # + # @return [Symbol, Lithic::Models::ExternalBankAccountListResponse::VerificationState] + required :verification_state, + enum: -> { Lithic::Models::ExternalBankAccountListResponse::VerificationState } + + # @!attribute account_token + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + # + # @return [String, nil] + optional :account_token, String, nil?: true + + # @!attribute address + # Address + # + # @return [Lithic::Models::ExternalBankAccountAddress, nil] + optional :address, -> { Lithic::ExternalBankAccountAddress }, nil?: true + + # @!attribute company_id + # Optional field that helps identify bank accounts in receipts + # + # @return [String, nil] + optional :company_id, String, nil?: true + + # @!attribute dob + # Date of Birth of the Individual that owns the external bank account + # + # @return [Date, nil] + optional :dob, Date, nil?: true + + # @!attribute doing_business_as + # Doing Business As + # + # @return [String, nil] + optional :doing_business_as, String, nil?: true + + # @!attribute financial_account_token + # The financial account token of the operating account to fund the micro deposits + # + # @return [String, nil] + optional :financial_account_token, String, nil?: true + + # @!attribute name + # The nickname for this External Bank Account + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute user_defined_id + # User Defined ID + # + # @return [String, nil] + optional :user_defined_id, String, nil?: true + + # @!attribute verification_failed_reason + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + # + # @return [String, nil] + optional :verification_failed_reason, String, nil?: true + + # @!method initialize(token:, country:, created:, currency:, last_four:, owner:, owner_type:, routing_number:, state:, type:, verification_attempts:, verification_method:, verification_state:, account_token: nil, address: nil, company_id: nil, dob: nil, doing_business_as: nil, financial_account_token: nil, name: nil, user_defined_id: nil, verification_failed_reason: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ExternalBankAccountListResponse} for more details. + # + # @param token [String] A globally unique identifier for this record of an external bank account associa + # + # @param country [String] The country that the bank account is located in using ISO 3166-1. We will only a + # + # @param created [Time] An ISO 8601 string representing when this funding source was added to the Lithic + # + # @param currency [String] currency of the external account 3-character alphabetic ISO 4217 code + # + # @param last_four [String] The last 4 digits of the bank account. Derived by Lithic from the account number + # + # @param owner [String] Legal Name of the business or individual who owns the external account. This wil + # + # @param owner_type [Symbol, Lithic::Models::ExternalBankAccountListResponse::OwnerType] Owner Type + # + # @param routing_number [String] Routing Number + # + # @param state [Symbol, Lithic::Models::ExternalBankAccountListResponse::State] Account State + # + # @param type [Symbol, Lithic::Models::ExternalBankAccountListResponse::Type] Account Type + # + # @param verification_attempts [Integer] The number of attempts at verification + # + # @param verification_method [Symbol, Lithic::Models::ExternalBankAccountListResponse::VerificationMethod] Verification Method + # + # @param verification_state [Symbol, Lithic::Models::ExternalBankAccountListResponse::VerificationState] Verification State + # + # @param account_token [String, nil] Indicates which Lithic account the external account is associated with. For exte + # + # @param address [Lithic::Models::ExternalBankAccountAddress, nil] Address + # + # @param company_id [String, nil] Optional field that helps identify bank accounts in receipts + # + # @param dob [Date, nil] Date of Birth of the Individual that owns the external bank account + # + # @param doing_business_as [String, nil] Doing Business As + # + # @param financial_account_token [String, nil] The financial account token of the operating account to fund the micro deposits + # + # @param name [String, nil] The nickname for this External Bank Account + # + # @param user_defined_id [String, nil] User Defined ID + # + # @param verification_failed_reason [String, nil] Optional free text description of the reason for the failed verification. For AC + + # Owner Type + # + # @see Lithic::Models::ExternalBankAccountListResponse#owner_type + module OwnerType + extend Lithic::Internal::Type::Enum + + BUSINESS = :BUSINESS + INDIVIDUAL = :INDIVIDUAL + + # @!method self.values + # @return [Array] + end + + # Account State + # + # @see Lithic::Models::ExternalBankAccountListResponse#state + module State + extend Lithic::Internal::Type::Enum + + ENABLED = :ENABLED + CLOSED = :CLOSED + PAUSED = :PAUSED + + # @!method self.values + # @return [Array] + end + + # Account Type + # + # @see Lithic::Models::ExternalBankAccountListResponse#type + module Type + extend Lithic::Internal::Type::Enum + + CHECKING = :CHECKING + SAVINGS = :SAVINGS + + # @!method self.values + # @return [Array] + end + + # Verification Method + # + # @see Lithic::Models::ExternalBankAccountListResponse#verification_method + module VerificationMethod + extend Lithic::Internal::Type::Enum + + MANUAL = :MANUAL + MICRO_DEPOSIT = :MICRO_DEPOSIT + PLAID = :PLAID + PRENOTE = :PRENOTE + + # @!method self.values + # @return [Array] + end + + # Verification State + # + # @see Lithic::Models::ExternalBankAccountListResponse#verification_state + module VerificationState + extend Lithic::Internal::Type::Enum + + PENDING = :PENDING + ENABLED = :ENABLED + FAILED_VERIFICATION = :FAILED_VERIFICATION + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/external_bank_account_pause_params.rb b/lib/lithic/models/external_bank_account_pause_params.rb new file mode 100644 index 00000000..c620e1c8 --- /dev/null +++ b/lib/lithic/models/external_bank_account_pause_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ExternalBankAccounts#pause + class ExternalBankAccountPauseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute external_bank_account_token + # + # @return [String] + required :external_bank_account_token, String + + # @!method initialize(external_bank_account_token:, request_options: {}) + # @param external_bank_account_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/external_bank_account_retrieve_params.rb b/lib/lithic/models/external_bank_account_retrieve_params.rb new file mode 100644 index 00000000..af342144 --- /dev/null +++ b/lib/lithic/models/external_bank_account_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ExternalBankAccounts#retrieve + class ExternalBankAccountRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute external_bank_account_token + # + # @return [String] + required :external_bank_account_token, String + + # @!method initialize(external_bank_account_token:, request_options: {}) + # @param external_bank_account_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/external_bank_account_retrieve_response.rb b/lib/lithic/models/external_bank_account_retrieve_response.rb new file mode 100644 index 00000000..eea54399 --- /dev/null +++ b/lib/lithic/models/external_bank_account_retrieve_response.rb @@ -0,0 +1,271 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ExternalBankAccounts#retrieve + class ExternalBankAccountRetrieveResponse < Lithic::Internal::Type::BaseModel + # @!attribute token + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + # + # @return [String] + required :token, String + + # @!attribute country + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + # + # @return [String] + required :country, String + + # @!attribute created + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # currency of the external account 3-character alphabetic ISO 4217 code + # + # @return [String] + required :currency, String + + # @!attribute last_four + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + # + # @return [String] + required :last_four, String + + # @!attribute owner + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + # + # @return [String] + required :owner, String + + # @!attribute owner_type + # Owner Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::OwnerType] + required :owner_type, enum: -> { Lithic::Models::ExternalBankAccountRetrieveResponse::OwnerType } + + # @!attribute routing_number + # Routing Number + # + # @return [String] + required :routing_number, String + + # @!attribute state + # Account State + # + # @return [Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::State] + required :state, enum: -> { Lithic::Models::ExternalBankAccountRetrieveResponse::State } + + # @!attribute type + # Account Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::Type] + required :type, enum: -> { Lithic::Models::ExternalBankAccountRetrieveResponse::Type } + + # @!attribute verification_attempts + # The number of attempts at verification + # + # @return [Integer] + required :verification_attempts, Integer + + # @!attribute verification_method + # Verification Method + # + # @return [Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationMethod] + required :verification_method, + enum: -> { Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationMethod } + + # @!attribute verification_state + # Verification State + # + # @return [Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationState] + required :verification_state, + enum: -> { Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationState } + + # @!attribute account_token + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + # + # @return [String, nil] + optional :account_token, String, nil?: true + + # @!attribute address + # Address + # + # @return [Lithic::Models::ExternalBankAccountAddress, nil] + optional :address, -> { Lithic::ExternalBankAccountAddress }, nil?: true + + # @!attribute company_id + # Optional field that helps identify bank accounts in receipts + # + # @return [String, nil] + optional :company_id, String, nil?: true + + # @!attribute dob + # Date of Birth of the Individual that owns the external bank account + # + # @return [Date, nil] + optional :dob, Date, nil?: true + + # @!attribute doing_business_as + # Doing Business As + # + # @return [String, nil] + optional :doing_business_as, String, nil?: true + + # @!attribute financial_account_token + # The financial account token of the operating account to fund the micro deposits + # + # @return [String, nil] + optional :financial_account_token, String, nil?: true + + # @!attribute name + # The nickname for this External Bank Account + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute user_defined_id + # User Defined ID + # + # @return [String, nil] + optional :user_defined_id, String, nil?: true + + # @!attribute verification_failed_reason + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + # + # @return [String, nil] + optional :verification_failed_reason, String, nil?: true + + # @!method initialize(token:, country:, created:, currency:, last_four:, owner:, owner_type:, routing_number:, state:, type:, verification_attempts:, verification_method:, verification_state:, account_token: nil, address: nil, company_id: nil, dob: nil, doing_business_as: nil, financial_account_token: nil, name: nil, user_defined_id: nil, verification_failed_reason: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ExternalBankAccountRetrieveResponse} for more details. + # + # @param token [String] A globally unique identifier for this record of an external bank account associa + # + # @param country [String] The country that the bank account is located in using ISO 3166-1. We will only a + # + # @param created [Time] An ISO 8601 string representing when this funding source was added to the Lithic + # + # @param currency [String] currency of the external account 3-character alphabetic ISO 4217 code + # + # @param last_four [String] The last 4 digits of the bank account. Derived by Lithic from the account number + # + # @param owner [String] Legal Name of the business or individual who owns the external account. This wil + # + # @param owner_type [Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::OwnerType] Owner Type + # + # @param routing_number [String] Routing Number + # + # @param state [Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::State] Account State + # + # @param type [Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::Type] Account Type + # + # @param verification_attempts [Integer] The number of attempts at verification + # + # @param verification_method [Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationMethod] Verification Method + # + # @param verification_state [Symbol, Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationState] Verification State + # + # @param account_token [String, nil] Indicates which Lithic account the external account is associated with. For exte + # + # @param address [Lithic::Models::ExternalBankAccountAddress, nil] Address + # + # @param company_id [String, nil] Optional field that helps identify bank accounts in receipts + # + # @param dob [Date, nil] Date of Birth of the Individual that owns the external bank account + # + # @param doing_business_as [String, nil] Doing Business As + # + # @param financial_account_token [String, nil] The financial account token of the operating account to fund the micro deposits + # + # @param name [String, nil] The nickname for this External Bank Account + # + # @param user_defined_id [String, nil] User Defined ID + # + # @param verification_failed_reason [String, nil] Optional free text description of the reason for the failed verification. For AC + + # Owner Type + # + # @see Lithic::Models::ExternalBankAccountRetrieveResponse#owner_type + module OwnerType + extend Lithic::Internal::Type::Enum + + BUSINESS = :BUSINESS + INDIVIDUAL = :INDIVIDUAL + + # @!method self.values + # @return [Array] + end + + # Account State + # + # @see Lithic::Models::ExternalBankAccountRetrieveResponse#state + module State + extend Lithic::Internal::Type::Enum + + ENABLED = :ENABLED + CLOSED = :CLOSED + PAUSED = :PAUSED + + # @!method self.values + # @return [Array] + end + + # Account Type + # + # @see Lithic::Models::ExternalBankAccountRetrieveResponse#type + module Type + extend Lithic::Internal::Type::Enum + + CHECKING = :CHECKING + SAVINGS = :SAVINGS + + # @!method self.values + # @return [Array] + end + + # Verification Method + # + # @see Lithic::Models::ExternalBankAccountRetrieveResponse#verification_method + module VerificationMethod + extend Lithic::Internal::Type::Enum + + MANUAL = :MANUAL + MICRO_DEPOSIT = :MICRO_DEPOSIT + PLAID = :PLAID + PRENOTE = :PRENOTE + + # @!method self.values + # @return [Array] + end + + # Verification State + # + # @see Lithic::Models::ExternalBankAccountRetrieveResponse#verification_state + module VerificationState + extend Lithic::Internal::Type::Enum + + PENDING = :PENDING + ENABLED = :ENABLED + FAILED_VERIFICATION = :FAILED_VERIFICATION + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/external_bank_account_retry_micro_deposits_params.rb b/lib/lithic/models/external_bank_account_retry_micro_deposits_params.rb new file mode 100644 index 00000000..a8a6d3f0 --- /dev/null +++ b/lib/lithic/models/external_bank_account_retry_micro_deposits_params.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ExternalBankAccounts#retry_micro_deposits + class ExternalBankAccountRetryMicroDepositsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute external_bank_account_token + # + # @return [String] + required :external_bank_account_token, String + + # @!attribute financial_account_token + # + # @return [String, nil] + optional :financial_account_token, String + + # @!method initialize(external_bank_account_token:, financial_account_token: nil, request_options: {}) + # @param external_bank_account_token [String] + # @param financial_account_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/external_bank_account_retry_micro_deposits_response.rb b/lib/lithic/models/external_bank_account_retry_micro_deposits_response.rb new file mode 100644 index 00000000..21b247bb --- /dev/null +++ b/lib/lithic/models/external_bank_account_retry_micro_deposits_response.rb @@ -0,0 +1,273 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ExternalBankAccounts#retry_micro_deposits + class ExternalBankAccountRetryMicroDepositsResponse < Lithic::Internal::Type::BaseModel + # @!attribute token + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + # + # @return [String] + required :token, String + + # @!attribute country + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + # + # @return [String] + required :country, String + + # @!attribute created + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # currency of the external account 3-character alphabetic ISO 4217 code + # + # @return [String] + required :currency, String + + # @!attribute last_four + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + # + # @return [String] + required :last_four, String + + # @!attribute owner + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + # + # @return [String] + required :owner, String + + # @!attribute owner_type + # Owner Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::OwnerType] + required :owner_type, + enum: -> { Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::OwnerType } + + # @!attribute routing_number + # Routing Number + # + # @return [String] + required :routing_number, String + + # @!attribute state + # Account State + # + # @return [Symbol, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::State] + required :state, enum: -> { Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::State } + + # @!attribute type + # Account Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::Type] + required :type, enum: -> { Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::Type } + + # @!attribute verification_attempts + # The number of attempts at verification + # + # @return [Integer] + required :verification_attempts, Integer + + # @!attribute verification_method + # Verification Method + # + # @return [Symbol, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationMethod] + required :verification_method, + enum: -> { Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationMethod } + + # @!attribute verification_state + # Verification State + # + # @return [Symbol, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationState] + required :verification_state, + enum: -> { Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationState } + + # @!attribute account_token + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + # + # @return [String, nil] + optional :account_token, String, nil?: true + + # @!attribute address + # Address + # + # @return [Lithic::Models::ExternalBankAccountAddress, nil] + optional :address, -> { Lithic::ExternalBankAccountAddress }, nil?: true + + # @!attribute company_id + # Optional field that helps identify bank accounts in receipts + # + # @return [String, nil] + optional :company_id, String, nil?: true + + # @!attribute dob + # Date of Birth of the Individual that owns the external bank account + # + # @return [Date, nil] + optional :dob, Date, nil?: true + + # @!attribute doing_business_as + # Doing Business As + # + # @return [String, nil] + optional :doing_business_as, String, nil?: true + + # @!attribute financial_account_token + # The financial account token of the operating account to fund the micro deposits + # + # @return [String, nil] + optional :financial_account_token, String, nil?: true + + # @!attribute name + # The nickname for this External Bank Account + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute user_defined_id + # User Defined ID + # + # @return [String, nil] + optional :user_defined_id, String, nil?: true + + # @!attribute verification_failed_reason + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + # + # @return [String, nil] + optional :verification_failed_reason, String, nil?: true + + # @!method initialize(token:, country:, created:, currency:, last_four:, owner:, owner_type:, routing_number:, state:, type:, verification_attempts:, verification_method:, verification_state:, account_token: nil, address: nil, company_id: nil, dob: nil, doing_business_as: nil, financial_account_token: nil, name: nil, user_defined_id: nil, verification_failed_reason: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse} for more + # details. + # + # @param token [String] A globally unique identifier for this record of an external bank account associa + # + # @param country [String] The country that the bank account is located in using ISO 3166-1. We will only a + # + # @param created [Time] An ISO 8601 string representing when this funding source was added to the Lithic + # + # @param currency [String] currency of the external account 3-character alphabetic ISO 4217 code + # + # @param last_four [String] The last 4 digits of the bank account. Derived by Lithic from the account number + # + # @param owner [String] Legal Name of the business or individual who owns the external account. This wil + # + # @param owner_type [Symbol, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::OwnerType] Owner Type + # + # @param routing_number [String] Routing Number + # + # @param state [Symbol, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::State] Account State + # + # @param type [Symbol, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::Type] Account Type + # + # @param verification_attempts [Integer] The number of attempts at verification + # + # @param verification_method [Symbol, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationMethod] Verification Method + # + # @param verification_state [Symbol, Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationState] Verification State + # + # @param account_token [String, nil] Indicates which Lithic account the external account is associated with. For exte + # + # @param address [Lithic::Models::ExternalBankAccountAddress, nil] Address + # + # @param company_id [String, nil] Optional field that helps identify bank accounts in receipts + # + # @param dob [Date, nil] Date of Birth of the Individual that owns the external bank account + # + # @param doing_business_as [String, nil] Doing Business As + # + # @param financial_account_token [String, nil] The financial account token of the operating account to fund the micro deposits + # + # @param name [String, nil] The nickname for this External Bank Account + # + # @param user_defined_id [String, nil] User Defined ID + # + # @param verification_failed_reason [String, nil] Optional free text description of the reason for the failed verification. For AC + + # Owner Type + # + # @see Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse#owner_type + module OwnerType + extend Lithic::Internal::Type::Enum + + BUSINESS = :BUSINESS + INDIVIDUAL = :INDIVIDUAL + + # @!method self.values + # @return [Array] + end + + # Account State + # + # @see Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse#state + module State + extend Lithic::Internal::Type::Enum + + ENABLED = :ENABLED + CLOSED = :CLOSED + PAUSED = :PAUSED + + # @!method self.values + # @return [Array] + end + + # Account Type + # + # @see Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse#type + module Type + extend Lithic::Internal::Type::Enum + + CHECKING = :CHECKING + SAVINGS = :SAVINGS + + # @!method self.values + # @return [Array] + end + + # Verification Method + # + # @see Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse#verification_method + module VerificationMethod + extend Lithic::Internal::Type::Enum + + MANUAL = :MANUAL + MICRO_DEPOSIT = :MICRO_DEPOSIT + PLAID = :PLAID + PRENOTE = :PRENOTE + + # @!method self.values + # @return [Array] + end + + # Verification State + # + # @see Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse#verification_state + module VerificationState + extend Lithic::Internal::Type::Enum + + PENDING = :PENDING + ENABLED = :ENABLED + FAILED_VERIFICATION = :FAILED_VERIFICATION + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/external_bank_account_retry_prenote_params.rb b/lib/lithic/models/external_bank_account_retry_prenote_params.rb new file mode 100644 index 00000000..da10ec77 --- /dev/null +++ b/lib/lithic/models/external_bank_account_retry_prenote_params.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ExternalBankAccounts#retry_prenote + class ExternalBankAccountRetryPrenoteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute external_bank_account_token + # + # @return [String] + required :external_bank_account_token, String + + # @!attribute financial_account_token + # + # @return [String, nil] + optional :financial_account_token, String + + # @!method initialize(external_bank_account_token:, financial_account_token: nil, request_options: {}) + # @param external_bank_account_token [String] + # @param financial_account_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/external_bank_account_set_verification_method_params.rb b/lib/lithic/models/external_bank_account_set_verification_method_params.rb new file mode 100644 index 00000000..041edd0b --- /dev/null +++ b/lib/lithic/models/external_bank_account_set_verification_method_params.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ExternalBankAccounts#set_verification_method + class ExternalBankAccountSetVerificationMethodParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute external_bank_account_token + # + # @return [String] + required :external_bank_account_token, String + + # @!attribute verification_method + # The verification method to set for the external bank account + # + # @return [Symbol, Lithic::Models::ExternalBankAccountSetVerificationMethodParams::VerificationMethod] + required :verification_method, + enum: -> { Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod } + + # @!attribute financial_account_token + # The financial account token of the operating account to fund the micro deposits. + # Required when verification_method is MICRO_DEPOSIT or PRENOTE. + # + # @return [String, nil] + optional :financial_account_token, String + + # @!method initialize(external_bank_account_token:, verification_method:, financial_account_token: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ExternalBankAccountSetVerificationMethodParams} for more + # details. + # + # @param external_bank_account_token [String] + # + # @param verification_method [Symbol, Lithic::Models::ExternalBankAccountSetVerificationMethodParams::VerificationMethod] The verification method to set for the external bank account + # + # @param financial_account_token [String] The financial account token of the operating account to fund the micro deposits. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # The verification method to set for the external bank account + module VerificationMethod + extend Lithic::Internal::Type::Enum + + MICRO_DEPOSIT = :MICRO_DEPOSIT + PRENOTE = :PRENOTE + EXTERNALLY_VERIFIED = :EXTERNALLY_VERIFIED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/external_bank_account_unpause_params.rb b/lib/lithic/models/external_bank_account_unpause_params.rb new file mode 100644 index 00000000..aafab888 --- /dev/null +++ b/lib/lithic/models/external_bank_account_unpause_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ExternalBankAccounts#unpause + class ExternalBankAccountUnpauseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute external_bank_account_token + # + # @return [String] + required :external_bank_account_token, String + + # @!method initialize(external_bank_account_token:, request_options: {}) + # @param external_bank_account_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/external_bank_account_update_params.rb b/lib/lithic/models/external_bank_account_update_params.rb new file mode 100644 index 00000000..8d6e1ec0 --- /dev/null +++ b/lib/lithic/models/external_bank_account_update_params.rb @@ -0,0 +1,106 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ExternalBankAccounts#update + class ExternalBankAccountUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute external_bank_account_token + # + # @return [String] + required :external_bank_account_token, String + + # @!attribute address + # Address + # + # @return [Lithic::Models::ExternalBankAccountAddress, nil] + optional :address, -> { Lithic::ExternalBankAccountAddress } + + # @!attribute company_id + # Optional field that helps identify bank accounts in receipts + # + # @return [String, nil] + optional :company_id, String + + # @!attribute dob + # Date of Birth of the Individual that owns the external bank account + # + # @return [Date, nil] + optional :dob, Date + + # @!attribute doing_business_as + # Doing Business As + # + # @return [String, nil] + optional :doing_business_as, String + + # @!attribute name + # The nickname for this External Bank Account + # + # @return [String, nil] + optional :name, String + + # @!attribute owner + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + # + # @return [String, nil] + optional :owner, String + + # @!attribute owner_type + # Owner Type + # + # @return [Symbol, Lithic::Models::OwnerType, nil] + optional :owner_type, enum: -> { Lithic::OwnerType } + + # @!attribute type + # + # @return [Symbol, Lithic::Models::ExternalBankAccountUpdateParams::Type, nil] + optional :type, enum: -> { Lithic::ExternalBankAccountUpdateParams::Type } + + # @!attribute user_defined_id + # User Defined ID + # + # @return [String, nil] + optional :user_defined_id, String + + # @!method initialize(external_bank_account_token:, address: nil, company_id: nil, dob: nil, doing_business_as: nil, name: nil, owner: nil, owner_type: nil, type: nil, user_defined_id: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ExternalBankAccountUpdateParams} for more details. + # + # @param external_bank_account_token [String] + # + # @param address [Lithic::Models::ExternalBankAccountAddress] Address + # + # @param company_id [String] Optional field that helps identify bank accounts in receipts + # + # @param dob [Date] Date of Birth of the Individual that owns the external bank account + # + # @param doing_business_as [String] Doing Business As + # + # @param name [String] The nickname for this External Bank Account + # + # @param owner [String] Legal Name of the business or individual who owns the external account. This wil + # + # @param owner_type [Symbol, Lithic::Models::OwnerType] Owner Type + # + # @param type [Symbol, Lithic::Models::ExternalBankAccountUpdateParams::Type] + # + # @param user_defined_id [String] User Defined ID + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + module Type + extend Lithic::Internal::Type::Enum + + CHECKING = :CHECKING + SAVINGS = :SAVINGS + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/external_bank_account_update_response.rb b/lib/lithic/models/external_bank_account_update_response.rb new file mode 100644 index 00000000..b13b825d --- /dev/null +++ b/lib/lithic/models/external_bank_account_update_response.rb @@ -0,0 +1,271 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ExternalBankAccounts#update + class ExternalBankAccountUpdateResponse < Lithic::Internal::Type::BaseModel + # @!attribute token + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + # + # @return [String] + required :token, String + + # @!attribute country + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + # + # @return [String] + required :country, String + + # @!attribute created + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # currency of the external account 3-character alphabetic ISO 4217 code + # + # @return [String] + required :currency, String + + # @!attribute last_four + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + # + # @return [String] + required :last_four, String + + # @!attribute owner + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + # + # @return [String] + required :owner, String + + # @!attribute owner_type + # Owner Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::OwnerType] + required :owner_type, enum: -> { Lithic::Models::ExternalBankAccountUpdateResponse::OwnerType } + + # @!attribute routing_number + # Routing Number + # + # @return [String] + required :routing_number, String + + # @!attribute state + # Account State + # + # @return [Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::State] + required :state, enum: -> { Lithic::Models::ExternalBankAccountUpdateResponse::State } + + # @!attribute type + # Account Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::Type] + required :type, enum: -> { Lithic::Models::ExternalBankAccountUpdateResponse::Type } + + # @!attribute verification_attempts + # The number of attempts at verification + # + # @return [Integer] + required :verification_attempts, Integer + + # @!attribute verification_method + # Verification Method + # + # @return [Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::VerificationMethod] + required :verification_method, + enum: -> { Lithic::Models::ExternalBankAccountUpdateResponse::VerificationMethod } + + # @!attribute verification_state + # Verification State + # + # @return [Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::VerificationState] + required :verification_state, + enum: -> { Lithic::Models::ExternalBankAccountUpdateResponse::VerificationState } + + # @!attribute account_token + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + # + # @return [String, nil] + optional :account_token, String, nil?: true + + # @!attribute address + # Address + # + # @return [Lithic::Models::ExternalBankAccountAddress, nil] + optional :address, -> { Lithic::ExternalBankAccountAddress }, nil?: true + + # @!attribute company_id + # Optional field that helps identify bank accounts in receipts + # + # @return [String, nil] + optional :company_id, String, nil?: true + + # @!attribute dob + # Date of Birth of the Individual that owns the external bank account + # + # @return [Date, nil] + optional :dob, Date, nil?: true + + # @!attribute doing_business_as + # Doing Business As + # + # @return [String, nil] + optional :doing_business_as, String, nil?: true + + # @!attribute financial_account_token + # The financial account token of the operating account to fund the micro deposits + # + # @return [String, nil] + optional :financial_account_token, String, nil?: true + + # @!attribute name + # The nickname for this External Bank Account + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute user_defined_id + # User Defined ID + # + # @return [String, nil] + optional :user_defined_id, String, nil?: true + + # @!attribute verification_failed_reason + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + # + # @return [String, nil] + optional :verification_failed_reason, String, nil?: true + + # @!method initialize(token:, country:, created:, currency:, last_four:, owner:, owner_type:, routing_number:, state:, type:, verification_attempts:, verification_method:, verification_state:, account_token: nil, address: nil, company_id: nil, dob: nil, doing_business_as: nil, financial_account_token: nil, name: nil, user_defined_id: nil, verification_failed_reason: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ExternalBankAccountUpdateResponse} for more details. + # + # @param token [String] A globally unique identifier for this record of an external bank account associa + # + # @param country [String] The country that the bank account is located in using ISO 3166-1. We will only a + # + # @param created [Time] An ISO 8601 string representing when this funding source was added to the Lithic + # + # @param currency [String] currency of the external account 3-character alphabetic ISO 4217 code + # + # @param last_four [String] The last 4 digits of the bank account. Derived by Lithic from the account number + # + # @param owner [String] Legal Name of the business or individual who owns the external account. This wil + # + # @param owner_type [Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::OwnerType] Owner Type + # + # @param routing_number [String] Routing Number + # + # @param state [Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::State] Account State + # + # @param type [Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::Type] Account Type + # + # @param verification_attempts [Integer] The number of attempts at verification + # + # @param verification_method [Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::VerificationMethod] Verification Method + # + # @param verification_state [Symbol, Lithic::Models::ExternalBankAccountUpdateResponse::VerificationState] Verification State + # + # @param account_token [String, nil] Indicates which Lithic account the external account is associated with. For exte + # + # @param address [Lithic::Models::ExternalBankAccountAddress, nil] Address + # + # @param company_id [String, nil] Optional field that helps identify bank accounts in receipts + # + # @param dob [Date, nil] Date of Birth of the Individual that owns the external bank account + # + # @param doing_business_as [String, nil] Doing Business As + # + # @param financial_account_token [String, nil] The financial account token of the operating account to fund the micro deposits + # + # @param name [String, nil] The nickname for this External Bank Account + # + # @param user_defined_id [String, nil] User Defined ID + # + # @param verification_failed_reason [String, nil] Optional free text description of the reason for the failed verification. For AC + + # Owner Type + # + # @see Lithic::Models::ExternalBankAccountUpdateResponse#owner_type + module OwnerType + extend Lithic::Internal::Type::Enum + + BUSINESS = :BUSINESS + INDIVIDUAL = :INDIVIDUAL + + # @!method self.values + # @return [Array] + end + + # Account State + # + # @see Lithic::Models::ExternalBankAccountUpdateResponse#state + module State + extend Lithic::Internal::Type::Enum + + ENABLED = :ENABLED + CLOSED = :CLOSED + PAUSED = :PAUSED + + # @!method self.values + # @return [Array] + end + + # Account Type + # + # @see Lithic::Models::ExternalBankAccountUpdateResponse#type + module Type + extend Lithic::Internal::Type::Enum + + CHECKING = :CHECKING + SAVINGS = :SAVINGS + + # @!method self.values + # @return [Array] + end + + # Verification Method + # + # @see Lithic::Models::ExternalBankAccountUpdateResponse#verification_method + module VerificationMethod + extend Lithic::Internal::Type::Enum + + MANUAL = :MANUAL + MICRO_DEPOSIT = :MICRO_DEPOSIT + PLAID = :PLAID + PRENOTE = :PRENOTE + + # @!method self.values + # @return [Array] + end + + # Verification State + # + # @see Lithic::Models::ExternalBankAccountUpdateResponse#verification_state + module VerificationState + extend Lithic::Internal::Type::Enum + + PENDING = :PENDING + ENABLED = :ENABLED + FAILED_VERIFICATION = :FAILED_VERIFICATION + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/external_bank_account_updated_webhook_event.rb b/lib/lithic/models/external_bank_account_updated_webhook_event.rb new file mode 100644 index 00000000..19869a90 --- /dev/null +++ b/lib/lithic/models/external_bank_account_updated_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalBankAccountUpdatedWebhookEvent < Lithic::Models::ExternalBankAccount + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"external_bank_account.updated"] + required :event_type, const: :"external_bank_account.updated" + + # @!method initialize(event_type: :"external_bank_account.updated") + # @param event_type [Symbol, :"external_bank_account.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/external_bank_accounts/micro_deposit_create_params.rb b/lib/lithic/models/external_bank_accounts/micro_deposit_create_params.rb new file mode 100644 index 00000000..ec35c9ce --- /dev/null +++ b/lib/lithic/models/external_bank_accounts/micro_deposit_create_params.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Lithic + module Models + module ExternalBankAccounts + # @see Lithic::Resources::ExternalBankAccounts::MicroDeposits#create + class MicroDepositCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute external_bank_account_token + # + # @return [String] + required :external_bank_account_token, String + + # @!attribute micro_deposits + # + # @return [Array] + required :micro_deposits, Lithic::Internal::Type::ArrayOf[Integer] + + # @!method initialize(external_bank_account_token:, micro_deposits:, request_options: {}) + # @param external_bank_account_token [String] + # @param micro_deposits [Array] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/external_bank_accounts/micro_deposit_create_response.rb b/lib/lithic/models/external_bank_accounts/micro_deposit_create_response.rb new file mode 100644 index 00000000..c3f82678 --- /dev/null +++ b/lib/lithic/models/external_bank_accounts/micro_deposit_create_response.rb @@ -0,0 +1,275 @@ +# frozen_string_literal: true + +module Lithic + module Models + module ExternalBankAccounts + # @see Lithic::Resources::ExternalBankAccounts::MicroDeposits#create + class MicroDepositCreateResponse < Lithic::Internal::Type::BaseModel + # @!attribute token + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + # + # @return [String] + required :token, String + + # @!attribute country + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + # + # @return [String] + required :country, String + + # @!attribute created + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # currency of the external account 3-character alphabetic ISO 4217 code + # + # @return [String] + required :currency, String + + # @!attribute last_four + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + # + # @return [String] + required :last_four, String + + # @!attribute owner + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + # + # @return [String] + required :owner, String + + # @!attribute owner_type + # Owner Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::OwnerType] + required :owner_type, + enum: -> { Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::OwnerType } + + # @!attribute routing_number + # Routing Number + # + # @return [String] + required :routing_number, String + + # @!attribute state + # Account State + # + # @return [Symbol, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::State] + required :state, enum: -> { Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::State } + + # @!attribute type + # Account Type + # + # @return [Symbol, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::Type] + required :type, enum: -> { Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::Type } + + # @!attribute verification_attempts + # The number of attempts at verification + # + # @return [Integer] + required :verification_attempts, Integer + + # @!attribute verification_method + # Verification Method + # + # @return [Symbol, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationMethod] + required :verification_method, + enum: -> { Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationMethod } + + # @!attribute verification_state + # Verification State + # + # @return [Symbol, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationState] + required :verification_state, + enum: -> { Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationState } + + # @!attribute account_token + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + # + # @return [String, nil] + optional :account_token, String, nil?: true + + # @!attribute address + # Address + # + # @return [Lithic::Models::ExternalBankAccountAddress, nil] + optional :address, -> { Lithic::ExternalBankAccountAddress }, nil?: true + + # @!attribute company_id + # Optional field that helps identify bank accounts in receipts + # + # @return [String, nil] + optional :company_id, String, nil?: true + + # @!attribute dob + # Date of Birth of the Individual that owns the external bank account + # + # @return [Date, nil] + optional :dob, Date, nil?: true + + # @!attribute doing_business_as + # Doing Business As + # + # @return [String, nil] + optional :doing_business_as, String, nil?: true + + # @!attribute financial_account_token + # The financial account token of the operating account to fund the micro deposits + # + # @return [String, nil] + optional :financial_account_token, String, nil?: true + + # @!attribute name + # The nickname for this External Bank Account + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute user_defined_id + # User Defined ID + # + # @return [String, nil] + optional :user_defined_id, String, nil?: true + + # @!attribute verification_failed_reason + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + # + # @return [String, nil] + optional :verification_failed_reason, String, nil?: true + + # @!method initialize(token:, country:, created:, currency:, last_four:, owner:, owner_type:, routing_number:, state:, type:, verification_attempts:, verification_method:, verification_state:, account_token: nil, address: nil, company_id: nil, dob: nil, doing_business_as: nil, financial_account_token: nil, name: nil, user_defined_id: nil, verification_failed_reason: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse} for more + # details. + # + # @param token [String] A globally unique identifier for this record of an external bank account associa + # + # @param country [String] The country that the bank account is located in using ISO 3166-1. We will only a + # + # @param created [Time] An ISO 8601 string representing when this funding source was added to the Lithic + # + # @param currency [String] currency of the external account 3-character alphabetic ISO 4217 code + # + # @param last_four [String] The last 4 digits of the bank account. Derived by Lithic from the account number + # + # @param owner [String] Legal Name of the business or individual who owns the external account. This wil + # + # @param owner_type [Symbol, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::OwnerType] Owner Type + # + # @param routing_number [String] Routing Number + # + # @param state [Symbol, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::State] Account State + # + # @param type [Symbol, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::Type] Account Type + # + # @param verification_attempts [Integer] The number of attempts at verification + # + # @param verification_method [Symbol, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationMethod] Verification Method + # + # @param verification_state [Symbol, Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationState] Verification State + # + # @param account_token [String, nil] Indicates which Lithic account the external account is associated with. For exte + # + # @param address [Lithic::Models::ExternalBankAccountAddress, nil] Address + # + # @param company_id [String, nil] Optional field that helps identify bank accounts in receipts + # + # @param dob [Date, nil] Date of Birth of the Individual that owns the external bank account + # + # @param doing_business_as [String, nil] Doing Business As + # + # @param financial_account_token [String, nil] The financial account token of the operating account to fund the micro deposits + # + # @param name [String, nil] The nickname for this External Bank Account + # + # @param user_defined_id [String, nil] User Defined ID + # + # @param verification_failed_reason [String, nil] Optional free text description of the reason for the failed verification. For AC + + # Owner Type + # + # @see Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse#owner_type + module OwnerType + extend Lithic::Internal::Type::Enum + + BUSINESS = :BUSINESS + INDIVIDUAL = :INDIVIDUAL + + # @!method self.values + # @return [Array] + end + + # Account State + # + # @see Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse#state + module State + extend Lithic::Internal::Type::Enum + + ENABLED = :ENABLED + CLOSED = :CLOSED + PAUSED = :PAUSED + + # @!method self.values + # @return [Array] + end + + # Account Type + # + # @see Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse#type + module Type + extend Lithic::Internal::Type::Enum + + CHECKING = :CHECKING + SAVINGS = :SAVINGS + + # @!method self.values + # @return [Array] + end + + # Verification Method + # + # @see Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse#verification_method + module VerificationMethod + extend Lithic::Internal::Type::Enum + + MANUAL = :MANUAL + MICRO_DEPOSIT = :MICRO_DEPOSIT + PLAID = :PLAID + PRENOTE = :PRENOTE + + # @!method self.values + # @return [Array] + end + + # Verification State + # + # @see Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse#verification_state + module VerificationState + extend Lithic::Internal::Type::Enum + + PENDING = :PENDING + ENABLED = :ENABLED + FAILED_VERIFICATION = :FAILED_VERIFICATION + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/external_payment.rb b/lib/lithic/models/external_payment.rb new file mode 100644 index 00000000..f9b90b25 --- /dev/null +++ b/lib/lithic/models/external_payment.rb @@ -0,0 +1,291 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ExternalPayments#create + class ExternalPayment < Lithic::Internal::Type::BaseModel + # @!attribute token + # Unique identifier for the transaction + # + # @return [String] + required :token, String + + # @!attribute created + # ISO 8601 timestamp of when the transaction was created + # + # @return [Time] + required :created, Time + + # @!attribute status + # The status of the transaction + # + # @return [Symbol, Lithic::Models::ExternalPayment::Status] + required :status, enum: -> { Lithic::ExternalPayment::Status } + + # @!attribute updated + # ISO 8601 timestamp of when the transaction was last updated + # + # @return [Time] + required :updated, Time + + # @!attribute category + # + # @return [Symbol, Lithic::Models::ExternalPayment::Category, nil] + optional :category, enum: -> { Lithic::ExternalPayment::Category } + + # @!attribute currency + # + # @return [String, nil] + optional :currency, String + + # @!attribute events + # + # @return [Array, nil] + optional :events, -> { Lithic::Internal::Type::ArrayOf[Lithic::ExternalPayment::Event] } + + # @!attribute family + # EXTERNAL_PAYMENT - External Payment Response + # + # @return [Symbol, Lithic::Models::ExternalPayment::Family, nil] + optional :family, enum: -> { Lithic::ExternalPayment::Family } + + # @!attribute financial_account_token + # + # @return [String, nil] + optional :financial_account_token, String + + # @!attribute payment_type + # + # @return [Symbol, Lithic::Models::ExternalPayment::PaymentType, nil] + optional :payment_type, enum: -> { Lithic::ExternalPayment::PaymentType } + + # @!attribute pending_amount + # + # @return [Integer, nil] + optional :pending_amount, Integer + + # @!attribute result + # + # @return [Symbol, Lithic::Models::ExternalPayment::Result, nil] + optional :result, enum: -> { Lithic::ExternalPayment::Result } + + # @!attribute settled_amount + # + # @return [Integer, nil] + optional :settled_amount, Integer + + # @!attribute user_defined_id + # + # @return [String, nil] + optional :user_defined_id, String, nil?: true + + # @!method initialize(token:, created:, status:, updated:, category: nil, currency: nil, events: nil, family: nil, financial_account_token: nil, payment_type: nil, pending_amount: nil, result: nil, settled_amount: nil, user_defined_id: nil) + # @param token [String] Unique identifier for the transaction + # + # @param created [Time] ISO 8601 timestamp of when the transaction was created + # + # @param status [Symbol, Lithic::Models::ExternalPayment::Status] The status of the transaction + # + # @param updated [Time] ISO 8601 timestamp of when the transaction was last updated + # + # @param category [Symbol, Lithic::Models::ExternalPayment::Category] + # + # @param currency [String] + # + # @param events [Array] + # + # @param family [Symbol, Lithic::Models::ExternalPayment::Family] EXTERNAL_PAYMENT - External Payment Response + # + # @param financial_account_token [String] + # + # @param payment_type [Symbol, Lithic::Models::ExternalPayment::PaymentType] + # + # @param pending_amount [Integer] + # + # @param result [Symbol, Lithic::Models::ExternalPayment::Result] + # + # @param settled_amount [Integer] + # + # @param user_defined_id [String, nil] + + # The status of the transaction + # + # @see Lithic::Models::ExternalPayment#status + module Status + extend Lithic::Internal::Type::Enum + + PENDING = :PENDING + SETTLED = :SETTLED + DECLINED = :DECLINED + REVERSED = :REVERSED + CANCELED = :CANCELED + RETURNED = :RETURNED + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::ExternalPayment#category + module Category + extend Lithic::Internal::Type::Enum + + EXTERNAL_WIRE = :EXTERNAL_WIRE + EXTERNAL_ACH = :EXTERNAL_ACH + EXTERNAL_CHECK = :EXTERNAL_CHECK + EXTERNAL_FEDNOW = :EXTERNAL_FEDNOW + EXTERNAL_RTP = :EXTERNAL_RTP + EXTERNAL_TRANSFER = :EXTERNAL_TRANSFER + + # @!method self.values + # @return [Array] + end + + class Event < Lithic::Internal::Type::BaseModel + # @!attribute token + # + # @return [String] + required :token, String + + # @!attribute amount + # + # @return [Integer] + required :amount, Integer + + # @!attribute created + # + # @return [Time] + required :created, Time + + # @!attribute detailed_results + # + # @return [Array] + required :detailed_results, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::ExternalPayment::Event::DetailedResult] } + + # @!attribute effective_date + # + # @return [Date] + required :effective_date, Date + + # @!attribute memo + # + # @return [String] + required :memo, String + + # @!attribute result + # + # @return [Symbol, Lithic::Models::ExternalPayment::Event::Result] + required :result, enum: -> { Lithic::ExternalPayment::Event::Result } + + # @!attribute type + # + # @return [Symbol, Lithic::Models::ExternalPayment::Event::Type] + required :type, enum: -> { Lithic::ExternalPayment::Event::Type } + + # @!method initialize(token:, amount:, created:, detailed_results:, effective_date:, memo:, result:, type:) + # @param token [String] + # @param amount [Integer] + # @param created [Time] + # @param detailed_results [Array] + # @param effective_date [Date] + # @param memo [String] + # @param result [Symbol, Lithic::Models::ExternalPayment::Event::Result] + # @param type [Symbol, Lithic::Models::ExternalPayment::Event::Type] + + module DetailedResult + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::ExternalPayment::Event#result + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::ExternalPayment::Event#type + module Type + extend Lithic::Internal::Type::Enum + + EXTERNAL_WIRE_INITIATED = :EXTERNAL_WIRE_INITIATED + EXTERNAL_WIRE_CANCELED = :EXTERNAL_WIRE_CANCELED + EXTERNAL_WIRE_SETTLED = :EXTERNAL_WIRE_SETTLED + EXTERNAL_WIRE_REVERSED = :EXTERNAL_WIRE_REVERSED + EXTERNAL_WIRE_RELEASED = :EXTERNAL_WIRE_RELEASED + EXTERNAL_ACH_INITIATED = :EXTERNAL_ACH_INITIATED + EXTERNAL_ACH_CANCELED = :EXTERNAL_ACH_CANCELED + EXTERNAL_ACH_SETTLED = :EXTERNAL_ACH_SETTLED + EXTERNAL_ACH_REVERSED = :EXTERNAL_ACH_REVERSED + EXTERNAL_ACH_RELEASED = :EXTERNAL_ACH_RELEASED + EXTERNAL_TRANSFER_INITIATED = :EXTERNAL_TRANSFER_INITIATED + EXTERNAL_TRANSFER_CANCELED = :EXTERNAL_TRANSFER_CANCELED + EXTERNAL_TRANSFER_SETTLED = :EXTERNAL_TRANSFER_SETTLED + EXTERNAL_TRANSFER_REVERSED = :EXTERNAL_TRANSFER_REVERSED + EXTERNAL_TRANSFER_RELEASED = :EXTERNAL_TRANSFER_RELEASED + EXTERNAL_CHECK_INITIATED = :EXTERNAL_CHECK_INITIATED + EXTERNAL_CHECK_CANCELED = :EXTERNAL_CHECK_CANCELED + EXTERNAL_CHECK_SETTLED = :EXTERNAL_CHECK_SETTLED + EXTERNAL_CHECK_REVERSED = :EXTERNAL_CHECK_REVERSED + EXTERNAL_CHECK_RELEASED = :EXTERNAL_CHECK_RELEASED + EXTERNAL_FEDNOW_INITIATED = :EXTERNAL_FEDNOW_INITIATED + EXTERNAL_FEDNOW_CANCELED = :EXTERNAL_FEDNOW_CANCELED + EXTERNAL_FEDNOW_SETTLED = :EXTERNAL_FEDNOW_SETTLED + EXTERNAL_FEDNOW_REVERSED = :EXTERNAL_FEDNOW_REVERSED + EXTERNAL_FEDNOW_RELEASED = :EXTERNAL_FEDNOW_RELEASED + EXTERNAL_RTP_INITIATED = :EXTERNAL_RTP_INITIATED + EXTERNAL_RTP_CANCELED = :EXTERNAL_RTP_CANCELED + EXTERNAL_RTP_SETTLED = :EXTERNAL_RTP_SETTLED + EXTERNAL_RTP_REVERSED = :EXTERNAL_RTP_REVERSED + EXTERNAL_RTP_RELEASED = :EXTERNAL_RTP_RELEASED + + # @!method self.values + # @return [Array] + end + end + + # EXTERNAL_PAYMENT - External Payment Response + # + # @see Lithic::Models::ExternalPayment#family + module Family + extend Lithic::Internal::Type::Enum + + EXTERNAL_PAYMENT = :EXTERNAL_PAYMENT + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::ExternalPayment#payment_type + module PaymentType + extend Lithic::Internal::Type::Enum + + DEPOSIT = :DEPOSIT + WITHDRAWAL = :WITHDRAWAL + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::ExternalPayment#result + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/external_payment_cancel_params.rb b/lib/lithic/models/external_payment_cancel_params.rb new file mode 100644 index 00000000..307cdf3d --- /dev/null +++ b/lib/lithic/models/external_payment_cancel_params.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ExternalPayments#cancel + class ExternalPaymentCancelParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute external_payment_token + # + # @return [String] + required :external_payment_token, String + + # @!attribute effective_date + # + # @return [Date] + required :effective_date, Date + + # @!attribute memo + # + # @return [String, nil] + optional :memo, String + + # @!method initialize(external_payment_token:, effective_date:, memo: nil, request_options: {}) + # @param external_payment_token [String] + # @param effective_date [Date] + # @param memo [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/external_payment_create_params.rb b/lib/lithic/models/external_payment_create_params.rb new file mode 100644 index 00000000..7adb232f --- /dev/null +++ b/lib/lithic/models/external_payment_create_params.rb @@ -0,0 +1,116 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ExternalPayments#create + class ExternalPaymentCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute amount + # + # @return [Integer] + required :amount, Integer + + # @!attribute category + # + # @return [Symbol, Lithic::Models::ExternalPaymentCreateParams::Category] + required :category, enum: -> { Lithic::ExternalPaymentCreateParams::Category } + + # @!attribute effective_date + # + # @return [Date] + required :effective_date, Date + + # @!attribute financial_account_token + # + # @return [String] + required :financial_account_token, String + + # @!attribute payment_type + # + # @return [Symbol, Lithic::Models::ExternalPaymentCreateParams::PaymentType] + required :payment_type, enum: -> { Lithic::ExternalPaymentCreateParams::PaymentType } + + # @!attribute token + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + # + # @return [String, nil] + optional :token, String + + # @!attribute memo + # + # @return [String, nil] + optional :memo, String + + # @!attribute progress_to + # + # @return [Symbol, Lithic::Models::ExternalPaymentCreateParams::ProgressTo, nil] + optional :progress_to, enum: -> { Lithic::ExternalPaymentCreateParams::ProgressTo } + + # @!attribute user_defined_id + # + # @return [String, nil] + optional :user_defined_id, String + + # @!method initialize(amount:, category:, effective_date:, financial_account_token:, payment_type:, token: nil, memo: nil, progress_to: nil, user_defined_id: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ExternalPaymentCreateParams} for more details. + # + # @param amount [Integer] + # + # @param category [Symbol, Lithic::Models::ExternalPaymentCreateParams::Category] + # + # @param effective_date [Date] + # + # @param financial_account_token [String] + # + # @param payment_type [Symbol, Lithic::Models::ExternalPaymentCreateParams::PaymentType] + # + # @param token [String] Customer-provided token that will serve as an idempotency token. This token will + # + # @param memo [String] + # + # @param progress_to [Symbol, Lithic::Models::ExternalPaymentCreateParams::ProgressTo] + # + # @param user_defined_id [String] + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + module Category + extend Lithic::Internal::Type::Enum + + EXTERNAL_WIRE = :EXTERNAL_WIRE + EXTERNAL_ACH = :EXTERNAL_ACH + EXTERNAL_CHECK = :EXTERNAL_CHECK + EXTERNAL_FEDNOW = :EXTERNAL_FEDNOW + EXTERNAL_RTP = :EXTERNAL_RTP + EXTERNAL_TRANSFER = :EXTERNAL_TRANSFER + + # @!method self.values + # @return [Array] + end + + module PaymentType + extend Lithic::Internal::Type::Enum + + DEPOSIT = :DEPOSIT + WITHDRAWAL = :WITHDRAWAL + + # @!method self.values + # @return [Array] + end + + module ProgressTo + extend Lithic::Internal::Type::Enum + + SETTLED = :SETTLED + RELEASED = :RELEASED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/external_payment_created_webhook_event.rb b/lib/lithic/models/external_payment_created_webhook_event.rb new file mode 100644 index 00000000..41fd4bf2 --- /dev/null +++ b/lib/lithic/models/external_payment_created_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalPaymentCreatedWebhookEvent < Lithic::Models::ExternalPayment + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"external_payment.created"] + required :event_type, const: :"external_payment.created" + + # @!method initialize(event_type: :"external_payment.created") + # @param event_type [Symbol, :"external_payment.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/external_payment_list_params.rb b/lib/lithic/models/external_payment_list_params.rb new file mode 100644 index 00000000..aff41236 --- /dev/null +++ b/lib/lithic/models/external_payment_list_params.rb @@ -0,0 +1,142 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ExternalPayments#list + class ExternalPaymentListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time + + # @!attribute business_account_token + # + # @return [String, nil] + optional :business_account_token, String + + # @!attribute category + # External Payment category to be returned. + # + # @return [Symbol, Lithic::Models::ExternalPaymentListParams::Category, nil] + optional :category, enum: -> { Lithic::ExternalPaymentListParams::Category } + + # @!attribute end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute financial_account_token + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + # + # @return [String, nil] + optional :financial_account_token, String + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute result + # External Payment result to be returned. + # + # @return [Symbol, Lithic::Models::ExternalPaymentListParams::Result, nil] + optional :result, enum: -> { Lithic::ExternalPaymentListParams::Result } + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!attribute status + # Book transfer status to be returned. + # + # @return [Symbol, Lithic::Models::ExternalPaymentListParams::Status, nil] + optional :status, enum: -> { Lithic::ExternalPaymentListParams::Status } + + # @!method initialize(begin_: nil, business_account_token: nil, category: nil, end_: nil, ending_before: nil, financial_account_token: nil, page_size: nil, result: nil, starting_after: nil, status: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ExternalPaymentListParams} for more details. + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param business_account_token [String] + # + # @param category [Symbol, Lithic::Models::ExternalPaymentListParams::Category] External Payment category to be returned. + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param financial_account_token [String] Globally unique identifier for the financial account or card that will send the + # + # @param page_size [Integer] Page size (for pagination). + # + # @param result [Symbol, Lithic::Models::ExternalPaymentListParams::Result] External Payment result to be returned. + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param status [Symbol, Lithic::Models::ExternalPaymentListParams::Status] Book transfer status to be returned. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # External Payment category to be returned. + module Category + extend Lithic::Internal::Type::Enum + + EXTERNAL_WIRE = :EXTERNAL_WIRE + EXTERNAL_ACH = :EXTERNAL_ACH + EXTERNAL_CHECK = :EXTERNAL_CHECK + EXTERNAL_FEDNOW = :EXTERNAL_FEDNOW + EXTERNAL_RTP = :EXTERNAL_RTP + EXTERNAL_TRANSFER = :EXTERNAL_TRANSFER + + # @!method self.values + # @return [Array] + end + + # External Payment result to be returned. + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + + # Book transfer status to be returned. + module Status + extend Lithic::Internal::Type::Enum + + PENDING = :PENDING + SETTLED = :SETTLED + DECLINED = :DECLINED + REVERSED = :REVERSED + CANCELED = :CANCELED + RETURNED = :RETURNED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/external_payment_release_params.rb b/lib/lithic/models/external_payment_release_params.rb new file mode 100644 index 00000000..ee0abc2e --- /dev/null +++ b/lib/lithic/models/external_payment_release_params.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ExternalPayments#release + class ExternalPaymentReleaseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute external_payment_token + # + # @return [String] + required :external_payment_token, String + + # @!attribute effective_date + # + # @return [Date] + required :effective_date, Date + + # @!attribute memo + # + # @return [String, nil] + optional :memo, String + + # @!method initialize(external_payment_token:, effective_date:, memo: nil, request_options: {}) + # @param external_payment_token [String] + # @param effective_date [Date] + # @param memo [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/external_payment_retrieve_params.rb b/lib/lithic/models/external_payment_retrieve_params.rb new file mode 100644 index 00000000..82a4aaa7 --- /dev/null +++ b/lib/lithic/models/external_payment_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ExternalPayments#retrieve + class ExternalPaymentRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute external_payment_token + # + # @return [String] + required :external_payment_token, String + + # @!method initialize(external_payment_token:, request_options: {}) + # @param external_payment_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/external_payment_reverse_params.rb b/lib/lithic/models/external_payment_reverse_params.rb new file mode 100644 index 00000000..ece047bc --- /dev/null +++ b/lib/lithic/models/external_payment_reverse_params.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ExternalPayments#reverse + class ExternalPaymentReverseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute external_payment_token + # + # @return [String] + required :external_payment_token, String + + # @!attribute effective_date + # + # @return [Date] + required :effective_date, Date + + # @!attribute memo + # + # @return [String, nil] + optional :memo, String + + # @!method initialize(external_payment_token:, effective_date:, memo: nil, request_options: {}) + # @param external_payment_token [String] + # @param effective_date [Date] + # @param memo [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/external_payment_settle_params.rb b/lib/lithic/models/external_payment_settle_params.rb new file mode 100644 index 00000000..a691812a --- /dev/null +++ b/lib/lithic/models/external_payment_settle_params.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ExternalPayments#settle + class ExternalPaymentSettleParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute external_payment_token + # + # @return [String] + required :external_payment_token, String + + # @!attribute effective_date + # + # @return [Date] + required :effective_date, Date + + # @!attribute memo + # + # @return [String, nil] + optional :memo, String + + # @!attribute progress_to + # + # @return [Symbol, Lithic::Models::ExternalPaymentSettleParams::ProgressTo, nil] + optional :progress_to, enum: -> { Lithic::ExternalPaymentSettleParams::ProgressTo } + + # @!method initialize(external_payment_token:, effective_date:, memo: nil, progress_to: nil, request_options: {}) + # @param external_payment_token [String] + # @param effective_date [Date] + # @param memo [String] + # @param progress_to [Symbol, Lithic::Models::ExternalPaymentSettleParams::ProgressTo] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + module ProgressTo + extend Lithic::Internal::Type::Enum + + SETTLED = :SETTLED + RELEASED = :RELEASED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/external_payment_updated_webhook_event.rb b/lib/lithic/models/external_payment_updated_webhook_event.rb new file mode 100644 index 00000000..20523f81 --- /dev/null +++ b/lib/lithic/models/external_payment_updated_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalPaymentUpdatedWebhookEvent < Lithic::Models::ExternalPayment + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"external_payment.updated"] + required :event_type, const: :"external_payment.updated" + + # @!method initialize(event_type: :"external_payment.updated") + # @param event_type [Symbol, :"external_payment.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/external_resource.rb b/lib/lithic/models/external_resource.rb new file mode 100644 index 00000000..0979bb12 --- /dev/null +++ b/lib/lithic/models/external_resource.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ExternalResource < Lithic::Internal::Type::BaseModel + # @!attribute external_resource_token + # Token identifying the external resource + # + # @return [String] + required :external_resource_token, String + + # @!attribute external_resource_type + # Type of external resource associated with the management operation + # + # @return [Symbol, Lithic::Models::ExternalResourceType] + required :external_resource_type, enum: -> { Lithic::ExternalResourceType } + + # @!attribute external_resource_sub_token + # Token identifying the external resource sub-resource + # + # @return [String, nil] + optional :external_resource_sub_token, String + + # @!method initialize(external_resource_token:, external_resource_type:, external_resource_sub_token: nil) + # External resource associated with the management operation + # + # @param external_resource_token [String] Token identifying the external resource + # + # @param external_resource_type [Symbol, Lithic::Models::ExternalResourceType] Type of external resource associated with the management operation + # + # @param external_resource_sub_token [String] Token identifying the external resource sub-resource + end + end +end diff --git a/lib/lithic/models/external_resource_type.rb b/lib/lithic/models/external_resource_type.rb new file mode 100644 index 00000000..4c4030f9 --- /dev/null +++ b/lib/lithic/models/external_resource_type.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + # Type of external resource associated with the management operation + module ExternalResourceType + extend Lithic::Internal::Type::Enum + + STATEMENT = :STATEMENT + COLLECTION = :COLLECTION + DISPUTE = :DISPUTE + UNKNOWN = :UNKNOWN + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/lithic/models/financial_account.rb b/lib/lithic/models/financial_account.rb new file mode 100644 index 00000000..2cb731e3 --- /dev/null +++ b/lib/lithic/models/financial_account.rb @@ -0,0 +1,213 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::FinancialAccounts#create + class FinancialAccount < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for the account + # + # @return [String] + required :token, String + + # @!attribute account_token + # + # @return [String, nil] + required :account_token, String, nil?: true + + # @!attribute created + # + # @return [Time] + required :created, Time + + # @!attribute credit_configuration + # + # @return [Lithic::Models::FinancialAccount::CreditConfiguration, nil] + required :credit_configuration, -> { Lithic::FinancialAccount::CreditConfiguration }, nil?: true + + # @!attribute is_for_benefit_of + # Whether financial account is for the benefit of another entity + # + # @return [Boolean] + required :is_for_benefit_of, Lithic::Internal::Type::Boolean + + # @!attribute nickname + # + # @return [String, nil] + required :nickname, String, nil?: true + + # @!attribute status + # Status of the financial account + # + # @return [Symbol, Lithic::Models::FinancialAccount::Status] + required :status, enum: -> { Lithic::FinancialAccount::Status } + + # @!attribute substatus + # Substatus for the financial account + # + # @return [Symbol, Lithic::Models::FinancialAccount::Substatus, nil] + required :substatus, enum: -> { Lithic::FinancialAccount::Substatus }, nil?: true + + # @!attribute type + # + # @return [Symbol, Lithic::Models::FinancialAccount::Type] + required :type, enum: -> { Lithic::FinancialAccount::Type } + + # @!attribute updated + # + # @return [Time] + required :updated, Time + + # @!attribute user_defined_status + # User-defined status for the financial account + # + # @return [String, nil] + required :user_defined_status, String, nil?: true + + # @!attribute account_number + # + # @return [String, nil] + optional :account_number, String, nil?: true + + # @!attribute routing_number + # + # @return [String, nil] + optional :routing_number, String, nil?: true + + # @!method initialize(token:, account_token:, created:, credit_configuration:, is_for_benefit_of:, nickname:, status:, substatus:, type:, updated:, user_defined_status:, account_number: nil, routing_number: nil) + # @param token [String] Globally unique identifier for the account + # + # @param account_token [String, nil] + # + # @param created [Time] + # + # @param credit_configuration [Lithic::Models::FinancialAccount::CreditConfiguration, nil] + # + # @param is_for_benefit_of [Boolean] Whether financial account is for the benefit of another entity + # + # @param nickname [String, nil] + # + # @param status [Symbol, Lithic::Models::FinancialAccount::Status] Status of the financial account + # + # @param substatus [Symbol, Lithic::Models::FinancialAccount::Substatus, nil] Substatus for the financial account + # + # @param type [Symbol, Lithic::Models::FinancialAccount::Type] + # + # @param updated [Time] + # + # @param user_defined_status [String, nil] User-defined status for the financial account + # + # @param account_number [String, nil] + # + # @param routing_number [String, nil] + + # @see Lithic::Models::FinancialAccount#credit_configuration + class CreditConfiguration < Lithic::Internal::Type::BaseModel + # @!attribute auto_collection_configuration + # + # @return [Lithic::Models::FinancialAccount::CreditConfiguration::AutoCollectionConfiguration, nil] + required :auto_collection_configuration, + -> { Lithic::FinancialAccount::CreditConfiguration::AutoCollectionConfiguration }, + nil?: true + + # @!attribute credit_limit + # + # @return [Integer, nil] + required :credit_limit, Integer, nil?: true + + # @!attribute credit_product_token + # Globally unique identifier for the credit product + # + # @return [String, nil] + required :credit_product_token, String, nil?: true + + # @!attribute external_bank_account_token + # + # @return [String, nil] + required :external_bank_account_token, String, nil?: true + + # @!attribute tier + # Tier assigned to the financial account + # + # @return [String, nil] + required :tier, String, nil?: true + + # @!method initialize(auto_collection_configuration:, credit_limit:, credit_product_token:, external_bank_account_token:, tier:) + # @param auto_collection_configuration [Lithic::Models::FinancialAccount::CreditConfiguration::AutoCollectionConfiguration, nil] + # + # @param credit_limit [Integer, nil] + # + # @param credit_product_token [String, nil] Globally unique identifier for the credit product + # + # @param external_bank_account_token [String, nil] + # + # @param tier [String, nil] Tier assigned to the financial account + + # @see Lithic::Models::FinancialAccount::CreditConfiguration#auto_collection_configuration + class AutoCollectionConfiguration < Lithic::Internal::Type::BaseModel + # @!attribute auto_collection_enabled + # If auto collection is enabled for this account + # + # @return [Boolean] + required :auto_collection_enabled, Lithic::Internal::Type::Boolean + + # @!method initialize(auto_collection_enabled:) + # @param auto_collection_enabled [Boolean] If auto collection is enabled for this account + end + end + + # Status of the financial account + # + # @see Lithic::Models::FinancialAccount#status + module Status + extend Lithic::Internal::Type::Enum + + OPEN = :OPEN + CLOSED = :CLOSED + SUSPENDED = :SUSPENDED + PENDING = :PENDING + + # @!method self.values + # @return [Array] + end + + # Substatus for the financial account + # + # @see Lithic::Models::FinancialAccount#substatus + module Substatus + extend Lithic::Internal::Type::Enum + + CHARGED_OFF_DELINQUENT = :CHARGED_OFF_DELINQUENT + CHARGED_OFF_FRAUD = :CHARGED_OFF_FRAUD + END_USER_REQUEST = :END_USER_REQUEST + BANK_REQUEST = :BANK_REQUEST + DELINQUENT = :DELINQUENT + INTEREST_AND_FEES_PAUSED = :INTEREST_AND_FEES_PAUSED + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::FinancialAccount#type + module Type + extend Lithic::Internal::Type::Enum + + ISSUING = :ISSUING + RESERVE = :RESERVE + OPERATING = :OPERATING + CHARGED_OFF_FEES = :CHARGED_OFF_FEES + CHARGED_OFF_INTEREST = :CHARGED_OFF_INTEREST + CHARGED_OFF_PRINCIPAL = :CHARGED_OFF_PRINCIPAL + SECURITY = :SECURITY + PROGRAM_RECEIVABLES = :PROGRAM_RECEIVABLES + COLLECTION = :COLLECTION + PROGRAM_BANK_ACCOUNTS_PAYABLE = :PROGRAM_BANK_ACCOUNTS_PAYABLE + EARLY_DIRECT_DEPOSIT_FLOAT = :EARLY_DIRECT_DEPOSIT_FLOAT + PROVISIONAL_CREDIT_ACCOUNT = :PROVISIONAL_CREDIT_ACCOUNT + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/financial_account_balance.rb b/lib/lithic/models/financial_account_balance.rb new file mode 100644 index 00000000..b8da8303 --- /dev/null +++ b/lib/lithic/models/financial_account_balance.rb @@ -0,0 +1,112 @@ +# frozen_string_literal: true + +module Lithic + module Models + class FinancialAccountBalance < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for the financial account that holds this balance. + # + # @return [String] + required :token, String + + # @!attribute available_amount + # Funds available for spend in the currency's smallest unit (e.g., cents for USD) + # + # @return [Integer] + required :available_amount, Integer + + # @!attribute created + # Date and time for when the balance was first created. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # 3-character alphabetic ISO 4217 code for the local currency of the balance. + # + # @return [String] + required :currency, String + + # @!attribute last_transaction_event_token + # Globally unique identifier for the last financial transaction event that + # impacted this balance. + # + # @return [String] + required :last_transaction_event_token, String + + # @!attribute last_transaction_token + # Globally unique identifier for the last financial transaction that impacted this + # balance. + # + # @return [String] + required :last_transaction_token, String + + # @!attribute pending_amount + # Funds not available for spend due to card authorizations or pending ACH release. + # Shown in the currency's smallest unit (e.g., cents for USD). + # + # @return [Integer] + required :pending_amount, Integer + + # @!attribute total_amount + # The sum of available and pending balance in the currency's smallest unit (e.g., + # cents for USD). + # + # @return [Integer] + required :total_amount, Integer + + # @!attribute type + # Type of financial account. + # + # @return [Symbol, Lithic::Models::FinancialAccountBalance::Type] + required :type, enum: -> { Lithic::FinancialAccountBalance::Type } + + # @!attribute updated + # Date and time for when the balance was last updated. + # + # @return [Time] + required :updated, Time + + # @!method initialize(token:, available_amount:, created:, currency:, last_transaction_event_token:, last_transaction_token:, pending_amount:, total_amount:, type:, updated:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::FinancialAccountBalance} for more details. + # + # Balance of a Financial Account + # + # @param token [String] Globally unique identifier for the financial account that holds this balance. + # + # @param available_amount [Integer] Funds available for spend in the currency's smallest unit (e.g., cents for USD) + # + # @param created [Time] Date and time for when the balance was first created. + # + # @param currency [String] 3-character alphabetic ISO 4217 code for the local currency of the balance. + # + # @param last_transaction_event_token [String] Globally unique identifier for the last financial transaction event that impacte + # + # @param last_transaction_token [String] Globally unique identifier for the last financial transaction that impacted this + # + # @param pending_amount [Integer] Funds not available for spend due to card authorizations or pending ACH release. + # + # @param total_amount [Integer] The sum of available and pending balance in the currency's smallest unit (e.g., + # + # @param type [Symbol, Lithic::Models::FinancialAccountBalance::Type] Type of financial account. + # + # @param updated [Time] Date and time for when the balance was last updated. + + # Type of financial account. + # + # @see Lithic::Models::FinancialAccountBalance#type + module Type + extend Lithic::Internal::Type::Enum + + ISSUING = :ISSUING + OPERATING = :OPERATING + RESERVE = :RESERVE + SECURITY = :SECURITY + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/financial_account_create_params.rb b/lib/lithic/models/financial_account_create_params.rb new file mode 100644 index 00000000..6d8473bf --- /dev/null +++ b/lib/lithic/models/financial_account_create_params.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::FinancialAccounts#create + class FinancialAccountCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute nickname + # + # @return [String] + required :nickname, String + + # @!attribute type + # + # @return [Symbol, Lithic::Models::FinancialAccountCreateParams::Type] + required :type, enum: -> { Lithic::FinancialAccountCreateParams::Type } + + # @!attribute account_token + # + # @return [String, nil] + optional :account_token, String + + # @!attribute is_for_benefit_of + # + # @return [Boolean, nil] + optional :is_for_benefit_of, Lithic::Internal::Type::Boolean + + # @!attribute idempotency_key + # + # @return [String, nil] + optional :idempotency_key, String + + # @!method initialize(nickname:, type:, account_token: nil, is_for_benefit_of: nil, idempotency_key: nil, request_options: {}) + # @param nickname [String] + # @param type [Symbol, Lithic::Models::FinancialAccountCreateParams::Type] + # @param account_token [String] + # @param is_for_benefit_of [Boolean] + # @param idempotency_key [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + module Type + extend Lithic::Internal::Type::Enum + + OPERATING = :OPERATING + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/financial_account_created_webhook_event.rb b/lib/lithic/models/financial_account_created_webhook_event.rb new file mode 100644 index 00000000..f412434b --- /dev/null +++ b/lib/lithic/models/financial_account_created_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class FinancialAccountCreatedWebhookEvent < Lithic::Models::FinancialAccount + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"financial_account.created"] + required :event_type, const: :"financial_account.created" + + # @!method initialize(event_type: :"financial_account.created") + # @param event_type [Symbol, :"financial_account.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/financial_account_list_params.rb b/lib/lithic/models/financial_account_list_params.rb new file mode 100644 index 00000000..7f7b451e --- /dev/null +++ b/lib/lithic/models/financial_account_list_params.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::FinancialAccounts#list + class FinancialAccountListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute account_token + # List financial accounts for a given account_token or business_account_token + # + # @return [String, nil] + optional :account_token, String + + # @!attribute business_account_token + # List financial accounts for a given business_account_token + # + # @return [String, nil] + optional :business_account_token, String + + # @!attribute type + # List financial accounts of a given type + # + # @return [Symbol, Lithic::Models::FinancialAccountListParams::Type, nil] + optional :type, enum: -> { Lithic::FinancialAccountListParams::Type } + + # @!method initialize(account_token: nil, business_account_token: nil, type: nil, request_options: {}) + # @param account_token [String] List financial accounts for a given account_token or business_account_token + # + # @param business_account_token [String] List financial accounts for a given business_account_token + # + # @param type [Symbol, Lithic::Models::FinancialAccountListParams::Type] List financial accounts of a given type + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # List financial accounts of a given type + module Type + extend Lithic::Internal::Type::Enum + + ISSUING = :ISSUING + OPERATING = :OPERATING + RESERVE = :RESERVE + SECURITY = :SECURITY + EARLY_DIRECT_DEPOSIT_FLOAT = :EARLY_DIRECT_DEPOSIT_FLOAT + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/financial_account_register_account_number_params.rb b/lib/lithic/models/financial_account_register_account_number_params.rb new file mode 100644 index 00000000..93f3c354 --- /dev/null +++ b/lib/lithic/models/financial_account_register_account_number_params.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::FinancialAccounts#register_account_number + class FinancialAccountRegisterAccountNumberParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute financial_account_token + # + # @return [String] + required :financial_account_token, String + + # @!attribute account_number + # + # @return [String] + required :account_number, String + + # @!method initialize(financial_account_token:, account_number:, request_options: {}) + # @param financial_account_token [String] + # @param account_number [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/financial_account_retrieve_params.rb b/lib/lithic/models/financial_account_retrieve_params.rb new file mode 100644 index 00000000..99234619 --- /dev/null +++ b/lib/lithic/models/financial_account_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::FinancialAccounts#retrieve + class FinancialAccountRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute financial_account_token + # + # @return [String] + required :financial_account_token, String + + # @!method initialize(financial_account_token:, request_options: {}) + # @param financial_account_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/financial_account_update_params.rb b/lib/lithic/models/financial_account_update_params.rb new file mode 100644 index 00000000..212ea937 --- /dev/null +++ b/lib/lithic/models/financial_account_update_params.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::FinancialAccounts#update + class FinancialAccountUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute financial_account_token + # + # @return [String] + required :financial_account_token, String + + # @!attribute nickname + # + # @return [String, nil] + optional :nickname, String + + # @!method initialize(financial_account_token:, nickname: nil, request_options: {}) + # @param financial_account_token [String] + # @param nickname [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/financial_account_update_status_params.rb b/lib/lithic/models/financial_account_update_status_params.rb new file mode 100644 index 00000000..37fd9ed9 --- /dev/null +++ b/lib/lithic/models/financial_account_update_status_params.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::FinancialAccounts#update_status + class FinancialAccountUpdateStatusParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute financial_account_token + # + # @return [String] + required :financial_account_token, String + + # @!attribute status + # Status of the financial account + # + # @return [Symbol, Lithic::Models::FinancialAccountUpdateStatusParams::Status] + required :status, enum: -> { Lithic::FinancialAccountUpdateStatusParams::Status } + + # @!attribute substatus + # Substatus for the financial account + # + # @return [Symbol, Lithic::Models::FinancialAccountUpdateStatusParams::Substatus, nil] + required :substatus, enum: -> { Lithic::FinancialAccountUpdateStatusParams::Substatus }, nil?: true + + # @!attribute user_defined_status + # User-defined status for the financial account + # + # @return [String, nil] + optional :user_defined_status, String + + # @!method initialize(financial_account_token:, status:, substatus:, user_defined_status: nil, request_options: {}) + # @param financial_account_token [String] + # + # @param status [Symbol, Lithic::Models::FinancialAccountUpdateStatusParams::Status] Status of the financial account + # + # @param substatus [Symbol, Lithic::Models::FinancialAccountUpdateStatusParams::Substatus, nil] Substatus for the financial account + # + # @param user_defined_status [String] User-defined status for the financial account + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Status of the financial account + module Status + extend Lithic::Internal::Type::Enum + + OPEN = :OPEN + CLOSED = :CLOSED + SUSPENDED = :SUSPENDED + PENDING = :PENDING + + # @!method self.values + # @return [Array] + end + + # Substatus for the financial account + module Substatus + extend Lithic::Internal::Type::Enum + + CHARGED_OFF_FRAUD = :CHARGED_OFF_FRAUD + END_USER_REQUEST = :END_USER_REQUEST + BANK_REQUEST = :BANK_REQUEST + CHARGED_OFF_DELINQUENT = :CHARGED_OFF_DELINQUENT + INTEREST_AND_FEES_PAUSED = :INTEREST_AND_FEES_PAUSED + DELINQUENT = :DELINQUENT + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/financial_account_updated_webhook_event.rb b/lib/lithic/models/financial_account_updated_webhook_event.rb new file mode 100644 index 00000000..eaf7b969 --- /dev/null +++ b/lib/lithic/models/financial_account_updated_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class FinancialAccountUpdatedWebhookEvent < Lithic::Models::FinancialAccount + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"financial_account.updated"] + required :event_type, const: :"financial_account.updated" + + # @!method initialize(event_type: :"financial_account.updated") + # @param event_type [Symbol, :"financial_account.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/financial_accounts/balance_list_params.rb b/lib/lithic/models/financial_accounts/balance_list_params.rb new file mode 100644 index 00000000..bb19db70 --- /dev/null +++ b/lib/lithic/models/financial_accounts/balance_list_params.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + # @see Lithic::Resources::FinancialAccounts::Balances#list + class BalanceListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute financial_account_token + # + # @return [String] + required :financial_account_token, String + + # @!attribute balance_date + # UTC date of the balance to retrieve. Defaults to latest available balance + # + # @return [Time, nil] + optional :balance_date, Time + + # @!attribute last_transaction_event_token + # Balance after a given financial event occured. For example, passing the + # event_token of a $5 CARD_CLEARING financial event will return a balance + # decreased by $5 + # + # @return [String, nil] + optional :last_transaction_event_token, String + + # @!method initialize(financial_account_token:, balance_date: nil, last_transaction_event_token: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::FinancialAccounts::BalanceListParams} for more details. + # + # @param financial_account_token [String] + # + # @param balance_date [Time] UTC date of the balance to retrieve. Defaults to latest available balance + # + # @param last_transaction_event_token [String] Balance after a given financial event occured. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/category_balances.rb b/lib/lithic/models/financial_accounts/category_balances.rb new file mode 100644 index 00000000..2d1e5852 --- /dev/null +++ b/lib/lithic/models/financial_accounts/category_balances.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + class CategoryBalances < Lithic::Internal::Type::BaseModel + # @!attribute fees + # + # @return [Integer] + required :fees, Integer + + # @!attribute interest + # + # @return [Integer] + required :interest, Integer + + # @!attribute principal + # + # @return [Integer] + required :principal, Integer + + # @!method initialize(fees:, interest:, principal:) + # @param fees [Integer] + # @param interest [Integer] + # @param principal [Integer] + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/category_tier.rb b/lib/lithic/models/financial_accounts/category_tier.rb new file mode 100644 index 00000000..041ae461 --- /dev/null +++ b/lib/lithic/models/financial_accounts/category_tier.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + class CategoryTier < Lithic::Internal::Type::BaseModel + # @!attribute cap_rate + # Maximum interest rate for this category, e.g. '0.0525' for 5.25% + # + # @return [String, nil] + optional :cap_rate, String + + # @!attribute rate + # Interest rate for this category, e.g. '0.0525' for 5.25% + # + # @return [String, nil] + optional :rate, String + + # @!method initialize(cap_rate: nil, rate: nil) + # Rate and rate cap for interest on a category + # + # @param cap_rate [String] Maximum interest rate for this category, e.g. '0.0525' for 5.25% + # + # @param rate [String] Interest rate for this category, e.g. '0.0525' for 5.25% + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/credit_configuration_retrieve_params.rb b/lib/lithic/models/financial_accounts/credit_configuration_retrieve_params.rb new file mode 100644 index 00000000..32a7020c --- /dev/null +++ b/lib/lithic/models/financial_accounts/credit_configuration_retrieve_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + # @see Lithic::Resources::FinancialAccounts::CreditConfiguration#retrieve + class CreditConfigurationRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute financial_account_token + # + # @return [String] + required :financial_account_token, String + + # @!method initialize(financial_account_token:, request_options: {}) + # @param financial_account_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/credit_configuration_update_params.rb b/lib/lithic/models/financial_accounts/credit_configuration_update_params.rb new file mode 100644 index 00000000..af8563b6 --- /dev/null +++ b/lib/lithic/models/financial_accounts/credit_configuration_update_params.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + # @see Lithic::Resources::FinancialAccounts::CreditConfiguration#update + class CreditConfigurationUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute financial_account_token + # + # @return [String] + required :financial_account_token, String + + # @!attribute auto_collection_configuration + # + # @return [Lithic::Models::FinancialAccounts::CreditConfigurationUpdateParams::AutoCollectionConfiguration, nil] + optional :auto_collection_configuration, + -> { Lithic::FinancialAccounts::CreditConfigurationUpdateParams::AutoCollectionConfiguration } + + # @!attribute credit_limit + # + # @return [Integer, nil] + optional :credit_limit, Integer + + # @!attribute credit_product_token + # Globally unique identifier for the credit product + # + # @return [String, nil] + optional :credit_product_token, String + + # @!attribute external_bank_account_token + # + # @return [String, nil] + optional :external_bank_account_token, String + + # @!attribute tier + # Tier to assign to a financial account + # + # @return [String, nil] + optional :tier, String + + # @!method initialize(financial_account_token:, auto_collection_configuration: nil, credit_limit: nil, credit_product_token: nil, external_bank_account_token: nil, tier: nil, request_options: {}) + # @param financial_account_token [String] + # + # @param auto_collection_configuration [Lithic::Models::FinancialAccounts::CreditConfigurationUpdateParams::AutoCollectionConfiguration] + # + # @param credit_limit [Integer] + # + # @param credit_product_token [String] Globally unique identifier for the credit product + # + # @param external_bank_account_token [String] + # + # @param tier [String] Tier to assign to a financial account + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + class AutoCollectionConfiguration < Lithic::Internal::Type::BaseModel + # @!attribute auto_collection_enabled + # If auto collection is enabled for this account + # + # @return [Boolean, nil] + optional :auto_collection_enabled, Lithic::Internal::Type::Boolean + + # @!method initialize(auto_collection_enabled: nil) + # @param auto_collection_enabled [Boolean] If auto collection is enabled for this account + end + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/financial_account_credit_config.rb b/lib/lithic/models/financial_accounts/financial_account_credit_config.rb new file mode 100644 index 00000000..6bec52e5 --- /dev/null +++ b/lib/lithic/models/financial_accounts/financial_account_credit_config.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + # @see Lithic::Resources::FinancialAccounts::CreditConfiguration#retrieve + class FinancialAccountCreditConfig < Lithic::Internal::Type::BaseModel + # @!attribute account_token + # Globally unique identifier for the account + # + # @return [String] + required :account_token, String + + # @!attribute auto_collection_configuration + # + # @return [Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::AutoCollectionConfiguration] + required :auto_collection_configuration, + -> { Lithic::FinancialAccounts::FinancialAccountCreditConfig::AutoCollectionConfiguration } + + # @!attribute credit_limit + # + # @return [Integer, nil] + required :credit_limit, Integer, nil?: true + + # @!attribute credit_product_token + # Globally unique identifier for the credit product + # + # @return [String, nil] + required :credit_product_token, String, nil?: true + + # @!attribute external_bank_account_token + # + # @return [String, nil] + required :external_bank_account_token, String, nil?: true + + # @!attribute tier + # Tier assigned to the financial account + # + # @return [String, nil] + required :tier, String, nil?: true + + # @!method initialize(account_token:, auto_collection_configuration:, credit_limit:, credit_product_token:, external_bank_account_token:, tier:) + # @param account_token [String] Globally unique identifier for the account + # + # @param auto_collection_configuration [Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig::AutoCollectionConfiguration] + # + # @param credit_limit [Integer, nil] + # + # @param credit_product_token [String, nil] Globally unique identifier for the credit product + # + # @param external_bank_account_token [String, nil] + # + # @param tier [String, nil] Tier assigned to the financial account + + # @see Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig#auto_collection_configuration + class AutoCollectionConfiguration < Lithic::Internal::Type::BaseModel + # @!attribute auto_collection_enabled + # If auto collection is enabled for this account + # + # @return [Boolean] + required :auto_collection_enabled, Lithic::Internal::Type::Boolean + + # @!method initialize(auto_collection_enabled:) + # @param auto_collection_enabled [Boolean] If auto collection is enabled for this account + end + end + end + + FinancialAccountCreditConfig = FinancialAccounts::FinancialAccountCreditConfig + end +end diff --git a/lib/lithic/models/financial_accounts/financial_transaction_list_params.rb b/lib/lithic/models/financial_accounts/financial_transaction_list_params.rb new file mode 100644 index 00000000..5b5da707 --- /dev/null +++ b/lib/lithic/models/financial_accounts/financial_transaction_list_params.rb @@ -0,0 +1,126 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + # @see Lithic::Resources::FinancialAccounts::FinancialTransactions#list + class FinancialTransactionListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute financial_account_token + # + # @return [String] + required :financial_account_token, String + + # @!attribute begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time + + # @!attribute category + # Financial Transaction category to be returned. + # + # @return [Symbol, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Category, nil] + optional :category, enum: -> { Lithic::FinancialAccounts::FinancialTransactionListParams::Category } + + # @!attribute end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute result + # Financial Transaction result to be returned. + # + # @return [Symbol, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Result, nil] + optional :result, enum: -> { Lithic::FinancialAccounts::FinancialTransactionListParams::Result } + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!attribute status + # Financial Transaction status to be returned. + # + # @return [Symbol, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Status, nil] + optional :status, enum: -> { Lithic::FinancialAccounts::FinancialTransactionListParams::Status } + + # @!method initialize(financial_account_token:, begin_: nil, category: nil, end_: nil, ending_before: nil, result: nil, starting_after: nil, status: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::FinancialAccounts::FinancialTransactionListParams} for more + # details. + # + # @param financial_account_token [String] + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param category [Symbol, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Category] Financial Transaction category to be returned. + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param result [Symbol, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Result] Financial Transaction result to be returned. + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param status [Symbol, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Status] Financial Transaction status to be returned. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Financial Transaction category to be returned. + module Category + extend Lithic::Internal::Type::Enum + + ACH = :ACH + CARD = :CARD + INTERNAL = :INTERNAL + TRANSFER = :TRANSFER + + # @!method self.values + # @return [Array] + end + + # Financial Transaction result to be returned. + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + + # Financial Transaction status to be returned. + module Status + extend Lithic::Internal::Type::Enum + + DECLINED = :DECLINED + EXPIRED = :EXPIRED + PENDING = :PENDING + RETURNED = :RETURNED + SETTLED = :SETTLED + VOIDED = :VOIDED + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/financial_transaction_retrieve_params.rb b/lib/lithic/models/financial_accounts/financial_transaction_retrieve_params.rb new file mode 100644 index 00000000..22565387 --- /dev/null +++ b/lib/lithic/models/financial_accounts/financial_transaction_retrieve_params.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + # @see Lithic::Resources::FinancialAccounts::FinancialTransactions#retrieve + class FinancialTransactionRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute financial_account_token + # + # @return [String] + required :financial_account_token, String + + # @!attribute financial_transaction_token + # + # @return [String] + required :financial_transaction_token, String + + # @!method initialize(financial_account_token:, financial_transaction_token:, request_options: {}) + # @param financial_account_token [String] + # @param financial_transaction_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/interest_tier_schedule.rb b/lib/lithic/models/financial_accounts/interest_tier_schedule.rb new file mode 100644 index 00000000..e9610b87 --- /dev/null +++ b/lib/lithic/models/financial_accounts/interest_tier_schedule.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + # @see Lithic::Resources::FinancialAccounts::InterestTierSchedule#create + class FinancialAccountsInterestTierSchedule < Lithic::Internal::Type::BaseModel + # @!attribute credit_product_token + # Globally unique identifier for a credit product + # + # @return [String] + required :credit_product_token, String + + # @!attribute effective_date + # Date the tier should be effective in YYYY-MM-DD format + # + # @return [Date] + required :effective_date, Date + + # @!attribute penalty_rates + # Custom rates per category for penalties + # + # @return [Object, nil] + optional :penalty_rates, Lithic::Internal::Type::Unknown + + # @!attribute tier_name + # Name of a tier contained in the credit product. Mutually exclusive with + # tier_rates + # + # @return [String, nil] + optional :tier_name, String + + # @!attribute tier_rates + # Custom rates per category. Mutually exclusive with tier_name + # + # @return [Object, nil] + optional :tier_rates, Lithic::Internal::Type::Unknown + + # @!method initialize(credit_product_token:, effective_date:, penalty_rates: nil, tier_name: nil, tier_rates: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::FinancialAccounts::FinancialAccountsInterestTierSchedule} for + # more details. + # + # Entry in the Tier Schedule of an account + # + # @param credit_product_token [String] Globally unique identifier for a credit product + # + # @param effective_date [Date] Date the tier should be effective in YYYY-MM-DD format + # + # @param penalty_rates [Object] Custom rates per category for penalties + # + # @param tier_name [String] Name of a tier contained in the credit product. Mutually exclusive with tier_rat + # + # @param tier_rates [Object] Custom rates per category. Mutually exclusive with tier_name + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/interest_tier_schedule_create_params.rb b/lib/lithic/models/financial_accounts/interest_tier_schedule_create_params.rb new file mode 100644 index 00000000..fd3c478d --- /dev/null +++ b/lib/lithic/models/financial_accounts/interest_tier_schedule_create_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + # @see Lithic::Resources::FinancialAccounts::InterestTierSchedule#create + class InterestTierScheduleCreateParams < Lithic::Models::FinancialAccounts::FinancialAccountsInterestTierSchedule + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute financial_account_token + # + # @return [String] + required :financial_account_token, String + + # @!method initialize(financial_account_token:, request_options: {}) + # @param financial_account_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/interest_tier_schedule_delete_params.rb b/lib/lithic/models/financial_accounts/interest_tier_schedule_delete_params.rb new file mode 100644 index 00000000..1e4cd303 --- /dev/null +++ b/lib/lithic/models/financial_accounts/interest_tier_schedule_delete_params.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + # @see Lithic::Resources::FinancialAccounts::InterestTierSchedule#delete + class InterestTierScheduleDeleteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute financial_account_token + # + # @return [String] + required :financial_account_token, String + + # @!attribute effective_date + # + # @return [Date] + required :effective_date, Date + + # @!method initialize(financial_account_token:, effective_date:, request_options: {}) + # @param financial_account_token [String] + # @param effective_date [Date] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/interest_tier_schedule_list_params.rb b/lib/lithic/models/financial_accounts/interest_tier_schedule_list_params.rb new file mode 100644 index 00000000..895c7908 --- /dev/null +++ b/lib/lithic/models/financial_accounts/interest_tier_schedule_list_params.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + # @see Lithic::Resources::FinancialAccounts::InterestTierSchedule#list + class InterestTierScheduleListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute financial_account_token + # + # @return [String] + required :financial_account_token, String + + # @!attribute after_date + # Return schedules with effective_date >= after_date (ISO format YYYY-MM-DD) + # + # @return [Date, nil] + optional :after_date, Date + + # @!attribute before_date + # Return schedules with effective_date <= before_date (ISO format YYYY-MM-DD) + # + # @return [Date, nil] + optional :before_date, Date + + # @!attribute for_date + # Return schedule with effective_date == for_date (ISO format YYYY-MM-DD) + # + # @return [Date, nil] + optional :for_date, Date + + # @!method initialize(financial_account_token:, after_date: nil, before_date: nil, for_date: nil, request_options: {}) + # @param financial_account_token [String] + # + # @param after_date [Date] Return schedules with effective_date >= after_date (ISO format YYYY-MM-DD) + # + # @param before_date [Date] Return schedules with effective_date <= before_date (ISO format YYYY-MM-DD) + # + # @param for_date [Date] Return schedule with effective_date == for_date (ISO format YYYY-MM-DD) + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/interest_tier_schedule_retrieve_params.rb b/lib/lithic/models/financial_accounts/interest_tier_schedule_retrieve_params.rb new file mode 100644 index 00000000..df0c2197 --- /dev/null +++ b/lib/lithic/models/financial_accounts/interest_tier_schedule_retrieve_params.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + # @see Lithic::Resources::FinancialAccounts::InterestTierSchedule#retrieve + class InterestTierScheduleRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute financial_account_token + # + # @return [String] + required :financial_account_token, String + + # @!attribute effective_date + # + # @return [Date] + required :effective_date, Date + + # @!method initialize(financial_account_token:, effective_date:, request_options: {}) + # @param financial_account_token [String] + # @param effective_date [Date] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/interest_tier_schedule_update_params.rb b/lib/lithic/models/financial_accounts/interest_tier_schedule_update_params.rb new file mode 100644 index 00000000..21e8f5bf --- /dev/null +++ b/lib/lithic/models/financial_accounts/interest_tier_schedule_update_params.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + # @see Lithic::Resources::FinancialAccounts::InterestTierSchedule#update + class InterestTierScheduleUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute financial_account_token + # + # @return [String] + required :financial_account_token, String + + # @!attribute effective_date + # + # @return [Date] + required :effective_date, Date + + # @!attribute penalty_rates + # Custom rates per category for penalties + # + # @return [Object, nil] + optional :penalty_rates, Lithic::Internal::Type::Unknown + + # @!attribute tier_name + # Name of a tier contained in the credit product. Mutually exclusive with + # tier_rates + # + # @return [String, nil] + optional :tier_name, String + + # @!attribute tier_rates + # Custom rates per category. Mutually exclusive with tier_name + # + # @return [Object, nil] + optional :tier_rates, Lithic::Internal::Type::Unknown + + # @!method initialize(financial_account_token:, effective_date:, penalty_rates: nil, tier_name: nil, tier_rates: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::FinancialAccounts::InterestTierScheduleUpdateParams} for more + # details. + # + # @param financial_account_token [String] + # + # @param effective_date [Date] + # + # @param penalty_rates [Object] Custom rates per category for penalties + # + # @param tier_name [String] Name of a tier contained in the credit product. Mutually exclusive with tier_rat + # + # @param tier_rates [Object] Custom rates per category. Mutually exclusive with tier_name + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/loan_tape.rb b/lib/lithic/models/financial_accounts/loan_tape.rb new file mode 100644 index 00000000..ba2ae2d1 --- /dev/null +++ b/lib/lithic/models/financial_accounts/loan_tape.rb @@ -0,0 +1,516 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + # @see Lithic::Resources::FinancialAccounts::LoanTapes#retrieve + class LoanTape < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for a loan tape + # + # @return [String] + required :token, String + + # @!attribute account_standing + # + # @return [Lithic::Models::FinancialAccounts::LoanTape::AccountStanding] + required :account_standing, -> { Lithic::FinancialAccounts::LoanTape::AccountStanding } + + # @!attribute available_credit + # Amount of credit available to spend in cents + # + # @return [Integer] + required :available_credit, Integer + + # @!attribute balances + # + # @return [Lithic::Models::FinancialAccounts::LoanTape::Balances] + required :balances, -> { Lithic::FinancialAccounts::LoanTape::Balances } + + # @!attribute created + # Timestamp of when the loan tape was created + # + # @return [Time] + required :created, Time + + # @!attribute credit_limit + # For prepay accounts, this is the minimum prepay balance that must be maintained. + # For charge card accounts, this is the maximum credit balance extended by a + # lender + # + # @return [Integer] + required :credit_limit, Integer + + # @!attribute credit_product_token + # Globally unique identifier for a credit product + # + # @return [String] + required :credit_product_token, String + + # @!attribute date + # Date of transactions that this loan tape covers + # + # @return [Date] + required :date, Date + + # @!attribute day_totals + # + # @return [Lithic::Models::StatementTotals] + required :day_totals, -> { Lithic::StatementTotals } + + # @!attribute ending_balance + # Balance at the end of the day + # + # @return [Integer] + required :ending_balance, Integer + + # @!attribute excess_credits + # Excess credits in the form of provisional credits, payments, or purchase + # refunds. If positive, the account is in net credit state with no outstanding + # balances. An overpayment could land an account in this state + # + # @return [Integer] + required :excess_credits, Integer + + # @!attribute financial_account_token + # Globally unique identifier for a financial account + # + # @return [String] + required :financial_account_token, String + + # @!attribute interest_details + # + # @return [Lithic::Models::FinancialAccounts::LoanTape::InterestDetails, nil] + required :interest_details, -> { Lithic::FinancialAccounts::LoanTape::InterestDetails }, nil?: true + + # @!attribute minimum_payment_balance + # + # @return [Lithic::Models::FinancialAccounts::LoanTape::MinimumPaymentBalance] + required :minimum_payment_balance, -> { Lithic::FinancialAccounts::LoanTape::MinimumPaymentBalance } + + # @!attribute payment_allocation + # + # @return [Lithic::Models::FinancialAccounts::LoanTape::PaymentAllocation] + required :payment_allocation, -> { Lithic::FinancialAccounts::LoanTape::PaymentAllocation } + + # @!attribute period_totals + # + # @return [Lithic::Models::StatementTotals] + required :period_totals, -> { Lithic::StatementTotals } + + # @!attribute previous_statement_balance + # + # @return [Lithic::Models::FinancialAccounts::LoanTape::PreviousStatementBalance] + required :previous_statement_balance, -> { Lithic::FinancialAccounts::LoanTape::PreviousStatementBalance } + + # @!attribute starting_balance + # Balance at the start of the day + # + # @return [Integer] + required :starting_balance, Integer + + # @!attribute updated + # Timestamp of when the loan tape was updated + # + # @return [Time] + required :updated, Time + + # @!attribute version + # Version number of the loan tape. This starts at 1 + # + # @return [Integer] + required :version, Integer + + # @!attribute ytd_totals + # + # @return [Lithic::Models::StatementTotals] + required :ytd_totals, -> { Lithic::StatementTotals } + + # @!attribute day_of_period + # Day of the billing period that this loan tape covers, starting at 1 + # + # @return [Integer, nil] + optional :day_of_period, Integer, nil?: true + + # @!attribute tier + # Interest tier to which this account belongs to + # + # @return [String, nil] + optional :tier, String, nil?: true + + # @!method initialize(token:, account_standing:, available_credit:, balances:, created:, credit_limit:, credit_product_token:, date:, day_totals:, ending_balance:, excess_credits:, financial_account_token:, interest_details:, minimum_payment_balance:, payment_allocation:, period_totals:, previous_statement_balance:, starting_balance:, updated:, version:, ytd_totals:, day_of_period: nil, tier: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::FinancialAccounts::LoanTape} for more details. + # + # @param token [String] Globally unique identifier for a loan tape + # + # @param account_standing [Lithic::Models::FinancialAccounts::LoanTape::AccountStanding] + # + # @param available_credit [Integer] Amount of credit available to spend in cents + # + # @param balances [Lithic::Models::FinancialAccounts::LoanTape::Balances] + # + # @param created [Time] Timestamp of when the loan tape was created + # + # @param credit_limit [Integer] For prepay accounts, this is the minimum prepay balance that must be maintained. + # + # @param credit_product_token [String] Globally unique identifier for a credit product + # + # @param date [Date] Date of transactions that this loan tape covers + # + # @param day_totals [Lithic::Models::StatementTotals] + # + # @param ending_balance [Integer] Balance at the end of the day + # + # @param excess_credits [Integer] Excess credits in the form of provisional credits, payments, or purchase refunds + # + # @param financial_account_token [String] Globally unique identifier for a financial account + # + # @param interest_details [Lithic::Models::FinancialAccounts::LoanTape::InterestDetails, nil] + # + # @param minimum_payment_balance [Lithic::Models::FinancialAccounts::LoanTape::MinimumPaymentBalance] + # + # @param payment_allocation [Lithic::Models::FinancialAccounts::LoanTape::PaymentAllocation] + # + # @param period_totals [Lithic::Models::StatementTotals] + # + # @param previous_statement_balance [Lithic::Models::FinancialAccounts::LoanTape::PreviousStatementBalance] + # + # @param starting_balance [Integer] Balance at the start of the day + # + # @param updated [Time] Timestamp of when the loan tape was updated + # + # @param version [Integer] Version number of the loan tape. This starts at 1 + # + # @param ytd_totals [Lithic::Models::StatementTotals] + # + # @param day_of_period [Integer, nil] Day of the billing period that this loan tape covers, starting at 1 + # + # @param tier [String, nil] Interest tier to which this account belongs to + + # @see Lithic::Models::FinancialAccounts::LoanTape#account_standing + class AccountStanding < Lithic::Internal::Type::BaseModel + # @!attribute consecutive_full_payments_made + # Number of consecutive full payments made + # + # @return [Integer] + required :consecutive_full_payments_made, Integer + + # @!attribute consecutive_minimum_payments_made + # Number of consecutive minimum payments made + # + # @return [Integer] + required :consecutive_minimum_payments_made, Integer + + # @!attribute consecutive_minimum_payments_missed + # Number of consecutive minimum payments missed + # + # @return [Integer] + required :consecutive_minimum_payments_missed, Integer + + # @!attribute days_past_due + # Number of days past due + # + # @return [Integer] + required :days_past_due, Integer + + # @!attribute financial_account_state + # Information about the financial account state + # + # @return [Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState] + required :financial_account_state, + -> { Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState } + + # @!attribute has_grace + # Whether the account currently has grace or not + # + # @return [Boolean] + required :has_grace, Lithic::Internal::Type::Boolean + + # @!attribute period_number + # Current overall period number + # + # @return [Integer] + required :period_number, Integer + + # @!attribute period_state + # + # @return [Symbol, Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::PeriodState] + required :period_state, enum: -> { Lithic::FinancialAccounts::LoanTape::AccountStanding::PeriodState } + + # @!method initialize(consecutive_full_payments_made:, consecutive_minimum_payments_made:, consecutive_minimum_payments_missed:, days_past_due:, financial_account_state:, has_grace:, period_number:, period_state:) + # @param consecutive_full_payments_made [Integer] Number of consecutive full payments made + # + # @param consecutive_minimum_payments_made [Integer] Number of consecutive minimum payments made + # + # @param consecutive_minimum_payments_missed [Integer] Number of consecutive minimum payments missed + # + # @param days_past_due [Integer] Number of days past due + # + # @param financial_account_state [Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState] Information about the financial account state + # + # @param has_grace [Boolean] Whether the account currently has grace or not + # + # @param period_number [Integer] Current overall period number + # + # @param period_state [Symbol, Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::PeriodState] + + # @see Lithic::Models::FinancialAccounts::LoanTape::AccountStanding#financial_account_state + class FinancialAccountState < Lithic::Internal::Type::BaseModel + # @!attribute status + # Status of the financial account + # + # @return [Symbol, Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Status] + required :status, + enum: -> { Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Status } + + # @!attribute substatus + # Substatus for the financial account + # + # @return [Symbol, Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Substatus, nil] + optional :substatus, + enum: -> { + Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Substatus + }, + nil?: true + + # @!method initialize(status:, substatus: nil) + # Information about the financial account state + # + # @param status [Symbol, Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Status] Status of the financial account + # + # @param substatus [Symbol, Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Substatus, nil] Substatus for the financial account + + # Status of the financial account + # + # @see Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState#status + module Status + extend Lithic::Internal::Type::Enum + + OPEN = :OPEN + CLOSED = :CLOSED + SUSPENDED = :SUSPENDED + PENDING = :PENDING + + # @!method self.values + # @return [Array] + end + + # Substatus for the financial account + # + # @see Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState#substatus + module Substatus + extend Lithic::Internal::Type::Enum + + CHARGED_OFF_DELINQUENT = :CHARGED_OFF_DELINQUENT + CHARGED_OFF_FRAUD = :CHARGED_OFF_FRAUD + END_USER_REQUEST = :END_USER_REQUEST + BANK_REQUEST = :BANK_REQUEST + DELINQUENT = :DELINQUENT + INTEREST_AND_FEES_PAUSED = :INTEREST_AND_FEES_PAUSED + + # @!method self.values + # @return [Array] + end + end + + # @see Lithic::Models::FinancialAccounts::LoanTape::AccountStanding#period_state + module PeriodState + extend Lithic::Internal::Type::Enum + + STANDARD = :STANDARD + PROMO = :PROMO + PENALTY = :PENALTY + + # @!method self.values + # @return [Array] + end + end + + # @see Lithic::Models::FinancialAccounts::LoanTape#balances + class Balances < Lithic::Internal::Type::BaseModel + # @!attribute due + # Amount due for the prior billing cycle. Any amounts not fully paid off on this + # due date will be considered past due the next day + # + # @return [Lithic::Models::FinancialAccounts::CategoryBalances] + required :due, -> { Lithic::FinancialAccounts::CategoryBalances } + + # @!attribute next_statement_due + # Amount due for the current billing cycle. Any amounts not paid off by early + # payments or credits will be considered due at the end of the current billing + # period + # + # @return [Lithic::Models::FinancialAccounts::CategoryBalances] + required :next_statement_due, -> { Lithic::FinancialAccounts::CategoryBalances } + + # @!attribute past_due + # Amount not paid off on previous due dates + # + # @return [Lithic::Models::FinancialAccounts::CategoryBalances] + required :past_due, -> { Lithic::FinancialAccounts::CategoryBalances } + + # @!attribute past_statements_due + # Amount due for the past billing cycles. + # + # @return [Lithic::Models::FinancialAccounts::CategoryBalances] + required :past_statements_due, -> { Lithic::FinancialAccounts::CategoryBalances } + + # @!method initialize(due:, next_statement_due:, past_due:, past_statements_due:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::FinancialAccounts::LoanTape::Balances} for more details. + # + # @param due [Lithic::Models::FinancialAccounts::CategoryBalances] Amount due for the prior billing cycle. Any amounts not fully paid off on this d + # + # @param next_statement_due [Lithic::Models::FinancialAccounts::CategoryBalances] Amount due for the current billing cycle. Any amounts not paid off by early paym + # + # @param past_due [Lithic::Models::FinancialAccounts::CategoryBalances] Amount not paid off on previous due dates + # + # @param past_statements_due [Lithic::Models::FinancialAccounts::CategoryBalances] Amount due for the past billing cycles. + end + + # @see Lithic::Models::FinancialAccounts::LoanTape#interest_details + class InterestDetails < Lithic::Internal::Type::BaseModel + # @!attribute actual_interest_charged + # + # @return [Integer, nil] + required :actual_interest_charged, Integer, nil?: true + + # @!attribute daily_balance_amounts + # + # @return [Lithic::Models::CategoryDetails] + required :daily_balance_amounts, -> { Lithic::CategoryDetails } + + # @!attribute effective_apr + # + # @return [Lithic::Models::CategoryDetails] + required :effective_apr, -> { Lithic::CategoryDetails } + + # @!attribute interest_calculation_method + # + # @return [Symbol, Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::InterestCalculationMethod] + required :interest_calculation_method, + enum: -> { Lithic::FinancialAccounts::LoanTape::InterestDetails::InterestCalculationMethod } + + # @!attribute interest_for_period + # + # @return [Lithic::Models::CategoryDetails] + required :interest_for_period, -> { Lithic::CategoryDetails } + + # @!attribute prime_rate + # + # @return [String, nil] + required :prime_rate, String, nil?: true + + # @!attribute minimum_interest_charged + # + # @return [Integer, nil] + optional :minimum_interest_charged, Integer, nil?: true + + # @!method initialize(actual_interest_charged:, daily_balance_amounts:, effective_apr:, interest_calculation_method:, interest_for_period:, prime_rate:, minimum_interest_charged: nil) + # @param actual_interest_charged [Integer, nil] + # @param daily_balance_amounts [Lithic::Models::CategoryDetails] + # @param effective_apr [Lithic::Models::CategoryDetails] + # @param interest_calculation_method [Symbol, Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::InterestCalculationMethod] + # @param interest_for_period [Lithic::Models::CategoryDetails] + # @param prime_rate [String, nil] + # @param minimum_interest_charged [Integer, nil] + + # @see Lithic::Models::FinancialAccounts::LoanTape::InterestDetails#interest_calculation_method + module InterestCalculationMethod + extend Lithic::Internal::Type::Enum + + DAILY = :DAILY + AVERAGE_DAILY = :AVERAGE_DAILY + + # @!method self.values + # @return [Array] + end + end + + # @see Lithic::Models::FinancialAccounts::LoanTape#minimum_payment_balance + class MinimumPaymentBalance < Lithic::Internal::Type::BaseModel + # @!attribute amount + # + # @return [Integer] + required :amount, Integer + + # @!attribute remaining + # + # @return [Integer] + required :remaining, Integer + + # @!method initialize(amount:, remaining:) + # @param amount [Integer] + # @param remaining [Integer] + end + + # @see Lithic::Models::FinancialAccounts::LoanTape#payment_allocation + class PaymentAllocation < Lithic::Internal::Type::BaseModel + # @!attribute fee_details + # + # @return [Lithic::Models::CategoryDetails, nil] + required :fee_details, -> { Lithic::CategoryDetails }, nil?: true + + # @!attribute fees + # Amount allocated to fees in cents + # + # @return [Integer] + required :fees, Integer + + # @!attribute interest + # Amount allocated to interest in cents + # + # @return [Integer] + required :interest, Integer + + # @!attribute interest_details + # + # @return [Lithic::Models::CategoryDetails, nil] + required :interest_details, -> { Lithic::CategoryDetails }, nil?: true + + # @!attribute principal + # Amount allocated to principal in cents + # + # @return [Integer] + required :principal, Integer + + # @!attribute principal_details + # + # @return [Lithic::Models::CategoryDetails, nil] + required :principal_details, -> { Lithic::CategoryDetails }, nil?: true + + # @!method initialize(fee_details:, fees:, interest:, interest_details:, principal:, principal_details:) + # @param fee_details [Lithic::Models::CategoryDetails, nil] + # + # @param fees [Integer] Amount allocated to fees in cents + # + # @param interest [Integer] Amount allocated to interest in cents + # + # @param interest_details [Lithic::Models::CategoryDetails, nil] + # + # @param principal [Integer] Amount allocated to principal in cents + # + # @param principal_details [Lithic::Models::CategoryDetails, nil] + end + + # @see Lithic::Models::FinancialAccounts::LoanTape#previous_statement_balance + class PreviousStatementBalance < Lithic::Internal::Type::BaseModel + # @!attribute amount + # + # @return [Integer] + required :amount, Integer + + # @!attribute remaining + # + # @return [Integer] + required :remaining, Integer + + # @!method initialize(amount:, remaining:) + # @param amount [Integer] + # @param remaining [Integer] + end + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/loan_tape_configuration.rb b/lib/lithic/models/financial_accounts/loan_tape_configuration.rb new file mode 100644 index 00000000..20b799e9 --- /dev/null +++ b/lib/lithic/models/financial_accounts/loan_tape_configuration.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + # @see Lithic::Resources::FinancialAccounts::LoanTapeConfiguration#retrieve + class FinancialAccountsLoanTapeConfiguration < Lithic::Internal::Type::BaseModel + # @!attribute created_at + # + # @return [Time] + required :created_at, Time + + # @!attribute financial_account_token + # + # @return [String] + required :financial_account_token, String + + # @!attribute instance_token + # + # @return [String] + required :instance_token, String + + # @!attribute updated_at + # + # @return [Time] + required :updated_at, Time + + # @!attribute credit_product_token + # + # @return [String, nil] + optional :credit_product_token, String + + # @!attribute loan_tape_rebuild_configuration + # Configuration for building loan tapes + # + # @return [Lithic::Models::FinancialAccounts::LoanTapeRebuildConfiguration, nil] + optional :loan_tape_rebuild_configuration, -> { Lithic::FinancialAccounts::LoanTapeRebuildConfiguration } + + # @!attribute tier_schedule_changed_at + # + # @return [Time, nil] + optional :tier_schedule_changed_at, Time + + # @!method initialize(created_at:, financial_account_token:, instance_token:, updated_at:, credit_product_token: nil, loan_tape_rebuild_configuration: nil, tier_schedule_changed_at: nil) + # Configuration for loan tapes + # + # @param created_at [Time] + # + # @param financial_account_token [String] + # + # @param instance_token [String] + # + # @param updated_at [Time] + # + # @param credit_product_token [String] + # + # @param loan_tape_rebuild_configuration [Lithic::Models::FinancialAccounts::LoanTapeRebuildConfiguration] Configuration for building loan tapes + # + # @param tier_schedule_changed_at [Time] + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/loan_tape_configuration_retrieve_params.rb b/lib/lithic/models/financial_accounts/loan_tape_configuration_retrieve_params.rb new file mode 100644 index 00000000..43de4ad4 --- /dev/null +++ b/lib/lithic/models/financial_accounts/loan_tape_configuration_retrieve_params.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + # @see Lithic::Resources::FinancialAccounts::LoanTapeConfiguration#retrieve + class LoanTapeConfigurationRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute financial_account_token + # Globally unique identifier for financial account. + # + # @return [String] + required :financial_account_token, String + + # @!method initialize(financial_account_token:, request_options: {}) + # @param financial_account_token [String] Globally unique identifier for financial account. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/loan_tape_list_params.rb b/lib/lithic/models/financial_accounts/loan_tape_list_params.rb new file mode 100644 index 00000000..00aed2c4 --- /dev/null +++ b/lib/lithic/models/financial_accounts/loan_tape_list_params.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + # @see Lithic::Resources::FinancialAccounts::LoanTapes#list + class LoanTapeListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute financial_account_token + # Globally unique identifier for financial account. + # + # @return [String] + required :financial_account_token, String + + # @!attribute begin_ + # Date string in RFC 3339 format. Only entries created after the specified date + # will be included. + # + # @return [Date, nil] + optional :begin_, Date + + # @!attribute end_ + # Date string in RFC 3339 format. Only entries created before the specified date + # will be included. + # + # @return [Date, nil] + optional :end_, Date + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!method initialize(financial_account_token:, begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::FinancialAccounts::LoanTapeListParams} for more details. + # + # @param financial_account_token [String] Globally unique identifier for financial account. + # + # @param begin_ [Date] Date string in RFC 3339 format. Only entries created after the specified date wi + # + # @param end_ [Date] Date string in RFC 3339 format. Only entries created before the specified date w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/loan_tape_rebuild_configuration.rb b/lib/lithic/models/financial_accounts/loan_tape_rebuild_configuration.rb new file mode 100644 index 00000000..1c8f0de1 --- /dev/null +++ b/lib/lithic/models/financial_accounts/loan_tape_rebuild_configuration.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + class LoanTapeRebuildConfiguration < Lithic::Internal::Type::BaseModel + # @!attribute rebuild_needed + # Whether the account's loan tapes need to be rebuilt or not + # + # @return [Boolean] + required :rebuild_needed, Lithic::Internal::Type::Boolean + + # @!attribute last_rebuild + # The date for which the account's loan tapes were last rebuilt + # + # @return [Date, nil] + optional :last_rebuild, Date + + # @!attribute rebuild_from + # Date from which to start rebuilding from if the account requires a rebuild + # + # @return [Date, nil] + optional :rebuild_from, Date + + # @!method initialize(rebuild_needed:, last_rebuild: nil, rebuild_from: nil) + # Configuration for building loan tapes + # + # @param rebuild_needed [Boolean] Whether the account's loan tapes need to be rebuilt or not + # + # @param last_rebuild [Date] The date for which the account's loan tapes were last rebuilt + # + # @param rebuild_from [Date] Date from which to start rebuilding from if the account requires a rebuild + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/loan_tape_retrieve_params.rb b/lib/lithic/models/financial_accounts/loan_tape_retrieve_params.rb new file mode 100644 index 00000000..6034a24b --- /dev/null +++ b/lib/lithic/models/financial_accounts/loan_tape_retrieve_params.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + # @see Lithic::Resources::FinancialAccounts::LoanTapes#retrieve + class LoanTapeRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute financial_account_token + # Globally unique identifier for financial account. + # + # @return [String] + required :financial_account_token, String + + # @!attribute loan_tape_token + # Globally unique identifier for loan tape. + # + # @return [String] + required :loan_tape_token, String + + # @!method initialize(financial_account_token:, loan_tape_token:, request_options: {}) + # @param financial_account_token [String] Globally unique identifier for financial account. + # + # @param loan_tape_token [String] Globally unique identifier for loan tape. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/statement.rb b/lib/lithic/models/financial_accounts/statement.rb new file mode 100644 index 00000000..6f561aba --- /dev/null +++ b/lib/lithic/models/financial_accounts/statement.rb @@ -0,0 +1,481 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + # @see Lithic::Resources::FinancialAccounts::Statements#retrieve + class Statement < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for a statement + # + # @return [String] + required :token, String + + # @!attribute account_standing + # + # @return [Lithic::Models::FinancialAccounts::Statement::AccountStanding] + required :account_standing, -> { Lithic::FinancialAccounts::Statement::AccountStanding } + + # @!attribute amount_due + # + # @return [Lithic::Models::FinancialAccounts::Statement::AmountDue] + required :amount_due, -> { Lithic::FinancialAccounts::Statement::AmountDue } + + # @!attribute available_credit + # Amount of credit available to spend in cents + # + # @return [Integer] + required :available_credit, Integer + + # @!attribute created + # Timestamp of when the statement was created + # + # @return [Time] + required :created, Time + + # @!attribute credit_limit + # This is the maximum credit balance extended by the lender in cents + # + # @return [Integer] + required :credit_limit, Integer + + # @!attribute credit_product_token + # Globally unique identifier for a credit product + # + # @return [String, nil] + required :credit_product_token, String, nil?: true + + # @!attribute days_in_billing_cycle + # Number of days in the billing cycle + # + # @return [Integer] + required :days_in_billing_cycle, Integer + + # @!attribute ending_balance + # Balance at the end of the billing period. For charge cards, this should be the + # same at the statement amount due in cents + # + # @return [Integer] + required :ending_balance, Integer + + # @!attribute financial_account_token + # Globally unique identifier for a financial account + # + # @return [String] + required :financial_account_token, String + + # @!attribute payment_due_date + # Date when the payment is due + # + # @return [Date, nil] + required :payment_due_date, Date, nil?: true + + # @!attribute period_totals + # + # @return [Lithic::Models::StatementTotals] + required :period_totals, -> { Lithic::StatementTotals } + + # @!attribute starting_balance + # Balance at the start of the billing period + # + # @return [Integer] + required :starting_balance, Integer + + # @!attribute statement_end_date + # Date when the billing period ended + # + # @return [Date] + required :statement_end_date, Date + + # @!attribute statement_start_date + # Date when the billing period began + # + # @return [Date] + required :statement_start_date, Date + + # @!attribute statement_type + # + # @return [Symbol, Lithic::Models::FinancialAccounts::Statement::StatementType] + required :statement_type, enum: -> { Lithic::FinancialAccounts::Statement::StatementType } + + # @!attribute updated + # Timestamp of when the statement was updated + # + # @return [Time] + required :updated, Time + + # @!attribute ytd_totals + # + # @return [Lithic::Models::StatementTotals] + required :ytd_totals, -> { Lithic::StatementTotals } + + # @!attribute interest_details + # + # @return [Lithic::Models::FinancialAccounts::Statement::InterestDetails, nil] + optional :interest_details, -> { Lithic::FinancialAccounts::Statement::InterestDetails }, nil?: true + + # @!attribute next_payment_due_date + # Date when the next payment is due + # + # @return [Date, nil] + optional :next_payment_due_date, Date, nil?: true + + # @!attribute next_statement_end_date + # Date when the next billing period will end + # + # @return [Date, nil] + optional :next_statement_end_date, Date, nil?: true + + # @!attribute payoff_details + # Details on number and size of payments to pay off balance + # + # @return [Lithic::Models::FinancialAccounts::Statement::PayoffDetails, nil] + optional :payoff_details, -> { Lithic::FinancialAccounts::Statement::PayoffDetails }, nil?: true + + # @!attribute statement_totals + # + # @return [Lithic::Models::StatementTotals, nil] + optional :statement_totals, -> { Lithic::StatementTotals } + + # @!method initialize(token:, account_standing:, amount_due:, available_credit:, created:, credit_limit:, credit_product_token:, days_in_billing_cycle:, ending_balance:, financial_account_token:, payment_due_date:, period_totals:, starting_balance:, statement_end_date:, statement_start_date:, statement_type:, updated:, ytd_totals:, interest_details: nil, next_payment_due_date: nil, next_statement_end_date: nil, payoff_details: nil, statement_totals: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::FinancialAccounts::Statement} for more details. + # + # @param token [String] Globally unique identifier for a statement + # + # @param account_standing [Lithic::Models::FinancialAccounts::Statement::AccountStanding] + # + # @param amount_due [Lithic::Models::FinancialAccounts::Statement::AmountDue] + # + # @param available_credit [Integer] Amount of credit available to spend in cents + # + # @param created [Time] Timestamp of when the statement was created + # + # @param credit_limit [Integer] This is the maximum credit balance extended by the lender in cents + # + # @param credit_product_token [String, nil] Globally unique identifier for a credit product + # + # @param days_in_billing_cycle [Integer] Number of days in the billing cycle + # + # @param ending_balance [Integer] Balance at the end of the billing period. For charge cards, this should be the s + # + # @param financial_account_token [String] Globally unique identifier for a financial account + # + # @param payment_due_date [Date, nil] Date when the payment is due + # + # @param period_totals [Lithic::Models::StatementTotals] + # + # @param starting_balance [Integer] Balance at the start of the billing period + # + # @param statement_end_date [Date] Date when the billing period ended + # + # @param statement_start_date [Date] Date when the billing period began + # + # @param statement_type [Symbol, Lithic::Models::FinancialAccounts::Statement::StatementType] + # + # @param updated [Time] Timestamp of when the statement was updated + # + # @param ytd_totals [Lithic::Models::StatementTotals] + # + # @param interest_details [Lithic::Models::FinancialAccounts::Statement::InterestDetails, nil] + # + # @param next_payment_due_date [Date, nil] Date when the next payment is due + # + # @param next_statement_end_date [Date, nil] Date when the next billing period will end + # + # @param payoff_details [Lithic::Models::FinancialAccounts::Statement::PayoffDetails, nil] Details on number and size of payments to pay off balance + # + # @param statement_totals [Lithic::Models::StatementTotals] + + # @see Lithic::Models::FinancialAccounts::Statement#account_standing + class AccountStanding < Lithic::Internal::Type::BaseModel + # @!attribute consecutive_full_payments_made + # Number of consecutive full payments made + # + # @return [Integer] + required :consecutive_full_payments_made, Integer + + # @!attribute consecutive_minimum_payments_made + # Number of consecutive minimum payments made + # + # @return [Integer] + required :consecutive_minimum_payments_made, Integer + + # @!attribute consecutive_minimum_payments_missed + # Number of consecutive minimum payments missed + # + # @return [Integer] + required :consecutive_minimum_payments_missed, Integer + + # @!attribute days_past_due + # Number of days past due + # + # @return [Integer] + required :days_past_due, Integer + + # @!attribute financial_account_state + # Information about the financial account state + # + # @return [Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState] + required :financial_account_state, + -> { Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState } + + # @!attribute has_grace + # Whether the account currently has grace or not + # + # @return [Boolean] + required :has_grace, Lithic::Internal::Type::Boolean + + # @!attribute period_number + # Current overall period number + # + # @return [Integer] + required :period_number, Integer + + # @!attribute period_state + # + # @return [Symbol, Lithic::Models::FinancialAccounts::Statement::AccountStanding::PeriodState] + required :period_state, enum: -> { Lithic::FinancialAccounts::Statement::AccountStanding::PeriodState } + + # @!method initialize(consecutive_full_payments_made:, consecutive_minimum_payments_made:, consecutive_minimum_payments_missed:, days_past_due:, financial_account_state:, has_grace:, period_number:, period_state:) + # @param consecutive_full_payments_made [Integer] Number of consecutive full payments made + # + # @param consecutive_minimum_payments_made [Integer] Number of consecutive minimum payments made + # + # @param consecutive_minimum_payments_missed [Integer] Number of consecutive minimum payments missed + # + # @param days_past_due [Integer] Number of days past due + # + # @param financial_account_state [Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState] Information about the financial account state + # + # @param has_grace [Boolean] Whether the account currently has grace or not + # + # @param period_number [Integer] Current overall period number + # + # @param period_state [Symbol, Lithic::Models::FinancialAccounts::Statement::AccountStanding::PeriodState] + + # @see Lithic::Models::FinancialAccounts::Statement::AccountStanding#financial_account_state + class FinancialAccountState < Lithic::Internal::Type::BaseModel + # @!attribute status + # Status of the financial account + # + # @return [Symbol, Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Status] + required :status, + enum: -> { Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Status } + + # @!attribute substatus + # Substatus for the financial account + # + # @return [Symbol, Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Substatus, nil] + optional :substatus, + enum: -> { + Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Substatus + }, + nil?: true + + # @!method initialize(status:, substatus: nil) + # Information about the financial account state + # + # @param status [Symbol, Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Status] Status of the financial account + # + # @param substatus [Symbol, Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Substatus, nil] Substatus for the financial account + + # Status of the financial account + # + # @see Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState#status + module Status + extend Lithic::Internal::Type::Enum + + OPEN = :OPEN + CLOSED = :CLOSED + SUSPENDED = :SUSPENDED + PENDING = :PENDING + + # @!method self.values + # @return [Array] + end + + # Substatus for the financial account + # + # @see Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState#substatus + module Substatus + extend Lithic::Internal::Type::Enum + + CHARGED_OFF_DELINQUENT = :CHARGED_OFF_DELINQUENT + CHARGED_OFF_FRAUD = :CHARGED_OFF_FRAUD + END_USER_REQUEST = :END_USER_REQUEST + BANK_REQUEST = :BANK_REQUEST + DELINQUENT = :DELINQUENT + INTEREST_AND_FEES_PAUSED = :INTEREST_AND_FEES_PAUSED + + # @!method self.values + # @return [Array] + end + end + + # @see Lithic::Models::FinancialAccounts::Statement::AccountStanding#period_state + module PeriodState + extend Lithic::Internal::Type::Enum + + STANDARD = :STANDARD + PROMO = :PROMO + PENALTY = :PENALTY + + # @!method self.values + # @return [Array] + end + end + + # @see Lithic::Models::FinancialAccounts::Statement#amount_due + class AmountDue < Lithic::Internal::Type::BaseModel + # @!attribute amount + # Payment due at the end of the billing period in cents. Negative amount indicates + # something is owed. If the amount owed is positive there was a net credit. If + # auto-collections are enabled this is the amount that will be requested on the + # payment due date + # + # @return [Integer] + required :amount, Integer + + # @!attribute past_due + # Amount past due for statement in cents + # + # @return [Integer] + required :past_due, Integer + + # @!method initialize(amount:, past_due:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::FinancialAccounts::Statement::AmountDue} for more details. + # + # @param amount [Integer] Payment due at the end of the billing period in cents. Negative amount indicates + # + # @param past_due [Integer] Amount past due for statement in cents + end + + # @see Lithic::Models::FinancialAccounts::Statement#statement_type + module StatementType + extend Lithic::Internal::Type::Enum + + INITIAL = :INITIAL + PERIOD_END = :PERIOD_END + FINAL = :FINAL + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::FinancialAccounts::Statement#interest_details + class InterestDetails < Lithic::Internal::Type::BaseModel + # @!attribute actual_interest_charged + # + # @return [Integer, nil] + required :actual_interest_charged, Integer, nil?: true + + # @!attribute daily_balance_amounts + # + # @return [Lithic::Models::CategoryDetails] + required :daily_balance_amounts, -> { Lithic::CategoryDetails } + + # @!attribute effective_apr + # + # @return [Lithic::Models::CategoryDetails] + required :effective_apr, -> { Lithic::CategoryDetails } + + # @!attribute interest_calculation_method + # + # @return [Symbol, Lithic::Models::FinancialAccounts::Statement::InterestDetails::InterestCalculationMethod] + required :interest_calculation_method, + enum: -> { Lithic::FinancialAccounts::Statement::InterestDetails::InterestCalculationMethod } + + # @!attribute interest_for_period + # + # @return [Lithic::Models::CategoryDetails] + required :interest_for_period, -> { Lithic::CategoryDetails } + + # @!attribute prime_rate + # + # @return [String, nil] + required :prime_rate, String, nil?: true + + # @!attribute minimum_interest_charged + # + # @return [Integer, nil] + optional :minimum_interest_charged, Integer, nil?: true + + # @!method initialize(actual_interest_charged:, daily_balance_amounts:, effective_apr:, interest_calculation_method:, interest_for_period:, prime_rate:, minimum_interest_charged: nil) + # @param actual_interest_charged [Integer, nil] + # @param daily_balance_amounts [Lithic::Models::CategoryDetails] + # @param effective_apr [Lithic::Models::CategoryDetails] + # @param interest_calculation_method [Symbol, Lithic::Models::FinancialAccounts::Statement::InterestDetails::InterestCalculationMethod] + # @param interest_for_period [Lithic::Models::CategoryDetails] + # @param prime_rate [String, nil] + # @param minimum_interest_charged [Integer, nil] + + # @see Lithic::Models::FinancialAccounts::Statement::InterestDetails#interest_calculation_method + module InterestCalculationMethod + extend Lithic::Internal::Type::Enum + + DAILY = :DAILY + AVERAGE_DAILY = :AVERAGE_DAILY + + # @!method self.values + # @return [Array] + end + end + + # @see Lithic::Models::FinancialAccounts::Statement#payoff_details + class PayoffDetails < Lithic::Internal::Type::BaseModel + # @!attribute minimum_payment_months + # The number of months it would take to pay off the balance in full by only paying + # the minimum payment. "NA" will signal negative or zero amortization + # + # @return [String] + required :minimum_payment_months, String + + # @!attribute minimum_payment_total + # The sum of all interest and principal paid, in cents, when only paying minimum + # monthly payment. "NA" will signal negative or zero amortization + # + # @return [String] + required :minimum_payment_total, String + + # @!attribute payoff_period_length_months + # Number of months to full pay off + # + # @return [Integer, nil] + required :payoff_period_length_months, Integer, nil?: true + + # @!attribute payoff_period_monthly_payment_amount + # The amount needed to be paid, in cents, each month in order to pay off current + # balance in the payoff period + # + # @return [Integer, nil] + required :payoff_period_monthly_payment_amount, Integer, nil?: true + + # @!attribute payoff_period_payment_total + # The sum of all interest and principal paid, in cents, when paying off in the + # payoff period + # + # @return [Integer, nil] + required :payoff_period_payment_total, Integer, nil?: true + + # @!method initialize(minimum_payment_months:, minimum_payment_total:, payoff_period_length_months:, payoff_period_monthly_payment_amount:, payoff_period_payment_total:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::FinancialAccounts::Statement::PayoffDetails} for more details. + # + # Details on number and size of payments to pay off balance + # + # @param minimum_payment_months [String] The number of months it would take to pay off the balance in full by only paying + # + # @param minimum_payment_total [String] The sum of all interest and principal paid, in cents, when only paying minimum m + # + # @param payoff_period_length_months [Integer, nil] Number of months to full pay off + # + # @param payoff_period_monthly_payment_amount [Integer, nil] The amount needed to be paid, in cents, each month in order to pay off current b + # + # @param payoff_period_payment_total [Integer, nil] The sum of all interest and principal paid, in cents, when paying off in the pay + end + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/statement_list_params.rb b/lib/lithic/models/financial_accounts/statement_list_params.rb new file mode 100644 index 00000000..3bbb2a96 --- /dev/null +++ b/lib/lithic/models/financial_accounts/statement_list_params.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + # @see Lithic::Resources::FinancialAccounts::Statements#list + class StatementListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute financial_account_token + # Globally unique identifier for financial account. + # + # @return [String] + required :financial_account_token, String + + # @!attribute begin_ + # Date string in RFC 3339 format. Only entries created after the specified date + # will be included. + # + # @return [Date, nil] + optional :begin_, Date + + # @!attribute end_ + # Date string in RFC 3339 format. Only entries created before the specified date + # will be included. + # + # @return [Date, nil] + optional :end_, Date + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute include_initial_statements + # Whether to include the initial statement. It is not included by default. + # + # @return [Boolean, nil] + optional :include_initial_statements, Lithic::Internal::Type::Boolean + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!method initialize(financial_account_token:, begin_: nil, end_: nil, ending_before: nil, include_initial_statements: nil, page_size: nil, starting_after: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::FinancialAccounts::StatementListParams} for more details. + # + # @param financial_account_token [String] Globally unique identifier for financial account. + # + # @param begin_ [Date] Date string in RFC 3339 format. Only entries created after the specified date wi + # + # @param end_ [Date] Date string in RFC 3339 format. Only entries created before the specified date w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param include_initial_statements [Boolean] Whether to include the initial statement. It is not included by default. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/statement_retrieve_params.rb b/lib/lithic/models/financial_accounts/statement_retrieve_params.rb new file mode 100644 index 00000000..d061ed5b --- /dev/null +++ b/lib/lithic/models/financial_accounts/statement_retrieve_params.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + # @see Lithic::Resources::FinancialAccounts::Statements#retrieve + class StatementRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute financial_account_token + # Globally unique identifier for financial account. + # + # @return [String] + required :financial_account_token, String + + # @!attribute statement_token + # Globally unique identifier for statements. + # + # @return [String] + required :statement_token, String + + # @!method initialize(financial_account_token:, statement_token:, request_options: {}) + # @param financial_account_token [String] Globally unique identifier for financial account. + # + # @param statement_token [String] Globally unique identifier for statements. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/statements.rb b/lib/lithic/models/financial_accounts/statements.rb new file mode 100644 index 00000000..dd52096f --- /dev/null +++ b/lib/lithic/models/financial_accounts/statements.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + class FinancialAccountsStatements < Lithic::Internal::Type::BaseModel + # @!attribute data + # + # @return [Array] + required :data, -> { Lithic::Internal::Type::ArrayOf[Lithic::FinancialAccounts::Statement] } + + # @!attribute has_more + # + # @return [Boolean] + required :has_more, Lithic::Internal::Type::Boolean + + # @!method initialize(data:, has_more:) + # @param data [Array] + # @param has_more [Boolean] + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/statements/line_item_list_params.rb b/lib/lithic/models/financial_accounts/statements/line_item_list_params.rb new file mode 100644 index 00000000..a5e4e30c --- /dev/null +++ b/lib/lithic/models/financial_accounts/statements/line_item_list_params.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + module Statements + # @see Lithic::Resources::FinancialAccounts::Statements::LineItems#list + class LineItemListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute financial_account_token + # Globally unique identifier for financial account. + # + # @return [String] + required :financial_account_token, String + + # @!attribute statement_token + # Globally unique identifier for statements. + # + # @return [String] + required :statement_token, String + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!method initialize(financial_account_token:, statement_token:, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::FinancialAccounts::Statements::LineItemListParams} for more + # details. + # + # @param financial_account_token [String] Globally unique identifier for financial account. + # + # @param statement_token [String] Globally unique identifier for statements. + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end + end +end diff --git a/lib/lithic/models/financial_accounts/statements/statement_line_items.rb b/lib/lithic/models/financial_accounts/statements/statement_line_items.rb new file mode 100644 index 00000000..e41c8987 --- /dev/null +++ b/lib/lithic/models/financial_accounts/statements/statement_line_items.rb @@ -0,0 +1,281 @@ +# frozen_string_literal: true + +module Lithic + module Models + module FinancialAccounts + module Statements + class StatementLineItems < Lithic::Internal::Type::BaseModel + # @!attribute data + # + # @return [Array] + required :data, + -> { Lithic::Internal::Type::ArrayOf[Lithic::FinancialAccounts::Statements::StatementLineItems::Data] } + + # @!attribute has_more + # + # @return [Boolean] + required :has_more, Lithic::Internal::Type::Boolean + + # @!method initialize(data:, has_more:) + # @param data [Array] + # @param has_more [Boolean] + + class Data < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for a Statement Line Item + # + # @return [String] + required :token, String + + # @!attribute amount + # Transaction amount in cents + # + # @return [Integer] + required :amount, Integer + + # @!attribute category + # Note: Inbound wire transfers are coming soon (availability varies by partner + # bank). The WIRE category is a preview. To learn more, contact your customer + # success manager. + # + # @return [Symbol, Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::Category] + required :category, enum: -> { Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category } + + # @!attribute created + # Timestamp of when the line item was generated + # + # @return [Time] + required :created, Time + + # @!attribute currency + # 3-character alphabetic ISO 4217 code for the settling currency of the + # transaction + # + # @return [String] + required :currency, String + + # @!attribute effective_date + # Date that the transaction effected the account balance + # + # @return [Date] + required :effective_date, Date + + # @!attribute event_type + # + # @return [Symbol, Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType] + required :event_type, + enum: -> { Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType } + + # @!attribute financial_account_token + # Globally unique identifier for a financial account + # + # @return [String] + required :financial_account_token, String + + # @!attribute financial_transaction_event_token + # Globally unique identifier for a financial transaction event + # + # @return [String] + required :financial_transaction_event_token, String + + # @!attribute financial_transaction_token + # Globally unique identifier for a financial transaction + # + # @return [String] + required :financial_transaction_token, String + + # @!attribute card_token + # Globally unique identifier for a card + # + # @return [String, nil] + optional :card_token, String, nil?: true + + # @!attribute descriptor + # + # @return [String, nil] + optional :descriptor, String + + # @!attribute event_subtype + # Subtype of the event that generated the line items + # + # @return [String, nil] + optional :event_subtype, String, nil?: true + + # @!attribute loan_tape_date + # Date of the loan tape that generated this line item + # + # @return [Date, nil] + optional :loan_tape_date, Date, nil?: true + + # @!method initialize(token:, amount:, category:, created:, currency:, effective_date:, event_type:, financial_account_token:, financial_transaction_event_token:, financial_transaction_token:, card_token: nil, descriptor: nil, event_subtype: nil, loan_tape_date: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data} for + # more details. + # + # @param token [String] Globally unique identifier for a Statement Line Item + # + # @param amount [Integer] Transaction amount in cents + # + # @param category [Symbol, Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::Category] Note: Inbound wire transfers are coming soon (availability varies by partner ban + # + # @param created [Time] Timestamp of when the line item was generated + # + # @param currency [String] 3-character alphabetic ISO 4217 code for the settling currency of the transactio + # + # @param effective_date [Date] Date that the transaction effected the account balance + # + # @param event_type [Symbol, Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::EventType] + # + # @param financial_account_token [String] Globally unique identifier for a financial account + # + # @param financial_transaction_event_token [String] Globally unique identifier for a financial transaction event + # + # @param financial_transaction_token [String] Globally unique identifier for a financial transaction + # + # @param card_token [String, nil] Globally unique identifier for a card + # + # @param descriptor [String] + # + # @param event_subtype [String, nil] Subtype of the event that generated the line items + # + # @param loan_tape_date [Date, nil] Date of the loan tape that generated this line item + + # Note: Inbound wire transfers are coming soon (availability varies by partner + # bank). The WIRE category is a preview. To learn more, contact your customer + # success manager. + # + # @see Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data#category + module Category + extend Lithic::Internal::Type::Enum + + ACH = :ACH + WIRE = :WIRE + BALANCE_OR_FUNDING = :BALANCE_OR_FUNDING + FEE = :FEE + REWARD = :REWARD + ADJUSTMENT = :ADJUSTMENT + DERECOGNITION = :DERECOGNITION + DISPUTE = :DISPUTE + CARD = :CARD + EXTERNAL_ACH = :EXTERNAL_ACH + EXTERNAL_CHECK = :EXTERNAL_CHECK + EXTERNAL_FEDNOW = :EXTERNAL_FEDNOW + EXTERNAL_RTP = :EXTERNAL_RTP + EXTERNAL_TRANSFER = :EXTERNAL_TRANSFER + EXTERNAL_WIRE = :EXTERNAL_WIRE + MANAGEMENT_ADJUSTMENT = :MANAGEMENT_ADJUSTMENT + MANAGEMENT_DISPUTE = :MANAGEMENT_DISPUTE + MANAGEMENT_FEE = :MANAGEMENT_FEE + MANAGEMENT_REWARD = :MANAGEMENT_REWARD + MANAGEMENT_DISBURSEMENT = :MANAGEMENT_DISBURSEMENT + HOLD = :HOLD + PROGRAM_FUNDING = :PROGRAM_FUNDING + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data#event_type + module EventType + extend Lithic::Internal::Type::Enum + + ACH_ORIGINATION_CANCELLED = :ACH_ORIGINATION_CANCELLED + ACH_ORIGINATION_INITIATED = :ACH_ORIGINATION_INITIATED + ACH_ORIGINATION_PROCESSED = :ACH_ORIGINATION_PROCESSED + ACH_ORIGINATION_RELEASED = :ACH_ORIGINATION_RELEASED + ACH_ORIGINATION_REJECTED = :ACH_ORIGINATION_REJECTED + ACH_ORIGINATION_REVIEWED = :ACH_ORIGINATION_REVIEWED + ACH_ORIGINATION_SETTLED = :ACH_ORIGINATION_SETTLED + ACH_RECEIPT_PROCESSED = :ACH_RECEIPT_PROCESSED + ACH_RECEIPT_RELEASED = :ACH_RECEIPT_RELEASED + ACH_RECEIPT_SETTLED = :ACH_RECEIPT_SETTLED + ACH_RETURN_INITIATED = :ACH_RETURN_INITIATED + ACH_RETURN_PROCESSED = :ACH_RETURN_PROCESSED + ACH_RETURN_REJECTED = :ACH_RETURN_REJECTED + ACH_RETURN_SETTLED = :ACH_RETURN_SETTLED + AUTHORIZATION = :AUTHORIZATION + AUTHORIZATION_ADVICE = :AUTHORIZATION_ADVICE + AUTHORIZATION_EXPIRY = :AUTHORIZATION_EXPIRY + AUTHORIZATION_REVERSAL = :AUTHORIZATION_REVERSAL + BALANCE_INQUIRY = :BALANCE_INQUIRY + BILLING_ERROR = :BILLING_ERROR + BILLING_ERROR_REVERSAL = :BILLING_ERROR_REVERSAL + CARD_TO_CARD = :CARD_TO_CARD + CASH_BACK = :CASH_BACK + CASH_BACK_REVERSAL = :CASH_BACK_REVERSAL + CLEARING = :CLEARING + COLLECTION = :COLLECTION + CORRECTION_CREDIT = :CORRECTION_CREDIT + CORRECTION_DEBIT = :CORRECTION_DEBIT + CREDIT_AUTHORIZATION = :CREDIT_AUTHORIZATION + CREDIT_AUTHORIZATION_ADVICE = :CREDIT_AUTHORIZATION_ADVICE + CURRENCY_CONVERSION = :CURRENCY_CONVERSION + CURRENCY_CONVERSION_REVERSAL = :CURRENCY_CONVERSION_REVERSAL + DISPUTE_WON = :DISPUTE_WON + EXTERNAL_ACH_CANCELED = :EXTERNAL_ACH_CANCELED + EXTERNAL_ACH_INITIATED = :EXTERNAL_ACH_INITIATED + EXTERNAL_ACH_RELEASED = :EXTERNAL_ACH_RELEASED + EXTERNAL_ACH_REVERSED = :EXTERNAL_ACH_REVERSED + EXTERNAL_ACH_SETTLED = :EXTERNAL_ACH_SETTLED + EXTERNAL_CHECK_CANCELED = :EXTERNAL_CHECK_CANCELED + EXTERNAL_CHECK_INITIATED = :EXTERNAL_CHECK_INITIATED + EXTERNAL_CHECK_RELEASED = :EXTERNAL_CHECK_RELEASED + EXTERNAL_CHECK_REVERSED = :EXTERNAL_CHECK_REVERSED + EXTERNAL_CHECK_SETTLED = :EXTERNAL_CHECK_SETTLED + EXTERNAL_FEDNOW_CANCELED = :EXTERNAL_FEDNOW_CANCELED + EXTERNAL_FEDNOW_INITIATED = :EXTERNAL_FEDNOW_INITIATED + EXTERNAL_FEDNOW_RELEASED = :EXTERNAL_FEDNOW_RELEASED + EXTERNAL_FEDNOW_REVERSED = :EXTERNAL_FEDNOW_REVERSED + EXTERNAL_FEDNOW_SETTLED = :EXTERNAL_FEDNOW_SETTLED + EXTERNAL_RTP_CANCELED = :EXTERNAL_RTP_CANCELED + EXTERNAL_RTP_INITIATED = :EXTERNAL_RTP_INITIATED + EXTERNAL_RTP_RELEASED = :EXTERNAL_RTP_RELEASED + EXTERNAL_RTP_REVERSED = :EXTERNAL_RTP_REVERSED + EXTERNAL_RTP_SETTLED = :EXTERNAL_RTP_SETTLED + EXTERNAL_TRANSFER_CANCELED = :EXTERNAL_TRANSFER_CANCELED + EXTERNAL_TRANSFER_INITIATED = :EXTERNAL_TRANSFER_INITIATED + EXTERNAL_TRANSFER_RELEASED = :EXTERNAL_TRANSFER_RELEASED + EXTERNAL_TRANSFER_REVERSED = :EXTERNAL_TRANSFER_REVERSED + EXTERNAL_TRANSFER_SETTLED = :EXTERNAL_TRANSFER_SETTLED + EXTERNAL_WIRE_CANCELED = :EXTERNAL_WIRE_CANCELED + EXTERNAL_WIRE_INITIATED = :EXTERNAL_WIRE_INITIATED + EXTERNAL_WIRE_RELEASED = :EXTERNAL_WIRE_RELEASED + EXTERNAL_WIRE_REVERSED = :EXTERNAL_WIRE_REVERSED + EXTERNAL_WIRE_SETTLED = :EXTERNAL_WIRE_SETTLED + FINANCIAL_AUTHORIZATION = :FINANCIAL_AUTHORIZATION + FINANCIAL_CREDIT_AUTHORIZATION = :FINANCIAL_CREDIT_AUTHORIZATION + INTEREST = :INTEREST + INTEREST_REVERSAL = :INTEREST_REVERSAL + INTERNAL_ADJUSTMENT = :INTERNAL_ADJUSTMENT + LATE_PAYMENT = :LATE_PAYMENT + LATE_PAYMENT_REVERSAL = :LATE_PAYMENT_REVERSAL + LOSS_WRITE_OFF = :LOSS_WRITE_OFF + PROVISIONAL_CREDIT = :PROVISIONAL_CREDIT + PROVISIONAL_CREDIT_REVERSAL = :PROVISIONAL_CREDIT_REVERSAL + SERVICE = :SERVICE + RETURN = :RETURN + RETURN_REVERSAL = :RETURN_REVERSAL + TRANSFER = :TRANSFER + TRANSFER_INSUFFICIENT_FUNDS = :TRANSFER_INSUFFICIENT_FUNDS + RETURNED_PAYMENT = :RETURNED_PAYMENT + RETURNED_PAYMENT_REVERSAL = :RETURNED_PAYMENT_REVERSAL + LITHIC_NETWORK_PAYMENT = :LITHIC_NETWORK_PAYMENT + ANNUAL = :ANNUAL + ANNUAL_REVERSAL = :ANNUAL_REVERSAL + QUARTERLY = :QUARTERLY + QUARTERLY_REVERSAL = :QUARTERLY_REVERSAL + MONTHLY = :MONTHLY + MONTHLY_REVERSAL = :MONTHLY_REVERSAL + ACCOUNT_TO_ACCOUNT = :ACCOUNT_TO_ACCOUNT + + # @!method self.values + # @return [Array] + end + end + end + end + + StatementLineItems = Statements::StatementLineItems + end + end +end diff --git a/lib/lithic/models/financial_event.rb b/lib/lithic/models/financial_event.rb new file mode 100644 index 00000000..0e7fc6ab --- /dev/null +++ b/lib/lithic/models/financial_event.rb @@ -0,0 +1,165 @@ +# frozen_string_literal: true + +module Lithic + module Models + class FinancialEvent < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier. + # + # @return [String, nil] + optional :token, String + + # @!attribute amount + # Amount of the financial event that has been settled in the currency's smallest + # unit (e.g., cents). + # + # @return [Integer, nil] + optional :amount, Integer + + # @!attribute created + # Date and time when the financial event occurred. UTC time zone. + # + # @return [Time, nil] + optional :created, Time + + # @!attribute result + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + # + # @return [Symbol, Lithic::Models::FinancialEvent::Result, nil] + optional :result, enum: -> { Lithic::FinancialEvent::Result } + + # @!attribute type + # + # @return [Symbol, Lithic::Models::FinancialEvent::Type, nil] + optional :type, enum: -> { Lithic::FinancialEvent::Type } + + # @!method initialize(token: nil, amount: nil, created: nil, result: nil, type: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::FinancialEvent} for more details. + # + # Financial Event + # + # @param token [String] Globally unique identifier. + # + # @param amount [Integer] Amount of the financial event that has been settled in the currency's smallest u + # + # @param created [Time] Date and time when the financial event occurred. UTC time zone. + # + # @param result [Symbol, Lithic::Models::FinancialEvent::Result] APPROVED financial events were successful while DECLINED financial events were d + # + # @param type [Symbol, Lithic::Models::FinancialEvent::Type] + + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + # + # @see Lithic::Models::FinancialEvent#result + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::FinancialEvent#type + module Type + extend Lithic::Internal::Type::Enum + + ACH_ORIGINATION_CANCELLED = :ACH_ORIGINATION_CANCELLED + ACH_ORIGINATION_INITIATED = :ACH_ORIGINATION_INITIATED + ACH_ORIGINATION_PROCESSED = :ACH_ORIGINATION_PROCESSED + ACH_ORIGINATION_RELEASED = :ACH_ORIGINATION_RELEASED + ACH_ORIGINATION_REJECTED = :ACH_ORIGINATION_REJECTED + ACH_ORIGINATION_REVIEWED = :ACH_ORIGINATION_REVIEWED + ACH_ORIGINATION_SETTLED = :ACH_ORIGINATION_SETTLED + ACH_RECEIPT_PROCESSED = :ACH_RECEIPT_PROCESSED + ACH_RECEIPT_RELEASED = :ACH_RECEIPT_RELEASED + ACH_RECEIPT_SETTLED = :ACH_RECEIPT_SETTLED + ACH_RETURN_INITIATED = :ACH_RETURN_INITIATED + ACH_RETURN_PROCESSED = :ACH_RETURN_PROCESSED + ACH_RETURN_REJECTED = :ACH_RETURN_REJECTED + ACH_RETURN_SETTLED = :ACH_RETURN_SETTLED + AUTHORIZATION = :AUTHORIZATION + AUTHORIZATION_ADVICE = :AUTHORIZATION_ADVICE + AUTHORIZATION_EXPIRY = :AUTHORIZATION_EXPIRY + AUTHORIZATION_REVERSAL = :AUTHORIZATION_REVERSAL + BALANCE_INQUIRY = :BALANCE_INQUIRY + BILLING_ERROR = :BILLING_ERROR + BILLING_ERROR_REVERSAL = :BILLING_ERROR_REVERSAL + CARD_TO_CARD = :CARD_TO_CARD + CASH_BACK = :CASH_BACK + CASH_BACK_REVERSAL = :CASH_BACK_REVERSAL + CLEARING = :CLEARING + COLLECTION = :COLLECTION + CORRECTION_CREDIT = :CORRECTION_CREDIT + CORRECTION_DEBIT = :CORRECTION_DEBIT + CREDIT_AUTHORIZATION = :CREDIT_AUTHORIZATION + CREDIT_AUTHORIZATION_ADVICE = :CREDIT_AUTHORIZATION_ADVICE + CURRENCY_CONVERSION = :CURRENCY_CONVERSION + CURRENCY_CONVERSION_REVERSAL = :CURRENCY_CONVERSION_REVERSAL + DISPUTE_WON = :DISPUTE_WON + EXTERNAL_ACH_CANCELED = :EXTERNAL_ACH_CANCELED + EXTERNAL_ACH_INITIATED = :EXTERNAL_ACH_INITIATED + EXTERNAL_ACH_RELEASED = :EXTERNAL_ACH_RELEASED + EXTERNAL_ACH_REVERSED = :EXTERNAL_ACH_REVERSED + EXTERNAL_ACH_SETTLED = :EXTERNAL_ACH_SETTLED + EXTERNAL_CHECK_CANCELED = :EXTERNAL_CHECK_CANCELED + EXTERNAL_CHECK_INITIATED = :EXTERNAL_CHECK_INITIATED + EXTERNAL_CHECK_RELEASED = :EXTERNAL_CHECK_RELEASED + EXTERNAL_CHECK_REVERSED = :EXTERNAL_CHECK_REVERSED + EXTERNAL_CHECK_SETTLED = :EXTERNAL_CHECK_SETTLED + EXTERNAL_FEDNOW_CANCELED = :EXTERNAL_FEDNOW_CANCELED + EXTERNAL_FEDNOW_INITIATED = :EXTERNAL_FEDNOW_INITIATED + EXTERNAL_FEDNOW_RELEASED = :EXTERNAL_FEDNOW_RELEASED + EXTERNAL_FEDNOW_REVERSED = :EXTERNAL_FEDNOW_REVERSED + EXTERNAL_FEDNOW_SETTLED = :EXTERNAL_FEDNOW_SETTLED + EXTERNAL_RTP_CANCELED = :EXTERNAL_RTP_CANCELED + EXTERNAL_RTP_INITIATED = :EXTERNAL_RTP_INITIATED + EXTERNAL_RTP_RELEASED = :EXTERNAL_RTP_RELEASED + EXTERNAL_RTP_REVERSED = :EXTERNAL_RTP_REVERSED + EXTERNAL_RTP_SETTLED = :EXTERNAL_RTP_SETTLED + EXTERNAL_TRANSFER_CANCELED = :EXTERNAL_TRANSFER_CANCELED + EXTERNAL_TRANSFER_INITIATED = :EXTERNAL_TRANSFER_INITIATED + EXTERNAL_TRANSFER_RELEASED = :EXTERNAL_TRANSFER_RELEASED + EXTERNAL_TRANSFER_REVERSED = :EXTERNAL_TRANSFER_REVERSED + EXTERNAL_TRANSFER_SETTLED = :EXTERNAL_TRANSFER_SETTLED + EXTERNAL_WIRE_CANCELED = :EXTERNAL_WIRE_CANCELED + EXTERNAL_WIRE_INITIATED = :EXTERNAL_WIRE_INITIATED + EXTERNAL_WIRE_RELEASED = :EXTERNAL_WIRE_RELEASED + EXTERNAL_WIRE_REVERSED = :EXTERNAL_WIRE_REVERSED + EXTERNAL_WIRE_SETTLED = :EXTERNAL_WIRE_SETTLED + FINANCIAL_AUTHORIZATION = :FINANCIAL_AUTHORIZATION + FINANCIAL_CREDIT_AUTHORIZATION = :FINANCIAL_CREDIT_AUTHORIZATION + INTEREST = :INTEREST + INTEREST_REVERSAL = :INTEREST_REVERSAL + INTERNAL_ADJUSTMENT = :INTERNAL_ADJUSTMENT + LATE_PAYMENT = :LATE_PAYMENT + LATE_PAYMENT_REVERSAL = :LATE_PAYMENT_REVERSAL + LOSS_WRITE_OFF = :LOSS_WRITE_OFF + PROVISIONAL_CREDIT = :PROVISIONAL_CREDIT + PROVISIONAL_CREDIT_REVERSAL = :PROVISIONAL_CREDIT_REVERSAL + SERVICE = :SERVICE + RETURN = :RETURN + RETURN_REVERSAL = :RETURN_REVERSAL + TRANSFER = :TRANSFER + TRANSFER_INSUFFICIENT_FUNDS = :TRANSFER_INSUFFICIENT_FUNDS + RETURNED_PAYMENT = :RETURNED_PAYMENT + RETURNED_PAYMENT_REVERSAL = :RETURNED_PAYMENT_REVERSAL + LITHIC_NETWORK_PAYMENT = :LITHIC_NETWORK_PAYMENT + ANNUAL = :ANNUAL + ANNUAL_REVERSAL = :ANNUAL_REVERSAL + QUARTERLY = :QUARTERLY + QUARTERLY_REVERSAL = :QUARTERLY_REVERSAL + MONTHLY = :MONTHLY + MONTHLY_REVERSAL = :MONTHLY_REVERSAL + ACCOUNT_TO_ACCOUNT = :ACCOUNT_TO_ACCOUNT + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/financial_transaction.rb b/lib/lithic/models/financial_transaction.rb new file mode 100644 index 00000000..d987a017 --- /dev/null +++ b/lib/lithic/models/financial_transaction.rb @@ -0,0 +1,181 @@ +# frozen_string_literal: true + +module Lithic + module Models + class FinancialTransaction < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier. + # + # @return [String] + required :token, String + + # @!attribute category + # Status types: + # + # - `CARD` - Issuing card transaction. + # - `ACH` - Transaction over ACH. + # - `INTERNAL` - Transaction for internal adjustment. + # - `TRANSFER` - Internal transfer of funds between financial accounts in your + # program. + # + # @return [Symbol, Lithic::Models::FinancialTransaction::Category] + required :category, enum: -> { Lithic::FinancialTransaction::Category } + + # @!attribute created + # Date and time when the financial transaction first occurred. UTC time zone. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # 3-character alphabetic ISO 4217 code for the settling currency of the + # transaction. + # + # @return [String] + required :currency, String + + # @!attribute descriptor + # A string that provides a description of the financial transaction; may be useful + # to display to users. + # + # @return [String] + required :descriptor, String + + # @!attribute events + # A list of all financial events that have modified this financial transaction. + # + # @return [Array] + required :events, -> { Lithic::Internal::Type::ArrayOf[Lithic::FinancialEvent] } + + # @!attribute pending_amount + # Pending amount of the transaction in the currency's smallest unit (e.g., cents), + # including any acquirer fees. + # + # The value of this field will go to zero over time once the financial transaction + # is settled. + # + # @return [Integer] + required :pending_amount, Integer + + # @!attribute result + # APPROVED transactions were successful while DECLINED transactions were declined + # by user, Lithic, or the network. + # + # @return [Symbol, Lithic::Models::FinancialTransaction::Result] + required :result, enum: -> { Lithic::FinancialTransaction::Result } + + # @!attribute settled_amount + # Amount of the transaction that has been settled in the currency's smallest unit + # (e.g., cents), including any acquirer fees. This may change over time. + # + # @return [Integer] + required :settled_amount, Integer + + # @!attribute status + # Status types: + # + # - `DECLINED` - The transaction was declined. + # - `EXPIRED` - The authorization as it has passed its expiration time. Card + # transaction only. + # - `PENDING` - The transaction is expected to settle. + # - `RETURNED` - The transaction has been returned. + # - `SETTLED` - The transaction is completed. + # - `VOIDED` - The transaction was voided. Card transaction only. + # + # @return [Symbol, Lithic::Models::FinancialTransaction::Status] + required :status, enum: -> { Lithic::FinancialTransaction::Status } + + # @!attribute updated + # Date and time when the financial transaction was last updated. UTC time zone. + # + # @return [Time] + required :updated, Time + + # @!method initialize(token:, category:, created:, currency:, descriptor:, events:, pending_amount:, result:, settled_amount:, status:, updated:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::FinancialTransaction} for more details. + # + # @param token [String] Globally unique identifier. + # + # @param category [Symbol, Lithic::Models::FinancialTransaction::Category] Status types: + # + # @param created [Time] Date and time when the financial transaction first occurred. UTC time zone. + # + # @param currency [String] 3-character alphabetic ISO 4217 code for the settling currency of the transactio + # + # @param descriptor [String] A string that provides a description of the financial transaction; may be useful + # + # @param events [Array] A list of all financial events that have modified this financial transaction. + # + # @param pending_amount [Integer] Pending amount of the transaction in the currency's smallest unit (e.g., cents), + # + # @param result [Symbol, Lithic::Models::FinancialTransaction::Result] APPROVED transactions were successful while DECLINED transactions were declined + # + # @param settled_amount [Integer] Amount of the transaction that has been settled in the currency's smallest unit + # + # @param status [Symbol, Lithic::Models::FinancialTransaction::Status] Status types: + # + # @param updated [Time] Date and time when the financial transaction was last updated. UTC time zone. + + # Status types: + # + # - `CARD` - Issuing card transaction. + # - `ACH` - Transaction over ACH. + # - `INTERNAL` - Transaction for internal adjustment. + # - `TRANSFER` - Internal transfer of funds between financial accounts in your + # program. + # + # @see Lithic::Models::FinancialTransaction#category + module Category + extend Lithic::Internal::Type::Enum + + ACH = :ACH + CARD = :CARD + INTERNAL = :INTERNAL + TRANSFER = :TRANSFER + + # @!method self.values + # @return [Array] + end + + # APPROVED transactions were successful while DECLINED transactions were declined + # by user, Lithic, or the network. + # + # @see Lithic::Models::FinancialTransaction#result + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + + # Status types: + # + # - `DECLINED` - The transaction was declined. + # - `EXPIRED` - The authorization as it has passed its expiration time. Card + # transaction only. + # - `PENDING` - The transaction is expected to settle. + # - `RETURNED` - The transaction has been returned. + # - `SETTLED` - The transaction is completed. + # - `VOIDED` - The transaction was voided. Card transaction only. + # + # @see Lithic::Models::FinancialTransaction#status + module Status + extend Lithic::Internal::Type::Enum + + DECLINED = :DECLINED + EXPIRED = :EXPIRED + PENDING = :PENDING + RETURNED = :RETURNED + SETTLED = :SETTLED + VOIDED = :VOIDED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/fraud/transaction_report_params.rb b/lib/lithic/models/fraud/transaction_report_params.rb new file mode 100644 index 00000000..52a1cb91 --- /dev/null +++ b/lib/lithic/models/fraud/transaction_report_params.rb @@ -0,0 +1,137 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Fraud + # @see Lithic::Resources::Fraud::Transactions#report + class TransactionReportParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute transaction_token + # + # @return [String] + required :transaction_token, String + + # @!attribute fraud_status + # The fraud status of the transaction, string (enum) supporting the following + # values: + # + # - `SUSPECTED_FRAUD`: The transaction is suspected to be fraudulent, but this + # hasn’t been confirmed. + # - `FRAUDULENT`: The transaction is confirmed to be fraudulent. A transaction may + # immediately be moved into this state, or be graduated into this state from the + # `SUSPECTED_FRAUD` state. + # - `NOT_FRAUDULENT`: The transaction is (explicitly) marked as not fraudulent. A + # transaction may immediately be moved into this state, or be graduated into + # this state from the `SUSPECTED_FRAUD` state. + # + # @return [Symbol, Lithic::Models::Fraud::TransactionReportParams::FraudStatus] + required :fraud_status, enum: -> { Lithic::Fraud::TransactionReportParams::FraudStatus } + + # @!attribute comment + # Optional field providing additional information or context about why the + # transaction is considered fraudulent. + # + # @return [String, nil] + optional :comment, String + + # @!attribute fraud_type + # Specifies the type or category of fraud that the transaction is suspected or + # confirmed to involve, string (enum) supporting the following values: + # + # - `FIRST_PARTY_FRAUD`: First-party fraud occurs when a legitimate account or + # cardholder intentionally misuses financial services for personal gain. This + # includes actions such as disputing legitimate transactions to obtain a refund, + # abusing return policies, or defaulting on credit obligations without intent to + # repay. + # - `ACCOUNT_TAKEOVER`: Account takeover fraud occurs when a fraudster gains + # unauthorized access to an existing account, modifies account settings, and + # carries out fraudulent transactions. + # - `CARD_COMPROMISED`: Card compromised fraud occurs when a fraudster gains + # access to card details without taking over the account, such as through + # physical card theft, cloning, or online data breaches. + # - `IDENTITY_THEFT`: Identity theft fraud occurs when a fraudster uses stolen + # personal information, such as Social Security numbers or addresses, to open + # accounts, apply for loans, or conduct financial transactions in someone's + # name. + # - `CARDHOLDER_MANIPULATION`: This type of fraud occurs when a fraudster + # manipulates or coerces a legitimate cardholder into unauthorized transactions, + # often through social engineering tactics. + # + # @return [Symbol, Lithic::Models::Fraud::TransactionReportParams::FraudType, nil] + optional :fraud_type, enum: -> { Lithic::Fraud::TransactionReportParams::FraudType } + + # @!method initialize(transaction_token:, fraud_status:, comment: nil, fraud_type: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Fraud::TransactionReportParams} for more details. + # + # @param transaction_token [String] + # + # @param fraud_status [Symbol, Lithic::Models::Fraud::TransactionReportParams::FraudStatus] The fraud status of the transaction, string (enum) supporting the following valu + # + # @param comment [String] Optional field providing additional information or context about why the transac + # + # @param fraud_type [Symbol, Lithic::Models::Fraud::TransactionReportParams::FraudType] Specifies the type or category of fraud that the transaction is suspected or con + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # The fraud status of the transaction, string (enum) supporting the following + # values: + # + # - `SUSPECTED_FRAUD`: The transaction is suspected to be fraudulent, but this + # hasn’t been confirmed. + # - `FRAUDULENT`: The transaction is confirmed to be fraudulent. A transaction may + # immediately be moved into this state, or be graduated into this state from the + # `SUSPECTED_FRAUD` state. + # - `NOT_FRAUDULENT`: The transaction is (explicitly) marked as not fraudulent. A + # transaction may immediately be moved into this state, or be graduated into + # this state from the `SUSPECTED_FRAUD` state. + module FraudStatus + extend Lithic::Internal::Type::Enum + + SUSPECTED_FRAUD = :SUSPECTED_FRAUD + FRAUDULENT = :FRAUDULENT + NOT_FRAUDULENT = :NOT_FRAUDULENT + + # @!method self.values + # @return [Array] + end + + # Specifies the type or category of fraud that the transaction is suspected or + # confirmed to involve, string (enum) supporting the following values: + # + # - `FIRST_PARTY_FRAUD`: First-party fraud occurs when a legitimate account or + # cardholder intentionally misuses financial services for personal gain. This + # includes actions such as disputing legitimate transactions to obtain a refund, + # abusing return policies, or defaulting on credit obligations without intent to + # repay. + # - `ACCOUNT_TAKEOVER`: Account takeover fraud occurs when a fraudster gains + # unauthorized access to an existing account, modifies account settings, and + # carries out fraudulent transactions. + # - `CARD_COMPROMISED`: Card compromised fraud occurs when a fraudster gains + # access to card details without taking over the account, such as through + # physical card theft, cloning, or online data breaches. + # - `IDENTITY_THEFT`: Identity theft fraud occurs when a fraudster uses stolen + # personal information, such as Social Security numbers or addresses, to open + # accounts, apply for loans, or conduct financial transactions in someone's + # name. + # - `CARDHOLDER_MANIPULATION`: This type of fraud occurs when a fraudster + # manipulates or coerces a legitimate cardholder into unauthorized transactions, + # often through social engineering tactics. + module FraudType + extend Lithic::Internal::Type::Enum + + FIRST_PARTY_FRAUD = :FIRST_PARTY_FRAUD + ACCOUNT_TAKEOVER = :ACCOUNT_TAKEOVER + CARD_COMPROMISED = :CARD_COMPROMISED + IDENTITY_THEFT = :IDENTITY_THEFT + CARDHOLDER_MANIPULATION = :CARDHOLDER_MANIPULATION + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/fraud/transaction_report_response.rb b/lib/lithic/models/fraud/transaction_report_response.rb new file mode 100644 index 00000000..30f3d331 --- /dev/null +++ b/lib/lithic/models/fraud/transaction_report_response.rb @@ -0,0 +1,160 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Fraud + # @see Lithic::Resources::Fraud::Transactions#report + class TransactionReportResponse < Lithic::Internal::Type::BaseModel + # @!attribute fraud_status + # The fraud status of the transaction, string (enum) supporting the following + # values: + # + # - `SUSPECTED_FRAUD`: The transaction is suspected to be fraudulent, but this + # hasn’t been confirmed. + # - `FRAUDULENT`: The transaction is confirmed to be fraudulent. A transaction may + # immediately be moved into this state, or be graduated into this state from the + # `SUSPECTED_FRAUD` state. + # - `NOT_FRAUDULENT`: The transaction is (explicitly) marked as not fraudulent. A + # transaction may immediately be moved into this state, or be graduated into + # this state from the `SUSPECTED_FRAUD` state. + # - `NO_REPORTED_FRAUD`: Indicates that no fraud report exists for the + # transaction. It is the default state for transactions that have not been + # analyzed or associated with any known fraudulent activity. + # + # @return [Symbol, Lithic::Models::Fraud::TransactionReportResponse::FraudStatus] + required :fraud_status, enum: -> { Lithic::Models::Fraud::TransactionReportResponse::FraudStatus } + + # @!attribute transaction_token + # The universally unique identifier (UUID) associated with the transaction being + # reported. + # + # @return [String] + required :transaction_token, String + + # @!attribute comment + # Provides additional context or details about the fraud report. + # + # @return [String, nil] + optional :comment, String + + # @!attribute created_at + # Timestamp representing when the fraud report was created. + # + # @return [Time, nil] + optional :created_at, Time + + # @!attribute fraud_type + # Specifies the type or category of fraud that the transaction is suspected or + # confirmed to involve, string (enum) supporting the following values: + # + # - `FIRST_PARTY_FRAUD`: First-party fraud occurs when a legitimate account or + # cardholder intentionally misuses financial services for personal gain. This + # includes actions such as disputing legitimate transactions to obtain a refund, + # abusing return policies, or defaulting on credit obligations without intent to + # repay. + # - `ACCOUNT_TAKEOVER`: Account takeover fraud occurs when a fraudster gains + # unauthorized access to an existing account, modifies account settings, and + # carries out fraudulent transactions. + # - `CARD_COMPROMISED`: Card compromised fraud occurs when a fraudster gains + # access to card details without taking over the account, such as through + # physical card theft, cloning, or online data breaches. + # - `IDENTITY_THEFT`: Identity theft fraud occurs when a fraudster uses stolen + # personal information, such as Social Security numbers or addresses, to open + # accounts, apply for loans, or conduct financial transactions in someone's + # name. + # - `CARDHOLDER_MANIPULATION`: This type of fraud occurs when a fraudster + # manipulates or coerces a legitimate cardholder into unauthorized transactions, + # often through social engineering tactics. + # + # @return [Symbol, Lithic::Models::Fraud::TransactionReportResponse::FraudType, nil] + optional :fraud_type, enum: -> { Lithic::Models::Fraud::TransactionReportResponse::FraudType } + + # @!attribute updated_at + # Timestamp representing the last update to the fraud report. + # + # @return [Time, nil] + optional :updated_at, Time + + # @!method initialize(fraud_status:, transaction_token:, comment: nil, created_at: nil, fraud_type: nil, updated_at: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Fraud::TransactionReportResponse} for more details. + # + # @param fraud_status [Symbol, Lithic::Models::Fraud::TransactionReportResponse::FraudStatus] The fraud status of the transaction, string (enum) supporting the following valu + # + # @param transaction_token [String] The universally unique identifier (UUID) associated with the transaction being r + # + # @param comment [String] Provides additional context or details about the fraud report. + # + # @param created_at [Time] Timestamp representing when the fraud report was created. + # + # @param fraud_type [Symbol, Lithic::Models::Fraud::TransactionReportResponse::FraudType] Specifies the type or category of fraud that the transaction is suspected or con + # + # @param updated_at [Time] Timestamp representing the last update to the fraud report. + + # The fraud status of the transaction, string (enum) supporting the following + # values: + # + # - `SUSPECTED_FRAUD`: The transaction is suspected to be fraudulent, but this + # hasn’t been confirmed. + # - `FRAUDULENT`: The transaction is confirmed to be fraudulent. A transaction may + # immediately be moved into this state, or be graduated into this state from the + # `SUSPECTED_FRAUD` state. + # - `NOT_FRAUDULENT`: The transaction is (explicitly) marked as not fraudulent. A + # transaction may immediately be moved into this state, or be graduated into + # this state from the `SUSPECTED_FRAUD` state. + # - `NO_REPORTED_FRAUD`: Indicates that no fraud report exists for the + # transaction. It is the default state for transactions that have not been + # analyzed or associated with any known fraudulent activity. + # + # @see Lithic::Models::Fraud::TransactionReportResponse#fraud_status + module FraudStatus + extend Lithic::Internal::Type::Enum + + SUSPECTED_FRAUD = :SUSPECTED_FRAUD + FRAUDULENT = :FRAUDULENT + NOT_FRAUDULENT = :NOT_FRAUDULENT + NO_REPORTED_FRAUD = :NO_REPORTED_FRAUD + + # @!method self.values + # @return [Array] + end + + # Specifies the type or category of fraud that the transaction is suspected or + # confirmed to involve, string (enum) supporting the following values: + # + # - `FIRST_PARTY_FRAUD`: First-party fraud occurs when a legitimate account or + # cardholder intentionally misuses financial services for personal gain. This + # includes actions such as disputing legitimate transactions to obtain a refund, + # abusing return policies, or defaulting on credit obligations without intent to + # repay. + # - `ACCOUNT_TAKEOVER`: Account takeover fraud occurs when a fraudster gains + # unauthorized access to an existing account, modifies account settings, and + # carries out fraudulent transactions. + # - `CARD_COMPROMISED`: Card compromised fraud occurs when a fraudster gains + # access to card details without taking over the account, such as through + # physical card theft, cloning, or online data breaches. + # - `IDENTITY_THEFT`: Identity theft fraud occurs when a fraudster uses stolen + # personal information, such as Social Security numbers or addresses, to open + # accounts, apply for loans, or conduct financial transactions in someone's + # name. + # - `CARDHOLDER_MANIPULATION`: This type of fraud occurs when a fraudster + # manipulates or coerces a legitimate cardholder into unauthorized transactions, + # often through social engineering tactics. + # + # @see Lithic::Models::Fraud::TransactionReportResponse#fraud_type + module FraudType + extend Lithic::Internal::Type::Enum + + FIRST_PARTY_FRAUD = :FIRST_PARTY_FRAUD + ACCOUNT_TAKEOVER = :ACCOUNT_TAKEOVER + CARD_COMPROMISED = :CARD_COMPROMISED + IDENTITY_THEFT = :IDENTITY_THEFT + CARDHOLDER_MANIPULATION = :CARDHOLDER_MANIPULATION + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/fraud/transaction_retrieve_params.rb b/lib/lithic/models/fraud/transaction_retrieve_params.rb new file mode 100644 index 00000000..2f6d6931 --- /dev/null +++ b/lib/lithic/models/fraud/transaction_retrieve_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Fraud + # @see Lithic::Resources::Fraud::Transactions#retrieve + class TransactionRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute transaction_token + # + # @return [String] + required :transaction_token, String + + # @!method initialize(transaction_token:, request_options: {}) + # @param transaction_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/fraud/transaction_retrieve_response.rb b/lib/lithic/models/fraud/transaction_retrieve_response.rb new file mode 100644 index 00000000..df1fb69e --- /dev/null +++ b/lib/lithic/models/fraud/transaction_retrieve_response.rb @@ -0,0 +1,160 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Fraud + # @see Lithic::Resources::Fraud::Transactions#retrieve + class TransactionRetrieveResponse < Lithic::Internal::Type::BaseModel + # @!attribute fraud_status + # The fraud status of the transaction, string (enum) supporting the following + # values: + # + # - `SUSPECTED_FRAUD`: The transaction is suspected to be fraudulent, but this + # hasn’t been confirmed. + # - `FRAUDULENT`: The transaction is confirmed to be fraudulent. A transaction may + # immediately be moved into this state, or be graduated into this state from the + # `SUSPECTED_FRAUD` state. + # - `NOT_FRAUDULENT`: The transaction is (explicitly) marked as not fraudulent. A + # transaction may immediately be moved into this state, or be graduated into + # this state from the `SUSPECTED_FRAUD` state. + # - `NO_REPORTED_FRAUD`: Indicates that no fraud report exists for the + # transaction. It is the default state for transactions that have not been + # analyzed or associated with any known fraudulent activity. + # + # @return [Symbol, Lithic::Models::Fraud::TransactionRetrieveResponse::FraudStatus] + required :fraud_status, enum: -> { Lithic::Models::Fraud::TransactionRetrieveResponse::FraudStatus } + + # @!attribute transaction_token + # The universally unique identifier (UUID) associated with the transaction being + # reported. + # + # @return [String] + required :transaction_token, String + + # @!attribute comment + # Provides additional context or details about the fraud report. + # + # @return [String, nil] + optional :comment, String + + # @!attribute created_at + # Timestamp representing when the fraud report was created. + # + # @return [Time, nil] + optional :created_at, Time + + # @!attribute fraud_type + # Specifies the type or category of fraud that the transaction is suspected or + # confirmed to involve, string (enum) supporting the following values: + # + # - `FIRST_PARTY_FRAUD`: First-party fraud occurs when a legitimate account or + # cardholder intentionally misuses financial services for personal gain. This + # includes actions such as disputing legitimate transactions to obtain a refund, + # abusing return policies, or defaulting on credit obligations without intent to + # repay. + # - `ACCOUNT_TAKEOVER`: Account takeover fraud occurs when a fraudster gains + # unauthorized access to an existing account, modifies account settings, and + # carries out fraudulent transactions. + # - `CARD_COMPROMISED`: Card compromised fraud occurs when a fraudster gains + # access to card details without taking over the account, such as through + # physical card theft, cloning, or online data breaches. + # - `IDENTITY_THEFT`: Identity theft fraud occurs when a fraudster uses stolen + # personal information, such as Social Security numbers or addresses, to open + # accounts, apply for loans, or conduct financial transactions in someone's + # name. + # - `CARDHOLDER_MANIPULATION`: This type of fraud occurs when a fraudster + # manipulates or coerces a legitimate cardholder into unauthorized transactions, + # often through social engineering tactics. + # + # @return [Symbol, Lithic::Models::Fraud::TransactionRetrieveResponse::FraudType, nil] + optional :fraud_type, enum: -> { Lithic::Models::Fraud::TransactionRetrieveResponse::FraudType } + + # @!attribute updated_at + # Timestamp representing the last update to the fraud report. + # + # @return [Time, nil] + optional :updated_at, Time + + # @!method initialize(fraud_status:, transaction_token:, comment: nil, created_at: nil, fraud_type: nil, updated_at: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Fraud::TransactionRetrieveResponse} for more details. + # + # @param fraud_status [Symbol, Lithic::Models::Fraud::TransactionRetrieveResponse::FraudStatus] The fraud status of the transaction, string (enum) supporting the following valu + # + # @param transaction_token [String] The universally unique identifier (UUID) associated with the transaction being r + # + # @param comment [String] Provides additional context or details about the fraud report. + # + # @param created_at [Time] Timestamp representing when the fraud report was created. + # + # @param fraud_type [Symbol, Lithic::Models::Fraud::TransactionRetrieveResponse::FraudType] Specifies the type or category of fraud that the transaction is suspected or con + # + # @param updated_at [Time] Timestamp representing the last update to the fraud report. + + # The fraud status of the transaction, string (enum) supporting the following + # values: + # + # - `SUSPECTED_FRAUD`: The transaction is suspected to be fraudulent, but this + # hasn’t been confirmed. + # - `FRAUDULENT`: The transaction is confirmed to be fraudulent. A transaction may + # immediately be moved into this state, or be graduated into this state from the + # `SUSPECTED_FRAUD` state. + # - `NOT_FRAUDULENT`: The transaction is (explicitly) marked as not fraudulent. A + # transaction may immediately be moved into this state, or be graduated into + # this state from the `SUSPECTED_FRAUD` state. + # - `NO_REPORTED_FRAUD`: Indicates that no fraud report exists for the + # transaction. It is the default state for transactions that have not been + # analyzed or associated with any known fraudulent activity. + # + # @see Lithic::Models::Fraud::TransactionRetrieveResponse#fraud_status + module FraudStatus + extend Lithic::Internal::Type::Enum + + SUSPECTED_FRAUD = :SUSPECTED_FRAUD + FRAUDULENT = :FRAUDULENT + NOT_FRAUDULENT = :NOT_FRAUDULENT + NO_REPORTED_FRAUD = :NO_REPORTED_FRAUD + + # @!method self.values + # @return [Array] + end + + # Specifies the type or category of fraud that the transaction is suspected or + # confirmed to involve, string (enum) supporting the following values: + # + # - `FIRST_PARTY_FRAUD`: First-party fraud occurs when a legitimate account or + # cardholder intentionally misuses financial services for personal gain. This + # includes actions such as disputing legitimate transactions to obtain a refund, + # abusing return policies, or defaulting on credit obligations without intent to + # repay. + # - `ACCOUNT_TAKEOVER`: Account takeover fraud occurs when a fraudster gains + # unauthorized access to an existing account, modifies account settings, and + # carries out fraudulent transactions. + # - `CARD_COMPROMISED`: Card compromised fraud occurs when a fraudster gains + # access to card details without taking over the account, such as through + # physical card theft, cloning, or online data breaches. + # - `IDENTITY_THEFT`: Identity theft fraud occurs when a fraudster uses stolen + # personal information, such as Social Security numbers or addresses, to open + # accounts, apply for loans, or conduct financial transactions in someone's + # name. + # - `CARDHOLDER_MANIPULATION`: This type of fraud occurs when a fraudster + # manipulates or coerces a legitimate cardholder into unauthorized transactions, + # often through social engineering tactics. + # + # @see Lithic::Models::Fraud::TransactionRetrieveResponse#fraud_type + module FraudType + extend Lithic::Internal::Type::Enum + + FIRST_PARTY_FRAUD = :FIRST_PARTY_FRAUD + ACCOUNT_TAKEOVER = :ACCOUNT_TAKEOVER + CARD_COMPROMISED = :CARD_COMPROMISED + IDENTITY_THEFT = :IDENTITY_THEFT + CARDHOLDER_MANIPULATION = :CARDHOLDER_MANIPULATION + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/funding_event.rb b/lib/lithic/models/funding_event.rb new file mode 100644 index 00000000..2575abe0 --- /dev/null +++ b/lib/lithic/models/funding_event.rb @@ -0,0 +1,107 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::FundingEvents#retrieve + class FundingEvent < Lithic::Internal::Type::BaseModel + # @!attribute token + # Unique token ID + # + # @return [String] + required :token, String + + # @!attribute collection_resource_type + # Collection resource type + # + # @return [Symbol, Lithic::Models::FundingEvent::CollectionResourceType] + required :collection_resource_type, enum: -> { Lithic::FundingEvent::CollectionResourceType } + + # @!attribute collection_tokens + # IDs of collections, further information can be gathered from the appropriate + # collection API based on collection_resource_type + # + # @return [Array] + required :collection_tokens, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute created + # Time of the creation + # + # @return [Time] + required :created, Time + + # @!attribute high_watermark + # Time of the high watermark + # + # @return [Time] + required :high_watermark, Time + + # @!attribute network_settlement_summary + # Network settlement summary breakdown by network settlement date + # + # @return [Array] + required :network_settlement_summary, + -> { Lithic::Internal::Type::ArrayOf[Lithic::FundingEvent::NetworkSettlementSummary] } + + # @!attribute previous_high_watermark + # Time of the previous high watermark + # + # @return [Time] + required :previous_high_watermark, Time + + # @!attribute updated + # Time of the update + # + # @return [Time] + required :updated, Time + + # @!method initialize(token:, collection_resource_type:, collection_tokens:, created:, high_watermark:, network_settlement_summary:, previous_high_watermark:, updated:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::FundingEvent} for more details. + # + # @param token [String] Unique token ID + # + # @param collection_resource_type [Symbol, Lithic::Models::FundingEvent::CollectionResourceType] Collection resource type + # + # @param collection_tokens [Array] IDs of collections, further information can be gathered from the appropriate col + # + # @param created [Time] Time of the creation + # + # @param high_watermark [Time] Time of the high watermark + # + # @param network_settlement_summary [Array] Network settlement summary breakdown by network settlement date + # + # @param previous_high_watermark [Time] Time of the previous high watermark + # + # @param updated [Time] Time of the update + + # Collection resource type + # + # @see Lithic::Models::FundingEvent#collection_resource_type + module CollectionResourceType + extend Lithic::Internal::Type::Enum + + BOOK_TRANSFER = :BOOK_TRANSFER + PAYMENT = :PAYMENT + + # @!method self.values + # @return [Array] + end + + class NetworkSettlementSummary < Lithic::Internal::Type::BaseModel + # @!attribute network_settlement_date + # + # @return [Date] + required :network_settlement_date, Date + + # @!attribute settled_gross_amount + # + # @return [Integer] + required :settled_gross_amount, Integer + + # @!method initialize(network_settlement_date:, settled_gross_amount:) + # @param network_settlement_date [Date] + # @param settled_gross_amount [Integer] + end + end + end +end diff --git a/lib/lithic/models/funding_event_created_webhook_event.rb b/lib/lithic/models/funding_event_created_webhook_event.rb new file mode 100644 index 00000000..1d93ba78 --- /dev/null +++ b/lib/lithic/models/funding_event_created_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class FundingEventCreatedWebhookEvent < Lithic::Models::FundingEvent + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"funding_event.created"] + required :event_type, const: :"funding_event.created" + + # @!method initialize(event_type: :"funding_event.created") + # @param event_type [Symbol, :"funding_event.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/funding_event_list_params.rb b/lib/lithic/models/funding_event_list_params.rb new file mode 100644 index 00000000..d2192856 --- /dev/null +++ b/lib/lithic/models/funding_event_list_params.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::FundingEvents#list + class FundingEventListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!method initialize(ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::FundingEventListParams} for more details. + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/funding_event_retrieve_details_params.rb b/lib/lithic/models/funding_event_retrieve_details_params.rb new file mode 100644 index 00000000..ec89258b --- /dev/null +++ b/lib/lithic/models/funding_event_retrieve_details_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::FundingEvents#retrieve_details + class FundingEventRetrieveDetailsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute funding_event_token + # + # @return [String] + required :funding_event_token, String + + # @!method initialize(funding_event_token:, request_options: {}) + # @param funding_event_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/funding_event_retrieve_details_response.rb b/lib/lithic/models/funding_event_retrieve_details_response.rb new file mode 100644 index 00000000..e2a5eda3 --- /dev/null +++ b/lib/lithic/models/funding_event_retrieve_details_response.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::FundingEvents#retrieve_details + class FundingEventRetrieveDetailsResponse < Lithic::Internal::Type::BaseModel + # @!attribute token + # Unique token ID + # + # @return [String] + required :token, String + + # @!attribute settlement_details_url + # URL of the settlement details + # + # @return [String] + required :settlement_details_url, String + + # @!attribute settlement_summary_url + # URL of the settlement summary + # + # @return [String] + required :settlement_summary_url, String + + # @!method initialize(token:, settlement_details_url:, settlement_summary_url:) + # @param token [String] Unique token ID + # + # @param settlement_details_url [String] URL of the settlement details + # + # @param settlement_summary_url [String] URL of the settlement summary + end + end +end diff --git a/lib/lithic/models/funding_event_retrieve_params.rb b/lib/lithic/models/funding_event_retrieve_params.rb new file mode 100644 index 00000000..012465f4 --- /dev/null +++ b/lib/lithic/models/funding_event_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::FundingEvents#retrieve + class FundingEventRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute funding_event_token + # + # @return [String] + required :funding_event_token, String + + # @!method initialize(funding_event_token:, request_options: {}) + # @param funding_event_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/hold.rb b/lib/lithic/models/hold.rb new file mode 100644 index 00000000..eadd9e29 --- /dev/null +++ b/lib/lithic/models/hold.rb @@ -0,0 +1,147 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Holds#create + class Hold < Lithic::Internal::Type::BaseModel + # @!attribute token + # Unique identifier for the transaction + # + # @return [String] + required :token, String + + # @!attribute created + # ISO 8601 timestamp of when the transaction was created + # + # @return [Time] + required :created, Time + + # @!attribute status + # Status of a hold transaction + # + # @return [Symbol, Lithic::Models::Hold::Status] + required :status, enum: -> { Lithic::Hold::Status } + + # @!attribute updated + # ISO 8601 timestamp of when the transaction was last updated + # + # @return [Time] + required :updated, Time + + # @!attribute currency + # + # @return [String, nil] + optional :currency, String + + # @!attribute events + # + # @return [Array, nil] + optional :events, -> { Lithic::Internal::Type::ArrayOf[Lithic::HoldEvent] } + + # @!attribute expiration_datetime + # When the hold will auto-expire if not resolved + # + # @return [Time, nil] + optional :expiration_datetime, Time, nil?: true + + # @!attribute family + # HOLD - Hold Transaction + # + # @return [Symbol, Lithic::Models::Hold::Family, nil] + optional :family, enum: -> { Lithic::Hold::Family } + + # @!attribute financial_account_token + # + # @return [String, nil] + optional :financial_account_token, String + + # @!attribute pending_amount + # Current pending amount (0 when resolved) + # + # @return [Integer, nil] + optional :pending_amount, Integer + + # @!attribute result + # + # @return [Symbol, Lithic::Models::Hold::Result, nil] + optional :result, enum: -> { Lithic::Hold::Result } + + # @!attribute user_defined_id + # + # @return [String, nil] + optional :user_defined_id, String, nil?: true + + # @!method initialize(token:, created:, status:, updated:, currency: nil, events: nil, expiration_datetime: nil, family: nil, financial_account_token: nil, pending_amount: nil, result: nil, user_defined_id: nil) + # A hold transaction representing reserved funds on a financial account. Holds + # move funds from available to pending balance in anticipation of future payments. + # They can be resolved via settlement (linked to payment), manual release, or + # expiration. + # + # @param token [String] Unique identifier for the transaction + # + # @param created [Time] ISO 8601 timestamp of when the transaction was created + # + # @param status [Symbol, Lithic::Models::Hold::Status] Status of a hold transaction + # + # @param updated [Time] ISO 8601 timestamp of when the transaction was last updated + # + # @param currency [String] + # + # @param events [Array] + # + # @param expiration_datetime [Time, nil] When the hold will auto-expire if not resolved + # + # @param family [Symbol, Lithic::Models::Hold::Family] HOLD - Hold Transaction + # + # @param financial_account_token [String] + # + # @param pending_amount [Integer] Current pending amount (0 when resolved) + # + # @param result [Symbol, Lithic::Models::Hold::Result] + # + # @param user_defined_id [String, nil] + + # Status of a hold transaction + # + # @see Lithic::Models::Hold#status + module Status + extend Lithic::Internal::Type::Enum + + PENDING = :PENDING + SETTLED = :SETTLED + EXPIRED = :EXPIRED + VOIDED = :VOIDED + DECLINED = :DECLINED + REVERSED = :REVERSED + CANCELED = :CANCELED + RETURNED = :RETURNED + + # @!method self.values + # @return [Array] + end + + # HOLD - Hold Transaction + # + # @see Lithic::Models::Hold#family + module Family + extend Lithic::Internal::Type::Enum + + HOLD = :HOLD + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::Hold#result + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/hold_create_params.rb b/lib/lithic/models/hold_create_params.rb new file mode 100644 index 00000000..d3bf691a --- /dev/null +++ b/lib/lithic/models/hold_create_params.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Holds#create + class HoldCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute financial_account_token + # + # @return [String] + required :financial_account_token, String + + # @!attribute amount + # Amount to hold in cents + # + # @return [Integer] + required :amount, Integer + + # @!attribute token + # Customer-provided token for idempotency. Becomes the hold token. + # + # @return [String, nil] + optional :token, String + + # @!attribute expiration_datetime + # When the hold should auto-expire + # + # @return [Time, nil] + optional :expiration_datetime, Time + + # @!attribute memo + # Reason for the hold + # + # @return [String, nil] + optional :memo, String, nil?: true + + # @!attribute user_defined_id + # User-provided identifier for the hold + # + # @return [String, nil] + optional :user_defined_id, String + + # @!method initialize(financial_account_token:, amount:, token: nil, expiration_datetime: nil, memo: nil, user_defined_id: nil, request_options: {}) + # @param financial_account_token [String] + # + # @param amount [Integer] Amount to hold in cents + # + # @param token [String] Customer-provided token for idempotency. Becomes the hold token. + # + # @param expiration_datetime [Time] When the hold should auto-expire + # + # @param memo [String, nil] Reason for the hold + # + # @param user_defined_id [String] User-provided identifier for the hold + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/hold_event.rb b/lib/lithic/models/hold_event.rb new file mode 100644 index 00000000..73fd3d79 --- /dev/null +++ b/lib/lithic/models/hold_event.rb @@ -0,0 +1,110 @@ +# frozen_string_literal: true + +module Lithic + module Models + class HoldEvent < Lithic::Internal::Type::BaseModel + # @!attribute token + # + # @return [String] + required :token, String + + # @!attribute amount + # Amount in cents + # + # @return [Integer] + required :amount, Integer + + # @!attribute created + # + # @return [Time] + required :created, Time + + # @!attribute detailed_results + # + # @return [Array] + required :detailed_results, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::HoldEvent::DetailedResult] } + + # @!attribute memo + # + # @return [String, nil] + required :memo, String, nil?: true + + # @!attribute result + # + # @return [Symbol, Lithic::Models::HoldEvent::Result] + required :result, enum: -> { Lithic::HoldEvent::Result } + + # @!attribute settling_transaction_token + # Transaction token of the payment that settled this hold (only populated for + # HOLD_SETTLED events) + # + # @return [String, nil] + required :settling_transaction_token, String, nil?: true + + # @!attribute type + # Type of hold lifecycle event + # + # @return [Symbol, Lithic::Models::HoldEvent::Type] + required :type, enum: -> { Lithic::HoldEvent::Type } + + # @!method initialize(token:, amount:, created:, detailed_results:, memo:, result:, settling_transaction_token:, type:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::HoldEvent} for more details. + # + # Event representing a lifecycle change to a hold + # + # @param token [String] + # + # @param amount [Integer] Amount in cents + # + # @param created [Time] + # + # @param detailed_results [Array] + # + # @param memo [String, nil] + # + # @param result [Symbol, Lithic::Models::HoldEvent::Result] + # + # @param settling_transaction_token [String, nil] Transaction token of the payment that settled this hold (only populated for HOLD + # + # @param type [Symbol, Lithic::Models::HoldEvent::Type] Type of hold lifecycle event + + module DetailedResult + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::HoldEvent#result + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + + # Type of hold lifecycle event + # + # @see Lithic::Models::HoldEvent#type + module Type + extend Lithic::Internal::Type::Enum + + HOLD_INITIATED = :HOLD_INITIATED + HOLD_VOIDED = :HOLD_VOIDED + HOLD_EXPIRED = :HOLD_EXPIRED + HOLD_SETTLED = :HOLD_SETTLED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/hold_list_params.rb b/lib/lithic/models/hold_list_params.rb new file mode 100644 index 00000000..07648f85 --- /dev/null +++ b/lib/lithic/models/hold_list_params.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Holds#list + class HoldListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute financial_account_token + # + # @return [String] + required :financial_account_token, String + + # @!attribute begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time + + # @!attribute end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!attribute status + # Hold status to filter by. + # + # @return [Symbol, Lithic::Models::HoldListParams::Status, nil] + optional :status, enum: -> { Lithic::HoldListParams::Status } + + # @!method initialize(financial_account_token:, begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, status: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::HoldListParams} for more details. + # + # @param financial_account_token [String] + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param status [Symbol, Lithic::Models::HoldListParams::Status] Hold status to filter by. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Hold status to filter by. + module Status + extend Lithic::Internal::Type::Enum + + PENDING = :PENDING + SETTLED = :SETTLED + EXPIRED = :EXPIRED + VOIDED = :VOIDED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/hold_retrieve_params.rb b/lib/lithic/models/hold_retrieve_params.rb new file mode 100644 index 00000000..9ad8e397 --- /dev/null +++ b/lib/lithic/models/hold_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Holds#retrieve + class HoldRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute hold_token + # + # @return [String] + required :hold_token, String + + # @!method initialize(hold_token:, request_options: {}) + # @param hold_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/hold_void_params.rb b/lib/lithic/models/hold_void_params.rb new file mode 100644 index 00000000..846a5645 --- /dev/null +++ b/lib/lithic/models/hold_void_params.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Holds#void + class HoldVoidParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute hold_token + # + # @return [String] + required :hold_token, String + + # @!attribute memo + # Reason for voiding the hold + # + # @return [String, nil] + optional :memo, String, nil?: true + + # @!method initialize(hold_token:, memo: nil, request_options: {}) + # @param hold_token [String] + # + # @param memo [String, nil] Reason for voiding the hold + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/instance_financial_account_type.rb b/lib/lithic/models/instance_financial_account_type.rb new file mode 100644 index 00000000..da4a7e10 --- /dev/null +++ b/lib/lithic/models/instance_financial_account_type.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Lithic + module Models + # Type of instance financial account + module InstanceFinancialAccountType + extend Lithic::Internal::Type::Enum + + ISSUING = :ISSUING + RESERVE = :RESERVE + OPERATING = :OPERATING + CHARGED_OFF_FEES = :CHARGED_OFF_FEES + CHARGED_OFF_INTEREST = :CHARGED_OFF_INTEREST + CHARGED_OFF_PRINCIPAL = :CHARGED_OFF_PRINCIPAL + SECURITY = :SECURITY + PROGRAM_RECEIVABLES = :PROGRAM_RECEIVABLES + COLLECTION = :COLLECTION + PROGRAM_BANK_ACCOUNTS_PAYABLE = :PROGRAM_BANK_ACCOUNTS_PAYABLE + EARLY_DIRECT_DEPOSIT_FLOAT = :EARLY_DIRECT_DEPOSIT_FLOAT + PROVISIONAL_CREDIT_ACCOUNT = :PROVISIONAL_CREDIT_ACCOUNT + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/lithic/models/internal_transaction.rb b/lib/lithic/models/internal_transaction.rb new file mode 100644 index 00000000..979642e7 --- /dev/null +++ b/lib/lithic/models/internal_transaction.rb @@ -0,0 +1,166 @@ +# frozen_string_literal: true + +module Lithic + module Models + class InternalTransactionAPI < Lithic::Internal::Type::BaseModel + # @!attribute token + # + # @return [String] + required :token, String + + # @!attribute category + # + # @return [Symbol, Lithic::Models::InternalTransactionAPI::Category] + required :category, enum: -> { Lithic::InternalTransactionAPI::Category } + + # @!attribute created + # + # @return [Time] + required :created, Time + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute descriptor + # + # @return [String] + required :descriptor, String + + # @!attribute events + # + # @return [Array] + required :events, -> { Lithic::Internal::Type::ArrayOf[Lithic::InternalTransactionAPI::Event] } + + # @!attribute pending_amount + # + # @return [Integer] + required :pending_amount, Integer + + # @!attribute result + # + # @return [Symbol, Lithic::Models::InternalTransactionAPI::Result] + required :result, enum: -> { Lithic::InternalTransactionAPI::Result } + + # @!attribute settled_amount + # + # @return [Integer] + required :settled_amount, Integer + + # @!attribute status + # + # @return [Symbol, Lithic::Models::InternalTransactionAPI::Status] + required :status, enum: -> { Lithic::InternalTransactionAPI::Status } + + # @!attribute updated + # + # @return [Time] + required :updated, Time + + # @!method initialize(token:, category:, created:, currency:, descriptor:, events:, pending_amount:, result:, settled_amount:, status:, updated:) + # @param token [String] + # @param category [Symbol, Lithic::Models::InternalTransactionAPI::Category] + # @param created [Time] + # @param currency [String] + # @param descriptor [String] + # @param events [Array] + # @param pending_amount [Integer] + # @param result [Symbol, Lithic::Models::InternalTransactionAPI::Result] + # @param settled_amount [Integer] + # @param status [Symbol, Lithic::Models::InternalTransactionAPI::Status] + # @param updated [Time] + + # @see Lithic::Models::InternalTransactionAPI#category + module Category + extend Lithic::Internal::Type::Enum + + INTERNAL = :INTERNAL + + # @!method self.values + # @return [Array] + end + + class Event < Lithic::Internal::Type::BaseModel + # @!attribute token + # + # @return [String] + required :token, String + + # @!attribute amount + # + # @return [Integer] + required :amount, Integer + + # @!attribute created + # + # @return [Time] + required :created, Time + + # @!attribute result + # + # @return [Symbol, Lithic::Models::InternalTransactionAPI::Event::Result] + required :result, enum: -> { Lithic::InternalTransactionAPI::Event::Result } + + # @!attribute type + # + # @return [Symbol, Lithic::Models::InternalTransactionAPI::Event::Type] + required :type, enum: -> { Lithic::InternalTransactionAPI::Event::Type } + + # @!method initialize(token:, amount:, created:, result:, type:) + # @param token [String] + # @param amount [Integer] + # @param created [Time] + # @param result [Symbol, Lithic::Models::InternalTransactionAPI::Event::Result] + # @param type [Symbol, Lithic::Models::InternalTransactionAPI::Event::Type] + + # @see Lithic::Models::InternalTransactionAPI::Event#result + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::InternalTransactionAPI::Event#type + module Type + extend Lithic::Internal::Type::Enum + + INTERNAL_ADJUSTMENT = :INTERNAL_ADJUSTMENT + + # @!method self.values + # @return [Array] + end + end + + # @see Lithic::Models::InternalTransactionAPI#result + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::InternalTransactionAPI#status + module Status + extend Lithic::Internal::Type::Enum + + PENDING = :PENDING + SETTLED = :SETTLED + DECLINED = :DECLINED + REVERSED = :REVERSED + CANCELED = :CANCELED + RETURNED = :RETURNED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/internal_transaction_created_webhook_event.rb b/lib/lithic/models/internal_transaction_created_webhook_event.rb new file mode 100644 index 00000000..0bcd7399 --- /dev/null +++ b/lib/lithic/models/internal_transaction_created_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class InternalTransactionCreatedWebhookEvent < Lithic::Models::InternalTransactionAPI + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"internal_transaction.created"] + required :event_type, const: :"internal_transaction.created" + + # @!method initialize(event_type: :"internal_transaction.created") + # @param event_type [Symbol, :"internal_transaction.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/internal_transaction_updated_webhook_event.rb b/lib/lithic/models/internal_transaction_updated_webhook_event.rb new file mode 100644 index 00000000..ba3993be --- /dev/null +++ b/lib/lithic/models/internal_transaction_updated_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class InternalTransactionUpdatedWebhookEvent < Lithic::Models::InternalTransactionAPI + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"internal_transaction.updated"] + required :event_type, const: :"internal_transaction.updated" + + # @!method initialize(event_type: :"internal_transaction.updated") + # @param event_type [Symbol, :"internal_transaction.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/kyb.rb b/lib/lithic/models/kyb.rb new file mode 100644 index 00000000..63d02f8a --- /dev/null +++ b/lib/lithic/models/kyb.rb @@ -0,0 +1,336 @@ +# frozen_string_literal: true + +module Lithic + module Models + class KYB < Lithic::Internal::Type::BaseModel + # @!attribute beneficial_owner_individuals + # You must submit a list of all direct and indirect individuals with 25% or more + # ownership in the company. A maximum of 4 beneficial owners can be submitted. If + # no individual owns 25% of the company you do not need to send beneficial owner + # information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + # + # @return [Array] + required :beneficial_owner_individuals, + -> { Lithic::Internal::Type::ArrayOf[Lithic::KYB::BeneficialOwnerIndividual] } + + # @!attribute business_entity + # Information for business for which the account is being opened and KYB is being + # run. + # + # @return [Lithic::Models::KYB::BusinessEntity] + required :business_entity, -> { Lithic::KYB::BusinessEntity } + + # @!attribute control_person + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + # + # @return [Lithic::Models::KYB::ControlPerson] + required :control_person, -> { Lithic::KYB::ControlPerson } + + # @!attribute nature_of_business + # Short description of the company's line of business (i.e., what does the company + # do?). Values longer than 255 characters will be truncated before KYB + # verification + # + # @return [String] + required :nature_of_business, String + + # @!attribute tos_timestamp + # An RFC 3339 timestamp indicating when the account holder accepted the applicable + # legal agreements (e.g., cardholder terms) as agreed upon during API customer's + # implementation with Lithic. + # + # @return [String] + required :tos_timestamp, String + + # @!attribute workflow + # Specifies the type of KYB workflow to run. + # + # @return [Symbol, Lithic::Models::KYB::Workflow] + required :workflow, enum: -> { Lithic::KYB::Workflow } + + # @!attribute external_id + # A user provided id that can be used to link an account holder with an external + # system + # + # @return [String, nil] + optional :external_id, String + + # @!attribute kyb_passed_timestamp + # An RFC 3339 timestamp indicating when precomputed KYB was completed on the + # business with a pass result. + # + # This field is required only if workflow type is `KYB_BYO`. + # + # @return [String, nil] + optional :kyb_passed_timestamp, String + + # @!attribute naics_code + # 6-digit North American Industry Classification System (NAICS) code for the + # business. + # + # @return [String, nil] + optional :naics_code, String + + # @!attribute website_url + # Company website URL. + # + # @return [String, nil] + optional :website_url, String + + # @!method initialize(beneficial_owner_individuals:, business_entity:, control_person:, nature_of_business:, tos_timestamp:, workflow:, external_id: nil, kyb_passed_timestamp: nil, naics_code: nil, website_url: nil) + # Some parameter documentations has been truncated, see {Lithic::Models::KYB} for + # more details. + # + # @param beneficial_owner_individuals [Array] You must submit a list of all direct and indirect individuals with 25% or more o + # + # @param business_entity [Lithic::Models::KYB::BusinessEntity] Information for business for which the account is being opened and KYB is being + # + # @param control_person [Lithic::Models::KYB::ControlPerson] An individual with significant responsibility for managing the legal entity (e.g + # + # @param nature_of_business [String] Short description of the company's line of business (i.e., what does the company + # + # @param tos_timestamp [String] An RFC 3339 timestamp indicating when the account holder accepted the applicable + # + # @param workflow [Symbol, Lithic::Models::KYB::Workflow] Specifies the type of KYB workflow to run. + # + # @param external_id [String] A user provided id that can be used to link an account holder with an external s + # + # @param kyb_passed_timestamp [String] An RFC 3339 timestamp indicating when precomputed KYB was completed on the busin + # + # @param naics_code [String] 6-digit North American Industry Classification System (NAICS) code for the busin + # + # @param website_url [String] Company website URL. + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::Address] + required :address, -> { Lithic::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String] + required :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String] + required :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String] + required :first_name, String + + # @!attribute government_id + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + # + # @return [String] + required :government_id, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String] + required :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!method initialize(address:, dob:, email:, first_name:, government_id:, last_name:, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::KYB::BeneficialOwnerIndividual} for more details. + # + # Individuals associated with a KYB application. Phone number is optional. + # + # @param address [Lithic::Models::Address] Individual's current address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param government_id [String] Government-issued identification number (required for identity verification and + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + end + + # @see Lithic::Models::KYB#business_entity + class BusinessEntity < Lithic::Internal::Type::BaseModel + # @!attribute address + # Business's physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + # + # @return [Lithic::Models::Address] + required :address, -> { Lithic::Address } + + # @!attribute government_id + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + # + # @return [String] + required :government_id, String + + # @!attribute legal_business_name + # Legal (formal) business name. + # + # @return [String] + required :legal_business_name, String + + # @!attribute phone_numbers + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + # + # @return [Array] + required :phone_numbers, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute dba_business_name + # Any name that the business operates under that is not its legal business name + # (if applicable). + # + # @return [String, nil] + optional :dba_business_name, String + + # @!attribute parent_company + # Parent company name (if applicable). + # + # @return [String, nil] + optional :parent_company, String + + # @!method initialize(address:, government_id:, legal_business_name:, phone_numbers:, dba_business_name: nil, parent_company: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::KYB::BusinessEntity} for more details. + # + # Information for business for which the account is being opened and KYB is being + # run. + # + # @param address [Lithic::Models::Address] Business's physical address - PO boxes, UPS drops, and FedEx drops are not accep + # + # @param government_id [String] Government-issued identification number. US Federal Employer Identification Numb + # + # @param legal_business_name [String] Legal (formal) business name. + # + # @param phone_numbers [Array] One or more of the business's phone number(s), entered as a list in E.164 format + # + # @param dba_business_name [String] Any name that the business operates under that is not its legal business name (i + # + # @param parent_company [String] Parent company name (if applicable). + end + + # @see Lithic::Models::KYB#control_person + class ControlPerson < Lithic::Internal::Type::BaseModel + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::Address] + required :address, -> { Lithic::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String] + required :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String] + required :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String] + required :first_name, String + + # @!attribute government_id + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + # + # @return [String] + required :government_id, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String] + required :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!method initialize(address:, dob:, email:, first_name:, government_id:, last_name:, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::KYB::ControlPerson} for more details. + # + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + # + # @param address [Lithic::Models::Address] Individual's current address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param government_id [String] Government-issued identification number (required for identity verification and + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + end + + # Specifies the type of KYB workflow to run. + # + # @see Lithic::Models::KYB#workflow + module Workflow + extend Lithic::Internal::Type::Enum + + KYB_BASIC = :KYB_BASIC + KYB_BYO = :KYB_BYO + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/kyb_business_entity.rb b/lib/lithic/models/kyb_business_entity.rb new file mode 100644 index 00000000..ddefa8df --- /dev/null +++ b/lib/lithic/models/kyb_business_entity.rb @@ -0,0 +1,125 @@ +# frozen_string_literal: true + +module Lithic + module Models + class KYBBusinessEntity < Lithic::Internal::Type::BaseModel + # @!attribute address + # Business''s physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + # + # @return [Lithic::Models::KYBBusinessEntity::Address] + required :address, -> { Lithic::KYBBusinessEntity::Address } + + # @!attribute government_id + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + # + # @return [String] + required :government_id, String + + # @!attribute legal_business_name + # Legal (formal) business name. + # + # @return [String] + required :legal_business_name, String + + # @!attribute phone_numbers + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + # + # @return [Array] + required :phone_numbers, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute dba_business_name + # Any name that the business operates under that is not its legal business name + # (if applicable). + # + # @return [String, nil] + optional :dba_business_name, String + + # @!attribute parent_company + # Parent company name (if applicable). + # + # @return [String, nil] + optional :parent_company, String, nil?: true + + # @!method initialize(address:, government_id:, legal_business_name:, phone_numbers:, dba_business_name: nil, parent_company: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::KYBBusinessEntity} for more details. + # + # @param address [Lithic::Models::KYBBusinessEntity::Address] Business''s physical address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param government_id [String] Government-issued identification number. US Federal Employer Identification Numb + # + # @param legal_business_name [String] Legal (formal) business name. + # + # @param phone_numbers [Array] One or more of the business's phone number(s), entered as a list in E.164 format + # + # @param dba_business_name [String] Any name that the business operates under that is not its legal business name (i + # + # @param parent_company [String, nil] Parent company name (if applicable). + + # @see Lithic::Models::KYBBusinessEntity#address + class Address < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!method initialize(address1:, city:, country:, postal_code:, state:, address2: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::KYBBusinessEntity::Address} for more details. + # + # Business''s physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + # + # @param address1 [String] Valid deliverable address (no PO boxes). + # + # @param city [String] Name of city. + # + # @param country [String] Valid country code. Only USA is currently supported, entered in uppercase ISO 31 + # + # @param postal_code [String] Valid postal code. Only USA ZIP codes are currently supported, entered as a five + # + # @param state [String] Valid state code. Only USA state codes are currently supported, entered in upper + # + # @param address2 [String] Unit or apartment number (if applicable). + end + end + end +end diff --git a/lib/lithic/models/kyc.rb b/lib/lithic/models/kyc.rb new file mode 100644 index 00000000..9c168f8d --- /dev/null +++ b/lib/lithic/models/kyc.rb @@ -0,0 +1,142 @@ +# frozen_string_literal: true + +module Lithic + module Models + class KYC < Lithic::Internal::Type::BaseModel + # @!attribute individual + # Information on individual for whom the account is being opened and KYC is being + # run. + # + # @return [Lithic::Models::KYC::Individual] + required :individual, -> { Lithic::KYC::Individual } + + # @!attribute tos_timestamp + # An RFC 3339 timestamp indicating when the account holder accepted the applicable + # legal agreements (e.g., cardholder terms) as agreed upon during API customer's + # implementation with Lithic. + # + # @return [String] + required :tos_timestamp, String + + # @!attribute workflow + # Specifies the type of KYC workflow to run. + # + # @return [Symbol, Lithic::Models::KYC::Workflow] + required :workflow, enum: -> { Lithic::KYC::Workflow } + + # @!attribute external_id + # A user provided id that can be used to link an account holder with an external + # system + # + # @return [String, nil] + optional :external_id, String + + # @!attribute kyc_passed_timestamp + # An RFC 3339 timestamp indicating when precomputed KYC was completed on the + # individual with a pass result. + # + # This field is required only if workflow type is `KYC_BYO`. + # + # @return [String, nil] + optional :kyc_passed_timestamp, String + + # @!method initialize(individual:, tos_timestamp:, workflow:, external_id: nil, kyc_passed_timestamp: nil) + # Some parameter documentations has been truncated, see {Lithic::Models::KYC} for + # more details. + # + # @param individual [Lithic::Models::KYC::Individual] Information on individual for whom the account is being opened and KYC is being + # + # @param tos_timestamp [String] An RFC 3339 timestamp indicating when the account holder accepted the applicable + # + # @param workflow [Symbol, Lithic::Models::KYC::Workflow] Specifies the type of KYC workflow to run. + # + # @param external_id [String] A user provided id that can be used to link an account holder with an external s + # + # @param kyc_passed_timestamp [String] An RFC 3339 timestamp indicating when precomputed KYC was completed on the indiv + + # @see Lithic::Models::KYC#individual + class Individual < Lithic::Internal::Type::BaseModel + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::Address] + required :address, -> { Lithic::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String] + required :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String] + required :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String] + required :first_name, String + + # @!attribute government_id + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + # + # @return [String] + required :government_id, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String] + required :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String] + required :phone_number, String + + # @!method initialize(address:, dob:, email:, first_name:, government_id:, last_name:, phone_number:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::KYC::Individual} for more details. + # + # Information on individual for whom the account is being opened and KYC is being + # run. + # + # @param address [Lithic::Models::Address] Individual's current address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param government_id [String] Government-issued identification number (required for identity verification and + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + end + + # Specifies the type of KYC workflow to run. + # + # @see Lithic::Models::KYC#workflow + module Workflow + extend Lithic::Internal::Type::Enum + + KYC_BASIC = :KYC_BASIC + KYC_BYO = :KYC_BYO + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/kyc_exempt.rb b/lib/lithic/models/kyc_exempt.rb new file mode 100644 index 00000000..194041c1 --- /dev/null +++ b/lib/lithic/models/kyc_exempt.rb @@ -0,0 +1,112 @@ +# frozen_string_literal: true + +module Lithic + module Models + class KYCExempt < Lithic::Internal::Type::BaseModel + # @!attribute address + # KYC Exempt user's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + # + # @return [Lithic::Models::Address] + required :address, -> { Lithic::Address } + + # @!attribute email + # The KYC Exempt user's email + # + # @return [String] + required :email, String + + # @!attribute first_name + # The KYC Exempt user's first name + # + # @return [String] + required :first_name, String + + # @!attribute kyc_exemption_type + # Specifies the type of KYC Exempt user + # + # @return [Symbol, Lithic::Models::KYCExempt::KYCExemptionType] + required :kyc_exemption_type, enum: -> { Lithic::KYCExempt::KYCExemptionType } + + # @!attribute last_name + # The KYC Exempt user's last name + # + # @return [String] + required :last_name, String + + # @!attribute phone_number + # The KYC Exempt user's phone number, entered in E.164 format. + # + # @return [String] + required :phone_number, String + + # @!attribute workflow + # Specifies the workflow type. This must be 'KYC_EXEMPT' + # + # @return [Symbol, Lithic::Models::KYCExempt::Workflow] + required :workflow, enum: -> { Lithic::KYCExempt::Workflow } + + # @!attribute business_account_token + # Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # users of businesses. Pass the account_token of the enrolled business associated + # with the AUTHORIZED_USER in this field. + # + # @return [String, nil] + optional :business_account_token, String + + # @!attribute external_id + # A user provided id that can be used to link an account holder with an external + # system + # + # @return [String, nil] + optional :external_id, String + + # @!method initialize(address:, email:, first_name:, kyc_exemption_type:, last_name:, phone_number:, workflow:, business_account_token: nil, external_id: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::KYCExempt} for more details. + # + # @param address [Lithic::Models::Address] KYC Exempt user's current address - PO boxes, UPS drops, and FedEx drops are not + # + # @param email [String] The KYC Exempt user's email + # + # @param first_name [String] The KYC Exempt user's first name + # + # @param kyc_exemption_type [Symbol, Lithic::Models::KYCExempt::KYCExemptionType] Specifies the type of KYC Exempt user + # + # @param last_name [String] The KYC Exempt user's last name + # + # @param phone_number [String] The KYC Exempt user's phone number, entered in E.164 format. + # + # @param workflow [Symbol, Lithic::Models::KYCExempt::Workflow] Specifies the workflow type. This must be 'KYC_EXEMPT' + # + # @param business_account_token [String] Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # + # @param external_id [String] A user provided id that can be used to link an account holder with an external s + + # Specifies the type of KYC Exempt user + # + # @see Lithic::Models::KYCExempt#kyc_exemption_type + module KYCExemptionType + extend Lithic::Internal::Type::Enum + + AUTHORIZED_USER = :AUTHORIZED_USER + PREPAID_CARD_USER = :PREPAID_CARD_USER + + # @!method self.values + # @return [Array] + end + + # Specifies the workflow type. This must be 'KYC_EXEMPT' + # + # @see Lithic::Models::KYCExempt#workflow + module Workflow + extend Lithic::Internal::Type::Enum + + KYC_EXEMPT = :KYC_EXEMPT + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/loan_tape_created_webhook_event.rb b/lib/lithic/models/loan_tape_created_webhook_event.rb new file mode 100644 index 00000000..e24138c4 --- /dev/null +++ b/lib/lithic/models/loan_tape_created_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class LoanTapeCreatedWebhookEvent < Lithic::Models::FinancialAccounts::LoanTape + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"loan_tape.created"] + required :event_type, const: :"loan_tape.created" + + # @!method initialize(event_type: :"loan_tape.created") + # @param event_type [Symbol, :"loan_tape.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/loan_tape_updated_webhook_event.rb b/lib/lithic/models/loan_tape_updated_webhook_event.rb new file mode 100644 index 00000000..6ff06c20 --- /dev/null +++ b/lib/lithic/models/loan_tape_updated_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class LoanTapeUpdatedWebhookEvent < Lithic::Models::FinancialAccounts::LoanTape + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"loan_tape.updated"] + required :event_type, const: :"loan_tape.updated" + + # @!method initialize(event_type: :"loan_tape.updated") + # @param event_type [Symbol, :"loan_tape.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/management_operation_create_params.rb b/lib/lithic/models/management_operation_create_params.rb new file mode 100644 index 00000000..7aff24b8 --- /dev/null +++ b/lib/lithic/models/management_operation_create_params.rb @@ -0,0 +1,164 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ManagementOperations#create + class ManagementOperationCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute amount + # + # @return [Integer] + required :amount, Integer + + # @!attribute category + # + # @return [Symbol, Lithic::Models::ManagementOperationCreateParams::Category] + required :category, enum: -> { Lithic::ManagementOperationCreateParams::Category } + + # @!attribute direction + # + # @return [Symbol, Lithic::Models::ManagementOperationCreateParams::Direction] + required :direction, enum: -> { Lithic::ManagementOperationCreateParams::Direction } + + # @!attribute effective_date + # + # @return [Date] + required :effective_date, Date + + # @!attribute event_type + # + # @return [Symbol, Lithic::Models::ManagementOperationCreateParams::EventType] + required :event_type, enum: -> { Lithic::ManagementOperationCreateParams::EventType } + + # @!attribute financial_account_token + # + # @return [String] + required :financial_account_token, String + + # @!attribute token + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + # + # @return [String, nil] + optional :token, String + + # @!attribute memo + # + # @return [String, nil] + optional :memo, String + + # @!attribute on_closed_account + # What to do if the financial account is closed when posting an operation + # + # @return [Symbol, Lithic::Models::ManagementOperationCreateParams::OnClosedAccount, nil] + optional :on_closed_account, enum: -> { Lithic::ManagementOperationCreateParams::OnClosedAccount } + + # @!attribute subtype + # + # @return [String, nil] + optional :subtype, String + + # @!attribute user_defined_id + # + # @return [String, nil] + optional :user_defined_id, String + + # @!method initialize(amount:, category:, direction:, effective_date:, event_type:, financial_account_token:, token: nil, memo: nil, on_closed_account: nil, subtype: nil, user_defined_id: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ManagementOperationCreateParams} for more details. + # + # @param amount [Integer] + # + # @param category [Symbol, Lithic::Models::ManagementOperationCreateParams::Category] + # + # @param direction [Symbol, Lithic::Models::ManagementOperationCreateParams::Direction] + # + # @param effective_date [Date] + # + # @param event_type [Symbol, Lithic::Models::ManagementOperationCreateParams::EventType] + # + # @param financial_account_token [String] + # + # @param token [String] Customer-provided token that will serve as an idempotency token. This token will + # + # @param memo [String] + # + # @param on_closed_account [Symbol, Lithic::Models::ManagementOperationCreateParams::OnClosedAccount] What to do if the financial account is closed when posting an operation + # + # @param subtype [String] + # + # @param user_defined_id [String] + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + module Category + extend Lithic::Internal::Type::Enum + + MANAGEMENT_FEE = :MANAGEMENT_FEE + MANAGEMENT_DISPUTE = :MANAGEMENT_DISPUTE + MANAGEMENT_REWARD = :MANAGEMENT_REWARD + MANAGEMENT_ADJUSTMENT = :MANAGEMENT_ADJUSTMENT + MANAGEMENT_DISBURSEMENT = :MANAGEMENT_DISBURSEMENT + + # @!method self.values + # @return [Array] + end + + module Direction + extend Lithic::Internal::Type::Enum + + CREDIT = :CREDIT + DEBIT = :DEBIT + + # @!method self.values + # @return [Array] + end + + module EventType + extend Lithic::Internal::Type::Enum + + LOSS_WRITE_OFF = :LOSS_WRITE_OFF + CASH_BACK = :CASH_BACK + CASH_BACK_REVERSAL = :CASH_BACK_REVERSAL + CURRENCY_CONVERSION = :CURRENCY_CONVERSION + CURRENCY_CONVERSION_REVERSAL = :CURRENCY_CONVERSION_REVERSAL + INTEREST = :INTEREST + INTEREST_REVERSAL = :INTEREST_REVERSAL + LATE_PAYMENT = :LATE_PAYMENT + LATE_PAYMENT_REVERSAL = :LATE_PAYMENT_REVERSAL + BILLING_ERROR = :BILLING_ERROR + BILLING_ERROR_REVERSAL = :BILLING_ERROR_REVERSAL + PROVISIONAL_CREDIT = :PROVISIONAL_CREDIT + PROVISIONAL_CREDIT_REVERSAL = :PROVISIONAL_CREDIT_REVERSAL + RETURNED_PAYMENT = :RETURNED_PAYMENT + RETURNED_PAYMENT_REVERSAL = :RETURNED_PAYMENT_REVERSAL + DISPUTE_WON = :DISPUTE_WON + DISPUTE_WON_REVERSAL = :DISPUTE_WON_REVERSAL + DISBURSE = :DISBURSE + DISBURSE_REVERSAL = :DISBURSE_REVERSAL + ANNUAL = :ANNUAL + ANNUAL_REVERSAL = :ANNUAL_REVERSAL + QUARTERLY = :QUARTERLY + QUARTERLY_REVERSAL = :QUARTERLY_REVERSAL + MONTHLY = :MONTHLY + MONTHLY_REVERSAL = :MONTHLY_REVERSAL + + # @!method self.values + # @return [Array] + end + + # What to do if the financial account is closed when posting an operation + module OnClosedAccount + extend Lithic::Internal::Type::Enum + + FAIL = :FAIL + USE_SUSPENSE = :USE_SUSPENSE + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/management_operation_created_webhook_event.rb b/lib/lithic/models/management_operation_created_webhook_event.rb new file mode 100644 index 00000000..e853775a --- /dev/null +++ b/lib/lithic/models/management_operation_created_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ManagementOperationCreatedWebhookEvent < Lithic::Models::ManagementOperationTransaction + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"management_operation.created"] + required :event_type, const: :"management_operation.created" + + # @!method initialize(event_type: :"management_operation.created") + # @param event_type [Symbol, :"management_operation.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/management_operation_list_params.rb b/lib/lithic/models/management_operation_list_params.rb new file mode 100644 index 00000000..3b83c201 --- /dev/null +++ b/lib/lithic/models/management_operation_list_params.rb @@ -0,0 +1,122 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ManagementOperations#list + class ManagementOperationListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time + + # @!attribute business_account_token + # + # @return [String, nil] + optional :business_account_token, String + + # @!attribute category + # Management operation category to be returned. + # + # @return [Symbol, Lithic::Models::ManagementOperationListParams::Category, nil] + optional :category, enum: -> { Lithic::ManagementOperationListParams::Category } + + # @!attribute end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute financial_account_token + # Globally unique identifier for the financial account. Accepted type dependent on + # the program's use case. + # + # @return [String, nil] + optional :financial_account_token, String + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!attribute status + # Management operation status to be returned. + # + # @return [Symbol, Lithic::Models::ManagementOperationListParams::Status, nil] + optional :status, enum: -> { Lithic::ManagementOperationListParams::Status } + + # @!method initialize(begin_: nil, business_account_token: nil, category: nil, end_: nil, ending_before: nil, financial_account_token: nil, page_size: nil, starting_after: nil, status: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ManagementOperationListParams} for more details. + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param business_account_token [String] + # + # @param category [Symbol, Lithic::Models::ManagementOperationListParams::Category] Management operation category to be returned. + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param financial_account_token [String] Globally unique identifier for the financial account. Accepted type dependent on + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param status [Symbol, Lithic::Models::ManagementOperationListParams::Status] Management operation status to be returned. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Management operation category to be returned. + module Category + extend Lithic::Internal::Type::Enum + + MANAGEMENT_FEE = :MANAGEMENT_FEE + MANAGEMENT_DISPUTE = :MANAGEMENT_DISPUTE + MANAGEMENT_REWARD = :MANAGEMENT_REWARD + MANAGEMENT_ADJUSTMENT = :MANAGEMENT_ADJUSTMENT + MANAGEMENT_DISBURSEMENT = :MANAGEMENT_DISBURSEMENT + + # @!method self.values + # @return [Array] + end + + # Management operation status to be returned. + module Status + extend Lithic::Internal::Type::Enum + + PENDING = :PENDING + SETTLED = :SETTLED + DECLINED = :DECLINED + REVERSED = :REVERSED + CANCELED = :CANCELED + RETURNED = :RETURNED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/management_operation_retrieve_params.rb b/lib/lithic/models/management_operation_retrieve_params.rb new file mode 100644 index 00000000..46f348f4 --- /dev/null +++ b/lib/lithic/models/management_operation_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ManagementOperations#retrieve + class ManagementOperationRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute management_operation_token + # + # @return [String] + required :management_operation_token, String + + # @!method initialize(management_operation_token:, request_options: {}) + # @param management_operation_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/management_operation_reverse_params.rb b/lib/lithic/models/management_operation_reverse_params.rb new file mode 100644 index 00000000..9ba27a76 --- /dev/null +++ b/lib/lithic/models/management_operation_reverse_params.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ManagementOperations#reverse + class ManagementOperationReverseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute management_operation_token + # + # @return [String] + required :management_operation_token, String + + # @!attribute effective_date + # + # @return [Date] + required :effective_date, Date + + # @!attribute memo + # + # @return [String, nil] + optional :memo, String + + # @!method initialize(management_operation_token:, effective_date:, memo: nil, request_options: {}) + # @param management_operation_token [String] + # @param effective_date [Date] + # @param memo [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/management_operation_transaction.rb b/lib/lithic/models/management_operation_transaction.rb new file mode 100644 index 00000000..fc172b33 --- /dev/null +++ b/lib/lithic/models/management_operation_transaction.rb @@ -0,0 +1,333 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ManagementOperations#create + class ManagementOperationTransaction < Lithic::Internal::Type::BaseModel + # @!attribute token + # Unique identifier for the transaction + # + # @return [String] + required :token, String + + # @!attribute created + # ISO 8601 timestamp of when the transaction was created + # + # @return [Time] + required :created, Time + + # @!attribute status + # The status of the transaction + # + # @return [Symbol, Lithic::Models::ManagementOperationTransaction::Status] + required :status, enum: -> { Lithic::ManagementOperationTransaction::Status } + + # @!attribute updated + # ISO 8601 timestamp of when the transaction was last updated + # + # @return [Time] + required :updated, Time + + # @!attribute category + # + # @return [Symbol, Lithic::Models::ManagementOperationTransaction::Category, nil] + optional :category, enum: -> { Lithic::ManagementOperationTransaction::Category } + + # @!attribute currency + # + # @return [String, nil] + optional :currency, String + + # @!attribute direction + # + # @return [Symbol, Lithic::Models::ManagementOperationTransaction::Direction, nil] + optional :direction, enum: -> { Lithic::ManagementOperationTransaction::Direction } + + # @!attribute events + # + # @return [Array, nil] + optional :events, -> { Lithic::Internal::Type::ArrayOf[Lithic::ManagementOperationTransaction::Event] } + + # @!attribute external_resource + # External resource associated with the management operation + # + # @return [Lithic::Models::ExternalResource, nil] + optional :external_resource, -> { Lithic::ExternalResource }, nil?: true + + # @!attribute family + # MANAGEMENT_OPERATION - Management Operation Transaction + # + # @return [Symbol, Lithic::Models::ManagementOperationTransaction::Family, nil] + optional :family, enum: -> { Lithic::ManagementOperationTransaction::Family } + + # @!attribute financial_account_token + # + # @return [String, nil] + optional :financial_account_token, String + + # @!attribute pending_amount + # + # @return [Integer, nil] + optional :pending_amount, Integer + + # @!attribute result + # + # @return [Symbol, Lithic::Models::ManagementOperationTransaction::Result, nil] + optional :result, enum: -> { Lithic::ManagementOperationTransaction::Result } + + # @!attribute settled_amount + # + # @return [Integer, nil] + optional :settled_amount, Integer + + # @!attribute transaction_series + # + # @return [Lithic::Models::ManagementOperationTransaction::TransactionSeries, nil] + optional :transaction_series, + -> { + Lithic::ManagementOperationTransaction::TransactionSeries + }, + nil?: true + + # @!attribute user_defined_id + # + # @return [String, nil] + optional :user_defined_id, String, nil?: true + + # @!method initialize(token:, created:, status:, updated:, category: nil, currency: nil, direction: nil, events: nil, external_resource: nil, family: nil, financial_account_token: nil, pending_amount: nil, result: nil, settled_amount: nil, transaction_series: nil, user_defined_id: nil) + # @param token [String] Unique identifier for the transaction + # + # @param created [Time] ISO 8601 timestamp of when the transaction was created + # + # @param status [Symbol, Lithic::Models::ManagementOperationTransaction::Status] The status of the transaction + # + # @param updated [Time] ISO 8601 timestamp of when the transaction was last updated + # + # @param category [Symbol, Lithic::Models::ManagementOperationTransaction::Category] + # + # @param currency [String] + # + # @param direction [Symbol, Lithic::Models::ManagementOperationTransaction::Direction] + # + # @param events [Array] + # + # @param external_resource [Lithic::Models::ExternalResource, nil] External resource associated with the management operation + # + # @param family [Symbol, Lithic::Models::ManagementOperationTransaction::Family] MANAGEMENT_OPERATION - Management Operation Transaction + # + # @param financial_account_token [String] + # + # @param pending_amount [Integer] + # + # @param result [Symbol, Lithic::Models::ManagementOperationTransaction::Result] + # + # @param settled_amount [Integer] + # + # @param transaction_series [Lithic::Models::ManagementOperationTransaction::TransactionSeries, nil] + # + # @param user_defined_id [String, nil] + + # The status of the transaction + # + # @see Lithic::Models::ManagementOperationTransaction#status + module Status + extend Lithic::Internal::Type::Enum + + PENDING = :PENDING + SETTLED = :SETTLED + DECLINED = :DECLINED + REVERSED = :REVERSED + CANCELED = :CANCELED + RETURNED = :RETURNED + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::ManagementOperationTransaction#category + module Category + extend Lithic::Internal::Type::Enum + + MANAGEMENT_FEE = :MANAGEMENT_FEE + MANAGEMENT_DISPUTE = :MANAGEMENT_DISPUTE + MANAGEMENT_REWARD = :MANAGEMENT_REWARD + MANAGEMENT_ADJUSTMENT = :MANAGEMENT_ADJUSTMENT + MANAGEMENT_DISBURSEMENT = :MANAGEMENT_DISBURSEMENT + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::ManagementOperationTransaction#direction + module Direction + extend Lithic::Internal::Type::Enum + + CREDIT = :CREDIT + DEBIT = :DEBIT + + # @!method self.values + # @return [Array] + end + + class Event < Lithic::Internal::Type::BaseModel + # @!attribute token + # + # @return [String] + required :token, String + + # @!attribute amount + # + # @return [Integer] + required :amount, Integer + + # @!attribute created + # + # @return [Time] + required :created, Time + + # @!attribute detailed_results + # + # @return [Array] + required :detailed_results, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::ManagementOperationTransaction::Event::DetailedResult] } + + # @!attribute effective_date + # + # @return [Date] + required :effective_date, Date + + # @!attribute memo + # + # @return [String] + required :memo, String + + # @!attribute result + # + # @return [Symbol, Lithic::Models::ManagementOperationTransaction::Event::Result] + required :result, enum: -> { Lithic::ManagementOperationTransaction::Event::Result } + + # @!attribute type + # + # @return [Symbol, Lithic::Models::ManagementOperationTransaction::Event::Type] + required :type, enum: -> { Lithic::ManagementOperationTransaction::Event::Type } + + # @!attribute subtype + # + # @return [String, nil] + optional :subtype, String, nil?: true + + # @!method initialize(token:, amount:, created:, detailed_results:, effective_date:, memo:, result:, type:, subtype: nil) + # @param token [String] + # @param amount [Integer] + # @param created [Time] + # @param detailed_results [Array] + # @param effective_date [Date] + # @param memo [String] + # @param result [Symbol, Lithic::Models::ManagementOperationTransaction::Event::Result] + # @param type [Symbol, Lithic::Models::ManagementOperationTransaction::Event::Type] + # @param subtype [String, nil] + + module DetailedResult + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::ManagementOperationTransaction::Event#result + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::ManagementOperationTransaction::Event#type + module Type + extend Lithic::Internal::Type::Enum + + LOSS_WRITE_OFF = :LOSS_WRITE_OFF + CASH_BACK = :CASH_BACK + CASH_BACK_REVERSAL = :CASH_BACK_REVERSAL + CURRENCY_CONVERSION = :CURRENCY_CONVERSION + CURRENCY_CONVERSION_REVERSAL = :CURRENCY_CONVERSION_REVERSAL + INTEREST = :INTEREST + INTEREST_REVERSAL = :INTEREST_REVERSAL + LATE_PAYMENT = :LATE_PAYMENT + LATE_PAYMENT_REVERSAL = :LATE_PAYMENT_REVERSAL + BILLING_ERROR = :BILLING_ERROR + BILLING_ERROR_REVERSAL = :BILLING_ERROR_REVERSAL + PROVISIONAL_CREDIT = :PROVISIONAL_CREDIT + PROVISIONAL_CREDIT_REVERSAL = :PROVISIONAL_CREDIT_REVERSAL + RETURNED_PAYMENT = :RETURNED_PAYMENT + RETURNED_PAYMENT_REVERSAL = :RETURNED_PAYMENT_REVERSAL + DISPUTE_WON = :DISPUTE_WON + DISPUTE_WON_REVERSAL = :DISPUTE_WON_REVERSAL + DISBURSE = :DISBURSE + DISBURSE_REVERSAL = :DISBURSE_REVERSAL + ANNUAL = :ANNUAL + ANNUAL_REVERSAL = :ANNUAL_REVERSAL + QUARTERLY = :QUARTERLY + QUARTERLY_REVERSAL = :QUARTERLY_REVERSAL + MONTHLY = :MONTHLY + MONTHLY_REVERSAL = :MONTHLY_REVERSAL + + # @!method self.values + # @return [Array] + end + end + + # MANAGEMENT_OPERATION - Management Operation Transaction + # + # @see Lithic::Models::ManagementOperationTransaction#family + module Family + extend Lithic::Internal::Type::Enum + + MANAGEMENT_OPERATION = :MANAGEMENT_OPERATION + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::ManagementOperationTransaction#result + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::ManagementOperationTransaction#transaction_series + class TransactionSeries < Lithic::Internal::Type::BaseModel + # @!attribute related_transaction_event_token + # + # @return [String, nil] + required :related_transaction_event_token, String, nil?: true + + # @!attribute related_transaction_token + # + # @return [String, nil] + required :related_transaction_token, String, nil?: true + + # @!attribute type + # + # @return [String] + required :type, String + + # @!method initialize(related_transaction_event_token:, related_transaction_token:, type:) + # @param related_transaction_event_token [String, nil] + # @param related_transaction_token [String, nil] + # @param type [String] + end + end + end +end diff --git a/lib/lithic/models/management_operation_updated_webhook_event.rb b/lib/lithic/models/management_operation_updated_webhook_event.rb new file mode 100644 index 00000000..aaa17709 --- /dev/null +++ b/lib/lithic/models/management_operation_updated_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ManagementOperationUpdatedWebhookEvent < Lithic::Models::ManagementOperationTransaction + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"management_operation.updated"] + required :event_type, const: :"management_operation.updated" + + # @!method initialize(event_type: :"management_operation.updated") + # @param event_type [Symbol, :"management_operation.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/merchant.rb b/lib/lithic/models/merchant.rb new file mode 100644 index 00000000..2bb506cb --- /dev/null +++ b/lib/lithic/models/merchant.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +module Lithic + module Models + class Merchant < Lithic::Internal::Type::BaseModel + # @!attribute acceptor_id + # Unique alphanumeric identifier for the payment card acceptor (merchant). + # + # @return [String] + required :acceptor_id, String + + # @!attribute acquiring_institution_id + # Unique numeric identifier of the acquiring institution. + # + # @return [String] + required :acquiring_institution_id, String + + # @!attribute city + # City of card acceptor. Note that in many cases, particularly in card-not-present + # transactions, merchants may send through a phone number or URL in this field. + # + # @return [String] + required :city, String + + # @!attribute country + # Country or entity of card acceptor. Possible values are: (1) all ISO 3166-1 + # alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for Netherlands Antilles. + # + # @return [String] + required :country, String + + # @!attribute descriptor + # Short description of card acceptor. + # + # @return [String] + required :descriptor, String + + # @!attribute mcc + # Merchant category code (MCC). A four-digit number listed in ISO 18245. An MCC is + # used to classify a business by the types of goods or services it provides. + # + # @return [String] + required :mcc, String + + # @!attribute state + # Geographic state of card acceptor. + # + # @return [String] + required :state, String + + # @!method initialize(acceptor_id:, acquiring_institution_id:, city:, country:, descriptor:, mcc:, state:) + # Some parameter documentations has been truncated, see {Lithic::Models::Merchant} + # for more details. + # + # @param acceptor_id [String] Unique alphanumeric identifier for the payment card acceptor (merchant). + # + # @param acquiring_institution_id [String] Unique numeric identifier of the acquiring institution. + # + # @param city [String] City of card acceptor. Note that in many cases, particularly in card-not-present + # + # @param country [String] Country or entity of card acceptor. Possible values are: (1) all ISO 3166-1 alph + # + # @param descriptor [String] Short description of card acceptor. + # + # @param mcc [String] Merchant category code (MCC). A four-digit number listed in ISO 18245. An MCC is + # + # @param state [String] Geographic state of card acceptor. + end + end +end diff --git a/lib/lithic/models/message_attempt.rb b/lib/lithic/models/message_attempt.rb new file mode 100644 index 00000000..b9815423 --- /dev/null +++ b/lib/lithic/models/message_attempt.rb @@ -0,0 +1,94 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Events#list_attempts + class MessageAttempt < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier. + # + # @return [String] + required :token, String + + # @!attribute created + # An RFC 3339 timestamp for when the event was created. UTC time zone. + # + # If no timezone is specified, UTC will be used. + # + # @return [Time] + required :created, Time + + # @!attribute event_subscription_token + # Globally unique identifier. + # + # @return [String] + required :event_subscription_token, String + + # @!attribute event_token + # Globally unique identifier. + # + # @return [String] + required :event_token, String + + # @!attribute response + # The response body from the event subscription's URL. + # + # @return [String] + required :response, String + + # @!attribute response_status_code + # The response status code from the event subscription's URL. + # + # @return [Integer] + required :response_status_code, Integer + + # @!attribute status + # The status of the event attempt. + # + # @return [Symbol, Lithic::Models::MessageAttempt::Status] + required :status, enum: -> { Lithic::MessageAttempt::Status } + + # @!attribute url + # + # @return [String] + required :url, String + + # @!method initialize(token:, created:, event_subscription_token:, event_token:, response:, response_status_code:, status:, url:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::MessageAttempt} for more details. + # + # A subscription to specific event types. + # + # @param token [String] Globally unique identifier. + # + # @param created [Time] An RFC 3339 timestamp for when the event was created. UTC time zone. + # + # @param event_subscription_token [String] Globally unique identifier. + # + # @param event_token [String] Globally unique identifier. + # + # @param response [String] The response body from the event subscription's URL. + # + # @param response_status_code [Integer] The response status code from the event subscription's URL. + # + # @param status [Symbol, Lithic::Models::MessageAttempt::Status] The status of the event attempt. + # + # @param url [String] + + # The status of the event attempt. + # + # @see Lithic::Models::MessageAttempt#status + module Status + extend Lithic::Internal::Type::Enum + + FAILED = :FAILED + PENDING = :PENDING + SENDING = :SENDING + SUCCESS = :SUCCESS + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/network_program.rb b/lib/lithic/models/network_program.rb new file mode 100644 index 00000000..889a82b7 --- /dev/null +++ b/lib/lithic/models/network_program.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::NetworkPrograms#retrieve + class NetworkProgram < Lithic::Internal::Type::BaseModel + # @!attribute token + # Lithic-generated unique identifier for the program + # + # @return [String] + required :token, String + + # @!attribute default_product_code + # Network product ID associated with this program. + # + # @return [String] + required :default_product_code, String + + # @!attribute name + # The name of the network program. + # + # @return [String] + required :name, String + + # @!attribute registered_program_identification_number + # RPIN value assigned by the network. + # + # @return [String] + required :registered_program_identification_number, String + + # @!method initialize(token:, default_product_code:, name:, registered_program_identification_number:) + # @param token [String] Lithic-generated unique identifier for the program + # + # @param default_product_code [String] Network product ID associated with this program. + # + # @param name [String] The name of the network program. + # + # @param registered_program_identification_number [String] RPIN value assigned by the network. + end + end +end diff --git a/lib/lithic/models/network_program_list_params.rb b/lib/lithic/models/network_program_list_params.rb new file mode 100644 index 00000000..8626339c --- /dev/null +++ b/lib/lithic/models/network_program_list_params.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::NetworkPrograms#list + class NetworkProgramListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time + + # @!attribute end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!method initialize(begin_: nil, end_: nil, page_size: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::NetworkProgramListParams} for more details. + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param page_size [Integer] Page size (for pagination). + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/network_program_retrieve_params.rb b/lib/lithic/models/network_program_retrieve_params.rb new file mode 100644 index 00000000..a8844e4f --- /dev/null +++ b/lib/lithic/models/network_program_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::NetworkPrograms#retrieve + class NetworkProgramRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute network_program_token + # + # @return [String] + required :network_program_token, String + + # @!method initialize(network_program_token:, request_options: {}) + # @param network_program_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/network_total.rb b/lib/lithic/models/network_total.rb new file mode 100644 index 00000000..81219f68 --- /dev/null +++ b/lib/lithic/models/network_total.rb @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +module Lithic + module Models + class NetworkTotal < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier. + # + # @return [String] + required :token, String + + # @!attribute amounts + # + # @return [Lithic::Models::NetworkTotal::Amounts] + required :amounts, -> { Lithic::NetworkTotal::Amounts } + + # @!attribute created + # RFC 3339 timestamp for when the record was created. UTC time zone. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # 3-character alphabetic ISO 4217 code. + # + # @return [String] + required :currency, String + + # @!attribute institution_id + # The institution that activity occurred on. For Mastercard: ICA (Interbank Card + # Association). For Maestro: institution ID. For Visa: lowest level SRE + # (Settlement Reporting Entity). + # + # @return [String] + required :institution_id, String + + # @!attribute is_complete + # Indicates that all settlement records related to this Network Total are + # available in the details endpoint. + # + # @return [Boolean] + required :is_complete, Lithic::Internal::Type::Boolean + + # @!attribute network + # Card network where the transaction took place. AMEX, VISA, MASTERCARD, MAESTRO, + # or INTERLINK. + # + # @return [Symbol, Lithic::Models::NetworkTotal::Network] + required :network, enum: -> { Lithic::NetworkTotal::Network } + + # @!attribute report_date + # Date that the network total record applies to. YYYY-MM-DD format. + # + # @return [Date] + required :report_date, Date + + # @!attribute settlement_institution_id + # The institution responsible for settlement. For Mastercard: same as + # `institution_id`. For Maestro: billing ICA. For Visa: Funds Transfer SRE + # (FTSRE). + # + # @return [String] + required :settlement_institution_id, String + + # @!attribute settlement_service + # Settlement service. + # + # @return [String] + required :settlement_service, String + + # @!attribute updated + # RFC 3339 timestamp for when the record was last updated. UTC time zone. + # + # @return [Time] + required :updated, Time + + # @!attribute cycle + # The clearing cycle that the network total record applies to. Mastercard only. + # + # @return [Integer, nil] + optional :cycle, Integer + + # @!method initialize(token:, amounts:, created:, currency:, institution_id:, is_complete:, network:, report_date:, settlement_institution_id:, settlement_service:, updated:, cycle: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::NetworkTotal} for more details. + # + # @param token [String] Globally unique identifier. + # + # @param amounts [Lithic::Models::NetworkTotal::Amounts] + # + # @param created [Time] RFC 3339 timestamp for when the record was created. UTC time zone. + # + # @param currency [String] 3-character alphabetic ISO 4217 code. + # + # @param institution_id [String] The institution that activity occurred on. For Mastercard: ICA (Interbank Card A + # + # @param is_complete [Boolean] Indicates that all settlement records related to this Network Total are availabl + # + # @param network [Symbol, Lithic::Models::NetworkTotal::Network] Card network where the transaction took place. AMEX, VISA, MASTERCARD, MAESTRO, + # + # @param report_date [Date] Date that the network total record applies to. YYYY-MM-DD format. + # + # @param settlement_institution_id [String] The institution responsible for settlement. For Mastercard: same as `institution + # + # @param settlement_service [String] Settlement service. + # + # @param updated [Time] RFC 3339 timestamp for when the record was last updated. UTC time zone. + # + # @param cycle [Integer] The clearing cycle that the network total record applies to. Mastercard only. + + # @see Lithic::Models::NetworkTotal#amounts + class Amounts < Lithic::Internal::Type::BaseModel + # @!attribute gross_settlement + # Total settlement amount excluding interchange, in currency's smallest unit. + # + # @return [Integer] + required :gross_settlement, Integer + + # @!attribute interchange_fees + # Interchange amount, in currency's smallest unit. + # + # @return [Integer] + required :interchange_fees, Integer + + # @!attribute net_settlement + # `gross_settlement` net of `interchange_fees` and `visa_charges` (if applicable), + # in currency's smallest unit. + # + # @return [Integer] + required :net_settlement, Integer + + # @!attribute visa_charges + # Charges specific to Visa/Interlink, in currency's smallest unit. + # + # @return [Integer, nil] + optional :visa_charges, Integer + + # @!method initialize(gross_settlement:, interchange_fees:, net_settlement:, visa_charges: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::NetworkTotal::Amounts} for more details. + # + # @param gross_settlement [Integer] Total settlement amount excluding interchange, in currency's smallest unit. + # + # @param interchange_fees [Integer] Interchange amount, in currency's smallest unit. + # + # @param net_settlement [Integer] `gross_settlement` net of `interchange_fees` and `visa_charges` (if applicable), + # + # @param visa_charges [Integer] Charges specific to Visa/Interlink, in currency's smallest unit. + end + + # Card network where the transaction took place. AMEX, VISA, MASTERCARD, MAESTRO, + # or INTERLINK. + # + # @see Lithic::Models::NetworkTotal#network + module Network + extend Lithic::Internal::Type::Enum + + AMEX = :AMEX + VISA = :VISA + MASTERCARD = :MASTERCARD + MAESTRO = :MAESTRO + INTERLINK = :INTERLINK + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/network_total_created_webhook_event.rb b/lib/lithic/models/network_total_created_webhook_event.rb new file mode 100644 index 00000000..386e666d --- /dev/null +++ b/lib/lithic/models/network_total_created_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class NetworkTotalCreatedWebhookEvent < Lithic::Models::NetworkTotal + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"network_total.created"] + required :event_type, const: :"network_total.created" + + # @!method initialize(event_type: :"network_total.created") + # @param event_type [Symbol, :"network_total.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/network_total_updated_webhook_event.rb b/lib/lithic/models/network_total_updated_webhook_event.rb new file mode 100644 index 00000000..d94ad810 --- /dev/null +++ b/lib/lithic/models/network_total_updated_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class NetworkTotalUpdatedWebhookEvent < Lithic::Models::NetworkTotal + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"network_total.updated"] + required :event_type, const: :"network_total.updated" + + # @!method initialize(event_type: :"network_total.updated") + # @param event_type [Symbol, :"network_total.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/non_pci_card.rb b/lib/lithic/models/non_pci_card.rb new file mode 100644 index 00000000..5461f849 --- /dev/null +++ b/lib/lithic/models/non_pci_card.rb @@ -0,0 +1,500 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Cards#list + class NonPCICard < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier. + # + # @return [String] + required :token, String + + # @!attribute account_token + # Globally unique identifier for the account to which the card belongs. + # + # @return [String] + required :account_token, String + + # @!attribute card_program_token + # Globally unique identifier for the card program on which the card exists. + # + # @return [String] + required :card_program_token, String + + # @!attribute created + # An RFC 3339 timestamp for when the card was created. UTC time zone. + # + # @return [Time] + required :created, Time + + # @!attribute funding + # Funding account for a card + # + # @return [Lithic::Models::NonPCICard::Funding, nil] + required :funding, -> { Lithic::NonPCICard::Funding }, nil?: true + + # @!attribute last_four + # Last four digits of the card number. + # + # @return [String] + required :last_four, String + + # @!attribute pin_status + # Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect + # attempts). + # + # @return [Symbol, Lithic::Models::NonPCICard::PinStatus] + required :pin_status, enum: -> { Lithic::NonPCICard::PinStatus } + + # @!attribute spend_limit + # Amount (in cents) to limit approved authorizations (e.g. 100000 would be a + # $1,000 limit). Transaction requests above the spend limit will be declined. + # + # @return [Integer] + required :spend_limit, Integer + + # @!attribute spend_limit_duration + # Spend limit duration values: + # + # - `ANNUALLY` - Card will authorize transactions up to spend limit for the + # trailing year. + # - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime + # of the card. + # - `MONTHLY` - Card will authorize transactions up to spend limit for the + # trailing month. To support recurring monthly payments, which can occur on + # different day every month, the time window we consider for monthly velocity + # starts 6 days after the current calendar date one month prior. + # - `TRANSACTION` - Card will authorize multiple transactions if each individual + # transaction is under the spend limit. + # + # @return [Symbol, Lithic::Models::SpendLimitDuration] + required :spend_limit_duration, enum: -> { Lithic::SpendLimitDuration } + + # @!attribute state + # Card state values: _ `CLOSED` - Card will no longer approve authorizations. + # Closing a card cannot be undone. _ `OPEN` - Card will approve authorizations (if + # they match card and account parameters). _ `PAUSED` - Card will decline + # authorizations, but can be resumed at a later time. _ `PENDING_FULFILLMENT` - + # The initial state for cards of type `PHYSICAL`. The card is provisioned pending + # manufacturing and fulfillment. Cards in this state can accept authorizations for + # e-commerce purchases, but not for "Card Present" purchases where the physical + # card itself is present. \* `PENDING_ACTIVATION` - At regular intervals, cards of + # type `PHYSICAL` in state `PENDING_FULFILLMENT` are sent to the card production + # warehouse and updated to state `PENDING_ACTIVATION`. Similar to + # `PENDING_FULFILLMENT`, cards in this state can be used for e-commerce + # transactions or can be added to mobile wallets. API clients should update the + # card's state to `OPEN` only after the cardholder confirms receipt of the card. + # In sandbox, the same daily batch fulfillment occurs, but no cards are actually + # manufactured. + # + # @return [Symbol, Lithic::Models::NonPCICard::State] + required :state, enum: -> { Lithic::NonPCICard::State } + + # @!attribute type + # Card types: _ `VIRTUAL` - Card will authorize at any merchant and can be added + # to a digital wallet like Apple Pay or Google Pay (if the card program is digital + # wallet-enabled). _ `PHYSICAL` - Manufactured and sent to the cardholder. We + # offer white label branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe + # functionality. _ `SINGLE_USE` - Card is closed upon first successful + # authorization. _ `MERCHANT_LOCKED` - Card is locked to the first merchant that + # successfully authorizes the card. _ `UNLOCKED` - _[Deprecated]_ Similar behavior + # to VIRTUAL cards, please use VIRTUAL instead. _ `DIGITAL_WALLET` - + # _[Deprecated]_ Similar behavior to VIRTUAL cards, please use VIRTUAL instead. + # + # @return [Symbol, Lithic::Models::NonPCICard::Type] + required :type, enum: -> { Lithic::NonPCICard::Type } + + # @!attribute auth_rule_tokens + # @deprecated + # + # List of identifiers for the Auth Rule(s) that are applied on the card. This + # field is deprecated and will no longer be populated in the `Card` object. The + # key will be removed from the schema in a future release. Use the `/auth_rules` + # endpoints to fetch Auth Rule information instead. + # + # @return [Array, nil] + optional :auth_rule_tokens, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute bulk_order_token + # Globally unique identifier for the bulk order associated with this card. Only + # applicable to physical cards that are part of a bulk shipment + # + # @return [String, nil] + optional :bulk_order_token, String, nil?: true + + # @!attribute cardholder_currency + # 3-character alphabetic ISO 4217 code for the currency of the cardholder. + # + # @return [String, nil] + optional :cardholder_currency, String + + # @!attribute comment + # Additional context or information related to the card. + # + # @return [String, nil] + optional :comment, String + + # @!attribute digital_card_art_token + # Specifies the digital card art to be displayed in the user's digital wallet + # after tokenization. This artwork must be approved by Mastercard and configured + # by Lithic to use. + # + # @return [String, nil] + optional :digital_card_art_token, String, nil?: true + + # @!attribute exp_month + # Two digit (MM) expiry month. + # + # @return [String, nil] + optional :exp_month, String + + # @!attribute exp_year + # Four digit (yyyy) expiry year. + # + # @return [String, nil] + optional :exp_year, String + + # @!attribute hostname + # Hostname of card's locked merchant (will be empty if not applicable). + # + # @return [String, nil] + optional :hostname, String + + # @!attribute memo + # Friendly name to identify the card. + # + # @return [String, nil] + optional :memo, String + + # @!attribute network_program_token + # Globally unique identifier for the card's network program. Null if the card is + # not associated with a network program. Currently applicable to Visa cards + # participating in Account Level Management only + # + # @return [String, nil] + optional :network_program_token, String, nil?: true + + # @!attribute pending_commands + # Indicates if there are offline PIN changes pending card interaction with an + # offline PIN terminal. Possible commands are: CHANGE_PIN, UNBLOCK_PIN. Applicable + # only to cards issued in markets supporting offline PINs. + # + # @return [Array, nil] + optional :pending_commands, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute product_id + # Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic + # before use. Specifies the configuration (i.e., physical card art) that the card + # should be manufactured with. + # + # @return [String, nil] + optional :product_id, String, nil?: true + + # @!attribute replacement_for + # If the card is a replacement for another card, the globally unique identifier + # for the card that was replaced. + # + # @return [String, nil] + optional :replacement_for, String, nil?: true + + # @!attribute substatus + # Card state substatus values: _ `LOST` - The physical card is no longer in the + # cardholder's possession due to being lost or never received by the cardholder. _ + # `COMPROMISED` - Card information has been exposed, potentially leading to + # unauthorized access. This may involve physical card theft, cloning, or online + # data breaches. _ `DAMAGED` - The physical card is not functioning properly, such + # as having chip failures or a demagnetized magnetic stripe. _ + # `END_USER_REQUEST` - The cardholder requested the closure of the card for + # reasons unrelated to fraud or damage, such as switching to a different product + # or closing the account. _ `ISSUER_REQUEST` - The issuer closed the card for + # reasons unrelated to fraud or damage, such as account inactivity, product or + # policy changes, or technology upgrades. _ `NOT_ACTIVE` - The card hasn’t had any + # transaction activity for a specified period, applicable to statuses like + # `PAUSED` or `CLOSED`. _ `SUSPICIOUS_ACTIVITY` - The card has one or more + # suspicious transactions or activities that require review. This can involve + # prompting the cardholder to confirm legitimate use or report confirmed fraud. _ + # `INTERNAL_REVIEW` - The card is temporarily paused pending further internal + # review. _ `EXPIRED` - The card has expired and has been closed without being + # reissued. _ `UNDELIVERABLE` - The card cannot be delivered to the cardholder and + # has been returned. \* `OTHER` - The reason for the status does not fall into any + # of the above categories. A comment can be provided to specify the reason. + # + # @return [Symbol, Lithic::Models::NonPCICard::Substatus, nil] + optional :substatus, enum: -> { Lithic::NonPCICard::Substatus }, nil?: true + + # @!method initialize(token:, account_token:, card_program_token:, created:, funding:, last_four:, pin_status:, spend_limit:, spend_limit_duration:, state:, type:, auth_rule_tokens: nil, bulk_order_token: nil, cardholder_currency: nil, comment: nil, digital_card_art_token: nil, exp_month: nil, exp_year: nil, hostname: nil, memo: nil, network_program_token: nil, pending_commands: nil, product_id: nil, replacement_for: nil, substatus: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::NonPCICard} for more details. + # + # Card details without PCI information + # + # @param token [String] Globally unique identifier. + # + # @param account_token [String] Globally unique identifier for the account to which the card belongs. + # + # @param card_program_token [String] Globally unique identifier for the card program on which the card exists. + # + # @param created [Time] An RFC 3339 timestamp for when the card was created. UTC time zone. + # + # @param funding [Lithic::Models::NonPCICard::Funding, nil] Funding account for a card + # + # @param last_four [String] Last four digits of the card number. + # + # @param pin_status [Symbol, Lithic::Models::NonPCICard::PinStatus] Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect + # + # @param spend_limit [Integer] Amount (in cents) to limit approved authorizations (e.g. 100000 would be a $1,00 + # + # @param spend_limit_duration [Symbol, Lithic::Models::SpendLimitDuration] Spend limit duration values: + # + # @param state [Symbol, Lithic::Models::NonPCICard::State] Card state values: \* `CLOSED` - Card will no longer approve authorizations. + # Clos + # + # @param type [Symbol, Lithic::Models::NonPCICard::Type] Card types: \* `VIRTUAL` - Card will authorize at any merchant and can be added + # t + # + # @param auth_rule_tokens [Array] List of identifiers for the Auth Rule(s) that are applied on the card. This fiel + # + # @param bulk_order_token [String, nil] Globally unique identifier for the bulk order associated with this card. Only ap + # + # @param cardholder_currency [String] 3-character alphabetic ISO 4217 code for the currency of the cardholder. + # + # @param comment [String] Additional context or information related to the card. + # + # @param digital_card_art_token [String, nil] Specifies the digital card art to be displayed in the user's digital wallet afte + # + # @param exp_month [String] Two digit (MM) expiry month. + # + # @param exp_year [String] Four digit (yyyy) expiry year. + # + # @param hostname [String] Hostname of card's locked merchant (will be empty if not applicable). + # + # @param memo [String] Friendly name to identify the card. + # + # @param network_program_token [String, nil] Globally unique identifier for the card's network program. Null if the card is n + # + # @param pending_commands [Array] Indicates if there are offline PIN changes pending card interaction with an offl + # + # @param product_id [String, nil] Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic + # + # @param replacement_for [String, nil] If the card is a replacement for another card, the globally unique identifier fo + # + # @param substatus [Symbol, Lithic::Models::NonPCICard::Substatus, nil] Card state substatus values: \* `LOST` - The physical card is no longer in the + # ca + + # @see Lithic::Models::NonPCICard#funding + class Funding < Lithic::Internal::Type::BaseModel + # @!attribute token + # A globally unique identifier for this FundingAccount. + # + # @return [String] + required :token, String + + # @!attribute created + # An RFC 3339 string representing when this funding source was added to the Lithic + # account. This may be `null`. UTC time zone. + # + # @return [Time] + required :created, Time + + # @!attribute last_four + # The last 4 digits of the account (e.g. bank account, debit card) associated with + # this FundingAccount. This may be null. + # + # @return [String] + required :last_four, String + + # @!attribute state + # State of funding source. Funding source states: _ `ENABLED` - The funding + # account is available to use for card creation and transactions. _ `PENDING` - + # The funding account is still being verified e.g. bank micro-deposits + # verification. \* `DELETED` - The founding account has been deleted. + # + # @return [Symbol, Lithic::Models::NonPCICard::Funding::State] + required :state, enum: -> { Lithic::NonPCICard::Funding::State } + + # @!attribute type + # Types of funding source: _ `DEPOSITORY_CHECKING` - Bank checking account. _ + # `DEPOSITORY_SAVINGS` - Bank savings account. + # + # @return [Symbol, Lithic::Models::NonPCICard::Funding::Type] + required :type, enum: -> { Lithic::NonPCICard::Funding::Type } + + # @!attribute account_name + # Account name identifying the funding source. This may be `null`. + # + # @return [String, nil] + optional :account_name, String + + # @!attribute nickname + # The nickname given to the `FundingAccount` or `null` if it has no nickname. + # + # @return [String, nil] + optional :nickname, String, nil?: true + + # @!method initialize(token:, created:, last_four:, state:, type:, account_name: nil, nickname: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::NonPCICard::Funding} for more details. + # + # Funding account for a card + # + # @param token [String] A globally unique identifier for this FundingAccount. + # + # @param created [Time] An RFC 3339 string representing when this funding source was added to the Lithic + # + # @param last_four [String] The last 4 digits of the account (e.g. bank account, debit card) associated with + # + # @param state [Symbol, Lithic::Models::NonPCICard::Funding::State] State of funding source. Funding source states: \* `ENABLED` - The funding + # accoun + # + # @param type [Symbol, Lithic::Models::NonPCICard::Funding::Type] Types of funding source: _ `DEPOSITORY_CHECKING` - Bank checking account. _ `DEP + # + # @param account_name [String] Account name identifying the funding source. This may be `null`. + # + # @param nickname [String, nil] The nickname given to the `FundingAccount` or `null` if it has no nickname. + + # State of funding source. Funding source states: _ `ENABLED` - The funding + # account is available to use for card creation and transactions. _ `PENDING` - + # The funding account is still being verified e.g. bank micro-deposits + # verification. \* `DELETED` - The founding account has been deleted. + # + # @see Lithic::Models::NonPCICard::Funding#state + module State + extend Lithic::Internal::Type::Enum + + DELETED = :DELETED + ENABLED = :ENABLED + PENDING = :PENDING + + # @!method self.values + # @return [Array] + end + + # Types of funding source: _ `DEPOSITORY_CHECKING` - Bank checking account. _ + # `DEPOSITORY_SAVINGS` - Bank savings account. + # + # @see Lithic::Models::NonPCICard::Funding#type + module Type + extend Lithic::Internal::Type::Enum + + DEPOSITORY_CHECKING = :DEPOSITORY_CHECKING + DEPOSITORY_SAVINGS = :DEPOSITORY_SAVINGS + + # @!method self.values + # @return [Array] + end + end + + # Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect + # attempts). + # + # @see Lithic::Models::NonPCICard#pin_status + module PinStatus + extend Lithic::Internal::Type::Enum + + OK = :OK + BLOCKED = :BLOCKED + NOT_SET = :NOT_SET + + # @!method self.values + # @return [Array] + end + + # Card state values: _ `CLOSED` - Card will no longer approve authorizations. + # Closing a card cannot be undone. _ `OPEN` - Card will approve authorizations (if + # they match card and account parameters). _ `PAUSED` - Card will decline + # authorizations, but can be resumed at a later time. _ `PENDING_FULFILLMENT` - + # The initial state for cards of type `PHYSICAL`. The card is provisioned pending + # manufacturing and fulfillment. Cards in this state can accept authorizations for + # e-commerce purchases, but not for "Card Present" purchases where the physical + # card itself is present. \* `PENDING_ACTIVATION` - At regular intervals, cards of + # type `PHYSICAL` in state `PENDING_FULFILLMENT` are sent to the card production + # warehouse and updated to state `PENDING_ACTIVATION`. Similar to + # `PENDING_FULFILLMENT`, cards in this state can be used for e-commerce + # transactions or can be added to mobile wallets. API clients should update the + # card's state to `OPEN` only after the cardholder confirms receipt of the card. + # In sandbox, the same daily batch fulfillment occurs, but no cards are actually + # manufactured. + # + # @see Lithic::Models::NonPCICard#state + module State + extend Lithic::Internal::Type::Enum + + CLOSED = :CLOSED + OPEN = :OPEN + PAUSED = :PAUSED + PENDING_ACTIVATION = :PENDING_ACTIVATION + PENDING_FULFILLMENT = :PENDING_FULFILLMENT + + # @!method self.values + # @return [Array] + end + + # Card types: _ `VIRTUAL` - Card will authorize at any merchant and can be added + # to a digital wallet like Apple Pay or Google Pay (if the card program is digital + # wallet-enabled). _ `PHYSICAL` - Manufactured and sent to the cardholder. We + # offer white label branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe + # functionality. _ `SINGLE_USE` - Card is closed upon first successful + # authorization. _ `MERCHANT_LOCKED` - Card is locked to the first merchant that + # successfully authorizes the card. _ `UNLOCKED` - _[Deprecated]_ Similar behavior + # to VIRTUAL cards, please use VIRTUAL instead. _ `DIGITAL_WALLET` - + # _[Deprecated]_ Similar behavior to VIRTUAL cards, please use VIRTUAL instead. + # + # @see Lithic::Models::NonPCICard#type + module Type + extend Lithic::Internal::Type::Enum + + MERCHANT_LOCKED = :MERCHANT_LOCKED + PHYSICAL = :PHYSICAL + SINGLE_USE = :SINGLE_USE + VIRTUAL = :VIRTUAL + UNLOCKED = :UNLOCKED + DIGITAL_WALLET = :DIGITAL_WALLET + + # @!method self.values + # @return [Array] + end + + # Card state substatus values: _ `LOST` - The physical card is no longer in the + # cardholder's possession due to being lost or never received by the cardholder. _ + # `COMPROMISED` - Card information has been exposed, potentially leading to + # unauthorized access. This may involve physical card theft, cloning, or online + # data breaches. _ `DAMAGED` - The physical card is not functioning properly, such + # as having chip failures or a demagnetized magnetic stripe. _ + # `END_USER_REQUEST` - The cardholder requested the closure of the card for + # reasons unrelated to fraud or damage, such as switching to a different product + # or closing the account. _ `ISSUER_REQUEST` - The issuer closed the card for + # reasons unrelated to fraud or damage, such as account inactivity, product or + # policy changes, or technology upgrades. _ `NOT_ACTIVE` - The card hasn’t had any + # transaction activity for a specified period, applicable to statuses like + # `PAUSED` or `CLOSED`. _ `SUSPICIOUS_ACTIVITY` - The card has one or more + # suspicious transactions or activities that require review. This can involve + # prompting the cardholder to confirm legitimate use or report confirmed fraud. _ + # `INTERNAL_REVIEW` - The card is temporarily paused pending further internal + # review. _ `EXPIRED` - The card has expired and has been closed without being + # reissued. _ `UNDELIVERABLE` - The card cannot be delivered to the cardholder and + # has been returned. \* `OTHER` - The reason for the status does not fall into any + # of the above categories. A comment can be provided to specify the reason. + # + # @see Lithic::Models::NonPCICard#substatus + module Substatus + extend Lithic::Internal::Type::Enum + + LOST = :LOST + COMPROMISED = :COMPROMISED + DAMAGED = :DAMAGED + END_USER_REQUEST = :END_USER_REQUEST + ISSUER_REQUEST = :ISSUER_REQUEST + NOT_ACTIVE = :NOT_ACTIVE + SUSPICIOUS_ACTIVITY = :SUSPICIOUS_ACTIVITY + INTERNAL_REVIEW = :INTERNAL_REVIEW + EXPIRED = :EXPIRED + UNDELIVERABLE = :UNDELIVERABLE + OTHER = :OTHER + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/owner_type.rb b/lib/lithic/models/owner_type.rb new file mode 100644 index 00000000..15c5fea4 --- /dev/null +++ b/lib/lithic/models/owner_type.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Lithic + module Models + module OwnerType + extend Lithic::Internal::Type::Enum + + INDIVIDUAL = :INDIVIDUAL + BUSINESS = :BUSINESS + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/lithic/models/parsed_webhook_event.rb b/lib/lithic/models/parsed_webhook_event.rb new file mode 100644 index 00000000..ca1e2301 --- /dev/null +++ b/lib/lithic/models/parsed_webhook_event.rb @@ -0,0 +1,822 @@ +# frozen_string_literal: true + +module Lithic + module Models + # KYB payload for an updated account holder. + module ParsedWebhookEvent + extend Lithic::Internal::Type::Union + + variant -> { Lithic::AccountHolderCreatedWebhookEvent } + + # KYB payload for an updated account holder. + variant -> { Lithic::ParsedWebhookEvent::KYBPayload } + + # KYC payload for an updated account holder. + variant -> { Lithic::ParsedWebhookEvent::KYCPayload } + + # Legacy payload for an updated account holder. + variant -> { Lithic::ParsedWebhookEvent::LegacyPayload } + + variant -> { Lithic::AccountHolderVerificationWebhookEvent } + + variant -> { Lithic::AccountHolderDocumentUpdatedWebhookEvent } + + # The Auth Stream Access request payload that was sent to the ASA responder. + variant -> { Lithic::CardAuthorizationApprovalRequestWebhookEvent } + + variant -> { Lithic::CardAuthorizationChallengeWebhookEvent } + + variant -> { Lithic::CardAuthorizationChallengeResponseWebhookEvent } + + variant -> { Lithic::AuthRulesBacktestReportCreatedWebhookEvent } + + variant -> { Lithic::BalanceUpdatedWebhookEvent } + + # Book transfer transaction + variant -> { Lithic::BookTransferTransactionCreatedWebhookEvent } + + # Book transfer transaction + variant -> { Lithic::BookTransferTransactionUpdatedWebhookEvent } + + variant -> { Lithic::CardCreatedWebhookEvent } + + variant -> { Lithic::CardConvertedWebhookEvent } + + variant -> { Lithic::CardRenewedWebhookEvent } + + variant -> { Lithic::CardReissuedWebhookEvent } + + variant -> { Lithic::CardShippedWebhookEvent } + + variant -> { Lithic::CardUpdatedWebhookEvent } + + variant -> { Lithic::CardTransactionUpdatedWebhookEvent } + + variant -> { Lithic::CardTransactionEnhancedDataCreatedWebhookEvent } + + variant -> { Lithic::CardTransactionEnhancedDataUpdatedWebhookEvent } + + # Payload for digital wallet tokenization approval requests. Used for both the decisioning responder request (sent to the customer's endpoint for a real-time decision) and the subsequent webhook event (sent after the decision is made). Fields like customer_tokenization_decision, tokenization_decline_reasons, tokenization_tfa_reasons, and rule_results are only populated in the webhook event, not in the initial decisioning request. + variant -> { Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent } + + variant -> { Lithic::DigitalWalletTokenizationResultWebhookEvent } + + variant -> { Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent } + + variant -> { Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent } + + variant -> { Lithic::DigitalWalletTokenizationUpdatedWebhookEvent } + + # Dispute. + variant -> { Lithic::DisputeUpdatedWebhookEvent } + + # Dispute evidence. + variant -> { Lithic::DisputeEvidenceUploadFailedWebhookEvent } + + variant -> { Lithic::ExternalBankAccountCreatedWebhookEvent } + + variant -> { Lithic::ExternalBankAccountUpdatedWebhookEvent } + + variant -> { Lithic::ExternalPaymentCreatedWebhookEvent } + + variant -> { Lithic::ExternalPaymentUpdatedWebhookEvent } + + variant -> { Lithic::FinancialAccountCreatedWebhookEvent } + + variant -> { Lithic::FinancialAccountUpdatedWebhookEvent } + + variant -> { Lithic::FundingEventCreatedWebhookEvent } + + variant -> { Lithic::LoanTapeCreatedWebhookEvent } + + variant -> { Lithic::LoanTapeUpdatedWebhookEvent } + + variant -> { Lithic::ManagementOperationCreatedWebhookEvent } + + variant -> { Lithic::ManagementOperationUpdatedWebhookEvent } + + variant -> { Lithic::InternalTransactionCreatedWebhookEvent } + + variant -> { Lithic::InternalTransactionUpdatedWebhookEvent } + + variant -> { Lithic::NetworkTotalCreatedWebhookEvent } + + variant -> { Lithic::NetworkTotalUpdatedWebhookEvent } + + # Payment transaction + variant -> { Lithic::PaymentTransactionCreatedWebhookEvent } + + # Payment transaction + variant -> { Lithic::PaymentTransactionUpdatedWebhookEvent } + + variant -> { Lithic::SettlementReportUpdatedWebhookEvent } + + variant -> { Lithic::StatementsCreatedWebhookEvent } + + # Represents a 3DS authentication + variant -> { Lithic::ThreeDSAuthenticationCreatedWebhookEvent } + + # Represents a 3DS authentication + variant -> { Lithic::ThreeDSAuthenticationUpdatedWebhookEvent } + + variant -> { Lithic::ThreeDSAuthenticationChallengeWebhookEvent } + + variant -> { Lithic::TokenizationApprovalRequestWebhookEvent } + + variant -> { Lithic::TokenizationResultWebhookEvent } + + variant -> { Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent } + + variant -> { Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent } + + variant -> { Lithic::TokenizationUpdatedWebhookEvent } + + # Represents a 3DS authentication + variant -> { Lithic::ThreeDSAuthenticationApprovalRequestWebhookEvent } + + # The Dispute object tracks the progression of a dispute throughout its lifecycle. + variant -> { Lithic::DisputeTransactionCreatedWebhookEvent } + + # The Dispute object tracks the progression of a dispute throughout its lifecycle. + variant -> { Lithic::DisputeTransactionUpdatedWebhookEvent } + + class KYBPayload < Lithic::Internal::Type::BaseModel + # @!attribute token + # The token of the account_holder that was created. + # + # @return [String] + required :token, String + + # @!attribute update_request + # Original request to update the account holder. + # + # @return [Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest] + required :update_request, -> { Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest } + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, Lithic::Models::ParsedWebhookEvent::KYBPayload::EventType, nil] + optional :event_type, enum: -> { Lithic::ParsedWebhookEvent::KYBPayload::EventType } + + # @!attribute external_id + # A user provided id that can be used to link an account holder with an external + # system + # + # @return [String, nil] + optional :external_id, String + + # @!attribute naics_code + # 6-digit North American Industry Classification System (NAICS) code for the + # business. Only present if naics_code was included in the update request. + # + # @return [String, nil] + optional :naics_code, String + + # @!attribute nature_of_business + # Short description of the company's line of business (i.e., what does the company + # do?). Values longer than 255 characters will be truncated before KYB + # verification + # + # @return [String, nil] + optional :nature_of_business, String + + # @!attribute website_url + # Company website URL. + # + # @return [String, nil] + optional :website_url, String + + # @!method initialize(token:, update_request:, event_type: nil, external_id: nil, naics_code: nil, nature_of_business: nil, website_url: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ParsedWebhookEvent::KYBPayload} for more details. + # + # KYB payload for an updated account holder. + # + # @param token [String] The token of the account_holder that was created. + # + # @param update_request [Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest] Original request to update the account holder. + # + # @param event_type [Symbol, Lithic::Models::ParsedWebhookEvent::KYBPayload::EventType] The type of event that occurred. + # + # @param external_id [String] A user provided id that can be used to link an account holder with an external s + # + # @param naics_code [String] 6-digit North American Industry Classification System (NAICS) code for the busin + # + # @param nature_of_business [String] Short description of the company's line of business (i.e., what does the company + # + # @param website_url [String] Company website URL. + + # @see Lithic::Models::ParsedWebhookEvent::KYBPayload#update_request + class UpdateRequest < Lithic::Internal::Type::BaseModel + # @!attribute beneficial_owner_individuals + # You must submit a list of all direct and indirect individuals with 25% or more + # ownership in the company. A maximum of 4 beneficial owners can be submitted. If + # no individual owns 25% of the company you do not need to send beneficial owner + # information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + # + # @return [Array, nil] + optional :beneficial_owner_individuals, + -> { Lithic::Internal::Type::ArrayOf[Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual] } + + # @!attribute business_entity + # Information for business for which the account is being opened and KYB is being + # run. + # + # @return [Lithic::Models::KYBBusinessEntity, nil] + optional :business_entity, -> { Lithic::KYBBusinessEntity } + + # @!attribute control_person + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + # + # @return [Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson, nil] + optional :control_person, -> { Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson } + + # @!method initialize(beneficial_owner_individuals: nil, business_entity: nil, control_person: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest} for more + # details. + # + # Original request to update the account holder. + # + # @param beneficial_owner_individuals [Array] You must submit a list of all direct and indirect individuals with 25% or more o + # + # @param business_entity [Lithic::Models::KYBBusinessEntity] Information for business for which the account is being opened and KYB is being + # + # @param control_person [Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson] An individual with significant responsibility for managing the legal entity (e.g + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address, nil] + optional :address, + -> { Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!method initialize(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual} + # for more details. + # + # @param address [Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address] Individual's current address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. If utilizing Lithic for chargeback processing, this + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + + # @see Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual#address + class Address < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!method initialize(address1:, city:, country:, postal_code:, state:, address2: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address} + # for more details. + # + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @param address1 [String] Valid deliverable address (no PO boxes). + # + # @param city [String] Name of city. + # + # @param country [String] Valid country code. Only USA is currently supported, entered in uppercase ISO 31 + # + # @param postal_code [String] Valid postal code. Only USA ZIP codes are currently supported, entered as a five + # + # @param state [String] Valid state code. Only USA state codes are currently supported, entered in upper + # + # @param address2 [String] Unit or apartment number (if applicable). + end + end + + # @see Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest#control_person + class ControlPerson < Lithic::Internal::Type::BaseModel + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address, nil] + optional :address, -> { Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!method initialize(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson} + # for more details. + # + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + # + # @param address [Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address] Individual's current address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. If utilizing Lithic for chargeback processing, this + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + + # @see Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson#address + class Address < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!method initialize(address1:, city:, country:, postal_code:, state:, address2: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address} + # for more details. + # + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @param address1 [String] Valid deliverable address (no PO boxes). + # + # @param city [String] Name of city. + # + # @param country [String] Valid country code. Only USA is currently supported, entered in uppercase ISO 31 + # + # @param postal_code [String] Valid postal code. Only USA ZIP codes are currently supported, entered as a five + # + # @param state [String] Valid state code. Only USA state codes are currently supported, entered in upper + # + # @param address2 [String] Unit or apartment number (if applicable). + end + end + end + + # The type of event that occurred. + # + # @see Lithic::Models::ParsedWebhookEvent::KYBPayload#event_type + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_UPDATED = :"account_holder.updated" + + # @!method self.values + # @return [Array] + end + end + + class KYCPayload < Lithic::Internal::Type::BaseModel + # @!attribute token + # The token of the account_holder that was created. + # + # @return [String] + required :token, String + + # @!attribute update_request + # Original request to update the account holder. + # + # @return [Lithic::Models::ParsedWebhookEvent::KYCPayload::UpdateRequest] + required :update_request, -> { Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest } + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, Lithic::Models::ParsedWebhookEvent::KYCPayload::EventType, nil] + optional :event_type, enum: -> { Lithic::ParsedWebhookEvent::KYCPayload::EventType } + + # @!attribute external_id + # A user provided id that can be used to link an account holder with an external + # system + # + # @return [String, nil] + optional :external_id, String + + # @!method initialize(token:, update_request:, event_type: nil, external_id: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ParsedWebhookEvent::KYCPayload} for more details. + # + # KYC payload for an updated account holder. + # + # @param token [String] The token of the account_holder that was created. + # + # @param update_request [Lithic::Models::ParsedWebhookEvent::KYCPayload::UpdateRequest] Original request to update the account holder. + # + # @param event_type [Symbol, Lithic::Models::ParsedWebhookEvent::KYCPayload::EventType] The type of event that occurred. + # + # @param external_id [String] A user provided id that can be used to link an account holder with an external s + + # @see Lithic::Models::ParsedWebhookEvent::KYCPayload#update_request + class UpdateRequest < Lithic::Internal::Type::BaseModel + # @!attribute individual + # Information on the individual for whom the account is being opened and KYC is + # being run. + # + # @return [Lithic::Models::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual, nil] + optional :individual, -> { Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual } + + # @!method initialize(individual: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ParsedWebhookEvent::KYCPayload::UpdateRequest} for more + # details. + # + # Original request to update the account holder. + # + # @param individual [Lithic::Models::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual] Information on the individual for whom the account is being opened and KYC is be + + # @see Lithic::Models::ParsedWebhookEvent::KYCPayload::UpdateRequest#individual + class Individual < Lithic::Internal::Type::BaseModel + # @!attribute address + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @return [Lithic::Models::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address, nil] + optional :address, -> { Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address } + + # @!attribute dob + # Individual's date of birth, as an RFC 3339 date. + # + # @return [String, nil] + optional :dob, String + + # @!attribute email + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + # + # @return [String, nil] + optional :email, String + + # @!attribute first_name + # Individual's first name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # Individual's last name, as it appears on government-issued identity documents. + # + # @return [String, nil] + optional :last_name, String + + # @!attribute phone_number + # Individual's phone number, entered in E.164 format. + # + # @return [String, nil] + optional :phone_number, String + + # @!method initialize(address: nil, dob: nil, email: nil, first_name: nil, last_name: nil, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual} for + # more details. + # + # Information on the individual for whom the account is being opened and KYC is + # being run. + # + # @param address [Lithic::Models::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address] Individual's current address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. If utilizing Lithic for chargeback processing, this + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + + # @see Lithic::Models::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual#address + class Address < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # Valid deliverable address (no PO boxes). + # + # @return [String] + required :address1, String + + # @!attribute city + # Name of city. + # + # @return [String] + required :city, String + + # @!attribute country + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + # + # @return [String] + required :country, String + + # @!attribute postal_code + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + # + # @return [String] + required :state, String + + # @!attribute address2 + # Unit or apartment number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!method initialize(address1:, city:, country:, postal_code:, state:, address2: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address} + # for more details. + # + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + # + # @param address1 [String] Valid deliverable address (no PO boxes). + # + # @param city [String] Name of city. + # + # @param country [String] Valid country code. Only USA is currently supported, entered in uppercase ISO 31 + # + # @param postal_code [String] Valid postal code. Only USA ZIP codes are currently supported, entered as a five + # + # @param state [String] Valid state code. Only USA state codes are currently supported, entered in upper + # + # @param address2 [String] Unit or apartment number (if applicable). + end + end + end + + # The type of event that occurred. + # + # @see Lithic::Models::ParsedWebhookEvent::KYCPayload#event_type + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_UPDATED = :"account_holder.updated" + + # @!method self.values + # @return [Array] + end + end + + class LegacyPayload < Lithic::Internal::Type::BaseModel + # @!attribute token + # The token of the account_holder that was created. + # + # @return [String] + required :token, String + + # @!attribute business_account_token + # If applicable, represents the business account token associated with the + # account_holder. + # + # @return [String, nil] + optional :business_account_token, String, nil?: true + + # @!attribute created + # When the account_holder updated event was created + # + # @return [Time, nil] + optional :created, Time + + # @!attribute email + # If updated, the newly updated email associated with the account_holder otherwise + # the existing email is provided. + # + # @return [String, nil] + optional :email, String + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, Lithic::Models::ParsedWebhookEvent::LegacyPayload::EventType, nil] + optional :event_type, enum: -> { Lithic::ParsedWebhookEvent::LegacyPayload::EventType } + + # @!attribute external_id + # If applicable, represents the external_id associated with the account_holder. + # + # @return [String, nil] + optional :external_id, String, nil?: true + + # @!attribute first_name + # If applicable, represents the account_holder's first name. + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # If applicable, represents the account_holder's last name. + # + # @return [String, nil] + optional :last_name, String + + # @!attribute legal_business_name + # If applicable, represents the account_holder's business name. + # + # @return [String, nil] + optional :legal_business_name, String + + # @!attribute phone_number + # If updated, the newly updated phone_number associated with the account_holder + # otherwise the existing phone_number is provided. + # + # @return [String, nil] + optional :phone_number, String + + # @!method initialize(token:, business_account_token: nil, created: nil, email: nil, event_type: nil, external_id: nil, first_name: nil, last_name: nil, legal_business_name: nil, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ParsedWebhookEvent::LegacyPayload} for more details. + # + # Legacy payload for an updated account holder. + # + # @param token [String] The token of the account_holder that was created. + # + # @param business_account_token [String, nil] If applicable, represents the business account token associated with the account + # + # @param created [Time] When the account_holder updated event was created + # + # @param email [String] If updated, the newly updated email associated with the account_holder otherwise + # + # @param event_type [Symbol, Lithic::Models::ParsedWebhookEvent::LegacyPayload::EventType] The type of event that occurred. + # + # @param external_id [String, nil] If applicable, represents the external_id associated with the account_holder. + # + # @param first_name [String] If applicable, represents the account_holder's first name. + # + # @param last_name [String] If applicable, represents the account_holder's last name. + # + # @param legal_business_name [String] If applicable, represents the account_holder's business name. + # + # @param phone_number [String] If updated, the newly updated phone_number associated with the account_holder ot + + # The type of event that occurred. + # + # @see Lithic::Models::ParsedWebhookEvent::LegacyPayload#event_type + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_UPDATED = :"account_holder.updated" + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(Lithic::Models::AccountHolderCreatedWebhookEvent, Lithic::Models::ParsedWebhookEvent::KYBPayload, Lithic::Models::ParsedWebhookEvent::KYCPayload, Lithic::Models::ParsedWebhookEvent::LegacyPayload, Lithic::Models::AccountHolderVerificationWebhookEvent, Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent, Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent, Lithic::Models::CardAuthorizationChallengeWebhookEvent, Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent, Lithic::Models::AuthRulesBacktestReportCreatedWebhookEvent, Lithic::Models::BalanceUpdatedWebhookEvent, Lithic::Models::BookTransferTransactionCreatedWebhookEvent, Lithic::Models::BookTransferTransactionUpdatedWebhookEvent, Lithic::Models::CardCreatedWebhookEvent, Lithic::Models::CardConvertedWebhookEvent, Lithic::Models::CardRenewedWebhookEvent, Lithic::Models::CardReissuedWebhookEvent, Lithic::Models::CardShippedWebhookEvent, Lithic::Models::CardUpdatedWebhookEvent, Lithic::Models::CardTransactionUpdatedWebhookEvent, Lithic::Models::CardTransactionEnhancedDataCreatedWebhookEvent, Lithic::Models::CardTransactionEnhancedDataUpdatedWebhookEvent, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent, Lithic::Models::DigitalWalletTokenizationResultWebhookEvent, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent, Lithic::Models::DigitalWalletTokenizationUpdatedWebhookEvent, Lithic::Models::DisputeUpdatedWebhookEvent, Lithic::Models::DisputeEvidenceUploadFailedWebhookEvent, Lithic::Models::ExternalBankAccountCreatedWebhookEvent, Lithic::Models::ExternalBankAccountUpdatedWebhookEvent, Lithic::Models::ExternalPaymentCreatedWebhookEvent, Lithic::Models::ExternalPaymentUpdatedWebhookEvent, Lithic::Models::FinancialAccountCreatedWebhookEvent, Lithic::Models::FinancialAccountUpdatedWebhookEvent, Lithic::Models::FundingEventCreatedWebhookEvent, Lithic::Models::LoanTapeCreatedWebhookEvent, Lithic::Models::LoanTapeUpdatedWebhookEvent, Lithic::Models::ManagementOperationCreatedWebhookEvent, Lithic::Models::ManagementOperationUpdatedWebhookEvent, Lithic::Models::InternalTransactionCreatedWebhookEvent, Lithic::Models::InternalTransactionUpdatedWebhookEvent, Lithic::Models::NetworkTotalCreatedWebhookEvent, Lithic::Models::NetworkTotalUpdatedWebhookEvent, Lithic::Models::PaymentTransactionCreatedWebhookEvent, Lithic::Models::PaymentTransactionUpdatedWebhookEvent, Lithic::Models::SettlementReportUpdatedWebhookEvent, Lithic::Models::StatementsCreatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationCreatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationUpdatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent, Lithic::Models::TokenizationApprovalRequestWebhookEvent, Lithic::Models::TokenizationResultWebhookEvent, Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent, Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent, Lithic::Models::TokenizationUpdatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationApprovalRequestWebhookEvent, Lithic::Models::DisputeTransactionCreatedWebhookEvent, Lithic::Models::DisputeTransactionUpdatedWebhookEvent)] + end + end +end diff --git a/lib/lithic/models/payment.rb b/lib/lithic/models/payment.rb new file mode 100644 index 00000000..24809660 --- /dev/null +++ b/lib/lithic/models/payment.rb @@ -0,0 +1,757 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Payments#retrieve + class Payment < Lithic::Internal::Type::BaseModel + # @!attribute token + # Unique identifier for the transaction + # + # @return [String] + required :token, String + + # @!attribute category + # Transaction category + # + # @return [Symbol, Lithic::Models::Payment::Category] + required :category, enum: -> { Lithic::Payment::Category } + + # @!attribute created + # ISO 8601 timestamp of when the transaction was created + # + # @return [Time] + required :created, Time + + # @!attribute descriptor + # Transaction descriptor + # + # @return [String] + required :descriptor, String + + # @!attribute direction + # Transfer direction + # + # @return [Symbol, Lithic::Models::Payment::Direction] + required :direction, enum: -> { Lithic::Payment::Direction } + + # @!attribute events + # List of transaction events + # + # @return [Array] + required :events, -> { Lithic::Internal::Type::ArrayOf[Lithic::Payment::Event] } + + # @!attribute family + # PAYMENT - Payment Transaction + # + # @return [Symbol, :PAYMENT] + required :family, const: :PAYMENT + + # @!attribute financial_account_token + # Financial account token + # + # @return [String] + required :financial_account_token, String + + # @!attribute method_ + # Transfer method + # + # @return [Symbol, Lithic::Models::Payment::Method] + required :method_, enum: -> { Lithic::Payment::Method }, api_name: :method + + # @!attribute method_attributes + # Method-specific attributes + # + # @return [Lithic::Models::Payment::MethodAttributes::ACHMethodAttributes, Lithic::Models::Payment::MethodAttributes::WireMethodAttributes] + required :method_attributes, union: -> { Lithic::Payment::MethodAttributes } + + # @!attribute pending_amount + # Pending amount in cents + # + # @return [Integer] + required :pending_amount, Integer + + # @!attribute related_account_tokens + # Account tokens related to a payment transaction + # + # @return [Lithic::Models::Payment::RelatedAccountTokens, nil] + required :related_account_tokens, -> { Lithic::Payment::RelatedAccountTokens }, nil?: true + + # @!attribute result + # Transaction result + # + # @return [Symbol, Lithic::Models::Payment::Result] + required :result, enum: -> { Lithic::Payment::Result } + + # @!attribute settled_amount + # Settled amount in cents + # + # @return [Integer] + required :settled_amount, Integer + + # @!attribute source + # Transaction source + # + # @return [Symbol, Lithic::Models::Payment::Source] + required :source, enum: -> { Lithic::Payment::Source } + + # @!attribute status + # The status of the transaction + # + # @return [Symbol, Lithic::Models::Payment::Status] + required :status, enum: -> { Lithic::Payment::Status } + + # @!attribute updated + # ISO 8601 timestamp of when the transaction was last updated + # + # @return [Time] + required :updated, Time + + # @!attribute currency + # Currency of the transaction in ISO 4217 format + # + # @return [String, nil] + optional :currency, String + + # @!attribute expected_release_date + # Expected release date for the transaction + # + # @return [Date, nil] + optional :expected_release_date, Date, nil?: true + + # @!attribute external_bank_account_token + # External bank account token + # + # @return [String, nil] + optional :external_bank_account_token, String, nil?: true + + # @!attribute tags + # Key-value pairs for tagging resources. Tags allow you to associate arbitrary + # metadata with a resource for your own purposes. + # + # @return [Hash{Symbol=>String}, nil] + optional :tags, Lithic::Internal::Type::HashOf[String] + + # @!attribute type + # + # @return [Symbol, Lithic::Models::Payment::Type, nil] + optional :type, enum: -> { Lithic::Payment::Type } + + # @!attribute user_defined_id + # User-defined identifier + # + # @return [String, nil] + optional :user_defined_id, String, nil?: true + + # @!method initialize(token:, category:, created:, descriptor:, direction:, events:, financial_account_token:, method_:, method_attributes:, pending_amount:, related_account_tokens:, result:, settled_amount:, source:, status:, updated:, currency: nil, expected_release_date: nil, external_bank_account_token: nil, tags: nil, type: nil, user_defined_id: nil, family: :PAYMENT) + # Some parameter documentations has been truncated, see {Lithic::Models::Payment} + # for more details. + # + # Payment transaction + # + # @param token [String] Unique identifier for the transaction + # + # @param category [Symbol, Lithic::Models::Payment::Category] Transaction category + # + # @param created [Time] ISO 8601 timestamp of when the transaction was created + # + # @param descriptor [String] Transaction descriptor + # + # @param direction [Symbol, Lithic::Models::Payment::Direction] Transfer direction + # + # @param events [Array] List of transaction events + # + # @param financial_account_token [String] Financial account token + # + # @param method_ [Symbol, Lithic::Models::Payment::Method] Transfer method + # + # @param method_attributes [Lithic::Models::Payment::MethodAttributes::ACHMethodAttributes, Lithic::Models::Payment::MethodAttributes::WireMethodAttributes] Method-specific attributes + # + # @param pending_amount [Integer] Pending amount in cents + # + # @param related_account_tokens [Lithic::Models::Payment::RelatedAccountTokens, nil] Account tokens related to a payment transaction + # + # @param result [Symbol, Lithic::Models::Payment::Result] Transaction result + # + # @param settled_amount [Integer] Settled amount in cents + # + # @param source [Symbol, Lithic::Models::Payment::Source] Transaction source + # + # @param status [Symbol, Lithic::Models::Payment::Status] The status of the transaction + # + # @param updated [Time] ISO 8601 timestamp of when the transaction was last updated + # + # @param currency [String] Currency of the transaction in ISO 4217 format + # + # @param expected_release_date [Date, nil] Expected release date for the transaction + # + # @param external_bank_account_token [String, nil] External bank account token + # + # @param tags [Hash{Symbol=>String}] Key-value pairs for tagging resources. Tags allow you to associate arbitrary met + # + # @param type [Symbol, Lithic::Models::Payment::Type] + # + # @param user_defined_id [String, nil] User-defined identifier + # + # @param family [Symbol, :PAYMENT] PAYMENT - Payment Transaction + + # Transaction category + # + # @see Lithic::Models::Payment#category + module Category + extend Lithic::Internal::Type::Enum + + ACH = :ACH + WIRE = :WIRE + BALANCE_OR_FUNDING = :BALANCE_OR_FUNDING + FEE = :FEE + REWARD = :REWARD + ADJUSTMENT = :ADJUSTMENT + DERECOGNITION = :DERECOGNITION + DISPUTE = :DISPUTE + CARD = :CARD + EXTERNAL_ACH = :EXTERNAL_ACH + EXTERNAL_CHECK = :EXTERNAL_CHECK + EXTERNAL_FEDNOW = :EXTERNAL_FEDNOW + EXTERNAL_RTP = :EXTERNAL_RTP + EXTERNAL_TRANSFER = :EXTERNAL_TRANSFER + EXTERNAL_WIRE = :EXTERNAL_WIRE + MANAGEMENT_ADJUSTMENT = :MANAGEMENT_ADJUSTMENT + MANAGEMENT_DISPUTE = :MANAGEMENT_DISPUTE + MANAGEMENT_FEE = :MANAGEMENT_FEE + MANAGEMENT_REWARD = :MANAGEMENT_REWARD + MANAGEMENT_DISBURSEMENT = :MANAGEMENT_DISBURSEMENT + HOLD = :HOLD + PROGRAM_FUNDING = :PROGRAM_FUNDING + + # @!method self.values + # @return [Array] + end + + # Transfer direction + # + # @see Lithic::Models::Payment#direction + module Direction + extend Lithic::Internal::Type::Enum + + CREDIT = :CREDIT + DEBIT = :DEBIT + + # @!method self.values + # @return [Array] + end + + class Event < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier. + # + # @return [String] + required :token, String + + # @!attribute amount + # Amount of the financial event that has been settled in the currency's smallest + # unit (e.g., cents). + # + # @return [Integer] + required :amount, Integer + + # @!attribute created + # Date and time when the financial event occurred. UTC time zone. + # + # @return [Time] + required :created, Time + + # @!attribute result + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + # + # @return [Symbol, Lithic::Models::Payment::Event::Result] + required :result, enum: -> { Lithic::Payment::Event::Result } + + # @!attribute type + # Note: Inbound wire transfers are coming soon (availability varies by partner + # bank). Wire-related event types below are a preview. To learn more, contact your + # customer success manager. + # + # Event types: + # + # ACH events: + # + # - `ACH_ORIGINATION_INITIATED` - ACH origination received and pending + # approval/release from an ACH hold. + # - `ACH_ORIGINATION_REVIEWED` - ACH origination has completed the review process. + # - `ACH_ORIGINATION_CANCELLED` - ACH origination has been cancelled. + # - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed and sent to + # the Federal Reserve. + # - `ACH_ORIGINATION_SETTLED` - ACH origination has settled. + # - `ACH_ORIGINATION_RELEASED` - ACH origination released from pending to + # available balance. + # - `ACH_ORIGINATION_REJECTED` - ACH origination was rejected and not sent to the + # Federal Reserve. + # - `ACH_RECEIPT_PROCESSED` - ACH receipt pending release from an ACH holder. + # - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled. + # - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available + # balance. + # - `ACH_RECEIPT_RELEASED_EARLY` - ACH receipt released early from pending to + # available balance. + # - `ACH_RETURN_INITIATED` - ACH initiated return for an ACH receipt. + # - `ACH_RETURN_PROCESSED` - ACH receipt returned by the Receiving Depository + # Financial Institution. + # - `ACH_RETURN_SETTLED` - ACH return settled by the Receiving Depository + # Financial Institution. + # - `ACH_RETURN_REJECTED` - ACH return was rejected by the Receiving Depository + # Financial Institution. + # + # Wire transfer events: + # + # - `WIRE_TRANSFER_INBOUND_RECEIVED` - Inbound wire transfer received from the + # Federal Reserve and pending release to available balance. + # - `WIRE_TRANSFER_INBOUND_SETTLED` - Inbound wire transfer funds released from + # pending to available balance. + # - `WIRE_TRANSFER_INBOUND_BLOCKED` - Inbound wire transfer blocked and funds + # frozen for regulatory review. + # + # Wire return events: + # + # - `WIRE_RETURN_OUTBOUND_INITIATED` - Outbound wire return initiated to return + # funds from an inbound wire transfer. + # - `WIRE_RETURN_OUTBOUND_SENT` - Outbound wire return sent to the Federal Reserve + # and pending acceptance. + # - `WIRE_RETURN_OUTBOUND_SETTLED` - Outbound wire return accepted by the Federal + # Reserve and funds returned to sender. + # - `WIRE_RETURN_OUTBOUND_REJECTED` - Outbound wire return rejected by the Federal + # Reserve. + # + # @return [Symbol, Lithic::Models::Payment::Event::Type] + required :type, enum: -> { Lithic::Payment::Event::Type } + + # @!attribute detailed_results + # More detailed reasons for the event + # + # @return [Array, nil] + optional :detailed_results, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::Payment::Event::DetailedResult] } + + # @!attribute external_id + # Payment event external ID. For ACH transactions, this is the ACH trace number. + # For inbound wire transfers, this is the IMAD (Input Message Accountability + # Data). + # + # @return [String, nil] + optional :external_id, String, nil?: true + + # @!method initialize(token:, amount:, created:, result:, type:, detailed_results: nil, external_id: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Payment::Event} for more details. + # + # Note: Inbound wire transfers are coming soon (availability varies by partner + # bank). Wire-related fields below are a preview. To learn more, contact your + # customer success manager. + # + # Payment Event + # + # @param token [String] Globally unique identifier. + # + # @param amount [Integer] Amount of the financial event that has been settled in the currency's smallest u + # + # @param created [Time] Date and time when the financial event occurred. UTC time zone. + # + # @param result [Symbol, Lithic::Models::Payment::Event::Result] APPROVED financial events were successful while DECLINED financial events were d + # + # @param type [Symbol, Lithic::Models::Payment::Event::Type] Note: Inbound wire transfers are coming soon (availability varies by partner ban + # + # @param detailed_results [Array] More detailed reasons for the event + # + # @param external_id [String, nil] Payment event external ID. For ACH transactions, this is the ACH trace number. + + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + # + # @see Lithic::Models::Payment::Event#result + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + + # Note: Inbound wire transfers are coming soon (availability varies by partner + # bank). Wire-related event types below are a preview. To learn more, contact your + # customer success manager. + # + # Event types: + # + # ACH events: + # + # - `ACH_ORIGINATION_INITIATED` - ACH origination received and pending + # approval/release from an ACH hold. + # - `ACH_ORIGINATION_REVIEWED` - ACH origination has completed the review process. + # - `ACH_ORIGINATION_CANCELLED` - ACH origination has been cancelled. + # - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed and sent to + # the Federal Reserve. + # - `ACH_ORIGINATION_SETTLED` - ACH origination has settled. + # - `ACH_ORIGINATION_RELEASED` - ACH origination released from pending to + # available balance. + # - `ACH_ORIGINATION_REJECTED` - ACH origination was rejected and not sent to the + # Federal Reserve. + # - `ACH_RECEIPT_PROCESSED` - ACH receipt pending release from an ACH holder. + # - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled. + # - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available + # balance. + # - `ACH_RECEIPT_RELEASED_EARLY` - ACH receipt released early from pending to + # available balance. + # - `ACH_RETURN_INITIATED` - ACH initiated return for an ACH receipt. + # - `ACH_RETURN_PROCESSED` - ACH receipt returned by the Receiving Depository + # Financial Institution. + # - `ACH_RETURN_SETTLED` - ACH return settled by the Receiving Depository + # Financial Institution. + # - `ACH_RETURN_REJECTED` - ACH return was rejected by the Receiving Depository + # Financial Institution. + # + # Wire transfer events: + # + # - `WIRE_TRANSFER_INBOUND_RECEIVED` - Inbound wire transfer received from the + # Federal Reserve and pending release to available balance. + # - `WIRE_TRANSFER_INBOUND_SETTLED` - Inbound wire transfer funds released from + # pending to available balance. + # - `WIRE_TRANSFER_INBOUND_BLOCKED` - Inbound wire transfer blocked and funds + # frozen for regulatory review. + # + # Wire return events: + # + # - `WIRE_RETURN_OUTBOUND_INITIATED` - Outbound wire return initiated to return + # funds from an inbound wire transfer. + # - `WIRE_RETURN_OUTBOUND_SENT` - Outbound wire return sent to the Federal Reserve + # and pending acceptance. + # - `WIRE_RETURN_OUTBOUND_SETTLED` - Outbound wire return accepted by the Federal + # Reserve and funds returned to sender. + # - `WIRE_RETURN_OUTBOUND_REJECTED` - Outbound wire return rejected by the Federal + # Reserve. + # + # @see Lithic::Models::Payment::Event#type + module Type + extend Lithic::Internal::Type::Enum + + ACH_ORIGINATION_CANCELLED = :ACH_ORIGINATION_CANCELLED + ACH_ORIGINATION_INITIATED = :ACH_ORIGINATION_INITIATED + ACH_ORIGINATION_PROCESSED = :ACH_ORIGINATION_PROCESSED + ACH_ORIGINATION_REJECTED = :ACH_ORIGINATION_REJECTED + ACH_ORIGINATION_RELEASED = :ACH_ORIGINATION_RELEASED + ACH_ORIGINATION_REVIEWED = :ACH_ORIGINATION_REVIEWED + ACH_ORIGINATION_SETTLED = :ACH_ORIGINATION_SETTLED + ACH_RECEIPT_PROCESSED = :ACH_RECEIPT_PROCESSED + ACH_RECEIPT_RELEASED = :ACH_RECEIPT_RELEASED + ACH_RECEIPT_RELEASED_EARLY = :ACH_RECEIPT_RELEASED_EARLY + ACH_RECEIPT_SETTLED = :ACH_RECEIPT_SETTLED + ACH_RETURN_INITIATED = :ACH_RETURN_INITIATED + ACH_RETURN_PROCESSED = :ACH_RETURN_PROCESSED + ACH_RETURN_REJECTED = :ACH_RETURN_REJECTED + ACH_RETURN_SETTLED = :ACH_RETURN_SETTLED + WIRE_TRANSFER_INBOUND_RECEIVED = :WIRE_TRANSFER_INBOUND_RECEIVED + WIRE_TRANSFER_INBOUND_SETTLED = :WIRE_TRANSFER_INBOUND_SETTLED + WIRE_TRANSFER_INBOUND_BLOCKED = :WIRE_TRANSFER_INBOUND_BLOCKED + WIRE_RETURN_OUTBOUND_INITIATED = :WIRE_RETURN_OUTBOUND_INITIATED + WIRE_RETURN_OUTBOUND_SENT = :WIRE_RETURN_OUTBOUND_SENT + WIRE_RETURN_OUTBOUND_SETTLED = :WIRE_RETURN_OUTBOUND_SETTLED + WIRE_RETURN_OUTBOUND_REJECTED = :WIRE_RETURN_OUTBOUND_REJECTED + + # @!method self.values + # @return [Array] + end + + module DetailedResult + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + FUNDS_INSUFFICIENT = :FUNDS_INSUFFICIENT + ACCOUNT_INVALID = :ACCOUNT_INVALID + PROGRAM_TRANSACTION_LIMIT_EXCEEDED = :PROGRAM_TRANSACTION_LIMIT_EXCEEDED + PROGRAM_DAILY_LIMIT_EXCEEDED = :PROGRAM_DAILY_LIMIT_EXCEEDED + PROGRAM_MONTHLY_LIMIT_EXCEEDED = :PROGRAM_MONTHLY_LIMIT_EXCEEDED + + # @!method self.values + # @return [Array] + end + end + + # Transfer method + # + # @see Lithic::Models::Payment#method_ + module Method + extend Lithic::Internal::Type::Enum + + ACH_NEXT_DAY = :ACH_NEXT_DAY + ACH_SAME_DAY = :ACH_SAME_DAY + WIRE = :WIRE + + # @!method self.values + # @return [Array] + end + + # Method-specific attributes + # + # @see Lithic::Models::Payment#method_attributes + module MethodAttributes + extend Lithic::Internal::Type::Union + + variant -> { Lithic::Payment::MethodAttributes::ACHMethodAttributes } + + variant -> { Lithic::Payment::MethodAttributes::WireMethodAttributes } + + class ACHMethodAttributes < Lithic::Internal::Type::BaseModel + # @!attribute sec_code + # SEC code for ACH transaction + # + # @return [Symbol, Lithic::Models::Payment::MethodAttributes::ACHMethodAttributes::SecCode] + required :sec_code, enum: -> { Lithic::Payment::MethodAttributes::ACHMethodAttributes::SecCode } + + # @!attribute ach_hold_period + # Number of days the ACH transaction is on hold + # + # @return [Integer, nil] + optional :ach_hold_period, Integer, nil?: true + + # @!attribute addenda + # Addenda information + # + # @return [String, nil] + optional :addenda, String, nil?: true + + # @!attribute company_id + # Company ID for the ACH transaction + # + # @return [String, nil] + optional :company_id, String, nil?: true + + # @!attribute override_company_name + # Value to override the configured company name with. Can only be used if allowed + # to override + # + # @return [String, nil] + optional :override_company_name, String, nil?: true + + # @!attribute receipt_routing_number + # Receipt routing number + # + # @return [String, nil] + optional :receipt_routing_number, String, nil?: true + + # @!attribute retries + # Number of retries attempted + # + # @return [Integer, nil] + optional :retries, Integer, nil?: true + + # @!attribute return_reason_code + # Return reason code if the transaction was returned + # + # @return [String, nil] + optional :return_reason_code, String, nil?: true + + # @!attribute trace_numbers + # Trace numbers for the ACH transaction + # + # @return [Array, nil] + optional :trace_numbers, Lithic::Internal::Type::ArrayOf[String] + + # @!method initialize(sec_code:, ach_hold_period: nil, addenda: nil, company_id: nil, override_company_name: nil, receipt_routing_number: nil, retries: nil, return_reason_code: nil, trace_numbers: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Payment::MethodAttributes::ACHMethodAttributes} for more + # details. + # + # @param sec_code [Symbol, Lithic::Models::Payment::MethodAttributes::ACHMethodAttributes::SecCode] SEC code for ACH transaction + # + # @param ach_hold_period [Integer, nil] Number of days the ACH transaction is on hold + # + # @param addenda [String, nil] Addenda information + # + # @param company_id [String, nil] Company ID for the ACH transaction + # + # @param override_company_name [String, nil] Value to override the configured company name with. Can only be used if allowed + # + # @param receipt_routing_number [String, nil] Receipt routing number + # + # @param retries [Integer, nil] Number of retries attempted + # + # @param return_reason_code [String, nil] Return reason code if the transaction was returned + # + # @param trace_numbers [Array] Trace numbers for the ACH transaction + + # SEC code for ACH transaction + # + # @see Lithic::Models::Payment::MethodAttributes::ACHMethodAttributes#sec_code + module SecCode + extend Lithic::Internal::Type::Enum + + CCD = :CCD + PPD = :PPD + WEB = :WEB + TEL = :TEL + CIE = :CIE + CTX = :CTX + + # @!method self.values + # @return [Array] + end + end + + class WireMethodAttributes < Lithic::Internal::Type::BaseModel + # @!attribute wire_message_type + # Type of wire message + # + # @return [String, nil] + required :wire_message_type, String, nil?: true + + # @!attribute wire_network + # Type of wire transfer + # + # @return [Symbol, Lithic::Models::Payment::MethodAttributes::WireMethodAttributes::WireNetwork] + required :wire_network, enum: -> { Lithic::Payment::MethodAttributes::WireMethodAttributes::WireNetwork } + + # @!attribute creditor + # + # @return [Lithic::Models::WirePartyDetails, nil] + optional :creditor, -> { Lithic::WirePartyDetails } + + # @!attribute debtor + # + # @return [Lithic::Models::WirePartyDetails, nil] + optional :debtor, -> { Lithic::WirePartyDetails } + + # @!attribute message_id + # Point to point reference identifier, as assigned by the instructing party, used + # for tracking the message through the Fedwire system + # + # @return [String, nil] + optional :message_id, String, nil?: true + + # @!attribute remittance_information + # Payment details or invoice reference + # + # @return [String, nil] + optional :remittance_information, String, nil?: true + + # @!method initialize(wire_message_type:, wire_network:, creditor: nil, debtor: nil, message_id: nil, remittance_information: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Payment::MethodAttributes::WireMethodAttributes} for more + # details. + # + # @param wire_message_type [String, nil] Type of wire message + # + # @param wire_network [Symbol, Lithic::Models::Payment::MethodAttributes::WireMethodAttributes::WireNetwork] Type of wire transfer + # + # @param creditor [Lithic::Models::WirePartyDetails] + # + # @param debtor [Lithic::Models::WirePartyDetails] + # + # @param message_id [String, nil] Point to point reference identifier, as assigned by the instructing party, used + # + # @param remittance_information [String, nil] Payment details or invoice reference + + # Type of wire transfer + # + # @see Lithic::Models::Payment::MethodAttributes::WireMethodAttributes#wire_network + module WireNetwork + extend Lithic::Internal::Type::Enum + + FEDWIRE = :FEDWIRE + SWIFT = :SWIFT + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(Lithic::Models::Payment::MethodAttributes::ACHMethodAttributes, Lithic::Models::Payment::MethodAttributes::WireMethodAttributes)] + end + + # @see Lithic::Models::Payment#related_account_tokens + class RelatedAccountTokens < Lithic::Internal::Type::BaseModel + # @!attribute account_token + # Globally unique identifier for the account + # + # @return [String, nil] + required :account_token, String, nil?: true + + # @!attribute business_account_token + # Globally unique identifier for the business account + # + # @return [String, nil] + required :business_account_token, String, nil?: true + + # @!method initialize(account_token:, business_account_token:) + # Account tokens related to a payment transaction + # + # @param account_token [String, nil] Globally unique identifier for the account + # + # @param business_account_token [String, nil] Globally unique identifier for the business account + end + + # Transaction result + # + # @see Lithic::Models::Payment#result + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + + # Transaction source + # + # @see Lithic::Models::Payment#source + module Source + extend Lithic::Internal::Type::Enum + + LITHIC = :LITHIC + EXTERNAL = :EXTERNAL + CUSTOMER = :CUSTOMER + + # @!method self.values + # @return [Array] + end + + # The status of the transaction + # + # @see Lithic::Models::Payment#status + module Status + extend Lithic::Internal::Type::Enum + + PENDING = :PENDING + SETTLED = :SETTLED + DECLINED = :DECLINED + REVERSED = :REVERSED + CANCELED = :CANCELED + RETURNED = :RETURNED + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::Payment#type + module Type + extend Lithic::Internal::Type::Enum + + ORIGINATION_CREDIT = :ORIGINATION_CREDIT + ORIGINATION_DEBIT = :ORIGINATION_DEBIT + RECEIPT_CREDIT = :RECEIPT_CREDIT + RECEIPT_DEBIT = :RECEIPT_DEBIT + WIRE_INBOUND_PAYMENT = :WIRE_INBOUND_PAYMENT + WIRE_INBOUND_ADMIN = :WIRE_INBOUND_ADMIN + WIRE_OUTBOUND_PAYMENT = :WIRE_OUTBOUND_PAYMENT + WIRE_OUTBOUND_ADMIN = :WIRE_OUTBOUND_ADMIN + WIRE_INBOUND_DRAWDOWN_REQUEST = :WIRE_INBOUND_DRAWDOWN_REQUEST + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/payment_create_params.rb b/lib/lithic/models/payment_create_params.rb new file mode 100644 index 00000000..f777988f --- /dev/null +++ b/lib/lithic/models/payment_create_params.rb @@ -0,0 +1,172 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Payments#create + class PaymentCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute amount + # + # @return [Integer] + required :amount, Integer + + # @!attribute external_bank_account_token + # + # @return [String] + required :external_bank_account_token, String + + # @!attribute financial_account_token + # + # @return [String] + required :financial_account_token, String + + # @!attribute method_ + # + # @return [Symbol, Lithic::Models::PaymentCreateParams::Method] + required :method_, enum: -> { Lithic::PaymentCreateParams::Method }, api_name: :method + + # @!attribute method_attributes + # + # @return [Lithic::Models::PaymentCreateParams::MethodAttributes] + required :method_attributes, -> { Lithic::PaymentCreateParams::MethodAttributes } + + # @!attribute type + # + # @return [Symbol, Lithic::Models::PaymentCreateParams::Type] + required :type, enum: -> { Lithic::PaymentCreateParams::Type } + + # @!attribute token + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + # + # @return [String, nil] + optional :token, String + + # @!attribute hold + # Optional hold to settle when this payment is initiated. + # + # @return [Lithic::Models::PaymentCreateParams::Hold, nil] + optional :hold, -> { Lithic::PaymentCreateParams::Hold } + + # @!attribute memo + # + # @return [String, nil] + optional :memo, String + + # @!attribute user_defined_id + # + # @return [String, nil] + optional :user_defined_id, String + + # @!method initialize(amount:, external_bank_account_token:, financial_account_token:, method_:, method_attributes:, type:, token: nil, hold: nil, memo: nil, user_defined_id: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::PaymentCreateParams} for more details. + # + # @param amount [Integer] + # + # @param external_bank_account_token [String] + # + # @param financial_account_token [String] + # + # @param method_ [Symbol, Lithic::Models::PaymentCreateParams::Method] + # + # @param method_attributes [Lithic::Models::PaymentCreateParams::MethodAttributes] + # + # @param type [Symbol, Lithic::Models::PaymentCreateParams::Type] + # + # @param token [String] Customer-provided token that will serve as an idempotency token. This token will + # + # @param hold [Lithic::Models::PaymentCreateParams::Hold] Optional hold to settle when this payment is initiated. + # + # @param memo [String] + # + # @param user_defined_id [String] + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + module Method + extend Lithic::Internal::Type::Enum + + ACH_NEXT_DAY = :ACH_NEXT_DAY + ACH_SAME_DAY = :ACH_SAME_DAY + + # @!method self.values + # @return [Array] + end + + class MethodAttributes < Lithic::Internal::Type::BaseModel + # @!attribute sec_code + # + # @return [Symbol, Lithic::Models::PaymentCreateParams::MethodAttributes::SecCode] + required :sec_code, enum: -> { Lithic::PaymentCreateParams::MethodAttributes::SecCode } + + # @!attribute ach_hold_period + # Number of days to hold the ACH payment + # + # @return [Integer, nil] + optional :ach_hold_period, Integer + + # @!attribute addenda + # + # @return [String, nil] + optional :addenda, String, nil?: true + + # @!attribute override_company_name + # Value to override the configured company name with. Can only be used if allowed + # to override + # + # @return [String, nil] + optional :override_company_name, String, nil?: true + + # @!method initialize(sec_code:, ach_hold_period: nil, addenda: nil, override_company_name: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::PaymentCreateParams::MethodAttributes} for more details. + # + # @param sec_code [Symbol, Lithic::Models::PaymentCreateParams::MethodAttributes::SecCode] + # + # @param ach_hold_period [Integer] Number of days to hold the ACH payment + # + # @param addenda [String, nil] + # + # @param override_company_name [String, nil] Value to override the configured company name with. Can only be used if allowed + + # @see Lithic::Models::PaymentCreateParams::MethodAttributes#sec_code + module SecCode + extend Lithic::Internal::Type::Enum + + CCD = :CCD + PPD = :PPD + WEB = :WEB + + # @!method self.values + # @return [Array] + end + end + + module Type + extend Lithic::Internal::Type::Enum + + COLLECTION = :COLLECTION + PAYMENT = :PAYMENT + + # @!method self.values + # @return [Array] + end + + class Hold < Lithic::Internal::Type::BaseModel + # @!attribute token + # Token of the hold to settle when this payment is initiated. + # + # @return [String] + required :token, String + + # @!method initialize(token:) + # Optional hold to settle when this payment is initiated. + # + # @param token [String] Token of the hold to settle when this payment is initiated. + end + end + end +end diff --git a/lib/lithic/models/payment_create_response.rb b/lib/lithic/models/payment_create_response.rb new file mode 100644 index 00000000..ddb84aa7 --- /dev/null +++ b/lib/lithic/models/payment_create_response.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Payments#create + class PaymentCreateResponse < Lithic::Models::Payment + # @!attribute balance + # Balance + # + # @return [Lithic::Models::Balance, nil] + optional :balance, -> { Lithic::Balance } + + # @!method initialize(balance: nil) + # Payment transaction + # + # @param balance [Lithic::Models::Balance] Balance + end + end +end diff --git a/lib/lithic/models/payment_list_params.rb b/lib/lithic/models/payment_list_params.rb new file mode 100644 index 00000000..2da625f0 --- /dev/null +++ b/lib/lithic/models/payment_list_params.rb @@ -0,0 +1,134 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Payments#list + class PaymentListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute account_token + # + # @return [String, nil] + optional :account_token, String + + # @!attribute begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time + + # @!attribute business_account_token + # + # @return [String, nil] + optional :business_account_token, String + + # @!attribute category + # + # @return [Symbol, Lithic::Models::PaymentListParams::Category, nil] + optional :category, enum: -> { Lithic::PaymentListParams::Category } + + # @!attribute end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute financial_account_token + # + # @return [String, nil] + optional :financial_account_token, String + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute result + # + # @return [Symbol, Lithic::Models::PaymentListParams::Result, nil] + optional :result, enum: -> { Lithic::PaymentListParams::Result } + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!attribute status + # + # @return [Symbol, Lithic::Models::PaymentListParams::Status, nil] + optional :status, enum: -> { Lithic::PaymentListParams::Status } + + # @!method initialize(account_token: nil, begin_: nil, business_account_token: nil, category: nil, end_: nil, ending_before: nil, financial_account_token: nil, page_size: nil, result: nil, starting_after: nil, status: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::PaymentListParams} for more details. + # + # @param account_token [String] + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param business_account_token [String] + # + # @param category [Symbol, Lithic::Models::PaymentListParams::Category] + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param financial_account_token [String] + # + # @param page_size [Integer] Page size (for pagination). + # + # @param result [Symbol, Lithic::Models::PaymentListParams::Result] + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param status [Symbol, Lithic::Models::PaymentListParams::Status] + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + module Category + extend Lithic::Internal::Type::Enum + + ACH = :ACH + + # @!method self.values + # @return [Array] + end + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + + module Status + extend Lithic::Internal::Type::Enum + + DECLINED = :DECLINED + PENDING = :PENDING + RETURNED = :RETURNED + SETTLED = :SETTLED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/payment_retrieve_params.rb b/lib/lithic/models/payment_retrieve_params.rb new file mode 100644 index 00000000..3114a8f5 --- /dev/null +++ b/lib/lithic/models/payment_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Payments#retrieve + class PaymentRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute payment_token + # + # @return [String] + required :payment_token, String + + # @!method initialize(payment_token:, request_options: {}) + # @param payment_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/payment_retry_params.rb b/lib/lithic/models/payment_retry_params.rb new file mode 100644 index 00000000..a05f70db --- /dev/null +++ b/lib/lithic/models/payment_retry_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Payments#retry_ + class PaymentRetryParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute payment_token + # + # @return [String] + required :payment_token, String + + # @!method initialize(payment_token:, request_options: {}) + # @param payment_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/payment_retry_response.rb b/lib/lithic/models/payment_retry_response.rb new file mode 100644 index 00000000..8c014dee --- /dev/null +++ b/lib/lithic/models/payment_retry_response.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Payments#retry_ + class PaymentRetryResponse < Lithic::Models::Payment + # @!attribute balance + # Balance + # + # @return [Lithic::Models::Balance, nil] + optional :balance, -> { Lithic::Balance } + + # @!method initialize(balance: nil) + # Payment transaction + # + # @param balance [Lithic::Models::Balance] Balance + end + end +end diff --git a/lib/lithic/models/payment_return_params.rb b/lib/lithic/models/payment_return_params.rb new file mode 100644 index 00000000..51795f08 --- /dev/null +++ b/lib/lithic/models/payment_return_params.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Payments#return_ + class PaymentReturnParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute payment_token + # + # @return [String] + required :payment_token, String + + # @!attribute financial_account_token + # Globally unique identifier for the financial account + # + # @return [String] + required :financial_account_token, String + + # @!attribute return_reason_code + # ACH return reason code indicating the reason for returning the payment. + # Supported codes include R01-R53 and R80-R85. For a complete list of return codes + # and their meanings, see + # [ACH Return Reasons](https://docs.lithic.com/docs/ach-overview#ach-return-reasons) + # + # @return [String] + required :return_reason_code, String + + # @!attribute addenda + # Optional additional information about the return. Limited to 44 characters + # + # @return [String, nil] + optional :addenda, String, nil?: true + + # @!attribute date_of_death + # Date of death in YYYY-MM-DD format. Required when using return codes **R14** + # (representative payee deceased) or **R15** (beneficiary or account holder + # deceased) + # + # @return [Date, nil] + optional :date_of_death, Date, nil?: true + + # @!attribute memo + # Optional memo for the return. Limited to 10 characters + # + # @return [String, nil] + optional :memo, String, nil?: true + + # @!method initialize(payment_token:, financial_account_token:, return_reason_code:, addenda: nil, date_of_death: nil, memo: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::PaymentReturnParams} for more details. + # + # @param payment_token [String] + # + # @param financial_account_token [String] Globally unique identifier for the financial account + # + # @param return_reason_code [String] ACH return reason code indicating the reason for returning the payment. Supporte + # + # @param addenda [String, nil] Optional additional information about the return. Limited to 44 characters + # + # @param date_of_death [Date, nil] Date of death in YYYY-MM-DD format. Required when using return codes **R14** (re + # + # @param memo [String, nil] Optional memo for the return. Limited to 10 characters + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/payment_simulate_action_params.rb b/lib/lithic/models/payment_simulate_action_params.rb new file mode 100644 index 00000000..defe97db --- /dev/null +++ b/lib/lithic/models/payment_simulate_action_params.rb @@ -0,0 +1,92 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Payments#simulate_action + class PaymentSimulateActionParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute payment_token + # + # @return [String] + required :payment_token, String + + # @!attribute event_type + # Event Type + # + # @return [Symbol, Lithic::Models::PaymentSimulateActionParams::EventType] + required :event_type, enum: -> { Lithic::PaymentSimulateActionParams::EventType } + + # @!attribute date_of_death + # Date of Death for ACH Return + # + # @return [Date, nil] + optional :date_of_death, Date + + # @!attribute decline_reason + # Decline reason + # + # @return [Symbol, Lithic::Models::PaymentSimulateActionParams::DeclineReason, nil] + optional :decline_reason, enum: -> { Lithic::PaymentSimulateActionParams::DeclineReason } + + # @!attribute return_addenda + # Return Addenda + # + # @return [String, nil] + optional :return_addenda, String + + # @!attribute return_reason_code + # Return Reason Code + # + # @return [String, nil] + optional :return_reason_code, String + + # @!method initialize(payment_token:, event_type:, date_of_death: nil, decline_reason: nil, return_addenda: nil, return_reason_code: nil, request_options: {}) + # @param payment_token [String] + # + # @param event_type [Symbol, Lithic::Models::PaymentSimulateActionParams::EventType] Event Type + # + # @param date_of_death [Date] Date of Death for ACH Return + # + # @param decline_reason [Symbol, Lithic::Models::PaymentSimulateActionParams::DeclineReason] Decline reason + # + # @param return_addenda [String] Return Addenda + # + # @param return_reason_code [String] Return Reason Code + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Event Type + module EventType + extend Lithic::Internal::Type::Enum + + ACH_ORIGINATION_REVIEWED = :ACH_ORIGINATION_REVIEWED + ACH_ORIGINATION_RELEASED = :ACH_ORIGINATION_RELEASED + ACH_ORIGINATION_PROCESSED = :ACH_ORIGINATION_PROCESSED + ACH_ORIGINATION_SETTLED = :ACH_ORIGINATION_SETTLED + ACH_RECEIPT_SETTLED = :ACH_RECEIPT_SETTLED + ACH_RECEIPT_RELEASED = :ACH_RECEIPT_RELEASED + ACH_RECEIPT_RELEASED_EARLY = :ACH_RECEIPT_RELEASED_EARLY + ACH_RETURN_INITIATED = :ACH_RETURN_INITIATED + ACH_RETURN_PROCESSED = :ACH_RETURN_PROCESSED + ACH_RETURN_SETTLED = :ACH_RETURN_SETTLED + + # @!method self.values + # @return [Array] + end + + # Decline reason + module DeclineReason + extend Lithic::Internal::Type::Enum + + PROGRAM_TRANSACTION_LIMIT_EXCEEDED = :PROGRAM_TRANSACTION_LIMIT_EXCEEDED + PROGRAM_DAILY_LIMIT_EXCEEDED = :PROGRAM_DAILY_LIMIT_EXCEEDED + PROGRAM_MONTHLY_LIMIT_EXCEEDED = :PROGRAM_MONTHLY_LIMIT_EXCEEDED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/payment_simulate_action_response.rb b/lib/lithic/models/payment_simulate_action_response.rb new file mode 100644 index 00000000..e2cf5088 --- /dev/null +++ b/lib/lithic/models/payment_simulate_action_response.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Payments#simulate_action + class PaymentSimulateActionResponse < Lithic::Internal::Type::BaseModel + # @!attribute debugging_request_id + # Debugging Request Id + # + # @return [String] + required :debugging_request_id, String + + # @!attribute result + # Request Result + # + # @return [Symbol, Lithic::Models::PaymentSimulateActionResponse::Result] + required :result, enum: -> { Lithic::Models::PaymentSimulateActionResponse::Result } + + # @!attribute transaction_event_token + # Transaction Event Token + # + # @return [String] + required :transaction_event_token, String + + # @!method initialize(debugging_request_id:, result:, transaction_event_token:) + # @param debugging_request_id [String] Debugging Request Id + # + # @param result [Symbol, Lithic::Models::PaymentSimulateActionResponse::Result] Request Result + # + # @param transaction_event_token [String] Transaction Event Token + + # Request Result + # + # @see Lithic::Models::PaymentSimulateActionResponse#result + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/payment_simulate_receipt_params.rb b/lib/lithic/models/payment_simulate_receipt_params.rb new file mode 100644 index 00000000..c6e367d1 --- /dev/null +++ b/lib/lithic/models/payment_simulate_receipt_params.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Payments#simulate_receipt + class PaymentSimulateReceiptParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute token + # Customer-generated payment token used to uniquely identify the simulated payment + # + # @return [String] + required :token, String + + # @!attribute amount + # Amount + # + # @return [Integer] + required :amount, Integer + + # @!attribute financial_account_token + # Financial Account Token + # + # @return [String] + required :financial_account_token, String + + # @!attribute receipt_type + # Receipt Type + # + # @return [Symbol, Lithic::Models::PaymentSimulateReceiptParams::ReceiptType] + required :receipt_type, enum: -> { Lithic::PaymentSimulateReceiptParams::ReceiptType } + + # @!attribute memo + # Memo + # + # @return [String, nil] + optional :memo, String + + # @!method initialize(token:, amount:, financial_account_token:, receipt_type:, memo: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::PaymentSimulateReceiptParams} for more details. + # + # @param token [String] Customer-generated payment token used to uniquely identify the simulated payment + # + # @param amount [Integer] Amount + # + # @param financial_account_token [String] Financial Account Token + # + # @param receipt_type [Symbol, Lithic::Models::PaymentSimulateReceiptParams::ReceiptType] Receipt Type + # + # @param memo [String] Memo + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Receipt Type + module ReceiptType + extend Lithic::Internal::Type::Enum + + RECEIPT_CREDIT = :RECEIPT_CREDIT + RECEIPT_DEBIT = :RECEIPT_DEBIT + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/payment_simulate_receipt_response.rb b/lib/lithic/models/payment_simulate_receipt_response.rb new file mode 100644 index 00000000..72c94859 --- /dev/null +++ b/lib/lithic/models/payment_simulate_receipt_response.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Payments#simulate_receipt + class PaymentSimulateReceiptResponse < Lithic::Internal::Type::BaseModel + # @!attribute debugging_request_id + # Debugging Request Id + # + # @return [String] + required :debugging_request_id, String + + # @!attribute result + # Request Result + # + # @return [Symbol, Lithic::Models::PaymentSimulateReceiptResponse::Result] + required :result, enum: -> { Lithic::Models::PaymentSimulateReceiptResponse::Result } + + # @!attribute transaction_event_token + # Transaction Event Token + # + # @return [String] + required :transaction_event_token, String + + # @!method initialize(debugging_request_id:, result:, transaction_event_token:) + # @param debugging_request_id [String] Debugging Request Id + # + # @param result [Symbol, Lithic::Models::PaymentSimulateReceiptResponse::Result] Request Result + # + # @param transaction_event_token [String] Transaction Event Token + + # Request Result + # + # @see Lithic::Models::PaymentSimulateReceiptResponse#result + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/payment_simulate_release_params.rb b/lib/lithic/models/payment_simulate_release_params.rb new file mode 100644 index 00000000..c596b6e7 --- /dev/null +++ b/lib/lithic/models/payment_simulate_release_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Payments#simulate_release + class PaymentSimulateReleaseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute payment_token + # Payment Token + # + # @return [String] + required :payment_token, String + + # @!method initialize(payment_token:, request_options: {}) + # @param payment_token [String] Payment Token + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/payment_simulate_release_response.rb b/lib/lithic/models/payment_simulate_release_response.rb new file mode 100644 index 00000000..8a9a79a5 --- /dev/null +++ b/lib/lithic/models/payment_simulate_release_response.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Payments#simulate_release + class PaymentSimulateReleaseResponse < Lithic::Internal::Type::BaseModel + # @!attribute debugging_request_id + # Debugging Request Id + # + # @return [String] + required :debugging_request_id, String + + # @!attribute result + # Request Result + # + # @return [Symbol, Lithic::Models::PaymentSimulateReleaseResponse::Result] + required :result, enum: -> { Lithic::Models::PaymentSimulateReleaseResponse::Result } + + # @!attribute transaction_event_token + # Transaction Event Token + # + # @return [String] + required :transaction_event_token, String + + # @!method initialize(debugging_request_id:, result:, transaction_event_token:) + # @param debugging_request_id [String] Debugging Request Id + # + # @param result [Symbol, Lithic::Models::PaymentSimulateReleaseResponse::Result] Request Result + # + # @param transaction_event_token [String] Transaction Event Token + + # Request Result + # + # @see Lithic::Models::PaymentSimulateReleaseResponse#result + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/payment_simulate_return_params.rb b/lib/lithic/models/payment_simulate_return_params.rb new file mode 100644 index 00000000..3f02a767 --- /dev/null +++ b/lib/lithic/models/payment_simulate_return_params.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Payments#simulate_return + class PaymentSimulateReturnParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute payment_token + # Payment Token + # + # @return [String] + required :payment_token, String + + # @!attribute return_reason_code + # Return Reason Code + # + # @return [String, nil] + optional :return_reason_code, String + + # @!method initialize(payment_token:, return_reason_code: nil, request_options: {}) + # @param payment_token [String] Payment Token + # + # @param return_reason_code [String] Return Reason Code + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/payment_simulate_return_response.rb b/lib/lithic/models/payment_simulate_return_response.rb new file mode 100644 index 00000000..9f9604b0 --- /dev/null +++ b/lib/lithic/models/payment_simulate_return_response.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Payments#simulate_return + class PaymentSimulateReturnResponse < Lithic::Internal::Type::BaseModel + # @!attribute debugging_request_id + # Debugging Request Id + # + # @return [String] + required :debugging_request_id, String + + # @!attribute result + # Request Result + # + # @return [Symbol, Lithic::Models::PaymentSimulateReturnResponse::Result] + required :result, enum: -> { Lithic::Models::PaymentSimulateReturnResponse::Result } + + # @!attribute transaction_event_token + # Transaction Event Token + # + # @return [String] + required :transaction_event_token, String + + # @!method initialize(debugging_request_id:, result:, transaction_event_token:) + # @param debugging_request_id [String] Debugging Request Id + # + # @param result [Symbol, Lithic::Models::PaymentSimulateReturnResponse::Result] Request Result + # + # @param transaction_event_token [String] Transaction Event Token + + # Request Result + # + # @see Lithic::Models::PaymentSimulateReturnResponse#result + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/payment_transaction_created_webhook_event.rb b/lib/lithic/models/payment_transaction_created_webhook_event.rb new file mode 100644 index 00000000..bffe3fd5 --- /dev/null +++ b/lib/lithic/models/payment_transaction_created_webhook_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class PaymentTransactionCreatedWebhookEvent < Lithic::Models::Payment + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"payment_transaction.created"] + required :event_type, const: :"payment_transaction.created" + + # @!method initialize(event_type: :"payment_transaction.created") + # Payment transaction + # + # @param event_type [Symbol, :"payment_transaction.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/payment_transaction_updated_webhook_event.rb b/lib/lithic/models/payment_transaction_updated_webhook_event.rb new file mode 100644 index 00000000..7a53c62c --- /dev/null +++ b/lib/lithic/models/payment_transaction_updated_webhook_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class PaymentTransactionUpdatedWebhookEvent < Lithic::Models::Payment + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"payment_transaction.updated"] + required :event_type, const: :"payment_transaction.updated" + + # @!method initialize(event_type: :"payment_transaction.updated") + # Payment transaction + # + # @param event_type [Symbol, :"payment_transaction.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/provision_response.rb b/lib/lithic/models/provision_response.rb new file mode 100644 index 00000000..b4a612e8 --- /dev/null +++ b/lib/lithic/models/provision_response.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ProvisionResponse < Lithic::Internal::Type::BaseModel + # @!attribute activation_data + # + # @return [String, nil] + optional :activation_data, String, api_name: :activationData + + # @!attribute encrypted_data + # + # @return [String, nil] + optional :encrypted_data, String, api_name: :encryptedData + + # @!attribute ephemeral_public_key + # + # @return [String, nil] + optional :ephemeral_public_key, String, api_name: :ephemeralPublicKey + + # @!method initialize(activation_data: nil, encrypted_data: nil, ephemeral_public_key: nil) + # Object containing the fields required to add a card to Apple Pay. Applies only + # to Apple Pay wallet. + # + # @param activation_data [String] + # @param encrypted_data [String] + # @param ephemeral_public_key [String] + end + end +end diff --git a/lib/lithic/models/reports/settlement/network_total_list_params.rb b/lib/lithic/models/reports/settlement/network_total_list_params.rb new file mode 100644 index 00000000..3910397e --- /dev/null +++ b/lib/lithic/models/reports/settlement/network_total_list_params.rb @@ -0,0 +1,128 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Reports + module Settlement + # @see Lithic::Resources::Reports::Settlement::NetworkTotals#list + class NetworkTotalListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute begin_ + # Datetime in RFC 3339 format. Only entries created after the specified time will + # be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time + + # @!attribute end_ + # Datetime in RFC 3339 format. Only entries created before the specified time will + # be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute institution_id + # Institution ID to filter on. + # + # @return [String, nil] + optional :institution_id, String + + # @!attribute network + # Network to filter on. + # + # @return [Symbol, Lithic::Models::Reports::Settlement::NetworkTotalListParams::Network, nil] + optional :network, enum: -> { Lithic::Reports::Settlement::NetworkTotalListParams::Network } + + # @!attribute page_size + # Number of records per page. + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute report_date + # Singular report date to filter on (YYYY-MM-DD). Cannot be populated in + # conjunction with report_date_begin or report_date_end. + # + # @return [Date, nil] + optional :report_date, Date + + # @!attribute report_date_begin + # Earliest report date to filter on, inclusive (YYYY-MM-DD). + # + # @return [Date, nil] + optional :report_date_begin, Date + + # @!attribute report_date_end + # Latest report date to filter on, inclusive (YYYY-MM-DD). + # + # @return [Date, nil] + optional :report_date_end, Date + + # @!attribute settlement_institution_id + # Settlement institution ID to filter on. + # + # @return [String, nil] + optional :settlement_institution_id, String + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!method initialize(begin_: nil, end_: nil, ending_before: nil, institution_id: nil, network: nil, page_size: nil, report_date: nil, report_date_begin: nil, report_date_end: nil, settlement_institution_id: nil, starting_after: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Reports::Settlement::NetworkTotalListParams} for more details. + # + # @param begin_ [Time] Datetime in RFC 3339 format. Only entries created after the specified time will + # + # @param end_ [Time] Datetime in RFC 3339 format. Only entries created before the specified time will + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param institution_id [String] Institution ID to filter on. + # + # @param network [Symbol, Lithic::Models::Reports::Settlement::NetworkTotalListParams::Network] Network to filter on. + # + # @param page_size [Integer] Number of records per page. + # + # @param report_date [Date] Singular report date to filter on (YYYY-MM-DD). Cannot be populated in conjuncti + # + # @param report_date_begin [Date] Earliest report date to filter on, inclusive (YYYY-MM-DD). + # + # @param report_date_end [Date] Latest report date to filter on, inclusive (YYYY-MM-DD). + # + # @param settlement_institution_id [String] Settlement institution ID to filter on. + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Network to filter on. + module Network + extend Lithic::Internal::Type::Enum + + AMEX = :AMEX + VISA = :VISA + MASTERCARD = :MASTERCARD + MAESTRO = :MAESTRO + INTERLINK = :INTERLINK + + # @!method self.values + # @return [Array] + end + end + end + end + end +end diff --git a/lib/lithic/models/reports/settlement/network_total_retrieve_params.rb b/lib/lithic/models/reports/settlement/network_total_retrieve_params.rb new file mode 100644 index 00000000..bcbf038a --- /dev/null +++ b/lib/lithic/models/reports/settlement/network_total_retrieve_params.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Reports + module Settlement + # @see Lithic::Resources::Reports::Settlement::NetworkTotals#retrieve + class NetworkTotalRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute token + # + # @return [String] + required :token, String + + # @!method initialize(token:, request_options: {}) + # @param token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end + end +end diff --git a/lib/lithic/models/reports/settlement_list_details_params.rb b/lib/lithic/models/reports/settlement_list_details_params.rb new file mode 100644 index 00000000..94fbaf6b --- /dev/null +++ b/lib/lithic/models/reports/settlement_list_details_params.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Reports + # @see Lithic::Resources::Reports::Settlement#list_details + class SettlementListDetailsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute report_date + # + # @return [Date] + required :report_date, Date + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute page_size + # Number of records per page. + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!method initialize(report_date:, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Reports::SettlementListDetailsParams} for more details. + # + # @param report_date [Date] + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Number of records per page. + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/reports/settlement_summary_params.rb b/lib/lithic/models/reports/settlement_summary_params.rb new file mode 100644 index 00000000..19670424 --- /dev/null +++ b/lib/lithic/models/reports/settlement_summary_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Reports + # @see Lithic::Resources::Reports::Settlement#summary + class SettlementSummaryParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute report_date + # + # @return [Date] + required :report_date, Date + + # @!method initialize(report_date:, request_options: {}) + # @param report_date [Date] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/required_document.rb b/lib/lithic/models/required_document.rb new file mode 100644 index 00000000..af11a4a1 --- /dev/null +++ b/lib/lithic/models/required_document.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module Lithic + module Models + class RequiredDocument < Lithic::Internal::Type::BaseModel + # @!attribute entity_token + # Globally unique identifier for an entity. + # + # @return [String] + required :entity_token, String + + # @!attribute status_reasons + # Provides the status reasons that will be satisfied by providing one of the valid + # documents. + # + # @return [Array] + required :status_reasons, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute valid_documents + # A list of valid documents that will satisfy the KYC requirements for the + # specified entity. + # + # @return [Array] + required :valid_documents, Lithic::Internal::Type::ArrayOf[String] + + # @!method initialize(entity_token:, status_reasons:, valid_documents:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::RequiredDocument} for more details. + # + # @param entity_token [String] Globally unique identifier for an entity. + # + # @param status_reasons [Array] Provides the status reasons that will be satisfied by providing one of the valid + # + # @param valid_documents [Array] A list of valid documents that will satisfy the KYC requirements for the specifi + end + end +end diff --git a/lib/lithic/models/responder_endpoint_check_status_params.rb b/lib/lithic/models/responder_endpoint_check_status_params.rb new file mode 100644 index 00000000..9d8310f3 --- /dev/null +++ b/lib/lithic/models/responder_endpoint_check_status_params.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ResponderEndpoints#check_status + class ResponderEndpointCheckStatusParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute type + # The type of the endpoint. + # + # @return [Symbol, Lithic::Models::ResponderEndpointCheckStatusParams::Type] + required :type, enum: -> { Lithic::ResponderEndpointCheckStatusParams::Type } + + # @!method initialize(type:, request_options: {}) + # @param type [Symbol, Lithic::Models::ResponderEndpointCheckStatusParams::Type] The type of the endpoint. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # The type of the endpoint. + module Type + extend Lithic::Internal::Type::Enum + + AUTH_STREAM_ACCESS = :AUTH_STREAM_ACCESS + THREE_DS_DECISIONING = :THREE_DS_DECISIONING + TOKENIZATION_DECISIONING = :TOKENIZATION_DECISIONING + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/responder_endpoint_create_params.rb b/lib/lithic/models/responder_endpoint_create_params.rb new file mode 100644 index 00000000..20c3ee87 --- /dev/null +++ b/lib/lithic/models/responder_endpoint_create_params.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ResponderEndpoints#create + class ResponderEndpointCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute type + # The type of the endpoint. + # + # @return [Symbol, Lithic::Models::ResponderEndpointCreateParams::Type, nil] + optional :type, enum: -> { Lithic::ResponderEndpointCreateParams::Type } + + # @!attribute url + # The URL for the responder endpoint (must be http(s)). + # + # @return [String, nil] + optional :url, String + + # @!method initialize(type: nil, url: nil, request_options: {}) + # @param type [Symbol, Lithic::Models::ResponderEndpointCreateParams::Type] The type of the endpoint. + # + # @param url [String] The URL for the responder endpoint (must be http(s)). + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # The type of the endpoint. + module Type + extend Lithic::Internal::Type::Enum + + AUTH_STREAM_ACCESS = :AUTH_STREAM_ACCESS + THREE_DS_DECISIONING = :THREE_DS_DECISIONING + TOKENIZATION_DECISIONING = :TOKENIZATION_DECISIONING + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/responder_endpoint_create_response.rb b/lib/lithic/models/responder_endpoint_create_response.rb new file mode 100644 index 00000000..3de2fb6f --- /dev/null +++ b/lib/lithic/models/responder_endpoint_create_response.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ResponderEndpoints#create + class ResponderEndpointCreateResponse < Lithic::Internal::Type::BaseModel + # @!attribute enrolled + # True if the endpoint was enrolled successfully. + # + # @return [Boolean, nil] + optional :enrolled, Lithic::Internal::Type::Boolean + + # @!method initialize(enrolled: nil) + # @param enrolled [Boolean] True if the endpoint was enrolled successfully. + end + end +end diff --git a/lib/lithic/models/responder_endpoint_delete_params.rb b/lib/lithic/models/responder_endpoint_delete_params.rb new file mode 100644 index 00000000..b7e09fb9 --- /dev/null +++ b/lib/lithic/models/responder_endpoint_delete_params.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ResponderEndpoints#delete + class ResponderEndpointDeleteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute type + # The type of the endpoint. + # + # @return [Symbol, Lithic::Models::ResponderEndpointDeleteParams::Type] + required :type, enum: -> { Lithic::ResponderEndpointDeleteParams::Type } + + # @!method initialize(type:, request_options: {}) + # @param type [Symbol, Lithic::Models::ResponderEndpointDeleteParams::Type] The type of the endpoint. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # The type of the endpoint. + module Type + extend Lithic::Internal::Type::Enum + + AUTH_STREAM_ACCESS = :AUTH_STREAM_ACCESS + THREE_DS_DECISIONING = :THREE_DS_DECISIONING + TOKENIZATION_DECISIONING = :TOKENIZATION_DECISIONING + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/responder_endpoint_status.rb b/lib/lithic/models/responder_endpoint_status.rb new file mode 100644 index 00000000..f0f5053c --- /dev/null +++ b/lib/lithic/models/responder_endpoint_status.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::ResponderEndpoints#check_status + class ResponderEndpointStatus < Lithic::Internal::Type::BaseModel + # @!attribute enrolled + # True if the instance has an endpoint enrolled. + # + # @return [Boolean, nil] + optional :enrolled, Lithic::Internal::Type::Boolean + + # @!attribute url + # The URL of the currently enrolled endpoint or null. + # + # @return [String, nil] + optional :url, String, nil?: true + + # @!method initialize(enrolled: nil, url: nil) + # @param enrolled [Boolean] True if the instance has an endpoint enrolled. + # + # @param url [String, nil] The URL of the currently enrolled endpoint or null. + end + end +end diff --git a/lib/lithic/models/settlement_detail.rb b/lib/lithic/models/settlement_detail.rb new file mode 100644 index 00000000..58aebaa6 --- /dev/null +++ b/lib/lithic/models/settlement_detail.rb @@ -0,0 +1,243 @@ +# frozen_string_literal: true + +module Lithic + module Models + class SettlementDetail < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier denoting the Settlement Detail. + # + # @return [String] + required :token, String + + # @!attribute account_token + # Globally unique identifier denoting the account that the associated transaction + # occurred on. + # + # @return [String, nil] + required :account_token, String, nil?: true + + # @!attribute card_program_token + # Globally unique identifier denoting the card program that the associated + # transaction occurred on. + # + # @return [String, nil] + required :card_program_token, String, nil?: true + + # @!attribute card_token + # Globally unique identifier denoting the card that the associated transaction + # occurred on. + # + # @return [String, nil] + required :card_token, String, nil?: true + + # @!attribute created + # Date and time when the transaction first occurred. UTC time zone. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # Three-character alphabetic ISO 4217 code. + # + # @return [String] + required :currency, String + + # @!attribute disputes_gross_amount + # The total gross amount of disputes settlements. + # + # @return [Integer] + required :disputes_gross_amount, Integer + + # @!attribute event_tokens + # Array of globally unique identifiers for the financial events that comprise this + # settlement. Use these tokens to access detailed event-level information. + # + # @return [Array] + required :event_tokens, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute institution + # The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE + # for Visa). + # + # @return [String] + required :institution, String + + # @!attribute interchange_fee_extended_precision + # The total amount of interchange in six-digit extended precision. + # + # @return [Integer] + required :interchange_fee_extended_precision, Integer + + # @!attribute interchange_gross_amount + # The total amount of interchange. + # + # @return [Integer] + required :interchange_gross_amount, Integer + + # @!attribute network + # Card network where the transaction took place. + # + # @return [Symbol, Lithic::Models::SettlementDetail::Network] + required :network, enum: -> { Lithic::SettlementDetail::Network } + + # @!attribute other_fees_details + # The total gross amount of other fees by type. + # + # @return [Lithic::Models::SettlementDetail::OtherFeesDetails] + required :other_fees_details, -> { Lithic::SettlementDetail::OtherFeesDetails } + + # @!attribute other_fees_gross_amount + # Total amount of gross other fees outside of interchange. + # + # @return [Integer] + required :other_fees_gross_amount, Integer + + # @!attribute report_date + # Date of when the report was first generated. + # + # @return [String] + required :report_date, String + + # @!attribute settlement_date + # Date of when money movement is triggered for the transaction. One exception + # applies - for Mastercard dual message settlement, this is the settlement + # advisement date, which is distinct from the date of money movement. + # + # @return [String] + required :settlement_date, String + + # @!attribute transaction_token + # Globally unique identifier denoting the associated transaction. For settlement + # records with type `CLEARING`, `FINANCIAL`, or `NON_FINANCIAL`, this references a + # card transaction token. For settlement records with type `CHARGEBACK`, + # `REPRESENTMENT`, `PREARBITRATION`, `ARBITRATION`, or `COLLABORATION`, this + # references the dispute transaction token. May be null for certain settlement + # types. + # + # @return [String, nil] + required :transaction_token, String, nil?: true + + # @!attribute transactions_gross_amount + # The total amount of settlement impacting transactions (excluding interchange, + # fees, and disputes). + # + # @return [Integer] + required :transactions_gross_amount, Integer + + # @!attribute type + # The type of settlement record. + # + # @return [Symbol, Lithic::Models::SettlementDetail::Type] + required :type, enum: -> { Lithic::SettlementDetail::Type } + + # @!attribute updated + # Date and time when the transaction first occurred. UTC time zone. + # + # @return [Time] + required :updated, Time + + # @!attribute fee_description + # Network's description of a fee, only present on records with type `FEE`. + # + # @return [String, nil] + optional :fee_description, String + + # @!method initialize(token:, account_token:, card_program_token:, card_token:, created:, currency:, disputes_gross_amount:, event_tokens:, institution:, interchange_fee_extended_precision:, interchange_gross_amount:, network:, other_fees_details:, other_fees_gross_amount:, report_date:, settlement_date:, transaction_token:, transactions_gross_amount:, type:, updated:, fee_description: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::SettlementDetail} for more details. + # + # @param token [String] Globally unique identifier denoting the Settlement Detail. + # + # @param account_token [String, nil] Globally unique identifier denoting the account that the associated transaction + # + # @param card_program_token [String, nil] Globally unique identifier denoting the card program that the associated transac + # + # @param card_token [String, nil] Globally unique identifier denoting the card that the associated transaction occ + # + # @param created [Time] Date and time when the transaction first occurred. UTC time zone. + # + # @param currency [String] Three-character alphabetic ISO 4217 code. + # + # @param disputes_gross_amount [Integer] The total gross amount of disputes settlements. + # + # @param event_tokens [Array] Array of globally unique identifiers for the financial events that comprise this + # + # @param institution [String] The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE f + # + # @param interchange_fee_extended_precision [Integer] The total amount of interchange in six-digit extended precision. + # + # @param interchange_gross_amount [Integer] The total amount of interchange. + # + # @param network [Symbol, Lithic::Models::SettlementDetail::Network] Card network where the transaction took place. + # + # @param other_fees_details [Lithic::Models::SettlementDetail::OtherFeesDetails] The total gross amount of other fees by type. + # + # @param other_fees_gross_amount [Integer] Total amount of gross other fees outside of interchange. + # + # @param report_date [String] Date of when the report was first generated. + # + # @param settlement_date [String] Date of when money movement is triggered for the transaction. One exception appl + # + # @param transaction_token [String, nil] Globally unique identifier denoting the associated transaction. For settlement r + # + # @param transactions_gross_amount [Integer] The total amount of settlement impacting transactions (excluding interchange, fe + # + # @param type [Symbol, Lithic::Models::SettlementDetail::Type] The type of settlement record. + # + # @param updated [Time] Date and time when the transaction first occurred. UTC time zone. + # + # @param fee_description [String] Network's description of a fee, only present on records with type `FEE`. + + # Card network where the transaction took place. + # + # @see Lithic::Models::SettlementDetail#network + module Network + extend Lithic::Internal::Type::Enum + + AMEX = :AMEX + INTERLINK = :INTERLINK + MAESTRO = :MAESTRO + MASTERCARD = :MASTERCARD + UNKNOWN = :UNKNOWN + VISA = :VISA + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::SettlementDetail#other_fees_details + class OtherFeesDetails < Lithic::Internal::Type::BaseModel + # @!attribute isa + # + # @return [Integer, nil] + optional :isa, Integer, api_name: :ISA + + # @!method initialize(isa: nil) + # The total gross amount of other fees by type. + # + # @param isa [Integer] + end + + # The type of settlement record. + # + # @see Lithic::Models::SettlementDetail#type + module Type + extend Lithic::Internal::Type::Enum + + ADJUSTMENT = :ADJUSTMENT + ARBITRATION = :ARBITRATION + CHARGEBACK = :CHARGEBACK + CLEARING = :CLEARING + COLLABORATION = :COLLABORATION + FEE = :FEE + FINANCIAL = :FINANCIAL + NON_FINANCIAL = :NON_FINANCIAL + PREARBITRATION = :PREARBITRATION + REPRESENTMENT = :REPRESENTMENT + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/settlement_report.rb b/lib/lithic/models/settlement_report.rb new file mode 100644 index 00000000..5a230c86 --- /dev/null +++ b/lib/lithic/models/settlement_report.rb @@ -0,0 +1,125 @@ +# frozen_string_literal: true + +module Lithic + module Models + class SettlementReport < Lithic::Internal::Type::BaseModel + # @!attribute created + # Date and time when the transaction first occurred. UTC time zone. + # + # @return [Time] + required :created, Time + + # @!attribute currency + # @deprecated + # + # 3-character alphabetic ISO 4217 code. (This field is deprecated and will be + # removed in a future version of the API.) + # + # @return [String] + required :currency, String + + # @!attribute details + # + # @return [Array] + required :details, -> { Lithic::Internal::Type::ArrayOf[Lithic::SettlementSummaryDetails] } + + # @!attribute disputes_gross_amount + # @deprecated + # + # The total gross amount of disputes settlements. (This field is deprecated and + # will be removed in a future version of the API. To compute total amounts, Lithic + # recommends that customers sum the relevant settlement amounts found within + # `details`.) + # + # @return [Integer] + required :disputes_gross_amount, Integer + + # @!attribute interchange_gross_amount + # @deprecated + # + # The total amount of interchange. (This field is deprecated and will be removed + # in a future version of the API. To compute total amounts, Lithic recommends that + # customers sum the relevant settlement amounts found within `details`.) + # + # @return [Integer] + required :interchange_gross_amount, Integer + + # @!attribute is_complete + # Indicates that all data expected on the given report date is available. + # + # @return [Boolean] + required :is_complete, Lithic::Internal::Type::Boolean + + # @!attribute other_fees_gross_amount + # @deprecated + # + # Total amount of gross other fees outside of interchange. (This field is + # deprecated and will be removed in a future version of the API. To compute total + # amounts, Lithic recommends that customers sum the relevant settlement amounts + # found within `details`.) + # + # @return [Integer] + required :other_fees_gross_amount, Integer + + # @!attribute report_date + # Date of when the report was first generated. + # + # @return [String] + required :report_date, String + + # @!attribute settled_net_amount + # @deprecated + # + # The total net amount of cash moved. (net value of settled_gross_amount, + # interchange, fees). (This field is deprecated and will be removed in a future + # version of the API. To compute total amounts, Lithic recommends that customers + # sum the relevant settlement amounts found within `details`.) + # + # @return [Integer] + required :settled_net_amount, Integer + + # @!attribute transactions_gross_amount + # @deprecated + # + # The total amount of settlement impacting transactions (excluding interchange, + # fees, and disputes). (This field is deprecated and will be removed in a future + # version of the API. To compute total amounts, Lithic recommends that customers + # sum the relevant settlement amounts found within `details`.) + # + # @return [Integer] + required :transactions_gross_amount, Integer + + # @!attribute updated + # Date and time when the transaction first occurred. UTC time zone. + # + # @return [Time] + required :updated, Time + + # @!method initialize(created:, currency:, details:, disputes_gross_amount:, interchange_gross_amount:, is_complete:, other_fees_gross_amount:, report_date:, settled_net_amount:, transactions_gross_amount:, updated:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::SettlementReport} for more details. + # + # @param created [Time] Date and time when the transaction first occurred. UTC time zone. + # + # @param currency [String] 3-character alphabetic ISO 4217 code. (This field is deprecated and will be remo + # + # @param details [Array] + # + # @param disputes_gross_amount [Integer] The total gross amount of disputes settlements. (This field is deprecated and wi + # + # @param interchange_gross_amount [Integer] The total amount of interchange. (This field is deprecated and will be removed i + # + # @param is_complete [Boolean] Indicates that all data expected on the given report date is available. + # + # @param other_fees_gross_amount [Integer] Total amount of gross other fees outside of interchange. (This field is deprecat + # + # @param report_date [String] Date of when the report was first generated. + # + # @param settled_net_amount [Integer] The total net amount of cash moved. (net value of settled_gross_amount, intercha + # + # @param transactions_gross_amount [Integer] The total amount of settlement impacting transactions (excluding interchange, fe + # + # @param updated [Time] Date and time when the transaction first occurred. UTC time zone. + end + end +end diff --git a/lib/lithic/models/settlement_report_updated_webhook_event.rb b/lib/lithic/models/settlement_report_updated_webhook_event.rb new file mode 100644 index 00000000..d3d4a6e3 --- /dev/null +++ b/lib/lithic/models/settlement_report_updated_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class SettlementReportUpdatedWebhookEvent < Lithic::Models::SettlementReport + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"settlement_report.updated"] + required :event_type, const: :"settlement_report.updated" + + # @!method initialize(event_type: :"settlement_report.updated") + # @param event_type [Symbol, :"settlement_report.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/settlement_summary_details.rb b/lib/lithic/models/settlement_summary_details.rb new file mode 100644 index 00000000..d894b168 --- /dev/null +++ b/lib/lithic/models/settlement_summary_details.rb @@ -0,0 +1,95 @@ +# frozen_string_literal: true + +module Lithic + module Models + class SettlementSummaryDetails < Lithic::Internal::Type::BaseModel + # @!attribute currency + # 3-character alphabetic ISO 4217 code. + # + # @return [String, nil] + optional :currency, String + + # @!attribute disputes_gross_amount + # The total gross amount of disputes settlements. + # + # @return [Integer, nil] + optional :disputes_gross_amount, Integer + + # @!attribute institution + # The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE + # for Visa). + # + # @return [String, nil] + optional :institution, String + + # @!attribute interchange_gross_amount + # The total amount of interchange. + # + # @return [Integer, nil] + optional :interchange_gross_amount, Integer + + # @!attribute network + # Card network where the transaction took place + # + # @return [Symbol, Lithic::Models::SettlementSummaryDetails::Network, nil] + optional :network, enum: -> { Lithic::SettlementSummaryDetails::Network } + + # @!attribute other_fees_gross_amount + # Total amount of gross other fees outside of interchange. + # + # @return [Integer, nil] + optional :other_fees_gross_amount, Integer + + # @!attribute settled_net_amount + # The total net amount of cash moved. (net value of settled_gross_amount, + # interchange, fees). + # + # @return [Integer, nil] + optional :settled_net_amount, Integer + + # @!attribute transactions_gross_amount + # The total amount of settlement impacting transactions (excluding interchange, + # fees, and disputes). + # + # @return [Integer, nil] + optional :transactions_gross_amount, Integer + + # @!method initialize(currency: nil, disputes_gross_amount: nil, institution: nil, interchange_gross_amount: nil, network: nil, other_fees_gross_amount: nil, settled_net_amount: nil, transactions_gross_amount: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::SettlementSummaryDetails} for more details. + # + # @param currency [String] 3-character alphabetic ISO 4217 code. + # + # @param disputes_gross_amount [Integer] The total gross amount of disputes settlements. + # + # @param institution [String] The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE f + # + # @param interchange_gross_amount [Integer] The total amount of interchange. + # + # @param network [Symbol, Lithic::Models::SettlementSummaryDetails::Network] Card network where the transaction took place + # + # @param other_fees_gross_amount [Integer] Total amount of gross other fees outside of interchange. + # + # @param settled_net_amount [Integer] The total net amount of cash moved. (net value of settled_gross_amount, intercha + # + # @param transactions_gross_amount [Integer] The total amount of settlement impacting transactions (excluding interchange, fe + + # Card network where the transaction took place + # + # @see Lithic::Models::SettlementSummaryDetails#network + module Network + extend Lithic::Internal::Type::Enum + + AMEX = :AMEX + INTERLINK = :INTERLINK + MAESTRO = :MAESTRO + MASTERCARD = :MASTERCARD + UNKNOWN = :UNKNOWN + VISA = :VISA + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/shipping_address.rb b/lib/lithic/models/shipping_address.rb new file mode 100644 index 00000000..d2ed715c --- /dev/null +++ b/lib/lithic/models/shipping_address.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ShippingAddress < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # Valid USPS routable address. + # + # @return [String] + required :address1, String + + # @!attribute city + # City + # + # @return [String] + required :city, String + + # @!attribute country + # Uppercase ISO 3166-1 alpha-3 three character abbreviation. + # + # @return [String] + required :country, String + + # @!attribute first_name + # Customer's first name. This will be the first name printed on the physical card. + # The combined length of `first_name` and `last_name` may not exceed 25 + # characters. + # + # @return [String] + required :first_name, String + + # @!attribute last_name + # Customer's surname (family name). This will be the last name printed on the + # physical card. The combined length of `first_name` and `last_name` may not + # exceed 25 characters. + # + # @return [String] + required :last_name, String + + # @!attribute postal_code + # Postal code (formerly zipcode). For US addresses, either five-digit postal code + # or nine-digit postal code (ZIP+4) using the format 12345-1234. + # + # @return [String] + required :postal_code, String + + # @!attribute state + # Uppercase ISO 3166-2 two character abbreviation for US and CA. Optional with a + # limit of 24 characters for other countries. + # + # @return [String] + required :state, String + + # @!attribute address2 + # Unit number (if applicable). + # + # @return [String, nil] + optional :address2, String + + # @!attribute email + # Email address to be contacted for expedited shipping process purposes. Required + # if `shipping_method` is `EXPEDITED`. + # + # @return [String, nil] + optional :email, String + + # @!attribute line2_text + # Text to be printed on line two of the physical card. Use of this field requires + # additional permissions. + # + # @return [String, nil] + optional :line2_text, String + + # @!attribute phone_number + # Cardholder's phone number in E.164 format to be contacted for expedited shipping + # process purposes. Required if `shipping_method` is `EXPEDITED`. + # + # @return [String, nil] + optional :phone_number, String + + # @!method initialize(address1:, city:, country:, first_name:, last_name:, postal_code:, state:, address2: nil, email: nil, line2_text: nil, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ShippingAddress} for more details. + # + # @param address1 [String] Valid USPS routable address. + # + # @param city [String] City + # + # @param country [String] Uppercase ISO 3166-1 alpha-3 three character abbreviation. + # + # @param first_name [String] Customer's first name. This will be the first name printed on the physical card. + # + # @param last_name [String] Customer's surname (family name). This will be the last name printed on the phys + # + # @param postal_code [String] Postal code (formerly zipcode). For US addresses, either five-digit postal code + # + # @param state [String] Uppercase ISO 3166-2 two character abbreviation for US and CA. Optional with a l + # + # @param address2 [String] Unit number (if applicable). + # + # @param email [String] Email address to be contacted for expedited shipping process purposes. Required + # + # @param line2_text [String] Text to be printed on line two of the physical card. Use of this field requires + # + # @param phone_number [String] Cardholder's phone number in E.164 format to be contacted for expedited shipping + end + end +end diff --git a/lib/lithic/models/signals_response.rb b/lib/lithic/models/signals_response.rb new file mode 100644 index 00000000..ec0f0a18 --- /dev/null +++ b/lib/lithic/models/signals_response.rb @@ -0,0 +1,306 @@ +# frozen_string_literal: true + +module Lithic + module Models + class SignalsResponse < Lithic::Internal::Type::BaseModel + # @!attribute approved_txn_amount_m2 + # The Welford M2 accumulator for lifetime approved transaction amounts. Used + # together with `avg_transaction_amount` and `approved_txn_count` to compute the + # z-score of a new transaction amount (variance = M2 / (count - 1)). + # + # @return [Float, nil] + required :approved_txn_amount_m2, Float, nil?: true + + # @!attribute approved_txn_amount_m2_30d + # The Welford M2 accumulator for approved transaction amounts over the last 30 + # days. + # + # @return [Float, nil] + required :approved_txn_amount_m2_30d, Float, nil?: true + + # @!attribute approved_txn_amount_m2_7d + # The Welford M2 accumulator for approved transaction amounts over the last 7 + # days. + # + # @return [Float, nil] + required :approved_txn_amount_m2_7d, Float, nil?: true + + # @!attribute approved_txn_amount_m2_90d + # The Welford M2 accumulator for approved transaction amounts over the last 90 + # days. + # + # @return [Float, nil] + required :approved_txn_amount_m2_90d, Float, nil?: true + + # @!attribute approved_txn_count + # The total number of approved transactions over the entity's lifetime. + # + # @return [Integer, nil] + required :approved_txn_count, Integer, nil?: true + + # @!attribute approved_txn_count_30d + # The number of approved transactions in the last 30 days. + # + # @return [Integer, nil] + required :approved_txn_count_30d, Integer, nil?: true + + # @!attribute approved_txn_count_7d + # The number of approved transactions in the last 7 days. + # + # @return [Integer, nil] + required :approved_txn_count_7d, Integer, nil?: true + + # @!attribute approved_txn_count_90d + # The number of approved transactions in the last 90 days. + # + # @return [Integer, nil] + required :approved_txn_count_90d, Integer, nil?: true + + # @!attribute avg_transaction_amount + # The average approved transaction amount over the entity's lifetime, in cents. + # Null if fewer than 5 approved transactions have been recorded. + # + # @return [Float, nil] + required :avg_transaction_amount, Float, nil?: true + + # @!attribute avg_transaction_amount_30d + # The average approved transaction amount over the last 30 days, in cents. Null if + # fewer than 5 approved transactions in window. + # + # @return [Float, nil] + required :avg_transaction_amount_30d, Float, nil?: true + + # @!attribute avg_transaction_amount_7d + # The average approved transaction amount over the last 7 days, in cents. Null if + # fewer than 5 approved transactions in window. + # + # @return [Float, nil] + required :avg_transaction_amount_7d, Float, nil?: true + + # @!attribute avg_transaction_amount_90d + # The average approved transaction amount over the last 90 days, in cents. Null if + # fewer than 5 approved transactions in window. + # + # @return [Float, nil] + required :avg_transaction_amount_90d, Float, nil?: true + + # @!attribute distinct_country_count + # The number of distinct merchant countries seen in the entity's transaction + # history. + # + # @return [Integer, nil] + required :distinct_country_count, Integer, nil?: true + + # @!attribute distinct_mcc_count + # The number of distinct MCCs seen in the entity's transaction history. + # + # @return [Integer, nil] + required :distinct_mcc_count, Integer, nil?: true + + # @!attribute first_txn_at + # The timestamp of the first approved transaction for the entity, in ISO 8601 + # format. + # + # @return [Time, nil] + required :first_txn_at, Time, nil?: true + + # @!attribute is_first_transaction + # Whether the entity has no prior transaction history. Returns true if no history + # is found. Null if transaction history exists but a first transaction timestamp + # is unavailable. + # + # @return [Boolean, nil] + required :is_first_transaction, Lithic::Internal::Type::Boolean, nil?: true + + # @!attribute last_cp_country + # The merchant country of the last card-present transaction. + # + # @return [String, nil] + required :last_cp_country, String, nil?: true + + # @!attribute last_cp_postal_code + # The merchant postal code of the last card-present transaction. + # + # @return [String, nil] + required :last_cp_postal_code, String, nil?: true + + # @!attribute last_cp_timestamp + # The timestamp of the last card-present transaction, in ISO 8601 format. + # + # @return [Time, nil] + required :last_cp_timestamp, Time, nil?: true + + # @!attribute last_txn_approved_at + # The timestamp of the most recent approved transaction for the entity, in ISO + # 8601 format. + # + # @return [Time, nil] + required :last_txn_approved_at, Time, nil?: true + + # @!attribute seen_countries + # The set of merchant countries seen in the entity's transaction history. Clients + # can use this to determine whether a new transaction's country is novel (i.e. + # compute `is_new_country`). + # + # @return [Array, nil] + required :seen_countries, Lithic::Internal::Type::ArrayOf[String], nil?: true + + # @!attribute seen_mccs + # The set of MCCs seen in the entity's transaction history. Clients can use this + # to determine whether a new transaction's MCC is novel (i.e. compute + # `is_new_mcc`). + # + # @return [Array, nil] + required :seen_mccs, Lithic::Internal::Type::ArrayOf[String], nil?: true + + # @!attribute seen_merchants + # The set of card acceptor IDs seen in the card's approved transaction history, + # capped at the 1000 most recently seen. Null for account responses. Clients can + # use this to determine whether a new transaction's merchant is novel (i.e. + # compute `is_new_merchant`). + # + # @return [Array, nil] + required :seen_merchants, Lithic::Internal::Type::ArrayOf[String], nil?: true + + # @!attribute stdev_transaction_amount + # The standard deviation of approved transaction amounts over the entity's + # lifetime, in cents. Null if fewer than 30 approved transactions have been + # recorded. + # + # @return [Float, nil] + required :stdev_transaction_amount, Float, nil?: true + + # @!attribute stdev_transaction_amount_30d + # The standard deviation of approved transaction amounts over the last 30 days, in + # cents. Null if fewer than 30 approved transactions in window. + # + # @return [Float, nil] + required :stdev_transaction_amount_30d, Float, nil?: true + + # @!attribute stdev_transaction_amount_7d + # The standard deviation of approved transaction amounts over the last 7 days, in + # cents. Null if fewer than 30 approved transactions in window. + # + # @return [Float, nil] + required :stdev_transaction_amount_7d, Float, nil?: true + + # @!attribute stdev_transaction_amount_90d + # The standard deviation of approved transaction amounts over the last 90 days, in + # cents. Null if fewer than 30 approved transactions in window. + # + # @return [Float, nil] + required :stdev_transaction_amount_90d, Float, nil?: true + + # @!attribute three_ds_success_count + # The number of successful 3DS authentications for the card. Null for account + # responses. + # + # @return [Integer, nil] + required :three_ds_success_count, Integer, nil?: true + + # @!attribute three_ds_success_rate + # The 3DS authentication success rate for the card, as a percentage from 0.0 to + # 100.0. Null for account responses. + # + # @return [Float, nil] + required :three_ds_success_rate, Float, nil?: true + + # @!attribute three_ds_total_count + # The total number of 3DS authentication attempts for the card. Null for account + # responses. + # + # @return [Integer, nil] + required :three_ds_total_count, Integer, nil?: true + + # @!attribute time_since_last_transaction_days + # The number of days since the last approved transaction on the entity. + # + # @return [Float, nil] + required :time_since_last_transaction_days, Float, nil?: true + + # @!method initialize(approved_txn_amount_m2:, approved_txn_amount_m2_30d:, approved_txn_amount_m2_7d:, approved_txn_amount_m2_90d:, approved_txn_count:, approved_txn_count_30d:, approved_txn_count_7d:, approved_txn_count_90d:, avg_transaction_amount:, avg_transaction_amount_30d:, avg_transaction_amount_7d:, avg_transaction_amount_90d:, distinct_country_count:, distinct_mcc_count:, first_txn_at:, is_first_transaction:, last_cp_country:, last_cp_postal_code:, last_cp_timestamp:, last_txn_approved_at:, seen_countries:, seen_mccs:, seen_merchants:, stdev_transaction_amount:, stdev_transaction_amount_30d:, stdev_transaction_amount_7d:, stdev_transaction_amount_90d:, three_ds_success_count:, three_ds_success_rate:, three_ds_total_count:, time_since_last_transaction_days:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::SignalsResponse} for more details. + # + # Behavioral feature state for a card or account derived from its transaction + # history. + # + # Derived statistical features (averages, standard deviations, z-scores) are + # computed using Welford's online algorithm over approved transactions. Average + # fields are null when fewer than 5 approved transactions have been recorded. + # Standard deviation fields are null when fewer than 30 approved transactions have + # been recorded. + # + # 3DS fields (`three_ds_success_rate`, `three_ds_success_count`, + # `three_ds_total_count`) are card-scoped and will be null for account responses. + # + # Raw fields (`seen_countries`, `seen_mccs`, `approved_txn_amount_m2`, etc.) are + # included so clients can compute their own transaction-specific derivations, such + # as checking whether a new transaction's country is in `seen_countries` to + # determine `is_new_country`, or computing a z-score using the raw mean and M2 + # values. + # + # @param approved_txn_amount_m2 [Float, nil] The Welford M2 accumulator for lifetime approved transaction amounts. Used toget + # + # @param approved_txn_amount_m2_30d [Float, nil] The Welford M2 accumulator for approved transaction amounts over the last 30 day + # + # @param approved_txn_amount_m2_7d [Float, nil] The Welford M2 accumulator for approved transaction amounts over the last 7 days + # + # @param approved_txn_amount_m2_90d [Float, nil] The Welford M2 accumulator for approved transaction amounts over the last 90 day + # + # @param approved_txn_count [Integer, nil] The total number of approved transactions over the entity's lifetime. + # + # @param approved_txn_count_30d [Integer, nil] The number of approved transactions in the last 30 days. + # + # @param approved_txn_count_7d [Integer, nil] The number of approved transactions in the last 7 days. + # + # @param approved_txn_count_90d [Integer, nil] The number of approved transactions in the last 90 days. + # + # @param avg_transaction_amount [Float, nil] The average approved transaction amount over the entity's lifetime, in cents. Nu + # + # @param avg_transaction_amount_30d [Float, nil] The average approved transaction amount over the last 30 days, in cents. Null if + # + # @param avg_transaction_amount_7d [Float, nil] The average approved transaction amount over the last 7 days, in cents. Null if + # + # @param avg_transaction_amount_90d [Float, nil] The average approved transaction amount over the last 90 days, in cents. Null if + # + # @param distinct_country_count [Integer, nil] The number of distinct merchant countries seen in the entity's transaction histo + # + # @param distinct_mcc_count [Integer, nil] The number of distinct MCCs seen in the entity's transaction history. + # + # @param first_txn_at [Time, nil] The timestamp of the first approved transaction for the entity, in ISO 8601 form + # + # @param is_first_transaction [Boolean, nil] Whether the entity has no prior transaction history. Returns true if no history + # + # @param last_cp_country [String, nil] The merchant country of the last card-present transaction. + # + # @param last_cp_postal_code [String, nil] The merchant postal code of the last card-present transaction. + # + # @param last_cp_timestamp [Time, nil] The timestamp of the last card-present transaction, in ISO 8601 format. + # + # @param last_txn_approved_at [Time, nil] The timestamp of the most recent approved transaction for the entity, in ISO 860 + # + # @param seen_countries [Array, nil] The set of merchant countries seen in the entity's transaction history. Clients + # + # @param seen_mccs [Array, nil] The set of MCCs seen in the entity's transaction history. Clients can use this t + # + # @param seen_merchants [Array, nil] The set of card acceptor IDs seen in the card's approved transaction history, ca + # + # @param stdev_transaction_amount [Float, nil] The standard deviation of approved transaction amounts over the entity's lifetim + # + # @param stdev_transaction_amount_30d [Float, nil] The standard deviation of approved transaction amounts over the last 30 days, in + # + # @param stdev_transaction_amount_7d [Float, nil] The standard deviation of approved transaction amounts over the last 7 days, in + # + # @param stdev_transaction_amount_90d [Float, nil] The standard deviation of approved transaction amounts over the last 90 days, in + # + # @param three_ds_success_count [Integer, nil] The number of successful 3DS authentications for the card. Null for account resp + # + # @param three_ds_success_rate [Float, nil] The 3DS authentication success rate for the card, as a percentage from 0.0 to 10 + # + # @param three_ds_total_count [Integer, nil] The total number of 3DS authentication attempts for the card. Null for account r + # + # @param time_since_last_transaction_days [Float, nil] The number of days since the last approved transaction on the entity. + end + end +end diff --git a/lib/lithic/models/spend_limit_duration.rb b/lib/lithic/models/spend_limit_duration.rb new file mode 100644 index 00000000..94305f90 --- /dev/null +++ b/lib/lithic/models/spend_limit_duration.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Lithic + module Models + # Spend limit duration values: + # + # - `ANNUALLY` - Card will authorize transactions up to spend limit for the + # trailing year. + # - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime + # of the card. + # - `MONTHLY` - Card will authorize transactions up to spend limit for the + # trailing month. To support recurring monthly payments, which can occur on + # different day every month, the time window we consider for monthly velocity + # starts 6 days after the current calendar date one month prior. + # - `TRANSACTION` - Card will authorize multiple transactions if each individual + # transaction is under the spend limit. + module SpendLimitDuration + extend Lithic::Internal::Type::Enum + + ANNUALLY = :ANNUALLY + FOREVER = :FOREVER + MONTHLY = :MONTHLY + TRANSACTION = :TRANSACTION + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/lithic/models/statement_totals.rb b/lib/lithic/models/statement_totals.rb new file mode 100644 index 00000000..fdea1618 --- /dev/null +++ b/lib/lithic/models/statement_totals.rb @@ -0,0 +1,100 @@ +# frozen_string_literal: true + +module Lithic + module Models + class StatementTotals < Lithic::Internal::Type::BaseModel + # @!attribute balance_transfers + # Opening balance transferred from previous account in cents + # + # @return [Integer] + required :balance_transfers, Integer + + # @!attribute cash_advances + # ATM and cashback transactions in cents + # + # @return [Integer] + required :cash_advances, Integer + + # @!attribute credits + # Volume of credit management operation transactions less any balance transfers in + # cents + # + # @return [Integer] + required :credits, Integer + + # @!attribute debits + # Volume of debit management operation transactions less any interest in cents + # + # @return [Integer] + required :debits, Integer + + # @!attribute fees + # Volume of debit management operation transactions less any interest in cents + # + # @return [Integer] + required :fees, Integer + + # @!attribute interest + # Interest accrued in cents + # + # @return [Integer] + required :interest, Integer + + # @!attribute payments + # Any funds transfers which affective the balance in cents + # + # @return [Integer] + required :payments, Integer + + # @!attribute purchases + # Net card transaction volume less any cash advances in cents + # + # @return [Integer] + required :purchases, Integer + + # @!attribute credit_details + # Breakdown of credits + # + # @return [Object, nil] + optional :credit_details, Lithic::Internal::Type::Unknown, nil?: true + + # @!attribute debit_details + # Breakdown of debits + # + # @return [Object, nil] + optional :debit_details, Lithic::Internal::Type::Unknown, nil?: true + + # @!attribute payment_details + # Breakdown of payments + # + # @return [Object, nil] + optional :payment_details, Lithic::Internal::Type::Unknown, nil?: true + + # @!method initialize(balance_transfers:, cash_advances:, credits:, debits:, fees:, interest:, payments:, purchases:, credit_details: nil, debit_details: nil, payment_details: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::StatementTotals} for more details. + # + # @param balance_transfers [Integer] Opening balance transferred from previous account in cents + # + # @param cash_advances [Integer] ATM and cashback transactions in cents + # + # @param credits [Integer] Volume of credit management operation transactions less any balance transfers in + # + # @param debits [Integer] Volume of debit management operation transactions less any interest in cents + # + # @param fees [Integer] Volume of debit management operation transactions less any interest in cents + # + # @param interest [Integer] Interest accrued in cents + # + # @param payments [Integer] Any funds transfers which affective the balance in cents + # + # @param purchases [Integer] Net card transaction volume less any cash advances in cents + # + # @param credit_details [Object, nil] Breakdown of credits + # + # @param debit_details [Object, nil] Breakdown of debits + # + # @param payment_details [Object, nil] Breakdown of payments + end + end +end diff --git a/lib/lithic/models/statements_created_webhook_event.rb b/lib/lithic/models/statements_created_webhook_event.rb new file mode 100644 index 00000000..ad9dcc73 --- /dev/null +++ b/lib/lithic/models/statements_created_webhook_event.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + class StatementsCreatedWebhookEvent < Lithic::Models::FinancialAccounts::Statement + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"statements.created"] + required :event_type, const: :"statements.created" + + # @!method initialize(event_type: :"statements.created") + # @param event_type [Symbol, :"statements.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/three_ds/authentication_retrieve_params.rb b/lib/lithic/models/three_ds/authentication_retrieve_params.rb new file mode 100644 index 00000000..6c757ada --- /dev/null +++ b/lib/lithic/models/three_ds/authentication_retrieve_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Models + module ThreeDS + # @see Lithic::Resources::ThreeDS::Authentication#retrieve + class AuthenticationRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute three_ds_authentication_token + # + # @return [String] + required :three_ds_authentication_token, String + + # @!method initialize(three_ds_authentication_token:, request_options: {}) + # @param three_ds_authentication_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/three_ds/authentication_simulate_otp_entry_params.rb b/lib/lithic/models/three_ds/authentication_simulate_otp_entry_params.rb new file mode 100644 index 00000000..155c7b93 --- /dev/null +++ b/lib/lithic/models/three_ds/authentication_simulate_otp_entry_params.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module Lithic + module Models + module ThreeDS + # @see Lithic::Resources::ThreeDS::Authentication#simulate_otp_entry + class AuthenticationSimulateOtpEntryParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute token + # A unique token returned as part of a /v1/three_ds_authentication/simulate call + # that resulted in PENDING_CHALLENGE authentication result. + # + # @return [String] + required :token, String + + # @!attribute otp + # The OTP entered by the cardholder + # + # @return [String] + required :otp, String + + # @!method initialize(token:, otp:, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ThreeDS::AuthenticationSimulateOtpEntryParams} for more + # details. + # + # @param token [String] A unique token returned as part of a /v1/three_ds_authentication/simulate call t + # + # @param otp [String] The OTP entered by the cardholder + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/three_ds/authentication_simulate_params.rb b/lib/lithic/models/three_ds/authentication_simulate_params.rb new file mode 100644 index 00000000..f211ac85 --- /dev/null +++ b/lib/lithic/models/three_ds/authentication_simulate_params.rb @@ -0,0 +1,132 @@ +# frozen_string_literal: true + +module Lithic + module Models + module ThreeDS + # @see Lithic::Resources::ThreeDS::Authentication#simulate + class AuthenticationSimulateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute merchant + # Merchant information for the simulated transaction + # + # @return [Lithic::Models::ThreeDS::AuthenticationSimulateParams::Merchant] + required :merchant, -> { Lithic::ThreeDS::AuthenticationSimulateParams::Merchant } + + # @!attribute pan + # Sixteen digit card number. + # + # @return [String] + required :pan, String + + # @!attribute transaction + # Transaction details for the simulation + # + # @return [Lithic::Models::ThreeDS::AuthenticationSimulateParams::Transaction] + required :transaction, -> { Lithic::ThreeDS::AuthenticationSimulateParams::Transaction } + + # @!attribute card_expiry_check + # When set will use the following values as part of the Simulated Authentication. + # When not set defaults to MATCH + # + # @return [Symbol, Lithic::Models::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck, nil] + optional :card_expiry_check, enum: -> { Lithic::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck } + + # @!method initialize(merchant:, pan:, transaction:, card_expiry_check: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ThreeDS::AuthenticationSimulateParams} for more details. + # + # @param merchant [Lithic::Models::ThreeDS::AuthenticationSimulateParams::Merchant] Merchant information for the simulated transaction + # + # @param pan [String] Sixteen digit card number. + # + # @param transaction [Lithic::Models::ThreeDS::AuthenticationSimulateParams::Transaction] Transaction details for the simulation + # + # @param card_expiry_check [Symbol, Lithic::Models::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck] When set will use the following values as part of the Simulated Authentication. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + class Merchant < Lithic::Internal::Type::BaseModel + # @!attribute id + # Unique identifier to identify the payment card acceptor. Corresponds to + # `merchant_acceptor_id` in authorization. + # + # @return [String] + required :id, String + + # @!attribute country + # Country of the address provided by the cardholder in ISO 3166-1 alpha-3 format + # (e.g. USA) + # + # @return [String] + required :country, String + + # @!attribute mcc + # Merchant category code for the transaction to be simulated. A four-digit number + # listed in ISO 18245. Supported merchant category codes can be found + # [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs). + # + # @return [String] + required :mcc, String + + # @!attribute name + # Merchant descriptor, corresponds to `descriptor` in authorization. If CHALLENGE + # keyword is included, Lithic will trigger a challenge. + # + # @return [String] + required :name, String + + # @!method initialize(id:, country:, mcc:, name:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ThreeDS::AuthenticationSimulateParams::Merchant} for more + # details. + # + # Merchant information for the simulated transaction + # + # @param id [String] Unique identifier to identify the payment card acceptor. Corresponds to `merchan + # + # @param country [String] Country of the address provided by the cardholder in ISO 3166-1 alpha-3 format ( + # + # @param mcc [String] Merchant category code for the transaction to be simulated. A four-digit number + # + # @param name [String] Merchant descriptor, corresponds to `descriptor` in authorization. If CHALLENGE + end + + class Transaction < Lithic::Internal::Type::BaseModel + # @!attribute amount + # Amount (in cents) to authenticate. + # + # @return [Integer] + required :amount, Integer + + # @!attribute currency + # 3-character alphabetic ISO 4217 currency code. + # + # @return [String] + required :currency, String + + # @!method initialize(amount:, currency:) + # Transaction details for the simulation + # + # @param amount [Integer] Amount (in cents) to authenticate. + # + # @param currency [String] 3-character alphabetic ISO 4217 currency code. + end + + # When set will use the following values as part of the Simulated Authentication. + # When not set defaults to MATCH + module CardExpiryCheck + extend Lithic::Internal::Type::Enum + + MATCH = :MATCH + MISMATCH = :MISMATCH + NOT_PRESENT = :NOT_PRESENT + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/three_ds/authentication_simulate_response.rb b/lib/lithic/models/three_ds/authentication_simulate_response.rb new file mode 100644 index 00000000..94fd4685 --- /dev/null +++ b/lib/lithic/models/three_ds/authentication_simulate_response.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Lithic + module Models + module ThreeDS + # @see Lithic::Resources::ThreeDS::Authentication#simulate + class AuthenticationSimulateResponse < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for the 3DS authentication. + # + # @return [String, nil] + optional :token, String + + # @!method initialize(token: nil) + # @param token [String] Globally unique identifier for the 3DS authentication. + end + end + end +end diff --git a/lib/lithic/models/three_ds/challenge_response.rb b/lib/lithic/models/three_ds/challenge_response.rb new file mode 100644 index 00000000..2e73dfd2 --- /dev/null +++ b/lib/lithic/models/three_ds/challenge_response.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Lithic + module Models + module ThreeDS + class ChallengeResponse < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for 3DS Authentication that resulted in + # PENDING_CHALLENGE authentication result. + # + # @return [String] + required :token, String + + # @!attribute challenge_response + # Whether the Cardholder has approved or declined the issued Challenge + # + # @return [Symbol, Lithic::Models::ThreeDS::ChallengeResult] + required :challenge_response, enum: -> { Lithic::ThreeDS::ChallengeResult } + + # @!method initialize(token:, challenge_response:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ThreeDS::ChallengeResponse} for more details. + # + # Response from Card Program to a 3DS Authentication challenge + # + # @param token [String] Globally unique identifier for 3DS Authentication that resulted in PENDING_CHALL + # + # @param challenge_response [Symbol, Lithic::Models::ThreeDS::ChallengeResult] Whether the Cardholder has approved or declined the issued Challenge + end + end + end +end diff --git a/lib/lithic/models/three_ds/challenge_result.rb b/lib/lithic/models/three_ds/challenge_result.rb new file mode 100644 index 00000000..d88ddb41 --- /dev/null +++ b/lib/lithic/models/three_ds/challenge_result.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + module ThreeDS + # Whether the Cardholder has approved or declined the issued Challenge + module ChallengeResult + extend Lithic::Internal::Type::Enum + + APPROVE = :APPROVE + DECLINE_BY_CUSTOMER = :DECLINE_BY_CUSTOMER + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/three_ds/decisioning_challenge_response_params.rb b/lib/lithic/models/three_ds/decisioning_challenge_response_params.rb new file mode 100644 index 00000000..000c0779 --- /dev/null +++ b/lib/lithic/models/three_ds/decisioning_challenge_response_params.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + module ThreeDS + # @see Lithic::Resources::ThreeDS::Decisioning#challenge_response + class DecisioningChallengeResponseParams < Lithic::Models::ThreeDS::ChallengeResponse + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/three_ds/decisioning_retrieve_secret_params.rb b/lib/lithic/models/three_ds/decisioning_retrieve_secret_params.rb new file mode 100644 index 00000000..55565451 --- /dev/null +++ b/lib/lithic/models/three_ds/decisioning_retrieve_secret_params.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + module ThreeDS + # @see Lithic::Resources::ThreeDS::Decisioning#retrieve_secret + class DecisioningRetrieveSecretParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/three_ds/decisioning_retrieve_secret_response.rb b/lib/lithic/models/three_ds/decisioning_retrieve_secret_response.rb new file mode 100644 index 00000000..9fccb67a --- /dev/null +++ b/lib/lithic/models/three_ds/decisioning_retrieve_secret_response.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Lithic + module Models + module ThreeDS + # @see Lithic::Resources::ThreeDS::Decisioning#retrieve_secret + class DecisioningRetrieveSecretResponse < Lithic::Internal::Type::BaseModel + # @!attribute secret + # The 3DS Decisioning HMAC secret + # + # @return [String, nil] + optional :secret, String + + # @!method initialize(secret: nil) + # @param secret [String] The 3DS Decisioning HMAC secret + end + end + end +end diff --git a/lib/lithic/models/three_ds/decisioning_rotate_secret_params.rb b/lib/lithic/models/three_ds/decisioning_rotate_secret_params.rb new file mode 100644 index 00000000..9e192e65 --- /dev/null +++ b/lib/lithic/models/three_ds/decisioning_rotate_secret_params.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Lithic + module Models + module ThreeDS + # @see Lithic::Resources::ThreeDS::Decisioning#rotate_secret + class DecisioningRotateSecretParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/three_ds_authentication.rb b/lib/lithic/models/three_ds_authentication.rb new file mode 100644 index 00000000..a29ed789 --- /dev/null +++ b/lib/lithic/models/three_ds_authentication.rb @@ -0,0 +1,1259 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ThreeDSAuthentication < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for the 3DS authentication. Permitted values: + # 36-digit version 4 UUID (including hyphens). + # + # @return [String] + required :token, String + + # @!attribute account_type + # Type of account/card that is being used for the transaction. Maps to EMV 3DS + # field `acctType`. + # + # @return [Symbol, Lithic::Models::ThreeDSAuthentication::AccountType, nil] + required :account_type, enum: -> { Lithic::ThreeDSAuthentication::AccountType }, nil?: true + + # @!attribute authentication_result + # Indicates the outcome of the 3DS authentication process. + # + # @return [Symbol, Lithic::Models::ThreeDSAuthentication::AuthenticationResult] + required :authentication_result, enum: -> { Lithic::ThreeDSAuthentication::AuthenticationResult } + + # @!attribute card_expiry_check + # Indicates whether the expiration date provided by the cardholder during checkout + # matches Lithic's record of the card's expiration date. + # + # @return [Symbol, Lithic::Models::ThreeDSAuthentication::CardExpiryCheck] + required :card_expiry_check, enum: -> { Lithic::ThreeDSAuthentication::CardExpiryCheck } + + # @!attribute card_token + # Globally unique identifier for the card on which the 3DS authentication has + # occurred. Permitted values: 36-digit version 4 UUID (including hyphens). + # + # @return [String] + required :card_token, String + + # @!attribute cardholder + # Object containing data about the cardholder provided during the transaction. + # + # @return [Lithic::Models::ThreeDSAuthentication::Cardholder] + required :cardholder, -> { Lithic::ThreeDSAuthentication::Cardholder } + + # @!attribute channel + # Channel in which the authentication occurs. Maps to EMV 3DS field + # `deviceChannel`. + # + # @return [Symbol, Lithic::Models::ThreeDSAuthentication::Channel] + required :channel, enum: -> { Lithic::ThreeDSAuthentication::Channel } + + # @!attribute created + # Date and time when the authentication was created in Lithic's system. Permitted + # values: Date string in the ISO 8601 format yyyy-MM-dd'T'hh:mm:ssZ. + # + # @return [Time] + required :created, Time + + # @!attribute merchant + # Object containing data about the merchant involved in the e-commerce + # transaction. + # + # @return [Lithic::Models::ThreeDSAuthentication::Merchant] + required :merchant, -> { Lithic::ThreeDSAuthentication::Merchant } + + # @!attribute message_category + # Either PAYMENT_AUTHENTICATION or NON_PAYMENT_AUTHENTICATION. For + # NON_PAYMENT_AUTHENTICATION, additional_data and transaction fields are not + # populated. + # + # @return [Symbol, Lithic::Models::ThreeDSAuthentication::MessageCategory] + required :message_category, enum: -> { Lithic::ThreeDSAuthentication::MessageCategory } + + # @!attribute three_ds_requestor_challenge_indicator + # Indicates whether a challenge is requested for this transaction + # + # - `NO_PREFERENCE` - No Preference + # - `NO_CHALLENGE_REQUESTED` - No Challenge Requested + # - `CHALLENGE_PREFERENCE` - Challenge requested (3DS Requestor preference) + # - `CHALLENGE_MANDATE` - Challenge requested (Mandate) + # - `NO_CHALLENGE_RISK_ALREADY_ASSESSED` - No Challenge requested (Transactional + # risk analysis is already performed) + # - `DATA_SHARE_ONLY` - No Challenge requested (Data Share Only) + # - `OTHER` - Other indicators not captured by above. These are rarely used + # + # @return [Symbol, Lithic::Models::ThreeDSAuthentication::ThreeDSRequestorChallengeIndicator] + required :three_ds_requestor_challenge_indicator, + enum: -> { Lithic::ThreeDSAuthentication::ThreeDSRequestorChallengeIndicator } + + # @!attribute additional_data + # Object containing additional data about the 3DS request that is beyond the EMV + # 3DS standard spec (e.g., specific fields that only certain card networks send + # but are not required across all 3DS requests). + # + # @return [Lithic::Models::ThreeDSAuthentication::AdditionalData, nil] + optional :additional_data, -> { Lithic::ThreeDSAuthentication::AdditionalData }, nil?: true + + # @!attribute app + # Object containing data about the app used in the e-commerce transaction. Present + # if the channel is 'APP_BASED'. + # + # @return [Lithic::Models::ThreeDSAuthentication::App, nil] + optional :app, -> { Lithic::ThreeDSAuthentication::App }, nil?: true + + # @!attribute authentication_request_type + # Type of authentication request - i.e., the type of transaction or interaction is + # causing the merchant to request an authentication. Maps to EMV 3DS field + # `threeDSRequestorAuthenticationInd`. + # + # @return [Symbol, Lithic::Models::ThreeDSAuthentication::AuthenticationRequestType, nil] + optional :authentication_request_type, + enum: -> { Lithic::ThreeDSAuthentication::AuthenticationRequestType }, + nil?: true + + # @!attribute browser + # Object containing data about the browser used in the e-commerce transaction. + # Present if the channel is 'BROWSER'. + # + # @return [Lithic::Models::ThreeDSAuthentication::Browser, nil] + optional :browser, -> { Lithic::ThreeDSAuthentication::Browser }, nil?: true + + # @!attribute challenge_metadata + # Metadata about the challenge method and delivery. Only present when a challenge + # is triggered. + # + # @return [Lithic::Models::ThreeDSAuthentication::ChallengeMetadata, nil] + optional :challenge_metadata, -> { Lithic::ThreeDSAuthentication::ChallengeMetadata }, nil?: true + + # @!attribute challenge_orchestrated_by + # Entity that orchestrates the challenge. This won't be set for authentications + # for which a decision has not yet been made (e.g. in-flight customer decisioning + # request). + # + # @return [Symbol, Lithic::Models::ThreeDSAuthentication::ChallengeOrchestratedBy, nil] + optional :challenge_orchestrated_by, + enum: -> { Lithic::ThreeDSAuthentication::ChallengeOrchestratedBy }, + nil?: true + + # @!attribute decision_made_by + # Entity that made the authentication decision. This won't be set for + # authentications for which a decision has not yet been made (e.g. in-flight + # customer decisioning request). + # + # @return [Symbol, Lithic::Models::ThreeDSAuthentication::DecisionMadeBy, nil] + optional :decision_made_by, enum: -> { Lithic::ThreeDSAuthentication::DecisionMadeBy }, nil?: true + + # @!attribute three_ri_request_type + # Type of 3DS Requestor Initiated (3RI) request — i.e., a 3DS authentication that + # takes place at the initiation of the merchant rather than the cardholder. The + # most common example of this is where a merchant is authenticating before billing + # for a recurring transaction such as a pay TV subscription or a utility bill. + # Maps to EMV 3DS field `threeRIInd`. + # + # @return [Symbol, Lithic::Models::ThreeDSAuthentication::ThreeRiRequestType, nil] + optional :three_ri_request_type, + enum: -> { Lithic::ThreeDSAuthentication::ThreeRiRequestType }, + nil?: true + + # @!attribute transaction + # Object containing data about the e-commerce transaction for which the merchant + # is requesting authentication. + # + # @return [Lithic::Models::ThreeDSAuthentication::Transaction, nil] + optional :transaction, -> { Lithic::ThreeDSAuthentication::Transaction }, nil?: true + + # @!method initialize(token:, account_type:, authentication_result:, card_expiry_check:, card_token:, cardholder:, channel:, created:, merchant:, message_category:, three_ds_requestor_challenge_indicator:, additional_data: nil, app: nil, authentication_request_type: nil, browser: nil, challenge_metadata: nil, challenge_orchestrated_by: nil, decision_made_by: nil, three_ri_request_type: nil, transaction: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ThreeDSAuthentication} for more details. + # + # Represents a 3DS authentication + # + # @param token [String] Globally unique identifier for the 3DS authentication. Permitted values: 36-digi + # + # @param account_type [Symbol, Lithic::Models::ThreeDSAuthentication::AccountType, nil] Type of account/card that is being used for the transaction. Maps to EMV 3DS fie + # + # @param authentication_result [Symbol, Lithic::Models::ThreeDSAuthentication::AuthenticationResult] Indicates the outcome of the 3DS authentication process. + # + # @param card_expiry_check [Symbol, Lithic::Models::ThreeDSAuthentication::CardExpiryCheck] Indicates whether the expiration date provided by the cardholder during checkout + # + # @param card_token [String] Globally unique identifier for the card on which the 3DS authentication has occu + # + # @param cardholder [Lithic::Models::ThreeDSAuthentication::Cardholder] Object containing data about the cardholder provided during the transaction. + # + # @param channel [Symbol, Lithic::Models::ThreeDSAuthentication::Channel] Channel in which the authentication occurs. Maps to EMV 3DS field `deviceChannel + # + # @param created [Time] Date and time when the authentication was created in Lithic's system. Permitted + # + # @param merchant [Lithic::Models::ThreeDSAuthentication::Merchant] Object containing data about the merchant involved in the e-commerce transaction + # + # @param message_category [Symbol, Lithic::Models::ThreeDSAuthentication::MessageCategory] Either PAYMENT_AUTHENTICATION or NON_PAYMENT_AUTHENTICATION. For NON_PAYMENT_AUT + # + # @param three_ds_requestor_challenge_indicator [Symbol, Lithic::Models::ThreeDSAuthentication::ThreeDSRequestorChallengeIndicator] Indicates whether a challenge is requested for this transaction + # + # @param additional_data [Lithic::Models::ThreeDSAuthentication::AdditionalData, nil] Object containing additional data about the 3DS request that is beyond the EMV 3 + # + # @param app [Lithic::Models::ThreeDSAuthentication::App, nil] Object containing data about the app used in the e-commerce transaction. Present + # + # @param authentication_request_type [Symbol, Lithic::Models::ThreeDSAuthentication::AuthenticationRequestType, nil] Type of authentication request - i.e., the type of transaction or interaction is + # + # @param browser [Lithic::Models::ThreeDSAuthentication::Browser, nil] Object containing data about the browser used in the e-commerce transaction. Pre + # + # @param challenge_metadata [Lithic::Models::ThreeDSAuthentication::ChallengeMetadata, nil] Metadata about the challenge method and delivery. Only present when a challenge + # + # @param challenge_orchestrated_by [Symbol, Lithic::Models::ThreeDSAuthentication::ChallengeOrchestratedBy, nil] Entity that orchestrates the challenge. This won't be set for authentications fo + # + # @param decision_made_by [Symbol, Lithic::Models::ThreeDSAuthentication::DecisionMadeBy, nil] Entity that made the authentication decision. This won't be set for authenticati + # + # @param three_ri_request_type [Symbol, Lithic::Models::ThreeDSAuthentication::ThreeRiRequestType, nil] Type of 3DS Requestor Initiated (3RI) request — i.e., a 3DS authentication that + # + # @param transaction [Lithic::Models::ThreeDSAuthentication::Transaction, nil] Object containing data about the e-commerce transaction for which the merchant i + + # Type of account/card that is being used for the transaction. Maps to EMV 3DS + # field `acctType`. + # + # @see Lithic::Models::ThreeDSAuthentication#account_type + module AccountType + extend Lithic::Internal::Type::Enum + + CREDIT = :CREDIT + DEBIT = :DEBIT + NOT_APPLICABLE = :NOT_APPLICABLE + + # @!method self.values + # @return [Array] + end + + # Indicates the outcome of the 3DS authentication process. + # + # @see Lithic::Models::ThreeDSAuthentication#authentication_result + module AuthenticationResult + extend Lithic::Internal::Type::Enum + + DECLINE = :DECLINE + SUCCESS = :SUCCESS + PENDING_CHALLENGE = :PENDING_CHALLENGE + PENDING_DECISION = :PENDING_DECISION + + # @!method self.values + # @return [Array] + end + + # Indicates whether the expiration date provided by the cardholder during checkout + # matches Lithic's record of the card's expiration date. + # + # @see Lithic::Models::ThreeDSAuthentication#card_expiry_check + module CardExpiryCheck + extend Lithic::Internal::Type::Enum + + MATCH = :MATCH + MISMATCH = :MISMATCH + NOT_PRESENT = :NOT_PRESENT + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::ThreeDSAuthentication#cardholder + class Cardholder < Lithic::Internal::Type::BaseModel + # @!attribute address_match + # Indicates whether the shipping address and billing address provided by the + # cardholder are the same. This value - and assessment of whether the addresses + # match - is provided directly in the 3DS request and is not determined by Lithic. + # Maps to EMV 3DS field `addrMatch`. + # + # @return [Boolean, nil] + optional :address_match, Lithic::Internal::Type::Boolean, nil?: true + + # @!attribute address_on_file_match + # Lithic's evaluation result comparing the transaction's address data with the + # cardholder KYC data if it exists. In the event Lithic does not have any + # Cardholder KYC data, or the transaction does not contain any address data, + # NOT_PRESENT will be returned + # + # @return [Symbol, Lithic::Models::ThreeDSAuthentication::Cardholder::AddressOnFileMatch, nil] + optional :address_on_file_match, + enum: -> { Lithic::ThreeDSAuthentication::Cardholder::AddressOnFileMatch } + + # @!attribute billing_address + # Object containing data on the billing address provided during the transaction. + # + # @return [Lithic::Models::ThreeDSAuthentication::Cardholder::BillingAddress, nil] + optional :billing_address, -> { Lithic::ThreeDSAuthentication::Cardholder::BillingAddress } + + # @!attribute email + # Email address that is either provided by the cardholder or is on file with the + # merchant in a 3RI request. Maps to EMV 3DS field `email`. + # + # @return [String, nil] + optional :email, String, nil?: true + + # @!attribute name + # Name of the cardholder. Maps to EMV 3DS field `cardholderName`. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!attribute phone_number_home + # Home phone number in E.164 format provided by the cardholder. Maps to EMV 3DS + # fields `homePhone.cc` and `homePhone.subscriber`. + # + # @return [String, nil] + optional :phone_number_home, String, nil?: true + + # @!attribute phone_number_mobile + # Mobile/cell phone number in E.164 format provided by the cardholder. Maps to EMV + # 3DS fields `mobilePhone.cc` and `mobilePhone.subscriber`. + # + # @return [String, nil] + optional :phone_number_mobile, String, nil?: true + + # @!attribute phone_number_work + # Work phone number in E.164 format provided by the cardholder. Maps to EMV 3DS + # fields `workPhone.cc` and `workPhone.subscriber`. + # + # @return [String, nil] + optional :phone_number_work, String, nil?: true + + # @!attribute shipping_address + # Object containing data on the shipping address provided during the transaction. + # + # @return [Lithic::Models::ThreeDSAuthentication::Cardholder::ShippingAddress, nil] + optional :shipping_address, -> { Lithic::ThreeDSAuthentication::Cardholder::ShippingAddress } + + # @!method initialize(address_match: nil, address_on_file_match: nil, billing_address: nil, email: nil, name: nil, phone_number_home: nil, phone_number_mobile: nil, phone_number_work: nil, shipping_address: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ThreeDSAuthentication::Cardholder} for more details. + # + # Object containing data about the cardholder provided during the transaction. + # + # @param address_match [Boolean, nil] Indicates whether the shipping address and billing address provided by the cardh + # + # @param address_on_file_match [Symbol, Lithic::Models::ThreeDSAuthentication::Cardholder::AddressOnFileMatch] Lithic's evaluation result comparing the transaction's address data with the car + # + # @param billing_address [Lithic::Models::ThreeDSAuthentication::Cardholder::BillingAddress] Object containing data on the billing address provided during the transaction. + # + # @param email [String, nil] Email address that is either provided by the cardholder or is on file with the m + # + # @param name [String, nil] Name of the cardholder. Maps to EMV 3DS field `cardholderName`. + # + # @param phone_number_home [String, nil] Home phone number in E.164 format provided by the cardholder. Maps to EMV 3DS fi + # + # @param phone_number_mobile [String, nil] Mobile/cell phone number in E.164 format provided by the cardholder. Maps to EMV + # + # @param phone_number_work [String, nil] Work phone number in E.164 format provided by the cardholder. Maps to EMV 3DS fi + # + # @param shipping_address [Lithic::Models::ThreeDSAuthentication::Cardholder::ShippingAddress] Object containing data on the shipping address provided during the transaction. + + # Lithic's evaluation result comparing the transaction's address data with the + # cardholder KYC data if it exists. In the event Lithic does not have any + # Cardholder KYC data, or the transaction does not contain any address data, + # NOT_PRESENT will be returned + # + # @see Lithic::Models::ThreeDSAuthentication::Cardholder#address_on_file_match + module AddressOnFileMatch + extend Lithic::Internal::Type::Enum + + MATCH = :MATCH + MATCH_ADDRESS_ONLY = :MATCH_ADDRESS_ONLY + MATCH_ZIP_ONLY = :MATCH_ZIP_ONLY + MISMATCH = :MISMATCH + NOT_PRESENT = :NOT_PRESENT + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::ThreeDSAuthentication::Cardholder#billing_address + class BillingAddress < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # First line of the street address provided by the cardholder. + # + # @return [String, nil] + optional :address1, String, nil?: true + + # @!attribute address2 + # Second line of the street address provided by the cardholder. + # + # @return [String, nil] + optional :address2, String, nil?: true + + # @!attribute address3 + # Third line of the street address provided by the cardholder. + # + # @return [String, nil] + optional :address3, String, nil?: true + + # @!attribute city + # City of the address provided by the cardholder. + # + # @return [String, nil] + optional :city, String, nil?: true + + # @!attribute country + # Country of the address provided by the cardholder in ISO 3166-1 alpha-3 format + # (e.g. USA) + # + # @return [String, nil] + optional :country, String, nil?: true + + # @!attribute postal_code + # Postal code (e.g., ZIP code) of the address provided by the cardholder + # + # @return [String, nil] + optional :postal_code, String, nil?: true + + # @!method initialize(address1: nil, address2: nil, address3: nil, city: nil, country: nil, postal_code: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ThreeDSAuthentication::Cardholder::BillingAddress} for more + # details. + # + # Object containing data on the billing address provided during the transaction. + # + # @param address1 [String, nil] First line of the street address provided by the cardholder. + # + # @param address2 [String, nil] Second line of the street address provided by the cardholder. + # + # @param address3 [String, nil] Third line of the street address provided by the cardholder. + # + # @param city [String, nil] City of the address provided by the cardholder. + # + # @param country [String, nil] Country of the address provided by the cardholder in ISO 3166-1 alpha-3 format ( + # + # @param postal_code [String, nil] Postal code (e.g., ZIP code) of the address provided by the cardholder + end + + # @see Lithic::Models::ThreeDSAuthentication::Cardholder#shipping_address + class ShippingAddress < Lithic::Internal::Type::BaseModel + # @!attribute address1 + # First line of the street address provided by the cardholder. + # + # @return [String, nil] + optional :address1, String, nil?: true + + # @!attribute address2 + # Second line of the street address provided by the cardholder. + # + # @return [String, nil] + optional :address2, String, nil?: true + + # @!attribute address3 + # Third line of the street address provided by the cardholder. + # + # @return [String, nil] + optional :address3, String, nil?: true + + # @!attribute city + # City of the address provided by the cardholder. + # + # @return [String, nil] + optional :city, String, nil?: true + + # @!attribute country + # Country of the address provided by the cardholder in ISO 3166-1 alpha-3 format + # (e.g. USA) + # + # @return [String, nil] + optional :country, String, nil?: true + + # @!attribute postal_code + # Postal code (e.g., ZIP code) of the address provided by the cardholder + # + # @return [String, nil] + optional :postal_code, String, nil?: true + + # @!method initialize(address1: nil, address2: nil, address3: nil, city: nil, country: nil, postal_code: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ThreeDSAuthentication::Cardholder::ShippingAddress} for more + # details. + # + # Object containing data on the shipping address provided during the transaction. + # + # @param address1 [String, nil] First line of the street address provided by the cardholder. + # + # @param address2 [String, nil] Second line of the street address provided by the cardholder. + # + # @param address3 [String, nil] Third line of the street address provided by the cardholder. + # + # @param city [String, nil] City of the address provided by the cardholder. + # + # @param country [String, nil] Country of the address provided by the cardholder in ISO 3166-1 alpha-3 format ( + # + # @param postal_code [String, nil] Postal code (e.g., ZIP code) of the address provided by the cardholder + end + end + + # Channel in which the authentication occurs. Maps to EMV 3DS field + # `deviceChannel`. + # + # @see Lithic::Models::ThreeDSAuthentication#channel + module Channel + extend Lithic::Internal::Type::Enum + + APP_BASED = :APP_BASED + BROWSER = :BROWSER + THREE_DS_REQUESTOR_INITIATED = :THREE_DS_REQUESTOR_INITIATED + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::ThreeDSAuthentication#merchant + class Merchant < Lithic::Internal::Type::BaseModel + # @!attribute risk_indicator + # Object containing additional data indicating additional risk factors related to + # the e-commerce transaction. + # + # @return [Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator] + required :risk_indicator, -> { Lithic::ThreeDSAuthentication::Merchant::RiskIndicator } + + # @!attribute id + # Merchant identifier as assigned by the acquirer. Maps to EMV 3DS field + # `acquirerMerchantId`. May not be present for non-payment authentications. + # + # @return [String, nil] + optional :id, String, nil?: true + + # @!attribute country + # Country code of the merchant requesting 3DS authentication. Maps to EMV 3DS + # field `merchantCountryCode`. Permitted values: ISO 3166-1 alpha-3 country code + # (e.g., USA). May not be present for non-payment authentications. + # + # @return [String, nil] + optional :country, String, nil?: true + + # @!attribute mcc + # Merchant category code assigned to the merchant that describes its business + # activity type. Maps to EMV 3DS field `mcc`. May not be present for non-payment + # authentications. + # + # @return [String, nil] + optional :mcc, String, nil?: true + + # @!attribute name + # Name of the merchant. Maps to EMV 3DS field `merchantName`. May not be present + # for non-payment authentications. + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!method initialize(risk_indicator:, id: nil, country: nil, mcc: nil, name: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ThreeDSAuthentication::Merchant} for more details. + # + # Object containing data about the merchant involved in the e-commerce + # transaction. + # + # @param risk_indicator [Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator] Object containing additional data indicating additional risk factors related to + # + # @param id [String, nil] Merchant identifier as assigned by the acquirer. Maps to EMV 3DS field `acquirer + # + # @param country [String, nil] Country code of the merchant requesting 3DS authentication. Maps to EMV 3DS fiel + # + # @param mcc [String, nil] Merchant category code assigned to the merchant that describes its business acti + # + # @param name [String, nil] Name of the merchant. Maps to EMV 3DS field `merchantName`. May not be present f + + # @see Lithic::Models::ThreeDSAuthentication::Merchant#risk_indicator + class RiskIndicator < Lithic::Internal::Type::BaseModel + # @!attribute delivery_email_address + # In transactions with electronic delivery, email address to which merchandise is + # delivered. Maps to EMV 3DS field `deliveryEmailAddress`. + # + # @return [String, nil] + optional :delivery_email_address, String, nil?: true + + # @!attribute delivery_time_frame + # The delivery time frame for the merchandise. Maps to EMV 3DS field + # `deliveryTimeframe`. + # + # @return [Symbol, Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator::DeliveryTimeFrame, nil] + optional :delivery_time_frame, + enum: -> { Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::DeliveryTimeFrame }, + nil?: true + + # @!attribute gift_card_amount + # In prepaid or gift card purchase transactions, purchase amount total in major + # units (e.g., a purchase of USD $205.10 would be 205). Maps to EMV 3DS field + # `giftCardAmount`. + # + # @return [Integer, nil] + optional :gift_card_amount, Integer, nil?: true + + # @!attribute gift_card_count + # In prepaid or gift card purchase transactions, count of individual prepaid or + # gift cards/codes purchased. Maps to EMV 3DS field `giftCardCount`. + # + # @return [Integer, nil] + optional :gift_card_count, Integer, nil?: true + + # @!attribute gift_card_currency + # In prepaid or gift card purchase transactions, currency code of the gift card. + # Maps to EMV 3DS field `giftCardCurr`. Permitted values: ISO 4217 three-character + # currency code (e.g., USD). + # + # @return [String, nil] + optional :gift_card_currency, String, nil?: true + + # @!attribute order_availability + # Indicates whether the purchase is for merchandise that is available now or at a + # future date. Maps to EMV 3DS field `preOrderPurchaseInd`. + # + # @return [Symbol, Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator::OrderAvailability, nil] + optional :order_availability, + enum: -> { Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::OrderAvailability }, + nil?: true + + # @!attribute pre_order_available_date + # In pre-order purchase transactions, the expected date that the merchandise will + # be available. Maps to EMV 3DS field `preOrderDate`. Permitted values: Date + # string in the ISO 8601 format yyyy-MM-dd'T'hh:mm:ssZ + # + # @return [Time, nil] + optional :pre_order_available_date, Time, nil?: true + + # @!attribute reorder_items + # Indicates whether the cardholder is reordering previously purchased merchandise. + # Maps to EMV 3DS field `reorderItemsInd`. + # + # @return [Symbol, Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator::ReorderItems, nil] + optional :reorder_items, + enum: -> { Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::ReorderItems }, + nil?: true + + # @!attribute shipping_method + # Shipping method that the cardholder chose for the transaction. If purchase + # includes one or more item, this indicator is used for the physical goods; if the + # purchase only includes digital goods, this indicator is used to describe the + # most expensive item purchased. Maps to EMV 3DS field `shipIndicator`. + # + # @return [Symbol, Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator::ShippingMethod, nil] + optional :shipping_method, + enum: -> { Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::ShippingMethod }, + nil?: true + + # @!method initialize(delivery_email_address: nil, delivery_time_frame: nil, gift_card_amount: nil, gift_card_count: nil, gift_card_currency: nil, order_availability: nil, pre_order_available_date: nil, reorder_items: nil, shipping_method: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator} for more + # details. + # + # Object containing additional data indicating additional risk factors related to + # the e-commerce transaction. + # + # @param delivery_email_address [String, nil] In transactions with electronic delivery, email address to which merchandise is + # + # @param delivery_time_frame [Symbol, Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator::DeliveryTimeFrame, nil] The delivery time frame for the merchandise. Maps to EMV 3DS field `deliveryTime + # + # @param gift_card_amount [Integer, nil] In prepaid or gift card purchase transactions, purchase amount total in major un + # + # @param gift_card_count [Integer, nil] In prepaid or gift card purchase transactions, count of individual prepaid or gi + # + # @param gift_card_currency [String, nil] In prepaid or gift card purchase transactions, currency code of the gift card. M + # + # @param order_availability [Symbol, Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator::OrderAvailability, nil] Indicates whether the purchase is for merchandise that is available now or at a + # + # @param pre_order_available_date [Time, nil] In pre-order purchase transactions, the expected date that the merchandise will + # + # @param reorder_items [Symbol, Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator::ReorderItems, nil] Indicates whether the cardholder is reordering previously purchased merchandise. + # + # @param shipping_method [Symbol, Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator::ShippingMethod, nil] Shipping method that the cardholder chose for the transaction. If purchase inclu + + # The delivery time frame for the merchandise. Maps to EMV 3DS field + # `deliveryTimeframe`. + # + # @see Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator#delivery_time_frame + module DeliveryTimeFrame + extend Lithic::Internal::Type::Enum + + ELECTRONIC_DELIVERY = :ELECTRONIC_DELIVERY + OVERNIGHT_SHIPPING = :OVERNIGHT_SHIPPING + SAME_DAY_SHIPPING = :SAME_DAY_SHIPPING + TWO_DAY_OR_MORE_SHIPPING = :TWO_DAY_OR_MORE_SHIPPING + + # @!method self.values + # @return [Array] + end + + # Indicates whether the purchase is for merchandise that is available now or at a + # future date. Maps to EMV 3DS field `preOrderPurchaseInd`. + # + # @see Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator#order_availability + module OrderAvailability + extend Lithic::Internal::Type::Enum + + FUTURE_AVAILABILITY = :FUTURE_AVAILABILITY + MERCHANDISE_AVAILABLE = :MERCHANDISE_AVAILABLE + + # @!method self.values + # @return [Array] + end + + # Indicates whether the cardholder is reordering previously purchased merchandise. + # Maps to EMV 3DS field `reorderItemsInd`. + # + # @see Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator#reorder_items + module ReorderItems + extend Lithic::Internal::Type::Enum + + FIRST_TIME_ORDERED = :FIRST_TIME_ORDERED + REORDERED = :REORDERED + + # @!method self.values + # @return [Array] + end + + # Shipping method that the cardholder chose for the transaction. If purchase + # includes one or more item, this indicator is used for the physical goods; if the + # purchase only includes digital goods, this indicator is used to describe the + # most expensive item purchased. Maps to EMV 3DS field `shipIndicator`. + # + # @see Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator#shipping_method + module ShippingMethod + extend Lithic::Internal::Type::Enum + + DIGITAL_GOODS = :DIGITAL_GOODS + LOCKER_DELIVERY = :LOCKER_DELIVERY + OTHER = :OTHER + PICK_UP_AND_GO_DELIVERY = :PICK_UP_AND_GO_DELIVERY + SHIP_TO_BILLING_ADDRESS = :SHIP_TO_BILLING_ADDRESS + SHIP_TO_NON_BILLING_ADDRESS = :SHIP_TO_NON_BILLING_ADDRESS + SHIP_TO_OTHER_VERIFIED_ADDRESS = :SHIP_TO_OTHER_VERIFIED_ADDRESS + SHIP_TO_STORE = :SHIP_TO_STORE + TRAVEL_AND_EVENT_TICKETS = :TRAVEL_AND_EVENT_TICKETS + + # @!method self.values + # @return [Array] + end + end + end + + # Either PAYMENT_AUTHENTICATION or NON_PAYMENT_AUTHENTICATION. For + # NON_PAYMENT_AUTHENTICATION, additional_data and transaction fields are not + # populated. + # + # @see Lithic::Models::ThreeDSAuthentication#message_category + module MessageCategory + extend Lithic::Internal::Type::Enum + + NON_PAYMENT_AUTHENTICATION = :NON_PAYMENT_AUTHENTICATION + PAYMENT_AUTHENTICATION = :PAYMENT_AUTHENTICATION + + # @!method self.values + # @return [Array] + end + + # Indicates whether a challenge is requested for this transaction + # + # - `NO_PREFERENCE` - No Preference + # - `NO_CHALLENGE_REQUESTED` - No Challenge Requested + # - `CHALLENGE_PREFERENCE` - Challenge requested (3DS Requestor preference) + # - `CHALLENGE_MANDATE` - Challenge requested (Mandate) + # - `NO_CHALLENGE_RISK_ALREADY_ASSESSED` - No Challenge requested (Transactional + # risk analysis is already performed) + # - `DATA_SHARE_ONLY` - No Challenge requested (Data Share Only) + # - `OTHER` - Other indicators not captured by above. These are rarely used + # + # @see Lithic::Models::ThreeDSAuthentication#three_ds_requestor_challenge_indicator + module ThreeDSRequestorChallengeIndicator + extend Lithic::Internal::Type::Enum + + NO_PREFERENCE = :NO_PREFERENCE + NO_CHALLENGE_REQUESTED = :NO_CHALLENGE_REQUESTED + CHALLENGE_PREFERENCE = :CHALLENGE_PREFERENCE + CHALLENGE_MANDATE = :CHALLENGE_MANDATE + NO_CHALLENGE_RISK_ALREADY_ASSESSED = :NO_CHALLENGE_RISK_ALREADY_ASSESSED + DATA_SHARE_ONLY = :DATA_SHARE_ONLY + OTHER = :OTHER + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::ThreeDSAuthentication#additional_data + class AdditionalData < Lithic::Internal::Type::BaseModel + # @!attribute network_decision + # Mastercard only: Indicates whether the network would have considered the + # authentication request to be low risk or not. + # + # @return [Symbol, Lithic::Models::ThreeDSAuthentication::AdditionalData::NetworkDecision, nil] + optional :network_decision, + enum: -> { Lithic::ThreeDSAuthentication::AdditionalData::NetworkDecision }, + nil?: true + + # @!attribute network_risk_score + # Mastercard only: Assessment by the network of the authentication risk level, + # with a higher value indicating a higher amount of risk. Permitted values: + # Integer between 0-950, in increments of 50. + # + # @return [Integer, nil] + optional :network_risk_score, Integer, nil?: true + + # @!method initialize(network_decision: nil, network_risk_score: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ThreeDSAuthentication::AdditionalData} for more details. + # + # Object containing additional data about the 3DS request that is beyond the EMV + # 3DS standard spec (e.g., specific fields that only certain card networks send + # but are not required across all 3DS requests). + # + # @param network_decision [Symbol, Lithic::Models::ThreeDSAuthentication::AdditionalData::NetworkDecision, nil] Mastercard only: Indicates whether the network would have considered the authent + # + # @param network_risk_score [Integer, nil] Mastercard only: Assessment by the network of the authentication risk level, wit + + # Mastercard only: Indicates whether the network would have considered the + # authentication request to be low risk or not. + # + # @see Lithic::Models::ThreeDSAuthentication::AdditionalData#network_decision + module NetworkDecision + extend Lithic::Internal::Type::Enum + + LOW_RISK = :LOW_RISK + NOT_LOW_RISK = :NOT_LOW_RISK + + # @!method self.values + # @return [Array] + end + end + + # @see Lithic::Models::ThreeDSAuthentication#app + class App < Lithic::Internal::Type::BaseModel + # @!attribute device + # Device model: e.g. "Apple iPhone 16". + # + # @return [String, nil] + optional :device, String, nil?: true + + # @!attribute device_info + # Raw device information - base64-encoded JSON object. Maps to EMV 3DS field + # `deviceInfo`. + # + # @return [String, nil] + optional :device_info, String, nil?: true + + # @!attribute ip + # IP address of the device. + # + # @return [String, nil] + optional :ip, String + + # @!attribute latitude + # Latitude coordinate of current device location. + # + # @return [Float, nil] + optional :latitude, Float, nil?: true + + # @!attribute locale + # Device locale: e.g. "en-US". + # + # @return [String, nil] + optional :locale, String, nil?: true + + # @!attribute longitude + # Longitude coordinate of current device location. + # + # @return [Float, nil] + optional :longitude, Float, nil?: true + + # @!attribute os + # Operating System: e.g. "Android 12", "iOS 17.1". + # + # @return [String, nil] + optional :os, String, nil?: true + + # @!attribute platform + # Device platform: Android, iOS, Windows, etc. + # + # @return [String, nil] + optional :platform, String, nil?: true + + # @!attribute screen_height + # Screen height in pixels. + # + # @return [Integer, nil] + optional :screen_height, Integer, nil?: true + + # @!attribute screen_width + # Screen width in pixels. + # + # @return [Integer, nil] + optional :screen_width, Integer, nil?: true + + # @!attribute time_zone + # Time zone offset in minutes between UTC and device local time. + # + # @return [String, nil] + optional :time_zone, String, nil?: true + + # @!method initialize(device: nil, device_info: nil, ip: nil, latitude: nil, locale: nil, longitude: nil, os: nil, platform: nil, screen_height: nil, screen_width: nil, time_zone: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ThreeDSAuthentication::App} for more details. + # + # Object containing data about the app used in the e-commerce transaction. Present + # if the channel is 'APP_BASED'. + # + # @param device [String, nil] Device model: e.g. "Apple iPhone 16". + # + # @param device_info [String, nil] Raw device information - base64-encoded JSON object. Maps to EMV 3DS field `devi + # + # @param ip [String] IP address of the device. + # + # @param latitude [Float, nil] Latitude coordinate of current device location. + # + # @param locale [String, nil] Device locale: e.g. "en-US". + # + # @param longitude [Float, nil] Longitude coordinate of current device location. + # + # @param os [String, nil] Operating System: e.g. "Android 12", "iOS 17.1". + # + # @param platform [String, nil] Device platform: Android, iOS, Windows, etc. + # + # @param screen_height [Integer, nil] Screen height in pixels. + # + # @param screen_width [Integer, nil] Screen width in pixels. + # + # @param time_zone [String, nil] Time zone offset in minutes between UTC and device local time. + end + + # Type of authentication request - i.e., the type of transaction or interaction is + # causing the merchant to request an authentication. Maps to EMV 3DS field + # `threeDSRequestorAuthenticationInd`. + # + # @see Lithic::Models::ThreeDSAuthentication#authentication_request_type + module AuthenticationRequestType + extend Lithic::Internal::Type::Enum + + ADD_CARD = :ADD_CARD + BILLING_AGREEMENT = :BILLING_AGREEMENT + DELAYED_SHIPMENT = :DELAYED_SHIPMENT + EMV_TOKEN_CARDHOLDER_VERIFICATION = :EMV_TOKEN_CARDHOLDER_VERIFICATION + INSTALLMENT_TRANSACTION = :INSTALLMENT_TRANSACTION + MAINTAIN_CARD = :MAINTAIN_CARD + PAYMENT_TRANSACTION = :PAYMENT_TRANSACTION + RECURRING_TRANSACTION = :RECURRING_TRANSACTION + SPLIT_PAYMENT = :SPLIT_PAYMENT + SPLIT_SHIPMENT = :SPLIT_SHIPMENT + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::ThreeDSAuthentication#browser + class Browser < Lithic::Internal::Type::BaseModel + # @!attribute accept_header + # Content of the HTTP accept headers as sent from the cardholder's browser to the + # 3DS requestor (e.g., merchant or digital wallet). + # + # @return [String, nil] + optional :accept_header, String, nil?: true + + # @!attribute ip + # IP address of the browser as returned by the HTTP headers to the 3DS requestor + # (e.g., merchant or digital wallet). Maps to EMV 3DS field `browserIP`. + # + # @return [String, nil] + optional :ip, String, nil?: true + + # @!attribute java_enabled + # Indicates whether the cardholder's browser has the ability to execute Java. Maps + # to EMV 3DS field `browserJavaEnabled`. + # + # @return [Boolean, nil] + optional :java_enabled, Lithic::Internal::Type::Boolean, nil?: true + + # @!attribute javascript_enabled + # Indicates whether the cardholder's browser has the ability to execute + # JavaScript. Maps to EMV 3DS field `browserJavascriptEnabled`. + # + # @return [Boolean, nil] + optional :javascript_enabled, Lithic::Internal::Type::Boolean, nil?: true + + # @!attribute language + # Language of the cardholder's browser as defined in IETF BCP47. Maps to EMV 3DS + # field `browserLanguage`. + # + # @return [String, nil] + optional :language, String, nil?: true + + # @!attribute time_zone + # Time zone offset in minutes between UTC and browser local time. Maps to EMV 3DS + # field `browserTz`. + # + # @return [String, nil] + optional :time_zone, String, nil?: true + + # @!attribute user_agent + # Content of the HTTP user-agent header. Maps to EMV 3DS field `browserUserAgent`. + # + # @return [String, nil] + optional :user_agent, String, nil?: true + + # @!method initialize(accept_header: nil, ip: nil, java_enabled: nil, javascript_enabled: nil, language: nil, time_zone: nil, user_agent: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ThreeDSAuthentication::Browser} for more details. + # + # Object containing data about the browser used in the e-commerce transaction. + # Present if the channel is 'BROWSER'. + # + # @param accept_header [String, nil] Content of the HTTP accept headers as sent from the cardholder's browser to the + # + # @param ip [String, nil] IP address of the browser as returned by the HTTP headers to the 3DS requestor ( + # + # @param java_enabled [Boolean, nil] Indicates whether the cardholder's browser has the ability to execute Java. Maps + # + # @param javascript_enabled [Boolean, nil] Indicates whether the cardholder's browser has the ability to execute JavaScript + # + # @param language [String, nil] Language of the cardholder's browser as defined in IETF BCP47. Maps to EMV 3DS f + # + # @param time_zone [String, nil] Time zone offset in minutes between UTC and browser local time. Maps to EMV 3DS + # + # @param user_agent [String, nil] Content of the HTTP user-agent header. Maps to EMV 3DS field `browserUserAgent`. + end + + # @see Lithic::Models::ThreeDSAuthentication#challenge_metadata + class ChallengeMetadata < Lithic::Internal::Type::BaseModel + # @!attribute method_type + # The type of challenge method used for authentication. + # + # @return [Symbol, Lithic::Models::ThreeDSAuthentication::ChallengeMetadata::MethodType] + required :method_type, enum: -> { Lithic::ThreeDSAuthentication::ChallengeMetadata::MethodType } + + # @!attribute status + # Indicates the status of the challenge + # + # - SUCCESS - Cardholder completed the challenge successfully + # - PENDING - Challenge was issued to the cardholder and was not completed yet + # - SMS_DELIVERY_FAILED - Lithic confirmed undeliverability of the SMS to the + # provided phone number. Relevant only for SMS_OTP method + # - CARDHOLDER_TIMEOUT - Cardholder failed to complete the challenge within the + # given challenge TTL + # - CANCELED_VIA_CHALLENGE_UI - Cardholder canceled the challenge by selecting + # "cancel" on the challenge UI + # - CANCELED_OOB - Cardholder canceled the challenge out of band + # - ATTEMPTS_EXCEEDED - Cardholder failed the challenge by either entering an + # incorrect OTP more than the allowed number of times or requesting a new OTP + # more than the allowed number of times + # - ABORTED - Merchant aborted authentication after a challenge was requested + # - ERROR - The challenge failed for a reason different than those documented + # + # @return [Symbol, Lithic::Models::ThreeDSAuthentication::ChallengeMetadata::Status] + required :status, enum: -> { Lithic::ThreeDSAuthentication::ChallengeMetadata::Status } + + # @!attribute phone_number + # The phone number used for delivering the OTP. Relevant only for SMS_OTP method. + # + # @return [String, nil] + optional :phone_number, String, nil?: true + + # @!method initialize(method_type:, status:, phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ThreeDSAuthentication::ChallengeMetadata} for more details. + # + # Metadata about the challenge method and delivery. Only present when a challenge + # is triggered. + # + # @param method_type [Symbol, Lithic::Models::ThreeDSAuthentication::ChallengeMetadata::MethodType] The type of challenge method used for authentication. + # + # @param status [Symbol, Lithic::Models::ThreeDSAuthentication::ChallengeMetadata::Status] Indicates the status of the challenge + # + # @param phone_number [String, nil] The phone number used for delivering the OTP. Relevant only for SMS_OTP method. + + # The type of challenge method used for authentication. + # + # @see Lithic::Models::ThreeDSAuthentication::ChallengeMetadata#method_type + module MethodType + extend Lithic::Internal::Type::Enum + + SMS_OTP = :SMS_OTP + OUT_OF_BAND = :OUT_OF_BAND + + # @!method self.values + # @return [Array] + end + + # Indicates the status of the challenge + # + # - SUCCESS - Cardholder completed the challenge successfully + # - PENDING - Challenge was issued to the cardholder and was not completed yet + # - SMS_DELIVERY_FAILED - Lithic confirmed undeliverability of the SMS to the + # provided phone number. Relevant only for SMS_OTP method + # - CARDHOLDER_TIMEOUT - Cardholder failed to complete the challenge within the + # given challenge TTL + # - CANCELED_VIA_CHALLENGE_UI - Cardholder canceled the challenge by selecting + # "cancel" on the challenge UI + # - CANCELED_OOB - Cardholder canceled the challenge out of band + # - ATTEMPTS_EXCEEDED - Cardholder failed the challenge by either entering an + # incorrect OTP more than the allowed number of times or requesting a new OTP + # more than the allowed number of times + # - ABORTED - Merchant aborted authentication after a challenge was requested + # - ERROR - The challenge failed for a reason different than those documented + # + # @see Lithic::Models::ThreeDSAuthentication::ChallengeMetadata#status + module Status + extend Lithic::Internal::Type::Enum + + SUCCESS = :SUCCESS + PENDING = :PENDING + SMS_DELIVERY_FAILED = :SMS_DELIVERY_FAILED + CARDHOLDER_TIMEOUT = :CARDHOLDER_TIMEOUT + CANCELED_VIA_CHALLENGE_UI = :CANCELED_VIA_CHALLENGE_UI + CANCELED_OOB = :CANCELED_OOB + ATTEMPTS_EXCEEDED = :ATTEMPTS_EXCEEDED + ABORTED = :ABORTED + ERROR = :ERROR + + # @!method self.values + # @return [Array] + end + end + + # Entity that orchestrates the challenge. This won't be set for authentications + # for which a decision has not yet been made (e.g. in-flight customer decisioning + # request). + # + # @see Lithic::Models::ThreeDSAuthentication#challenge_orchestrated_by + module ChallengeOrchestratedBy + extend Lithic::Internal::Type::Enum + + LITHIC = :LITHIC + CUSTOMER = :CUSTOMER + NO_CHALLENGE = :NO_CHALLENGE + + # @!method self.values + # @return [Array] + end + + # Entity that made the authentication decision. This won't be set for + # authentications for which a decision has not yet been made (e.g. in-flight + # customer decisioning request). + # + # @see Lithic::Models::ThreeDSAuthentication#decision_made_by + module DecisionMadeBy + extend Lithic::Internal::Type::Enum + + LITHIC_RULES = :LITHIC_RULES + LITHIC_DEFAULT = :LITHIC_DEFAULT + CUSTOMER_RULES = :CUSTOMER_RULES + CUSTOMER_ENDPOINT = :CUSTOMER_ENDPOINT + NETWORK = :NETWORK + UNKNOWN = :UNKNOWN + + # @!method self.values + # @return [Array] + end + + # Type of 3DS Requestor Initiated (3RI) request — i.e., a 3DS authentication that + # takes place at the initiation of the merchant rather than the cardholder. The + # most common example of this is where a merchant is authenticating before billing + # for a recurring transaction such as a pay TV subscription or a utility bill. + # Maps to EMV 3DS field `threeRIInd`. + # + # @see Lithic::Models::ThreeDSAuthentication#three_ri_request_type + module ThreeRiRequestType + extend Lithic::Internal::Type::Enum + + ACCOUNT_VERIFICATION = :ACCOUNT_VERIFICATION + ADD_CARD = :ADD_CARD + BILLING_AGREEMENT = :BILLING_AGREEMENT + CARD_SECURITY_CODE_STATUS_CHECK = :CARD_SECURITY_CODE_STATUS_CHECK + DELAYED_SHIPMENT = :DELAYED_SHIPMENT + DEVICE_BINDING_STATUS_CHECK = :DEVICE_BINDING_STATUS_CHECK + INSTALLMENT_TRANSACTION = :INSTALLMENT_TRANSACTION + MAIL_ORDER = :MAIL_ORDER + MAINTAIN_CARD_INFO = :MAINTAIN_CARD_INFO + OTHER_PAYMENT = :OTHER_PAYMENT + RECURRING_TRANSACTION = :RECURRING_TRANSACTION + SPLIT_PAYMENT = :SPLIT_PAYMENT + SPLIT_SHIPMENT = :SPLIT_SHIPMENT + TELEPHONE_ORDER = :TELEPHONE_ORDER + TOP_UP = :TOP_UP + TRUST_LIST_STATUS_CHECK = :TRUST_LIST_STATUS_CHECK + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::ThreeDSAuthentication#transaction + class Transaction < Lithic::Internal::Type::BaseModel + # @!attribute amount + # Amount of the purchase in minor units of currency with all punctuation removed. + # Maps to EMV 3DS field `purchaseAmount`. + # + # @return [Float] + required :amount, Float + + # @!attribute cardholder_amount + # Approximate amount of the purchase in minor units of cardholder currency. + # Derived from `amount` using a daily conversion rate. + # + # @return [Float, nil] + required :cardholder_amount, Float, nil?: true + + # @!attribute currency + # Currency of the purchase. Maps to EMV 3DS field `purchaseCurrency`. Permitted + # values: ISO 4217 three-character currency code (e.g., USD). + # + # @return [String] + required :currency, String + + # @!attribute currency_exponent + # Minor units of currency, as specified in ISO 4217 currency exponent. Maps to EMV + # 3DS field `purchaseExponent`. + # + # @return [Float] + required :currency_exponent, Float + + # @!attribute date_time + # Date and time when the authentication was generated by the merchant/acquirer's + # 3DS server. Maps to EMV 3DS field `purchaseDate`. Permitted values: Date string + # in the ISO 8601 format yyyy-MM-dd'T'hh:mm:ssZ. + # + # @return [Time] + required :date_time, Time + + # @!attribute type + # Type of the transaction for which a 3DS authentication request is occurring. + # Maps to EMV 3DS field `transType`. + # + # @return [Symbol, Lithic::Models::ThreeDSAuthentication::Transaction::Type, nil] + required :type, enum: -> { Lithic::ThreeDSAuthentication::Transaction::Type }, nil?: true + + # @!method initialize(amount:, cardholder_amount:, currency:, currency_exponent:, date_time:, type:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ThreeDSAuthentication::Transaction} for more details. + # + # Object containing data about the e-commerce transaction for which the merchant + # is requesting authentication. + # + # @param amount [Float] Amount of the purchase in minor units of currency with all punctuation removed. + # + # @param cardholder_amount [Float, nil] Approximate amount of the purchase in minor units of cardholder currency. Derive + # + # @param currency [String] Currency of the purchase. Maps to EMV 3DS field `purchaseCurrency`. Permitted va + # + # @param currency_exponent [Float] Minor units of currency, as specified in ISO 4217 currency exponent. Maps to EMV + # + # @param date_time [Time] Date and time when the authentication was generated by the merchant/acquirer's 3 + # + # @param type [Symbol, Lithic::Models::ThreeDSAuthentication::Transaction::Type, nil] Type of the transaction for which a 3DS authentication request is occurring. Map + + # Type of the transaction for which a 3DS authentication request is occurring. + # Maps to EMV 3DS field `transType`. + # + # @see Lithic::Models::ThreeDSAuthentication::Transaction#type + module Type + extend Lithic::Internal::Type::Enum + + ACCOUNT_FUNDING = :ACCOUNT_FUNDING + CHECK_ACCEPTANCE = :CHECK_ACCEPTANCE + GOODS_SERVICE_PURCHASE = :GOODS_SERVICE_PURCHASE + PREPAID_ACTIVATION_AND_LOAD = :PREPAID_ACTIVATION_AND_LOAD + QUASI_CASH_TRANSACTION = :QUASI_CASH_TRANSACTION + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/three_ds_authentication_approval_request_webhook_event.rb b/lib/lithic/models/three_ds_authentication_approval_request_webhook_event.rb new file mode 100644 index 00000000..bd27f983 --- /dev/null +++ b/lib/lithic/models/three_ds_authentication_approval_request_webhook_event.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ThreeDSAuthenticationApprovalRequestWebhookEvent < Lithic::Models::ThreeDSAuthentication + # @!attribute event_type + # + # @return [Symbol, :"three_ds_authentication.approval_request"] + required :event_type, const: :"three_ds_authentication.approval_request" + + # @!method initialize(event_type: :"three_ds_authentication.approval_request") + # Represents a 3DS authentication + # + # @param event_type [Symbol, :"three_ds_authentication.approval_request"] + end + end +end diff --git a/lib/lithic/models/three_ds_authentication_challenge_webhook_event.rb b/lib/lithic/models/three_ds_authentication_challenge_webhook_event.rb new file mode 100644 index 00000000..7bd381e9 --- /dev/null +++ b/lib/lithic/models/three_ds_authentication_challenge_webhook_event.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ThreeDSAuthenticationChallengeWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute authentication_object + # Represents a 3DS authentication + # + # @return [Lithic::Models::ThreeDSAuthentication] + required :authentication_object, -> { Lithic::ThreeDSAuthentication } + + # @!attribute challenge + # Represents a challenge object for 3DS authentication + # + # @return [Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent::Challenge] + required :challenge, -> { Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge } + + # @!attribute event_type + # + # @return [Symbol, :"three_ds_authentication.challenge"] + required :event_type, const: :"three_ds_authentication.challenge" + + # @!method initialize(authentication_object:, challenge:, event_type: :"three_ds_authentication.challenge") + # @param authentication_object [Lithic::Models::ThreeDSAuthentication] Represents a 3DS authentication + # + # @param challenge [Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent::Challenge] Represents a challenge object for 3DS authentication + # + # @param event_type [Symbol, :"three_ds_authentication.challenge"] + + # @see Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent#challenge + class Challenge < Lithic::Internal::Type::BaseModel + # @!attribute challenge_method_type + # The type of challenge method issued to the cardholder + # + # @return [Symbol, Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::ChallengeMethodType] + required :challenge_method_type, + enum: -> { Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::ChallengeMethodType } + + # @!attribute expiry_time + # ISO-8601 time at which the challenge expires + # + # @return [Time] + required :expiry_time, Time + + # @!attribute start_time + # ISO-8601 time at which the challenge has started + # + # @return [Time] + required :start_time, Time + + # @!attribute app_requestor_url + # Fully qualified app URL of the merchant app. This should be used to redirect the + # cardholder back to the merchant app after completing an app-based challenge. + # This URL will only be populated if the 3DS Requestor App is provided to the 3DS + # SDK. + # + # @return [String, nil] + optional :app_requestor_url, String, nil?: true + + # @!method initialize(challenge_method_type:, expiry_time:, start_time:, app_requestor_url: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent::Challenge} for more + # details. + # + # Represents a challenge object for 3DS authentication + # + # @param challenge_method_type [Symbol, Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::ChallengeMethodType] The type of challenge method issued to the cardholder + # + # @param expiry_time [Time] ISO-8601 time at which the challenge expires + # + # @param start_time [Time] ISO-8601 time at which the challenge has started + # + # @param app_requestor_url [String, nil] Fully qualified app URL of the merchant app. This should be used to redirect the + + # The type of challenge method issued to the cardholder + # + # @see Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent::Challenge#challenge_method_type + module ChallengeMethodType + extend Lithic::Internal::Type::Enum + + OUT_OF_BAND = :OUT_OF_BAND + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/three_ds_authentication_created_webhook_event.rb b/lib/lithic/models/three_ds_authentication_created_webhook_event.rb new file mode 100644 index 00000000..f7f16295 --- /dev/null +++ b/lib/lithic/models/three_ds_authentication_created_webhook_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ThreeDSAuthenticationCreatedWebhookEvent < Lithic::Models::ThreeDSAuthentication + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"three_ds_authentication.created"] + required :event_type, const: :"three_ds_authentication.created" + + # @!method initialize(event_type: :"three_ds_authentication.created") + # Represents a 3DS authentication + # + # @param event_type [Symbol, :"three_ds_authentication.created"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/three_ds_authentication_updated_webhook_event.rb b/lib/lithic/models/three_ds_authentication_updated_webhook_event.rb new file mode 100644 index 00000000..bd5d470f --- /dev/null +++ b/lib/lithic/models/three_ds_authentication_updated_webhook_event.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + class ThreeDSAuthenticationUpdatedWebhookEvent < Lithic::Models::ThreeDSAuthentication + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"three_ds_authentication.updated"] + required :event_type, const: :"three_ds_authentication.updated" + + # @!method initialize(event_type: :"three_ds_authentication.updated") + # Represents a 3DS authentication + # + # @param event_type [Symbol, :"three_ds_authentication.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/token_info.rb b/lib/lithic/models/token_info.rb new file mode 100644 index 00000000..c6b9e173 --- /dev/null +++ b/lib/lithic/models/token_info.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenInfo < Lithic::Internal::Type::BaseModel + # @!attribute wallet_type + # The wallet_type field will indicate the source of the token. Possible token + # sources include digital wallets (Apple, Google, or Samsung Pay), merchant + # tokenization, and “other” sources like in-flight commerce. Masterpass is not + # currently supported and is included for future use. + # + # @return [Symbol, Lithic::Models::TokenInfo::WalletType] + required :wallet_type, enum: -> { Lithic::TokenInfo::WalletType } + + # @!method initialize(wallet_type:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TokenInfo} for more details. + # + # @param wallet_type [Symbol, Lithic::Models::TokenInfo::WalletType] The wallet_type field will indicate the source of the token. Possible token sour + + # The wallet_type field will indicate the source of the token. Possible token + # sources include digital wallets (Apple, Google, or Samsung Pay), merchant + # tokenization, and “other” sources like in-flight commerce. Masterpass is not + # currently supported and is included for future use. + # + # @see Lithic::Models::TokenInfo#wallet_type + module WalletType + extend Lithic::Internal::Type::Enum + + APPLE_PAY = :APPLE_PAY + GOOGLE_PAY = :GOOGLE_PAY + MASTERPASS = :MASTERPASS + MERCHANT = :MERCHANT + OTHER = :OTHER + SAMSUNG_PAY = :SAMSUNG_PAY + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/token_metadata.rb b/lib/lithic/models/token_metadata.rb new file mode 100644 index 00000000..a5f47436 --- /dev/null +++ b/lib/lithic/models/token_metadata.rb @@ -0,0 +1,140 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenMetadata < Lithic::Internal::Type::BaseModel + # @!attribute payment_account_info + # Contains the information of the account responsible for the payment. + # + # @return [Lithic::Models::TokenMetadata::PaymentAccountInfo] + required :payment_account_info, -> { Lithic::TokenMetadata::PaymentAccountInfo } + + # @!attribute status + # The current status of the digital wallet token. Pending or declined. + # + # @return [String] + required :status, String + + # @!attribute payment_app_instance_id + # The identifier of the Payment App instance within a device that will be + # provisioned with a token + # + # @return [String, nil] + optional :payment_app_instance_id, String, nil?: true + + # @!attribute token_requestor_id + # The party that requested the digitization + # + # @return [String, nil] + optional :token_requestor_id, String + + # @!attribute token_requestor_name + # Human-readable name of the wallet that the token_requestor_id maps to. + # + # @return [Symbol, Lithic::Models::TokenMetadata::TokenRequestorName, nil] + optional :token_requestor_name, enum: -> { Lithic::TokenMetadata::TokenRequestorName } + + # @!method initialize(payment_account_info:, status:, payment_app_instance_id: nil, token_requestor_id: nil, token_requestor_name: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TokenMetadata} for more details. + # + # Contains the metadata for the digital wallet being tokenized. + # + # @param payment_account_info [Lithic::Models::TokenMetadata::PaymentAccountInfo] Contains the information of the account responsible for the payment. + # + # @param status [String] The current status of the digital wallet token. Pending or declined. + # + # @param payment_app_instance_id [String, nil] The identifier of the Payment App instance within a device that will be provisio + # + # @param token_requestor_id [String] The party that requested the digitization + # + # @param token_requestor_name [Symbol, Lithic::Models::TokenMetadata::TokenRequestorName] Human-readable name of the wallet that the token_requestor_id maps to. + + # @see Lithic::Models::TokenMetadata#payment_account_info + class PaymentAccountInfo < Lithic::Internal::Type::BaseModel + # @!attribute account_holder_data + # Additional information that can be used to identify the account holder, such as + # name, address, etc + # + # @return [Lithic::Models::TokenMetadata::PaymentAccountInfo::AccountHolderData] + required :account_holder_data, -> { Lithic::TokenMetadata::PaymentAccountInfo::AccountHolderData } + + # @!attribute pan_unique_reference + # Reference to the PAN that is unique per Wallet Provider + # + # @return [String, nil] + optional :pan_unique_reference, String, nil?: true + + # @!attribute payment_account_reference + # The unique account reference assigned to the PAN + # + # @return [String, nil] + optional :payment_account_reference, String, nil?: true + + # @!attribute token_unique_reference + # A unique reference assigned following the allocation of a token used to identify + # the token for the duration of its lifetime. + # + # @return [String, nil] + optional :token_unique_reference, String, nil?: true + + # @!method initialize(account_holder_data:, pan_unique_reference: nil, payment_account_reference: nil, token_unique_reference: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TokenMetadata::PaymentAccountInfo} for more details. + # + # Contains the information of the account responsible for the payment. + # + # @param account_holder_data [Lithic::Models::TokenMetadata::PaymentAccountInfo::AccountHolderData] Additional information that can be used to identify the account holder, such as + # + # @param pan_unique_reference [String, nil] Reference to the PAN that is unique per Wallet Provider + # + # @param payment_account_reference [String, nil] The unique account reference assigned to the PAN + # + # @param token_unique_reference [String, nil] A unique reference assigned following the allocation of a token used to identify + + # @see Lithic::Models::TokenMetadata::PaymentAccountInfo#account_holder_data + class AccountHolderData < Lithic::Internal::Type::BaseModel + # @!attribute phone_number + # The phone number, may contain country code along with phone number when + # countryDialInCode is not present + # + # @return [String, nil] + optional :phone_number, String, nil?: true + + # @!method initialize(phone_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TokenMetadata::PaymentAccountInfo::AccountHolderData} for more + # details. + # + # Additional information that can be used to identify the account holder, such as + # name, address, etc + # + # @param phone_number [String, nil] The phone number, may contain country code along with phone number when countryD + end + end + + # Human-readable name of the wallet that the token_requestor_id maps to. + # + # @see Lithic::Models::TokenMetadata#token_requestor_name + module TokenRequestorName + extend Lithic::Internal::Type::Enum + + AMAZON_ONE = :AMAZON_ONE + ANDROID_PAY = :ANDROID_PAY + APPLE_PAY = :APPLE_PAY + FACEBOOK = :FACEBOOK + FITBIT_PAY = :FITBIT_PAY + GARMIN_PAY = :GARMIN_PAY + GOOGLE_PAY = :GOOGLE_PAY + MICROSOFT_PAY = :MICROSOFT_PAY + NETFLIX = :NETFLIX + SAMSUNG_PAY = :SAMSUNG_PAY + UNKNOWN = :UNKNOWN + VISA_CHECKOUT = :VISA_CHECKOUT + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/tokenization.rb b/lib/lithic/models/tokenization.rb new file mode 100644 index 00000000..7232d870 --- /dev/null +++ b/lib/lithic/models/tokenization.rb @@ -0,0 +1,320 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Tokenizations#retrieve + class Tokenization < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for a Tokenization + # + # @return [String] + required :token, String + + # @!attribute account_token + # The account token associated with the card being tokenized. + # + # @return [String] + required :account_token, String + + # @!attribute card_token + # The card token associated with the card being tokenized. + # + # @return [String] + required :card_token, String + + # @!attribute created_at + # Date and time when the tokenization first occurred. UTC time zone. + # + # @return [Time] + required :created_at, Time + + # @!attribute dpan + # The dynamic pan assigned to the token by the network. + # + # @return [String, nil] + required :dpan, String, nil?: true + + # @!attribute status + # The status of the tokenization request + # + # @return [Symbol, Lithic::Models::Tokenization::Status] + required :status, enum: -> { Lithic::Tokenization::Status } + + # @!attribute token_requestor_name + # The entity that requested the tokenization. For digital wallets, this will be + # one of the defined wallet types. For merchant tokenizations, this will be a + # free-form merchant name string. + # + # @return [Symbol, String, Lithic::Models::Tokenization::TokenRequestorName] + required :token_requestor_name, union: -> { Lithic::Tokenization::TokenRequestorName } + + # @!attribute token_unique_reference + # The network's unique reference for the tokenization. + # + # @return [String] + required :token_unique_reference, String + + # @!attribute tokenization_channel + # The channel through which the tokenization was made. + # + # @return [Symbol, Lithic::Models::Tokenization::TokenizationChannel] + required :tokenization_channel, enum: -> { Lithic::Tokenization::TokenizationChannel } + + # @!attribute updated_at + # Latest date and time when the tokenization was updated. UTC time zone. + # + # @return [Time] + required :updated_at, Time + + # @!attribute device_id + # The device identifier associated with the tokenization. + # + # @return [String, nil] + optional :device_id, String, nil?: true + + # @!attribute digital_card_art_token + # Specifies the digital card art displayed in the user's digital wallet after + # tokenization. This will be null if the tokenization was created without an + # associated digital card art. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + # + # @return [String, nil] + optional :digital_card_art_token, String, nil?: true + + # @!attribute events + # A list of events related to the tokenization. + # + # @return [Array, nil] + optional :events, -> { Lithic::Internal::Type::ArrayOf[Lithic::Tokenization::Event] } + + # @!attribute payment_account_reference_id + # The network's unique reference for the card that is tokenized. + # + # @return [String, nil] + optional :payment_account_reference_id, String, nil?: true + + # @!method initialize(token:, account_token:, card_token:, created_at:, dpan:, status:, token_requestor_name:, token_unique_reference:, tokenization_channel:, updated_at:, device_id: nil, digital_card_art_token: nil, events: nil, payment_account_reference_id: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Tokenization} for more details. + # + # @param token [String] Globally unique identifier for a Tokenization + # + # @param account_token [String] The account token associated with the card being tokenized. + # + # @param card_token [String] The card token associated with the card being tokenized. + # + # @param created_at [Time] Date and time when the tokenization first occurred. UTC time zone. + # + # @param dpan [String, nil] The dynamic pan assigned to the token by the network. + # + # @param status [Symbol, Lithic::Models::Tokenization::Status] The status of the tokenization request + # + # @param token_requestor_name [Symbol, String, Lithic::Models::Tokenization::TokenRequestorName] The entity that requested the tokenization. For digital wallets, this will be on + # + # @param token_unique_reference [String] The network's unique reference for the tokenization. + # + # @param tokenization_channel [Symbol, Lithic::Models::Tokenization::TokenizationChannel] The channel through which the tokenization was made. + # + # @param updated_at [Time] Latest date and time when the tokenization was updated. UTC time zone. + # + # @param device_id [String, nil] The device identifier associated with the tokenization. + # + # @param digital_card_art_token [String, nil] Specifies the digital card art displayed in the user's digital wallet after toke + # + # @param events [Array] A list of events related to the tokenization. + # + # @param payment_account_reference_id [String, nil] The network's unique reference for the card that is tokenized. + + # The status of the tokenization request + # + # @see Lithic::Models::Tokenization#status + module Status + extend Lithic::Internal::Type::Enum + + ACTIVE = :ACTIVE + DEACTIVATED = :DEACTIVATED + INACTIVE = :INACTIVE + PAUSED = :PAUSED + PENDING_2_FA = :PENDING_2FA + PENDING_ACTIVATION = :PENDING_ACTIVATION + UNKNOWN = :UNKNOWN + + # @!method self.values + # @return [Array] + end + + # The entity that requested the tokenization. For digital wallets, this will be + # one of the defined wallet types. For merchant tokenizations, this will be a + # free-form merchant name string. + # + # @see Lithic::Models::Tokenization#token_requestor_name + module TokenRequestorName + extend Lithic::Internal::Type::Union + + variant const: -> { Lithic::Models::Tokenization::TokenRequestorName::AMAZON_ONE } + + variant const: -> { Lithic::Models::Tokenization::TokenRequestorName::ANDROID_PAY } + + variant const: -> { Lithic::Models::Tokenization::TokenRequestorName::APPLE_PAY } + + variant const: -> { Lithic::Models::Tokenization::TokenRequestorName::FACEBOOK } + + variant const: -> { Lithic::Models::Tokenization::TokenRequestorName::FITBIT_PAY } + + variant const: -> { Lithic::Models::Tokenization::TokenRequestorName::GARMIN_PAY } + + variant const: -> { Lithic::Models::Tokenization::TokenRequestorName::GOOGLE_PAY } + + variant const: -> { Lithic::Models::Tokenization::TokenRequestorName::MICROSOFT_PAY } + + variant const: -> { Lithic::Models::Tokenization::TokenRequestorName::NETFLIX } + + variant const: -> { Lithic::Models::Tokenization::TokenRequestorName::SAMSUNG_PAY } + + variant const: -> { Lithic::Models::Tokenization::TokenRequestorName::UNKNOWN } + + variant const: -> { Lithic::Models::Tokenization::TokenRequestorName::VISA_CHECKOUT } + + # Merchant name for merchant tokenizations + variant String + + # @!method self.variants + # @return [Array(Symbol, String)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(Lithic::Tokenization::TokenRequestorName::TaggedSymbol, String) } + end + + # @!group + + AMAZON_ONE = :AMAZON_ONE + ANDROID_PAY = :ANDROID_PAY + APPLE_PAY = :APPLE_PAY + FACEBOOK = :FACEBOOK + FITBIT_PAY = :FITBIT_PAY + GARMIN_PAY = :GARMIN_PAY + GOOGLE_PAY = :GOOGLE_PAY + MICROSOFT_PAY = :MICROSOFT_PAY + NETFLIX = :NETFLIX + SAMSUNG_PAY = :SAMSUNG_PAY + UNKNOWN = :UNKNOWN + VISA_CHECKOUT = :VISA_CHECKOUT + + # @!endgroup + end + + # The channel through which the tokenization was made. + # + # @see Lithic::Models::Tokenization#tokenization_channel + module TokenizationChannel + extend Lithic::Internal::Type::Enum + + DIGITAL_WALLET = :DIGITAL_WALLET + MERCHANT = :MERCHANT + + # @!method self.values + # @return [Array] + end + + class Event < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for a Tokenization Event + # + # @return [String, nil] + optional :token, String + + # @!attribute created_at + # Date and time when the tokenization event first occurred. UTC time zone. + # + # @return [Time, nil] + optional :created_at, Time + + # @!attribute result + # Enum representing the result of the tokenization event + # + # @return [Symbol, Lithic::Models::Tokenization::Event::Result, nil] + optional :result, enum: -> { Lithic::Tokenization::Event::Result } + + # @!attribute rule_results + # Results from rules that were evaluated for this tokenization + # + # @return [Array, nil] + optional :rule_results, -> { Lithic::Internal::Type::ArrayOf[Lithic::TokenizationRuleResult] } + + # @!attribute tokenization_decline_reasons + # List of reasons why the tokenization was declined + # + # @return [Array, nil] + optional :tokenization_decline_reasons, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::TokenizationDeclineReason] } + + # @!attribute tokenization_tfa_reasons + # List of reasons why two-factor authentication was required + # + # @return [Array, nil] + optional :tokenization_tfa_reasons, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::TokenizationTfaReason] } + + # @!attribute type + # Enum representing the type of tokenization event that occurred + # + # @return [Symbol, Lithic::Models::Tokenization::Event::Type, nil] + optional :type, enum: -> { Lithic::Tokenization::Event::Type } + + # @!method initialize(token: nil, created_at: nil, result: nil, rule_results: nil, tokenization_decline_reasons: nil, tokenization_tfa_reasons: nil, type: nil) + # @param token [String] Globally unique identifier for a Tokenization Event + # + # @param created_at [Time] Date and time when the tokenization event first occurred. UTC time zone. + # + # @param result [Symbol, Lithic::Models::Tokenization::Event::Result] Enum representing the result of the tokenization event + # + # @param rule_results [Array] Results from rules that were evaluated for this tokenization + # + # @param tokenization_decline_reasons [Array] List of reasons why the tokenization was declined + # + # @param tokenization_tfa_reasons [Array] List of reasons why two-factor authentication was required + # + # @param type [Symbol, Lithic::Models::Tokenization::Event::Type] Enum representing the type of tokenization event that occurred + + # Enum representing the result of the tokenization event + # + # @see Lithic::Models::Tokenization::Event#result + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + NOTIFICATION_DELIVERED = :NOTIFICATION_DELIVERED + REQUIRE_ADDITIONAL_AUTHENTICATION = :REQUIRE_ADDITIONAL_AUTHENTICATION + TOKEN_ACTIVATED = :TOKEN_ACTIVATED + TOKEN_CREATED = :TOKEN_CREATED + TOKEN_DEACTIVATED = :TOKEN_DEACTIVATED + TOKEN_DELETED_FROM_CONSUMER_APP = :TOKEN_DELETED_FROM_CONSUMER_APP + TOKEN_INACTIVE = :TOKEN_INACTIVE + TOKEN_STATE_UNKNOWN = :TOKEN_STATE_UNKNOWN + TOKEN_SUSPENDED = :TOKEN_SUSPENDED + TOKEN_UPDATED = :TOKEN_UPDATED + + # @!method self.values + # @return [Array] + end + + # Enum representing the type of tokenization event that occurred + # + # @see Lithic::Models::Tokenization::Event#type + module Type + extend Lithic::Internal::Type::Enum + + TOKENIZATION_2_FA = :TOKENIZATION_2FA + TOKENIZATION_AUTHORIZATION = :TOKENIZATION_AUTHORIZATION + TOKENIZATION_DECISIONING = :TOKENIZATION_DECISIONING + TOKENIZATION_ELIGIBILITY_CHECK = :TOKENIZATION_ELIGIBILITY_CHECK + TOKENIZATION_UPDATED = :TOKENIZATION_UPDATED + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/tokenization_activate_params.rb b/lib/lithic/models/tokenization_activate_params.rb new file mode 100644 index 00000000..e73733b3 --- /dev/null +++ b/lib/lithic/models/tokenization_activate_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Tokenizations#activate + class TokenizationActivateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute tokenization_token + # + # @return [String] + required :tokenization_token, String + + # @!method initialize(tokenization_token:, request_options: {}) + # @param tokenization_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/tokenization_approval_request_webhook_event.rb b/lib/lithic/models/tokenization_approval_request_webhook_event.rb new file mode 100644 index 00000000..ec431949 --- /dev/null +++ b/lib/lithic/models/tokenization_approval_request_webhook_event.rb @@ -0,0 +1,249 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenizationApprovalRequestWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute account_token + # Unique identifier for the user tokenizing a card + # + # @return [String] + required :account_token, String + + # @!attribute card_token + # Unique identifier for the card being tokenized + # + # @return [String] + required :card_token, String + + # @!attribute created + # Indicate when the request was received from Mastercard or Visa + # + # @return [Time] + required :created, Time + + # @!attribute customer_tokenization_decision + # Contains the metadata for the customer tokenization decision. + # + # @return [Lithic::Models::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision, nil] + required :customer_tokenization_decision, + -> { Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision }, + nil?: true + + # @!attribute event_type + # The name of this event + # + # @return [Symbol, Lithic::Models::TokenizationApprovalRequestWebhookEvent::EventType] + required :event_type, enum: -> { Lithic::TokenizationApprovalRequestWebhookEvent::EventType } + + # @!attribute issuer_decision + # Whether Lithic decisioned on the token, and if so, what the decision was. + # APPROVED/VERIFICATION_REQUIRED/DENIED. + # + # @return [Symbol, Lithic::Models::TokenizationApprovalRequestWebhookEvent::IssuerDecision] + required :issuer_decision, enum: -> { Lithic::TokenizationApprovalRequestWebhookEvent::IssuerDecision } + + # @!attribute token_metadata + # Contains the metadata for the digital wallet being tokenized. + # + # @return [Lithic::Models::TokenMetadata] + required :token_metadata, -> { Lithic::TokenMetadata } + + # @!attribute tokenization_channel + # The channel through which the tokenization was made. + # + # @return [Symbol, Lithic::Models::TokenizationApprovalRequestWebhookEvent::TokenizationChannel] + required :tokenization_channel, + enum: -> { Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationChannel } + + # @!attribute tokenization_token + # Unique identifier for the digital wallet token attempt + # + # @return [String] + required :tokenization_token, String + + # @!attribute wallet_decisioning_info + # + # @return [Lithic::Models::WalletDecisioningInfo] + required :wallet_decisioning_info, -> { Lithic::WalletDecisioningInfo } + + # @!attribute device + # + # @return [Lithic::Models::Device, nil] + optional :device, -> { Lithic::Device } + + # @!attribute rule_results + # Results from rules that were evaluated for this tokenization + # + # @return [Array, nil] + optional :rule_results, -> { Lithic::Internal::Type::ArrayOf[Lithic::TokenizationRuleResult] } + + # @!attribute tokenization_decline_reasons + # List of reasons why the tokenization was declined + # + # @return [Array, nil] + optional :tokenization_decline_reasons, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::TokenizationDeclineReason] } + + # @!attribute tokenization_source + # The source of the tokenization. + # + # @return [Symbol, Lithic::Models::TokenizationApprovalRequestWebhookEvent::TokenizationSource, nil] + optional :tokenization_source, + enum: -> { Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationSource } + + # @!attribute tokenization_tfa_reasons + # List of reasons why two-factor authentication was required + # + # @return [Array, nil] + optional :tokenization_tfa_reasons, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::TokenizationTfaReason] } + + # @!method initialize(account_token:, card_token:, created:, customer_tokenization_decision:, event_type:, issuer_decision:, token_metadata:, tokenization_channel:, tokenization_token:, wallet_decisioning_info:, device: nil, rule_results: nil, tokenization_decline_reasons: nil, tokenization_source: nil, tokenization_tfa_reasons: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TokenizationApprovalRequestWebhookEvent} for more details. + # + # @param account_token [String] Unique identifier for the user tokenizing a card + # + # @param card_token [String] Unique identifier for the card being tokenized + # + # @param created [Time] Indicate when the request was received from Mastercard or Visa + # + # @param customer_tokenization_decision [Lithic::Models::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision, nil] Contains the metadata for the customer tokenization decision. + # + # @param event_type [Symbol, Lithic::Models::TokenizationApprovalRequestWebhookEvent::EventType] The name of this event + # + # @param issuer_decision [Symbol, Lithic::Models::TokenizationApprovalRequestWebhookEvent::IssuerDecision] Whether Lithic decisioned on the token, and if so, what the decision was. APPROV + # + # @param token_metadata [Lithic::Models::TokenMetadata] Contains the metadata for the digital wallet being tokenized. + # + # @param tokenization_channel [Symbol, Lithic::Models::TokenizationApprovalRequestWebhookEvent::TokenizationChannel] The channel through which the tokenization was made. + # + # @param tokenization_token [String] Unique identifier for the digital wallet token attempt + # + # @param wallet_decisioning_info [Lithic::Models::WalletDecisioningInfo] + # + # @param device [Lithic::Models::Device] + # + # @param rule_results [Array] Results from rules that were evaluated for this tokenization + # + # @param tokenization_decline_reasons [Array] List of reasons why the tokenization was declined + # + # @param tokenization_source [Symbol, Lithic::Models::TokenizationApprovalRequestWebhookEvent::TokenizationSource] The source of the tokenization. + # + # @param tokenization_tfa_reasons [Array] List of reasons why two-factor authentication was required + + # @see Lithic::Models::TokenizationApprovalRequestWebhookEvent#customer_tokenization_decision + class CustomerTokenizationDecision < Lithic::Internal::Type::BaseModel + # @!attribute outcome + # The outcome of the customer's decision + # + # @return [Symbol, Lithic::Models::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome] + required :outcome, + enum: -> { Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome } + + # @!attribute responder_url + # The customer's subscribed URL + # + # @return [String] + required :responder_url, String + + # @!attribute latency + # Time in ms it took for the customer's URL to respond + # + # @return [String, nil] + optional :latency, String + + # @!attribute response_code + # The response code that the customer provided + # + # @return [String, nil] + optional :response_code, String + + # @!method initialize(outcome:, responder_url:, latency: nil, response_code: nil) + # Contains the metadata for the customer tokenization decision. + # + # @param outcome [Symbol, Lithic::Models::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome] The outcome of the customer's decision + # + # @param responder_url [String] The customer's subscribed URL + # + # @param latency [String] Time in ms it took for the customer's URL to respond + # + # @param response_code [String] The response code that the customer provided + + # The outcome of the customer's decision + # + # @see Lithic::Models::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision#outcome + module Outcome + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + ERROR = :ERROR + INVALID_RESPONSE = :INVALID_RESPONSE + REQUIRE_ADDITIONAL_AUTHENTICATION = :REQUIRE_ADDITIONAL_AUTHENTICATION + TIMEOUT = :TIMEOUT + + # @!method self.values + # @return [Array] + end + end + + # The name of this event + # + # @see Lithic::Models::TokenizationApprovalRequestWebhookEvent#event_type + module EventType + extend Lithic::Internal::Type::Enum + + TOKENIZATION_APPROVAL_REQUEST = :"tokenization.approval_request" + + # @!method self.values + # @return [Array] + end + + # Whether Lithic decisioned on the token, and if so, what the decision was. + # APPROVED/VERIFICATION_REQUIRED/DENIED. + # + # @see Lithic::Models::TokenizationApprovalRequestWebhookEvent#issuer_decision + module IssuerDecision + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DENIED = :DENIED + VERIFICATION_REQUIRED = :VERIFICATION_REQUIRED + + # @!method self.values + # @return [Array] + end + + # The channel through which the tokenization was made. + # + # @see Lithic::Models::TokenizationApprovalRequestWebhookEvent#tokenization_channel + module TokenizationChannel + extend Lithic::Internal::Type::Enum + + DIGITAL_WALLET = :DIGITAL_WALLET + MERCHANT = :MERCHANT + + # @!method self.values + # @return [Array] + end + + # The source of the tokenization. + # + # @see Lithic::Models::TokenizationApprovalRequestWebhookEvent#tokenization_source + module TokenizationSource + extend Lithic::Internal::Type::Enum + + ACCOUNT_ON_FILE = :ACCOUNT_ON_FILE + CONTACTLESS_TAP = :CONTACTLESS_TAP + MANUAL_PROVISION = :MANUAL_PROVISION + PUSH_PROVISION = :PUSH_PROVISION + TOKEN = :TOKEN + UNKNOWN = :UNKNOWN + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/tokenization_deactivate_params.rb b/lib/lithic/models/tokenization_deactivate_params.rb new file mode 100644 index 00000000..d1a527b9 --- /dev/null +++ b/lib/lithic/models/tokenization_deactivate_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Tokenizations#deactivate + class TokenizationDeactivateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute tokenization_token + # + # @return [String] + required :tokenization_token, String + + # @!method initialize(tokenization_token:, request_options: {}) + # @param tokenization_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/tokenization_decisioning_retrieve_secret_params.rb b/lib/lithic/models/tokenization_decisioning_retrieve_secret_params.rb new file mode 100644 index 00000000..11b4c7a7 --- /dev/null +++ b/lib/lithic/models/tokenization_decisioning_retrieve_secret_params.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::TokenizationDecisioning#retrieve_secret + class TokenizationDecisioningRetrieveSecretParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/tokenization_decisioning_rotate_secret_params.rb b/lib/lithic/models/tokenization_decisioning_rotate_secret_params.rb new file mode 100644 index 00000000..ad94f61c --- /dev/null +++ b/lib/lithic/models/tokenization_decisioning_rotate_secret_params.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::TokenizationDecisioning#rotate_secret + class TokenizationDecisioningRotateSecretParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/tokenization_decisioning_rotate_secret_response.rb b/lib/lithic/models/tokenization_decisioning_rotate_secret_response.rb new file mode 100644 index 00000000..83379732 --- /dev/null +++ b/lib/lithic/models/tokenization_decisioning_rotate_secret_response.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::TokenizationDecisioning#rotate_secret + class TokenizationDecisioningRotateSecretResponse < Lithic::Internal::Type::BaseModel + # @!attribute secret + # The new Tokenization Decisioning HMAC secret + # + # @return [String, nil] + optional :secret, String + + # @!method initialize(secret: nil) + # @param secret [String] The new Tokenization Decisioning HMAC secret + end + end +end diff --git a/lib/lithic/models/tokenization_decline_reason.rb b/lib/lithic/models/tokenization_decline_reason.rb new file mode 100644 index 00000000..7382c120 --- /dev/null +++ b/lib/lithic/models/tokenization_decline_reason.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Lithic + module Models + # Reason code for why a tokenization was declined + module TokenizationDeclineReason + extend Lithic::Internal::Type::Enum + + ACCOUNT_SCORE_1 = :ACCOUNT_SCORE_1 + DEVICE_SCORE_1 = :DEVICE_SCORE_1 + ALL_WALLET_DECLINE_REASONS_PRESENT = :ALL_WALLET_DECLINE_REASONS_PRESENT + WALLET_RECOMMENDED_DECISION_RED = :WALLET_RECOMMENDED_DECISION_RED + CVC_MISMATCH = :CVC_MISMATCH + CARD_EXPIRY_MONTH_MISMATCH = :CARD_EXPIRY_MONTH_MISMATCH + CARD_EXPIRY_YEAR_MISMATCH = :CARD_EXPIRY_YEAR_MISMATCH + CARD_INVALID_STATE = :CARD_INVALID_STATE + CUSTOMER_RED_PATH = :CUSTOMER_RED_PATH + INVALID_CUSTOMER_RESPONSE = :INVALID_CUSTOMER_RESPONSE + NETWORK_FAILURE = :NETWORK_FAILURE + GENERIC_DECLINE = :GENERIC_DECLINE + DIGITAL_CARD_ART_REQUIRED = :DIGITAL_CARD_ART_REQUIRED + INVALID_PAN = :INVALID_PAN + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/lithic/models/tokenization_list_params.rb b/lib/lithic/models/tokenization_list_params.rb new file mode 100644 index 00000000..b4e0c409 --- /dev/null +++ b/lib/lithic/models/tokenization_list_params.rb @@ -0,0 +1,97 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Tokenizations#list + class TokenizationListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute account_token + # Filters for tokenizations associated with a specific account. + # + # @return [String, nil] + optional :account_token, String + + # @!attribute begin_ + # Filter for tokenizations created after this date. + # + # @return [Date, nil] + optional :begin_, Date + + # @!attribute card_token + # Filters for tokenizations associated with a specific card. + # + # @return [String, nil] + optional :card_token, String + + # @!attribute end_ + # Filter for tokenizations created before this date. + # + # @return [Date, nil] + optional :end_, Date + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!attribute tokenization_channel + # Filter for tokenizations by tokenization channel. If this is not specified, only + # DIGITAL_WALLET tokenizations will be returned. + # + # @return [Symbol, Lithic::Models::TokenizationListParams::TokenizationChannel, nil] + optional :tokenization_channel, enum: -> { Lithic::TokenizationListParams::TokenizationChannel } + + # @!method initialize(account_token: nil, begin_: nil, card_token: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, tokenization_channel: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TokenizationListParams} for more details. + # + # @param account_token [String] Filters for tokenizations associated with a specific account. + # + # @param begin_ [Date] Filter for tokenizations created after this date. + # + # @param card_token [String] Filters for tokenizations associated with a specific card. + # + # @param end_ [Date] Filter for tokenizations created before this date. + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param tokenization_channel [Symbol, Lithic::Models::TokenizationListParams::TokenizationChannel] Filter for tokenizations by tokenization channel. If this is not specified, only + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Filter for tokenizations by tokenization channel. If this is not specified, only + # DIGITAL_WALLET tokenizations will be returned. + module TokenizationChannel + extend Lithic::Internal::Type::Enum + + DIGITAL_WALLET = :DIGITAL_WALLET + MERCHANT = :MERCHANT + ALL = :ALL + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/tokenization_pause_params.rb b/lib/lithic/models/tokenization_pause_params.rb new file mode 100644 index 00000000..f46154ab --- /dev/null +++ b/lib/lithic/models/tokenization_pause_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Tokenizations#pause + class TokenizationPauseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute tokenization_token + # + # @return [String] + required :tokenization_token, String + + # @!method initialize(tokenization_token:, request_options: {}) + # @param tokenization_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/tokenization_resend_activation_code_params.rb b/lib/lithic/models/tokenization_resend_activation_code_params.rb new file mode 100644 index 00000000..77d04608 --- /dev/null +++ b/lib/lithic/models/tokenization_resend_activation_code_params.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Tokenizations#resend_activation_code + class TokenizationResendActivationCodeParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute tokenization_token + # + # @return [String] + required :tokenization_token, String + + # @!attribute activation_method_type + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + # + # @return [Symbol, Lithic::Models::TokenizationResendActivationCodeParams::ActivationMethodType, nil] + optional :activation_method_type, + enum: -> { Lithic::TokenizationResendActivationCodeParams::ActivationMethodType } + + # @!method initialize(tokenization_token:, activation_method_type: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TokenizationResendActivationCodeParams} for more details. + # + # @param tokenization_token [String] + # + # @param activation_method_type [Symbol, Lithic::Models::TokenizationResendActivationCodeParams::ActivationMethodType] The communication method that the user has selected to use to receive the authen + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + module ActivationMethodType + extend Lithic::Internal::Type::Enum + + EMAIL_TO_CARDHOLDER_ADDRESS = :EMAIL_TO_CARDHOLDER_ADDRESS + TEXT_TO_CARDHOLDER_NUMBER = :TEXT_TO_CARDHOLDER_NUMBER + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/tokenization_result_webhook_event.rb b/lib/lithic/models/tokenization_result_webhook_event.rb new file mode 100644 index 00000000..235b0e44 --- /dev/null +++ b/lib/lithic/models/tokenization_result_webhook_event.rb @@ -0,0 +1,141 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenizationResultWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute account_token + # Account token + # + # @return [String] + required :account_token, String + + # @!attribute card_token + # Card token + # + # @return [String] + required :card_token, String + + # @!attribute created + # Created date + # + # @return [Time] + required :created, Time + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"tokenization.result"] + required :event_type, const: :"tokenization.result" + + # @!attribute tokenization_result_details + # The result of the tokenization request. + # + # @return [Lithic::Models::TokenizationResultWebhookEvent::TokenizationResultDetails] + required :tokenization_result_details, + -> { Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails } + + # @!attribute tokenization_token + # Tokenization token + # + # @return [String] + required :tokenization_token, String + + # @!method initialize(account_token:, card_token:, created:, tokenization_result_details:, tokenization_token:, event_type: :"tokenization.result") + # @param account_token [String] Account token + # + # @param card_token [String] Card token + # + # @param created [Time] Created date + # + # @param tokenization_result_details [Lithic::Models::TokenizationResultWebhookEvent::TokenizationResultDetails] The result of the tokenization request. + # + # @param tokenization_token [String] Tokenization token + # + # @param event_type [Symbol, :"tokenization.result"] The type of event that occurred. + + # @see Lithic::Models::TokenizationResultWebhookEvent#tokenization_result_details + class TokenizationResultDetails < Lithic::Internal::Type::BaseModel + # @!attribute issuer_decision + # Lithic's tokenization decision. + # + # @return [String] + required :issuer_decision, String + + # @!attribute tokenization_decline_reasons + # List of reasons why the tokenization was declined + # + # @return [Array] + required :tokenization_decline_reasons, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason] } + + # @!attribute customer_decision + # The customer's tokenization decision if applicable. + # + # @return [String, nil] + optional :customer_decision, String, nil?: true + + # @!attribute rule_results + # Results from rules that were evaluated for this tokenization + # + # @return [Array, nil] + optional :rule_results, -> { Lithic::Internal::Type::ArrayOf[Lithic::TokenizationRuleResult] } + + # @!attribute token_activated_date_time + # An RFC 3339 timestamp indicating when the tokenization succeeded. + # + # @return [Time, nil] + optional :token_activated_date_time, Time, nil?: true + + # @!attribute tokenization_tfa_reasons + # List of reasons why two-factor authentication was required + # + # @return [Array, nil] + optional :tokenization_tfa_reasons, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::TokenizationTfaReason] } + + # @!attribute wallet_decision + # The wallet's recommended decision. + # + # @return [String, nil] + optional :wallet_decision, String, nil?: true + + # @!method initialize(issuer_decision:, tokenization_decline_reasons:, customer_decision: nil, rule_results: nil, token_activated_date_time: nil, tokenization_tfa_reasons: nil, wallet_decision: nil) + # The result of the tokenization request. + # + # @param issuer_decision [String] Lithic's tokenization decision. + # + # @param tokenization_decline_reasons [Array] List of reasons why the tokenization was declined + # + # @param customer_decision [String, nil] The customer's tokenization decision if applicable. + # + # @param rule_results [Array] Results from rules that were evaluated for this tokenization + # + # @param token_activated_date_time [Time, nil] An RFC 3339 timestamp indicating when the tokenization succeeded. + # + # @param tokenization_tfa_reasons [Array] List of reasons why two-factor authentication was required + # + # @param wallet_decision [String, nil] The wallet's recommended decision. + + module TokenizationDeclineReason + extend Lithic::Internal::Type::Enum + + ACCOUNT_SCORE_1 = :ACCOUNT_SCORE_1 + ALL_WALLET_DECLINE_REASONS_PRESENT = :ALL_WALLET_DECLINE_REASONS_PRESENT + CARD_EXPIRY_MONTH_MISMATCH = :CARD_EXPIRY_MONTH_MISMATCH + CARD_EXPIRY_YEAR_MISMATCH = :CARD_EXPIRY_YEAR_MISMATCH + CARD_INVALID_STATE = :CARD_INVALID_STATE + CUSTOMER_RED_PATH = :CUSTOMER_RED_PATH + CVC_MISMATCH = :CVC_MISMATCH + DEVICE_SCORE_1 = :DEVICE_SCORE_1 + GENERIC_DECLINE = :GENERIC_DECLINE + INVALID_CUSTOMER_RESPONSE = :INVALID_CUSTOMER_RESPONSE + NETWORK_FAILURE = :NETWORK_FAILURE + WALLET_RECOMMENDED_DECISION_RED = :WALLET_RECOMMENDED_DECISION_RED + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/tokenization_retrieve_params.rb b/lib/lithic/models/tokenization_retrieve_params.rb new file mode 100644 index 00000000..01283d89 --- /dev/null +++ b/lib/lithic/models/tokenization_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Tokenizations#retrieve + class TokenizationRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute tokenization_token + # + # @return [String] + required :tokenization_token, String + + # @!method initialize(tokenization_token:, request_options: {}) + # @param tokenization_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/tokenization_rule_result.rb b/lib/lithic/models/tokenization_rule_result.rb new file mode 100644 index 00000000..ab5d4f65 --- /dev/null +++ b/lib/lithic/models/tokenization_rule_result.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenizationRuleResult < Lithic::Internal::Type::BaseModel + # @!attribute auth_rule_token + # The Auth Rule Token associated with the rule. If this is set to null, then the + # result was not associated with a customer-configured rule. This may happen in + # cases where a tokenization is declined or requires TFA due to a + # Lithic-configured security or compliance rule, for example. + # + # @return [String, nil] + required :auth_rule_token, String, nil?: true + + # @!attribute explanation + # A human-readable explanation outlining the motivation for the rule's result + # + # @return [String, nil] + required :explanation, String, nil?: true + + # @!attribute name + # The name for the rule, if any was configured + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute result + # The result associated with this rule + # + # @return [Symbol, Lithic::Models::TokenizationRuleResult::Result] + required :result, enum: -> { Lithic::TokenizationRuleResult::Result } + + # @!method initialize(auth_rule_token:, explanation:, name:, result:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TokenizationRuleResult} for more details. + # + # @param auth_rule_token [String, nil] The Auth Rule Token associated with the rule. If this is set to null, then the r + # + # @param explanation [String, nil] A human-readable explanation outlining the motivation for the rule's result + # + # @param name [String, nil] The name for the rule, if any was configured + # + # @param result [Symbol, Lithic::Models::TokenizationRuleResult::Result] The result associated with this rule + + # The result associated with this rule + # + # @see Lithic::Models::TokenizationRuleResult#result + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + REQUIRE_TFA = :REQUIRE_TFA + ERROR = :ERROR + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/tokenization_secret.rb b/lib/lithic/models/tokenization_secret.rb new file mode 100644 index 00000000..3f0b145f --- /dev/null +++ b/lib/lithic/models/tokenization_secret.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::TokenizationDecisioning#retrieve_secret + class TokenizationSecret < Lithic::Internal::Type::BaseModel + # @!attribute secret + # The Tokenization Decisioning HMAC secret + # + # @return [String, nil] + optional :secret, String + + # @!method initialize(secret: nil) + # @param secret [String] The Tokenization Decisioning HMAC secret + end + end +end diff --git a/lib/lithic/models/tokenization_simulate_params.rb b/lib/lithic/models/tokenization_simulate_params.rb new file mode 100644 index 00000000..ef9106f9 --- /dev/null +++ b/lib/lithic/models/tokenization_simulate_params.rb @@ -0,0 +1,110 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Tokenizations#simulate + class TokenizationSimulateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute cvv + # The three digit cvv for the card. + # + # @return [String] + required :cvv, String + + # @!attribute expiration_date + # The expiration date of the card in 'MM/YY' format. + # + # @return [String] + required :expiration_date, String + + # @!attribute pan + # The sixteen digit card number. + # + # @return [String] + required :pan, String + + # @!attribute tokenization_source + # The source of the tokenization request. + # + # @return [Symbol, Lithic::Models::TokenizationSimulateParams::TokenizationSource] + required :tokenization_source, enum: -> { Lithic::TokenizationSimulateParams::TokenizationSource } + + # @!attribute account_score + # The account score (1-5) that represents how the Digital Wallet's view on how + # reputable an end user's account is. + # + # @return [Integer, nil] + optional :account_score, Integer + + # @!attribute device_score + # The device score (1-5) that represents how the Digital Wallet's view on how + # reputable an end user's device is. + # + # @return [Integer, nil] + optional :device_score, Integer + + # @!attribute entity + # Optional field to specify the token requestor name for a merchant token + # simulation. Ignored when tokenization_source is not MERCHANT. + # + # @return [String, nil] + optional :entity, String + + # @!attribute wallet_recommended_decision + # The decision that the Digital Wallet's recommend + # + # @return [Symbol, Lithic::Models::TokenizationSimulateParams::WalletRecommendedDecision, nil] + optional :wallet_recommended_decision, + enum: -> { Lithic::TokenizationSimulateParams::WalletRecommendedDecision } + + # @!method initialize(cvv:, expiration_date:, pan:, tokenization_source:, account_score: nil, device_score: nil, entity: nil, wallet_recommended_decision: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TokenizationSimulateParams} for more details. + # + # @param cvv [String] The three digit cvv for the card. + # + # @param expiration_date [String] The expiration date of the card in 'MM/YY' format. + # + # @param pan [String] The sixteen digit card number. + # + # @param tokenization_source [Symbol, Lithic::Models::TokenizationSimulateParams::TokenizationSource] The source of the tokenization request. + # + # @param account_score [Integer] The account score (1-5) that represents how the Digital Wallet's view on how rep + # + # @param device_score [Integer] The device score (1-5) that represents how the Digital Wallet's view on how repu + # + # @param entity [String] Optional field to specify the token requestor name for a merchant token simulati + # + # @param wallet_recommended_decision [Symbol, Lithic::Models::TokenizationSimulateParams::WalletRecommendedDecision] The decision that the Digital Wallet's recommend + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # The source of the tokenization request. + module TokenizationSource + extend Lithic::Internal::Type::Enum + + APPLE_PAY = :APPLE_PAY + GOOGLE = :GOOGLE + SAMSUNG_PAY = :SAMSUNG_PAY + MERCHANT = :MERCHANT + + # @!method self.values + # @return [Array] + end + + # The decision that the Digital Wallet's recommend + module WalletRecommendedDecision + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + REQUIRE_ADDITIONAL_AUTHENTICATION = :REQUIRE_ADDITIONAL_AUTHENTICATION + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/tokenization_tfa_reason.rb b/lib/lithic/models/tokenization_tfa_reason.rb new file mode 100644 index 00000000..f825fc56 --- /dev/null +++ b/lib/lithic/models/tokenization_tfa_reason.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Lithic + module Models + # Reason code for why a tokenization required two-factor authentication + module TokenizationTfaReason + extend Lithic::Internal::Type::Enum + + WALLET_RECOMMENDED_TFA = :WALLET_RECOMMENDED_TFA + SUSPICIOUS_ACTIVITY = :SUSPICIOUS_ACTIVITY + DEVICE_RECENTLY_LOST = :DEVICE_RECENTLY_LOST + TOO_MANY_RECENT_ATTEMPTS = :TOO_MANY_RECENT_ATTEMPTS + TOO_MANY_RECENT_TOKENS = :TOO_MANY_RECENT_TOKENS + TOO_MANY_DIFFERENT_CARDHOLDERS = :TOO_MANY_DIFFERENT_CARDHOLDERS + OUTSIDE_HOME_TERRITORY = :OUTSIDE_HOME_TERRITORY + HAS_SUSPENDED_TOKENS = :HAS_SUSPENDED_TOKENS + HIGH_RISK = :HIGH_RISK + ACCOUNT_SCORE_LOW = :ACCOUNT_SCORE_LOW + DEVICE_SCORE_LOW = :DEVICE_SCORE_LOW + CARD_STATE_TFA = :CARD_STATE_TFA + HARDCODED_TFA = :HARDCODED_TFA + CUSTOMER_RULE_TFA = :CUSTOMER_RULE_TFA + DEVICE_HOST_CARD_EMULATION = :DEVICE_HOST_CARD_EMULATION + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/lithic/models/tokenization_two_factor_authentication_code_sent_webhook_event.rb b/lib/lithic/models/tokenization_two_factor_authentication_code_sent_webhook_event.rb new file mode 100644 index 00000000..fe60247d --- /dev/null +++ b/lib/lithic/models/tokenization_two_factor_authentication_code_sent_webhook_event.rb @@ -0,0 +1,100 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenizationTwoFactorAuthenticationCodeSentWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute account_token + # Unique identifier for the user tokenizing a card + # + # @return [String] + required :account_token, String + + # @!attribute activation_method + # + # @return [Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod] + required :activation_method, + -> { Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod } + + # @!attribute card_token + # Unique identifier for the card being tokenized + # + # @return [String] + required :card_token, String + + # @!attribute created + # Indicate when the request was received from Mastercard or Visa + # + # @return [Time] + required :created, Time + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"tokenization.two_factor_authentication_code_sent"] + required :event_type, const: :"tokenization.two_factor_authentication_code_sent" + + # @!attribute tokenization_token + # Unique identifier for the tokenization + # + # @return [String] + required :tokenization_token, String + + # @!method initialize(account_token:, activation_method:, card_token:, created:, tokenization_token:, event_type: :"tokenization.two_factor_authentication_code_sent") + # @param account_token [String] Unique identifier for the user tokenizing a card + # + # @param activation_method [Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod] + # + # @param card_token [String] Unique identifier for the card being tokenized + # + # @param created [Time] Indicate when the request was received from Mastercard or Visa + # + # @param tokenization_token [String] Unique identifier for the tokenization + # + # @param event_type [Symbol, :"tokenization.two_factor_authentication_code_sent"] The type of event that occurred. + + # @see Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent#activation_method + class ActivationMethod < Lithic::Internal::Type::BaseModel + # @!attribute type + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + # + # @return [Symbol, Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type] + required :type, + enum: -> { Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type } + + # @!attribute value + # The location to which the authentication code was sent. The format depends on + # the ActivationMethod.Type field. If Type is Email, the Value will be the email + # address. If the Type is Sms, the Value will be the phone number. + # + # @return [String] + required :value, String + + # @!method initialize(type:, value:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod} + # for more details. + # + # @param type [Symbol, Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type] The communication method that the user has selected to use to receive the authen + # + # @param value [String] The location to which the authentication code was sent. + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + # + # @see Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod#type + module Type + extend Lithic::Internal::Type::Enum + + EMAIL_TO_CARDHOLDER_ADDRESS = :EMAIL_TO_CARDHOLDER_ADDRESS + TEXT_TO_CARDHOLDER_NUMBER = :TEXT_TO_CARDHOLDER_NUMBER + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/tokenization_two_factor_authentication_code_webhook_event.rb b/lib/lithic/models/tokenization_two_factor_authentication_code_webhook_event.rb new file mode 100644 index 00000000..e1f76309 --- /dev/null +++ b/lib/lithic/models/tokenization_two_factor_authentication_code_webhook_event.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenizationTwoFactorAuthenticationCodeWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute account_token + # Unique identifier for the user tokenizing a card + # + # @return [String] + required :account_token, String + + # @!attribute activation_method + # + # @return [Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod] + required :activation_method, + -> { Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod } + + # @!attribute authentication_code + # Authentication code to provide to the user tokenizing a card. + # + # @return [String] + required :authentication_code, String + + # @!attribute card_token + # Unique identifier for the card being tokenized + # + # @return [String] + required :card_token, String + + # @!attribute created + # Indicate when the request was received from Mastercard or Visa + # + # @return [Time] + required :created, Time + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"tokenization.two_factor_authentication_code"] + required :event_type, const: :"tokenization.two_factor_authentication_code" + + # @!attribute tokenization_token + # Unique identifier for the tokenization + # + # @return [String] + required :tokenization_token, String + + # @!method initialize(account_token:, activation_method:, authentication_code:, card_token:, created:, tokenization_token:, event_type: :"tokenization.two_factor_authentication_code") + # @param account_token [String] Unique identifier for the user tokenizing a card + # + # @param activation_method [Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod] + # + # @param authentication_code [String] Authentication code to provide to the user tokenizing a card. + # + # @param card_token [String] Unique identifier for the card being tokenized + # + # @param created [Time] Indicate when the request was received from Mastercard or Visa + # + # @param tokenization_token [String] Unique identifier for the tokenization + # + # @param event_type [Symbol, :"tokenization.two_factor_authentication_code"] The type of event that occurred. + + # @see Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent#activation_method + class ActivationMethod < Lithic::Internal::Type::BaseModel + # @!attribute type + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + # + # @return [Symbol, Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type] + required :type, + enum: -> { Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type } + + # @!attribute value + # The location where the user wants to receive the authentication code. The format + # depends on the ActivationMethod.Type field. If Type is Email, the Value will be + # the email address. If the Type is Sms, the Value will be the phone number. + # + # @return [String] + required :value, String + + # @!method initialize(type:, value:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod} + # for more details. + # + # @param type [Symbol, Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type] The communication method that the user has selected to use to receive the authen + # + # @param value [String] The location where the user wants to receive the authentication code. + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + # + # @see Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod#type + module Type + extend Lithic::Internal::Type::Enum + + EMAIL_TO_CARDHOLDER_ADDRESS = :EMAIL_TO_CARDHOLDER_ADDRESS + TEXT_TO_CARDHOLDER_NUMBER = :TEXT_TO_CARDHOLDER_NUMBER + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/tokenization_unpause_params.rb b/lib/lithic/models/tokenization_unpause_params.rb new file mode 100644 index 00000000..1708e74e --- /dev/null +++ b/lib/lithic/models/tokenization_unpause_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Tokenizations#unpause + class TokenizationUnpauseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute tokenization_token + # + # @return [String] + required :tokenization_token, String + + # @!method initialize(tokenization_token:, request_options: {}) + # @param tokenization_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/tokenization_update_digital_card_art_params.rb b/lib/lithic/models/tokenization_update_digital_card_art_params.rb new file mode 100644 index 00000000..0dd474c8 --- /dev/null +++ b/lib/lithic/models/tokenization_update_digital_card_art_params.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Tokenizations#update_digital_card_art + class TokenizationUpdateDigitalCardArtParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute tokenization_token + # + # @return [String] + required :tokenization_token, String + + # @!attribute digital_card_art_token + # Specifies the digital card art to be displayed in the user’s digital wallet for + # a tokenization. This artwork must be approved by the network and configured by + # Lithic to use. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + # + # @return [String, nil] + optional :digital_card_art_token, String + + # @!method initialize(tokenization_token:, digital_card_art_token: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TokenizationUpdateDigitalCardArtParams} for more details. + # + # @param tokenization_token [String] + # + # @param digital_card_art_token [String] Specifies the digital card art to be displayed in the user’s digital wallet for + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/tokenization_updated_webhook_event.rb b/lib/lithic/models/tokenization_updated_webhook_event.rb new file mode 100644 index 00000000..ae6a443e --- /dev/null +++ b/lib/lithic/models/tokenization_updated_webhook_event.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TokenizationUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + # @!attribute account_token + # Account token + # + # @return [String] + required :account_token, String + + # @!attribute card_token + # Card token + # + # @return [String] + required :card_token, String + + # @!attribute created + # Created date + # + # @return [Time] + required :created, Time + + # @!attribute event_type + # The type of event that occurred. + # + # @return [Symbol, :"tokenization.updated"] + required :event_type, const: :"tokenization.updated" + + # @!attribute tokenization + # + # @return [Lithic::Models::Tokenization] + required :tokenization, -> { Lithic::Tokenization } + + # @!method initialize(account_token:, card_token:, created:, tokenization:, event_type: :"tokenization.updated") + # @param account_token [String] Account token + # + # @param card_token [String] Card token + # + # @param created [Time] Created date + # + # @param tokenization [Lithic::Models::Tokenization] + # + # @param event_type [Symbol, :"tokenization.updated"] The type of event that occurred. + end + end +end diff --git a/lib/lithic/models/transaction.rb b/lib/lithic/models/transaction.rb new file mode 100644 index 00000000..428527c0 --- /dev/null +++ b/lib/lithic/models/transaction.rb @@ -0,0 +1,1547 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Transactions#retrieve + class Transaction < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier. + # + # @return [String] + required :token, String + + # @!attribute account_token + # The token for the account associated with this transaction. + # + # @return [String] + required :account_token, String + + # @!attribute acquirer_fee + # Fee assessed by the merchant and paid for by the cardholder in the smallest unit + # of the currency. Will be zero if no fee is assessed. Rebates may be transmitted + # as a negative value to indicate credited fees. + # + # @return [Integer, nil] + required :acquirer_fee, Integer, nil?: true + + # @!attribute acquirer_reference_number + # @deprecated + # + # Unique identifier assigned to a transaction by the acquirer that can be used in + # dispute and chargeback filing. This field has been deprecated in favor of the + # `acquirer_reference_number` that resides in the event-level `network_info`. + # + # @return [String, nil] + required :acquirer_reference_number, String, nil?: true + + # @!attribute amount + # @deprecated + # + # When the transaction is pending, this represents the authorization amount of the + # transaction in the anticipated settlement currency. Once the transaction has + # settled, this field represents the settled amount in the settlement currency. + # + # @return [Integer] + required :amount, Integer + + # @!attribute amounts + # + # @return [Lithic::Models::Transaction::Amounts] + required :amounts, -> { Lithic::Transaction::Amounts } + + # @!attribute authorization_amount + # @deprecated + # + # The authorization amount of the transaction in the anticipated settlement + # currency. + # + # @return [Integer, nil] + required :authorization_amount, Integer, nil?: true + + # @!attribute authorization_code + # A fixed-width 6-digit numeric identifier that can be used to identify a + # transaction with networks. + # + # @return [String, nil] + required :authorization_code, String, nil?: true + + # @!attribute avs + # + # @return [Lithic::Models::Transaction::Avs, nil] + required :avs, -> { Lithic::Transaction::Avs }, nil?: true + + # @!attribute card_token + # Token for the card used in this transaction. + # + # @return [String] + required :card_token, String + + # @!attribute cardholder_authentication + # + # @return [Lithic::Models::CardholderAuthentication, nil] + required :cardholder_authentication, -> { Lithic::CardholderAuthentication }, nil?: true + + # @!attribute created + # Date and time when the transaction first occurred. UTC time zone. + # + # @return [Time] + required :created, Time + + # @!attribute financial_account_token + # + # @return [String, nil] + required :financial_account_token, String, nil?: true + + # @!attribute merchant + # Merchant information including full location details. + # + # @return [Lithic::Models::Transaction::Merchant] + required :merchant, -> { Lithic::Transaction::Merchant } + + # @!attribute merchant_amount + # @deprecated + # + # Analogous to the 'amount', but in the merchant currency. + # + # @return [Integer, nil] + required :merchant_amount, Integer, nil?: true + + # @!attribute merchant_authorization_amount + # @deprecated + # + # Analogous to the 'authorization_amount', but in the merchant currency. + # + # @return [Integer, nil] + required :merchant_authorization_amount, Integer, nil?: true + + # @!attribute merchant_currency + # @deprecated + # + # 3-character alphabetic ISO 4217 code for the local currency of the transaction. + # + # @return [String] + required :merchant_currency, String + + # @!attribute network + # Card network of the authorization. Value is `UNKNOWN` when Lithic cannot + # determine the network code from the upstream provider. + # + # @return [Symbol, Lithic::Models::Transaction::Network, nil] + required :network, enum: -> { Lithic::Transaction::Network }, nil?: true + + # @!attribute network_risk_score + # Network-provided score assessing risk level associated with a given + # authorization. Scores are on a range of 0-999, with 0 representing the lowest + # risk and 999 representing the highest risk. For Visa transactions, where the raw + # score has a range of 0-99, Lithic will normalize the score by multiplying the + # raw score by 10x. + # + # @return [Integer, nil] + required :network_risk_score, Integer, nil?: true + + # @!attribute pos + # + # @return [Lithic::Models::Transaction::Pos] + required :pos, -> { Lithic::Transaction::Pos } + + # @!attribute result + # + # @return [Symbol, Lithic::Models::Transaction::Result] + required :result, enum: -> { Lithic::Transaction::Result } + + # @!attribute service_location + # Where the cardholder received the service, when different from the card acceptor + # location. This is populated from network data elements such as Mastercard DE-122 + # SE1 SF9-14 and Visa F34 DS02. + # + # @return [Lithic::Models::Transaction::ServiceLocation, nil] + required :service_location, -> { Lithic::Transaction::ServiceLocation }, nil?: true + + # @!attribute settled_amount + # @deprecated + # + # The settled amount of the transaction in the settlement currency. + # + # @return [Integer] + required :settled_amount, Integer + + # @!attribute status + # Status of the transaction. + # + # @return [Symbol, Lithic::Models::Transaction::Status] + required :status, enum: -> { Lithic::Transaction::Status } + + # @!attribute tags + # Key-value pairs for tagging resources. Tags allow you to associate arbitrary + # metadata with a resource for your own purposes. + # + # @return [Hash{Symbol=>String}] + required :tags, Lithic::Internal::Type::HashOf[String] + + # @!attribute token_info + # + # @return [Lithic::Models::TokenInfo, nil] + required :token_info, -> { Lithic::TokenInfo }, nil?: true + + # @!attribute updated + # Date and time when the transaction last updated. UTC time zone. + # + # @return [Time] + required :updated, Time + + # @!attribute events + # + # @return [Array, nil] + optional :events, -> { Lithic::Internal::Type::ArrayOf[Lithic::Transaction::Event] } + + # @!method initialize(token:, account_token:, acquirer_fee:, acquirer_reference_number:, amount:, amounts:, authorization_amount:, authorization_code:, avs:, card_token:, cardholder_authentication:, created:, financial_account_token:, merchant:, merchant_amount:, merchant_authorization_amount:, merchant_currency:, network:, network_risk_score:, pos:, result:, service_location:, settled_amount:, status:, tags:, token_info:, updated:, events: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Transaction} for more details. + # + # @param token [String] Globally unique identifier. + # + # @param account_token [String] The token for the account associated with this transaction. + # + # @param acquirer_fee [Integer, nil] Fee assessed by the merchant and paid for by the cardholder in the smallest unit + # + # @param acquirer_reference_number [String, nil] Unique identifier assigned to a transaction by the acquirer that can be used in + # + # @param amount [Integer] When the transaction is pending, this represents the authorization amount of the + # + # @param amounts [Lithic::Models::Transaction::Amounts] + # + # @param authorization_amount [Integer, nil] The authorization amount of the transaction in the anticipated settlement curren + # + # @param authorization_code [String, nil] A fixed-width 6-digit numeric identifier that can be used to identify a transact + # + # @param avs [Lithic::Models::Transaction::Avs, nil] + # + # @param card_token [String] Token for the card used in this transaction. + # + # @param cardholder_authentication [Lithic::Models::CardholderAuthentication, nil] + # + # @param created [Time] Date and time when the transaction first occurred. UTC time zone. + # + # @param financial_account_token [String, nil] + # + # @param merchant [Lithic::Models::Transaction::Merchant] Merchant information including full location details. + # + # @param merchant_amount [Integer, nil] Analogous to the 'amount', but in the merchant currency. + # + # @param merchant_authorization_amount [Integer, nil] Analogous to the 'authorization_amount', but in the merchant currency. + # + # @param merchant_currency [String] 3-character alphabetic ISO 4217 code for the local currency of the transaction. + # + # @param network [Symbol, Lithic::Models::Transaction::Network, nil] Card network of the authorization. Value is `UNKNOWN` when Lithic cannot determi + # + # @param network_risk_score [Integer, nil] Network-provided score assessing risk level associated with a given authorizatio + # + # @param pos [Lithic::Models::Transaction::Pos] + # + # @param result [Symbol, Lithic::Models::Transaction::Result] + # + # @param service_location [Lithic::Models::Transaction::ServiceLocation, nil] Where the cardholder received the service, when different from the card acceptor + # + # @param settled_amount [Integer] The settled amount of the transaction in the settlement currency. + # + # @param status [Symbol, Lithic::Models::Transaction::Status] Status of the transaction. + # + # @param tags [Hash{Symbol=>String}] Key-value pairs for tagging resources. Tags allow you to associate arbitrary met + # + # @param token_info [Lithic::Models::TokenInfo, nil] + # + # @param updated [Time] Date and time when the transaction last updated. UTC time zone. + # + # @param events [Array] + + # @see Lithic::Models::Transaction#amounts + class Amounts < Lithic::Internal::Type::BaseModel + # @!attribute cardholder + # + # @return [Lithic::Models::Transaction::Amounts::Cardholder] + required :cardholder, -> { Lithic::Transaction::Amounts::Cardholder } + + # @!attribute hold + # + # @return [Lithic::Models::Transaction::Amounts::Hold] + required :hold, -> { Lithic::Transaction::Amounts::Hold } + + # @!attribute merchant + # + # @return [Lithic::Models::Transaction::Amounts::Merchant] + required :merchant, -> { Lithic::Transaction::Amounts::Merchant } + + # @!attribute settlement + # + # @return [Lithic::Models::Transaction::Amounts::Settlement] + required :settlement, -> { Lithic::Transaction::Amounts::Settlement } + + # @!method initialize(cardholder:, hold:, merchant:, settlement:) + # @param cardholder [Lithic::Models::Transaction::Amounts::Cardholder] + # @param hold [Lithic::Models::Transaction::Amounts::Hold] + # @param merchant [Lithic::Models::Transaction::Amounts::Merchant] + # @param settlement [Lithic::Models::Transaction::Amounts::Settlement] + + # @see Lithic::Models::Transaction::Amounts#cardholder + class Cardholder < Lithic::Internal::Type::BaseModel + # @!attribute amount + # The estimated settled amount of the transaction in the cardholder billing + # currency. + # + # @return [Integer] + required :amount, Integer + + # @!attribute conversion_rate + # The exchange rate used to convert the merchant amount to the cardholder billing + # amount. + # + # @return [String] + required :conversion_rate, String + + # @!attribute currency + # 3-character alphabetic ISO 4217 currency + # + # @return [String] + required :currency, String + + # @!method initialize(amount:, conversion_rate:, currency:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Transaction::Amounts::Cardholder} for more details. + # + # @param amount [Integer] The estimated settled amount of the transaction in the cardholder billing curren + # + # @param conversion_rate [String] The exchange rate used to convert the merchant amount to the cardholder billing + # + # @param currency [String] 3-character alphabetic ISO 4217 currency + end + + # @see Lithic::Models::Transaction::Amounts#hold + class Hold < Lithic::Internal::Type::BaseModel + # @!attribute amount + # The pending amount of the transaction in the anticipated settlement currency. + # + # @return [Integer] + required :amount, Integer + + # @!attribute currency + # 3-character alphabetic ISO 4217 currency + # + # @return [String] + required :currency, String + + # @!method initialize(amount:, currency:) + # @param amount [Integer] The pending amount of the transaction in the anticipated settlement currency. + # + # @param currency [String] 3-character alphabetic ISO 4217 currency + end + + # @see Lithic::Models::Transaction::Amounts#merchant + class Merchant < Lithic::Internal::Type::BaseModel + # @!attribute amount + # The settled amount of the transaction in the merchant currency. + # + # @return [Integer] + required :amount, Integer + + # @!attribute currency + # 3-character alphabetic ISO 4217 currency + # + # @return [String] + required :currency, String + + # @!method initialize(amount:, currency:) + # @param amount [Integer] The settled amount of the transaction in the merchant currency. + # + # @param currency [String] 3-character alphabetic ISO 4217 currency + end + + # @see Lithic::Models::Transaction::Amounts#settlement + class Settlement < Lithic::Internal::Type::BaseModel + # @!attribute amount + # The settled amount of the transaction in the settlement currency. + # + # @return [Integer] + required :amount, Integer + + # @!attribute currency + # 3-character alphabetic ISO 4217 currency + # + # @return [String] + required :currency, String + + # @!method initialize(amount:, currency:) + # @param amount [Integer] The settled amount of the transaction in the settlement currency. + # + # @param currency [String] 3-character alphabetic ISO 4217 currency + end + end + + # @see Lithic::Models::Transaction#avs + class Avs < Lithic::Internal::Type::BaseModel + # @!attribute address + # Cardholder address + # + # @return [String] + required :address, String + + # @!attribute zipcode + # Cardholder ZIP code + # + # @return [String] + required :zipcode, String + + # @!method initialize(address:, zipcode:) + # @param address [String] Cardholder address + # + # @param zipcode [String] Cardholder ZIP code + end + + # @see Lithic::Models::Transaction#merchant + class Merchant < Lithic::Models::Merchant + # @!attribute phone_number + # Phone number of card acceptor. + # + # @return [String, nil] + required :phone_number, String, nil?: true + + # @!attribute postal_code + # Postal code of card acceptor. + # + # @return [String, nil] + required :postal_code, String, nil?: true + + # @!attribute street_address + # Street address of card acceptor. + # + # @return [String, nil] + required :street_address, String, nil?: true + + # @!method initialize(phone_number:, postal_code:, street_address:) + # Merchant information including full location details. + # + # @param phone_number [String, nil] Phone number of card acceptor. + # + # @param postal_code [String, nil] Postal code of card acceptor. + # + # @param street_address [String, nil] Street address of card acceptor. + end + + # Card network of the authorization. Value is `UNKNOWN` when Lithic cannot + # determine the network code from the upstream provider. + # + # @see Lithic::Models::Transaction#network + module Network + extend Lithic::Internal::Type::Enum + + AMEX = :AMEX + INTERLINK = :INTERLINK + MAESTRO = :MAESTRO + MASTERCARD = :MASTERCARD + UNKNOWN = :UNKNOWN + VISA = :VISA + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::Transaction#pos + class Pos < Lithic::Internal::Type::BaseModel + # @!attribute entry_mode + # + # @return [Lithic::Models::Transaction::Pos::EntryMode] + required :entry_mode, -> { Lithic::Transaction::Pos::EntryMode } + + # @!attribute terminal + # + # @return [Lithic::Models::Transaction::Pos::Terminal] + required :terminal, -> { Lithic::Transaction::Pos::Terminal } + + # @!method initialize(entry_mode:, terminal:) + # @param entry_mode [Lithic::Models::Transaction::Pos::EntryMode] + # @param terminal [Lithic::Models::Transaction::Pos::Terminal] + + # @see Lithic::Models::Transaction::Pos#entry_mode + class EntryMode < Lithic::Internal::Type::BaseModel + # @!attribute card + # Card presence indicator + # + # @return [Symbol, Lithic::Models::Transaction::Pos::EntryMode::Card] + required :card, enum: -> { Lithic::Transaction::Pos::EntryMode::Card } + + # @!attribute cardholder + # Cardholder presence indicator + # + # @return [Symbol, Lithic::Models::Transaction::Pos::EntryMode::Cardholder] + required :cardholder, enum: -> { Lithic::Transaction::Pos::EntryMode::Cardholder } + + # @!attribute pan + # Method of entry for the PAN + # + # @return [Symbol, Lithic::Models::Transaction::Pos::EntryMode::Pan] + required :pan, enum: -> { Lithic::Transaction::Pos::EntryMode::Pan } + + # @!attribute pin_entered + # Indicates whether the cardholder entered the PIN. True if the PIN was entered. + # + # @return [Boolean] + required :pin_entered, Lithic::Internal::Type::Boolean + + # @!method initialize(card:, cardholder:, pan:, pin_entered:) + # @param card [Symbol, Lithic::Models::Transaction::Pos::EntryMode::Card] Card presence indicator + # + # @param cardholder [Symbol, Lithic::Models::Transaction::Pos::EntryMode::Cardholder] Cardholder presence indicator + # + # @param pan [Symbol, Lithic::Models::Transaction::Pos::EntryMode::Pan] Method of entry for the PAN + # + # @param pin_entered [Boolean] Indicates whether the cardholder entered the PIN. True if the PIN was entered. + + # Card presence indicator + # + # @see Lithic::Models::Transaction::Pos::EntryMode#card + module Card + extend Lithic::Internal::Type::Enum + + NOT_PRESENT = :NOT_PRESENT + PREAUTHORIZED = :PREAUTHORIZED + PRESENT = :PRESENT + UNKNOWN = :UNKNOWN + + # @!method self.values + # @return [Array] + end + + # Cardholder presence indicator + # + # @see Lithic::Models::Transaction::Pos::EntryMode#cardholder + module Cardholder + extend Lithic::Internal::Type::Enum + + DEFERRED_BILLING = :DEFERRED_BILLING + ELECTRONIC_ORDER = :ELECTRONIC_ORDER + INSTALLMENT = :INSTALLMENT + MAIL_ORDER = :MAIL_ORDER + NOT_PRESENT = :NOT_PRESENT + PREAUTHORIZED = :PREAUTHORIZED + PRESENT = :PRESENT + REOCCURRING = :REOCCURRING + TELEPHONE_ORDER = :TELEPHONE_ORDER + UNKNOWN = :UNKNOWN + + # @!method self.values + # @return [Array] + end + + # Method of entry for the PAN + # + # @see Lithic::Models::Transaction::Pos::EntryMode#pan + module Pan + extend Lithic::Internal::Type::Enum + + AUTO_ENTRY = :AUTO_ENTRY + BAR_CODE = :BAR_CODE + CONTACTLESS = :CONTACTLESS + CREDENTIAL_ON_FILE = :CREDENTIAL_ON_FILE + ECOMMERCE = :ECOMMERCE + ERROR_KEYED = :ERROR_KEYED + ERROR_MAGNETIC_STRIPE = :ERROR_MAGNETIC_STRIPE + ICC = :ICC + KEY_ENTERED = :KEY_ENTERED + MAGNETIC_STRIPE = :MAGNETIC_STRIPE + MANUAL = :MANUAL + OCR = :OCR + SECURE_CARDLESS = :SECURE_CARDLESS + UNKNOWN = :UNKNOWN + UNSPECIFIED = :UNSPECIFIED + + # @!method self.values + # @return [Array] + end + end + + # @see Lithic::Models::Transaction::Pos#terminal + class Terminal < Lithic::Internal::Type::BaseModel + # @!attribute attended + # True if a clerk is present at the sale. + # + # @return [Boolean] + required :attended, Lithic::Internal::Type::Boolean + + # @!attribute card_retention_capable + # True if the terminal is capable of retaining the card. + # + # @return [Boolean] + required :card_retention_capable, Lithic::Internal::Type::Boolean + + # @!attribute on_premise + # True if the sale was made at the place of business (vs. mobile). + # + # @return [Boolean] + required :on_premise, Lithic::Internal::Type::Boolean + + # @!attribute operator + # The person that is designated to swipe the card + # + # @return [Symbol, Lithic::Models::Transaction::Pos::Terminal::Operator] + required :operator, enum: -> { Lithic::Transaction::Pos::Terminal::Operator } + + # @!attribute partial_approval_capable + # True if the terminal is capable of partial approval. Partial approval is when + # part of a transaction is approved and another payment must be used for the + # remainder. Example scenario: A $40 transaction is attempted on a prepaid card + # with a $25 balance. If partial approval is enabled, $25 can be authorized, at + # which point the POS will prompt the user for an additional payment of $15. + # + # @return [Boolean] + required :partial_approval_capable, Lithic::Internal::Type::Boolean + + # @!attribute pin_capability + # Status of whether the POS is able to accept PINs + # + # @return [Symbol, Lithic::Models::Transaction::Pos::Terminal::PinCapability] + required :pin_capability, enum: -> { Lithic::Transaction::Pos::Terminal::PinCapability } + + # @!attribute type + # POS Type + # + # @return [Symbol, Lithic::Models::Transaction::Pos::Terminal::Type] + required :type, enum: -> { Lithic::Transaction::Pos::Terminal::Type } + + # @!attribute acceptor_terminal_id + # Uniquely identifies a terminal at the card acceptor location of acquiring + # institutions or merchant POS Systems + # + # @return [String, nil] + optional :acceptor_terminal_id, String, nil?: true + + # @!method initialize(attended:, card_retention_capable:, on_premise:, operator:, partial_approval_capable:, pin_capability:, type:, acceptor_terminal_id: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Transaction::Pos::Terminal} for more details. + # + # @param attended [Boolean] True if a clerk is present at the sale. + # + # @param card_retention_capable [Boolean] True if the terminal is capable of retaining the card. + # + # @param on_premise [Boolean] True if the sale was made at the place of business (vs. mobile). + # + # @param operator [Symbol, Lithic::Models::Transaction::Pos::Terminal::Operator] The person that is designated to swipe the card + # + # @param partial_approval_capable [Boolean] True if the terminal is capable of partial approval. Partial approval is when pa + # + # @param pin_capability [Symbol, Lithic::Models::Transaction::Pos::Terminal::PinCapability] Status of whether the POS is able to accept PINs + # + # @param type [Symbol, Lithic::Models::Transaction::Pos::Terminal::Type] POS Type + # + # @param acceptor_terminal_id [String, nil] Uniquely identifies a terminal at the card acceptor location of acquiring instit + + # The person that is designated to swipe the card + # + # @see Lithic::Models::Transaction::Pos::Terminal#operator + module Operator + extend Lithic::Internal::Type::Enum + + ADMINISTRATIVE = :ADMINISTRATIVE + CARDHOLDER = :CARDHOLDER + CARD_ACCEPTOR = :CARD_ACCEPTOR + UNKNOWN = :UNKNOWN + + # @!method self.values + # @return [Array] + end + + # Status of whether the POS is able to accept PINs + # + # @see Lithic::Models::Transaction::Pos::Terminal#pin_capability + module PinCapability + extend Lithic::Internal::Type::Enum + + CAPABLE = :CAPABLE + INOPERATIVE = :INOPERATIVE + NOT_CAPABLE = :NOT_CAPABLE + UNSPECIFIED = :UNSPECIFIED + + # @!method self.values + # @return [Array] + end + + # POS Type + # + # @see Lithic::Models::Transaction::Pos::Terminal#type + module Type + extend Lithic::Internal::Type::Enum + + ADMINISTRATIVE = :ADMINISTRATIVE + ATM = :ATM + AUTHORIZATION = :AUTHORIZATION + COUPON_MACHINE = :COUPON_MACHINE + DIAL_TERMINAL = :DIAL_TERMINAL + ECOMMERCE = :ECOMMERCE + ECR = :ECR + FUEL_MACHINE = :FUEL_MACHINE + HOME_TERMINAL = :HOME_TERMINAL + MICR = :MICR + OFF_PREMISE = :OFF_PREMISE + PAYMENT = :PAYMENT + PDA = :PDA + PHONE = :PHONE + POINT = :POINT + POS_TERMINAL = :POS_TERMINAL + PUBLIC_UTILITY = :PUBLIC_UTILITY + SELF_SERVICE = :SELF_SERVICE + TELEVISION = :TELEVISION + TELLER = :TELLER + TRAVELERS_CHECK_MACHINE = :TRAVELERS_CHECK_MACHINE + VENDING = :VENDING + VOICE = :VOICE + UNKNOWN = :UNKNOWN + + # @!method self.values + # @return [Array] + end + end + end + + # @see Lithic::Models::Transaction#result + module Result + extend Lithic::Internal::Type::Enum + + ACCOUNT_PAUSED = :ACCOUNT_PAUSED + ACCOUNT_STATE_TRANSACTION_FAIL = :ACCOUNT_STATE_TRANSACTION_FAIL + APPROVED = :APPROVED + BANK_CONNECTION_ERROR = :BANK_CONNECTION_ERROR + BANK_NOT_VERIFIED = :BANK_NOT_VERIFIED + CARD_CLOSED = :CARD_CLOSED + CARD_PAUSED = :CARD_PAUSED + DECLINED = :DECLINED + FRAUD_ADVICE = :FRAUD_ADVICE + IGNORED_TTL_EXPIRY = :IGNORED_TTL_EXPIRY + SUSPECTED_FRAUD = :SUSPECTED_FRAUD + INACTIVE_ACCOUNT = :INACTIVE_ACCOUNT + INCORRECT_PIN = :INCORRECT_PIN + INVALID_CARD_DETAILS = :INVALID_CARD_DETAILS + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + INSUFFICIENT_FUNDS_PRELOAD = :INSUFFICIENT_FUNDS_PRELOAD + INVALID_TRANSACTION = :INVALID_TRANSACTION + MERCHANT_BLACKLIST = :MERCHANT_BLACKLIST + ORIGINAL_NOT_FOUND = :ORIGINAL_NOT_FOUND + PREVIOUSLY_COMPLETED = :PREVIOUSLY_COMPLETED + SINGLE_USE_RECHARGED = :SINGLE_USE_RECHARGED + SWITCH_INOPERATIVE_ADVICE = :SWITCH_INOPERATIVE_ADVICE + UNAUTHORIZED_MERCHANT = :UNAUTHORIZED_MERCHANT + UNKNOWN_HOST_TIMEOUT = :UNKNOWN_HOST_TIMEOUT + USER_TRANSACTION_LIMIT = :USER_TRANSACTION_LIMIT + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::Transaction#service_location + class ServiceLocation < Lithic::Internal::Type::BaseModel + # @!attribute city + # City of service location. + # + # @return [String, nil] + required :city, String, nil?: true + + # @!attribute country + # Country code of service location, ISO 3166-1 alpha-3. + # + # @return [String, nil] + required :country, String, nil?: true + + # @!attribute postal_code + # Postal code of service location. + # + # @return [String, nil] + required :postal_code, String, nil?: true + + # @!attribute state + # State/province code of service location, ISO 3166-2. + # + # @return [String, nil] + required :state, String, nil?: true + + # @!attribute street_address + # Street address of service location. + # + # @return [String, nil] + required :street_address, String, nil?: true + + # @!method initialize(city:, country:, postal_code:, state:, street_address:) + # Where the cardholder received the service, when different from the card acceptor + # location. This is populated from network data elements such as Mastercard DE-122 + # SE1 SF9-14 and Visa F34 DS02. + # + # @param city [String, nil] City of service location. + # + # @param country [String, nil] Country code of service location, ISO 3166-1 alpha-3. + # + # @param postal_code [String, nil] Postal code of service location. + # + # @param state [String, nil] State/province code of service location, ISO 3166-2. + # + # @param street_address [String, nil] Street address of service location. + end + + # Status of the transaction. + # + # @see Lithic::Models::Transaction#status + module Status + extend Lithic::Internal::Type::Enum + + DECLINED = :DECLINED + EXPIRED = :EXPIRED + PENDING = :PENDING + SETTLED = :SETTLED + VOIDED = :VOIDED + + # @!method self.values + # @return [Array] + end + + class Event < Lithic::Internal::Type::BaseModel + # @!attribute token + # Transaction event identifier. + # + # @return [String] + required :token, String + + # @!attribute amount + # @deprecated + # + # Amount of the event in the settlement currency. + # + # @return [Integer] + required :amount, Integer + + # @!attribute amounts + # + # @return [Lithic::Models::Transaction::Event::Amounts] + required :amounts, -> { Lithic::Transaction::Event::Amounts } + + # @!attribute created + # RFC 3339 date and time this event entered the system. UTC time zone. + # + # @return [Time] + required :created, Time + + # @!attribute detailed_results + # + # @return [Array] + required :detailed_results, + -> { Lithic::Internal::Type::ArrayOf[enum: Lithic::Transaction::Event::DetailedResult] } + + # @!attribute effective_polarity + # Indicates whether the transaction event is a credit or debit to the account. + # + # @return [Symbol, Lithic::Models::Transaction::Event::EffectivePolarity] + required :effective_polarity, enum: -> { Lithic::Transaction::Event::EffectivePolarity } + + # @!attribute network_info + # Information provided by the card network in each event. This includes common + # identifiers shared between you, Lithic, the card network and in some cases the + # acquirer. These identifiers often link together events within the same + # transaction lifecycle and can be used to locate a particular transaction, such + # as during processing of disputes. Not all fields are available in all events, + # and the presence of these fields is dependent on the card network and the event + # type. If the field is populated by the network, we will pass it through as is + # unless otherwise specified. Please consult the official network documentation + # for more details about these fields and how to use them. + # + # @return [Lithic::Models::Transaction::Event::NetworkInfo, nil] + required :network_info, -> { Lithic::Transaction::Event::NetworkInfo }, nil?: true + + # @!attribute result + # + # @return [Symbol, Lithic::Models::Transaction::Event::Result] + required :result, enum: -> { Lithic::Transaction::Event::Result } + + # @!attribute rule_results + # + # @return [Array] + required :rule_results, -> { Lithic::Internal::Type::ArrayOf[Lithic::Transaction::Event::RuleResult] } + + # @!attribute type + # Type of transaction event + # + # @return [Symbol, Lithic::Models::Transaction::Event::Type] + required :type, enum: -> { Lithic::Transaction::Event::Type } + + # @!attribute account_type + # + # @return [Symbol, Lithic::Models::Transaction::Event::AccountType, nil] + optional :account_type, enum: -> { Lithic::Transaction::Event::AccountType } + + # @!attribute network_specific_data + # + # @return [Lithic::Models::Transaction::Event::NetworkSpecificData, nil] + optional :network_specific_data, -> { Lithic::Transaction::Event::NetworkSpecificData }, nil?: true + + # @!method initialize(token:, amount:, amounts:, created:, detailed_results:, effective_polarity:, network_info:, result:, rule_results:, type:, account_type: nil, network_specific_data: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Transaction::Event} for more details. + # + # @param token [String] Transaction event identifier. + # + # @param amount [Integer] Amount of the event in the settlement currency. + # + # @param amounts [Lithic::Models::Transaction::Event::Amounts] + # + # @param created [Time] RFC 3339 date and time this event entered the system. UTC time zone. + # + # @param detailed_results [Array] + # + # @param effective_polarity [Symbol, Lithic::Models::Transaction::Event::EffectivePolarity] Indicates whether the transaction event is a credit or debit to the account. + # + # @param network_info [Lithic::Models::Transaction::Event::NetworkInfo, nil] Information provided by the card network in each event. This includes common ide + # + # @param result [Symbol, Lithic::Models::Transaction::Event::Result] + # + # @param rule_results [Array] + # + # @param type [Symbol, Lithic::Models::Transaction::Event::Type] Type of transaction event + # + # @param account_type [Symbol, Lithic::Models::Transaction::Event::AccountType] + # + # @param network_specific_data [Lithic::Models::Transaction::Event::NetworkSpecificData, nil] + + # @see Lithic::Models::Transaction::Event#amounts + class Amounts < Lithic::Internal::Type::BaseModel + # @!attribute cardholder + # + # @return [Lithic::Models::Transaction::Event::Amounts::Cardholder] + required :cardholder, -> { Lithic::Transaction::Event::Amounts::Cardholder } + + # @!attribute merchant + # + # @return [Lithic::Models::Transaction::Event::Amounts::Merchant] + required :merchant, -> { Lithic::Transaction::Event::Amounts::Merchant } + + # @!attribute settlement + # + # @return [Lithic::Models::Transaction::Event::Amounts::Settlement, nil] + required :settlement, -> { Lithic::Transaction::Event::Amounts::Settlement }, nil?: true + + # @!method initialize(cardholder:, merchant:, settlement:) + # @param cardholder [Lithic::Models::Transaction::Event::Amounts::Cardholder] + # @param merchant [Lithic::Models::Transaction::Event::Amounts::Merchant] + # @param settlement [Lithic::Models::Transaction::Event::Amounts::Settlement, nil] + + # @see Lithic::Models::Transaction::Event::Amounts#cardholder + class Cardholder < Lithic::Internal::Type::BaseModel + # @!attribute amount + # Amount of the event in the cardholder billing currency. + # + # @return [Integer] + required :amount, Integer + + # @!attribute conversion_rate + # Exchange rate used to convert the merchant amount to the cardholder billing + # amount. + # + # @return [String] + required :conversion_rate, String + + # @!attribute currency + # 3-character alphabetic ISO 4217 currency + # + # @return [String] + required :currency, String + + # @!method initialize(amount:, conversion_rate:, currency:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Transaction::Event::Amounts::Cardholder} for more details. + # + # @param amount [Integer] Amount of the event in the cardholder billing currency. + # + # @param conversion_rate [String] Exchange rate used to convert the merchant amount to the cardholder billing amou + # + # @param currency [String] 3-character alphabetic ISO 4217 currency + end + + # @see Lithic::Models::Transaction::Event::Amounts#merchant + class Merchant < Lithic::Internal::Type::BaseModel + # @!attribute amount + # Amount of the event in the merchant currency. + # + # @return [Integer] + required :amount, Integer + + # @!attribute currency + # 3-character alphabetic ISO 4217 currency + # + # @return [String] + required :currency, String + + # @!method initialize(amount:, currency:) + # @param amount [Integer] Amount of the event in the merchant currency. + # + # @param currency [String] 3-character alphabetic ISO 4217 currency + end + + # @see Lithic::Models::Transaction::Event::Amounts#settlement + class Settlement < Lithic::Internal::Type::BaseModel + # @!attribute amount + # Amount of the event, if it is financial, in the settlement currency. + # Non-financial events do not contain this amount because they do not move funds. + # + # @return [Integer] + required :amount, Integer + + # @!attribute conversion_rate + # Exchange rate used to convert the merchant amount to the settlement amount. + # + # @return [String] + required :conversion_rate, String + + # @!attribute currency + # 3-character alphabetic ISO 4217 currency + # + # @return [String] + required :currency, String + + # @!method initialize(amount:, conversion_rate:, currency:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Transaction::Event::Amounts::Settlement} for more details. + # + # @param amount [Integer] Amount of the event, if it is financial, in the settlement currency. Non-financi + # + # @param conversion_rate [String] Exchange rate used to convert the merchant amount to the settlement amount. + # + # @param currency [String] 3-character alphabetic ISO 4217 currency + end + end + + module DetailedResult + extend Lithic::Internal::Type::Enum + + ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED = :ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED + ACCOUNT_DELINQUENT = :ACCOUNT_DELINQUENT + ACCOUNT_INACTIVE = :ACCOUNT_INACTIVE + ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED = :ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED + ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED = :ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED + ACCOUNT_PAUSED = :ACCOUNT_PAUSED + ACCOUNT_UNDER_REVIEW = :ACCOUNT_UNDER_REVIEW + ADDRESS_INCORRECT = :ADDRESS_INCORRECT + APPROVED = :APPROVED + AUTH_RULE_ALLOWED_COUNTRY = :AUTH_RULE_ALLOWED_COUNTRY + AUTH_RULE_ALLOWED_MCC = :AUTH_RULE_ALLOWED_MCC + AUTH_RULE_BLOCKED_COUNTRY = :AUTH_RULE_BLOCKED_COUNTRY + AUTH_RULE_BLOCKED_MCC = :AUTH_RULE_BLOCKED_MCC + AUTH_RULE = :AUTH_RULE + CARD_CLOSED = :CARD_CLOSED + CARD_CRYPTOGRAM_VALIDATION_FAILURE = :CARD_CRYPTOGRAM_VALIDATION_FAILURE + CARD_EXPIRED = :CARD_EXPIRED + CARD_EXPIRY_DATE_INCORRECT = :CARD_EXPIRY_DATE_INCORRECT + CARD_INVALID = :CARD_INVALID + CARD_NOT_ACTIVATED = :CARD_NOT_ACTIVATED + CARD_PAUSED = :CARD_PAUSED + CARD_PIN_INCORRECT = :CARD_PIN_INCORRECT + CARD_RESTRICTED = :CARD_RESTRICTED + CARD_SECURITY_CODE_INCORRECT = :CARD_SECURITY_CODE_INCORRECT + CARD_SPEND_LIMIT_EXCEEDED = :CARD_SPEND_LIMIT_EXCEEDED + CONTACT_CARD_ISSUER = :CONTACT_CARD_ISSUER + CUSTOMER_ASA_TIMEOUT = :CUSTOMER_ASA_TIMEOUT + CUSTOM_ASA_RESULT = :CUSTOM_ASA_RESULT + DECLINED = :DECLINED + DO_NOT_HONOR = :DO_NOT_HONOR + DRIVER_NUMBER_INVALID = :DRIVER_NUMBER_INVALID + FORMAT_ERROR = :FORMAT_ERROR + INSUFFICIENT_FUNDING_SOURCE_BALANCE = :INSUFFICIENT_FUNDING_SOURCE_BALANCE + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + LITHIC_SYSTEM_ERROR = :LITHIC_SYSTEM_ERROR + LITHIC_SYSTEM_RATE_LIMIT = :LITHIC_SYSTEM_RATE_LIMIT + MALFORMED_ASA_RESPONSE = :MALFORMED_ASA_RESPONSE + MERCHANT_INVALID = :MERCHANT_INVALID + MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE = :MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE + MERCHANT_NOT_PERMITTED = :MERCHANT_NOT_PERMITTED + OVER_REVERSAL_ATTEMPTED = :OVER_REVERSAL_ATTEMPTED + PIN_BLOCKED = :PIN_BLOCKED + PROGRAM_CARD_SPEND_LIMIT_EXCEEDED = :PROGRAM_CARD_SPEND_LIMIT_EXCEEDED + PROGRAM_SUSPENDED = :PROGRAM_SUSPENDED + PROGRAM_USAGE_RESTRICTION = :PROGRAM_USAGE_RESTRICTION + REVERSAL_UNMATCHED = :REVERSAL_UNMATCHED + SECURITY_VIOLATION = :SECURITY_VIOLATION + SINGLE_USE_CARD_REATTEMPTED = :SINGLE_USE_CARD_REATTEMPTED + SUSPECTED_FRAUD = :SUSPECTED_FRAUD + TRANSACTION_INVALID = :TRANSACTION_INVALID + TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL = :TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL + TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER = :TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER + TRANSACTION_PREVIOUSLY_COMPLETED = :TRANSACTION_PREVIOUSLY_COMPLETED + UNAUTHORIZED_MERCHANT = :UNAUTHORIZED_MERCHANT + VEHICLE_NUMBER_INVALID = :VEHICLE_NUMBER_INVALID + CARDHOLDER_CHALLENGED = :CARDHOLDER_CHALLENGED + CARDHOLDER_CHALLENGE_FAILED = :CARDHOLDER_CHALLENGE_FAILED + + # @!method self.values + # @return [Array] + end + + # Indicates whether the transaction event is a credit or debit to the account. + # + # @see Lithic::Models::Transaction::Event#effective_polarity + module EffectivePolarity + extend Lithic::Internal::Type::Enum + + CREDIT = :CREDIT + DEBIT = :DEBIT + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::Transaction::Event#network_info + class NetworkInfo < Lithic::Internal::Type::BaseModel + # @!attribute acquirer + # + # @return [Lithic::Models::Transaction::Event::NetworkInfo::Acquirer, nil] + required :acquirer, -> { Lithic::Transaction::Event::NetworkInfo::Acquirer }, nil?: true + + # @!attribute amex + # + # @return [Lithic::Models::Transaction::Event::NetworkInfo::Amex, nil] + required :amex, -> { Lithic::Transaction::Event::NetworkInfo::Amex }, nil?: true + + # @!attribute mastercard + # + # @return [Lithic::Models::Transaction::Event::NetworkInfo::Mastercard, nil] + required :mastercard, -> { Lithic::Transaction::Event::NetworkInfo::Mastercard }, nil?: true + + # @!attribute visa + # + # @return [Lithic::Models::Transaction::Event::NetworkInfo::Visa, nil] + required :visa, -> { Lithic::Transaction::Event::NetworkInfo::Visa }, nil?: true + + # @!method initialize(acquirer:, amex:, mastercard:, visa:) + # Information provided by the card network in each event. This includes common + # identifiers shared between you, Lithic, the card network and in some cases the + # acquirer. These identifiers often link together events within the same + # transaction lifecycle and can be used to locate a particular transaction, such + # as during processing of disputes. Not all fields are available in all events, + # and the presence of these fields is dependent on the card network and the event + # type. If the field is populated by the network, we will pass it through as is + # unless otherwise specified. Please consult the official network documentation + # for more details about these fields and how to use them. + # + # @param acquirer [Lithic::Models::Transaction::Event::NetworkInfo::Acquirer, nil] + # @param amex [Lithic::Models::Transaction::Event::NetworkInfo::Amex, nil] + # @param mastercard [Lithic::Models::Transaction::Event::NetworkInfo::Mastercard, nil] + # @param visa [Lithic::Models::Transaction::Event::NetworkInfo::Visa, nil] + + # @see Lithic::Models::Transaction::Event::NetworkInfo#acquirer + class Acquirer < Lithic::Internal::Type::BaseModel + # @!attribute acquirer_reference_number + # Identifier assigned by the acquirer, applicable to dual-message transactions + # only. The acquirer reference number (ARN) is only populated once a transaction + # has been cleared, and it is not available in all transactions (such as automated + # fuel dispenser transactions). A single transaction can contain multiple ARNs if + # the merchant sends multiple clearings. + # + # @return [String, nil] + required :acquirer_reference_number, String, nil?: true + + # @!attribute retrieval_reference_number + # Identifier assigned by the acquirer. + # + # @return [String, nil] + required :retrieval_reference_number, String, nil?: true + + # @!method initialize(acquirer_reference_number:, retrieval_reference_number:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Transaction::Event::NetworkInfo::Acquirer} for more details. + # + # @param acquirer_reference_number [String, nil] Identifier assigned by the acquirer, applicable to dual-message transactions onl + # + # @param retrieval_reference_number [String, nil] Identifier assigned by the acquirer. + end + + # @see Lithic::Models::Transaction::Event::NetworkInfo#amex + class Amex < Lithic::Internal::Type::BaseModel + # @!attribute original_transaction_id + # Identifier assigned by American Express. Matches the `transaction_id` of a prior + # related event. May be populated in incremental authorizations (authorization + # requests that augment a previously authorized amount), authorization advices, + # financial authorizations, and clearings. + # + # @return [String, nil] + required :original_transaction_id, String, nil?: true + + # @!attribute transaction_id + # Identifier assigned by American Express to link original messages to subsequent + # messages. Guaranteed by American Express to be unique for each original + # authorization and financial authorization. + # + # @return [String, nil] + required :transaction_id, String, nil?: true + + # @!method initialize(original_transaction_id:, transaction_id:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Transaction::Event::NetworkInfo::Amex} for more details. + # + # @param original_transaction_id [String, nil] Identifier assigned by American Express. Matches the `transaction_id` of a prior + # + # @param transaction_id [String, nil] Identifier assigned by American Express to link original messages to subsequent + end + + # @see Lithic::Models::Transaction::Event::NetworkInfo#mastercard + class Mastercard < Lithic::Internal::Type::BaseModel + # @!attribute banknet_reference_number + # Identifier assigned by Mastercard. Guaranteed by Mastercard to be unique for any + # transaction within a specific financial network on any processing day. + # + # @return [String, nil] + required :banknet_reference_number, String, nil?: true + + # @!attribute original_banknet_reference_number + # Identifier assigned by Mastercard. Matches the `banknet_reference_number` of a + # prior related event. May be populated in authorization reversals, incremental + # authorizations (authorization requests that augment a previously authorized + # amount), automated fuel dispenser authorization advices and clearings, and + # financial authorizations. If the original banknet reference number contains all + # zeroes, then no actual reference number could be found by the network or + # acquirer. If Mastercard converts a transaction from dual-message to + # single-message, such as for certain ATM transactions, it will populate the + # original banknet reference number in the resulting financial authorization with + # the banknet reference number of the initial authorization, which Lithic does not + # receive. + # + # @return [String, nil] + required :original_banknet_reference_number, String, nil?: true + + # @!attribute original_switch_serial_number + # Identifier assigned by Mastercard. Matches the `switch_serial_number` of a prior + # related event. May be populated in returns and return reversals. Applicable to + # single-message transactions only. + # + # @return [String, nil] + required :original_switch_serial_number, String, nil?: true + + # @!attribute switch_serial_number + # Identifier assigned by Mastercard, applicable to single-message transactions + # only. + # + # @return [String, nil] + required :switch_serial_number, String, nil?: true + + # @!method initialize(banknet_reference_number:, original_banknet_reference_number:, original_switch_serial_number:, switch_serial_number:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Transaction::Event::NetworkInfo::Mastercard} for more details. + # + # @param banknet_reference_number [String, nil] Identifier assigned by Mastercard. Guaranteed by Mastercard to be unique for any + # + # @param original_banknet_reference_number [String, nil] Identifier assigned by Mastercard. Matches the `banknet_reference_number` of a p + # + # @param original_switch_serial_number [String, nil] Identifier assigned by Mastercard. Matches the `switch_serial_number` of a prior + # + # @param switch_serial_number [String, nil] Identifier assigned by Mastercard, applicable to single-message transactions onl + end + + # @see Lithic::Models::Transaction::Event::NetworkInfo#visa + class Visa < Lithic::Internal::Type::BaseModel + # @!attribute original_transaction_id + # Identifier assigned by Visa. Matches the `transaction_id` of a prior related + # event. May be populated in incremental authorizations (authorization requests + # that augment a previously authorized amount), authorization advices, financial + # authorizations, and clearings. + # + # @return [String, nil] + required :original_transaction_id, String, nil?: true + + # @!attribute transaction_id + # Identifier assigned by Visa to link original messages to subsequent messages. + # Guaranteed by Visa to be unique for each original authorization and financial + # authorization. + # + # @return [String, nil] + required :transaction_id, String, nil?: true + + # @!method initialize(original_transaction_id:, transaction_id:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Transaction::Event::NetworkInfo::Visa} for more details. + # + # @param original_transaction_id [String, nil] Identifier assigned by Visa. Matches the `transaction_id` of a prior related eve + # + # @param transaction_id [String, nil] Identifier assigned by Visa to link original messages to subsequent messages. Gu + end + end + + # @see Lithic::Models::Transaction::Event#result + module Result + extend Lithic::Internal::Type::Enum + + ACCOUNT_PAUSED = :ACCOUNT_PAUSED + ACCOUNT_STATE_TRANSACTION_FAIL = :ACCOUNT_STATE_TRANSACTION_FAIL + APPROVED = :APPROVED + BANK_CONNECTION_ERROR = :BANK_CONNECTION_ERROR + BANK_NOT_VERIFIED = :BANK_NOT_VERIFIED + CARD_CLOSED = :CARD_CLOSED + CARD_PAUSED = :CARD_PAUSED + DECLINED = :DECLINED + FRAUD_ADVICE = :FRAUD_ADVICE + IGNORED_TTL_EXPIRY = :IGNORED_TTL_EXPIRY + SUSPECTED_FRAUD = :SUSPECTED_FRAUD + INACTIVE_ACCOUNT = :INACTIVE_ACCOUNT + INCORRECT_PIN = :INCORRECT_PIN + INVALID_CARD_DETAILS = :INVALID_CARD_DETAILS + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + INSUFFICIENT_FUNDS_PRELOAD = :INSUFFICIENT_FUNDS_PRELOAD + INVALID_TRANSACTION = :INVALID_TRANSACTION + MERCHANT_BLACKLIST = :MERCHANT_BLACKLIST + ORIGINAL_NOT_FOUND = :ORIGINAL_NOT_FOUND + PREVIOUSLY_COMPLETED = :PREVIOUSLY_COMPLETED + SINGLE_USE_RECHARGED = :SINGLE_USE_RECHARGED + SWITCH_INOPERATIVE_ADVICE = :SWITCH_INOPERATIVE_ADVICE + UNAUTHORIZED_MERCHANT = :UNAUTHORIZED_MERCHANT + UNKNOWN_HOST_TIMEOUT = :UNKNOWN_HOST_TIMEOUT + USER_TRANSACTION_LIMIT = :USER_TRANSACTION_LIMIT + + # @!method self.values + # @return [Array] + end + + class RuleResult < Lithic::Internal::Type::BaseModel + # @!attribute auth_rule_token + # The Auth Rule Token associated with the rule from which the decline originated. + # If this is set to null, then the decline was not associated with a + # customer-configured Auth Rule. This may happen in cases where a transaction is + # declined due to a Lithic-configured security or compliance rule, for example. + # + # @return [String, nil] + required :auth_rule_token, String, nil?: true + + # @!attribute explanation + # A human-readable explanation outlining the motivation for the rule's decline. + # + # @return [String, nil] + required :explanation, String, nil?: true + + # @!attribute name + # The name for the rule, if any was configured. + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute result + # The detailed_result associated with this rule's decline. + # + # @return [Symbol, Lithic::Models::Transaction::Event::RuleResult::Result] + required :result, enum: -> { Lithic::Transaction::Event::RuleResult::Result } + + # @!method initialize(auth_rule_token:, explanation:, name:, result:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Transaction::Event::RuleResult} for more details. + # + # @param auth_rule_token [String, nil] The Auth Rule Token associated with the rule from which the decline originated. + # + # @param explanation [String, nil] A human-readable explanation outlining the motivation for the rule's decline. + # + # @param name [String, nil] The name for the rule, if any was configured. + # + # @param result [Symbol, Lithic::Models::Transaction::Event::RuleResult::Result] The detailed_result associated with this rule's decline. + + # The detailed_result associated with this rule's decline. + # + # @see Lithic::Models::Transaction::Event::RuleResult#result + module Result + extend Lithic::Internal::Type::Enum + + ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED = :ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED + ACCOUNT_DELINQUENT = :ACCOUNT_DELINQUENT + ACCOUNT_INACTIVE = :ACCOUNT_INACTIVE + ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED = :ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED + ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED = :ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED + ACCOUNT_PAUSED = :ACCOUNT_PAUSED + ACCOUNT_UNDER_REVIEW = :ACCOUNT_UNDER_REVIEW + ADDRESS_INCORRECT = :ADDRESS_INCORRECT + APPROVED = :APPROVED + AUTH_RULE_ALLOWED_COUNTRY = :AUTH_RULE_ALLOWED_COUNTRY + AUTH_RULE_ALLOWED_MCC = :AUTH_RULE_ALLOWED_MCC + AUTH_RULE_BLOCKED_COUNTRY = :AUTH_RULE_BLOCKED_COUNTRY + AUTH_RULE_BLOCKED_MCC = :AUTH_RULE_BLOCKED_MCC + AUTH_RULE = :AUTH_RULE + CARD_CLOSED = :CARD_CLOSED + CARD_CRYPTOGRAM_VALIDATION_FAILURE = :CARD_CRYPTOGRAM_VALIDATION_FAILURE + CARD_EXPIRED = :CARD_EXPIRED + CARD_EXPIRY_DATE_INCORRECT = :CARD_EXPIRY_DATE_INCORRECT + CARD_INVALID = :CARD_INVALID + CARD_NOT_ACTIVATED = :CARD_NOT_ACTIVATED + CARD_PAUSED = :CARD_PAUSED + CARD_PIN_INCORRECT = :CARD_PIN_INCORRECT + CARD_RESTRICTED = :CARD_RESTRICTED + CARD_SECURITY_CODE_INCORRECT = :CARD_SECURITY_CODE_INCORRECT + CARD_SPEND_LIMIT_EXCEEDED = :CARD_SPEND_LIMIT_EXCEEDED + CONTACT_CARD_ISSUER = :CONTACT_CARD_ISSUER + CUSTOMER_ASA_TIMEOUT = :CUSTOMER_ASA_TIMEOUT + CUSTOM_ASA_RESULT = :CUSTOM_ASA_RESULT + DECLINED = :DECLINED + DO_NOT_HONOR = :DO_NOT_HONOR + DRIVER_NUMBER_INVALID = :DRIVER_NUMBER_INVALID + FORMAT_ERROR = :FORMAT_ERROR + INSUFFICIENT_FUNDING_SOURCE_BALANCE = :INSUFFICIENT_FUNDING_SOURCE_BALANCE + INSUFFICIENT_FUNDS = :INSUFFICIENT_FUNDS + LITHIC_SYSTEM_ERROR = :LITHIC_SYSTEM_ERROR + LITHIC_SYSTEM_RATE_LIMIT = :LITHIC_SYSTEM_RATE_LIMIT + MALFORMED_ASA_RESPONSE = :MALFORMED_ASA_RESPONSE + MERCHANT_INVALID = :MERCHANT_INVALID + MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE = :MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE + MERCHANT_NOT_PERMITTED = :MERCHANT_NOT_PERMITTED + OVER_REVERSAL_ATTEMPTED = :OVER_REVERSAL_ATTEMPTED + PIN_BLOCKED = :PIN_BLOCKED + PROGRAM_CARD_SPEND_LIMIT_EXCEEDED = :PROGRAM_CARD_SPEND_LIMIT_EXCEEDED + PROGRAM_SUSPENDED = :PROGRAM_SUSPENDED + PROGRAM_USAGE_RESTRICTION = :PROGRAM_USAGE_RESTRICTION + REVERSAL_UNMATCHED = :REVERSAL_UNMATCHED + SECURITY_VIOLATION = :SECURITY_VIOLATION + SINGLE_USE_CARD_REATTEMPTED = :SINGLE_USE_CARD_REATTEMPTED + SUSPECTED_FRAUD = :SUSPECTED_FRAUD + TRANSACTION_INVALID = :TRANSACTION_INVALID + TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL = :TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL + TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER = :TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER + TRANSACTION_PREVIOUSLY_COMPLETED = :TRANSACTION_PREVIOUSLY_COMPLETED + UNAUTHORIZED_MERCHANT = :UNAUTHORIZED_MERCHANT + VEHICLE_NUMBER_INVALID = :VEHICLE_NUMBER_INVALID + CARDHOLDER_CHALLENGED = :CARDHOLDER_CHALLENGED + CARDHOLDER_CHALLENGE_FAILED = :CARDHOLDER_CHALLENGE_FAILED + + # @!method self.values + # @return [Array] + end + end + + # Type of transaction event + # + # @see Lithic::Models::Transaction::Event#type + module Type + extend Lithic::Internal::Type::Enum + + AUTHORIZATION = :AUTHORIZATION + AUTHORIZATION_ADVICE = :AUTHORIZATION_ADVICE + AUTHORIZATION_EXPIRY = :AUTHORIZATION_EXPIRY + AUTHORIZATION_REVERSAL = :AUTHORIZATION_REVERSAL + BALANCE_INQUIRY = :BALANCE_INQUIRY + CLEARING = :CLEARING + CORRECTION_CREDIT = :CORRECTION_CREDIT + CORRECTION_DEBIT = :CORRECTION_DEBIT + CREDIT_AUTHORIZATION = :CREDIT_AUTHORIZATION + CREDIT_AUTHORIZATION_ADVICE = :CREDIT_AUTHORIZATION_ADVICE + FINANCIAL_AUTHORIZATION = :FINANCIAL_AUTHORIZATION + FINANCIAL_CREDIT_AUTHORIZATION = :FINANCIAL_CREDIT_AUTHORIZATION + RETURN = :RETURN + RETURN_REVERSAL = :RETURN_REVERSAL + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::Transaction::Event#account_type + module AccountType + extend Lithic::Internal::Type::Enum + + CHECKING = :CHECKING + SAVINGS = :SAVINGS + + # @!method self.values + # @return [Array] + end + + # @see Lithic::Models::Transaction::Event#network_specific_data + class NetworkSpecificData < Lithic::Internal::Type::BaseModel + # @!attribute mastercard + # + # @return [Lithic::Models::Transaction::Event::NetworkSpecificData::Mastercard] + required :mastercard, -> { Lithic::Transaction::Event::NetworkSpecificData::Mastercard } + + # @!attribute visa + # + # @return [Lithic::Models::Transaction::Event::NetworkSpecificData::Visa] + required :visa, -> { Lithic::Transaction::Event::NetworkSpecificData::Visa } + + # @!method initialize(mastercard:, visa:) + # @param mastercard [Lithic::Models::Transaction::Event::NetworkSpecificData::Mastercard] + # @param visa [Lithic::Models::Transaction::Event::NetworkSpecificData::Visa] + + # @see Lithic::Models::Transaction::Event::NetworkSpecificData#mastercard + class Mastercard < Lithic::Internal::Type::BaseModel + # @!attribute ecommerce_security_level_indicator + # Indicates the electronic commerce security level and UCAF collection. + # + # @return [String, nil] + required :ecommerce_security_level_indicator, String, nil?: true + + # @!attribute on_behalf_service_result + # The On-behalf Service performed on the transaction and the results. Contains all + # applicable, on-behalf service results that were performed on a given + # transaction. + # + # @return [Array, nil] + required :on_behalf_service_result, + -> { + Lithic::Internal::Type::ArrayOf[Lithic::Transaction::Event::NetworkSpecificData::Mastercard::OnBehalfServiceResult] + }, + nil?: true + + # @!attribute transaction_type_identifier + # Indicates the type of additional transaction purpose. + # + # @return [String, nil] + required :transaction_type_identifier, String, nil?: true + + # @!method initialize(ecommerce_security_level_indicator:, on_behalf_service_result:, transaction_type_identifier:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Transaction::Event::NetworkSpecificData::Mastercard} for more + # details. + # + # @param ecommerce_security_level_indicator [String, nil] Indicates the electronic commerce security level and UCAF collection. + # + # @param on_behalf_service_result [Array, nil] The On-behalf Service performed on the transaction and the results. Contains all + # + # @param transaction_type_identifier [String, nil] Indicates the type of additional transaction purpose. + + class OnBehalfServiceResult < Lithic::Internal::Type::BaseModel + # @!attribute result_1 + # Indicates the results of the service processing. + # + # @return [String] + required :result_1, String + + # @!attribute result_2 + # Identifies the results of the service processing. + # + # @return [String] + required :result_2, String + + # @!attribute service + # Indicates the service performed on the transaction. + # + # @return [String] + required :service, String + + # @!method initialize(result_1:, result_2:, service:) + # @param result_1 [String] Indicates the results of the service processing. + # + # @param result_2 [String] Identifies the results of the service processing. + # + # @param service [String] Indicates the service performed on the transaction. + end + end + + # @see Lithic::Models::Transaction::Event::NetworkSpecificData#visa + class Visa < Lithic::Internal::Type::BaseModel + # @!attribute business_application_identifier + # Identifies the purpose or category of a transaction, used to classify and + # process transactions according to Visa’s rules. + # + # @return [String, nil] + required :business_application_identifier, String, nil?: true + + # @!method initialize(business_application_identifier:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Transaction::Event::NetworkSpecificData::Visa} for more + # details. + # + # @param business_application_identifier [String, nil] Identifies the purpose or category of a transaction, used to classify and proces + end + end + end + end + end +end diff --git a/lib/lithic/models/transaction_expire_authorization_params.rb b/lib/lithic/models/transaction_expire_authorization_params.rb new file mode 100644 index 00000000..7de55198 --- /dev/null +++ b/lib/lithic/models/transaction_expire_authorization_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Transactions#expire_authorization + class TransactionExpireAuthorizationParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute transaction_token + # + # @return [String] + required :transaction_token, String + + # @!method initialize(transaction_token:, request_options: {}) + # @param transaction_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/transaction_list_params.rb b/lib/lithic/models/transaction_list_params.rb new file mode 100644 index 00000000..ec55b0f6 --- /dev/null +++ b/lib/lithic/models/transaction_list_params.rb @@ -0,0 +1,120 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Transactions#list + class TransactionListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute account_token + # Filters for transactions associated with a specific account. + # + # @return [String, nil] + optional :account_token, String + + # @!attribute begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time + + # @!attribute card_token + # Filters for transactions associated with a specific card. + # + # @return [String, nil] + optional :card_token, String + + # @!attribute end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute result + # Filters for transactions using transaction result field. Can filter by + # `APPROVED`, and `DECLINED`. + # + # @return [Symbol, Lithic::Models::TransactionListParams::Result, nil] + optional :result, enum: -> { Lithic::TransactionListParams::Result } + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!attribute status + # Filters for transactions using transaction status field. + # + # @return [Symbol, Lithic::Models::TransactionListParams::Status, nil] + optional :status, enum: -> { Lithic::TransactionListParams::Status } + + # @!method initialize(account_token: nil, begin_: nil, card_token: nil, end_: nil, ending_before: nil, page_size: nil, result: nil, starting_after: nil, status: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionListParams} for more details. + # + # @param account_token [String] Filters for transactions associated with a specific account. + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param card_token [String] Filters for transactions associated with a specific card. + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param result [Symbol, Lithic::Models::TransactionListParams::Result] Filters for transactions using transaction result field. Can filter by `APPROVED + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param status [Symbol, Lithic::Models::TransactionListParams::Status] Filters for transactions using transaction status field. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Filters for transactions using transaction result field. Can filter by + # `APPROVED`, and `DECLINED`. + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + + # Filters for transactions using transaction status field. + module Status + extend Lithic::Internal::Type::Enum + + PENDING = :PENDING + VOIDED = :VOIDED + SETTLED = :SETTLED + DECLINED = :DECLINED + EXPIRED = :EXPIRED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/case_activity_entry.rb b/lib/lithic/models/transaction_monitoring/case_activity_entry.rb new file mode 100644 index 00000000..51292618 --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/case_activity_entry.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + # @see Lithic::Resources::TransactionMonitoring::Cases#list_activity + class CaseActivityEntry < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for the activity entry + # + # @return [String] + required :token, String + + # @!attribute actor_token + # Identifier of the actor that produced the activity entry + # + # @return [String, nil] + required :actor_token, String, nil?: true + + # @!attribute created + # Date and time at which the activity entry was created + # + # @return [Time] + required :created, Time + + # @!attribute entry_type + # The case field that changed, or the action that was taken, in an activity entry: + # + # - `STATUS` - The case status changed + # - `TITLE` - The case title changed + # - `ASSIGNED_TO` - The case assignee changed + # - `RESOLUTION_OUTCOME` - The resolution outcome was set or changed + # - `RESOLUTION_NOTES` - The resolution notes were set or changed + # - `TAGS` - The case tags changed + # - `PRIORITY` - The case priority changed + # - `COMMENT` - A comment was added or edited + # - `FILE` - A file was attached to the case + # + # @return [Symbol, Lithic::Models::TransactionMonitoring::CaseActivityType] + required :entry_type, enum: -> { Lithic::TransactionMonitoring::CaseActivityType } + + # @!attribute new_value + # New value of the changed field, when applicable + # + # @return [String, nil] + required :new_value, String, nil?: true + + # @!attribute previous_value + # Previous value of the changed field, when applicable + # + # @return [String, nil] + required :previous_value, String, nil?: true + + # @!method initialize(token:, actor_token:, created:, entry_type:, new_value:, previous_value:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionMonitoring::CaseActivityEntry} for more details. + # + # A single entry in a case's activity feed + # + # @param token [String] Globally unique identifier for the activity entry + # + # @param actor_token [String, nil] Identifier of the actor that produced the activity entry + # + # @param created [Time] Date and time at which the activity entry was created + # + # @param entry_type [Symbol, Lithic::Models::TransactionMonitoring::CaseActivityType] The case field that changed, or the action that was taken, in an activity entry: + # + # @param new_value [String, nil] New value of the changed field, when applicable + # + # @param previous_value [String, nil] Previous value of the changed field, when applicable + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/case_activity_type.rb b/lib/lithic/models/transaction_monitoring/case_activity_type.rb new file mode 100644 index 00000000..1fe95095 --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/case_activity_type.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + # The case field that changed, or the action that was taken, in an activity entry: + # + # - `STATUS` - The case status changed + # - `TITLE` - The case title changed + # - `ASSIGNED_TO` - The case assignee changed + # - `RESOLUTION_OUTCOME` - The resolution outcome was set or changed + # - `RESOLUTION_NOTES` - The resolution notes were set or changed + # - `TAGS` - The case tags changed + # - `PRIORITY` - The case priority changed + # - `COMMENT` - A comment was added or edited + # - `FILE` - A file was attached to the case + module CaseActivityType + extend Lithic::Internal::Type::Enum + + STATUS = :STATUS + TITLE = :TITLE + ASSIGNED_TO = :ASSIGNED_TO + RESOLUTION_OUTCOME = :RESOLUTION_OUTCOME + RESOLUTION_NOTES = :RESOLUTION_NOTES + TAGS = :TAGS + PRIORITY = :PRIORITY + COMMENT = :COMMENT + FILE = :FILE + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/case_card.rb b/lib/lithic/models/transaction_monitoring/case_card.rb new file mode 100644 index 00000000..40b26633 --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/case_card.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + class CaseCard < Lithic::Internal::Type::BaseModel + # @!attribute account_token + # Token of the account the card belongs to + # + # @return [String] + required :account_token, String + + # @!attribute card_token + # Token of the card + # + # @return [String] + required :card_token, String + + # @!attribute transaction_count + # Number of the card's transactions associated with the case + # + # @return [Integer] + required :transaction_count, Integer + + # @!method initialize(account_token:, card_token:, transaction_count:) + # Summary of a card's involvement in a case, aggregated across the case's + # transactions + # + # @param account_token [String] Token of the account the card belongs to + # + # @param card_token [String] Token of the card + # + # @param transaction_count [Integer] Number of the card's transactions associated with the case + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/case_entity.rb b/lib/lithic/models/transaction_monitoring/case_entity.rb new file mode 100644 index 00000000..c81e36f6 --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/case_entity.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + class CaseEntity < Lithic::Internal::Type::BaseModel + # @!attribute entity_token + # Globally unique identifier for the associated entity + # + # @return [String] + required :entity_token, String + + # @!attribute entity_type + # The type of entity a case is associated with: + # + # - `CARD` - The case is associated with a card + # - `ACCOUNT` - The case is associated with an account + # + # @return [Symbol, Lithic::Models::TransactionMonitoring::CaseEntity::EntityType] + required :entity_type, enum: -> { Lithic::TransactionMonitoring::CaseEntity::EntityType } + + # @!method initialize(entity_token:, entity_type:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionMonitoring::CaseEntity} for more details. + # + # The entity a case is associated with + # + # @param entity_token [String] Globally unique identifier for the associated entity + # + # @param entity_type [Symbol, Lithic::Models::TransactionMonitoring::CaseEntity::EntityType] The type of entity a case is associated with: + + # The type of entity a case is associated with: + # + # - `CARD` - The case is associated with a card + # - `ACCOUNT` - The case is associated with an account + # + # @see Lithic::Models::TransactionMonitoring::CaseEntity#entity_type + module EntityType + extend Lithic::Internal::Type::Enum + + CARD = :CARD + ACCOUNT = :ACCOUNT + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/case_list_activity_params.rb b/lib/lithic/models/transaction_monitoring/case_list_activity_params.rb new file mode 100644 index 00000000..8dfbf2a7 --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/case_list_activity_params.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + # @see Lithic::Resources::TransactionMonitoring::Cases#list_activity + class CaseListActivityParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute case_token + # + # @return [String] + required :case_token, String + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!method initialize(case_token:, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionMonitoring::CaseListActivityParams} for more + # details. + # + # @param case_token [String] + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/case_list_params.rb b/lib/lithic/models/transaction_monitoring/case_list_params.rb new file mode 100644 index 00000000..95045da2 --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/case_list_params.rb @@ -0,0 +1,136 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + # @see Lithic::Resources::TransactionMonitoring::Cases#list + class CaseListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute account_token + # Only return cases that include transactions on the provided account. + # + # @return [String, nil] + optional :account_token, String + + # @!attribute assignee + # Only return cases assigned to the provided value. Pass an empty string to return + # only unassigned cases. + # + # @return [String, nil] + optional :assignee, String + + # @!attribute begin_ + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :begin_, Time + + # @!attribute card_token + # Only return cases that include transactions on the provided card. + # + # @return [String, nil] + optional :card_token, String + + # @!attribute end_ + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + # + # @return [Time, nil] + optional :end_, Time + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute entity_token + # Only return cases associated with the provided entity. + # + # @return [String, nil] + optional :entity_token, String + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute queue_token + # Only return cases belonging to the provided queue. + # + # @return [String, nil] + optional :queue_token, String + + # @!attribute rule_token + # Only return cases triggered by the provided transaction monitoring rule. + # + # @return [String, nil] + optional :rule_token, String + + # @!attribute sort_by + # Sort order for the returned cases. + # + # @return [Symbol, Lithic::Models::TransactionMonitoring::CaseSortOrder, nil] + optional :sort_by, enum: -> { Lithic::TransactionMonitoring::CaseSortOrder } + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!attribute status + # Only return cases with the provided status. + # + # @return [Symbol, Lithic::Models::TransactionMonitoring::CaseStatus, nil] + optional :status, enum: -> { Lithic::TransactionMonitoring::CaseStatus } + + # @!attribute transaction_token + # Only return cases that include the provided transaction. + # + # @return [String, nil] + optional :transaction_token, String + + # @!method initialize(account_token: nil, assignee: nil, begin_: nil, card_token: nil, end_: nil, ending_before: nil, entity_token: nil, page_size: nil, queue_token: nil, rule_token: nil, sort_by: nil, starting_after: nil, status: nil, transaction_token: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionMonitoring::CaseListParams} for more details. + # + # @param account_token [String] Only return cases that include transactions on the provided account. + # + # @param assignee [String] Only return cases assigned to the provided value. Pass an empty string to return + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param card_token [String] Only return cases that include transactions on the provided card. + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param entity_token [String] Only return cases associated with the provided entity. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param queue_token [String] Only return cases belonging to the provided queue. + # + # @param rule_token [String] Only return cases triggered by the provided transaction monitoring rule. + # + # @param sort_by [Symbol, Lithic::Models::TransactionMonitoring::CaseSortOrder] Sort order for the returned cases. + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param status [Symbol, Lithic::Models::TransactionMonitoring::CaseStatus] Only return cases with the provided status. + # + # @param transaction_token [String] Only return cases that include the provided transaction. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/case_list_transactions_params.rb b/lib/lithic/models/transaction_monitoring/case_list_transactions_params.rb new file mode 100644 index 00000000..5e5de05d --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/case_list_transactions_params.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + # @see Lithic::Resources::TransactionMonitoring::Cases#list_transactions + class CaseListTransactionsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute case_token + # + # @return [String] + required :case_token, String + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!method initialize(case_token:, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionMonitoring::CaseListTransactionsParams} for more + # details. + # + # @param case_token [String] + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/case_priority.rb b/lib/lithic/models/transaction_monitoring/case_priority.rb new file mode 100644 index 00000000..633800c9 --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/case_priority.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + # Priority level of a case, controlling queue ordering and SLA urgency + module CasePriority + extend Lithic::Internal::Type::Enum + + LOW = :LOW + MEDIUM = :MEDIUM + HIGH = :HIGH + CRITICAL = :CRITICAL + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/case_retrieve_cards_params.rb b/lib/lithic/models/transaction_monitoring/case_retrieve_cards_params.rb new file mode 100644 index 00000000..fc13d30f --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/case_retrieve_cards_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + # @see Lithic::Resources::TransactionMonitoring::Cases#retrieve_cards + class CaseRetrieveCardsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute case_token + # + # @return [String] + required :case_token, String + + # @!method initialize(case_token:, request_options: {}) + # @param case_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/case_retrieve_cards_response.rb b/lib/lithic/models/transaction_monitoring/case_retrieve_cards_response.rb new file mode 100644 index 00000000..3a476e43 --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/case_retrieve_cards_response.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + # @type [Lithic::Internal::Type::Converter] + CaseRetrieveCardsResponse = + Lithic::Internal::Type::ArrayOf[-> { Lithic::TransactionMonitoring::CaseCard }] + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/case_retrieve_params.rb b/lib/lithic/models/transaction_monitoring/case_retrieve_params.rb new file mode 100644 index 00000000..3fb15f91 --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/case_retrieve_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + # @see Lithic::Resources::TransactionMonitoring::Cases#retrieve + class CaseRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute case_token + # + # @return [String] + required :case_token, String + + # @!method initialize(case_token:, request_options: {}) + # @param case_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/case_sort_order.rb b/lib/lithic/models/transaction_monitoring/case_sort_order.rb new file mode 100644 index 00000000..4021f1fc --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/case_sort_order.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + # Sort order for listing cases. Defaults to `CREATED_DESC` (newest first): + # + # - `CREATED_ASC` - Oldest first + # - `CREATED_DESC` - Newest first + # - `PRIORITY_DESC` - Highest priority first + # - `PRIORITY_ASC` - Lowest priority first + # - `STATUS_DESC` - Furthest workflow stage first + # - `STATUS_ASC` - Earliest workflow stage first + module CaseSortOrder + extend Lithic::Internal::Type::Enum + + CREATED_ASC = :CREATED_ASC + CREATED_DESC = :CREATED_DESC + PRIORITY_DESC = :PRIORITY_DESC + PRIORITY_ASC = :PRIORITY_ASC + STATUS_DESC = :STATUS_DESC + STATUS_ASC = :STATUS_ASC + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/case_status.rb b/lib/lithic/models/transaction_monitoring/case_status.rb new file mode 100644 index 00000000..7b8b89ef --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/case_status.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + # Status of a case as it progresses through the review workflow: + # + # - `OPEN` - The case has been created and is still collecting matching + # transactions + # - `ASSIGNED` - An analyst has been assigned and transaction collection has + # stopped + # - `IN_REVIEW` - The case is actively being investigated + # - `ESCALATED` - The case has been reviewed and requires additional oversight + # - `RESOLVED` - A determination has been made and a resolution recorded + # - `CLOSED` - The case is finalized + module CaseStatus + extend Lithic::Internal::Type::Enum + + OPEN = :OPEN + ASSIGNED = :ASSIGNED + IN_REVIEW = :IN_REVIEW + ESCALATED = :ESCALATED + RESOLVED = :RESOLVED + CLOSED = :CLOSED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/case_transaction.rb b/lib/lithic/models/transaction_monitoring/case_transaction.rb new file mode 100644 index 00000000..8df5e572 --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/case_transaction.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + # @see Lithic::Resources::TransactionMonitoring::Cases#list_transactions + class CaseTransaction < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for the transaction + # + # @return [String] + required :token, String + + # @!attribute account_token + # Token of the account the transaction belongs to + # + # @return [String] + required :account_token, String + + # @!attribute added_at + # Date and time at which the transaction was added to the case + # + # @return [Time] + required :added_at, Time + + # @!attribute card_token + # Token of the card the transaction was made on + # + # @return [String] + required :card_token, String + + # @!attribute transaction_created_at + # Date and time at which the transaction was created + # + # @return [Time] + required :transaction_created_at, Time + + # @!method initialize(token:, account_token:, added_at:, card_token:, transaction_created_at:) + # A single transaction associated with a case + # + # @param token [String] Globally unique identifier for the transaction + # + # @param account_token [String] Token of the account the transaction belongs to + # + # @param added_at [Time] Date and time at which the transaction was added to the case + # + # @param card_token [String] Token of the card the transaction was made on + # + # @param transaction_created_at [Time] Date and time at which the transaction was created + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/case_update_params.rb b/lib/lithic/models/transaction_monitoring/case_update_params.rb new file mode 100644 index 00000000..1a9b7317 --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/case_update_params.rb @@ -0,0 +1,116 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + # @see Lithic::Resources::TransactionMonitoring::Cases#update + class CaseUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute case_token + # + # @return [String] + required :case_token, String + + # @!attribute actor_token + # Optional client-provided identifier for the actor performing this action, + # recorded on the resulting activity entry. This value is supplied by the client + # (for example, your own internal user ID) and is not authenticated by Lithic + # + # @return [String, nil] + optional :actor_token, String + + # @!attribute assignee + # New assignee for the case, or `null` to unassign + # + # @return [String, nil] + optional :assignee, String, nil?: true + + # @!attribute priority + # Priority level of a case, controlling queue ordering and SLA urgency + # + # @return [Symbol, Lithic::Models::TransactionMonitoring::CasePriority, nil] + optional :priority, enum: -> { Lithic::TransactionMonitoring::CasePriority } + + # @!attribute resolution + # Outcome recorded when a case is resolved: + # + # - `CONFIRMED_FRAUD` - The reviewed activity was confirmed to be fraudulent + # - `SUSPICIOUS_ACTIVITY` - The activity is suspicious but not confirmed fraud + # - `FALSE_POSITIVE` - The activity was legitimate and the alert was a false + # positive + # - `NO_ACTION_REQUIRED` - No further action is required + # - `ESCALATED_EXTERNAL` - The case was escalated to an external party + # + # @return [Symbol, Lithic::Models::TransactionMonitoring::ResolutionOutcome, nil] + optional :resolution, enum: -> { Lithic::TransactionMonitoring::ResolutionOutcome } + + # @!attribute resolution_notes + # Notes describing the resolution + # + # @return [String, nil] + optional :resolution_notes, String + + # @!attribute sla_deadline + # New SLA deadline for the case, or `null` to clear it + # + # @return [Time, nil] + optional :sla_deadline, Time, nil?: true + + # @!attribute status + # Status of a case as it progresses through the review workflow: + # + # - `OPEN` - The case has been created and is still collecting matching + # transactions + # - `ASSIGNED` - An analyst has been assigned and transaction collection has + # stopped + # - `IN_REVIEW` - The case is actively being investigated + # - `ESCALATED` - The case has been reviewed and requires additional oversight + # - `RESOLVED` - A determination has been made and a resolution recorded + # - `CLOSED` - The case is finalized + # + # @return [Symbol, Lithic::Models::TransactionMonitoring::CaseStatus, nil] + optional :status, enum: -> { Lithic::TransactionMonitoring::CaseStatus } + + # @!attribute tags + # Arbitrary key-value metadata to set on the case + # + # @return [Hash{Symbol=>String}, nil] + optional :tags, Lithic::Internal::Type::HashOf[String] + + # @!attribute title + # New title for the case, or `null` to clear it + # + # @return [String, nil] + optional :title, String, nil?: true + + # @!method initialize(case_token:, actor_token: nil, assignee: nil, priority: nil, resolution: nil, resolution_notes: nil, sla_deadline: nil, status: nil, tags: nil, title: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionMonitoring::CaseUpdateParams} for more details. + # + # @param case_token [String] + # + # @param actor_token [String] Optional client-provided identifier for the actor performing this action, + # + # @param assignee [String, nil] New assignee for the case, or `null` to unassign + # + # @param priority [Symbol, Lithic::Models::TransactionMonitoring::CasePriority] Priority level of a case, controlling queue ordering and SLA urgency + # + # @param resolution [Symbol, Lithic::Models::TransactionMonitoring::ResolutionOutcome] Outcome recorded when a case is resolved: + # + # @param resolution_notes [String] Notes describing the resolution + # + # @param sla_deadline [Time, nil] New SLA deadline for the case, or `null` to clear it + # + # @param status [Symbol, Lithic::Models::TransactionMonitoring::CaseStatus] Status of a case as it progresses through the review workflow: + # + # @param tags [Hash{Symbol=>String}] Arbitrary key-value metadata to set on the case + # + # @param title [String, nil] New title for the case, or `null` to clear it + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/cases/case_file.rb b/lib/lithic/models/transaction_monitoring/cases/case_file.rb new file mode 100644 index 00000000..7ce58d23 --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/cases/case_file.rb @@ -0,0 +1,141 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + module Cases + # @see Lithic::Resources::TransactionMonitoring::Cases::Files#create + class CaseFile < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for the file + # + # @return [String] + required :token, String + + # @!attribute created + # Date and time at which the file record was created + # + # @return [Time] + required :created, Time + + # @!attribute download_url + # Presigned URL the client uses to download the file + # + # @return [String, nil] + required :download_url, String, nil?: true + + # @!attribute download_url_expires + # Date and time at which the download URL expires + # + # @return [Time, nil] + required :download_url_expires, Time, nil?: true + + # @!attribute failure_reason + # Reason the file was rejected, when applicable + # + # @return [String, nil] + required :failure_reason, String, nil?: true + + # @!attribute mime_type + # MIME type of the file, available once the file is ready + # + # @return [String, nil] + required :mime_type, String, nil?: true + + # @!attribute name + # Name of the file + # + # @return [String] + required :name, String + + # @!attribute size_bytes + # Size of the file in bytes, available once the file is ready + # + # @return [Integer, nil] + required :size_bytes, Integer, nil?: true + + # @!attribute status + # Lifecycle status of a case file: + # + # - `PENDING` - An upload URL has been issued and the file is awaiting upload + # - `READY` - The file has been uploaded and validated; a download URL is + # available + # - `REJECTED` - File validation failed; see `failure_reason` for details + # + # @return [Symbol, Lithic::Models::TransactionMonitoring::Cases::FileStatus] + required :status, enum: -> { Lithic::TransactionMonitoring::Cases::FileStatus } + + # @!attribute updated + # Date and time at which the file record was last updated + # + # @return [Time] + required :updated, Time + + # @!attribute upload_constraints + # Constraints applied to a file upload, returned alongside the upload URL so + # clients can validate before uploading + # + # @return [Lithic::Models::TransactionMonitoring::Cases::UploadConstraints, nil] + required :upload_constraints, + -> { + Lithic::TransactionMonitoring::Cases::UploadConstraints + }, + nil?: true + + # @!attribute upload_url + # Presigned URL the client uses to upload the file + # + # @return [String, nil] + required :upload_url, String, nil?: true + + # @!attribute upload_url_expires + # Date and time at which the upload URL expires + # + # @return [Time, nil] + required :upload_url_expires, Time, nil?: true + + # @!method initialize(token:, created:, download_url:, download_url_expires:, failure_reason:, mime_type:, name:, size_bytes:, status:, updated:, upload_constraints:, upload_url:, upload_url_expires:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionMonitoring::Cases::CaseFile} for more details. + # + # A file attached to a case. Status-dependent fields are always present but may be + # `null`: + # + # - `upload_url`, `upload_url_expires`, and `upload_constraints` are populated + # when `status` is `PENDING` or `REJECTED` + # - `download_url` and `download_url_expires` are populated when `status` is + # `READY` + # - `failure_reason` is populated when `status` is `REJECTED` + # + # @param token [String] Globally unique identifier for the file + # + # @param created [Time] Date and time at which the file record was created + # + # @param download_url [String, nil] Presigned URL the client uses to download the file + # + # @param download_url_expires [Time, nil] Date and time at which the download URL expires + # + # @param failure_reason [String, nil] Reason the file was rejected, when applicable + # + # @param mime_type [String, nil] MIME type of the file, available once the file is ready + # + # @param name [String] Name of the file + # + # @param size_bytes [Integer, nil] Size of the file in bytes, available once the file is ready + # + # @param status [Symbol, Lithic::Models::TransactionMonitoring::Cases::FileStatus] Lifecycle status of a case file: + # + # @param updated [Time] Date and time at which the file record was last updated + # + # @param upload_constraints [Lithic::Models::TransactionMonitoring::Cases::UploadConstraints, nil] Constraints applied to a file upload, returned alongside the upload URL so clien + # + # @param upload_url [String, nil] Presigned URL the client uses to upload the file + # + # @param upload_url_expires [Time, nil] Date and time at which the upload URL expires + end + end + + CaseFile = Cases::CaseFile + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/cases/comment_create_params.rb b/lib/lithic/models/transaction_monitoring/cases/comment_create_params.rb new file mode 100644 index 00000000..3b668b21 --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/cases/comment_create_params.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + module Cases + # @see Lithic::Resources::TransactionMonitoring::Cases::Comments#create + class CommentCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute case_token + # + # @return [String] + required :case_token, String + + # @!attribute comment + # Text of the comment + # + # @return [String] + required :comment, String + + # @!attribute actor_token + # Optional client-provided identifier for the actor performing this action, + # recorded on the resulting activity entry. This value is supplied by the client + # (for example, your own internal user ID) and is not authenticated by Lithic + # + # @return [String, nil] + optional :actor_token, String + + # @!method initialize(case_token:, comment:, actor_token: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionMonitoring::Cases::CommentCreateParams} for more + # details. + # + # @param case_token [String] + # + # @param comment [String] Text of the comment + # + # @param actor_token [String] Optional client-provided identifier for the actor performing this action, + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/cases/comment_delete_params.rb b/lib/lithic/models/transaction_monitoring/cases/comment_delete_params.rb new file mode 100644 index 00000000..f15b1c1a --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/cases/comment_delete_params.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + module Cases + # @see Lithic::Resources::TransactionMonitoring::Cases::Comments#delete + class CommentDeleteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute case_token + # + # @return [String] + required :case_token, String + + # @!attribute comment_token + # + # @return [String] + required :comment_token, String + + # @!method initialize(case_token:, comment_token:, request_options: {}) + # @param case_token [String] + # @param comment_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/cases/comment_update_params.rb b/lib/lithic/models/transaction_monitoring/cases/comment_update_params.rb new file mode 100644 index 00000000..0c7c3363 --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/cases/comment_update_params.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + module Cases + # @see Lithic::Resources::TransactionMonitoring::Cases::Comments#update + class CommentUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute case_token + # + # @return [String] + required :case_token, String + + # @!attribute comment_token + # + # @return [String] + required :comment_token, String + + # @!attribute comment + # New text of the comment + # + # @return [String] + required :comment, String + + # @!attribute actor_token + # Optional client-provided identifier for the actor performing this action, + # recorded on the resulting activity entry. This value is supplied by the client + # (for example, your own internal user ID) and is not authenticated by Lithic + # + # @return [String, nil] + optional :actor_token, String + + # @!method initialize(case_token:, comment_token:, comment:, actor_token: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionMonitoring::Cases::CommentUpdateParams} for more + # details. + # + # @param case_token [String] + # + # @param comment_token [String] + # + # @param comment [String] New text of the comment + # + # @param actor_token [String] Optional client-provided identifier for the actor performing this action, + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/cases/file_create_params.rb b/lib/lithic/models/transaction_monitoring/cases/file_create_params.rb new file mode 100644 index 00000000..9df4acf4 --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/cases/file_create_params.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + module Cases + # @see Lithic::Resources::TransactionMonitoring::Cases::Files#create + class FileCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute case_token + # + # @return [String] + required :case_token, String + + # @!attribute name + # Name of the file to upload + # + # @return [String] + required :name, String + + # @!method initialize(case_token:, name:, request_options: {}) + # @param case_token [String] + # + # @param name [String] Name of the file to upload + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/cases/file_delete_params.rb b/lib/lithic/models/transaction_monitoring/cases/file_delete_params.rb new file mode 100644 index 00000000..6e7e0178 --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/cases/file_delete_params.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + module Cases + # @see Lithic::Resources::TransactionMonitoring::Cases::Files#delete + class FileDeleteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute case_token + # + # @return [String] + required :case_token, String + + # @!attribute file_token + # + # @return [String] + required :file_token, String + + # @!method initialize(case_token:, file_token:, request_options: {}) + # @param case_token [String] + # @param file_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/cases/file_list_params.rb b/lib/lithic/models/transaction_monitoring/cases/file_list_params.rb new file mode 100644 index 00000000..cf4b5bb0 --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/cases/file_list_params.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + module Cases + # @see Lithic::Resources::TransactionMonitoring::Cases::Files#list + class FileListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute case_token + # + # @return [String] + required :case_token, String + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!method initialize(case_token:, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionMonitoring::Cases::FileListParams} for more details. + # + # @param case_token [String] + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/cases/file_retrieve_params.rb b/lib/lithic/models/transaction_monitoring/cases/file_retrieve_params.rb new file mode 100644 index 00000000..567163b8 --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/cases/file_retrieve_params.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + module Cases + # @see Lithic::Resources::TransactionMonitoring::Cases::Files#retrieve + class FileRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute case_token + # + # @return [String] + required :case_token, String + + # @!attribute file_token + # + # @return [String] + required :file_token, String + + # @!method initialize(case_token:, file_token:, request_options: {}) + # @param case_token [String] + # @param file_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/cases/file_status.rb b/lib/lithic/models/transaction_monitoring/cases/file_status.rb new file mode 100644 index 00000000..4755b6fb --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/cases/file_status.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + module Cases + # Lifecycle status of a case file: + # + # - `PENDING` - An upload URL has been issued and the file is awaiting upload + # - `READY` - The file has been uploaded and validated; a download URL is + # available + # - `REJECTED` - File validation failed; see `failure_reason` for details + module FileStatus + extend Lithic::Internal::Type::Enum + + PENDING = :PENDING + READY = :READY + REJECTED = :REJECTED + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/cases/upload_constraints.rb b/lib/lithic/models/transaction_monitoring/cases/upload_constraints.rb new file mode 100644 index 00000000..cc4feb83 --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/cases/upload_constraints.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + module Cases + class UploadConstraints < Lithic::Internal::Type::BaseModel + # @!attribute accepted_mime_types + # MIME types accepted for the upload + # + # @return [Array] + required :accepted_mime_types, Lithic::Internal::Type::ArrayOf[String] + + # @!attribute max_size_bytes + # Maximum accepted file size, in bytes + # + # @return [Integer] + required :max_size_bytes, Integer + + # @!method initialize(accepted_mime_types:, max_size_bytes:) + # Constraints applied to a file upload, returned alongside the upload URL so + # clients can validate before uploading + # + # @param accepted_mime_types [Array] MIME types accepted for the upload + # + # @param max_size_bytes [Integer] Maximum accepted file size, in bytes + end + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/entity_type.rb b/lib/lithic/models/transaction_monitoring/entity_type.rb new file mode 100644 index 00000000..2c1bb10a --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/entity_type.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + # The type of entity associated with an account holder + module EntityType + extend Lithic::Internal::Type::Enum + + BENEFICIAL_OWNER_INDIVIDUAL = :BENEFICIAL_OWNER_INDIVIDUAL + CONTROL_PERSON = :CONTROL_PERSON + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/monitoring_case.rb b/lib/lithic/models/transaction_monitoring/monitoring_case.rb new file mode 100644 index 00000000..7f43fb74 --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/monitoring_case.rb @@ -0,0 +1,168 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + # @see Lithic::Resources::TransactionMonitoring::Cases#retrieve + class MonitoringCase < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for the case + # + # @return [String] + required :token, String + + # @!attribute assignee + # Identifier of the user the case is currently assigned to + # + # @return [String, nil] + required :assignee, String, nil?: true + + # @!attribute collection_stopped + # Date and time at which transaction collection stopped for the case + # + # @return [Time, nil] + required :collection_stopped, Time, nil?: true + + # @!attribute created + # Date and time at which the case was created + # + # @return [Time] + required :created, Time + + # @!attribute entity + # The entity a case is associated with + # + # @return [Lithic::Models::TransactionMonitoring::CaseEntity, nil] + required :entity, -> { Lithic::TransactionMonitoring::CaseEntity }, nil?: true + + # @!attribute pending_transactions + # Whether the case still has transaction scopes pending resolution + # + # @return [Boolean] + required :pending_transactions, Lithic::Internal::Type::Boolean + + # @!attribute priority + # Priority level of a case, controlling queue ordering and SLA urgency + # + # @return [Symbol, Lithic::Models::TransactionMonitoring::CasePriority] + required :priority, enum: -> { Lithic::TransactionMonitoring::CasePriority } + + # @!attribute queue_token + # Token of the queue the case belongs to + # + # @return [String] + required :queue_token, String + + # @!attribute resolution + # Outcome recorded when a case is resolved: + # + # - `CONFIRMED_FRAUD` - The reviewed activity was confirmed to be fraudulent + # - `SUSPICIOUS_ACTIVITY` - The activity is suspicious but not confirmed fraud + # - `FALSE_POSITIVE` - The activity was legitimate and the alert was a false + # positive + # - `NO_ACTION_REQUIRED` - No further action is required + # - `ESCALATED_EXTERNAL` - The case was escalated to an external party + # + # @return [Symbol, Lithic::Models::TransactionMonitoring::ResolutionOutcome, nil] + required :resolution, enum: -> { Lithic::TransactionMonitoring::ResolutionOutcome }, nil?: true + + # @!attribute resolution_notes + # Free-form notes describing the resolution + # + # @return [String, nil] + required :resolution_notes, String, nil?: true + + # @!attribute resolved + # Date and time at which the case was resolved + # + # @return [Time, nil] + required :resolved, Time, nil?: true + + # @!attribute rule_token + # Token of the transaction monitoring rule that triggered the case + # + # @return [String, nil] + required :rule_token, String, nil?: true + + # @!attribute sla_deadline + # Deadline by which the case is expected to be resolved + # + # @return [Time, nil] + required :sla_deadline, Time, nil?: true + + # @!attribute status + # Status of a case as it progresses through the review workflow: + # + # - `OPEN` - The case has been created and is still collecting matching + # transactions + # - `ASSIGNED` - An analyst has been assigned and transaction collection has + # stopped + # - `IN_REVIEW` - The case is actively being investigated + # - `ESCALATED` - The case has been reviewed and requires additional oversight + # - `RESOLVED` - A determination has been made and a resolution recorded + # - `CLOSED` - The case is finalized + # + # @return [Symbol, Lithic::Models::TransactionMonitoring::CaseStatus] + required :status, enum: -> { Lithic::TransactionMonitoring::CaseStatus } + + # @!attribute tags + # Arbitrary key-value metadata associated with the case + # + # @return [Hash{Symbol=>String}] + required :tags, Lithic::Internal::Type::HashOf[String] + + # @!attribute title + # Short, human-readable summary of the case + # + # @return [String, nil] + required :title, String, nil?: true + + # @!attribute updated + # Date and time at which the case was last updated + # + # @return [Time] + required :updated, Time + + # @!method initialize(token:, assignee:, collection_stopped:, created:, entity:, pending_transactions:, priority:, queue_token:, resolution:, resolution_notes:, resolved:, rule_token:, sla_deadline:, status:, tags:, title:, updated:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionMonitoring::MonitoringCase} for more details. + # + # A transaction monitoring case + # + # @param token [String] Globally unique identifier for the case + # + # @param assignee [String, nil] Identifier of the user the case is currently assigned to + # + # @param collection_stopped [Time, nil] Date and time at which transaction collection stopped for the case + # + # @param created [Time] Date and time at which the case was created + # + # @param entity [Lithic::Models::TransactionMonitoring::CaseEntity, nil] The entity a case is associated with + # + # @param pending_transactions [Boolean] Whether the case still has transaction scopes pending resolution + # + # @param priority [Symbol, Lithic::Models::TransactionMonitoring::CasePriority] Priority level of a case, controlling queue ordering and SLA urgency + # + # @param queue_token [String] Token of the queue the case belongs to + # + # @param resolution [Symbol, Lithic::Models::TransactionMonitoring::ResolutionOutcome, nil] Outcome recorded when a case is resolved: + # + # @param resolution_notes [String, nil] Free-form notes describing the resolution + # + # @param resolved [Time, nil] Date and time at which the case was resolved + # + # @param rule_token [String, nil] Token of the transaction monitoring rule that triggered the case + # + # @param sla_deadline [Time, nil] Deadline by which the case is expected to be resolved + # + # @param status [Symbol, Lithic::Models::TransactionMonitoring::CaseStatus] Status of a case as it progresses through the review workflow: + # + # @param tags [Hash{Symbol=>String}] Arbitrary key-value metadata associated with the case + # + # @param title [String, nil] Short, human-readable summary of the case + # + # @param updated [Time] Date and time at which the case was last updated + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/queue.rb b/lib/lithic/models/transaction_monitoring/queue.rb new file mode 100644 index 00000000..ac563d9e --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/queue.rb @@ -0,0 +1,120 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + # @see Lithic::Resources::TransactionMonitoring::Queues#create + class Queue < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for the queue + # + # @return [String] + required :token, String + + # @!attribute case_counts + # Number of cases in the queue, broken down by status. A status is omitted when + # the queue has no cases in that status + # + # @return [Lithic::Models::TransactionMonitoring::Queue::CaseCounts] + required :case_counts, -> { Lithic::TransactionMonitoring::Queue::CaseCounts } + + # @!attribute created + # Date and time at which the queue was created + # + # @return [Time] + required :created, Time + + # @!attribute description + # Optional description of the queue + # + # @return [String, nil] + required :description, String, nil?: true + + # @!attribute name + # Human-readable name of the queue + # + # @return [String] + required :name, String + + # @!attribute updated + # Date and time at which the queue was last updated + # + # @return [Time] + required :updated, Time + + # @!method initialize(token:, case_counts:, created:, description:, name:, updated:) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionMonitoring::Queue} for more details. + # + # A queue that groups transaction monitoring cases for review + # + # @param token [String] Globally unique identifier for the queue + # + # @param case_counts [Lithic::Models::TransactionMonitoring::Queue::CaseCounts] Number of cases in the queue, broken down by status. A status is omitted + # + # @param created [Time] Date and time at which the queue was created + # + # @param description [String, nil] Optional description of the queue + # + # @param name [String] Human-readable name of the queue + # + # @param updated [Time] Date and time at which the queue was last updated + + # @see Lithic::Models::TransactionMonitoring::Queue#case_counts + class CaseCounts < Lithic::Internal::Type::BaseModel + # @!attribute assigned + # Number of cases in the queue with status `ASSIGNED` + # + # @return [Integer, nil] + optional :assigned, Integer, api_name: :ASSIGNED + + # @!attribute closed + # Number of cases in the queue with status `CLOSED` + # + # @return [Integer, nil] + optional :closed, Integer, api_name: :CLOSED + + # @!attribute escalated + # Number of cases in the queue with status `ESCALATED` + # + # @return [Integer, nil] + optional :escalated, Integer, api_name: :ESCALATED + + # @!attribute in_review + # Number of cases in the queue with status `IN_REVIEW` + # + # @return [Integer, nil] + optional :in_review, Integer, api_name: :IN_REVIEW + + # @!attribute open_ + # Number of cases in the queue with status `OPEN` + # + # @return [Integer, nil] + optional :open_, Integer, api_name: :OPEN + + # @!attribute resolved + # Number of cases in the queue with status `RESOLVED` + # + # @return [Integer, nil] + optional :resolved, Integer, api_name: :RESOLVED + + # @!method initialize(assigned: nil, closed: nil, escalated: nil, in_review: nil, open_: nil, resolved: nil) + # Number of cases in the queue, broken down by status. A status is omitted when + # the queue has no cases in that status + # + # @param assigned [Integer] Number of cases in the queue with status `ASSIGNED` + # + # @param closed [Integer] Number of cases in the queue with status `CLOSED` + # + # @param escalated [Integer] Number of cases in the queue with status `ESCALATED` + # + # @param in_review [Integer] Number of cases in the queue with status `IN_REVIEW` + # + # @param open_ [Integer] Number of cases in the queue with status `OPEN` + # + # @param resolved [Integer] Number of cases in the queue with status `RESOLVED` + end + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/queue_create_params.rb b/lib/lithic/models/transaction_monitoring/queue_create_params.rb new file mode 100644 index 00000000..594dd9a4 --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/queue_create_params.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + # @see Lithic::Resources::TransactionMonitoring::Queues#create + class QueueCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute name + # Human-readable name of the queue + # + # @return [String] + required :name, String + + # @!attribute description + # Optional description of the queue + # + # @return [String, nil] + optional :description, String, nil?: true + + # @!method initialize(name:, description: nil, request_options: {}) + # @param name [String] Human-readable name of the queue + # + # @param description [String, nil] Optional description of the queue + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/queue_delete_params.rb b/lib/lithic/models/transaction_monitoring/queue_delete_params.rb new file mode 100644 index 00000000..f91d7fd4 --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/queue_delete_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + # @see Lithic::Resources::TransactionMonitoring::Queues#delete + class QueueDeleteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute queue_token + # + # @return [String] + required :queue_token, String + + # @!method initialize(queue_token:, request_options: {}) + # @param queue_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/queue_list_params.rb b/lib/lithic/models/transaction_monitoring/queue_list_params.rb new file mode 100644 index 00000000..2474d6d2 --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/queue_list_params.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + # @see Lithic::Resources::TransactionMonitoring::Queues#list + class QueueListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute ending_before + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + # + # @return [String, nil] + optional :ending_before, String + + # @!attribute page_size + # Page size (for pagination). + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute starting_after + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + # + # @return [String, nil] + optional :starting_after, String + + # @!method initialize(ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionMonitoring::QueueListParams} for more details. + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/queue_retrieve_params.rb b/lib/lithic/models/transaction_monitoring/queue_retrieve_params.rb new file mode 100644 index 00000000..c50f3175 --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/queue_retrieve_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + # @see Lithic::Resources::TransactionMonitoring::Queues#retrieve + class QueueRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute queue_token + # + # @return [String] + required :queue_token, String + + # @!method initialize(queue_token:, request_options: {}) + # @param queue_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/queue_update_params.rb b/lib/lithic/models/transaction_monitoring/queue_update_params.rb new file mode 100644 index 00000000..ddae6426 --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/queue_update_params.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + # @see Lithic::Resources::TransactionMonitoring::Queues#update + class QueueUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute queue_token + # + # @return [String] + required :queue_token, String + + # @!attribute description + # New description for the queue, or `null` to clear it + # + # @return [String, nil] + optional :description, String, nil?: true + + # @!attribute name + # New name for the queue + # + # @return [String, nil] + optional :name, String + + # @!method initialize(queue_token:, description: nil, name: nil, request_options: {}) + # @param queue_token [String] + # + # @param description [String, nil] New description for the queue, or `null` to clear it + # + # @param name [String] New name for the queue + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/transaction_monitoring/resolution_outcome.rb b/lib/lithic/models/transaction_monitoring/resolution_outcome.rb new file mode 100644 index 00000000..aa1d352a --- /dev/null +++ b/lib/lithic/models/transaction_monitoring/resolution_outcome.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Lithic + module Models + module TransactionMonitoring + # Outcome recorded when a case is resolved: + # + # - `CONFIRMED_FRAUD` - The reviewed activity was confirmed to be fraudulent + # - `SUSPICIOUS_ACTIVITY` - The activity is suspicious but not confirmed fraud + # - `FALSE_POSITIVE` - The activity was legitimate and the alert was a false + # positive + # - `NO_ACTION_REQUIRED` - No further action is required + # - `ESCALATED_EXTERNAL` - The case was escalated to an external party + module ResolutionOutcome + extend Lithic::Internal::Type::Enum + + CONFIRMED_FRAUD = :CONFIRMED_FRAUD + SUSPICIOUS_ACTIVITY = :SUSPICIOUS_ACTIVITY + FALSE_POSITIVE = :FALSE_POSITIVE + NO_ACTION_REQUIRED = :NO_ACTION_REQUIRED + ESCALATED_EXTERNAL = :ESCALATED_EXTERNAL + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/transaction_retrieve_params.rb b/lib/lithic/models/transaction_retrieve_params.rb new file mode 100644 index 00000000..298fe520 --- /dev/null +++ b/lib/lithic/models/transaction_retrieve_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Transactions#retrieve + class TransactionRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute transaction_token + # + # @return [String] + required :transaction_token, String + + # @!method initialize(transaction_token:, request_options: {}) + # @param transaction_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/transaction_route_params.rb b/lib/lithic/models/transaction_route_params.rb new file mode 100644 index 00000000..9a1e0f55 --- /dev/null +++ b/lib/lithic/models/transaction_route_params.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Transactions#route + class TransactionRouteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute transaction_token + # + # @return [String] + required :transaction_token, String + + # @!attribute financial_account_token + # The token of the financial account to route the transaction to. + # + # @return [String] + required :financial_account_token, String + + # @!method initialize(transaction_token:, financial_account_token:, request_options: {}) + # @param transaction_token [String] + # + # @param financial_account_token [String] The token of the financial account to route the transaction to. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/transaction_simulate_authorization_advice_params.rb b/lib/lithic/models/transaction_simulate_authorization_advice_params.rb new file mode 100644 index 00000000..4c580dfc --- /dev/null +++ b/lib/lithic/models/transaction_simulate_authorization_advice_params.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Transactions#simulate_authorization_advice + class TransactionSimulateAuthorizationAdviceParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute token + # The transaction token returned from the /v1/simulate/authorize. response. + # + # @return [String] + required :token, String + + # @!attribute amount + # Amount (in cents) to authorize. This amount will override the transaction's + # amount that was originally set by /v1/simulate/authorize. + # + # @return [Integer] + required :amount, Integer + + # @!method initialize(token:, amount:, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionSimulateAuthorizationAdviceParams} for more details. + # + # @param token [String] The transaction token returned from the /v1/simulate/authorize. response. + # + # @param amount [Integer] Amount (in cents) to authorize. This amount will override the transaction's amou + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/transaction_simulate_authorization_advice_response.rb b/lib/lithic/models/transaction_simulate_authorization_advice_response.rb new file mode 100644 index 00000000..05879681 --- /dev/null +++ b/lib/lithic/models/transaction_simulate_authorization_advice_response.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Transactions#simulate_authorization_advice + class TransactionSimulateAuthorizationAdviceResponse < Lithic::Internal::Type::BaseModel + # @!attribute token + # A unique token to reference this transaction. + # + # @return [String, nil] + optional :token, String + + # @!attribute debugging_request_id + # Debugging request ID to share with Lithic Support team. + # + # @return [String, nil] + optional :debugging_request_id, String + + # @!method initialize(token: nil, debugging_request_id: nil) + # @param token [String] A unique token to reference this transaction. + # + # @param debugging_request_id [String] Debugging request ID to share with Lithic Support team. + end + end +end diff --git a/lib/lithic/models/transaction_simulate_authorization_params.rb b/lib/lithic/models/transaction_simulate_authorization_params.rb new file mode 100644 index 00000000..279ad985 --- /dev/null +++ b/lib/lithic/models/transaction_simulate_authorization_params.rb @@ -0,0 +1,175 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Transactions#simulate_authorization + class TransactionSimulateAuthorizationParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute amount + # Amount (in cents) to authorize. For credit authorizations and financial credit + # authorizations, any value entered will be converted into a negative amount in + # the simulated transaction. For example, entering 100 in this field will result + # in a -100 amount in the transaction. For balance inquiries, this field must be + # set to 0. + # + # @return [Integer] + required :amount, Integer + + # @!attribute descriptor + # Merchant descriptor. + # + # @return [String] + required :descriptor, String + + # @!attribute pan + # Sixteen digit card number. + # + # @return [String] + required :pan, String + + # @!attribute mcc + # Merchant category code for the transaction to be simulated. A four-digit number + # listed in ISO 18245. Supported merchant category codes can be found + # [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs). + # + # @return [String, nil] + optional :mcc, String + + # @!attribute merchant_acceptor_city + # Merchant acceptor city + # + # @return [String, nil] + optional :merchant_acceptor_city, String + + # @!attribute merchant_acceptor_country + # Merchant acceptor country code (ISO 3166-1 alpha-3) + # + # @return [String, nil] + optional :merchant_acceptor_country, String + + # @!attribute merchant_acceptor_id + # Unique identifier to identify the payment card acceptor. + # + # @return [String, nil] + optional :merchant_acceptor_id, String + + # @!attribute merchant_acceptor_state + # Merchant acceptor state/province (ISO 3166-2 subdivision code) + # + # @return [String, nil] + optional :merchant_acceptor_state, String + + # @!attribute merchant_amount + # Amount of the transaction to be simulated in currency specified in + # merchant_currency, including any acquirer fees. + # + # @return [Integer, nil] + optional :merchant_amount, Integer + + # @!attribute merchant_currency + # 3-character alphabetic ISO 4217 currency code. Note: Simulator only accepts USD, + # GBP, EUR and defaults to GBP if another ISO 4217 code is provided + # + # @return [String, nil] + optional :merchant_currency, String + + # @!attribute partial_approval_capable + # Set to true if the terminal is capable of partial approval otherwise false. + # Partial approval is when part of a transaction is approved and another payment + # must be used for the remainder. + # + # @return [Boolean, nil] + optional :partial_approval_capable, Lithic::Internal::Type::Boolean + + # @!attribute pin + # Simulate entering a PIN. If omitted, PIN check will not be performed. + # + # @return [String, nil] + optional :pin, String + + # @!attribute status + # Type of event to simulate. + # + # - `AUTHORIZATION` is a dual message purchase authorization, meaning a subsequent + # clearing step is required to settle the transaction. + # - `BALANCE_INQUIRY` is a $0 authorization requesting the balance held on the + # card, and is most often observed when a cardholder requests to view a card's + # balance at an ATM. + # - `CREDIT_AUTHORIZATION` is a dual message request from a merchant to authorize + # a refund, meaning a subsequent clearing step is required to settle the + # transaction. + # - `FINANCIAL_AUTHORIZATION` is a single message request from a merchant to debit + # funds immediately (such as an ATM withdrawal), and no subsequent clearing is + # required to settle the transaction. + # - `FINANCIAL_CREDIT_AUTHORIZATION` is a single message request from a merchant + # to credit funds immediately, and no subsequent clearing is required to settle + # the transaction. + # + # @return [Symbol, Lithic::Models::TransactionSimulateAuthorizationParams::Status, nil] + optional :status, enum: -> { Lithic::TransactionSimulateAuthorizationParams::Status } + + # @!method initialize(amount:, descriptor:, pan:, mcc: nil, merchant_acceptor_city: nil, merchant_acceptor_country: nil, merchant_acceptor_id: nil, merchant_acceptor_state: nil, merchant_amount: nil, merchant_currency: nil, partial_approval_capable: nil, pin: nil, status: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionSimulateAuthorizationParams} for more details. + # + # @param amount [Integer] Amount (in cents) to authorize. For credit authorizations and financial credit a + # + # @param descriptor [String] Merchant descriptor. + # + # @param pan [String] Sixteen digit card number. + # + # @param mcc [String] Merchant category code for the transaction to be simulated. A four-digit number + # + # @param merchant_acceptor_city [String] Merchant acceptor city + # + # @param merchant_acceptor_country [String] Merchant acceptor country code (ISO 3166-1 alpha-3) + # + # @param merchant_acceptor_id [String] Unique identifier to identify the payment card acceptor. + # + # @param merchant_acceptor_state [String] Merchant acceptor state/province (ISO 3166-2 subdivision code) + # + # @param merchant_amount [Integer] Amount of the transaction to be simulated in currency specified in merchant_curr + # + # @param merchant_currency [String] 3-character alphabetic ISO 4217 currency code. Note: Simulator only accepts USD, + # + # @param partial_approval_capable [Boolean] Set to true if the terminal is capable of partial approval otherwise false. + # + # @param pin [String] Simulate entering a PIN. If omitted, PIN check will not be performed. + # + # @param status [Symbol, Lithic::Models::TransactionSimulateAuthorizationParams::Status] Type of event to simulate. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Type of event to simulate. + # + # - `AUTHORIZATION` is a dual message purchase authorization, meaning a subsequent + # clearing step is required to settle the transaction. + # - `BALANCE_INQUIRY` is a $0 authorization requesting the balance held on the + # card, and is most often observed when a cardholder requests to view a card's + # balance at an ATM. + # - `CREDIT_AUTHORIZATION` is a dual message request from a merchant to authorize + # a refund, meaning a subsequent clearing step is required to settle the + # transaction. + # - `FINANCIAL_AUTHORIZATION` is a single message request from a merchant to debit + # funds immediately (such as an ATM withdrawal), and no subsequent clearing is + # required to settle the transaction. + # - `FINANCIAL_CREDIT_AUTHORIZATION` is a single message request from a merchant + # to credit funds immediately, and no subsequent clearing is required to settle + # the transaction. + module Status + extend Lithic::Internal::Type::Enum + + AUTHORIZATION = :AUTHORIZATION + BALANCE_INQUIRY = :BALANCE_INQUIRY + CREDIT_AUTHORIZATION = :CREDIT_AUTHORIZATION + FINANCIAL_AUTHORIZATION = :FINANCIAL_AUTHORIZATION + FINANCIAL_CREDIT_AUTHORIZATION = :FINANCIAL_CREDIT_AUTHORIZATION + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/transaction_simulate_authorization_response.rb b/lib/lithic/models/transaction_simulate_authorization_response.rb new file mode 100644 index 00000000..7fe5d31d --- /dev/null +++ b/lib/lithic/models/transaction_simulate_authorization_response.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Transactions#simulate_authorization + class TransactionSimulateAuthorizationResponse < Lithic::Internal::Type::BaseModel + # @!attribute token + # A unique token to reference this transaction with later calls to void or clear + # the authorization. + # + # @return [String, nil] + optional :token, String + + # @!attribute debugging_request_id + # Debugging request ID to share with Lithic Support team. + # + # @return [String, nil] + optional :debugging_request_id, String + + # @!method initialize(token: nil, debugging_request_id: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionSimulateAuthorizationResponse} for more details. + # + # @param token [String] A unique token to reference this transaction with later calls to void or clear t + # + # @param debugging_request_id [String] Debugging request ID to share with Lithic Support team. + end + end +end diff --git a/lib/lithic/models/transaction_simulate_clearing_params.rb b/lib/lithic/models/transaction_simulate_clearing_params.rb new file mode 100644 index 00000000..446d2156 --- /dev/null +++ b/lib/lithic/models/transaction_simulate_clearing_params.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Transactions#simulate_clearing + class TransactionSimulateClearingParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute token + # The transaction token returned from the /v1/simulate/authorize response. + # + # @return [String] + required :token, String + + # @!attribute amount + # Amount (in cents) to clear. Typically this will match the amount in the original + # authorization, but can be higher or lower. The sign of this amount will + # automatically match the sign of the original authorization's amount. For + # example, entering 100 in this field will result in a -100 amount in the + # transaction, if the original authorization is a credit authorization. + # + # If `amount` is not set, the full amount of the transaction will be cleared. + # Transactions that have already cleared, either partially or fully, cannot be + # cleared again using this endpoint. + # + # @return [Integer, nil] + optional :amount, Integer + + # @!method initialize(token:, amount: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionSimulateClearingParams} for more details. + # + # @param token [String] The transaction token returned from the /v1/simulate/authorize response. + # + # @param amount [Integer] Amount (in cents) to clear. Typically this will match the amount in the original + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/transaction_simulate_clearing_response.rb b/lib/lithic/models/transaction_simulate_clearing_response.rb new file mode 100644 index 00000000..18685e97 --- /dev/null +++ b/lib/lithic/models/transaction_simulate_clearing_response.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Transactions#simulate_clearing + class TransactionSimulateClearingResponse < Lithic::Internal::Type::BaseModel + # @!attribute debugging_request_id + # Debugging request ID to share with Lithic Support team. + # + # @return [String, nil] + optional :debugging_request_id, String + + # @!method initialize(debugging_request_id: nil) + # @param debugging_request_id [String] Debugging request ID to share with Lithic Support team. + end + end +end diff --git a/lib/lithic/models/transaction_simulate_credit_authorization_advice_params.rb b/lib/lithic/models/transaction_simulate_credit_authorization_advice_params.rb new file mode 100644 index 00000000..193347e1 --- /dev/null +++ b/lib/lithic/models/transaction_simulate_credit_authorization_advice_params.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Transactions#simulate_credit_authorization_advice + class TransactionSimulateCreditAuthorizationAdviceParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute amount + # Amount (in cents). Any value entered will be converted into a negative amount in + # the simulated transaction. For example, entering 100 in this field will appear + # as a -100 amount in the transaction. + # + # @return [Integer] + required :amount, Integer + + # @!attribute descriptor + # Merchant descriptor. + # + # @return [String] + required :descriptor, String + + # @!attribute pan + # Sixteen digit card number. + # + # @return [String] + required :pan, String + + # @!attribute mcc + # Merchant category code for the transaction to be simulated. A four-digit number + # listed in ISO 18245. Supported merchant category codes can be found + # [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs). + # + # @return [String, nil] + optional :mcc, String + + # @!attribute merchant_acceptor_city + # Merchant acceptor city + # + # @return [String, nil] + optional :merchant_acceptor_city, String + + # @!attribute merchant_acceptor_country + # Merchant acceptor country code (ISO 3166-1 alpha-3) + # + # @return [String, nil] + optional :merchant_acceptor_country, String + + # @!attribute merchant_acceptor_id + # Unique identifier to identify the payment card acceptor. + # + # @return [String, nil] + optional :merchant_acceptor_id, String + + # @!attribute merchant_acceptor_state + # Merchant acceptor state/province (ISO 3166-2 subdivision code) + # + # @return [String, nil] + optional :merchant_acceptor_state, String + + # @!method initialize(amount:, descriptor:, pan:, mcc: nil, merchant_acceptor_city: nil, merchant_acceptor_country: nil, merchant_acceptor_id: nil, merchant_acceptor_state: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionSimulateCreditAuthorizationAdviceParams} for more + # details. + # + # @param amount [Integer] Amount (in cents). Any value entered will be converted into a negative amount in + # + # @param descriptor [String] Merchant descriptor. + # + # @param pan [String] Sixteen digit card number. + # + # @param mcc [String] Merchant category code for the transaction to be simulated. A four-digit number + # + # @param merchant_acceptor_city [String] Merchant acceptor city + # + # @param merchant_acceptor_country [String] Merchant acceptor country code (ISO 3166-1 alpha-3) + # + # @param merchant_acceptor_id [String] Unique identifier to identify the payment card acceptor. + # + # @param merchant_acceptor_state [String] Merchant acceptor state/province (ISO 3166-2 subdivision code) + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/transaction_simulate_credit_authorization_advice_response.rb b/lib/lithic/models/transaction_simulate_credit_authorization_advice_response.rb new file mode 100644 index 00000000..f22e8581 --- /dev/null +++ b/lib/lithic/models/transaction_simulate_credit_authorization_advice_response.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Transactions#simulate_credit_authorization_advice + class TransactionSimulateCreditAuthorizationAdviceResponse < Lithic::Internal::Type::BaseModel + # @!attribute token + # A unique token to reference this transaction. + # + # @return [String, nil] + optional :token, String + + # @!attribute debugging_request_id + # Debugging request ID to share with Lithic Support team. + # + # @return [String, nil] + optional :debugging_request_id, String + + # @!method initialize(token: nil, debugging_request_id: nil) + # @param token [String] A unique token to reference this transaction. + # + # @param debugging_request_id [String] Debugging request ID to share with Lithic Support team. + end + end +end diff --git a/lib/lithic/models/transaction_simulate_return_params.rb b/lib/lithic/models/transaction_simulate_return_params.rb new file mode 100644 index 00000000..d4e695f0 --- /dev/null +++ b/lib/lithic/models/transaction_simulate_return_params.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Transactions#simulate_return + class TransactionSimulateReturnParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute amount + # Amount (in cents) to authorize. + # + # @return [Integer] + required :amount, Integer + + # @!attribute descriptor + # Merchant descriptor. + # + # @return [String] + required :descriptor, String + + # @!attribute pan + # Sixteen digit card number. + # + # @return [String] + required :pan, String + + # @!method initialize(amount:, descriptor:, pan:, request_options: {}) + # @param amount [Integer] Amount (in cents) to authorize. + # + # @param descriptor [String] Merchant descriptor. + # + # @param pan [String] Sixteen digit card number. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/transaction_simulate_return_response.rb b/lib/lithic/models/transaction_simulate_return_response.rb new file mode 100644 index 00000000..3aacab48 --- /dev/null +++ b/lib/lithic/models/transaction_simulate_return_response.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Transactions#simulate_return + class TransactionSimulateReturnResponse < Lithic::Internal::Type::BaseModel + # @!attribute token + # A unique token to reference this transaction. + # + # @return [String, nil] + optional :token, String + + # @!attribute debugging_request_id + # Debugging request ID to share with Lithic Support team. + # + # @return [String, nil] + optional :debugging_request_id, String + + # @!method initialize(token: nil, debugging_request_id: nil) + # @param token [String] A unique token to reference this transaction. + # + # @param debugging_request_id [String] Debugging request ID to share with Lithic Support team. + end + end +end diff --git a/lib/lithic/models/transaction_simulate_return_reversal_params.rb b/lib/lithic/models/transaction_simulate_return_reversal_params.rb new file mode 100644 index 00000000..d2157ff5 --- /dev/null +++ b/lib/lithic/models/transaction_simulate_return_reversal_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Transactions#simulate_return_reversal + class TransactionSimulateReturnReversalParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute token + # The transaction token returned from the /v1/simulate/authorize response. + # + # @return [String] + required :token, String + + # @!method initialize(token:, request_options: {}) + # @param token [String] The transaction token returned from the /v1/simulate/authorize response. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/transaction_simulate_return_reversal_response.rb b/lib/lithic/models/transaction_simulate_return_reversal_response.rb new file mode 100644 index 00000000..61be94f9 --- /dev/null +++ b/lib/lithic/models/transaction_simulate_return_reversal_response.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Transactions#simulate_return_reversal + class TransactionSimulateReturnReversalResponse < Lithic::Internal::Type::BaseModel + # @!attribute debugging_request_id + # Debugging request ID to share with Lithic Support team. + # + # @return [String, nil] + optional :debugging_request_id, String + + # @!method initialize(debugging_request_id: nil) + # @param debugging_request_id [String] Debugging request ID to share with Lithic Support team. + end + end +end diff --git a/lib/lithic/models/transaction_simulate_void_params.rb b/lib/lithic/models/transaction_simulate_void_params.rb new file mode 100644 index 00000000..209d212c --- /dev/null +++ b/lib/lithic/models/transaction_simulate_void_params.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Transactions#simulate_void + class TransactionSimulateVoidParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute token + # The transaction token returned from the /v1/simulate/authorize response. + # + # @return [String] + required :token, String + + # @!attribute amount + # Amount (in cents) to void. Typically this will match the amount in the original + # authorization, but can be less. Applies to authorization reversals only. An + # authorization expiry will always apply to the full pending amount. + # + # @return [Integer, nil] + optional :amount, Integer + + # @!attribute type + # Type of event to simulate. Defaults to `AUTHORIZATION_REVERSAL`. + # + # - `AUTHORIZATION_EXPIRY` indicates authorization has expired and been reversed + # by Lithic. + # - `AUTHORIZATION_REVERSAL` indicates authorization was reversed by the merchant. + # + # @return [Symbol, Lithic::Models::TransactionSimulateVoidParams::Type, nil] + optional :type, enum: -> { Lithic::TransactionSimulateVoidParams::Type } + + # @!method initialize(token:, amount: nil, type: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionSimulateVoidParams} for more details. + # + # @param token [String] The transaction token returned from the /v1/simulate/authorize response. + # + # @param amount [Integer] Amount (in cents) to void. Typically this will match the amount in the original + # + # @param type [Symbol, Lithic::Models::TransactionSimulateVoidParams::Type] Type of event to simulate. Defaults to `AUTHORIZATION_REVERSAL`. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + + # Type of event to simulate. Defaults to `AUTHORIZATION_REVERSAL`. + # + # - `AUTHORIZATION_EXPIRY` indicates authorization has expired and been reversed + # by Lithic. + # - `AUTHORIZATION_REVERSAL` indicates authorization was reversed by the merchant. + module Type + extend Lithic::Internal::Type::Enum + + AUTHORIZATION_EXPIRY = :AUTHORIZATION_EXPIRY + AUTHORIZATION_REVERSAL = :AUTHORIZATION_REVERSAL + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/transaction_simulate_void_response.rb b/lib/lithic/models/transaction_simulate_void_response.rb new file mode 100644 index 00000000..8199711f --- /dev/null +++ b/lib/lithic/models/transaction_simulate_void_response.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Transactions#simulate_void + class TransactionSimulateVoidResponse < Lithic::Internal::Type::BaseModel + # @!attribute debugging_request_id + # Debugging request ID to share with Lithic Support team. + # + # @return [String, nil] + optional :debugging_request_id, String + + # @!method initialize(debugging_request_id: nil) + # @param debugging_request_id [String] Debugging request ID to share with Lithic Support team. + end + end +end diff --git a/lib/lithic/models/transactions/enhanced_commercial_data_retrieve_params.rb b/lib/lithic/models/transactions/enhanced_commercial_data_retrieve_params.rb new file mode 100644 index 00000000..5fcb3567 --- /dev/null +++ b/lib/lithic/models/transactions/enhanced_commercial_data_retrieve_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Transactions + # @see Lithic::Resources::Transactions::EnhancedCommercialData#retrieve + class EnhancedCommercialDataRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute transaction_token + # + # @return [String] + required :transaction_token, String + + # @!method initialize(transaction_token:, request_options: {}) + # @param transaction_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/lithic/models/transactions/enhanced_commercial_data_retrieve_response.rb b/lib/lithic/models/transactions/enhanced_commercial_data_retrieve_response.rb new file mode 100644 index 00000000..b218622b --- /dev/null +++ b/lib/lithic/models/transactions/enhanced_commercial_data_retrieve_response.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Transactions + # @see Lithic::Resources::Transactions::EnhancedCommercialData#retrieve + class EnhancedCommercialDataRetrieveResponse < Lithic::Internal::Type::BaseModel + # @!attribute data + # + # @return [Array] + required :data, -> { Lithic::Internal::Type::ArrayOf[Lithic::Transactions::Events::EnhancedData] } + + # @!method initialize(data:) + # @param data [Array] + end + end + end +end diff --git a/lib/lithic/models/transactions/events/enhanced_commercial_data_retrieve_params.rb b/lib/lithic/models/transactions/events/enhanced_commercial_data_retrieve_params.rb new file mode 100644 index 00000000..9be9427f --- /dev/null +++ b/lib/lithic/models/transactions/events/enhanced_commercial_data_retrieve_params.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Transactions + module Events + # @see Lithic::Resources::Transactions::Events::EnhancedCommercialData#retrieve + class EnhancedCommercialDataRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute event_token + # + # @return [String] + required :event_token, String + + # @!method initialize(event_token:, request_options: {}) + # @param event_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end + end + end +end diff --git a/lib/lithic/models/transactions/events/enhanced_data.rb b/lib/lithic/models/transactions/events/enhanced_data.rb new file mode 100644 index 00000000..c65da11d --- /dev/null +++ b/lib/lithic/models/transactions/events/enhanced_data.rb @@ -0,0 +1,466 @@ +# frozen_string_literal: true + +module Lithic + module Models + module Transactions + module Events + # @see Lithic::Resources::Transactions::Events::EnhancedCommercialData#retrieve + class EnhancedData < Lithic::Internal::Type::BaseModel + # @!attribute token + # A unique identifier for the enhanced commercial data. + # + # @return [String] + required :token, String + + # @!attribute common + # + # @return [Lithic::Models::Transactions::Events::EnhancedData::Common] + required :common, -> { Lithic::Transactions::Events::EnhancedData::Common } + + # @!attribute event_token + # The token of the event that the enhanced data is associated with. + # + # @return [String] + required :event_token, String + + # @!attribute fleet + # + # @return [Array] + required :fleet, -> { Lithic::Internal::Type::ArrayOf[Lithic::Transactions::Events::EnhancedData::Fleet] } + + # @!attribute transaction_token + # The token of the transaction that the enhanced data is associated with. + # + # @return [String] + required :transaction_token, String + + # @!method initialize(token:, common:, event_token:, fleet:, transaction_token:) + # @param token [String] A unique identifier for the enhanced commercial data. + # + # @param common [Lithic::Models::Transactions::Events::EnhancedData::Common] + # + # @param event_token [String] The token of the event that the enhanced data is associated with. + # + # @param fleet [Array] + # + # @param transaction_token [String] The token of the transaction that the enhanced data is associated with. + + # @see Lithic::Models::Transactions::Events::EnhancedData#common + class Common < Lithic::Internal::Type::BaseModel + # @!attribute line_items + # + # @return [Array] + required :line_items, + -> { Lithic::Internal::Type::ArrayOf[Lithic::Transactions::Events::EnhancedData::Common::LineItem] } + + # @!attribute tax + # + # @return [Lithic::Models::Transactions::Events::EnhancedData::Common::Tax] + required :tax, -> { Lithic::Transactions::Events::EnhancedData::Common::Tax } + + # @!attribute customer_reference_number + # A customer identifier. + # + # @return [String, nil] + optional :customer_reference_number, String, nil?: true + + # @!attribute merchant_reference_number + # A merchant identifier. + # + # @return [String, nil] + optional :merchant_reference_number, String, nil?: true + + # @!attribute order_date + # The date of the order. + # + # @return [Date, nil] + optional :order_date, Date, nil?: true + + # @!method initialize(line_items:, tax:, customer_reference_number: nil, merchant_reference_number: nil, order_date: nil) + # @param line_items [Array] + # + # @param tax [Lithic::Models::Transactions::Events::EnhancedData::Common::Tax] + # + # @param customer_reference_number [String, nil] A customer identifier. + # + # @param merchant_reference_number [String, nil] A merchant identifier. + # + # @param order_date [Date, nil] The date of the order. + + class LineItem < Lithic::Internal::Type::BaseModel + # @!attribute amount + # The price of the item purchased in merchant currency. + # + # @return [String, nil] + optional :amount, String, nil?: true + + # @!attribute description + # A human-readable description of the item. + # + # @return [String, nil] + optional :description, String, nil?: true + + # @!attribute product_code + # An identifier for the item purchased. + # + # @return [String, nil] + optional :product_code, String, nil?: true + + # @!attribute quantity + # The quantity of the item purchased. + # + # @return [String, nil] + optional :quantity, String, nil?: true + + # @!method initialize(amount: nil, description: nil, product_code: nil, quantity: nil) + # An L2/L3 enhanced commercial data line item. + # + # @param amount [String, nil] The price of the item purchased in merchant currency. + # + # @param description [String, nil] A human-readable description of the item. + # + # @param product_code [String, nil] An identifier for the item purchased. + # + # @param quantity [String, nil] The quantity of the item purchased. + end + + # @see Lithic::Models::Transactions::Events::EnhancedData::Common#tax + class Tax < Lithic::Internal::Type::BaseModel + # @!attribute amount + # The amount of tax collected. + # + # @return [Integer, nil] + optional :amount, Integer, nil?: true + + # @!attribute exempt + # A flag indicating whether the transaction is tax exempt or not. + # + # @return [Symbol, Lithic::Models::Transactions::Events::EnhancedData::Common::Tax::Exempt, nil] + optional :exempt, + enum: -> { + Lithic::Transactions::Events::EnhancedData::Common::Tax::Exempt + }, + nil?: true + + # @!attribute merchant_tax_id + # The tax ID of the merchant. + # + # @return [String, nil] + optional :merchant_tax_id, String, nil?: true + + # @!method initialize(amount: nil, exempt: nil, merchant_tax_id: nil) + # @param amount [Integer, nil] The amount of tax collected. + # + # @param exempt [Symbol, Lithic::Models::Transactions::Events::EnhancedData::Common::Tax::Exempt, nil] A flag indicating whether the transaction is tax exempt or not. + # + # @param merchant_tax_id [String, nil] The tax ID of the merchant. + + # A flag indicating whether the transaction is tax exempt or not. + # + # @see Lithic::Models::Transactions::Events::EnhancedData::Common::Tax#exempt + module Exempt + extend Lithic::Internal::Type::Enum + + TAX_INCLUDED = :TAX_INCLUDED + TAX_NOT_INCLUDED = :TAX_NOT_INCLUDED + NOT_SUPPORTED = :NOT_SUPPORTED + + # @!method self.values + # @return [Array] + end + end + end + + class Fleet < Lithic::Internal::Type::BaseModel + # @!attribute amount_totals + # + # @return [Lithic::Models::Transactions::Events::EnhancedData::Fleet::AmountTotals] + required :amount_totals, -> { Lithic::Transactions::Events::EnhancedData::Fleet::AmountTotals } + + # @!attribute fuel + # + # @return [Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel] + required :fuel, -> { Lithic::Transactions::Events::EnhancedData::Fleet::Fuel } + + # @!attribute driver_number + # The driver number entered into the terminal at the time of sale, with leading + # zeros stripped. + # + # @return [String, nil] + optional :driver_number, String, nil?: true + + # @!attribute odometer + # The odometer reading entered into the terminal at the time of sale. + # + # @return [Integer, nil] + optional :odometer, Integer, nil?: true + + # @!attribute service_type + # The type of fuel service. + # + # @return [Symbol, Lithic::Models::Transactions::Events::EnhancedData::Fleet::ServiceType, nil] + optional :service_type, enum: -> { Lithic::Transactions::Events::EnhancedData::Fleet::ServiceType } + + # @!attribute vehicle_number + # The vehicle number entered into the terminal at the time of sale, with leading + # zeros stripped. + # + # @return [String, nil] + optional :vehicle_number, String, nil?: true + + # @!method initialize(amount_totals:, fuel:, driver_number: nil, odometer: nil, service_type: nil, vehicle_number: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::Transactions::Events::EnhancedData::Fleet} for more details. + # + # @param amount_totals [Lithic::Models::Transactions::Events::EnhancedData::Fleet::AmountTotals] + # + # @param fuel [Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel] + # + # @param driver_number [String, nil] The driver number entered into the terminal at the time of sale, with leading ze + # + # @param odometer [Integer, nil] The odometer reading entered into the terminal at the time of sale. + # + # @param service_type [Symbol, Lithic::Models::Transactions::Events::EnhancedData::Fleet::ServiceType] The type of fuel service. + # + # @param vehicle_number [String, nil] The vehicle number entered into the terminal at the time of sale, with leading z + + # @see Lithic::Models::Transactions::Events::EnhancedData::Fleet#amount_totals + class AmountTotals < Lithic::Internal::Type::BaseModel + # @!attribute discount + # The discount applied to the gross sale amount. + # + # @return [Integer, nil] + optional :discount, Integer, nil?: true + + # @!attribute gross_sale + # The gross sale amount. + # + # @return [Integer, nil] + optional :gross_sale, Integer, nil?: true + + # @!attribute net_sale + # The amount after discount. + # + # @return [Integer, nil] + optional :net_sale, Integer, nil?: true + + # @!method initialize(discount: nil, gross_sale: nil, net_sale: nil) + # @param discount [Integer, nil] The discount applied to the gross sale amount. + # + # @param gross_sale [Integer, nil] The gross sale amount. + # + # @param net_sale [Integer, nil] The amount after discount. + end + + # @see Lithic::Models::Transactions::Events::EnhancedData::Fleet#fuel + class Fuel < Lithic::Internal::Type::BaseModel + # @!attribute quantity + # The quantity of fuel purchased. + # + # @return [String, nil] + optional :quantity, String, nil?: true + + # @!attribute type + # The type of fuel purchased. + # + # @return [Symbol, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type, nil] + optional :type, + enum: -> { + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type + }, + nil?: true + + # @!attribute unit_of_measure + # Unit of measure for fuel disbursement. + # + # @return [Symbol, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure, nil] + optional :unit_of_measure, + enum: -> { Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure }, + nil?: true + + # @!attribute unit_price + # The price per unit of fuel. + # + # @return [Integer, nil] + optional :unit_price, Integer, nil?: true + + # @!method initialize(quantity: nil, type: nil, unit_of_measure: nil, unit_price: nil) + # @param quantity [String, nil] The quantity of fuel purchased. + # + # @param type [Symbol, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::Type, nil] The type of fuel purchased. + # + # @param unit_of_measure [Symbol, Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure, nil] Unit of measure for fuel disbursement. + # + # @param unit_price [Integer, nil] The price per unit of fuel. + + # The type of fuel purchased. + # + # @see Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel#type + module Type + extend Lithic::Internal::Type::Enum + + UNKNOWN = :UNKNOWN + REGULAR = :REGULAR + MID_PLUS = :MID_PLUS + PREMIUM_SUPER = :PREMIUM_SUPER + MID_PLUS_2 = :MID_PLUS_2 + PREMIUM_SUPER_2 = :PREMIUM_SUPER_2 + ETHANOL_5_7_BLEND = :ETHANOL_5_7_BLEND + MID_PLUS_ETHANOL_5_7_PERCENT_BLEND = :MID_PLUS_ETHANOL_5_7_PERCENT_BLEND + PREMIUM_SUPER_ETHANOL_5_7_PERCENT_BLEND = :PREMIUM_SUPER_ETHANOL_5_7_PERCENT_BLEND + ETHANOL_7_7_PERCENT_BLEND = :ETHANOL_7_7_PERCENT_BLEND + MID_PLUS_ETHANOL_7_7_PERCENT_BLEND = :MID_PLUS_ETHANOL_7_7_PERCENT_BLEND + GREEN_GASOLINE_REGULAR = :GREEN_GASOLINE_REGULAR + GREEN_GASOLINE_MID_PLUS = :GREEN_GASOLINE_MID_PLUS + GREEN_GASOLINE_PREMIUM_SUPER = :GREEN_GASOLINE_PREMIUM_SUPER + REGULAR_DIESEL_2 = :REGULAR_DIESEL_2 + PREMIUM_DIESEL_2 = :PREMIUM_DIESEL_2 + REGULAR_DIESEL_1 = :REGULAR_DIESEL_1 + COMPRESSED_NATURAL_GAS = :COMPRESSED_NATURAL_GAS + LIQUID_PROPANE_GAS = :LIQUID_PROPANE_GAS + LIQUID_NATURAL_GAS = :LIQUID_NATURAL_GAS + E_85 = :E_85 + REFORMULATED_1 = :REFORMULATED_1 + REFORMULATED_2 = :REFORMULATED_2 + REFORMULATED_3 = :REFORMULATED_3 + REFORMULATED_4 = :REFORMULATED_4 + REFORMULATED_5 = :REFORMULATED_5 + DIESEL_OFF_ROAD_1_AND_2_NON_TAXABLE = :DIESEL_OFF_ROAD_1_AND_2_NON_TAXABLE + DIESEL_OFF_ROAD_NON_TAXABLE = :DIESEL_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_OFF_ROAD_NON_TAXABLE = :BIODIESEL_BLEND_OFF_ROAD_NON_TAXABLE + UNDEFINED_FUEL = :UNDEFINED_FUEL + RACING_FUEL = :RACING_FUEL + MID_PLUS_2_10_PERCENT_BLEND = :MID_PLUS_2_10_PERCENT_BLEND + PREMIUM_SUPER_2_10_PERCENT_BLEND = :PREMIUM_SUPER_2_10_PERCENT_BLEND + MID_PLUS_ETHANOL_2_15_PERCENT_BLEND = :MID_PLUS_ETHANOL_2_15_PERCENT_BLEND + PREMIUM_SUPER_ETHANOL_2_15_PERCENT_BLEND = :PREMIUM_SUPER_ETHANOL_2_15_PERCENT_BLEND + PREMIUM_SUPER_ETHANOL_7_7_PERCENT_BLEND = :PREMIUM_SUPER_ETHANOL_7_7_PERCENT_BLEND + REGULAR_ETHANOL_10_PERCENT_BLEND = :REGULAR_ETHANOL_10_PERCENT_BLEND + MID_PLUS_ETHANOL_10_PERCENT_BLEND = :MID_PLUS_ETHANOL_10_PERCENT_BLEND + PREMIUM_SUPER_ETHANOL_10_PERCENT_BLEND = :PREMIUM_SUPER_ETHANOL_10_PERCENT_BLEND + B2_DIESEL_BLEND_2_PERCENT_BIODIESEL = :B2_DIESEL_BLEND_2_PERCENT_BIODIESEL + B5_DIESEL_BLEND_5_PERCENT_BIODIESEL = :B5_DIESEL_BLEND_5_PERCENT_BIODIESEL + B10_DIESEL_BLEND_10_PERCENT_BIODIESEL = :B10_DIESEL_BLEND_10_PERCENT_BIODIESEL + B11_DIESEL_BLEND_11_PERCENT_BIODIESEL = :B11_DIESEL_BLEND_11_PERCENT_BIODIESEL + B15_DIESEL_BLEND_15_PERCENT_BIODIESEL = :B15_DIESEL_BLEND_15_PERCENT_BIODIESEL + B20_DIESEL_BLEND_20_PERCENT_BIODIESEL = :B20_DIESEL_BLEND_20_PERCENT_BIODIESEL + B100_DIESEL_BLEND_100_PERCENT_BIODIESEL = :B100_DIESEL_BLEND_100_PERCENT_BIODIESEL + B1_DIESEL_BLEND_1_PERCENT_BIODIESEL = :B1_DIESEL_BLEND_1_PERCENT_BIODIESEL + ADDITIZED_DIESEL_2 = :ADDITIZED_DIESEL_2 + ADDITIZED_DIESEL_3 = :ADDITIZED_DIESEL_3 + RENEWABLE_DIESEL_R95 = :RENEWABLE_DIESEL_R95 + RENEWABLE_DIESEL_BIODIESEL_6_20_PERCENT = :RENEWABLE_DIESEL_BIODIESEL_6_20_PERCENT + DIESEL_EXHAUST_FLUID = :DIESEL_EXHAUST_FLUID + PREMIUM_DIESEL_1 = :PREMIUM_DIESEL_1 + REGULAR_ETHANOL_15_PERCENT_BLEND = :REGULAR_ETHANOL_15_PERCENT_BLEND + MID_PLUS_ETHANOL_15_PERCENT_BLEND = :MID_PLUS_ETHANOL_15_PERCENT_BLEND + PREMIUM_SUPER_ETHANOL_15_PERCENT_BLEND = :PREMIUM_SUPER_ETHANOL_15_PERCENT_BLEND + PREMIUM_DIESEL_BLEND_LESS_THAN_20_PERCENT_BIODIESEL = + :PREMIUM_DIESEL_BLEND_LESS_THAN_20_PERCENT_BIODIESEL + PREMIUM_DIESEL_BLEND_GREATER_THAN_20_PERCENT_BIODIESEL = + :PREMIUM_DIESEL_BLEND_GREATER_THAN_20_PERCENT_BIODIESEL + B75_DIESEL_BLEND_75_PERCENT_BIODIESEL = :B75_DIESEL_BLEND_75_PERCENT_BIODIESEL + B99_DIESEL_BLEND_99_PERCENT_BIODIESEL = :B99_DIESEL_BLEND_99_PERCENT_BIODIESEL + MISCELLANEOUS_FUEL = :MISCELLANEOUS_FUEL + JET_FUEL = :JET_FUEL + AVIATION_FUEL_REGULAR = :AVIATION_FUEL_REGULAR + AVIATION_FUEL_PREMIUM = :AVIATION_FUEL_PREMIUM + AVIATION_FUEL_JP8 = :AVIATION_FUEL_JP8 + AVIATION_FUEL_4 = :AVIATION_FUEL_4 + AVIATION_FUEL_5 = :AVIATION_FUEL_5 + BIOJET_DIESEL = :BIOJET_DIESEL + AVIATION_BIOFUEL_GASOLINE = :AVIATION_BIOFUEL_GASOLINE + MISCELLANEOUS_AVIATION_FUEL = :MISCELLANEOUS_AVIATION_FUEL + MARINE_FUEL_1 = :MARINE_FUEL_1 + MARINE_FUEL_2 = :MARINE_FUEL_2 + MARINE_FUEL_3 = :MARINE_FUEL_3 + MARINE_FUEL_4 = :MARINE_FUEL_4 + MARINE_FUEL_5 = :MARINE_FUEL_5 + MARINE_OTHER = :MARINE_OTHER + MARINE_DIESEL = :MARINE_DIESEL + MISCELLANEOUS_MARINE_FUEL = :MISCELLANEOUS_MARINE_FUEL + KEROSENE_LOW_SULFUR = :KEROSENE_LOW_SULFUR + WHITE_GAS = :WHITE_GAS + HEATING_OIL = :HEATING_OIL + OTHER_FUEL_NON_TAXABLE = :OTHER_FUEL_NON_TAXABLE + KEROSENE_ULTRA_LOW_SULFUR = :KEROSENE_ULTRA_LOW_SULFUR + KEROSENE_LOW_SULFUR_NON_TAXABLE = :KEROSENE_LOW_SULFUR_NON_TAXABLE + KEROSENE_ULTRA_LOW_SULFUR_NON_TAXABLE = :KEROSENE_ULTRA_LOW_SULFUR_NON_TAXABLE + EVC_1_LEVEL_1_CHARGE_110_V_15_AMP = :EVC_1_LEVEL_1_CHARGE_110V_15_AMP + EVC_2_LEVEL_2_CHARGE_240_V_15_40_AMP = :EVC_2_LEVEL_2_CHARGE_240V_15_40_AMP + EVC_3_LEVEL_3_CHARGE_480_V_3_PHASE_CHARGE = :EVC_3_LEVEL_3_CHARGE_480V_3_PHASE_CHARGE + BIODIESEL_BLEND_2_PERCENT_OFF_ROAD_NON_TAXABLE = :BIODIESEL_BLEND_2_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_5_PERCENT_OFF_ROAD_NON_TAXABLE = :BIODIESEL_BLEND_5_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_10_PERCENT_OFF_ROAD_NON_TAXABLE = :BIODIESEL_BLEND_10_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_11_PERCENT_OFF_ROAD_NON_TAXABLE = :BIODIESEL_BLEND_11_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_15_PERCENT_OFF_ROAD_NON_TAXABLE = :BIODIESEL_BLEND_15_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_20_PERCENT_OFF_ROAD_NON_TAXABLE = :BIODIESEL_BLEND_20_PERCENT_OFF_ROAD_NON_TAXABLE + DIESEL_1_OFF_ROAD_NON_TAXABLE = :DIESEL_1_OFF_ROAD_NON_TAXABLE + DIESEL_2_OFF_ROAD_NON_TAXABLE = :DIESEL_2_OFF_ROAD_NON_TAXABLE + DIESEL_1_PREMIUM_OFF_ROAD_NON_TAXABLE = :DIESEL_1_PREMIUM_OFF_ROAD_NON_TAXABLE + DIESEL_2_PREMIUM_OFF_ROAD_NON_TAXABLE = :DIESEL_2_PREMIUM_OFF_ROAD_NON_TAXABLE + ADDITIVE_DOSAGE = :ADDITIVE_DOSAGE + ETHANOL_BLENDS_E16_E84 = :ETHANOL_BLENDS_E16_E84 + LOW_OCTANE_UNL = :LOW_OCTANE_UNL + BLENDED_DIESEL_1_AND_2 = :BLENDED_DIESEL_1_AND_2 + OFF_ROAD_REGULAR_NON_TAXABLE = :OFF_ROAD_REGULAR_NON_TAXABLE + OFF_ROAD_MID_PLUS_NON_TAXABLE = :OFF_ROAD_MID_PLUS_NON_TAXABLE + OFF_ROAD_PREMIUM_SUPER_NON_TAXABLE = :OFF_ROAD_PREMIUM_SUPER_NON_TAXABLE + OFF_ROAD_MID_PLUS_2_NON_TAXABLE = :OFF_ROAD_MID_PLUS_2_NON_TAXABLE + OFF_ROAD_PREMIUM_SUPER_2_NON_TAXABLE = :OFF_ROAD_PREMIUM_SUPER_2_NON_TAXABLE + RECREATIONAL_FUEL_90_OCTANE = :RECREATIONAL_FUEL_90_OCTANE + HYDROGEN_H35 = :HYDROGEN_H35 + HYDROGEN_H70 = :HYDROGEN_H70 + RENEWABLE_DIESEL_R95_OFF_ROAD_NON_TAXABLE = :RENEWABLE_DIESEL_R95_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_1_PERCENT_OFF_ROAD_NON_TAXABLE = :BIODIESEL_BLEND_1_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_75_PERCENT_OFF_ROAD_NON_TAXABLE = :BIODIESEL_BLEND_75_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_99_PERCENT_OFF_ROAD_NON_TAXABLE = :BIODIESEL_BLEND_99_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_100_PERCENT_OFF_ROAD_NON_TAXABLE = :BIODIESEL_BLEND_100_PERCENT_OFF_ROAD_NON_TAXABLE + RENEWABLE_DIESEL_BIODIESEL_6_20_PERCENT_OFF_ROAD_NON_TAXABLE = + :RENEWABLE_DIESEL_BIODIESEL_6_20_PERCENT_OFF_ROAD_NON_TAXABLE + MISCELLANEOUS_OTHER_FUEL = :MISCELLANEOUS_OTHER_FUEL + + # @!method self.values + # @return [Array] + end + + # Unit of measure for fuel disbursement. + # + # @see Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel#unit_of_measure + module UnitOfMeasure + extend Lithic::Internal::Type::Enum + + GALLONS = :GALLONS + LITERS = :LITERS + POUNDS = :POUNDS + KILOGRAMS = :KILOGRAMS + IMPERIAL_GALLONS = :IMPERIAL_GALLONS + NOT_APPLICABLE = :NOT_APPLICABLE + UNKNOWN = :UNKNOWN + + # @!method self.values + # @return [Array] + end + end + + # The type of fuel service. + # + # @see Lithic::Models::Transactions::Events::EnhancedData::Fleet#service_type + module ServiceType + extend Lithic::Internal::Type::Enum + + UNKNOWN = :UNKNOWN + UNDEFINED = :UNDEFINED + SELF_SERVICE = :SELF_SERVICE + FULL_SERVICE = :FULL_SERVICE + NON_FUEL_ONLY = :NON_FUEL_ONLY + + # @!method self.values + # @return [Array] + end + end + end + end + end + end +end diff --git a/lib/lithic/models/transfer.rb b/lib/lithic/models/transfer.rb new file mode 100644 index 00000000..524a1c53 --- /dev/null +++ b/lib/lithic/models/transfer.rb @@ -0,0 +1,182 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Transfers#create + class Transfer < Lithic::Internal::Type::BaseModel + # @!attribute token + # Globally unique identifier for the transfer event. + # + # @return [String, nil] + optional :token, String + + # @!attribute category + # Status types: + # + # - `TRANSFER` - Internal transfer of funds between financial accounts in your + # program. + # + # @return [Symbol, Lithic::Models::Transfer::Category, nil] + optional :category, enum: -> { Lithic::Transfer::Category } + + # @!attribute created + # Date and time when the transfer occurred. UTC time zone. + # + # @return [Time, nil] + optional :created, Time + + # @!attribute currency + # 3-character alphabetic ISO 4217 code for the settling currency of the + # transaction. + # + # @return [String, nil] + optional :currency, String + + # @!attribute descriptor + # A string that provides a description of the transfer; may be useful to display + # to users. + # + # @return [String, nil] + optional :descriptor, String + + # @!attribute events + # A list of all financial events that have modified this trasnfer. + # + # @return [Array, nil] + optional :events, -> { Lithic::Internal::Type::ArrayOf[Lithic::FinancialEvent] } + + # @!attribute from_balance + # The updated balance of the sending financial account. + # + # @return [Array, nil] + optional :from_balance, -> { Lithic::Internal::Type::ArrayOf[Lithic::Balance] } + + # @!attribute pending_amount + # Pending amount of the transaction in the currency's smallest unit (e.g., cents), + # including any acquirer fees. The value of this field will go to zero over time + # once the financial transaction is settled. + # + # @return [Integer, nil] + optional :pending_amount, Integer + + # @!attribute result + # APPROVED transactions were successful while DECLINED transactions were declined + # by user, Lithic, or the network. + # + # @return [Symbol, Lithic::Models::Transfer::Result, nil] + optional :result, enum: -> { Lithic::Transfer::Result } + + # @!attribute settled_amount + # Amount of the transaction that has been settled in the currency's smallest unit + # (e.g., cents). + # + # @return [Integer, nil] + optional :settled_amount, Integer + + # @!attribute status + # Status types: + # + # - `DECLINED` - The transfer was declined. + # - `EXPIRED` - The transfer was held in pending for too long and expired. + # - `PENDING` - The transfer is pending release from a hold. + # - `SETTLED` - The transfer is completed. + # - `VOIDED` - The transfer was reversed before it settled. + # + # @return [Symbol, Lithic::Models::Transfer::Status, nil] + optional :status, enum: -> { Lithic::Transfer::Status } + + # @!attribute to_balance + # The updated balance of the receiving financial account. + # + # @return [Array, nil] + optional :to_balance, -> { Lithic::Internal::Type::ArrayOf[Lithic::Balance] } + + # @!attribute updated + # Date and time when the financial transaction was last updated. UTC time zone. + # + # @return [Time, nil] + optional :updated, Time + + # @!method initialize(token: nil, category: nil, created: nil, currency: nil, descriptor: nil, events: nil, from_balance: nil, pending_amount: nil, result: nil, settled_amount: nil, status: nil, to_balance: nil, updated: nil) + # Some parameter documentations has been truncated, see {Lithic::Models::Transfer} + # for more details. + # + # @param token [String] Globally unique identifier for the transfer event. + # + # @param category [Symbol, Lithic::Models::Transfer::Category] Status types: + # + # @param created [Time] Date and time when the transfer occurred. UTC time zone. + # + # @param currency [String] 3-character alphabetic ISO 4217 code for the settling currency of the transactio + # + # @param descriptor [String] A string that provides a description of the transfer; may be useful to display t + # + # @param events [Array] A list of all financial events that have modified this trasnfer. + # + # @param from_balance [Array] The updated balance of the sending financial account. + # + # @param pending_amount [Integer] Pending amount of the transaction in the currency's smallest unit (e.g., cents), + # + # @param result [Symbol, Lithic::Models::Transfer::Result] APPROVED transactions were successful while DECLINED transactions were declined + # + # @param settled_amount [Integer] Amount of the transaction that has been settled in the currency's smallest unit + # + # @param status [Symbol, Lithic::Models::Transfer::Status] Status types: + # + # @param to_balance [Array] The updated balance of the receiving financial account. + # + # @param updated [Time] Date and time when the financial transaction was last updated. UTC time zone. + + # Status types: + # + # - `TRANSFER` - Internal transfer of funds between financial accounts in your + # program. + # + # @see Lithic::Models::Transfer#category + module Category + extend Lithic::Internal::Type::Enum + + TRANSFER = :TRANSFER + + # @!method self.values + # @return [Array] + end + + # APPROVED transactions were successful while DECLINED transactions were declined + # by user, Lithic, or the network. + # + # @see Lithic::Models::Transfer#result + module Result + extend Lithic::Internal::Type::Enum + + APPROVED = :APPROVED + DECLINED = :DECLINED + + # @!method self.values + # @return [Array] + end + + # Status types: + # + # - `DECLINED` - The transfer was declined. + # - `EXPIRED` - The transfer was held in pending for too long and expired. + # - `PENDING` - The transfer is pending release from a hold. + # - `SETTLED` - The transfer is completed. + # - `VOIDED` - The transfer was reversed before it settled. + # + # @see Lithic::Models::Transfer#status + module Status + extend Lithic::Internal::Type::Enum + + DECLINED = :DECLINED + EXPIRED = :EXPIRED + PENDING = :PENDING + SETTLED = :SETTLED + VOIDED = :VOIDED + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/lithic/models/transfer_create_params.rb b/lib/lithic/models/transfer_create_params.rb new file mode 100644 index 00000000..06fff0a8 --- /dev/null +++ b/lib/lithic/models/transfer_create_params.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Transfers#create + class TransferCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute amount + # Amount to be transferred in the currency’s smallest unit (e.g., cents for USD). + # This should always be a positive value. + # + # @return [Integer] + required :amount, Integer + + # @!attribute from + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + # + # @return [String] + required :from, String + + # @!attribute to + # Globally unique identifier for the financial account or card that will receive + # the funds. Accepted type dependent on the program's use case. + # + # @return [String] + required :to, String + + # @!attribute token + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + # + # @return [String, nil] + optional :token, String + + # @!attribute memo + # Optional descriptor for the transfer. + # + # @return [String, nil] + optional :memo, String + + # @!method initialize(amount:, from:, to:, token: nil, memo: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransferCreateParams} for more details. + # + # @param amount [Integer] Amount to be transferred in the currency’s smallest unit (e.g., cents for USD). + # + # @param from [String] Globally unique identifier for the financial account or card that will send the + # + # @param to [String] Globally unique identifier for the financial account or card that will receive t + # + # @param token [String] Customer-provided token that will serve as an idempotency token. This token will + # + # @param memo [String] Optional descriptor for the transfer. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/transfer_limit_list_params.rb b/lib/lithic/models/transfer_limit_list_params.rb new file mode 100644 index 00000000..b9685cfe --- /dev/null +++ b/lib/lithic/models/transfer_limit_list_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::TransferLimits#list + class TransferLimitListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!attribute date + # Date for which to retrieve transfer limits (ISO 8601 format) + # + # @return [Date, nil] + optional :date, Date + + # @!method initialize(date: nil, request_options: {}) + # @param date [Date] Date for which to retrieve transfer limits (ISO 8601 format) + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/transfer_limits_response.rb b/lib/lithic/models/transfer_limits_response.rb new file mode 100644 index 00000000..1bf5ea8e --- /dev/null +++ b/lib/lithic/models/transfer_limits_response.rb @@ -0,0 +1,274 @@ +# frozen_string_literal: true + +module Lithic + module Models + class TransferLimitsResponse < Lithic::Internal::Type::BaseModel + # @!attribute data + # List of transfer limits + # + # @return [Array] + required :data, -> { Lithic::Internal::Type::ArrayOf[Lithic::TransferLimitsResponse::Data] } + + # @!attribute has_more + # Whether there are more transfer limits + # + # @return [Boolean] + required :has_more, Lithic::Internal::Type::Boolean + + # @!method initialize(data:, has_more:) + # @param data [Array] List of transfer limits + # + # @param has_more [Boolean] Whether there are more transfer limits + + class Data < Lithic::Internal::Type::BaseModel + # @!attribute company_id + # Company ID + # + # @return [String] + required :company_id, String + + # @!attribute daily_limit + # Daily limits with progress + # + # @return [Lithic::Models::TransferLimitsResponse::Data::DailyLimit] + required :daily_limit, -> { Lithic::TransferLimitsResponse::Data::DailyLimit } + + # @!attribute date + # The date for the limit view (ISO format) + # + # @return [Date] + required :date, Date + + # @!attribute is_fbo + # Whether the company is a FBO; based on the company ID prefix + # + # @return [Boolean] + required :is_fbo, Lithic::Internal::Type::Boolean + + # @!attribute monthly_limit + # Monthly limits with progress + # + # @return [Lithic::Models::TransferLimitsResponse::Data::MonthlyLimit] + required :monthly_limit, -> { Lithic::TransferLimitsResponse::Data::MonthlyLimit } + + # @!attribute program_limit_per_transaction + # Program transaction limits + # + # @return [Lithic::Models::TransferLimitsResponse::Data::ProgramLimitPerTransaction] + required :program_limit_per_transaction, + -> { Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction } + + # @!method initialize(company_id:, daily_limit:, date:, is_fbo:, monthly_limit:, program_limit_per_transaction:) + # @param company_id [String] Company ID + # + # @param daily_limit [Lithic::Models::TransferLimitsResponse::Data::DailyLimit] Daily limits with progress + # + # @param date [Date] The date for the limit view (ISO format) + # + # @param is_fbo [Boolean] Whether the company is a FBO; based on the company ID prefix + # + # @param monthly_limit [Lithic::Models::TransferLimitsResponse::Data::MonthlyLimit] Monthly limits with progress + # + # @param program_limit_per_transaction [Lithic::Models::TransferLimitsResponse::Data::ProgramLimitPerTransaction] Program transaction limits + + # @see Lithic::Models::TransferLimitsResponse::Data#daily_limit + class DailyLimit < Lithic::Internal::Type::BaseModel + # @!attribute credit + # Credit limits + # + # @return [Lithic::Models::TransferLimitsResponse::Data::DailyLimit::Credit] + required :credit, -> { Lithic::TransferLimitsResponse::Data::DailyLimit::Credit } + + # @!attribute debit + # Debit limits + # + # @return [Lithic::Models::TransferLimitsResponse::Data::DailyLimit::Debit] + required :debit, -> { Lithic::TransferLimitsResponse::Data::DailyLimit::Debit } + + # @!method initialize(credit:, debit:) + # Daily limits with progress + # + # @param credit [Lithic::Models::TransferLimitsResponse::Data::DailyLimit::Credit] Credit limits + # + # @param debit [Lithic::Models::TransferLimitsResponse::Data::DailyLimit::Debit] Debit limits + + # @see Lithic::Models::TransferLimitsResponse::Data::DailyLimit#credit + class Credit < Lithic::Internal::Type::BaseModel + # @!attribute limit + # The limit amount + # + # @return [Integer] + required :limit, Integer + + # @!attribute amount_originated + # Amount originated towards limit + # + # @return [Integer, nil] + optional :amount_originated, Integer, nil?: true + + # @!method initialize(limit:, amount_originated: nil) + # Credit limits + # + # @param limit [Integer] The limit amount + # + # @param amount_originated [Integer, nil] Amount originated towards limit + end + + # @see Lithic::Models::TransferLimitsResponse::Data::DailyLimit#debit + class Debit < Lithic::Internal::Type::BaseModel + # @!attribute limit + # The limit amount + # + # @return [Integer] + required :limit, Integer + + # @!attribute amount_originated + # Amount originated towards limit + # + # @return [Integer, nil] + optional :amount_originated, Integer, nil?: true + + # @!method initialize(limit:, amount_originated: nil) + # Debit limits + # + # @param limit [Integer] The limit amount + # + # @param amount_originated [Integer, nil] Amount originated towards limit + end + end + + # @see Lithic::Models::TransferLimitsResponse::Data#monthly_limit + class MonthlyLimit < Lithic::Internal::Type::BaseModel + # @!attribute credit + # Credit limits + # + # @return [Lithic::Models::TransferLimitsResponse::Data::MonthlyLimit::Credit] + required :credit, -> { Lithic::TransferLimitsResponse::Data::MonthlyLimit::Credit } + + # @!attribute debit + # Debit limits + # + # @return [Lithic::Models::TransferLimitsResponse::Data::MonthlyLimit::Debit] + required :debit, -> { Lithic::TransferLimitsResponse::Data::MonthlyLimit::Debit } + + # @!method initialize(credit:, debit:) + # Monthly limits with progress + # + # @param credit [Lithic::Models::TransferLimitsResponse::Data::MonthlyLimit::Credit] Credit limits + # + # @param debit [Lithic::Models::TransferLimitsResponse::Data::MonthlyLimit::Debit] Debit limits + + # @see Lithic::Models::TransferLimitsResponse::Data::MonthlyLimit#credit + class Credit < Lithic::Internal::Type::BaseModel + # @!attribute limit + # The limit amount + # + # @return [Integer] + required :limit, Integer + + # @!attribute amount_originated + # Amount originated towards limit + # + # @return [Integer, nil] + optional :amount_originated, Integer, nil?: true + + # @!method initialize(limit:, amount_originated: nil) + # Credit limits + # + # @param limit [Integer] The limit amount + # + # @param amount_originated [Integer, nil] Amount originated towards limit + end + + # @see Lithic::Models::TransferLimitsResponse::Data::MonthlyLimit#debit + class Debit < Lithic::Internal::Type::BaseModel + # @!attribute limit + # The limit amount + # + # @return [Integer] + required :limit, Integer + + # @!attribute amount_originated + # Amount originated towards limit + # + # @return [Integer, nil] + optional :amount_originated, Integer, nil?: true + + # @!method initialize(limit:, amount_originated: nil) + # Debit limits + # + # @param limit [Integer] The limit amount + # + # @param amount_originated [Integer, nil] Amount originated towards limit + end + end + + # @see Lithic::Models::TransferLimitsResponse::Data#program_limit_per_transaction + class ProgramLimitPerTransaction < Lithic::Internal::Type::BaseModel + # @!attribute credit + # Credit limits + # + # @return [Lithic::Models::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Credit] + required :credit, -> { Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Credit } + + # @!attribute debit + # Debit limits + # + # @return [Lithic::Models::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Debit] + required :debit, -> { Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Debit } + + # @!method initialize(credit:, debit:) + # Program transaction limits + # + # @param credit [Lithic::Models::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Credit] Credit limits + # + # @param debit [Lithic::Models::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Debit] Debit limits + + # @see Lithic::Models::TransferLimitsResponse::Data::ProgramLimitPerTransaction#credit + class Credit < Lithic::Internal::Type::BaseModel + # @!attribute limit + # The limit amount + # + # @return [Integer] + required :limit, Integer + + # @!attribute amount_originated + # Amount originated towards limit + # + # @return [Integer, nil] + optional :amount_originated, Integer, nil?: true + + # @!method initialize(limit:, amount_originated: nil) + # Credit limits + # + # @param limit [Integer] The limit amount + # + # @param amount_originated [Integer, nil] Amount originated towards limit + end + + # @see Lithic::Models::TransferLimitsResponse::Data::ProgramLimitPerTransaction#debit + class Debit < Lithic::Internal::Type::BaseModel + # @!attribute limit + # The limit amount + # + # @return [Integer] + required :limit, Integer + + # @!attribute amount_originated + # Amount originated towards limit + # + # @return [Integer, nil] + optional :amount_originated, Integer, nil?: true + + # @!method initialize(limit:, amount_originated: nil) + # Debit limits + # + # @param limit [Integer] The limit amount + # + # @param amount_originated [Integer, nil] Amount originated towards limit + end + end + end + end + end +end diff --git a/lib/lithic/models/verification_method.rb b/lib/lithic/models/verification_method.rb new file mode 100644 index 00000000..0aa321a0 --- /dev/null +++ b/lib/lithic/models/verification_method.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Models + module VerificationMethod + extend Lithic::Internal::Type::Enum + + MANUAL = :MANUAL + MICRO_DEPOSIT = :MICRO_DEPOSIT + PRENOTE = :PRENOTE + EXTERNALLY_VERIFIED = :EXTERNALLY_VERIFIED + UNVERIFIED = :UNVERIFIED + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/lithic/models/wallet_decisioning_info.rb b/lib/lithic/models/wallet_decisioning_info.rb new file mode 100644 index 00000000..30b81670 --- /dev/null +++ b/lib/lithic/models/wallet_decisioning_info.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +module Lithic + module Models + class WalletDecisioningInfo < Lithic::Internal::Type::BaseModel + # @!attribute account_score + # Score given to the account by the Wallet Provider + # + # @return [String, nil] + required :account_score, String, nil?: true + + # @!attribute device_score + # Score given to the device by the Wallet Provider + # + # @return [String, nil] + required :device_score, String, nil?: true + + # @!attribute recommended_decision + # The decision recommended by the Wallet Provider + # + # @return [String, nil] + required :recommended_decision, String, nil?: true + + # @!attribute recommendation_reasons + # Reasons provided to the Wallet Provider on how the recommended decision was + # reached + # + # @return [Array, nil] + optional :recommendation_reasons, Lithic::Internal::Type::ArrayOf[String], nil?: true + + # @!method initialize(account_score:, device_score:, recommended_decision:, recommendation_reasons: nil) + # Some parameter documentations has been truncated, see + # {Lithic::Models::WalletDecisioningInfo} for more details. + # + # @param account_score [String, nil] Score given to the account by the Wallet Provider + # + # @param device_score [String, nil] Score given to the device by the Wallet Provider + # + # @param recommended_decision [String, nil] The decision recommended by the Wallet Provider + # + # @param recommendation_reasons [Array, nil] Reasons provided to the Wallet Provider on how the recommended decision was reac + end + end +end diff --git a/lib/lithic/models/webhook_parsed_params.rb b/lib/lithic/models/webhook_parsed_params.rb new file mode 100644 index 00000000..5d943bb9 --- /dev/null +++ b/lib/lithic/models/webhook_parsed_params.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Lithic + module Models + # @see Lithic::Resources::Webhooks#parsed + class WebhookParsedParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/lithic/models/wire_party_details.rb b/lib/lithic/models/wire_party_details.rb new file mode 100644 index 00000000..06d5b0ec --- /dev/null +++ b/lib/lithic/models/wire_party_details.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module Lithic + module Models + class WirePartyDetails < Lithic::Internal::Type::BaseModel + # @!attribute account_number + # Account number + # + # @return [String, nil] + optional :account_number, String, nil?: true + + # @!attribute agent_id + # Routing number or BIC of the financial institution + # + # @return [String, nil] + optional :agent_id, String, nil?: true + + # @!attribute agent_name + # Name of the financial institution + # + # @return [String, nil] + optional :agent_name, String, nil?: true + + # @!attribute name + # Name of the person or company + # + # @return [String, nil] + optional :name, String, nil?: true + + # @!method initialize(account_number: nil, agent_id: nil, agent_name: nil, name: nil) + # @param account_number [String, nil] Account number + # + # @param agent_id [String, nil] Routing number or BIC of the financial institution + # + # @param agent_name [String, nil] Name of the financial institution + # + # @param name [String, nil] Name of the person or company + end + end +end diff --git a/lib/lithic/request_options.rb b/lib/lithic/request_options.rb new file mode 100644 index 00000000..5a4c4abb --- /dev/null +++ b/lib/lithic/request_options.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +module Lithic + # 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 < Lithic::Internal::Type::BaseModel + # @api private + # + # @param opts [Lithic::RequestOptions, Hash{Symbol=>Object}] + # + # @raise [ArgumentError] + def self.validate!(opts) + case opts + in Lithic::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, Lithic::Internal::Type::HashOf[Lithic::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, Lithic::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, Lithic::Internal::Type::HashOf[Lithic::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(Lithic::RequestOptions, Lithic::Internal::AnyHash) } + end + end +end diff --git a/lib/lithic/resources/account_activity.rb b/lib/lithic/resources/account_activity.rb new file mode 100644 index 00000000..c05686af --- /dev/null +++ b/lib/lithic/resources/account_activity.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class AccountActivity + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountActivityListParams} for more details. + # + # Retrieve a list of transactions across all public accounts. + # + # @overload list(account_token: nil, begin_: nil, business_account_token: nil, category: nil, end_: nil, ending_before: nil, financial_account_token: nil, page_size: nil, result: nil, starting_after: nil, status: nil, request_options: {}) + # + # @param account_token [String] Filter by account token + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param business_account_token [String] Filter by business account token + # + # @param category [Symbol, Lithic::Models::AccountActivityListParams::Category] Filter by transaction category + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param financial_account_token [String] Filter by financial account token + # + # @param page_size [Integer] Page size (for pagination). + # + # @param result [Symbol, Lithic::Models::AccountActivityListParams::Result] Filter by transaction result + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param status [Symbol, Lithic::Models::AccountActivityListParams::Status] Filter by transaction status + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::AccountActivityListParams + def list(params = {}) + parsed, options = Lithic::AccountActivityListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/account_activity", + query: query.transform_keys(begin_: "begin", end_: "end"), + page: Lithic::Internal::CursorPage, + model: Lithic::Models::AccountActivityListResponse, + options: options + ) + end + + # Retrieve a single transaction + # + # @overload retrieve_transaction(transaction_token, request_options: {}) + # + # @param transaction_token [String] The unique identifier for the transaction + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal, Lithic::Models::BookTransferResponse, Lithic::Models::AccountActivityRetrieveTransactionResponse::Card, Lithic::Models::Payment, Lithic::Models::ExternalPayment, Lithic::Models::ManagementOperationTransaction, Lithic::Models::Hold] + # + # @see Lithic::Models::AccountActivityRetrieveTransactionParams + def retrieve_transaction(transaction_token, params = {}) + @client.request( + method: :get, + path: ["v1/account_activity/%1$s", transaction_token], + model: Lithic::Models::AccountActivityRetrieveTransactionResponse, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/account_holders.rb b/lib/lithic/resources/account_holders.rb new file mode 100644 index 00000000..3cab29b1 --- /dev/null +++ b/lib/lithic/resources/account_holders.rb @@ -0,0 +1,327 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class AccountHolders + # @return [Lithic::Resources::AccountHolders::Entities] + attr_reader :entities + + # Create an account holder and initiate the appropriate onboarding workflow. + # Account holders and accounts have a 1:1 relationship. When an account holder is + # successfully created an associated account is also created. All calls to this + # endpoint will return a synchronous response. The response time will depend on + # the workflow. In some cases, the response may indicate the workflow is under + # review or further action will be needed to complete the account creation + # process. This endpoint can only be used on accounts that are part of the program + # that the calling API key manages. + # + # @overload create(body:, request_options: {}) + # + # @param body [Lithic::Models::KYB, Lithic::Models::AccountHolderCreateParams::Body::KYBDelegated, Lithic::Models::KYC, Lithic::Models::KYCExempt] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::AccountHolderCreateResponse] + # + # @see Lithic::Models::AccountHolderCreateParams + def create(params) + parsed, options = Lithic::AccountHolderCreateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/account_holders", + body: parsed[:body], + model: Lithic::Models::AccountHolderCreateResponse, + options: {timeout: 300, **options} + ) + end + + # Get an Individual or Business Account Holder and/or their KYC or KYB evaluation + # status. + # + # @overload retrieve(account_holder_token, request_options: {}) + # + # @param account_holder_token [String] Globally unique identifier for the account holder. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::AccountHolder] + # + # @see Lithic::Models::AccountHolderRetrieveParams + def retrieve(account_holder_token, params = {}) + @client.request( + method: :get, + path: ["v1/account_holders/%1$s", account_holder_token], + model: Lithic::AccountHolder, + options: params[:request_options] + ) + end + + # Update the information associated with a particular account holder (including + # business owners and control persons associated to a business account). If Lithic + # is performing KYB or KYC and additional verification is required we will run the + # individual's or business's updated information again and return whether the + # status is accepted or pending (i.e., further action required). All calls to this + # endpoint will return a synchronous response. The response time will depend on + # the workflow. In some cases, the response may indicate the workflow is under + # review or further action will be needed to complete the account creation + # process. This endpoint can only be used on existing accounts that are part of + # the program that the calling API key manages. + # + # @overload update(account_holder_token, body:, request_options: {}) + # + # @param account_holder_token [String] Globally unique identifier for the account holder. + # + # @param body [Lithic::Models::AccountHolderUpdateParams::Body::KYBPatchRequest, Lithic::Models::AccountHolderUpdateParams::Body::KYCPatchRequest, Lithic::Models::AccountHolderUpdateParams::Body::PatchRequest] The KYB request payload for updating a business. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse, Lithic::Models::AccountHolderUpdateResponse::PatchResponse] + # + # @see Lithic::Models::AccountHolderUpdateParams + def update(account_holder_token, params) + parsed, options = Lithic::AccountHolderUpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["v1/account_holders/%1$s", account_holder_token], + body: parsed[:body], + model: Lithic::Models::AccountHolderUpdateResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderListParams} for more details. + # + # Get a list of individual or business account holders and their KYC or KYB + # evaluation status. + # + # @overload list(begin_: nil, email: nil, end_: nil, ending_before: nil, external_id: nil, first_name: nil, last_name: nil, legal_business_name: nil, limit: nil, phone_number: nil, starting_after: nil, request_options: {}) + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param email [String] Email address of the account holder. The query must be an exact match, case inse + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param external_id [String] If applicable, represents the external_id associated with the account_holder. + # + # @param first_name [String] (Individual Account Holders only) The first name of the account holder. The quer + # + # @param last_name [String] (Individual Account Holders only) The last name of the account holder. The query + # + # @param legal_business_name [String] (Business Account Holders only) The legal business name of the account holder. T + # + # @param limit [Integer] The number of account_holders to limit the response to. + # + # @param phone_number [String] Phone number of the account holder. The query must be an exact match. + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::SinglePage] + # + # @see Lithic::Models::AccountHolderListParams + def list(params = {}) + parsed, options = Lithic::AccountHolderListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/account_holders", + query: query.transform_keys(begin_: "begin", end_: "end"), + page: Lithic::Internal::SinglePage, + model: Lithic::AccountHolder, + options: options + ) + end + + # Retrieve the status of account holder document uploads, or retrieve the upload + # URLs to process your image uploads. + # + # Note that this is not equivalent to checking the status of the KYC evaluation + # overall (a document may be successfully uploaded but not be sufficient for KYC + # to pass). + # + # In the event your upload URLs have expired, calling this endpoint will refresh + # them. Similarly, in the event a previous account holder document upload has + # failed, you can use this endpoint to get a new upload URL for the failed image + # upload. + # + # When a new document upload is generated for a failed attempt, the response will + # show an additional entry in the `required_document_uploads` list in a `PENDING` + # state for the corresponding `image_type`. + # + # @overload list_documents(account_holder_token, request_options: {}) + # + # @param account_holder_token [String] Globally unique identifier for the account holder. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::AccountHolderListDocumentsResponse] + # + # @see Lithic::Models::AccountHolderListDocumentsParams + def list_documents(account_holder_token, params = {}) + @client.request( + method: :get, + path: ["v1/account_holders/%1$s/documents", account_holder_token], + model: Lithic::Models::AccountHolderListDocumentsResponse, + options: params[:request_options] + ) + end + + # Check the status of an account holder document upload, or retrieve the upload + # URLs to process your image uploads. + # + # Note that this is not equivalent to checking the status of the KYC evaluation + # overall (a document may be successfully uploaded but not be sufficient for KYC + # to pass). + # + # In the event your upload URLs have expired, calling this endpoint will refresh + # them. Similarly, in the event a document upload has failed, you can use this + # endpoint to get a new upload URL for the failed image upload. + # + # When a new account holder document upload is generated for a failed attempt, the + # response will show an additional entry in the `required_document_uploads` array + # in a `PENDING` state for the corresponding `image_type`. + # + # @overload retrieve_document(document_token, account_holder_token:, request_options: {}) + # + # @param document_token [String] Globally unique identifier for the document. + # + # @param account_holder_token [String] Globally unique identifier for the account holder. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Document] + # + # @see Lithic::Models::AccountHolderRetrieveDocumentParams + def retrieve_document(document_token, params) + parsed, options = Lithic::AccountHolderRetrieveDocumentParams.dump_request(params) + account_holder_token = + parsed.delete(:account_holder_token) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :get, + path: ["v1/account_holders/%1$s/documents/%2$s", account_holder_token, document_token], + model: Lithic::Document, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams} for more + # details. + # + # Simulates a review for an account holder document upload. + # + # @overload simulate_enrollment_document_review(document_upload_token:, status:, accepted_entity_status_reasons: nil, status_reason: nil, request_options: {}) + # + # @param document_upload_token [String] The account holder document upload which to perform the simulation upon. + # + # @param status [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::Status] An account holder document's upload status for use within the simulation. + # + # @param accepted_entity_status_reasons [Array] A list of status reasons associated with a KYB account holder in PENDING_REVIEW + # + # @param status_reason [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason] Status reason that will be associated with the simulated account holder status. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Document] + # + # @see Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams + def simulate_enrollment_document_review(params) + parsed, options = Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams.dump_request(params) + @client.request( + method: :post, + path: "v1/simulate/account_holders/enrollment_document_review", + body: parsed, + model: Lithic::Document, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolderSimulateEnrollmentReviewParams} for more details. + # + # Simulates an enrollment review for an account holder. This endpoint is only + # applicable for workflows that may required intervention such as `KYB_BASIC`. + # + # @overload simulate_enrollment_review(account_holder_token: nil, status: nil, status_reasons: nil, request_options: {}) + # + # @param account_holder_token [String] The account holder which to perform the simulation upon. + # + # @param status [Symbol, Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::Status] An account holder's status for use within the simulation. + # + # @param status_reasons [Array] Status reason that will be associated with the simulated account holder status. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse] + # + # @see Lithic::Models::AccountHolderSimulateEnrollmentReviewParams + def simulate_enrollment_review(params = {}) + parsed, options = Lithic::AccountHolderSimulateEnrollmentReviewParams.dump_request(params) + @client.request( + method: :post, + path: "v1/simulate/account_holders/enrollment_review", + body: parsed, + model: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse, + options: options + ) + end + + # Use this endpoint to identify which type of supported government-issued + # documentation you will upload for further verification. It will return two URLs + # to upload your document images to - one for the front image and one for the back + # image. + # + # This endpoint is only valid for evaluations in a `PENDING_DOCUMENT` state. + # + # Supported file types include `jpg`, `png`, and `pdf`. Each file must be less + # than 15 MiB. Once both required uploads have been successfully completed, your + # document will be run through KYC verification. + # + # If you have registered a webhook, you will receive evaluation updates for any + # document submission evaluations, as well as for any failed document uploads. + # + # Two document submission attempts are permitted via this endpoint before a + # `REJECTED` status is returned and the account creation process is ended. + # Currently only one type of account holder document is supported per KYC + # verification. + # + # @overload upload_document(account_holder_token, document_type:, entity_token:, request_options: {}) + # + # @param account_holder_token [String] Globally unique identifier for the account holder. + # + # @param document_type [Symbol, Lithic::Models::AccountHolderUploadDocumentParams::DocumentType] The type of document to upload + # + # @param entity_token [String] Globally unique identifier for the entity. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Document] + # + # @see Lithic::Models::AccountHolderUploadDocumentParams + def upload_document(account_holder_token, params) + parsed, options = Lithic::AccountHolderUploadDocumentParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/account_holders/%1$s/documents", account_holder_token], + body: parsed, + model: Lithic::Document, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @entities = Lithic::Resources::AccountHolders::Entities.new(client: client) + end + end + end +end diff --git a/lib/lithic/resources/account_holders/entities.rb b/lib/lithic/resources/account_holders/entities.rb new file mode 100644 index 00000000..f127ffec --- /dev/null +++ b/lib/lithic/resources/account_holders/entities.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class AccountHolders + class Entities + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountHolders::EntityCreateParams} for more details. + # + # Create a new beneficial owner individual or replace the control person entity on + # an existing KYB account holder. This endpoint is only applicable for account + # holders enrolled through a KYB workflow with the Persona KYB provider. A new + # control person can only replace the existing one. A maximum of 4 beneficial + # owners can be associated with an account holder. + # + # @overload create(account_holder_token, address:, dob:, email:, first_name:, government_id:, last_name:, phone_number:, type:, request_options: {}) + # + # @param account_holder_token [String] Globally unique identifier for the account holder. + # + # @param address [Lithic::Models::AccountHolders::EntityCreateParams::Address] Individual's current address - PO boxes, UPS drops, and FedEx drops are not acce + # + # @param dob [String] Individual's date of birth, as an RFC 3339 date. + # + # @param email [String] Individual's email address. If utilizing Lithic for chargeback processing, this + # + # @param first_name [String] Individual's first name, as it appears on government-issued identity documents. + # + # @param government_id [String] Government-issued identification number (required for identity verification and + # + # @param last_name [String] Individual's last name, as it appears on government-issued identity documents. + # + # @param phone_number [String] Individual's phone number, entered in E.164 format. + # + # @param type [Symbol, Lithic::Models::TransactionMonitoring::EntityType] The type of entity to create on the account holder + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::AccountHolders::EntityCreateResponse] + # + # @see Lithic::Models::AccountHolders::EntityCreateParams + def create(account_holder_token, params) + parsed, options = Lithic::AccountHolders::EntityCreateParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/account_holders/%1$s/entities", account_holder_token], + body: parsed, + model: Lithic::Models::AccountHolders::EntityCreateResponse, + options: options + ) + end + + # Deactivate a beneficial owner individual on an existing KYB account holder. Only + # beneficial owner individuals can be deactivated. + # + # @overload delete(entity_token, account_holder_token:, request_options: {}) + # + # @param entity_token [String] Globally unique identifier for the entity. + # + # @param account_holder_token [String] Globally unique identifier for the account holder. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::AccountHolders::AccountHolderEntity] + # + # @see Lithic::Models::AccountHolders::EntityDeleteParams + def delete(entity_token, params) + parsed, options = Lithic::AccountHolders::EntityDeleteParams.dump_request(params) + account_holder_token = + parsed.delete(:account_holder_token) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :delete, + path: ["v1/account_holders/%1$s/entities/%2$s", account_holder_token, entity_token], + model: Lithic::AccountHolders::AccountHolderEntity, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/accounts.rb b/lib/lithic/resources/accounts.rb new file mode 100644 index 00000000..018a3f11 --- /dev/null +++ b/lib/lithic/resources/accounts.rb @@ -0,0 +1,161 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Accounts + # Get account configuration such as spend limits. + # + # @overload retrieve(account_token, request_options: {}) + # + # @param account_token [String] Globally unique identifier for account. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Account] + # + # @see Lithic::Models::AccountRetrieveParams + def retrieve(account_token, params = {}) + @client.request( + method: :get, + path: ["v1/accounts/%1$s", account_token], + model: Lithic::Account, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountUpdateParams} for more details. + # + # Update account configuration such as state or spend limits. Can only be run on + # accounts that are part of the program managed by this API key. Accounts that are + # in the `PAUSED` state will not be able to transact or create new cards. + # + # @overload update(account_token, comment: nil, daily_spend_limit: nil, lifetime_spend_limit: nil, monthly_spend_limit: nil, state: nil, substatus: nil, verification_address: nil, request_options: {}) + # + # @param account_token [String] Globally unique identifier for account. + # + # @param comment [String] Additional context or information related to the account. + # + # @param daily_spend_limit [Integer] Amount (in cents) for the account's daily spend limit (e.g. 100000 would be a $1 + # + # @param lifetime_spend_limit [Integer] Amount (in cents) for the account's lifetime spend limit (e.g. 100000 would be a + # + # @param monthly_spend_limit [Integer] Amount (in cents) for the account's monthly spend limit (e.g. 100000 would be a + # + # @param state [Symbol, Lithic::Models::AccountUpdateParams::State] Account states. + # + # @param substatus [Symbol, Lithic::Models::AccountUpdateParams::Substatus, nil] Account state substatus values: + # + # @param verification_address [Lithic::Models::AccountUpdateParams::VerificationAddress] Address used during Address Verification Service (AVS) checks during transaction + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Account] + # + # @see Lithic::Models::AccountUpdateParams + def update(account_token, params = {}) + parsed, options = Lithic::AccountUpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["v1/accounts/%1$s", account_token], + body: parsed, + model: Lithic::Account, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::AccountListParams} for more details. + # + # List account configurations. + # + # @overload list(begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::AccountListParams + def list(params = {}) + parsed, options = Lithic::AccountListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/accounts", + query: query.transform_keys(begin_: "begin", end_: "end"), + page: Lithic::Internal::CursorPage, + model: Lithic::Account, + options: options + ) + end + + # Returns behavioral feature state derived from an account's transaction history. + # + # These signals expose the same data used by behavioral rule attributes (e.g. + # `AMOUNT_Z_SCORE` with `scope: ACCOUNT`, `IS_NEW_COUNTRY` with `scope: ACCOUNT`) + # and custom code `TRANSACTION_HISTORY_SIGNALS` features, allowing clients to + # inspect feature values before writing rules and debug rule behavior. + # + # Note: 3DS fields are not available at the account scope and will be null. + # + # @overload retrieve_signals(account_token, request_options: {}) + # + # @param account_token [String] The token of the account to fetch signals for. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::SignalsResponse] + # + # @see Lithic::Models::AccountRetrieveSignalsParams + def retrieve_signals(account_token, params = {}) + @client.request( + method: :get, + path: ["v1/accounts/%1$s/signals", account_token], + model: Lithic::SignalsResponse, + options: params[:request_options] + ) + end + + # Get an Account's available spend limits, which is based on the spend limit + # configured on the Account and the amount already spent over the spend limit's + # duration. For example, if the Account has a daily spend limit of $1000 + # configured, and has spent $600 in the last 24 hours, the available spend limit + # returned would be $400. + # + # @overload retrieve_spend_limits(account_token, request_options: {}) + # + # @param account_token [String] Globally unique identifier for account. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::AccountSpendLimits] + # + # @see Lithic::Models::AccountRetrieveSpendLimitsParams + def retrieve_spend_limits(account_token, params = {}) + @client.request( + method: :get, + path: ["v1/accounts/%1$s/spend_limits", account_token], + model: Lithic::AccountSpendLimits, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/auth_rules.rb b/lib/lithic/resources/auth_rules.rb new file mode 100644 index 00000000..c85b601c --- /dev/null +++ b/lib/lithic/resources/auth_rules.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class AuthRules + # @return [Lithic::Resources::AuthRules::V2] + attr_reader :v2 + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @v2 = Lithic::Resources::AuthRules::V2.new(client: client) + end + end + end +end diff --git a/lib/lithic/resources/auth_rules/v2.rb b/lib/lithic/resources/auth_rules/v2.rb new file mode 100644 index 00000000..c397a1d3 --- /dev/null +++ b/lib/lithic/resources/auth_rules/v2.rb @@ -0,0 +1,333 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class AuthRules + class V2 + # @return [Lithic::Resources::AuthRules::V2::Backtests] + attr_reader :backtests + + # Creates a new V2 Auth rule in draft mode + # + # @overload create(body:, request_options: {}) + # + # @param body [Lithic::Models::AuthRules::V2CreateParams::Body::AccountLevelRule, Lithic::Models::AuthRules::V2CreateParams::Body::CardLevelRule, Lithic::Models::AuthRules::V2CreateParams::Body::ProgramLevelRule] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::AuthRules::AuthRule] + # + # @see Lithic::Models::AuthRules::V2CreateParams + def create(params) + parsed, options = Lithic::AuthRules::V2CreateParams.dump_request(params) + @client.request( + method: :post, + path: "v2/auth_rules", + body: parsed[:body], + model: Lithic::AuthRules::AuthRule, + options: options + ) + end + + # Fetches a V2 Auth rule by its token + # + # @overload retrieve(auth_rule_token, request_options: {}) + # + # @param auth_rule_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::AuthRules::AuthRule] + # + # @see Lithic::Models::AuthRules::V2RetrieveParams + def retrieve(auth_rule_token, params = {}) + @client.request( + method: :get, + path: ["v2/auth_rules/%1$s", auth_rule_token], + model: Lithic::AuthRules::AuthRule, + options: params[:request_options] + ) + end + + # Updates a V2 Auth rule's properties + # + # If `account_tokens`, `card_tokens`, `program_level`, `excluded_card_tokens`, + # `excluded_account_tokens`, or `excluded_business_account_tokens` is provided, + # this will replace existing associations with the provided list of entities. + # + # @overload update(auth_rule_token, body:, request_options: {}) + # + # @param auth_rule_token [String] + # @param body [Lithic::Models::AuthRules::V2UpdateParams::Body::AccountLevelRule, Lithic::Models::AuthRules::V2UpdateParams::Body::CardLevelRule, Lithic::Models::AuthRules::V2UpdateParams::Body::ProgramLevelRule] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::AuthRules::AuthRule] + # + # @see Lithic::Models::AuthRules::V2UpdateParams + def update(auth_rule_token, params) + parsed, options = Lithic::AuthRules::V2UpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["v2/auth_rules/%1$s", auth_rule_token], + body: parsed[:body], + model: Lithic::AuthRules::AuthRule, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::V2ListParams} for more details. + # + # Lists V2 Auth rules + # + # @overload list(account_token: nil, business_account_token: nil, card_token: nil, ending_before: nil, event_stream: nil, event_streams: nil, page_size: nil, scope: nil, starting_after: nil, request_options: {}) + # + # @param account_token [String] Only return Auth Rules that are bound to the provided account token. + # + # @param business_account_token [String] Only return Auth Rules that are bound to the provided business account token. + # + # @param card_token [String] Only return Auth Rules that are bound to the provided card token. + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param event_stream [Symbol, Lithic::Models::AuthRules::EventStream] Deprecated: Use event_streams instead. Only return Auth rules that are executed + # + # @param event_streams [Array] Only return Auth rules that are executed during any of the provided event stream + # + # @param page_size [Integer] Page size (for pagination). + # + # @param scope [Symbol, Lithic::Models::AuthRules::V2ListParams::Scope] Only return Auth Rules that are bound to the provided scope. + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::AuthRules::V2ListParams + def list(params = {}) + parsed, options = Lithic::AuthRules::V2ListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v2/auth_rules", + query: query, + page: Lithic::Internal::CursorPage, + model: Lithic::AuthRules::AuthRule, + options: options + ) + end + + # Deletes a V2 Auth rule + # + # @overload delete(auth_rule_token, request_options: {}) + # + # @param auth_rule_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Lithic::Models::AuthRules::V2DeleteParams + def delete(auth_rule_token, params = {}) + @client.request( + method: :delete, + path: ["v2/auth_rules/%1$s", auth_rule_token], + model: NilClass, + options: params[:request_options] + ) + end + + # Creates a new draft version of a rule that will be ran in shadow mode. + # + # This can also be utilized to reset the draft parameters, causing a draft version + # to no longer be ran in shadow mode. + # + # @overload draft(auth_rule_token, parameters: nil, request_options: {}) + # + # @param auth_rule_token [String] + # + # @param parameters [Lithic::Models::AuthRules::ConditionalBlockParameters, Lithic::Models::AuthRules::VelocityLimitParams, Lithic::Models::AuthRules::MerchantLockParameters, Lithic::Models::AuthRules::Conditional3DSActionParameters, Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters, Lithic::Models::AuthRules::ConditionalACHActionParameters, Lithic::Models::AuthRules::ConditionalTokenizationActionParameters, Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters, Lithic::Models::AuthRules::TypescriptCodeParameters, Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters, nil] Parameters for the Auth Rule + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::AuthRules::AuthRule] + # + # @see Lithic::Models::AuthRules::V2DraftParams + def draft(auth_rule_token, params = {}) + parsed, options = Lithic::AuthRules::V2DraftParams.dump_request(params) + @client.request( + method: :post, + path: ["v2/auth_rules/%1$s/draft", auth_rule_token], + body: parsed, + model: Lithic::AuthRules::AuthRule, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::AuthRules::V2ListResultsParams} for more details. + # + # Lists Auth Rule evaluation results. + # + # **Limitations:** + # + # - Results are available for the past 3 months only + # - At least one filter (`event_token` or `auth_rule_token`) must be provided + # - When filtering by `event_token`, pagination is not supported + # + # @overload list_results(auth_rule_token: nil, begin_: nil, end_: nil, ending_before: nil, event_token: nil, has_actions: nil, page_size: nil, starting_after: nil, request_options: {}) + # + # @param auth_rule_token [String] Filter by Auth Rule token + # + # @param begin_ [Time] Date string in RFC 3339 format. Only events evaluated after the specified time w + # + # @param end_ [Time] Date string in RFC 3339 format. Only events evaluated before the specified time + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param event_token [String] Filter by event token + # + # @param has_actions [Boolean] Filter by whether the rule evaluation produced any actions. When not provided, a + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::AuthRules::V2ListResultsParams + def list_results(params = {}) + parsed, options = Lithic::AuthRules::V2ListResultsParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v2/auth_rules/results", + query: query.transform_keys(begin_: "begin", end_: "end"), + page: Lithic::Internal::CursorPage, + model: Lithic::Models::AuthRules::V2ListResultsResponse, + options: options + ) + end + + # Returns all versions of an auth rule, sorted by version number descending + # (newest first). + # + # @overload list_versions(auth_rule_token, request_options: {}) + # + # @param auth_rule_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::AuthRules::V2ListVersionsResponse] + # + # @see Lithic::Models::AuthRules::V2ListVersionsParams + def list_versions(auth_rule_token, params = {}) + @client.request( + method: :get, + path: ["v2/auth_rules/%1$s/versions", auth_rule_token], + model: Lithic::Models::AuthRules::V2ListVersionsResponse, + options: params[:request_options] + ) + end + + # Promotes the draft version of an Auth rule to the currently active version such + # that it is enforced in the respective stream. + # + # @overload promote(auth_rule_token, request_options: {}) + # + # @param auth_rule_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::AuthRules::AuthRule] + # + # @see Lithic::Models::AuthRules::V2PromoteParams + def promote(auth_rule_token, params = {}) + @client.request( + method: :post, + path: ["v2/auth_rules/%1$s/promote", auth_rule_token], + model: Lithic::AuthRules::AuthRule, + options: params[:request_options] + ) + end + + # Fetches the current calculated Feature values for the given Auth Rule + # + # This only calculates the features for the active version. + # + # - VelocityLimit Rules calculates the current Velocity Feature data. This + # requires a `card_token` or `account_token` matching what the rule is Scoped + # to. + # - ConditionalBlock Rules calculates the CARD*TRANSACTION_COUNT*\* attributes on + # the rule. This requires a `card_token` + # + # @overload retrieve_features(auth_rule_token, account_token: nil, card_token: nil, request_options: {}) + # + # @param auth_rule_token [String] + # @param account_token [String] + # @param card_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::AuthRules::V2RetrieveFeaturesResponse] + # + # @see Lithic::Models::AuthRules::V2RetrieveFeaturesParams + def retrieve_features(auth_rule_token, params = {}) + parsed, options = Lithic::AuthRules::V2RetrieveFeaturesParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["v2/auth_rules/%1$s/features", auth_rule_token], + query: query, + model: Lithic::Models::AuthRules::V2RetrieveFeaturesResponse, + options: options + ) + end + + # Retrieves a performance report for an Auth rule containing daily statistics and + # evaluation outcomes. + # + # **Time Range Limitations:** + # + # - Reports are supported for the past 3 months only + # - Maximum interval length is 1 month + # - Report data is available only through the previous day in UTC (current day + # data is not available) + # + # The report provides daily statistics for both current and draft versions of the + # Auth rule, including approval, decline, and challenge counts along with sample + # events. + # + # @overload retrieve_report(auth_rule_token, begin_:, end_:, request_options: {}) + # + # @param auth_rule_token [String] + # + # @param begin_ [Date] Start date for the report + # + # @param end_ [Date] End date for the report + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::AuthRules::V2RetrieveReportResponse] + # + # @see Lithic::Models::AuthRules::V2RetrieveReportParams + def retrieve_report(auth_rule_token, params) + parsed, options = Lithic::AuthRules::V2RetrieveReportParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["v2/auth_rules/%1$s/report", auth_rule_token], + query: query.transform_keys(begin_: "begin", end_: "end"), + model: Lithic::Models::AuthRules::V2RetrieveReportResponse, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @backtests = Lithic::Resources::AuthRules::V2::Backtests.new(client: client) + end + end + end + end +end diff --git a/lib/lithic/resources/auth_rules/v2/backtests.rb b/lib/lithic/resources/auth_rules/v2/backtests.rb new file mode 100644 index 00000000..644efe67 --- /dev/null +++ b/lib/lithic/resources/auth_rules/v2/backtests.rb @@ -0,0 +1,110 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class AuthRules + class V2 + class Backtests + # Initiates a request to asynchronously generate a backtest for an Auth rule. + # During backtesting, both the active version (if one exists) and the draft + # version of the Auth Rule are evaluated by replaying historical transaction data + # against the rule's conditions. This process allows customers to simulate and + # understand the effects of proposed rule changes before deployment. The generated + # backtest report provides detailed results showing whether the draft version of + # the Auth Rule would have approved or declined historical transactions which were + # processed during the backtest period. These reports help evaluate how changes to + # rule configurations might affect overall transaction approval rates. + # + # The generated backtest report will be delivered asynchronously through a webhook + # with `event_type` = `auth_rules.backtest_report.created`. See the docs on + # setting up [webhook subscriptions](https://docs.lithic.com/docs/events-api). It + # is also possible to request backtest reports on-demand through the + # `/v2/auth_rules/{auth_rule_token}/backtests/{auth_rule_backtest_token}` + # endpoint. + # + # Lithic currently supports backtesting for `CONDITIONAL_BLOCK` / + # `CONDITIONAL_ACTION` rules. Backtesting for `VELOCITY_LIMIT` rules is generally + # not supported. In specific cases (i.e. where Lithic has pre-calculated the + # requested velocity metrics for historical transactions), a backtest may be + # feasible. However, such cases are uncommon and customers should not anticipate + # support for velocity backtests under most configurations. If a historical + # transaction does not feature the required inputs to evaluate the rule, then it + # will not be included in the final backtest report. + # + # @overload create(auth_rule_token, end_: nil, start: nil, request_options: {}) + # + # @param auth_rule_token [String] + # + # @param end_ [Time] The end time of the backtest. + # + # @param start [Time] The start time of the backtest. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::AuthRules::V2::BacktestCreateResponse] + # + # @see Lithic::Models::AuthRules::V2::BacktestCreateParams + def create(auth_rule_token, params = {}) + parsed, options = Lithic::AuthRules::V2::BacktestCreateParams.dump_request(params) + @client.request( + method: :post, + path: ["v2/auth_rules/%1$s/backtests", auth_rule_token], + body: parsed, + model: Lithic::Models::AuthRules::V2::BacktestCreateResponse, + options: options + ) + end + + # Returns the backtest results of an Auth rule (if available). + # + # Backtesting is an asynchronous process that requires time to complete. If a + # customer retrieves the backtest results using this endpoint before the report is + # fully generated, the response will return null for `results.current_version` and + # `results.draft_version`. Customers are advised to wait for the backtest creation + # process to complete (as indicated by the webhook event + # auth_rules.backtest_report.created) before retrieving results from this + # endpoint. + # + # Backtesting is an asynchronous process, while the backtest is being processed, + # results will not be available which will cause `results.current_version` and + # `results.draft_version` objects to contain `null`. The entries in `results` will + # also always represent the configuration of the rule at the time requests are + # made to this endpoint. For example, the results for `current_version` in the + # served backtest report will be consistent with which version of the rule is + # currently activated in the respective event stream, regardless of which version + # of the rule was active in the event stream at the time a backtest is requested. + # + # @overload retrieve(auth_rule_backtest_token, auth_rule_token:, request_options: {}) + # + # @param auth_rule_backtest_token [String] + # @param auth_rule_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::AuthRules::V2::BacktestResults] + # + # @see Lithic::Models::AuthRules::V2::BacktestRetrieveParams + def retrieve(auth_rule_backtest_token, params) + parsed, options = Lithic::AuthRules::V2::BacktestRetrieveParams.dump_request(params) + auth_rule_token = + parsed.delete(:auth_rule_token) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :get, + path: ["v2/auth_rules/%1$s/backtests/%2$s", auth_rule_token, auth_rule_backtest_token], + model: Lithic::AuthRules::V2::BacktestResults, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end + end +end diff --git a/lib/lithic/resources/auth_stream_enrollment.rb b/lib/lithic/resources/auth_stream_enrollment.rb new file mode 100644 index 00000000..b21cf1f5 --- /dev/null +++ b/lib/lithic/resources/auth_stream_enrollment.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class AuthStreamEnrollment + # Retrieve the ASA HMAC secret key. If one does not exist for your program yet, + # calling this endpoint will create one for you. The headers (which you can use to + # verify webhooks) will begin appearing shortly after calling this endpoint for + # the first time. See + # [this page](https://docs.lithic.com/docs/auth-stream-access-asa#asa-webhook-verification) + # for more detail about verifying ASA webhooks. + # + # @overload retrieve_secret(request_options: {}) + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::AuthStreamSecret] + # + # @see Lithic::Models::AuthStreamEnrollmentRetrieveSecretParams + def retrieve_secret(params = {}) + @client.request( + method: :get, + path: "v1/auth_stream/secret", + model: Lithic::AuthStreamSecret, + options: params[:request_options] + ) + end + + # Generate a new ASA HMAC secret key. The old ASA HMAC secret key will be + # deactivated 24 hours after a successful request to this endpoint. Make a + # [`GET /auth_stream/secret`](https://docs.lithic.com/reference/getauthstreamsecret) + # request to retrieve the new secret key. + # + # @overload rotate_secret(request_options: {}) + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Lithic::Models::AuthStreamEnrollmentRotateSecretParams + def rotate_secret(params = {}) + @client.request( + method: :post, + path: "v1/auth_stream/secret/rotate", + model: NilClass, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/balances.rb b/lib/lithic/resources/balances.rb new file mode 100644 index 00000000..cbe2fe78 --- /dev/null +++ b/lib/lithic/resources/balances.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Balances + # Some parameter documentations has been truncated, see + # {Lithic::Models::BalanceListParams} for more details. + # + # Get the balances for a program, business, or a given end-user account + # + # @overload list(account_token: nil, balance_date: nil, business_account_token: nil, financial_account_type: nil, request_options: {}) + # + # @param account_token [String] List balances for all financial accounts of a given account_token. + # + # @param balance_date [Time] UTC date and time of the balances to retrieve. Defaults to latest available bala + # + # @param business_account_token [String] List balances for all financial accounts of a given business_account_token. + # + # @param financial_account_type [Symbol, Lithic::Models::BalanceListParams::FinancialAccountType] List balances for a given Financial Account type. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::SinglePage] + # + # @see Lithic::Models::BalanceListParams + def list(params = {}) + parsed, options = Lithic::BalanceListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/balances", + query: query, + page: Lithic::Internal::SinglePage, + model: Lithic::Balance, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/book_transfers.rb b/lib/lithic/resources/book_transfers.rb new file mode 100644 index 00000000..722dbb4f --- /dev/null +++ b/lib/lithic/resources/book_transfers.rb @@ -0,0 +1,178 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class BookTransfers + # Some parameter documentations has been truncated, see + # {Lithic::Models::BookTransferCreateParams} for more details. + # + # Book transfer funds between two financial accounts or between a financial + # account and card + # + # @overload create(amount:, category:, from_financial_account_token:, subtype:, to_financial_account_token:, type:, token: nil, external_id: nil, hold_token: nil, memo: nil, on_closed_account: nil, request_options: {}) + # + # @param amount [Integer] Amount to be transferred in the currency's smallest unit (e.g., cents for USD). + # + # @param category [Symbol, Lithic::Models::BookTransferCreateParams::Category] + # + # @param from_financial_account_token [String] Globally unique identifier for the financial account or card that will send the + # + # @param subtype [String] The program specific subtype code for the specified category/type. + # + # @param to_financial_account_token [String] Globally unique identifier for the financial account or card that will receive t + # + # @param type [Symbol, Lithic::Models::BookTransferCreateParams::Type] Type of the book transfer + # + # @param token [String] Customer-provided token that will serve as an idempotency token. This token will + # + # @param external_id [String] External ID defined by the customer + # + # @param hold_token [String] Token of an existing hold to settle when this transfer is initiated + # + # @param memo [String] Optional descriptor for the transfer. + # + # @param on_closed_account [Symbol, Lithic::Models::BookTransferCreateParams::OnClosedAccount] What to do if the financial account is closed when posting an operation + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::BookTransferResponse] + # + # @see Lithic::Models::BookTransferCreateParams + def create(params) + parsed, options = Lithic::BookTransferCreateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/book_transfers", + body: parsed, + model: Lithic::BookTransferResponse, + options: options + ) + end + + # Get book transfer by token + # + # @overload retrieve(book_transfer_token, request_options: {}) + # + # @param book_transfer_token [String] Id of the book transfer to retrieve + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::BookTransferResponse] + # + # @see Lithic::Models::BookTransferRetrieveParams + def retrieve(book_transfer_token, params = {}) + @client.request( + method: :get, + path: ["v1/book_transfers/%1$s", book_transfer_token], + model: Lithic::BookTransferResponse, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::BookTransferListParams} for more details. + # + # List book transfers + # + # @overload list(account_token: nil, begin_: nil, business_account_token: nil, category: nil, end_: nil, ending_before: nil, financial_account_token: nil, page_size: nil, result: nil, starting_after: nil, status: nil, request_options: {}) + # + # @param account_token [String] + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param business_account_token [String] + # + # @param category [Symbol, Lithic::Models::BookTransferListParams::Category] Book Transfer category to be returned. + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param financial_account_token [String] Globally unique identifier for the financial account or card that will send the + # + # @param page_size [Integer] Page size (for pagination). + # + # @param result [Symbol, Lithic::Models::BookTransferListParams::Result] Book transfer result to be returned. + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param status [Symbol, Lithic::Models::BookTransferListParams::Status] Book transfer status to be returned. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::BookTransferListParams + def list(params = {}) + parsed, options = Lithic::BookTransferListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/book_transfers", + query: query.transform_keys(begin_: "begin", end_: "end"), + page: Lithic::Internal::CursorPage, + model: Lithic::BookTransferResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::BookTransferRetryParams} for more details. + # + # Retry a book transfer that has been declined + # + # @overload retry_(book_transfer_token, retry_token:, request_options: {}) + # + # @param book_transfer_token [String] Token of the book transfer to retry + # + # @param retry_token [String] Customer-provided token that will serve as an idempotency token. This token will + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::BookTransferResponse] + # + # @see Lithic::Models::BookTransferRetryParams + def retry_(book_transfer_token, params) + parsed, options = Lithic::BookTransferRetryParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/book_transfers/%1$s/retry", book_transfer_token], + body: parsed, + model: Lithic::BookTransferResponse, + options: options + ) + end + + # Reverse a book transfer + # + # @overload reverse(book_transfer_token, memo: nil, request_options: {}) + # + # @param book_transfer_token [String] Id of the book transfer to retrieve + # + # @param memo [String] Optional descriptor for the reversal. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::BookTransferResponse] + # + # @see Lithic::Models::BookTransferReverseParams + def reverse(book_transfer_token, params = {}) + parsed, options = Lithic::BookTransferReverseParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/book_transfers/%1$s/reverse", book_transfer_token], + body: parsed, + model: Lithic::BookTransferResponse, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/card_authorizations.rb b/lib/lithic/resources/card_authorizations.rb new file mode 100644 index 00000000..14d41cf1 --- /dev/null +++ b/lib/lithic/resources/card_authorizations.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class CardAuthorizations + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardAuthorizationChallengeResponseParams} for more details. + # + # Card program's response to Authorization Challenge. Programs that have + # Authorization Challenges configured as Out of Band receive a + # [card_authorization.challenge](https://docs.lithic.com/reference/post_card-authorization-challenge) + # webhook when an authorization attempt triggers a challenge. The card program + # should respond using this endpoint after the cardholder completes the challenge. + # + # @overload challenge_response(event_token, response:, request_options: {}) + # + # @param event_token [String] Globally unique identifier for the authorization event that triggered the challe + # + # @param response [Symbol, Lithic::Models::CardAuthorizationChallengeResponseParams::Response] Whether the cardholder has approved or declined the issued challenge + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Lithic::Models::CardAuthorizationChallengeResponseParams + def challenge_response(event_token, params) + parsed, options = Lithic::CardAuthorizationChallengeResponseParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/card_authorizations/%1$s/challenge_response", event_token], + body: parsed, + model: NilClass, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/card_bulk_orders.rb b/lib/lithic/resources/card_bulk_orders.rb new file mode 100644 index 00000000..63c251f3 --- /dev/null +++ b/lib/lithic/resources/card_bulk_orders.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class CardBulkOrders + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardBulkOrderCreateParams} for more details. + # + # Create a new bulk order for physical card shipments. Cards can be added to the + # order via the POST /v1/cards endpoint by specifying the bulk_order_token. Lock + # the order via PATCH /v1/card_bulk_orders/{bulk_order_token} to prepare for + # shipment. Please work with your Customer Success Manager and card + # personalization bureau to ensure bulk shipping is supported for your program. + # + # @overload create(customer_product_id:, shipping_address:, shipping_method:, request_options: {}) + # + # @param customer_product_id [String] Customer-specified product configuration for physical card manufacturing. This m + # + # @param shipping_address [Object] Shipping address for all cards in this bulk order + # + # @param shipping_method [Symbol, Lithic::Models::CardBulkOrderCreateParams::ShippingMethod] Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::CardBulkOrder] + # + # @see Lithic::Models::CardBulkOrderCreateParams + def create(params) + parsed, options = Lithic::CardBulkOrderCreateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/card_bulk_orders", + body: parsed, + model: Lithic::CardBulkOrder, + options: options + ) + end + + # Retrieve a specific bulk order by token + # + # @overload retrieve(bulk_order_token, request_options: {}) + # + # @param bulk_order_token [String] Globally unique identifier for the bulk order + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::CardBulkOrder] + # + # @see Lithic::Models::CardBulkOrderRetrieveParams + def retrieve(bulk_order_token, params = {}) + @client.request( + method: :get, + path: ["v1/card_bulk_orders/%1$s", bulk_order_token], + model: Lithic::CardBulkOrder, + options: params[:request_options] + ) + end + + # Update a bulk order. Primarily used to lock the order, preventing additional + # cards from being added + # + # @overload update(bulk_order_token, status:, request_options: {}) + # + # @param bulk_order_token [String] Globally unique identifier for the bulk order + # + # @param status [Symbol, Lithic::Models::CardBulkOrderUpdateParams::Status] Status to update the bulk order to. Use LOCKED to finalize the order + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::CardBulkOrder] + # + # @see Lithic::Models::CardBulkOrderUpdateParams + def update(bulk_order_token, params) + parsed, options = Lithic::CardBulkOrderUpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["v1/card_bulk_orders/%1$s", bulk_order_token], + body: parsed, + model: Lithic::CardBulkOrder, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardBulkOrderListParams} for more details. + # + # List bulk orders for physical card shipments + # + # @overload list(begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::CardBulkOrderListParams + def list(params = {}) + parsed, options = Lithic::CardBulkOrderListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/card_bulk_orders", + query: query.transform_keys(begin_: "begin", end_: "end"), + page: Lithic::Internal::CursorPage, + model: Lithic::CardBulkOrder, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/card_programs.rb b/lib/lithic/resources/card_programs.rb new file mode 100644 index 00000000..c129805e --- /dev/null +++ b/lib/lithic/resources/card_programs.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class CardPrograms + # Get card program. + # + # @overload retrieve(card_program_token, request_options: {}) + # + # @param card_program_token [String] Globally unique identifier for the card program. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::CardProgram] + # + # @see Lithic::Models::CardProgramRetrieveParams + def retrieve(card_program_token, params = {}) + @client.request( + method: :get, + path: ["v1/card_programs/%1$s", card_program_token], + model: Lithic::CardProgram, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardProgramListParams} for more details. + # + # List card programs. + # + # @overload list(ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::CardProgramListParams + def list(params = {}) + parsed, options = Lithic::CardProgramListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/card_programs", + query: query, + page: Lithic::Internal::CursorPage, + model: Lithic::CardProgram, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/cards.rb b/lib/lithic/resources/cards.rb new file mode 100644 index 00000000..7eb72a22 --- /dev/null +++ b/lib/lithic/resources/cards.rb @@ -0,0 +1,528 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Cards + # @return [Lithic::Resources::Cards::Balances] + attr_reader :balances + + # @return [Lithic::Resources::Cards::FinancialTransactions] + attr_reader :financial_transactions + + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardCreateParams} for more details. + # + # Create a new virtual or physical card. Parameters `shipping_address` and + # `product_id` only apply to physical cards. + # + # @overload create(type:, account_token: nil, bulk_order_token: nil, card_program_token: nil, carrier: nil, digital_card_art_token: nil, exp_month: nil, exp_year: nil, memo: nil, pin: nil, product_id: nil, replacement_account_token: nil, replacement_comment: nil, replacement_for: nil, replacement_substatus: nil, shipping_address: nil, shipping_method: nil, spend_limit: nil, spend_limit_duration: nil, state: nil, idempotency_key: nil, request_options: {}) + # + # @param type [Symbol, Lithic::Models::CardCreateParams::Type] Body param: Card types: + # + # @param account_token [String] Body param: Globally unique identifier for the account that the card will be ass + # + # @param bulk_order_token [String] Body param: Globally unique identifier for an existing bulk order to associate t + # + # @param card_program_token [String] Body param: For card programs with more than one BIN range. This must be configu + # + # @param carrier [Lithic::Models::Carrier] Body param + # + # @param digital_card_art_token [String] Body param: Specifies the digital card art to be displayed in the user’s digital + # + # @param exp_month [String] Body param: Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` i + # + # @param exp_year [String] Body param: Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` + # + # @param memo [String] Body param: Friendly name to identify the card. + # + # @param pin [String] Body param: Encrypted PIN block (in base64). Applies to cards of type `PHYSICAL` + # + # @param product_id [String] Body param: Only applicable to cards of type `PHYSICAL`. This must be configured + # + # @param replacement_account_token [String] Body param: Restricted field limited to select use cases. Lithic will reach out + # + # @param replacement_comment [String] Body param: Additional context or information related to the card that this card + # + # @param replacement_for [String] Body param: Globally unique identifier for the card that this card will replace. + # + # @param replacement_substatus [Symbol, Lithic::Models::CardCreateParams::ReplacementSubstatus] Body param: Card state substatus values for the card that this card will replace + # + # @param shipping_address [Lithic::Models::ShippingAddress] Body param + # + # @param shipping_method [Symbol, Lithic::Models::CardCreateParams::ShippingMethod] Body param: Shipping method for the card. Only applies to cards of type PHYSICAL + # + # @param spend_limit [Integer] Body param: Amount (in cents) to limit approved authorizations (e.g. 100000 woul + # + # @param spend_limit_duration [Symbol, Lithic::Models::SpendLimitDuration] Body param: Spend limit duration values: + # + # @param state [Symbol, Lithic::Models::CardCreateParams::State] Body param: Card state values: + # + # @param idempotency_key [String] Header param: Idempotency key for the request + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Card] + # + # @see Lithic::Models::CardCreateParams + def create(params) + parsed, options = Lithic::CardCreateParams.dump_request(params) + header_params = {idempotency_key: "idempotency-key"} + @client.request( + method: :post, + path: "v1/cards", + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), + model: Lithic::Card, + options: options + ) + end + + # Get card configuration such as spend limit and state. + # + # @overload retrieve(card_token, request_options: {}) + # + # @param card_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Card] + # + # @see Lithic::Models::CardRetrieveParams + def retrieve(card_token, params = {}) + @client.request( + method: :get, + path: ["v1/cards/%1$s", card_token], + model: Lithic::Card, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardUpdateParams} for more details. + # + # Update the specified properties of the card. Unsupplied properties will remain + # unchanged. + # + # _Note: setting a card to a `CLOSED` state is a final action that cannot be + # undone._ + # + # @overload update(card_token, comment: nil, digital_card_art_token: nil, memo: nil, network_program_token: nil, pin: nil, pin_status: nil, spend_limit: nil, spend_limit_duration: nil, state: nil, substatus: nil, request_options: {}) + # + # @param card_token [String] + # + # @param comment [String] Additional context or information related to the card. + # + # @param digital_card_art_token [String] Specifies the digital card art to be displayed in the user’s digital wallet afte + # + # @param memo [String] Friendly name to identify the card. + # + # @param network_program_token [String] Globally unique identifier for the card's network program. Currently applicable + # + # @param pin [String] Encrypted PIN block (in base64). Only applies to cards of type `PHYSICAL` and `V + # + # @param pin_status [Symbol, Lithic::Models::CardUpdateParams::PinStatus] Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect + # + # @param spend_limit [Integer] Amount (in cents) to limit approved authorizations (e.g. 100000 would be a $1,00 + # + # @param spend_limit_duration [Symbol, Lithic::Models::SpendLimitDuration] Spend limit duration values: + # + # @param state [Symbol, Lithic::Models::CardUpdateParams::State] Card state values: + # + # @param substatus [Symbol, Lithic::Models::CardUpdateParams::Substatus] Card state substatus values: + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Card] + # + # @see Lithic::Models::CardUpdateParams + def update(card_token, params = {}) + parsed, options = Lithic::CardUpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["v1/cards/%1$s", card_token], + body: parsed, + model: Lithic::Card, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardListParams} for more details. + # + # List cards. + # + # @overload list(account_token: nil, begin_: nil, end_: nil, ending_before: nil, memo: nil, page_size: nil, starting_after: nil, state: nil, request_options: {}) + # + # @param account_token [String] Returns cards associated with the specified account. + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param memo [String] Returns cards containing the specified partial or full memo text. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param state [Symbol, Lithic::Models::CardListParams::State] Returns cards with the specified state. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::CardListParams + def list(params = {}) + parsed, options = Lithic::CardListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/cards", + query: query.transform_keys(begin_: "begin", end_: "end"), + page: Lithic::Internal::CursorPage, + model: Lithic::NonPCICard, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardConvertPhysicalParams} for more details. + # + # Convert a virtual card into a physical card and manufacture it. Customer must + # supply relevant fields for physical card creation including `product_id`, + # `carrier`, `shipping_method`, and `shipping_address`. The card token will be + # unchanged. The card's type will be altered to `PHYSICAL`. The card will be set + # to state `PENDING_FULFILLMENT` and fulfilled at next fulfillment cycle. Virtual + # cards created on card programs which do not support physical cards cannot be + # converted. The card program cannot be changed as part of the conversion. Cards + # must be in an `OPEN` state to be converted. Only applies to cards of type + # `VIRTUAL` (or existing cards with deprecated types of `DIGITAL_WALLET` and + # `UNLOCKED`). + # + # @overload convert_physical(card_token, shipping_address:, carrier: nil, product_id: nil, shipping_method: nil, request_options: {}) + # + # @param card_token [String] + # + # @param shipping_address [Lithic::Models::ShippingAddress] The shipping address this card will be sent to. + # + # @param carrier [Lithic::Models::Carrier] If omitted, the previous carrier will be used. + # + # @param product_id [String] Specifies the configuration (e.g. physical card art) that the card should be man + # + # @param shipping_method [Symbol, Lithic::Models::CardConvertPhysicalParams::ShippingMethod] Shipping method for the card. Only applies to cards of type PHYSICAL. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Card] + # + # @see Lithic::Models::CardConvertPhysicalParams + def convert_physical(card_token, params) + parsed, options = Lithic::CardConvertPhysicalParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/cards/%1$s/convert_physical", card_token], + body: parsed, + model: Lithic::Card, + options: options + ) + end + + # Handling full card PANs and CVV codes requires that you comply with the Payment + # Card Industry Data Security Standards (PCI DSS). Some clients choose to reduce + # their compliance obligations by leveraging our embedded card UI solution + # documented below. + # + # In this setup, PANs and CVV codes are presented to the end-user via a card UI + # that we provide, optionally styled in the customer's branding using a specified + # css stylesheet. A user's browser makes the request directly to api.lithic.com, + # so card PANs and CVVs never touch the API customer's servers while full card + # data is displayed to their end-users. The response contains an HTML document + # (see Embedded Card UI or Changelog for upcoming changes in January). This means + # that the url for the request can be inserted straight into the `src` attribute + # of an iframe. + # + # ```html + # + # ``` + # + # You should compute the request payload on the server side. You can render it (or + # the whole iframe) on the server or make an ajax call from your front end code, + # but **do not ever embed your API key into front end code, as doing so introduces + # a serious security vulnerability**. + # + # @overload embed(embed_request:, hmac:, request_options: {}) + # + # @param embed_request [String] A base64 encoded JSON string of an EmbedRequest to specify which card to load. + # + # @param hmac [String] SHA256 HMAC of the embed_request JSON string with base64 digest. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [String] + # + # @see Lithic::Models::CardEmbedParams + def embed(params) + parsed, options = Lithic::CardEmbedParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/embed/card", + query: query, + headers: {"accept" => "text/html"}, + model: String, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardProvisionParams} for more details. + # + # Allow your cardholders to directly add payment cards to the device's digital + # wallet (e.g. Apple Pay) with one touch from your app. + # + # This requires some additional setup and configuration. Please + # [Contact Us](https://lithic.com/contact) or your Customer Success representative + # for more information. + # + # @overload provision(card_token, certificate: nil, client_device_id: nil, client_wallet_account_id: nil, digital_wallet: nil, nonce: nil, nonce_signature: nil, request_options: {}) + # + # @param card_token [String] The unique token of the card to add to the device's digital wallet. + # + # @param certificate [String] Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only `activa + # + # @param client_device_id [String] Only applicable if `digital_wallet` is `GOOGLE_PAY` or `SAMSUNG_PAY` and the car + # + # @param client_wallet_account_id [String] Only applicable if `digital_wallet` is `GOOGLE_PAY` or `SAMSUNG_PAY` and the car + # + # @param digital_wallet [Symbol, Lithic::Models::CardProvisionParams::DigitalWallet] Name of digital wallet provider. + # + # @param nonce [String] Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only `activa + # + # @param nonce_signature [String] Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only `activa + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::CardProvisionResponse] + # + # @see Lithic::Models::CardProvisionParams + def provision(card_token, params = {}) + parsed, options = Lithic::CardProvisionParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/cards/%1$s/provision", card_token], + body: parsed, + model: Lithic::Models::CardProvisionResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardReissueParams} for more details. + # + # Initiate print and shipment of a duplicate physical card (e.g. card is + # physically damaged). The PAN, expiry, and CVC2 will remain the same and the + # original card can continue to be used until the new card is activated. Only + # applies to cards of type `PHYSICAL`. A card can be reissued or renewed a total + # of 8 times. + # + # @overload reissue(card_token, carrier: nil, product_id: nil, shipping_address: nil, shipping_method: nil, request_options: {}) + # + # @param card_token [String] + # + # @param carrier [Lithic::Models::Carrier] If omitted, the previous carrier will be used. + # + # @param product_id [String] Specifies the configuration (e.g. physical card art) that the card should be man + # + # @param shipping_address [Lithic::Models::ShippingAddress] If omitted, the previous shipping address will be used. + # + # @param shipping_method [Symbol, Lithic::Models::CardReissueParams::ShippingMethod] Shipping method for the card. Only applies to cards of type PHYSICAL. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Card] + # + # @see Lithic::Models::CardReissueParams + def reissue(card_token, params = {}) + parsed, options = Lithic::CardReissueParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/cards/%1$s/reissue", card_token], + body: parsed, + model: Lithic::Card, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardRenewParams} for more details. + # + # Applies to card types `PHYSICAL` and `VIRTUAL`. For `PHYSICAL`, creates a new + # card with the same card token and PAN, but updated expiry and CVC2 code. The + # original card will keep working for card-present transactions until the new card + # is activated. For card-not-present transactions, the original card details + # (expiry, CVC2) will also keep working until the new card is activated. A + # `PHYSICAL` card can be reissued or renewed a total of 8 times. For `VIRTUAL`, + # the card will retain the same card token and PAN and receive an updated expiry + # and CVC2 code. `product_id`, `shipping_method`, `shipping_address`, `carrier` + # are only relevant for renewing `PHYSICAL` cards. + # + # @overload renew(card_token, shipping_address:, carrier: nil, exp_month: nil, exp_year: nil, product_id: nil, shipping_method: nil, request_options: {}) + # + # @param card_token [String] + # + # @param shipping_address [Lithic::Models::ShippingAddress] The shipping address this card will be sent to. + # + # @param carrier [Lithic::Models::Carrier] If omitted, the previous carrier will be used. + # + # @param exp_month [String] Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, + # + # @param exp_year [String] Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is provided + # + # @param product_id [String] Specifies the configuration (e.g. physical card art) that the card should be man + # + # @param shipping_method [Symbol, Lithic::Models::CardRenewParams::ShippingMethod] Shipping method for the card. Only applies to cards of type PHYSICAL. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Card] + # + # @see Lithic::Models::CardRenewParams + def renew(card_token, params) + parsed, options = Lithic::CardRenewParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/cards/%1$s/renew", card_token], + body: parsed, + model: Lithic::Card, + options: options + ) + end + + # Returns behavioral feature state derived from a card's transaction history. + # + # These signals expose the same data used by behavioral rule attributes (e.g. + # `AMOUNT_Z_SCORE` with `scope: CARD`, `IS_NEW_COUNTRY` with `scope: CARD`) and + # custom code `TRANSACTION_HISTORY_SIGNALS` features, allowing clients to inspect + # feature values before writing rules and debug rule behavior. + # + # @overload retrieve_signals(card_token, request_options: {}) + # + # @param card_token [String] The token of the card to fetch signals for. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::SignalsResponse] + # + # @see Lithic::Models::CardRetrieveSignalsParams + def retrieve_signals(card_token, params = {}) + @client.request( + method: :get, + path: ["v1/cards/%1$s/signals", card_token], + model: Lithic::SignalsResponse, + options: params[:request_options] + ) + end + + # Get a Card's available spend limit, which is based on the spend limit configured + # on the Card and the amount already spent over the spend limit's duration. For + # example, if the Card has a monthly spend limit of $1000 configured, and has + # spent $600 in the last month, the available spend limit returned would be $400. + # + # @overload retrieve_spend_limits(card_token, request_options: {}) + # + # @param card_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::CardSpendLimits] + # + # @see Lithic::Models::CardRetrieveSpendLimitsParams + def retrieve_spend_limits(card_token, params = {}) + @client.request( + method: :get, + path: ["v1/cards/%1$s/spend_limits", card_token], + model: Lithic::CardSpendLimits, + options: params[:request_options] + ) + end + + # Get card configuration such as spend limit and state. Customers must be PCI + # compliant to use this endpoint. Please contact + # [support.lithic.com](https://support.lithic.com/) for questions. _Note: this is + # a `POST` endpoint because it is more secure to send sensitive data in a request + # body than in a URL._ + # + # @overload search_by_pan(pan:, request_options: {}) + # + # @param pan [String] The PAN for the card being retrieved. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Card] + # + # @see Lithic::Models::CardSearchByPanParams + def search_by_pan(params) + parsed, options = Lithic::CardSearchByPanParams.dump_request(params) + @client.request( + method: :post, + path: "v1/cards/search_by_pan", + body: parsed, + model: Lithic::Card, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::CardWebProvisionParams} for more details. + # + # Allow your cardholders to directly add payment cards to the device's digital + # wallet from a browser on the web. + # + # This requires some additional setup and configuration. Please + # [Contact Us](https://lithic.com/contact) or your Customer Success representative + # for more information. + # + # @overload web_provision(card_token, client_device_id: nil, client_wallet_account_id: nil, digital_wallet: nil, server_session_id: nil, request_options: {}) + # + # @param card_token [String] The unique token of the card to add to the device's digital wallet. + # + # @param client_device_id [String] Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push Provision + # + # @param client_wallet_account_id [String] Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push Provision + # + # @param digital_wallet [Symbol, Lithic::Models::CardWebProvisionParams::DigitalWallet] Name of digital wallet provider. + # + # @param server_session_id [String] Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push Provision + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse, Lithic::Models::CardWebProvisionResponse::GoogleWebPushProvisioningResponse] + # + # @see Lithic::Models::CardWebProvisionParams + def web_provision(card_token, params = {}) + parsed, options = Lithic::CardWebProvisionParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/cards/%1$s/web_provision", card_token], + body: parsed, + model: Lithic::Models::CardWebProvisionResponse, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @balances = Lithic::Resources::Cards::Balances.new(client: client) + @financial_transactions = Lithic::Resources::Cards::FinancialTransactions.new(client: client) + end + end + end +end diff --git a/lib/lithic/resources/cards/balances.rb b/lib/lithic/resources/cards/balances.rb new file mode 100644 index 00000000..31b1ee33 --- /dev/null +++ b/lib/lithic/resources/cards/balances.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Cards + class Balances + # Some parameter documentations has been truncated, see + # {Lithic::Models::Cards::BalanceListParams} for more details. + # + # Get the balances for a given card. + # + # @overload list(card_token, balance_date: nil, last_transaction_event_token: nil, request_options: {}) + # + # @param card_token [String] + # + # @param balance_date [Time] UTC date of the balance to retrieve. Defaults to latest available balance + # + # @param last_transaction_event_token [String] Balance after a given financial event occured. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::SinglePage] + # + # @see Lithic::Models::Cards::BalanceListParams + def list(card_token, params = {}) + parsed, options = Lithic::Cards::BalanceListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["v1/cards/%1$s/balances", card_token], + query: query, + page: Lithic::Internal::SinglePage, + model: Lithic::FinancialAccountBalance, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/cards/financial_transactions.rb b/lib/lithic/resources/cards/financial_transactions.rb new file mode 100644 index 00000000..e460b635 --- /dev/null +++ b/lib/lithic/resources/cards/financial_transactions.rb @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Cards + class FinancialTransactions + # Get the card financial transaction for the provided token. + # + # @overload retrieve(financial_transaction_token, card_token:, request_options: {}) + # + # @param financial_transaction_token [String] Globally unique identifier for financial transaction token. + # + # @param card_token [String] + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::FinancialTransaction] + # + # @see Lithic::Models::Cards::FinancialTransactionRetrieveParams + def retrieve(financial_transaction_token, params) + parsed, options = Lithic::Cards::FinancialTransactionRetrieveParams.dump_request(params) + card_token = + parsed.delete(:card_token) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :get, + path: ["v1/cards/%1$s/financial_transactions/%2$s", card_token, financial_transaction_token], + model: Lithic::FinancialTransaction, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::Cards::FinancialTransactionListParams} for more details. + # + # List the financial transactions for a given card. + # + # @overload list(card_token, begin_: nil, category: nil, end_: nil, ending_before: nil, result: nil, starting_after: nil, status: nil, request_options: {}) + # + # @param card_token [String] + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param category [Symbol, Lithic::Models::Cards::FinancialTransactionListParams::Category] Financial Transaction category to be returned. + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param result [Symbol, Lithic::Models::Cards::FinancialTransactionListParams::Result] Financial Transaction result to be returned. + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param status [Symbol, Lithic::Models::Cards::FinancialTransactionListParams::Status] Financial Transaction status to be returned. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::SinglePage] + # + # @see Lithic::Models::Cards::FinancialTransactionListParams + def list(card_token, params = {}) + parsed, options = Lithic::Cards::FinancialTransactionListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["v1/cards/%1$s/financial_transactions", card_token], + query: query.transform_keys(begin_: "begin", end_: "end"), + page: Lithic::Internal::SinglePage, + model: Lithic::FinancialTransaction, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/credit_products.rb b/lib/lithic/resources/credit_products.rb new file mode 100644 index 00000000..a9afcbdc --- /dev/null +++ b/lib/lithic/resources/credit_products.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class CreditProducts + # @return [Lithic::Resources::CreditProducts::ExtendedCredit] + attr_reader :extended_credit + + # @return [Lithic::Resources::CreditProducts::PrimeRates] + attr_reader :prime_rates + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @extended_credit = Lithic::Resources::CreditProducts::ExtendedCredit.new(client: client) + @prime_rates = Lithic::Resources::CreditProducts::PrimeRates.new(client: client) + end + end + end +end diff --git a/lib/lithic/resources/credit_products/extended_credit.rb b/lib/lithic/resources/credit_products/extended_credit.rb new file mode 100644 index 00000000..4b34b59e --- /dev/null +++ b/lib/lithic/resources/credit_products/extended_credit.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class CreditProducts + class ExtendedCredit + # Get the extended credit for a given credit product under a program + # + # @overload retrieve(credit_product_token, request_options: {}) + # + # @param credit_product_token [String] Credit Product Token + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::CreditProducts::CreditProductsExtendedCredit] + # + # @see Lithic::Models::CreditProducts::ExtendedCreditRetrieveParams + def retrieve(credit_product_token, params = {}) + @client.request( + method: :get, + path: ["v1/credit_products/%1$s/extended_credit", credit_product_token], + model: Lithic::CreditProducts::CreditProductsExtendedCredit, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/credit_products/prime_rates.rb b/lib/lithic/resources/credit_products/prime_rates.rb new file mode 100644 index 00000000..a616c374 --- /dev/null +++ b/lib/lithic/resources/credit_products/prime_rates.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class CreditProducts + class PrimeRates + # Post Credit Product Prime Rate + # + # @overload create(credit_product_token, effective_date:, rate:, request_options: {}) + # + # @param credit_product_token [String] Globally unique identifier for credit products. + # + # @param effective_date [Date] Date the rate goes into effect + # + # @param rate [String] The rate in decimal format + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Lithic::Models::CreditProducts::PrimeRateCreateParams + def create(credit_product_token, params) + parsed, options = Lithic::CreditProducts::PrimeRateCreateParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/credit_products/%1$s/prime_rates", credit_product_token], + body: parsed, + model: NilClass, + options: options + ) + end + + # Get Credit Product Prime Rates + # + # @overload retrieve(credit_product_token, ending_before: nil, starting_after: nil, request_options: {}) + # + # @param credit_product_token [String] Globally unique identifier for credit products. + # + # @param ending_before [Date] The effective date that the prime rates ends before + # + # @param starting_after [Date] The effective date that the prime rate starts after + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::CreditProducts::PrimeRateRetrieveResponse] + # + # @see Lithic::Models::CreditProducts::PrimeRateRetrieveParams + def retrieve(credit_product_token, params = {}) + parsed, options = Lithic::CreditProducts::PrimeRateRetrieveParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["v1/credit_products/%1$s/prime_rates", credit_product_token], + query: query, + model: Lithic::Models::CreditProducts::PrimeRateRetrieveResponse, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/digital_card_art.rb b/lib/lithic/resources/digital_card_art.rb new file mode 100644 index 00000000..3ac56db2 --- /dev/null +++ b/lib/lithic/resources/digital_card_art.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class DigitalCardArt + # Some parameter documentations has been truncated, see + # {Lithic::Models::DigitalCardArtRetrieveParams} for more details. + # + # Get digital card art by token. + # + # @overload retrieve(digital_card_art_token, request_options: {}) + # + # @param digital_card_art_token [String] Specifies the digital card art to be displayed in the user’s digital wallet afte + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::DigitalCardArtAPI] + # + # @see Lithic::Models::DigitalCardArtRetrieveParams + def retrieve(digital_card_art_token, params = {}) + @client.request( + method: :get, + path: ["v1/digital_card_art/%1$s", digital_card_art_token], + model: Lithic::DigitalCardArtAPI, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::DigitalCardArtListParams} for more details. + # + # List digital card art. + # + # @overload list(ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::DigitalCardArtListParams + def list(params = {}) + parsed, options = Lithic::DigitalCardArtListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/digital_card_art", + query: query, + page: Lithic::Internal::CursorPage, + model: Lithic::DigitalCardArtAPI, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/disputes.rb b/lib/lithic/resources/disputes.rb new file mode 100644 index 00000000..de31d3ca --- /dev/null +++ b/lib/lithic/resources/disputes.rb @@ -0,0 +1,267 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Disputes + # Request a chargeback. + # + # @overload create(amount:, reason:, transaction_token:, customer_filed_date: nil, customer_note: nil, request_options: {}) + # + # @param amount [Integer] Amount for chargeback + # + # @param reason [Symbol, Lithic::Models::DisputeCreateParams::Reason] Reason for chargeback + # + # @param transaction_token [String] Transaction for chargeback + # + # @param customer_filed_date [Time] Date the customer filed the chargeback request + # + # @param customer_note [String] Customer description + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Dispute] + # + # @see Lithic::Models::DisputeCreateParams + def create(params) + parsed, options = Lithic::DisputeCreateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/disputes", + body: parsed, + model: Lithic::Dispute, + options: options + ) + end + + # Get chargeback request. + # + # @overload retrieve(dispute_token, request_options: {}) + # + # @param dispute_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Dispute] + # + # @see Lithic::Models::DisputeRetrieveParams + def retrieve(dispute_token, params = {}) + @client.request( + method: :get, + path: ["v1/disputes/%1$s", dispute_token], + model: Lithic::Dispute, + options: params[:request_options] + ) + end + + # Update chargeback request. Can only be modified if status is `NEW`. + # + # @overload update(dispute_token, amount: nil, customer_filed_date: nil, customer_note: nil, reason: nil, request_options: {}) + # + # @param dispute_token [String] + # + # @param amount [Integer] Amount for chargeback + # + # @param customer_filed_date [Time] Date the customer filed the chargeback request + # + # @param customer_note [String] Customer description + # + # @param reason [Symbol, Lithic::Models::DisputeUpdateParams::Reason] Reason for chargeback + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Dispute] + # + # @see Lithic::Models::DisputeUpdateParams + def update(dispute_token, params = {}) + parsed, options = Lithic::DisputeUpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["v1/disputes/%1$s", dispute_token], + body: parsed, + model: Lithic::Dispute, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::DisputeListParams} for more details. + # + # List chargeback requests. + # + # @overload list(begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, status: nil, transaction_tokens: nil, request_options: {}) + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param status [Symbol, Lithic::Models::DisputeListParams::Status] Filter by status. + # + # @param transaction_tokens [Array] Transaction tokens to filter by. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::DisputeListParams + def list(params = {}) + parsed, options = Lithic::DisputeListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/disputes", + query: query.transform_keys(begin_: "begin", end_: "end"), + page: Lithic::Internal::CursorPage, + model: Lithic::Dispute, + options: options + ) + end + + # Withdraw chargeback request. + # + # @overload delete(dispute_token, request_options: {}) + # + # @param dispute_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Dispute] + # + # @see Lithic::Models::DisputeDeleteParams + def delete(dispute_token, params = {}) + @client.request( + method: :delete, + path: ["v1/disputes/%1$s", dispute_token], + model: Lithic::Dispute, + options: params[:request_options] + ) + end + + # Soft delete evidence for a chargeback request. Evidence will not be reviewed or + # submitted by Lithic after it is withdrawn. + # + # @overload delete_evidence(evidence_token, dispute_token:, request_options: {}) + # + # @param evidence_token [String] + # @param dispute_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::DisputeEvidence] + # + # @see Lithic::Models::DisputeDeleteEvidenceParams + def delete_evidence(evidence_token, params) + parsed, options = Lithic::DisputeDeleteEvidenceParams.dump_request(params) + dispute_token = + parsed.delete(:dispute_token) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :delete, + path: ["v1/disputes/%1$s/evidences/%2$s", dispute_token, evidence_token], + model: Lithic::DisputeEvidence, + options: options + ) + end + + # Use this endpoint to upload evidence for a chargeback request. It will return a + # URL to upload your documents to. The URL will expire in 30 minutes. + # + # Uploaded documents must either be a `jpg`, `png` or `pdf` file, and each must be + # less than 5 GiB. + # + # @overload initiate_evidence_upload(dispute_token, filename: nil, request_options: {}) + # + # @param dispute_token [String] + # + # @param filename [String] Filename of the evidence. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::DisputeEvidence] + # + # @see Lithic::Models::DisputeInitiateEvidenceUploadParams + def initiate_evidence_upload(dispute_token, params = {}) + parsed, options = Lithic::DisputeInitiateEvidenceUploadParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/disputes/%1$s/evidences", dispute_token], + body: parsed, + model: Lithic::DisputeEvidence, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::DisputeListEvidencesParams} for more details. + # + # List evidence for a chargeback request. + # + # @overload list_evidences(dispute_token, begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # + # @param dispute_token [String] + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::DisputeListEvidencesParams + def list_evidences(dispute_token, params = {}) + parsed, options = Lithic::DisputeListEvidencesParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["v1/disputes/%1$s/evidences", dispute_token], + query: query.transform_keys(begin_: "begin", end_: "end"), + page: Lithic::Internal::CursorPage, + model: Lithic::DisputeEvidence, + options: options + ) + end + + # Get evidence for a chargeback request. + # + # @overload retrieve_evidence(evidence_token, dispute_token:, request_options: {}) + # + # @param evidence_token [String] + # @param dispute_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::DisputeEvidence] + # + # @see Lithic::Models::DisputeRetrieveEvidenceParams + def retrieve_evidence(evidence_token, params) + parsed, options = Lithic::DisputeRetrieveEvidenceParams.dump_request(params) + dispute_token = + parsed.delete(:dispute_token) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :get, + path: ["v1/disputes/%1$s/evidences/%2$s", dispute_token, evidence_token], + model: Lithic::DisputeEvidence, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/disputes_v2.rb b/lib/lithic/resources/disputes_v2.rb new file mode 100644 index 00000000..d92b14cb --- /dev/null +++ b/lib/lithic/resources/disputes_v2.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class DisputesV2 + # Retrieves a specific dispute by its token. + # + # @overload retrieve(dispute_token, request_options: {}) + # + # @param dispute_token [String] Token of the dispute to retrieve. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::DisputeV2] + # + # @see Lithic::Models::DisputesV2RetrieveParams + def retrieve(dispute_token, params = {}) + @client.request( + method: :get, + path: ["v2/disputes/%1$s", dispute_token], + model: Lithic::DisputeV2, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::DisputesV2ListParams} for more details. + # + # Returns a paginated list of disputes. + # + # @overload list(account_token: nil, begin_: nil, card_token: nil, disputed_transaction_token: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # + # @param account_token [String] Filter by account token. + # + # @param begin_ [Time] RFC 3339 timestamp for filtering by created date, inclusive. + # + # @param card_token [String] Filter by card token. + # + # @param disputed_transaction_token [String] Filter by the token of the transaction being disputed. Corresponds with transact + # + # @param end_ [Time] RFC 3339 timestamp for filtering by created date, inclusive. + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Number of items to return. + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::DisputesV2ListParams + def list(params = {}) + parsed, options = Lithic::DisputesV2ListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v2/disputes", + query: query.transform_keys(begin_: "begin", end_: "end"), + page: Lithic::Internal::CursorPage, + model: Lithic::DisputeV2, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/events.rb b/lib/lithic/resources/events.rb new file mode 100644 index 00000000..05e82ca2 --- /dev/null +++ b/lib/lithic/resources/events.rb @@ -0,0 +1,119 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Events + # @return [Lithic::Resources::Events::Subscriptions] + attr_reader :subscriptions + + # @return [Lithic::Resources::Events::EventSubscriptions] + attr_reader :event_subscriptions + + # Get an event. + # + # @overload retrieve(event_token, request_options: {}) + # + # @param event_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Event] + # + # @see Lithic::Models::EventRetrieveParams + def retrieve(event_token, params = {}) + @client.request( + method: :get, + path: ["v1/events/%1$s", event_token], + model: Lithic::Event, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::EventListParams} for more details. + # + # List all events. + # + # @overload list(begin_: nil, end_: nil, ending_before: nil, event_types: nil, page_size: nil, starting_after: nil, with_content: nil, request_options: {}) + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param event_types [Array] Event types to filter events by. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param with_content [Boolean] Whether to include the event payload content in the response. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::EventListParams + def list(params = {}) + parsed, options = Lithic::EventListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/events", + query: query.transform_keys(begin_: "begin", end_: "end"), + page: Lithic::Internal::CursorPage, + model: Lithic::Event, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::EventListAttemptsParams} for more details. + # + # List all the message attempts for a given event. + # + # @overload list_attempts(event_token, begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, status: nil, request_options: {}) + # + # @param event_token [String] + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param status [Symbol, Lithic::Models::EventListAttemptsParams::Status] + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::EventListAttemptsParams + def list_attempts(event_token, params = {}) + parsed, options = Lithic::EventListAttemptsParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["v1/events/%1$s/attempts", event_token], + query: query.transform_keys(begin_: "begin", end_: "end"), + page: Lithic::Internal::CursorPage, + model: Lithic::MessageAttempt, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @subscriptions = Lithic::Resources::Events::Subscriptions.new(client: client) + @event_subscriptions = Lithic::Resources::Events::EventSubscriptions.new(client: client) + end + end + end +end diff --git a/lib/lithic/resources/events/event_subscriptions.rb b/lib/lithic/resources/events/event_subscriptions.rb new file mode 100644 index 00000000..eeea0e75 --- /dev/null +++ b/lib/lithic/resources/events/event_subscriptions.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Events + class EventSubscriptions + # Resend an event to an event subscription. + # + # @overload resend(event_subscription_token, event_token:, request_options: {}) + # + # @param event_subscription_token [String] + # @param event_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Lithic::Models::Events::EventSubscriptionResendParams + def resend(event_subscription_token, params) + parsed, options = Lithic::Events::EventSubscriptionResendParams.dump_request(params) + event_token = + parsed.delete(:event_token) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :post, + path: ["v1/events/%1$s/event_subscriptions/%2$s/resend", event_token, event_subscription_token], + model: NilClass, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/events/subscriptions.rb b/lib/lithic/resources/events/subscriptions.rb new file mode 100644 index 00000000..ac1898e7 --- /dev/null +++ b/lib/lithic/resources/events/subscriptions.rb @@ -0,0 +1,315 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Events + class Subscriptions + # Some parameter documentations has been truncated, see + # {Lithic::Models::Events::SubscriptionCreateParams} for more details. + # + # Create a new event subscription. + # + # @overload create(url:, description: nil, disabled: nil, event_types: nil, request_options: {}) + # + # @param url [String] URL to which event webhooks will be sent. URL must be a valid HTTPS address. + # + # @param description [String] Event subscription description. + # + # @param disabled [Boolean] Whether the event subscription is active (false) or inactive (true). + # + # @param event_types [Array] Indicates types of events that will be sent to this subscription. If left blank, + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::EventSubscription] + # + # @see Lithic::Models::Events::SubscriptionCreateParams + def create(params) + parsed, options = Lithic::Events::SubscriptionCreateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/event_subscriptions", + body: parsed, + model: Lithic::EventSubscription, + options: options + ) + end + + # Get an event subscription. + # + # @overload retrieve(event_subscription_token, request_options: {}) + # + # @param event_subscription_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::EventSubscription] + # + # @see Lithic::Models::Events::SubscriptionRetrieveParams + def retrieve(event_subscription_token, params = {}) + @client.request( + method: :get, + path: ["v1/event_subscriptions/%1$s", event_subscription_token], + model: Lithic::EventSubscription, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::Events::SubscriptionUpdateParams} for more details. + # + # Update an event subscription. + # + # @overload update(event_subscription_token, url:, description: nil, disabled: nil, event_types: nil, request_options: {}) + # + # @param event_subscription_token [String] + # + # @param url [String] URL to which event webhooks will be sent. URL must be a valid HTTPS address. + # + # @param description [String] Event subscription description. + # + # @param disabled [Boolean] Whether the event subscription is active (false) or inactive (true). + # + # @param event_types [Array] Indicates types of events that will be sent to this subscription. If left blank, + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::EventSubscription] + # + # @see Lithic::Models::Events::SubscriptionUpdateParams + def update(event_subscription_token, params) + parsed, options = Lithic::Events::SubscriptionUpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["v1/event_subscriptions/%1$s", event_subscription_token], + body: parsed, + model: Lithic::EventSubscription, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::Events::SubscriptionListParams} for more details. + # + # List all the event subscriptions. + # + # @overload list(ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::Events::SubscriptionListParams + def list(params = {}) + parsed, options = Lithic::Events::SubscriptionListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/event_subscriptions", + query: query, + page: Lithic::Internal::CursorPage, + model: Lithic::EventSubscription, + options: options + ) + end + + # Delete an event subscription. + # + # @overload delete(event_subscription_token, request_options: {}) + # + # @param event_subscription_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Lithic::Models::Events::SubscriptionDeleteParams + def delete(event_subscription_token, params = {}) + @client.request( + method: :delete, + path: ["v1/event_subscriptions/%1$s", event_subscription_token], + model: NilClass, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::Events::SubscriptionListAttemptsParams} for more details. + # + # List all the message attempts for a given event subscription. + # + # @overload list_attempts(event_subscription_token, begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, status: nil, request_options: {}) + # + # @param event_subscription_token [String] + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param status [Symbol, Lithic::Models::Events::SubscriptionListAttemptsParams::Status] + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::Events::SubscriptionListAttemptsParams + def list_attempts(event_subscription_token, params = {}) + parsed, options = Lithic::Events::SubscriptionListAttemptsParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["v1/event_subscriptions/%1$s/attempts", event_subscription_token], + query: query.transform_keys(begin_: "begin", end_: "end"), + page: Lithic::Internal::CursorPage, + model: Lithic::MessageAttempt, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::Events::SubscriptionRecoverParams} for more details. + # + # Resend all failed messages since a given time. + # + # @overload recover(event_subscription_token, begin_: nil, end_: nil, request_options: {}) + # + # @param event_subscription_token [String] + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Lithic::Models::Events::SubscriptionRecoverParams + def recover(event_subscription_token, params = {}) + parsed, options = Lithic::Events::SubscriptionRecoverParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :post, + path: ["v1/event_subscriptions/%1$s/recover", event_subscription_token], + query: query.transform_keys(begin_: "begin", end_: "end"), + model: NilClass, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::Events::SubscriptionReplayMissingParams} for more details. + # + # Replays messages to the endpoint. Only messages that were created after `begin` + # will be sent. Messages that were previously sent to the endpoint are not resent. + # Message will be retried if endpoint responds with a non-2xx status code. See + # [Retry Schedule](https://docs.lithic.com/docs/events-api#retry-schedule) for + # details. + # + # @overload replay_missing(event_subscription_token, begin_: nil, end_: nil, request_options: {}) + # + # @param event_subscription_token [String] + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Lithic::Models::Events::SubscriptionReplayMissingParams + def replay_missing(event_subscription_token, params = {}) + parsed, options = Lithic::Events::SubscriptionReplayMissingParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :post, + path: ["v1/event_subscriptions/%1$s/replay_missing", event_subscription_token], + query: query.transform_keys(begin_: "begin", end_: "end"), + model: NilClass, + options: options + ) + end + + # Get the secret for an event subscription. + # + # @overload retrieve_secret(event_subscription_token, request_options: {}) + # + # @param event_subscription_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Events::SubscriptionRetrieveSecretResponse] + # + # @see Lithic::Models::Events::SubscriptionRetrieveSecretParams + def retrieve_secret(event_subscription_token, params = {}) + @client.request( + method: :get, + path: ["v1/event_subscriptions/%1$s/secret", event_subscription_token], + model: Lithic::Models::Events::SubscriptionRetrieveSecretResponse, + options: params[:request_options] + ) + end + + # Rotate the secret for an event subscription. The previous secret will be valid + # for the next 24 hours. + # + # @overload rotate_secret(event_subscription_token, request_options: {}) + # + # @param event_subscription_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Lithic::Models::Events::SubscriptionRotateSecretParams + def rotate_secret(event_subscription_token, params = {}) + @client.request( + method: :post, + path: ["v1/event_subscriptions/%1$s/secret/rotate", event_subscription_token], + model: NilClass, + options: params[:request_options] + ) + end + + # Send an example message for event. + # + # @overload send_simulated_example(event_subscription_token, event_type: nil, request_options: {}) + # + # @param event_subscription_token [String] + # + # @param event_type [Symbol, Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::EventType] Event type to send example message for. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Lithic::Models::Events::SubscriptionSendSimulatedExampleParams + def send_simulated_example(event_subscription_token, params = {}) + parsed, options = Lithic::Events::SubscriptionSendSimulatedExampleParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/simulate/event_subscriptions/%1$s/send_example", event_subscription_token], + body: parsed, + model: NilClass, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/external_bank_accounts.rb b/lib/lithic/resources/external_bank_accounts.rb new file mode 100644 index 00000000..fead241b --- /dev/null +++ b/lib/lithic/resources/external_bank_accounts.rb @@ -0,0 +1,257 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class ExternalBankAccounts + # @return [Lithic::Resources::ExternalBankAccounts::MicroDeposits] + attr_reader :micro_deposits + + # Creates an external bank account within a program or Lithic account. + # + # @overload create(body:, request_options: {}) + # + # @param body [Lithic::Models::ExternalBankAccountCreateParams::Body::ExternallyVerified, Lithic::Models::ExternalBankAccountCreateParams::Body::Unverified, Lithic::Models::ExternalBankAccountCreateParams::Body::BankVerifiedCreateBankAccountAPIRequest] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::ExternalBankAccountCreateResponse] + # + # @see Lithic::Models::ExternalBankAccountCreateParams + def create(params) + parsed, options = Lithic::ExternalBankAccountCreateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/external_bank_accounts", + body: parsed[:body], + model: Lithic::Models::ExternalBankAccountCreateResponse, + options: options + ) + end + + # Get the external bank account by token. + # + # @overload retrieve(external_bank_account_token, request_options: {}) + # + # @param external_bank_account_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::ExternalBankAccountRetrieveResponse] + # + # @see Lithic::Models::ExternalBankAccountRetrieveParams + def retrieve(external_bank_account_token, params = {}) + @client.request( + method: :get, + path: ["v1/external_bank_accounts/%1$s", external_bank_account_token], + model: Lithic::Models::ExternalBankAccountRetrieveResponse, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::ExternalBankAccountUpdateParams} for more details. + # + # Update the external bank account by token. + # + # @overload update(external_bank_account_token, address: nil, company_id: nil, dob: nil, doing_business_as: nil, name: nil, owner: nil, owner_type: nil, type: nil, user_defined_id: nil, request_options: {}) + # + # @param external_bank_account_token [String] + # + # @param address [Lithic::Models::ExternalBankAccountAddress] Address + # + # @param company_id [String] Optional field that helps identify bank accounts in receipts + # + # @param dob [Date] Date of Birth of the Individual that owns the external bank account + # + # @param doing_business_as [String] Doing Business As + # + # @param name [String] The nickname for this External Bank Account + # + # @param owner [String] Legal Name of the business or individual who owns the external account. This wil + # + # @param owner_type [Symbol, Lithic::Models::OwnerType] Owner Type + # + # @param type [Symbol, Lithic::Models::ExternalBankAccountUpdateParams::Type] + # + # @param user_defined_id [String] User Defined ID + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::ExternalBankAccountUpdateResponse] + # + # @see Lithic::Models::ExternalBankAccountUpdateParams + def update(external_bank_account_token, params = {}) + parsed, options = Lithic::ExternalBankAccountUpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["v1/external_bank_accounts/%1$s", external_bank_account_token], + body: parsed, + model: Lithic::Models::ExternalBankAccountUpdateResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::ExternalBankAccountListParams} for more details. + # + # List all the external bank accounts for the provided search criteria. + # + # @overload list(account_token: nil, account_types: nil, countries: nil, ending_before: nil, owner_types: nil, page_size: nil, starting_after: nil, states: nil, verification_states: nil, request_options: {}) + # + # @param account_token [String] + # + # @param account_types [Array] + # + # @param countries [Array] + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param owner_types [Array] + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param states [Array] + # + # @param verification_states [Array] + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::ExternalBankAccountListParams + def list(params = {}) + parsed, options = Lithic::ExternalBankAccountListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/external_bank_accounts", + query: query, + page: Lithic::Internal::CursorPage, + model: Lithic::Models::ExternalBankAccountListResponse, + options: options + ) + end + + # Pause an external bank account + # + # @overload pause(external_bank_account_token, request_options: {}) + # + # @param external_bank_account_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::ExternalBankAccount] + # + # @see Lithic::Models::ExternalBankAccountPauseParams + def pause(external_bank_account_token, params = {}) + @client.request( + method: :post, + path: ["v1/external_bank_accounts/%1$s/pause", external_bank_account_token], + model: Lithic::ExternalBankAccount, + options: params[:request_options] + ) + end + + # Retry external bank account micro deposit verification. + # + # @overload retry_micro_deposits(external_bank_account_token, financial_account_token: nil, request_options: {}) + # + # @param external_bank_account_token [String] + # @param financial_account_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse] + # + # @see Lithic::Models::ExternalBankAccountRetryMicroDepositsParams + def retry_micro_deposits(external_bank_account_token, params = {}) + parsed, options = Lithic::ExternalBankAccountRetryMicroDepositsParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/external_bank_accounts/%1$s/retry_micro_deposits", external_bank_account_token], + body: parsed, + model: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse, + options: options + ) + end + + # Retry external bank account prenote verification. + # + # @overload retry_prenote(external_bank_account_token, financial_account_token: nil, request_options: {}) + # + # @param external_bank_account_token [String] + # @param financial_account_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::ExternalBankAccount] + # + # @see Lithic::Models::ExternalBankAccountRetryPrenoteParams + def retry_prenote(external_bank_account_token, params = {}) + parsed, options = Lithic::ExternalBankAccountRetryPrenoteParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/external_bank_accounts/%1$s/retry_prenote", external_bank_account_token], + body: parsed, + model: Lithic::ExternalBankAccount, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::ExternalBankAccountSetVerificationMethodParams} for more + # details. + # + # Update the verification method for an external bank account. Verification method + # can only be updated if the `verification_state` is `PENDING`. + # + # @overload set_verification_method(external_bank_account_token, verification_method:, financial_account_token: nil, request_options: {}) + # + # @param external_bank_account_token [String] + # + # @param verification_method [Symbol, Lithic::Models::ExternalBankAccountSetVerificationMethodParams::VerificationMethod] The verification method to set for the external bank account + # + # @param financial_account_token [String] The financial account token of the operating account to fund the micro deposits. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::ExternalBankAccount] + # + # @see Lithic::Models::ExternalBankAccountSetVerificationMethodParams + def set_verification_method(external_bank_account_token, params) + parsed, options = Lithic::ExternalBankAccountSetVerificationMethodParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/external_bank_accounts/%1$s/set_verification_method", external_bank_account_token], + body: parsed, + model: Lithic::ExternalBankAccount, + options: options + ) + end + + # Unpause an external bank account + # + # @overload unpause(external_bank_account_token, request_options: {}) + # + # @param external_bank_account_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::ExternalBankAccount] + # + # @see Lithic::Models::ExternalBankAccountUnpauseParams + def unpause(external_bank_account_token, params = {}) + @client.request( + method: :post, + path: ["v1/external_bank_accounts/%1$s/unpause", external_bank_account_token], + model: Lithic::ExternalBankAccount, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @micro_deposits = Lithic::Resources::ExternalBankAccounts::MicroDeposits.new(client: client) + end + end + end +end diff --git a/lib/lithic/resources/external_bank_accounts/micro_deposits.rb b/lib/lithic/resources/external_bank_accounts/micro_deposits.rb new file mode 100644 index 00000000..22ea5af6 --- /dev/null +++ b/lib/lithic/resources/external_bank_accounts/micro_deposits.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class ExternalBankAccounts + class MicroDeposits + # Verify the external bank account by providing the micro deposit amounts. + # + # @overload create(external_bank_account_token, micro_deposits:, request_options: {}) + # + # @param external_bank_account_token [String] + # @param micro_deposits [Array] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse] + # + # @see Lithic::Models::ExternalBankAccounts::MicroDepositCreateParams + def create(external_bank_account_token, params) + parsed, options = Lithic::ExternalBankAccounts::MicroDepositCreateParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/external_bank_accounts/%1$s/micro_deposits", external_bank_account_token], + body: parsed, + model: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/external_payments.rb b/lib/lithic/resources/external_payments.rb new file mode 100644 index 00000000..71194e87 --- /dev/null +++ b/lib/lithic/resources/external_payments.rb @@ -0,0 +1,226 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class ExternalPayments + # Some parameter documentations has been truncated, see + # {Lithic::Models::ExternalPaymentCreateParams} for more details. + # + # Create external payment + # + # @overload create(amount:, category:, effective_date:, financial_account_token:, payment_type:, token: nil, memo: nil, progress_to: nil, user_defined_id: nil, request_options: {}) + # + # @param amount [Integer] + # + # @param category [Symbol, Lithic::Models::ExternalPaymentCreateParams::Category] + # + # @param effective_date [Date] + # + # @param financial_account_token [String] + # + # @param payment_type [Symbol, Lithic::Models::ExternalPaymentCreateParams::PaymentType] + # + # @param token [String] Customer-provided token that will serve as an idempotency token. This token will + # + # @param memo [String] + # + # @param progress_to [Symbol, Lithic::Models::ExternalPaymentCreateParams::ProgressTo] + # + # @param user_defined_id [String] + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::ExternalPayment] + # + # @see Lithic::Models::ExternalPaymentCreateParams + def create(params) + parsed, options = Lithic::ExternalPaymentCreateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/external_payments", + body: parsed, + model: Lithic::ExternalPayment, + options: options + ) + end + + # Get external payment + # + # @overload retrieve(external_payment_token, request_options: {}) + # + # @param external_payment_token [String] Globally unique identifier for the external payment + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::ExternalPayment] + # + # @see Lithic::Models::ExternalPaymentRetrieveParams + def retrieve(external_payment_token, params = {}) + @client.request( + method: :get, + path: ["v1/external_payments/%1$s", external_payment_token], + model: Lithic::ExternalPayment, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::ExternalPaymentListParams} for more details. + # + # List external payments + # + # @overload list(begin_: nil, business_account_token: nil, category: nil, end_: nil, ending_before: nil, financial_account_token: nil, page_size: nil, result: nil, starting_after: nil, status: nil, request_options: {}) + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param business_account_token [String] + # + # @param category [Symbol, Lithic::Models::ExternalPaymentListParams::Category] External Payment category to be returned. + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param financial_account_token [String] Globally unique identifier for the financial account or card that will send the + # + # @param page_size [Integer] Page size (for pagination). + # + # @param result [Symbol, Lithic::Models::ExternalPaymentListParams::Result] External Payment result to be returned. + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param status [Symbol, Lithic::Models::ExternalPaymentListParams::Status] Book transfer status to be returned. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::ExternalPaymentListParams + def list(params = {}) + parsed, options = Lithic::ExternalPaymentListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/external_payments", + query: query.transform_keys(begin_: "begin", end_: "end"), + page: Lithic::Internal::CursorPage, + model: Lithic::ExternalPayment, + options: options + ) + end + + # Cancel external payment + # + # @overload cancel(external_payment_token, effective_date:, memo: nil, request_options: {}) + # + # @param external_payment_token [String] Globally unique identifier for the external payment + # + # @param effective_date [Date] + # + # @param memo [String] + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::ExternalPayment] + # + # @see Lithic::Models::ExternalPaymentCancelParams + def cancel(external_payment_token, params) + parsed, options = Lithic::ExternalPaymentCancelParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/external_payments/%1$s/cancel", external_payment_token], + body: parsed, + model: Lithic::ExternalPayment, + options: options + ) + end + + # Release external payment + # + # @overload release(external_payment_token, effective_date:, memo: nil, request_options: {}) + # + # @param external_payment_token [String] Globally unique identifier for the external payment + # + # @param effective_date [Date] + # + # @param memo [String] + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::ExternalPayment] + # + # @see Lithic::Models::ExternalPaymentReleaseParams + def release(external_payment_token, params) + parsed, options = Lithic::ExternalPaymentReleaseParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/external_payments/%1$s/release", external_payment_token], + body: parsed, + model: Lithic::ExternalPayment, + options: options + ) + end + + # Reverse external payment + # + # @overload reverse(external_payment_token, effective_date:, memo: nil, request_options: {}) + # + # @param external_payment_token [String] Globally unique identifier for the external payment + # + # @param effective_date [Date] + # + # @param memo [String] + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::ExternalPayment] + # + # @see Lithic::Models::ExternalPaymentReverseParams + def reverse(external_payment_token, params) + parsed, options = Lithic::ExternalPaymentReverseParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/external_payments/%1$s/reverse", external_payment_token], + body: parsed, + model: Lithic::ExternalPayment, + options: options + ) + end + + # Settle external payment + # + # @overload settle(external_payment_token, effective_date:, memo: nil, progress_to: nil, request_options: {}) + # + # @param external_payment_token [String] Globally unique identifier for the external payment + # + # @param effective_date [Date] + # + # @param memo [String] + # + # @param progress_to [Symbol, Lithic::Models::ExternalPaymentSettleParams::ProgressTo] + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::ExternalPayment] + # + # @see Lithic::Models::ExternalPaymentSettleParams + def settle(external_payment_token, params) + parsed, options = Lithic::ExternalPaymentSettleParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/external_payments/%1$s/settle", external_payment_token], + body: parsed, + model: Lithic::ExternalPayment, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/financial_accounts.rb b/lib/lithic/resources/financial_accounts.rb new file mode 100644 index 00000000..c691d921 --- /dev/null +++ b/lib/lithic/resources/financial_accounts.rb @@ -0,0 +1,197 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class FinancialAccounts + # @return [Lithic::Resources::FinancialAccounts::Balances] + attr_reader :balances + + # @return [Lithic::Resources::FinancialAccounts::FinancialTransactions] + attr_reader :financial_transactions + + # @return [Lithic::Resources::FinancialAccounts::CreditConfiguration] + attr_reader :credit_configuration + + # @return [Lithic::Resources::FinancialAccounts::Statements] + attr_reader :statements + + # @return [Lithic::Resources::FinancialAccounts::LoanTapes] + attr_reader :loan_tapes + + # @return [Lithic::Resources::FinancialAccounts::LoanTapeConfiguration] + attr_reader :loan_tape_configuration + + # @return [Lithic::Resources::FinancialAccounts::InterestTierSchedule] + attr_reader :interest_tier_schedule + + # Create a new financial account + # + # @overload create(nickname:, type:, account_token: nil, is_for_benefit_of: nil, idempotency_key: nil, request_options: {}) + # + # @param nickname [String] Body param + # + # @param type [Symbol, Lithic::Models::FinancialAccountCreateParams::Type] Body param + # + # @param account_token [String] Body param + # + # @param is_for_benefit_of [Boolean] Body param + # + # @param idempotency_key [String] Header param: Idempotency key for the request + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::FinancialAccount] + # + # @see Lithic::Models::FinancialAccountCreateParams + def create(params) + parsed, options = Lithic::FinancialAccountCreateParams.dump_request(params) + header_params = {idempotency_key: "idempotency-key"} + @client.request( + method: :post, + path: "v1/financial_accounts", + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), + model: Lithic::FinancialAccount, + options: options + ) + end + + # Get a financial account + # + # @overload retrieve(financial_account_token, request_options: {}) + # + # @param financial_account_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::FinancialAccount] + # + # @see Lithic::Models::FinancialAccountRetrieveParams + def retrieve(financial_account_token, params = {}) + @client.request( + method: :get, + path: ["v1/financial_accounts/%1$s", financial_account_token], + model: Lithic::FinancialAccount, + options: params[:request_options] + ) + end + + # Update a financial account + # + # @overload update(financial_account_token, nickname: nil, request_options: {}) + # + # @param financial_account_token [String] + # @param nickname [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::FinancialAccount] + # + # @see Lithic::Models::FinancialAccountUpdateParams + def update(financial_account_token, params = {}) + parsed, options = Lithic::FinancialAccountUpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["v1/financial_accounts/%1$s", financial_account_token], + body: parsed, + model: Lithic::FinancialAccount, + options: options + ) + end + + # Retrieve information on your financial accounts including routing and account + # number. + # + # @overload list(account_token: nil, business_account_token: nil, type: nil, request_options: {}) + # + # @param account_token [String] List financial accounts for a given account_token or business_account_token + # + # @param business_account_token [String] List financial accounts for a given business_account_token + # + # @param type [Symbol, Lithic::Models::FinancialAccountListParams::Type] List financial accounts of a given type + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::SinglePage] + # + # @see Lithic::Models::FinancialAccountListParams + def list(params = {}) + parsed, options = Lithic::FinancialAccountListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/financial_accounts", + query: query, + page: Lithic::Internal::SinglePage, + model: Lithic::FinancialAccount, + options: options + ) + end + + # Register account number + # + # @overload register_account_number(financial_account_token, account_number:, request_options: {}) + # + # @param financial_account_token [String] Globally unique identifier for financial account. + # + # @param account_number [String] + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Lithic::Models::FinancialAccountRegisterAccountNumberParams + def register_account_number(financial_account_token, params) + parsed, options = Lithic::FinancialAccountRegisterAccountNumberParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/financial_accounts/%1$s/register_account_number", financial_account_token], + body: parsed, + model: NilClass, + options: options + ) + end + + # Update financial account status + # + # @overload update_status(financial_account_token, status:, substatus:, user_defined_status: nil, request_options: {}) + # + # @param financial_account_token [String] Globally unique identifier for financial account. + # + # @param status [Symbol, Lithic::Models::FinancialAccountUpdateStatusParams::Status] Status of the financial account + # + # @param substatus [Symbol, Lithic::Models::FinancialAccountUpdateStatusParams::Substatus, nil] Substatus for the financial account + # + # @param user_defined_status [String] User-defined status for the financial account + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::FinancialAccount] + # + # @see Lithic::Models::FinancialAccountUpdateStatusParams + def update_status(financial_account_token, params) + parsed, options = Lithic::FinancialAccountUpdateStatusParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/financial_accounts/%1$s/update_status", financial_account_token], + body: parsed, + model: Lithic::FinancialAccount, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @balances = Lithic::Resources::FinancialAccounts::Balances.new(client: client) + @financial_transactions = Lithic::Resources::FinancialAccounts::FinancialTransactions.new(client: client) + @credit_configuration = Lithic::Resources::FinancialAccounts::CreditConfiguration.new(client: client) + @statements = Lithic::Resources::FinancialAccounts::Statements.new(client: client) + @loan_tapes = Lithic::Resources::FinancialAccounts::LoanTapes.new(client: client) + @loan_tape_configuration = + Lithic::Resources::FinancialAccounts::LoanTapeConfiguration.new(client: client) + @interest_tier_schedule = Lithic::Resources::FinancialAccounts::InterestTierSchedule.new(client: client) + end + end + end +end diff --git a/lib/lithic/resources/financial_accounts/balances.rb b/lib/lithic/resources/financial_accounts/balances.rb new file mode 100644 index 00000000..2656a71d --- /dev/null +++ b/lib/lithic/resources/financial_accounts/balances.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class FinancialAccounts + class Balances + # Some parameter documentations has been truncated, see + # {Lithic::Models::FinancialAccounts::BalanceListParams} for more details. + # + # Get the balances for a given financial account. + # + # @overload list(financial_account_token, balance_date: nil, last_transaction_event_token: nil, request_options: {}) + # + # @param financial_account_token [String] Globally unique identifier for financial account. + # + # @param balance_date [Time] UTC date of the balance to retrieve. Defaults to latest available balance + # + # @param last_transaction_event_token [String] Balance after a given financial event occured. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::SinglePage] + # + # @see Lithic::Models::FinancialAccounts::BalanceListParams + def list(financial_account_token, params = {}) + parsed, options = Lithic::FinancialAccounts::BalanceListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["v1/financial_accounts/%1$s/balances", financial_account_token], + query: query, + page: Lithic::Internal::SinglePage, + model: Lithic::FinancialAccountBalance, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/financial_accounts/credit_configuration.rb b/lib/lithic/resources/financial_accounts/credit_configuration.rb new file mode 100644 index 00000000..47913448 --- /dev/null +++ b/lib/lithic/resources/financial_accounts/credit_configuration.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class FinancialAccounts + class CreditConfiguration + # Get an Account's credit configuration + # + # @overload retrieve(financial_account_token, request_options: {}) + # + # @param financial_account_token [String] Globally unique identifier for financial account. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig] + # + # @see Lithic::Models::FinancialAccounts::CreditConfigurationRetrieveParams + def retrieve(financial_account_token, params = {}) + @client.request( + method: :get, + path: ["v1/financial_accounts/%1$s/credit_configuration", financial_account_token], + model: Lithic::FinancialAccounts::FinancialAccountCreditConfig, + options: params[:request_options] + ) + end + + # Update an account's credit configuration + # + # @overload update(financial_account_token, auto_collection_configuration: nil, credit_limit: nil, credit_product_token: nil, external_bank_account_token: nil, tier: nil, request_options: {}) + # + # @param financial_account_token [String] Globally unique identifier for financial account. + # + # @param auto_collection_configuration [Lithic::Models::FinancialAccounts::CreditConfigurationUpdateParams::AutoCollectionConfiguration] + # + # @param credit_limit [Integer] + # + # @param credit_product_token [String] Globally unique identifier for the credit product + # + # @param external_bank_account_token [String] + # + # @param tier [String] Tier to assign to a financial account + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::FinancialAccounts::FinancialAccountCreditConfig] + # + # @see Lithic::Models::FinancialAccounts::CreditConfigurationUpdateParams + def update(financial_account_token, params = {}) + parsed, options = Lithic::FinancialAccounts::CreditConfigurationUpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["v1/financial_accounts/%1$s/credit_configuration", financial_account_token], + body: parsed, + model: Lithic::FinancialAccounts::FinancialAccountCreditConfig, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/financial_accounts/financial_transactions.rb b/lib/lithic/resources/financial_accounts/financial_transactions.rb new file mode 100644 index 00000000..c8bf3104 --- /dev/null +++ b/lib/lithic/resources/financial_accounts/financial_transactions.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class FinancialAccounts + class FinancialTransactions + # Get the financial transaction for the provided token. + # + # @overload retrieve(financial_transaction_token, financial_account_token:, request_options: {}) + # + # @param financial_transaction_token [String] Globally unique identifier for financial transaction token. + # + # @param financial_account_token [String] Globally unique identifier for financial account. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::FinancialTransaction] + # + # @see Lithic::Models::FinancialAccounts::FinancialTransactionRetrieveParams + def retrieve(financial_transaction_token, params) + parsed, options = Lithic::FinancialAccounts::FinancialTransactionRetrieveParams.dump_request(params) + financial_account_token = + parsed.delete(:financial_account_token) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :get, + path: [ + "v1/financial_accounts/%1$s/financial_transactions/%2$s", + financial_account_token, + financial_transaction_token + ], + model: Lithic::FinancialTransaction, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::FinancialAccounts::FinancialTransactionListParams} for more + # details. + # + # List the financial transactions for a given financial account. + # + # @overload list(financial_account_token, begin_: nil, category: nil, end_: nil, ending_before: nil, result: nil, starting_after: nil, status: nil, request_options: {}) + # + # @param financial_account_token [String] Globally unique identifier for financial account. + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param category [Symbol, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Category] Financial Transaction category to be returned. + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param result [Symbol, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Result] Financial Transaction result to be returned. + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param status [Symbol, Lithic::Models::FinancialAccounts::FinancialTransactionListParams::Status] Financial Transaction status to be returned. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::SinglePage] + # + # @see Lithic::Models::FinancialAccounts::FinancialTransactionListParams + def list(financial_account_token, params = {}) + parsed, options = Lithic::FinancialAccounts::FinancialTransactionListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["v1/financial_accounts/%1$s/financial_transactions", financial_account_token], + query: query.transform_keys(begin_: "begin", end_: "end"), + page: Lithic::Internal::SinglePage, + model: Lithic::FinancialTransaction, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/financial_accounts/interest_tier_schedule.rb b/lib/lithic/resources/financial_accounts/interest_tier_schedule.rb new file mode 100644 index 00000000..d02ec074 --- /dev/null +++ b/lib/lithic/resources/financial_accounts/interest_tier_schedule.rb @@ -0,0 +1,210 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class FinancialAccounts + class InterestTierSchedule + # Some parameter documentations has been truncated, see + # {Lithic::Models::FinancialAccounts::InterestTierScheduleCreateParams} for more + # details. + # + # Create a new interest tier schedule entry for a supported financial account + # + # @overload create(financial_account_token, credit_product_token:, effective_date:, penalty_rates: nil, tier_name: nil, tier_rates: nil, request_options: {}) + # + # @param financial_account_token [String] Globally unique identifier for financial account + # + # @param credit_product_token [String] Globally unique identifier for a credit product + # + # @param effective_date [Date] Date the tier should be effective in YYYY-MM-DD format + # + # @param penalty_rates [Object] Custom rates per category for penalties + # + # @param tier_name [String] Name of a tier contained in the credit product. Mutually exclusive with tier_rat + # + # @param tier_rates [Object] Custom rates per category. Mutually exclusive with tier_name + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::FinancialAccounts::FinancialAccountsInterestTierSchedule] + # + # @see Lithic::Models::FinancialAccounts::InterestTierScheduleCreateParams + def create(financial_account_token, params) + parsed, options = Lithic::FinancialAccounts::InterestTierScheduleCreateParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/financial_accounts/%1$s/interest_tier_schedule", financial_account_token], + body: parsed, + model: Lithic::FinancialAccounts::FinancialAccountsInterestTierSchedule, + options: options + ) + end + + # Get a specific interest tier schedule by effective date + # + # @overload retrieve(effective_date, financial_account_token:, request_options: {}) + # + # @param effective_date [Date] Effective date in ISO format (YYYY-MM-DD) + # + # @param financial_account_token [String] Globally unique identifier for financial account + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::FinancialAccounts::FinancialAccountsInterestTierSchedule] + # + # @see Lithic::Models::FinancialAccounts::InterestTierScheduleRetrieveParams + def retrieve(effective_date, params) + parsed, options = Lithic::FinancialAccounts::InterestTierScheduleRetrieveParams.dump_request(params) + financial_account_token = + parsed.delete(:financial_account_token) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :get, + path: [ + "v1/financial_accounts/%1$s/interest_tier_schedule/%2$s", + financial_account_token, + effective_date + ], + model: Lithic::FinancialAccounts::FinancialAccountsInterestTierSchedule, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::FinancialAccounts::InterestTierScheduleUpdateParams} for more + # details. + # + # Update an existing interest tier schedule + # + # @overload update(effective_date, financial_account_token:, penalty_rates: nil, tier_name: nil, tier_rates: nil, request_options: {}) + # + # @param effective_date [Date] Path param: Effective date in ISO format (YYYY-MM-DD) + # + # @param financial_account_token [String] Path param: Globally unique identifier for financial account + # + # @param penalty_rates [Object] Body param: Custom rates per category for penalties + # + # @param tier_name [String] Body param: Name of a tier contained in the credit product. Mutually exclusive w + # + # @param tier_rates [Object] Body param: Custom rates per category. Mutually exclusive with tier_name + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::FinancialAccounts::FinancialAccountsInterestTierSchedule] + # + # @see Lithic::Models::FinancialAccounts::InterestTierScheduleUpdateParams + def update(effective_date, params) + parsed, options = Lithic::FinancialAccounts::InterestTierScheduleUpdateParams.dump_request(params) + financial_account_token = + parsed.delete(:financial_account_token) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :put, + path: [ + "v1/financial_accounts/%1$s/interest_tier_schedule/%2$s", + financial_account_token, + effective_date + ], + body: parsed, + model: Lithic::FinancialAccounts::FinancialAccountsInterestTierSchedule, + options: options + ) + end + + # List interest tier schedules for a financial account with optional date + # filtering. + # + # If no date parameters are provided, returns all tier schedules. If date + # parameters are provided, uses filtering to return matching schedules (max 100). + # + # - for_date: Returns exact match (takes precedence over other dates) + # - before_date: Returns schedules with effective_date <= before_date + # - after_date: Returns schedules with effective_date >= after_date + # - Both before_date and after_date: Returns schedules in range + # + # @overload list(financial_account_token, after_date: nil, before_date: nil, for_date: nil, request_options: {}) + # + # @param financial_account_token [String] Globally unique identifier for financial account + # + # @param after_date [Date] Return schedules with effective_date >= after_date (ISO format YYYY-MM-DD) + # + # @param before_date [Date] Return schedules with effective_date <= before_date (ISO format YYYY-MM-DD) + # + # @param for_date [Date] Return schedule with effective_date == for_date (ISO format YYYY-MM-DD) + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::SinglePage] + # + # @see Lithic::Models::FinancialAccounts::InterestTierScheduleListParams + def list(financial_account_token, params = {}) + parsed, options = Lithic::FinancialAccounts::InterestTierScheduleListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["v1/financial_accounts/%1$s/interest_tier_schedule", financial_account_token], + query: query, + page: Lithic::Internal::SinglePage, + model: Lithic::FinancialAccounts::FinancialAccountsInterestTierSchedule, + options: options + ) + end + + # Delete an interest tier schedule entry. + # + # Returns: + # + # - 400 Bad Request: Invalid effective_date format OR attempting to delete the + # earliest tier schedule entry for a non-PENDING account + # - 404 Not Found: Tier schedule entry not found for the given effective_date OR + # ledger account not found + # + # Note: PENDING accounts can delete the earliest tier schedule entry (account + # hasn't opened yet). Active/non-PENDING accounts cannot delete the earliest entry + # to prevent orphaning the account. + # + # If the deleted tier schedule has a past effective_date and the account is + # ACTIVE, the loan tape rebuild configuration will be updated to trigger rebuilds + # from that date. + # + # @overload delete(effective_date, financial_account_token:, request_options: {}) + # + # @param effective_date [Date] Effective date in ISO format (YYYY-MM-DD) + # + # @param financial_account_token [String] Globally unique identifier for financial account + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Lithic::Models::FinancialAccounts::InterestTierScheduleDeleteParams + def delete(effective_date, params) + parsed, options = Lithic::FinancialAccounts::InterestTierScheduleDeleteParams.dump_request(params) + financial_account_token = + parsed.delete(:financial_account_token) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :delete, + path: [ + "v1/financial_accounts/%1$s/interest_tier_schedule/%2$s", + financial_account_token, + effective_date + ], + model: NilClass, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/financial_accounts/loan_tape_configuration.rb b/lib/lithic/resources/financial_accounts/loan_tape_configuration.rb new file mode 100644 index 00000000..333d4a04 --- /dev/null +++ b/lib/lithic/resources/financial_accounts/loan_tape_configuration.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class FinancialAccounts + class LoanTapeConfiguration + # Get the loan tape configuration for a given financial account. + # + # @overload retrieve(financial_account_token, request_options: {}) + # + # @param financial_account_token [String] Globally unique identifier for financial account. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::FinancialAccounts::FinancialAccountsLoanTapeConfiguration] + # + # @see Lithic::Models::FinancialAccounts::LoanTapeConfigurationRetrieveParams + def retrieve(financial_account_token, params = {}) + @client.request( + method: :get, + path: ["v1/financial_accounts/%1$s/loan_tape_configuration", financial_account_token], + model: Lithic::FinancialAccounts::FinancialAccountsLoanTapeConfiguration, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/financial_accounts/loan_tapes.rb b/lib/lithic/resources/financial_accounts/loan_tapes.rb new file mode 100644 index 00000000..9fdde99c --- /dev/null +++ b/lib/lithic/resources/financial_accounts/loan_tapes.rb @@ -0,0 +1,80 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class FinancialAccounts + class LoanTapes + # Get a specific loan tape for a given financial account. + # + # @overload retrieve(loan_tape_token, financial_account_token:, request_options: {}) + # + # @param loan_tape_token [String] Globally unique identifier for loan tape. + # + # @param financial_account_token [String] Globally unique identifier for financial account. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::FinancialAccounts::LoanTape] + # + # @see Lithic::Models::FinancialAccounts::LoanTapeRetrieveParams + def retrieve(loan_tape_token, params) + parsed, options = Lithic::FinancialAccounts::LoanTapeRetrieveParams.dump_request(params) + financial_account_token = + parsed.delete(:financial_account_token) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :get, + path: ["v1/financial_accounts/%1$s/loan_tapes/%2$s", financial_account_token, loan_tape_token], + model: Lithic::FinancialAccounts::LoanTape, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::FinancialAccounts::LoanTapeListParams} for more details. + # + # List the loan tapes for a given financial account. + # + # @overload list(financial_account_token, begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # + # @param financial_account_token [String] Globally unique identifier for financial account. + # + # @param begin_ [Date] Date string in RFC 3339 format. Only entries created after the specified date wi + # + # @param end_ [Date] Date string in RFC 3339 format. Only entries created before the specified date w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::FinancialAccounts::LoanTapeListParams + def list(financial_account_token, params = {}) + parsed, options = Lithic::FinancialAccounts::LoanTapeListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["v1/financial_accounts/%1$s/loan_tapes", financial_account_token], + query: query.transform_keys(begin_: "begin", end_: "end"), + page: Lithic::Internal::CursorPage, + model: Lithic::FinancialAccounts::LoanTape, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/financial_accounts/statements.rb b/lib/lithic/resources/financial_accounts/statements.rb new file mode 100644 index 00000000..9a9beefa --- /dev/null +++ b/lib/lithic/resources/financial_accounts/statements.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class FinancialAccounts + class Statements + # @return [Lithic::Resources::FinancialAccounts::Statements::LineItems] + attr_reader :line_items + + # Get a specific statement for a given financial account. + # + # @overload retrieve(statement_token, financial_account_token:, request_options: {}) + # + # @param statement_token [String] Globally unique identifier for statements. + # + # @param financial_account_token [String] Globally unique identifier for financial account. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::FinancialAccounts::Statement] + # + # @see Lithic::Models::FinancialAccounts::StatementRetrieveParams + def retrieve(statement_token, params) + parsed, options = Lithic::FinancialAccounts::StatementRetrieveParams.dump_request(params) + financial_account_token = + parsed.delete(:financial_account_token) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :get, + path: ["v1/financial_accounts/%1$s/statements/%2$s", financial_account_token, statement_token], + model: Lithic::FinancialAccounts::Statement, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::FinancialAccounts::StatementListParams} for more details. + # + # List the statements for a given financial account. + # + # @overload list(financial_account_token, begin_: nil, end_: nil, ending_before: nil, include_initial_statements: nil, page_size: nil, starting_after: nil, request_options: {}) + # + # @param financial_account_token [String] Globally unique identifier for financial account. + # + # @param begin_ [Date] Date string in RFC 3339 format. Only entries created after the specified date wi + # + # @param end_ [Date] Date string in RFC 3339 format. Only entries created before the specified date w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param include_initial_statements [Boolean] Whether to include the initial statement. It is not included by default. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::FinancialAccounts::StatementListParams + def list(financial_account_token, params = {}) + parsed, options = Lithic::FinancialAccounts::StatementListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["v1/financial_accounts/%1$s/statements", financial_account_token], + query: query.transform_keys(begin_: "begin", end_: "end"), + page: Lithic::Internal::CursorPage, + model: Lithic::FinancialAccounts::Statement, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @line_items = Lithic::Resources::FinancialAccounts::Statements::LineItems.new(client: client) + end + end + end + end +end diff --git a/lib/lithic/resources/financial_accounts/statements/line_items.rb b/lib/lithic/resources/financial_accounts/statements/line_items.rb new file mode 100644 index 00000000..a181fe49 --- /dev/null +++ b/lib/lithic/resources/financial_accounts/statements/line_items.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class FinancialAccounts + class Statements + class LineItems + # Some parameter documentations has been truncated, see + # {Lithic::Models::FinancialAccounts::Statements::LineItemListParams} for more + # details. + # + # List the line items for a given statement within a given financial account. + # + # @overload list(statement_token, financial_account_token:, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # + # @param statement_token [String] Path param: Globally unique identifier for statements. + # + # @param financial_account_token [String] Path param: Globally unique identifier for financial account. + # + # @param ending_before [String] Query param: A cursor representing an item's token before which a page of result + # + # @param page_size [Integer] Query param: Page size (for pagination). + # + # @param starting_after [String] Query param: A cursor representing an item's token after which a page of results + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::FinancialAccounts::Statements::LineItemListParams + def list(statement_token, params) + parsed, options = Lithic::FinancialAccounts::Statements::LineItemListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + financial_account_token = + parsed.delete(:financial_account_token) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :get, + path: [ + "v1/financial_accounts/%1$s/statements/%2$s/line_items", + financial_account_token, + statement_token + ], + query: query, + page: Lithic::Internal::CursorPage, + model: Lithic::FinancialAccounts::Statements::StatementLineItems::Data, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end + end +end diff --git a/lib/lithic/resources/fraud.rb b/lib/lithic/resources/fraud.rb new file mode 100644 index 00000000..3344e26b --- /dev/null +++ b/lib/lithic/resources/fraud.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Fraud + # @return [Lithic::Resources::Fraud::Transactions] + attr_reader :transactions + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @transactions = Lithic::Resources::Fraud::Transactions.new(client: client) + end + end + end +end diff --git a/lib/lithic/resources/fraud/transactions.rb b/lib/lithic/resources/fraud/transactions.rb new file mode 100644 index 00000000..425c58ec --- /dev/null +++ b/lib/lithic/resources/fraud/transactions.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Fraud + class Transactions + # Retrieve a fraud report for a specific transaction identified by its unique + # transaction token. + # + # @overload retrieve(transaction_token, request_options: {}) + # + # @param transaction_token [String] The token of the transaction that the enhanced data is associated with. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Fraud::TransactionRetrieveResponse] + # + # @see Lithic::Models::Fraud::TransactionRetrieveParams + def retrieve(transaction_token, params = {}) + @client.request( + method: :get, + path: ["v1/fraud/transactions/%1$s", transaction_token], + model: Lithic::Models::Fraud::TransactionRetrieveResponse, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::Fraud::TransactionReportParams} for more details. + # + # Report fraud for a specific transaction token by providing details such as fraud + # type, fraud status, and any additional comments. + # + # @overload report(transaction_token, fraud_status:, comment: nil, fraud_type: nil, request_options: {}) + # + # @param transaction_token [String] The token of the transaction that the enhanced data is associated with. + # + # @param fraud_status [Symbol, Lithic::Models::Fraud::TransactionReportParams::FraudStatus] The fraud status of the transaction, string (enum) supporting the following valu + # + # @param comment [String] Optional field providing additional information or context about why the transac + # + # @param fraud_type [Symbol, Lithic::Models::Fraud::TransactionReportParams::FraudType] Specifies the type or category of fraud that the transaction is suspected or con + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Fraud::TransactionReportResponse] + # + # @see Lithic::Models::Fraud::TransactionReportParams + def report(transaction_token, params) + parsed, options = Lithic::Fraud::TransactionReportParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/fraud/transactions/%1$s", transaction_token], + body: parsed, + model: Lithic::Models::Fraud::TransactionReportResponse, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/funding_events.rb b/lib/lithic/resources/funding_events.rb new file mode 100644 index 00000000..c7de4e29 --- /dev/null +++ b/lib/lithic/resources/funding_events.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class FundingEvents + # Get funding event for program by id + # + # @overload retrieve(funding_event_token, request_options: {}) + # + # @param funding_event_token [String] Globally unique identifier for funding event. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::FundingEvent] + # + # @see Lithic::Models::FundingEventRetrieveParams + def retrieve(funding_event_token, params = {}) + @client.request( + method: :get, + path: ["v1/funding_events/%1$s", funding_event_token], + model: Lithic::FundingEvent, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::FundingEventListParams} for more details. + # + # Get all funding events for program + # + # @overload list(ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::FundingEventListParams + def list(params = {}) + parsed, options = Lithic::FundingEventListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/funding_events", + query: query, + page: Lithic::Internal::CursorPage, + model: Lithic::FundingEvent, + options: options + ) + end + + # Get funding event details by id + # + # @overload retrieve_details(funding_event_token, request_options: {}) + # + # @param funding_event_token [String] Globally unique identifier for funding event. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::FundingEventRetrieveDetailsResponse] + # + # @see Lithic::Models::FundingEventRetrieveDetailsParams + def retrieve_details(funding_event_token, params = {}) + @client.request( + method: :get, + path: ["v1/funding_events/%1$s/details", funding_event_token], + model: Lithic::Models::FundingEventRetrieveDetailsResponse, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/holds.rb b/lib/lithic/resources/holds.rb new file mode 100644 index 00000000..a7e47a1d --- /dev/null +++ b/lib/lithic/resources/holds.rb @@ -0,0 +1,132 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Holds + # Create a hold on a financial account. Holds reserve funds by moving them from + # available to pending balance. They can be resolved via settlement (linked to a + # payment or book transfer), voiding, or expiration. + # + # @overload create(financial_account_token, amount:, token: nil, expiration_datetime: nil, memo: nil, user_defined_id: nil, request_options: {}) + # + # @param financial_account_token [String] Globally unique identifier for the financial account. + # + # @param amount [Integer] Amount to hold in cents + # + # @param token [String] Customer-provided token for idempotency. Becomes the hold token. + # + # @param expiration_datetime [Time] When the hold should auto-expire + # + # @param memo [String, nil] Reason for the hold + # + # @param user_defined_id [String] User-provided identifier for the hold + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Hold] + # + # @see Lithic::Models::HoldCreateParams + def create(financial_account_token, params) + parsed, options = Lithic::HoldCreateParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/financial_accounts/%1$s/holds", financial_account_token], + body: parsed, + model: Lithic::Hold, + options: options + ) + end + + # Get hold by token. + # + # @overload retrieve(hold_token, request_options: {}) + # + # @param hold_token [String] Globally unique identifier for the hold. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Hold] + # + # @see Lithic::Models::HoldRetrieveParams + def retrieve(hold_token, params = {}) + @client.request( + method: :get, + path: ["v1/holds/%1$s", hold_token], + model: Lithic::Hold, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::HoldListParams} for more details. + # + # List holds for a financial account. + # + # @overload list(financial_account_token, begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, status: nil, request_options: {}) + # + # @param financial_account_token [String] Globally unique identifier for the financial account. + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param status [Symbol, Lithic::Models::HoldListParams::Status] Hold status to filter by. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::HoldListParams + def list(financial_account_token, params = {}) + parsed, options = Lithic::HoldListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["v1/financial_accounts/%1$s/holds", financial_account_token], + query: query.transform_keys(begin_: "begin", end_: "end"), + page: Lithic::Internal::CursorPage, + model: Lithic::Hold, + options: options + ) + end + + # Void an active hold. This returns the held funds from pending back to available + # balance. Only holds in PENDING status can be voided. + # + # @overload void(hold_token, memo: nil, request_options: {}) + # + # @param hold_token [String] Globally unique identifier for the hold. + # + # @param memo [String, nil] Reason for voiding the hold + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Hold] + # + # @see Lithic::Models::HoldVoidParams + def void(hold_token, params = {}) + parsed, options = Lithic::HoldVoidParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/holds/%1$s/void", hold_token], + body: parsed, + model: Lithic::Hold, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/internal_transaction.rb b/lib/lithic/resources/internal_transaction.rb new file mode 100644 index 00000000..436842d3 --- /dev/null +++ b/lib/lithic/resources/internal_transaction.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class InternalTransaction + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/management_operations.rb b/lib/lithic/resources/management_operations.rb new file mode 100644 index 00000000..9bf5599d --- /dev/null +++ b/lib/lithic/resources/management_operations.rb @@ -0,0 +1,148 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class ManagementOperations + # Some parameter documentations has been truncated, see + # {Lithic::Models::ManagementOperationCreateParams} for more details. + # + # Create management operation + # + # @overload create(amount:, category:, direction:, effective_date:, event_type:, financial_account_token:, token: nil, memo: nil, on_closed_account: nil, subtype: nil, user_defined_id: nil, request_options: {}) + # + # @param amount [Integer] + # + # @param category [Symbol, Lithic::Models::ManagementOperationCreateParams::Category] + # + # @param direction [Symbol, Lithic::Models::ManagementOperationCreateParams::Direction] + # + # @param effective_date [Date] + # + # @param event_type [Symbol, Lithic::Models::ManagementOperationCreateParams::EventType] + # + # @param financial_account_token [String] + # + # @param token [String] Customer-provided token that will serve as an idempotency token. This token will + # + # @param memo [String] + # + # @param on_closed_account [Symbol, Lithic::Models::ManagementOperationCreateParams::OnClosedAccount] What to do if the financial account is closed when posting an operation + # + # @param subtype [String] + # + # @param user_defined_id [String] + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::ManagementOperationTransaction] + # + # @see Lithic::Models::ManagementOperationCreateParams + def create(params) + parsed, options = Lithic::ManagementOperationCreateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/management_operations", + body: parsed, + model: Lithic::ManagementOperationTransaction, + options: options + ) + end + + # Get management operation + # + # @overload retrieve(management_operation_token, request_options: {}) + # + # @param management_operation_token [String] Globally unique identifier for the management operation + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::ManagementOperationTransaction] + # + # @see Lithic::Models::ManagementOperationRetrieveParams + def retrieve(management_operation_token, params = {}) + @client.request( + method: :get, + path: ["v1/management_operations/%1$s", management_operation_token], + model: Lithic::ManagementOperationTransaction, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::ManagementOperationListParams} for more details. + # + # List management operations + # + # @overload list(begin_: nil, business_account_token: nil, category: nil, end_: nil, ending_before: nil, financial_account_token: nil, page_size: nil, starting_after: nil, status: nil, request_options: {}) + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param business_account_token [String] + # + # @param category [Symbol, Lithic::Models::ManagementOperationListParams::Category] Management operation category to be returned. + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param financial_account_token [String] Globally unique identifier for the financial account. Accepted type dependent on + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param status [Symbol, Lithic::Models::ManagementOperationListParams::Status] Management operation status to be returned. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::ManagementOperationListParams + def list(params = {}) + parsed, options = Lithic::ManagementOperationListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/management_operations", + query: query.transform_keys(begin_: "begin", end_: "end"), + page: Lithic::Internal::CursorPage, + model: Lithic::ManagementOperationTransaction, + options: options + ) + end + + # Reverse a management operation + # + # @overload reverse(management_operation_token, effective_date:, memo: nil, request_options: {}) + # + # @param management_operation_token [String] Globally unique identifier for the management operation + # + # @param effective_date [Date] + # + # @param memo [String] + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::ManagementOperationTransaction] + # + # @see Lithic::Models::ManagementOperationReverseParams + def reverse(management_operation_token, params) + parsed, options = Lithic::ManagementOperationReverseParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/management_operations/%1$s/reverse", management_operation_token], + body: parsed, + model: Lithic::ManagementOperationTransaction, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/network_programs.rb b/lib/lithic/resources/network_programs.rb new file mode 100644 index 00000000..e8fa57e0 --- /dev/null +++ b/lib/lithic/resources/network_programs.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class NetworkPrograms + # Get network program. + # + # @overload retrieve(network_program_token, request_options: {}) + # + # @param network_program_token [String] Globally unique identifier for the network program. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::NetworkProgram] + # + # @see Lithic::Models::NetworkProgramRetrieveParams + def retrieve(network_program_token, params = {}) + @client.request( + method: :get, + path: ["v1/network_programs/%1$s", network_program_token], + model: Lithic::NetworkProgram, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::NetworkProgramListParams} for more details. + # + # List network programs. + # + # @overload list(begin_: nil, end_: nil, page_size: nil, request_options: {}) + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param page_size [Integer] Page size (for pagination). + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::SinglePage] + # + # @see Lithic::Models::NetworkProgramListParams + def list(params = {}) + parsed, options = Lithic::NetworkProgramListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/network_programs", + query: query.transform_keys(begin_: "begin", end_: "end"), + page: Lithic::Internal::SinglePage, + model: Lithic::NetworkProgram, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/payments.rb b/lib/lithic/resources/payments.rb new file mode 100644 index 00000000..7f12f251 --- /dev/null +++ b/lib/lithic/resources/payments.rb @@ -0,0 +1,301 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Payments + # Some parameter documentations has been truncated, see + # {Lithic::Models::PaymentCreateParams} for more details. + # + # Initiates a payment between a financial account and an external bank account. + # + # @overload create(amount:, external_bank_account_token:, financial_account_token:, method_:, method_attributes:, type:, token: nil, hold: nil, memo: nil, user_defined_id: nil, request_options: {}) + # + # @param amount [Integer] + # + # @param external_bank_account_token [String] + # + # @param financial_account_token [String] + # + # @param method_ [Symbol, Lithic::Models::PaymentCreateParams::Method] + # + # @param method_attributes [Lithic::Models::PaymentCreateParams::MethodAttributes] + # + # @param type [Symbol, Lithic::Models::PaymentCreateParams::Type] + # + # @param token [String] Customer-provided token that will serve as an idempotency token. This token will + # + # @param hold [Lithic::Models::PaymentCreateParams::Hold] Optional hold to settle when this payment is initiated. + # + # @param memo [String] + # + # @param user_defined_id [String] + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::PaymentCreateResponse] + # + # @see Lithic::Models::PaymentCreateParams + def create(params) + parsed, options = Lithic::PaymentCreateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/payments", + body: parsed, + model: Lithic::Models::PaymentCreateResponse, + options: options + ) + end + + # Get the payment by token. + # + # @overload retrieve(payment_token, request_options: {}) + # + # @param payment_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Payment] + # + # @see Lithic::Models::PaymentRetrieveParams + def retrieve(payment_token, params = {}) + @client.request( + method: :get, + path: ["v1/payments/%1$s", payment_token], + model: Lithic::Payment, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::PaymentListParams} for more details. + # + # List all the payments for the provided search criteria. + # + # @overload list(account_token: nil, begin_: nil, business_account_token: nil, category: nil, end_: nil, ending_before: nil, financial_account_token: nil, page_size: nil, result: nil, starting_after: nil, status: nil, request_options: {}) + # + # @param account_token [String] + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param business_account_token [String] + # + # @param category [Symbol, Lithic::Models::PaymentListParams::Category] + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param financial_account_token [String] + # + # @param page_size [Integer] Page size (for pagination). + # + # @param result [Symbol, Lithic::Models::PaymentListParams::Result] + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param status [Symbol, Lithic::Models::PaymentListParams::Status] + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::PaymentListParams + def list(params = {}) + parsed, options = Lithic::PaymentListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/payments", + query: query.transform_keys(begin_: "begin", end_: "end"), + page: Lithic::Internal::CursorPage, + model: Lithic::Payment, + options: options + ) + end + + # Retry an origination which has been returned. + # + # @overload retry_(payment_token, request_options: {}) + # + # @param payment_token [String] + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::PaymentRetryResponse] + # + # @see Lithic::Models::PaymentRetryParams + def retry_(payment_token, params = {}) + @client.request( + method: :post, + path: ["v1/payments/%1$s/retry", payment_token], + model: Lithic::Models::PaymentRetryResponse, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::PaymentReturnParams} for more details. + # + # Return an ACH payment with a specified return reason code. Returns must be + # initiated within the time window specified by NACHA rules for each return code + # (typically 2 banking days for most codes, 60 calendar days for unauthorized + # debits). For a complete list of return codes and their meanings, see the + # [ACH Return Reasons documentation](https://docs.lithic.com/docs/ach-overview#ach-return-reasons). + # + # Note: + # + # - This endpoint does not modify the state of the financial account associated + # with the payment. If you would like to change the account state, use the + # [Update financial account status](https://docs.lithic.com/reference/updatefinancialaccountstatus) + # endpoint. + # - By default this endpoint is not enabled for your account. Please contact your + # implementations manager to enable this feature. + # + # @overload return_(payment_token, financial_account_token:, return_reason_code:, addenda: nil, date_of_death: nil, memo: nil, request_options: {}) + # + # @param payment_token [String] + # + # @param financial_account_token [String] Globally unique identifier for the financial account + # + # @param return_reason_code [String] ACH return reason code indicating the reason for returning the payment. Supporte + # + # @param addenda [String, nil] Optional additional information about the return. Limited to 44 characters + # + # @param date_of_death [Date, nil] Date of death in YYYY-MM-DD format. Required when using return codes **R14** (re + # + # @param memo [String, nil] Optional memo for the return. Limited to 10 characters + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Payment] + # + # @see Lithic::Models::PaymentReturnParams + def return_(payment_token, params) + parsed, options = Lithic::PaymentReturnParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/payments/%1$s/return", payment_token], + body: parsed, + model: Lithic::Payment, + options: options + ) + end + + # Simulate payment lifecycle event + # + # @overload simulate_action(payment_token, event_type:, date_of_death: nil, decline_reason: nil, return_addenda: nil, return_reason_code: nil, request_options: {}) + # + # @param payment_token [String] + # + # @param event_type [Symbol, Lithic::Models::PaymentSimulateActionParams::EventType] Event Type + # + # @param date_of_death [Date] Date of Death for ACH Return + # + # @param decline_reason [Symbol, Lithic::Models::PaymentSimulateActionParams::DeclineReason] Decline reason + # + # @param return_addenda [String] Return Addenda + # + # @param return_reason_code [String] Return Reason Code + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::PaymentSimulateActionResponse] + # + # @see Lithic::Models::PaymentSimulateActionParams + def simulate_action(payment_token, params) + parsed, options = Lithic::PaymentSimulateActionParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/simulate/payments/%1$s/action", payment_token], + body: parsed, + model: Lithic::Models::PaymentSimulateActionResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::PaymentSimulateReceiptParams} for more details. + # + # Simulates a receipt of a Payment. + # + # @overload simulate_receipt(token:, amount:, financial_account_token:, receipt_type:, memo: nil, request_options: {}) + # + # @param token [String] Customer-generated payment token used to uniquely identify the simulated payment + # + # @param amount [Integer] Amount + # + # @param financial_account_token [String] Financial Account Token + # + # @param receipt_type [Symbol, Lithic::Models::PaymentSimulateReceiptParams::ReceiptType] Receipt Type + # + # @param memo [String] Memo + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::PaymentSimulateReceiptResponse] + # + # @see Lithic::Models::PaymentSimulateReceiptParams + def simulate_receipt(params) + parsed, options = Lithic::PaymentSimulateReceiptParams.dump_request(params) + @client.request( + method: :post, + path: "v1/simulate/payments/receipt", + body: parsed, + model: Lithic::Models::PaymentSimulateReceiptResponse, + options: options + ) + end + + # Simulates a release of a Payment. + # + # @overload simulate_release(payment_token:, request_options: {}) + # + # @param payment_token [String] Payment Token + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::PaymentSimulateReleaseResponse] + # + # @see Lithic::Models::PaymentSimulateReleaseParams + def simulate_release(params) + parsed, options = Lithic::PaymentSimulateReleaseParams.dump_request(params) + @client.request( + method: :post, + path: "v1/simulate/payments/release", + body: parsed, + model: Lithic::Models::PaymentSimulateReleaseResponse, + options: options + ) + end + + # Simulates a return of a Payment. + # + # @overload simulate_return(payment_token:, return_reason_code: nil, request_options: {}) + # + # @param payment_token [String] Payment Token + # + # @param return_reason_code [String] Return Reason Code + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::PaymentSimulateReturnResponse] + # + # @see Lithic::Models::PaymentSimulateReturnParams + def simulate_return(params) + parsed, options = Lithic::PaymentSimulateReturnParams.dump_request(params) + @client.request( + method: :post, + path: "v1/simulate/payments/return", + body: parsed, + model: Lithic::Models::PaymentSimulateReturnResponse, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/reports.rb b/lib/lithic/resources/reports.rb new file mode 100644 index 00000000..40d29a4b --- /dev/null +++ b/lib/lithic/resources/reports.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Reports + # @return [Lithic::Resources::Reports::Settlement] + attr_reader :settlement + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @settlement = Lithic::Resources::Reports::Settlement.new(client: client) + end + end + end +end diff --git a/lib/lithic/resources/reports/settlement.rb b/lib/lithic/resources/reports/settlement.rb new file mode 100644 index 00000000..4f47028e --- /dev/null +++ b/lib/lithic/resources/reports/settlement.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Reports + class Settlement + # @return [Lithic::Resources::Reports::Settlement::NetworkTotals] + attr_reader :network_totals + + # Some parameter documentations has been truncated, see + # {Lithic::Models::Reports::SettlementListDetailsParams} for more details. + # + # List details. + # + # @overload list_details(report_date, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # + # @param report_date [Date] Date of the settlement report to retrieve. Not available in sandbox. + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Number of records per page. + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::Reports::SettlementListDetailsParams + def list_details(report_date, params = {}) + parsed, options = Lithic::Reports::SettlementListDetailsParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["v1/reports/settlement/details/%1$s", report_date], + query: query, + page: Lithic::Internal::CursorPage, + model: Lithic::SettlementDetail, + options: options + ) + end + + # Get the settlement report for a specified report date. Not available in sandbox. + # + # @overload summary(report_date, request_options: {}) + # + # @param report_date [Date] Date of the settlement report to retrieve. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::SettlementReport] + # + # @see Lithic::Models::Reports::SettlementSummaryParams + def summary(report_date, params = {}) + @client.request( + method: :get, + path: ["v1/reports/settlement/summary/%1$s", report_date], + model: Lithic::SettlementReport, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @network_totals = Lithic::Resources::Reports::Settlement::NetworkTotals.new(client: client) + end + end + end + end +end diff --git a/lib/lithic/resources/reports/settlement/network_totals.rb b/lib/lithic/resources/reports/settlement/network_totals.rb new file mode 100644 index 00000000..f8300f32 --- /dev/null +++ b/lib/lithic/resources/reports/settlement/network_totals.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Reports + class Settlement + class NetworkTotals + # Retrieve a specific network total record by token. Not available in sandbox. + # + # @overload retrieve(token, request_options: {}) + # + # @param token [String] Token of the network total record to retrieve + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::NetworkTotal] + # + # @see Lithic::Models::Reports::Settlement::NetworkTotalRetrieveParams + def retrieve(token, params = {}) + @client.request( + method: :get, + path: ["v1/reports/settlement/network_totals/%1$s", token], + model: Lithic::NetworkTotal, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::Reports::Settlement::NetworkTotalListParams} for more details. + # + # List network total records with optional filters. Not available in sandbox. + # + # @overload list(begin_: nil, end_: nil, ending_before: nil, institution_id: nil, network: nil, page_size: nil, report_date: nil, report_date_begin: nil, report_date_end: nil, settlement_institution_id: nil, starting_after: nil, request_options: {}) + # + # @param begin_ [Time] Datetime in RFC 3339 format. Only entries created after the specified time will + # + # @param end_ [Time] Datetime in RFC 3339 format. Only entries created before the specified time will + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param institution_id [String] Institution ID to filter on. + # + # @param network [Symbol, Lithic::Models::Reports::Settlement::NetworkTotalListParams::Network] Network to filter on. + # + # @param page_size [Integer] Number of records per page. + # + # @param report_date [Date] Singular report date to filter on (YYYY-MM-DD). Cannot be populated in conjuncti + # + # @param report_date_begin [Date] Earliest report date to filter on, inclusive (YYYY-MM-DD). + # + # @param report_date_end [Date] Latest report date to filter on, inclusive (YYYY-MM-DD). + # + # @param settlement_institution_id [String] Settlement institution ID to filter on. + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::Reports::Settlement::NetworkTotalListParams + def list(params = {}) + parsed, options = Lithic::Reports::Settlement::NetworkTotalListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/reports/settlement/network_totals", + query: query.transform_keys(begin_: "begin", end_: "end"), + page: Lithic::Internal::CursorPage, + model: Lithic::NetworkTotal, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end + end +end diff --git a/lib/lithic/resources/responder_endpoints.rb b/lib/lithic/resources/responder_endpoints.rb new file mode 100644 index 00000000..43468f76 --- /dev/null +++ b/lib/lithic/resources/responder_endpoints.rb @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class ResponderEndpoints + # Enroll a responder endpoint + # + # @overload create(type: nil, url: nil, request_options: {}) + # + # @param type [Symbol, Lithic::Models::ResponderEndpointCreateParams::Type] The type of the endpoint. + # + # @param url [String] The URL for the responder endpoint (must be http(s)). + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::ResponderEndpointCreateResponse] + # + # @see Lithic::Models::ResponderEndpointCreateParams + def create(params = {}) + parsed, options = Lithic::ResponderEndpointCreateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/responder_endpoints", + body: parsed, + model: Lithic::Models::ResponderEndpointCreateResponse, + options: options + ) + end + + # Disenroll a responder endpoint + # + # @overload delete(type:, request_options: {}) + # + # @param type [Symbol, Lithic::Models::ResponderEndpointDeleteParams::Type] The type of the endpoint. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Lithic::Models::ResponderEndpointDeleteParams + def delete(params) + parsed, options = Lithic::ResponderEndpointDeleteParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :delete, + path: "v1/responder_endpoints", + query: query, + model: NilClass, + options: options + ) + end + + # Check the status of a responder endpoint + # + # @overload check_status(type:, request_options: {}) + # + # @param type [Symbol, Lithic::Models::ResponderEndpointCheckStatusParams::Type] The type of the endpoint. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::ResponderEndpointStatus] + # + # @see Lithic::Models::ResponderEndpointCheckStatusParams + def check_status(params) + parsed, options = Lithic::ResponderEndpointCheckStatusParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/responder_endpoints", + query: query, + model: Lithic::ResponderEndpointStatus, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/three_ds.rb b/lib/lithic/resources/three_ds.rb new file mode 100644 index 00000000..f7cc34b6 --- /dev/null +++ b/lib/lithic/resources/three_ds.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class ThreeDS + # @return [Lithic::Resources::ThreeDS::Authentication] + attr_reader :authentication + + # @return [Lithic::Resources::ThreeDS::Decisioning] + attr_reader :decisioning + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @authentication = Lithic::Resources::ThreeDS::Authentication.new(client: client) + @decisioning = Lithic::Resources::ThreeDS::Decisioning.new(client: client) + end + end + end +end diff --git a/lib/lithic/resources/three_ds/authentication.rb b/lib/lithic/resources/three_ds/authentication.rb new file mode 100644 index 00000000..ef3b4422 --- /dev/null +++ b/lib/lithic/resources/three_ds/authentication.rb @@ -0,0 +1,103 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class ThreeDS + class Authentication + # Get 3DS Authentication by token + # + # @overload retrieve(three_ds_authentication_token, request_options: {}) + # + # @param three_ds_authentication_token [String] Globally unique identifier for the 3DS authentication. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::ThreeDSAuthentication] + # + # @see Lithic::Models::ThreeDS::AuthenticationRetrieveParams + def retrieve(three_ds_authentication_token, params = {}) + @client.request( + method: :get, + path: ["v1/three_ds_authentication/%1$s", three_ds_authentication_token], + model: Lithic::ThreeDSAuthentication, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::ThreeDS::AuthenticationSimulateParams} for more details. + # + # Simulates a 3DS authentication request from the payment network as if it came + # from an ACS. If you're configured for 3DS Customer Decisioning, simulating + # authentications requires your customer decisioning endpoint to be set up + # properly (respond with a valid JSON). If the authentication decision is to + # challenge, ensure that the account holder associated with the card transaction + # has a valid phone number configured to receive the OTP code via SMS. + # + # @overload simulate(merchant:, pan:, transaction:, card_expiry_check: nil, request_options: {}) + # + # @param merchant [Lithic::Models::ThreeDS::AuthenticationSimulateParams::Merchant] Merchant information for the simulated transaction + # + # @param pan [String] Sixteen digit card number. + # + # @param transaction [Lithic::Models::ThreeDS::AuthenticationSimulateParams::Transaction] Transaction details for the simulation + # + # @param card_expiry_check [Symbol, Lithic::Models::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck] When set will use the following values as part of the Simulated Authentication. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::ThreeDS::AuthenticationSimulateResponse] + # + # @see Lithic::Models::ThreeDS::AuthenticationSimulateParams + def simulate(params) + parsed, options = Lithic::ThreeDS::AuthenticationSimulateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/three_ds_authentication/simulate", + body: parsed, + model: Lithic::Models::ThreeDS::AuthenticationSimulateResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::ThreeDS::AuthenticationSimulateOtpEntryParams} for more + # details. + # + # Endpoint for simulating entering OTP into 3DS Challenge UI. A call to + # [/v1/three_ds_authentication/simulate](https://docs.lithic.com/reference/postsimulateauthentication) + # that resulted in triggered SMS-OTP challenge must precede. Only a single attempt + # is supported; upon entering OTP, the challenge is either approved or declined. + # + # @overload simulate_otp_entry(token:, otp:, request_options: {}) + # + # @param token [String] A unique token returned as part of a /v1/three_ds_authentication/simulate call t + # + # @param otp [String] The OTP entered by the cardholder + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Lithic::Models::ThreeDS::AuthenticationSimulateOtpEntryParams + def simulate_otp_entry(params) + parsed, options = Lithic::ThreeDS::AuthenticationSimulateOtpEntryParams.dump_request(params) + @client.request( + method: :post, + path: "v1/three_ds_decisioning/simulate/enter_otp", + body: parsed, + model: NilClass, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/three_ds/decisioning.rb b/lib/lithic/resources/three_ds/decisioning.rb new file mode 100644 index 00000000..dbaa8c77 --- /dev/null +++ b/lib/lithic/resources/three_ds/decisioning.rb @@ -0,0 +1,92 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class ThreeDS + class Decisioning + # Some parameter documentations has been truncated, see + # {Lithic::Models::ThreeDS::DecisioningChallengeResponseParams} for more details. + # + # Card program's response to a 3DS Challenge Request. Challenge Request is emitted + # as a webhook + # [three_ds_authentication.challenge](https://docs.lithic.com/reference/post_three-ds-authentication-challenge) + # and your Card Program needs to be configured with Out of Band (OOB) Challenges + # in order to receive it (see https://docs.lithic.com/docs/3ds-challenge-flow for + # more information). + # + # @overload challenge_response(token:, challenge_response:, request_options: {}) + # + # @param token [String] Globally unique identifier for 3DS Authentication that resulted in PENDING_CHALL + # + # @param challenge_response [Symbol, Lithic::Models::ThreeDS::ChallengeResult] Whether the Cardholder has approved or declined the issued Challenge + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Lithic::Models::ThreeDS::DecisioningChallengeResponseParams + def challenge_response(params) + parsed, options = Lithic::ThreeDS::DecisioningChallengeResponseParams.dump_request(params) + @client.request( + method: :post, + path: "v1/three_ds_decisioning/challenge_response", + body: parsed, + model: NilClass, + options: options + ) + end + + # Retrieve the 3DS Decisioning HMAC secret key. If one does not exist for your + # program yet, calling this endpoint will create one for you. The headers (which + # you can use to verify 3DS Decisioning requests) will begin appearing shortly + # after calling this endpoint for the first time. See + # [this page](https://docs.lithic.com/docs/3ds-decisioning#3ds-decisioning-hmac-secrets) + # for more detail about verifying 3DS Decisioning requests. + # + # @overload retrieve_secret(request_options: {}) + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::ThreeDS::DecisioningRetrieveSecretResponse] + # + # @see Lithic::Models::ThreeDS::DecisioningRetrieveSecretParams + def retrieve_secret(params = {}) + @client.request( + method: :get, + path: "v1/three_ds_decisioning/secret", + model: Lithic::Models::ThreeDS::DecisioningRetrieveSecretResponse, + options: params[:request_options] + ) + end + + # Generate a new 3DS Decisioning HMAC secret key. The old secret key will be + # deactivated 24 hours after a successful request to this endpoint. Make a + # [`GET /three_ds_decisioning/secret`](https://docs.lithic.com/reference/getthreedsdecisioningsecret) + # request to retrieve the new secret key. + # + # @overload rotate_secret(request_options: {}) + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Lithic::Models::ThreeDS::DecisioningRotateSecretParams + def rotate_secret(params = {}) + @client.request( + method: :post, + path: "v1/three_ds_decisioning/secret/rotate", + model: NilClass, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/tokenization_decisioning.rb b/lib/lithic/resources/tokenization_decisioning.rb new file mode 100644 index 00000000..8b0bd09f --- /dev/null +++ b/lib/lithic/resources/tokenization_decisioning.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class TokenizationDecisioning + # Retrieve the Tokenization Decisioning secret key. If one does not exist your + # program yet, calling this endpoint will create one for you. The headers of the + # Tokenization Decisioning request will contain a hmac signature which you can use + # to verify requests originate from Lithic. See + # [this page](https://docs.lithic.com/docs/events-api#verifying-webhooks) for more + # detail about verifying Tokenization Decisioning requests. + # + # @overload retrieve_secret(request_options: {}) + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::TokenizationSecret] + # + # @see Lithic::Models::TokenizationDecisioningRetrieveSecretParams + def retrieve_secret(params = {}) + @client.request( + method: :get, + path: "v1/tokenization_decisioning/secret", + model: Lithic::TokenizationSecret, + options: params[:request_options] + ) + end + + # Generate a new Tokenization Decisioning secret key. The old Tokenization + # Decisioning secret key will be deactivated 24 hours after a successful request + # to this endpoint. + # + # @overload rotate_secret(request_options: {}) + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::TokenizationDecisioningRotateSecretResponse] + # + # @see Lithic::Models::TokenizationDecisioningRotateSecretParams + def rotate_secret(params = {}) + @client.request( + method: :post, + path: "v1/tokenization_decisioning/secret/rotate", + model: Lithic::Models::TokenizationDecisioningRotateSecretResponse, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/tokenizations.rb b/lib/lithic/resources/tokenizations.rb new file mode 100644 index 00000000..5ab741d8 --- /dev/null +++ b/lib/lithic/resources/tokenizations.rb @@ -0,0 +1,293 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Tokenizations + # Get tokenization + # + # @overload retrieve(tokenization_token, request_options: {}) + # + # @param tokenization_token [String] Tokenization token + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Tokenization] + # + # @see Lithic::Models::TokenizationRetrieveParams + def retrieve(tokenization_token, params = {}) + @client.request( + method: :get, + path: ["v1/tokenizations/%1$s", tokenization_token], + model: Lithic::Tokenization, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::TokenizationListParams} for more details. + # + # List card tokenizations + # + # @overload list(account_token: nil, begin_: nil, card_token: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, tokenization_channel: nil, request_options: {}) + # + # @param account_token [String] Filters for tokenizations associated with a specific account. + # + # @param begin_ [Date] Filter for tokenizations created after this date. + # + # @param card_token [String] Filters for tokenizations associated with a specific card. + # + # @param end_ [Date] Filter for tokenizations created before this date. + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param tokenization_channel [Symbol, Lithic::Models::TokenizationListParams::TokenizationChannel] Filter for tokenizations by tokenization channel. If this is not specified, only + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::TokenizationListParams + def list(params = {}) + parsed, options = Lithic::TokenizationListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/tokenizations", + query: query.transform_keys(begin_: "begin", end_: "end"), + page: Lithic::Internal::CursorPage, + model: Lithic::Tokenization, + options: options + ) + end + + # This endpoint is used to ask the card network to activate a tokenization. A + # successful response indicates that the request was successfully delivered to the + # card network. When the card network activates the tokenization, the state will + # be updated and a tokenization.updated event will be sent. The endpoint may only + # be used on digital wallet tokenizations with status `INACTIVE`, + # `PENDING_ACTIVATION`, or `PENDING_2FA`. This will put the tokenization in an + # active state, and transactions will be allowed. Reach out at + # [lithic.com/contact](https://lithic.com/contact) for more information. + # + # @overload activate(tokenization_token, request_options: {}) + # + # @param tokenization_token [String] Tokenization token + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Lithic::Models::TokenizationActivateParams + def activate(tokenization_token, params = {}) + @client.request( + method: :post, + path: ["v1/tokenizations/%1$s/activate", tokenization_token], + model: NilClass, + options: params[:request_options] + ) + end + + # This endpoint is used to ask the card network to deactivate a tokenization. A + # successful response indicates that the request was successfully delivered to the + # card network. When the card network deactivates the tokenization, the state will + # be updated and a tokenization.updated event will be sent. Authorizations + # attempted with a deactivated tokenization will be blocked and will not be + # forwarded to Lithic from the network. Deactivating the token is a permanent + # operation. If the target is a digital wallet tokenization, it will be removed + # from its device. Reach out at [lithic.com/contact](https://lithic.com/contact) + # for more information. + # + # @overload deactivate(tokenization_token, request_options: {}) + # + # @param tokenization_token [String] Tokenization token + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Lithic::Models::TokenizationDeactivateParams + def deactivate(tokenization_token, params = {}) + @client.request( + method: :post, + path: ["v1/tokenizations/%1$s/deactivate", tokenization_token], + model: NilClass, + options: params[:request_options] + ) + end + + # This endpoint is used to ask the card network to pause a tokenization. A + # successful response indicates that the request was successfully delivered to the + # card network. When the card network pauses the tokenization, the state will be + # updated and a tokenization.updated event will be sent. The endpoint may only be + # used on tokenizations with status `ACTIVE`. A paused token will prevent + # merchants from sending authorizations, and is a temporary status that can be + # changed. Reach out at [lithic.com/contact](https://lithic.com/contact) for more + # information. + # + # @overload pause(tokenization_token, request_options: {}) + # + # @param tokenization_token [String] Tokenization token + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Lithic::Models::TokenizationPauseParams + def pause(tokenization_token, params = {}) + @client.request( + method: :post, + path: ["v1/tokenizations/%1$s/pause", tokenization_token], + model: NilClass, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::TokenizationResendActivationCodeParams} for more details. + # + # This endpoint is used to ask the card network to send another activation code to + # a cardholder that has already tried tokenizing a card. A successful response + # indicates that the request was successfully delivered to the card network. The + # endpoint may only be used on Mastercard digital wallet tokenizations with status + # `INACTIVE`, `PENDING_ACTIVATION`, or `PENDING_2FA`. The network will send a new + # activation code to the one of the contact methods provided in the initial + # tokenization flow. If a user fails to enter the code correctly 3 times, the + # contact method will not be eligible for resending the activation code, and the + # cardholder must restart the provision process. Reach out at + # [lithic.com/contact](https://lithic.com/contact) for more information. + # + # @overload resend_activation_code(tokenization_token, activation_method_type: nil, request_options: {}) + # + # @param tokenization_token [String] Tokenization token + # + # @param activation_method_type [Symbol, Lithic::Models::TokenizationResendActivationCodeParams::ActivationMethodType] The communication method that the user has selected to use to receive the authen + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Lithic::Models::TokenizationResendActivationCodeParams + def resend_activation_code(tokenization_token, params = {}) + parsed, options = Lithic::TokenizationResendActivationCodeParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/tokenizations/%1$s/resend_activation_code", tokenization_token], + body: parsed, + model: NilClass, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::TokenizationSimulateParams} for more details. + # + # This endpoint is used to simulate a card's tokenization in the Digital Wallet + # and merchant tokenization ecosystem. + # + # @overload simulate(cvv:, expiration_date:, pan:, tokenization_source:, account_score: nil, device_score: nil, entity: nil, wallet_recommended_decision: nil, request_options: {}) + # + # @param cvv [String] The three digit cvv for the card. + # + # @param expiration_date [String] The expiration date of the card in 'MM/YY' format. + # + # @param pan [String] The sixteen digit card number. + # + # @param tokenization_source [Symbol, Lithic::Models::TokenizationSimulateParams::TokenizationSource] The source of the tokenization request. + # + # @param account_score [Integer] The account score (1-5) that represents how the Digital Wallet's view on how rep + # + # @param device_score [Integer] The device score (1-5) that represents how the Digital Wallet's view on how repu + # + # @param entity [String] Optional field to specify the token requestor name for a merchant token simulati + # + # @param wallet_recommended_decision [Symbol, Lithic::Models::TokenizationSimulateParams::WalletRecommendedDecision] The decision that the Digital Wallet's recommend + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Tokenization] + # + # @see Lithic::Models::TokenizationSimulateParams + def simulate(params) + parsed, options = Lithic::TokenizationSimulateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/simulate/tokenizations", + body: parsed, + model: Lithic::Tokenization, + options: options + ) + end + + # This endpoint is used to ask the card network to unpause a tokenization. A + # successful response indicates that the request was successfully delivered to the + # card network. When the card network unpauses the tokenization, the state will be + # updated and a tokenization.updated event will be sent. The endpoint may only be + # used on tokenizations with status `PAUSED`. This will put the tokenization in an + # active state, and transactions may resume. Reach out at + # [lithic.com/contact](https://lithic.com/contact) for more information. + # + # @overload unpause(tokenization_token, request_options: {}) + # + # @param tokenization_token [String] Tokenization token + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Lithic::Models::TokenizationUnpauseParams + def unpause(tokenization_token, params = {}) + @client.request( + method: :post, + path: ["v1/tokenizations/%1$s/unpause", tokenization_token], + model: NilClass, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::TokenizationUpdateDigitalCardArtParams} for more details. + # + # This endpoint is used update the digital card art for a digital wallet + # tokenization. A successful response indicates that the card network has updated + # the tokenization's art, and the tokenization's `digital_cart_art_token` field + # was updated. The endpoint may not be used on tokenizations with status + # `DEACTIVATED`. Note that this updates the art for one specific tokenization, not + # all tokenizations for a card. New tokenizations for a card will be created with + # the art referenced in the card object's `digital_card_art_token` field. Reach + # out at [lithic.com/contact](https://lithic.com/contact) for more information. + # + # @overload update_digital_card_art(tokenization_token, digital_card_art_token: nil, request_options: {}) + # + # @param tokenization_token [String] Tokenization token + # + # @param digital_card_art_token [String] Specifies the digital card art to be displayed in the user’s digital wallet for + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Tokenization] + # + # @see Lithic::Models::TokenizationUpdateDigitalCardArtParams + def update_digital_card_art(tokenization_token, params = {}) + parsed, options = Lithic::TokenizationUpdateDigitalCardArtParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/tokenizations/%1$s/update_digital_card_art", tokenization_token], + body: parsed, + model: Lithic::Tokenization, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/transaction_monitoring.rb b/lib/lithic/resources/transaction_monitoring.rb new file mode 100644 index 00000000..6b9e0c2b --- /dev/null +++ b/lib/lithic/resources/transaction_monitoring.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class TransactionMonitoring + # @return [Lithic::Resources::TransactionMonitoring::Cases] + attr_reader :cases + + # @return [Lithic::Resources::TransactionMonitoring::Queues] + attr_reader :queues + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @cases = Lithic::Resources::TransactionMonitoring::Cases.new(client: client) + @queues = Lithic::Resources::TransactionMonitoring::Queues.new(client: client) + end + end + end +end diff --git a/lib/lithic/resources/transaction_monitoring/cases.rb b/lib/lithic/resources/transaction_monitoring/cases.rb new file mode 100644 index 00000000..deb32755 --- /dev/null +++ b/lib/lithic/resources/transaction_monitoring/cases.rb @@ -0,0 +1,228 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class TransactionMonitoring + class Cases + # @return [Lithic::Resources::TransactionMonitoring::Cases::Comments] + attr_reader :comments + + # @return [Lithic::Resources::TransactionMonitoring::Cases::Files] + attr_reader :files + + # Retrieves a single transaction monitoring case. + # + # @overload retrieve(case_token, request_options: {}) + # + # @param case_token [String] Globally unique identifier for the case. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::TransactionMonitoring::MonitoringCase] + # + # @see Lithic::Models::TransactionMonitoring::CaseRetrieveParams + def retrieve(case_token, params = {}) + @client.request( + method: :get, + path: ["v1/transaction_monitoring/cases/%1$s", case_token], + model: Lithic::TransactionMonitoring::MonitoringCase, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionMonitoring::CaseUpdateParams} for more details. + # + # Updates a transaction monitoring case. + # + # @overload update(case_token, actor_token: nil, assignee: nil, priority: nil, resolution: nil, resolution_notes: nil, sla_deadline: nil, status: nil, tags: nil, title: nil, request_options: {}) + # + # @param case_token [String] Globally unique identifier for the case. + # + # @param actor_token [String] Optional client-provided identifier for the actor performing this action, + # + # @param assignee [String, nil] New assignee for the case, or `null` to unassign + # + # @param priority [Symbol, Lithic::Models::TransactionMonitoring::CasePriority] Priority level of a case, controlling queue ordering and SLA urgency + # + # @param resolution [Symbol, Lithic::Models::TransactionMonitoring::ResolutionOutcome] Outcome recorded when a case is resolved: + # + # @param resolution_notes [String] Notes describing the resolution + # + # @param sla_deadline [Time, nil] New SLA deadline for the case, or `null` to clear it + # + # @param status [Symbol, Lithic::Models::TransactionMonitoring::CaseStatus] Status of a case as it progresses through the review workflow: + # + # @param tags [Hash{Symbol=>String}] Arbitrary key-value metadata to set on the case + # + # @param title [String, nil] New title for the case, or `null` to clear it + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::TransactionMonitoring::MonitoringCase] + # + # @see Lithic::Models::TransactionMonitoring::CaseUpdateParams + def update(case_token, params = {}) + parsed, options = Lithic::TransactionMonitoring::CaseUpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["v1/transaction_monitoring/cases/%1$s", case_token], + body: parsed, + model: Lithic::TransactionMonitoring::MonitoringCase, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionMonitoring::CaseListParams} for more details. + # + # Lists transaction monitoring cases, optionally filtered. + # + # @overload list(account_token: nil, assignee: nil, begin_: nil, card_token: nil, end_: nil, ending_before: nil, entity_token: nil, page_size: nil, queue_token: nil, rule_token: nil, sort_by: nil, starting_after: nil, status: nil, transaction_token: nil, request_options: {}) + # + # @param account_token [String] Only return cases that include transactions on the provided account. + # + # @param assignee [String] Only return cases assigned to the provided value. Pass an empty string to return + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param card_token [String] Only return cases that include transactions on the provided card. + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param entity_token [String] Only return cases associated with the provided entity. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param queue_token [String] Only return cases belonging to the provided queue. + # + # @param rule_token [String] Only return cases triggered by the provided transaction monitoring rule. + # + # @param sort_by [Symbol, Lithic::Models::TransactionMonitoring::CaseSortOrder] Sort order for the returned cases. + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param status [Symbol, Lithic::Models::TransactionMonitoring::CaseStatus] Only return cases with the provided status. + # + # @param transaction_token [String] Only return cases that include the provided transaction. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::TransactionMonitoring::CaseListParams + def list(params = {}) + parsed, options = Lithic::TransactionMonitoring::CaseListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/transaction_monitoring/cases", + query: query.transform_keys(begin_: "begin", end_: "end"), + page: Lithic::Internal::CursorPage, + model: Lithic::TransactionMonitoring::MonitoringCase, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionMonitoring::CaseListActivityParams} for more + # details. + # + # Lists the activity feed for a case. + # + # @overload list_activity(case_token, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # + # @param case_token [String] Globally unique identifier for the case. + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::TransactionMonitoring::CaseListActivityParams + def list_activity(case_token, params = {}) + parsed, options = Lithic::TransactionMonitoring::CaseListActivityParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["v1/transaction_monitoring/cases/%1$s/activity", case_token], + query: query, + page: Lithic::Internal::CursorPage, + model: Lithic::TransactionMonitoring::CaseActivityEntry, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionMonitoring::CaseListTransactionsParams} for more + # details. + # + # Lists the transactions associated with a case. + # + # @overload list_transactions(case_token, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # + # @param case_token [String] Globally unique identifier for the case. + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::TransactionMonitoring::CaseListTransactionsParams + def list_transactions(case_token, params = {}) + parsed, options = Lithic::TransactionMonitoring::CaseListTransactionsParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["v1/transaction_monitoring/cases/%1$s/transactions", case_token], + query: query, + page: Lithic::Internal::CursorPage, + model: Lithic::TransactionMonitoring::CaseTransaction, + options: options + ) + end + + # Lists the cards involved in a case, with per-card transaction counts. + # + # @overload retrieve_cards(case_token, request_options: {}) + # + # @param case_token [String] Globally unique identifier for the case. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Array] + # + # @see Lithic::Models::TransactionMonitoring::CaseRetrieveCardsParams + def retrieve_cards(case_token, params = {}) + @client.request( + method: :get, + path: ["v1/transaction_monitoring/cases/%1$s/cards", case_token], + model: Lithic::Internal::Type::ArrayOf[Lithic::TransactionMonitoring::CaseCard], + options: params[:request_options] + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @comments = Lithic::Resources::TransactionMonitoring::Cases::Comments.new(client: client) + @files = Lithic::Resources::TransactionMonitoring::Cases::Files.new(client: client) + end + end + end + end +end diff --git a/lib/lithic/resources/transaction_monitoring/cases/comments.rb b/lib/lithic/resources/transaction_monitoring/cases/comments.rb new file mode 100644 index 00000000..2905c800 --- /dev/null +++ b/lib/lithic/resources/transaction_monitoring/cases/comments.rb @@ -0,0 +1,111 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class TransactionMonitoring + class Cases + class Comments + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionMonitoring::Cases::CommentCreateParams} for more + # details. + # + # Adds a comment to a case. + # + # @overload create(case_token, comment:, actor_token: nil, request_options: {}) + # + # @param case_token [String] Globally unique identifier for the case. + # + # @param comment [String] Text of the comment + # + # @param actor_token [String] Optional client-provided identifier for the actor performing this action, + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::TransactionMonitoring::CaseActivityEntry] + # + # @see Lithic::Models::TransactionMonitoring::Cases::CommentCreateParams + def create(case_token, params) + parsed, options = Lithic::TransactionMonitoring::Cases::CommentCreateParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/transaction_monitoring/cases/%1$s/comments", case_token], + body: parsed, + model: Lithic::TransactionMonitoring::CaseActivityEntry, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionMonitoring::Cases::CommentUpdateParams} for more + # details. + # + # Edits an existing comment on a case. + # + # @overload update(comment_token, case_token:, comment:, actor_token: nil, request_options: {}) + # + # @param comment_token [String] Path param: Globally unique identifier for the comment. + # + # @param case_token [String] Path param: Globally unique identifier for the case. + # + # @param comment [String] Body param: New text of the comment + # + # @param actor_token [String] Body param: Optional client-provided identifier for the actor performing this ac + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::TransactionMonitoring::CaseActivityEntry] + # + # @see Lithic::Models::TransactionMonitoring::Cases::CommentUpdateParams + def update(comment_token, params) + parsed, options = Lithic::TransactionMonitoring::Cases::CommentUpdateParams.dump_request(params) + case_token = + parsed.delete(:case_token) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :patch, + path: ["v1/transaction_monitoring/cases/%1$s/comments/%2$s", case_token, comment_token], + body: parsed, + model: Lithic::TransactionMonitoring::CaseActivityEntry, + options: options + ) + end + + # Deletes a comment from a case. + # + # @overload delete(comment_token, case_token:, request_options: {}) + # + # @param comment_token [String] Globally unique identifier for the comment. + # + # @param case_token [String] Globally unique identifier for the case. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Lithic::Models::TransactionMonitoring::Cases::CommentDeleteParams + def delete(comment_token, params) + parsed, options = Lithic::TransactionMonitoring::Cases::CommentDeleteParams.dump_request(params) + case_token = + parsed.delete(:case_token) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :delete, + path: ["v1/transaction_monitoring/cases/%1$s/comments/%2$s", case_token, comment_token], + model: NilClass, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end + end +end diff --git a/lib/lithic/resources/transaction_monitoring/cases/files.rb b/lib/lithic/resources/transaction_monitoring/cases/files.rb new file mode 100644 index 00000000..d249f650 --- /dev/null +++ b/lib/lithic/resources/transaction_monitoring/cases/files.rb @@ -0,0 +1,131 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class TransactionMonitoring + class Cases + class Files + # Creates a file record and returns a presigned URL for uploading the file to the + # case. + # + # @overload create(case_token, name:, request_options: {}) + # + # @param case_token [String] Globally unique identifier for the case. + # + # @param name [String] Name of the file to upload + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::TransactionMonitoring::Cases::CaseFile] + # + # @see Lithic::Models::TransactionMonitoring::Cases::FileCreateParams + def create(case_token, params) + parsed, options = Lithic::TransactionMonitoring::Cases::FileCreateParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/transaction_monitoring/cases/%1$s/files", case_token], + body: parsed, + model: Lithic::TransactionMonitoring::Cases::CaseFile, + options: options + ) + end + + # Retrieves a single file attached to a case, including a presigned download URL + # when the file is ready. + # + # @overload retrieve(file_token, case_token:, request_options: {}) + # + # @param file_token [String] Globally unique identifier for the file. + # + # @param case_token [String] Globally unique identifier for the case. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::TransactionMonitoring::Cases::CaseFile] + # + # @see Lithic::Models::TransactionMonitoring::Cases::FileRetrieveParams + def retrieve(file_token, params) + parsed, options = Lithic::TransactionMonitoring::Cases::FileRetrieveParams.dump_request(params) + case_token = + parsed.delete(:case_token) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :get, + path: ["v1/transaction_monitoring/cases/%1$s/files/%2$s", case_token, file_token], + model: Lithic::TransactionMonitoring::Cases::CaseFile, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionMonitoring::Cases::FileListParams} for more details. + # + # Lists the files attached to a case. + # + # @overload list(case_token, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # + # @param case_token [String] Globally unique identifier for the case. + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::TransactionMonitoring::Cases::FileListParams + def list(case_token, params = {}) + parsed, options = Lithic::TransactionMonitoring::Cases::FileListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["v1/transaction_monitoring/cases/%1$s/files", case_token], + query: query, + page: Lithic::Internal::CursorPage, + model: Lithic::TransactionMonitoring::Cases::CaseFile, + options: options + ) + end + + # Deletes a file from a case. + # + # @overload delete(file_token, case_token:, request_options: {}) + # + # @param file_token [String] Globally unique identifier for the file. + # + # @param case_token [String] Globally unique identifier for the case. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Lithic::Models::TransactionMonitoring::Cases::FileDeleteParams + def delete(file_token, params) + parsed, options = Lithic::TransactionMonitoring::Cases::FileDeleteParams.dump_request(params) + case_token = + parsed.delete(:case_token) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :delete, + path: ["v1/transaction_monitoring/cases/%1$s/files/%2$s", case_token, file_token], + model: NilClass, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end + end +end diff --git a/lib/lithic/resources/transaction_monitoring/queues.rb b/lib/lithic/resources/transaction_monitoring/queues.rb new file mode 100644 index 00000000..5b2b2fd9 --- /dev/null +++ b/lib/lithic/resources/transaction_monitoring/queues.rb @@ -0,0 +1,137 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class TransactionMonitoring + class Queues + # Creates a new queue for grouping transaction monitoring cases. + # + # @overload create(name:, description: nil, request_options: {}) + # + # @param name [String] Human-readable name of the queue + # + # @param description [String, nil] Optional description of the queue + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::TransactionMonitoring::Queue] + # + # @see Lithic::Models::TransactionMonitoring::QueueCreateParams + def create(params) + parsed, options = Lithic::TransactionMonitoring::QueueCreateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/transaction_monitoring/queues", + body: parsed, + model: Lithic::TransactionMonitoring::Queue, + options: options + ) + end + + # Retrieves a single transaction monitoring queue. + # + # @overload retrieve(queue_token, request_options: {}) + # + # @param queue_token [String] Globally unique identifier for the queue. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::TransactionMonitoring::Queue] + # + # @see Lithic::Models::TransactionMonitoring::QueueRetrieveParams + def retrieve(queue_token, params = {}) + @client.request( + method: :get, + path: ["v1/transaction_monitoring/queues/%1$s", queue_token], + model: Lithic::TransactionMonitoring::Queue, + options: params[:request_options] + ) + end + + # Updates a transaction monitoring queue. + # + # @overload update(queue_token, description: nil, name: nil, request_options: {}) + # + # @param queue_token [String] Globally unique identifier for the queue. + # + # @param description [String, nil] New description for the queue, or `null` to clear it + # + # @param name [String] New name for the queue + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::TransactionMonitoring::Queue] + # + # @see Lithic::Models::TransactionMonitoring::QueueUpdateParams + def update(queue_token, params = {}) + parsed, options = Lithic::TransactionMonitoring::QueueUpdateParams.dump_request(params) + @client.request( + method: :patch, + path: ["v1/transaction_monitoring/queues/%1$s", queue_token], + body: parsed, + model: Lithic::TransactionMonitoring::Queue, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionMonitoring::QueueListParams} for more details. + # + # Lists transaction monitoring queues. + # + # @overload list(ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::TransactionMonitoring::QueueListParams + def list(params = {}) + parsed, options = Lithic::TransactionMonitoring::QueueListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/transaction_monitoring/queues", + query: query, + page: Lithic::Internal::CursorPage, + model: Lithic::TransactionMonitoring::Queue, + options: options + ) + end + + # Deletes a transaction monitoring queue. + # + # @overload delete(queue_token, request_options: {}) + # + # @param queue_token [String] Globally unique identifier for the queue. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Lithic::Models::TransactionMonitoring::QueueDeleteParams + def delete(queue_token, params = {}) + @client.request( + method: :delete, + path: ["v1/transaction_monitoring/queues/%1$s", queue_token], + model: NilClass, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/transactions.rb b/lib/lithic/resources/transactions.rb new file mode 100644 index 00000000..e43cb0c2 --- /dev/null +++ b/lib/lithic/resources/transactions.rb @@ -0,0 +1,374 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Transactions + # @return [Lithic::Resources::Transactions::EnhancedCommercialData] + attr_reader :enhanced_commercial_data + + # @return [Lithic::Resources::Transactions::Events] + attr_reader :events + + # Get a specific card transaction. All amounts are in the smallest unit of their + # respective currency (e.g., cents for USD). + # + # @overload retrieve(transaction_token, request_options: {}) + # + # @param transaction_token [String] Globally unique identifier for the transaction. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Transaction] + # + # @see Lithic::Models::TransactionRetrieveParams + def retrieve(transaction_token, params = {}) + @client.request( + method: :get, + path: ["v1/transactions/%1$s", transaction_token], + model: Lithic::Transaction, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionListParams} for more details. + # + # List card transactions. All amounts are in the smallest unit of their respective + # currency (e.g., cents for USD) and inclusive of any acquirer fees. + # + # @overload list(account_token: nil, begin_: nil, card_token: nil, end_: nil, ending_before: nil, page_size: nil, result: nil, starting_after: nil, status: nil, request_options: {}) + # + # @param account_token [String] Filters for transactions associated with a specific account. + # + # @param begin_ [Time] Date string in RFC 3339 format. Only entries created after the specified time wi + # + # @param card_token [String] Filters for transactions associated with a specific card. + # + # @param end_ [Time] Date string in RFC 3339 format. Only entries created before the specified time w + # + # @param ending_before [String] A cursor representing an item's token before which a page of results should end. + # + # @param page_size [Integer] Page size (for pagination). + # + # @param result [Symbol, Lithic::Models::TransactionListParams::Result] Filters for transactions using transaction result field. Can filter by `APPROVED + # + # @param starting_after [String] A cursor representing an item's token after which a page of results should begin + # + # @param status [Symbol, Lithic::Models::TransactionListParams::Status] Filters for transactions using transaction status field. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::CursorPage] + # + # @see Lithic::Models::TransactionListParams + def list(params = {}) + parsed, options = Lithic::TransactionListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/transactions", + query: query.transform_keys(begin_: "begin", end_: "end"), + page: Lithic::Internal::CursorPage, + model: Lithic::Transaction, + options: options + ) + end + + # Expire authorization + # + # @overload expire_authorization(transaction_token, request_options: {}) + # + # @param transaction_token [String] The token of the transaction to expire. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Lithic::Models::TransactionExpireAuthorizationParams + def expire_authorization(transaction_token, params = {}) + @client.request( + method: :post, + path: ["v1/transactions/%1$s/expire_authorization", transaction_token], + model: NilClass, + options: params[:request_options] + ) + end + + # Route a card transaction to a financial account. Only available for select use + # cases and programs. + # + # @overload route(transaction_token, financial_account_token:, request_options: {}) + # + # @param transaction_token [String] The token of the transaction to route. + # + # @param financial_account_token [String] The token of the financial account to route the transaction to. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Lithic::Models::TransactionRouteParams + def route(transaction_token, params) + parsed, options = Lithic::TransactionRouteParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/transactions/%1$s/route", transaction_token], + body: parsed, + model: NilClass, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionSimulateAuthorizationParams} for more details. + # + # Simulates an authorization request from the card network as if it came from a + # merchant acquirer. If you are configured for ASA, simulating authorizations + # requires your ASA client to be set up properly, i.e. be able to respond to the + # ASA request with a valid JSON. For users that are not configured for ASA, a + # daily transaction limit of $5000 USD is applied by default. You can update this + # limit via the + # [update account](https://docs.lithic.com/reference/patchaccountbytoken) + # endpoint. + # + # @overload simulate_authorization(amount:, descriptor:, pan:, mcc: nil, merchant_acceptor_city: nil, merchant_acceptor_country: nil, merchant_acceptor_id: nil, merchant_acceptor_state: nil, merchant_amount: nil, merchant_currency: nil, partial_approval_capable: nil, pin: nil, status: nil, request_options: {}) + # + # @param amount [Integer] Amount (in cents) to authorize. For credit authorizations and financial credit a + # + # @param descriptor [String] Merchant descriptor. + # + # @param pan [String] Sixteen digit card number. + # + # @param mcc [String] Merchant category code for the transaction to be simulated. A four-digit number + # + # @param merchant_acceptor_city [String] Merchant acceptor city + # + # @param merchant_acceptor_country [String] Merchant acceptor country code (ISO 3166-1 alpha-3) + # + # @param merchant_acceptor_id [String] Unique identifier to identify the payment card acceptor. + # + # @param merchant_acceptor_state [String] Merchant acceptor state/province (ISO 3166-2 subdivision code) + # + # @param merchant_amount [Integer] Amount of the transaction to be simulated in currency specified in merchant_curr + # + # @param merchant_currency [String] 3-character alphabetic ISO 4217 currency code. Note: Simulator only accepts USD, + # + # @param partial_approval_capable [Boolean] Set to true if the terminal is capable of partial approval otherwise false. + # + # @param pin [String] Simulate entering a PIN. If omitted, PIN check will not be performed. + # + # @param status [Symbol, Lithic::Models::TransactionSimulateAuthorizationParams::Status] Type of event to simulate. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::TransactionSimulateAuthorizationResponse] + # + # @see Lithic::Models::TransactionSimulateAuthorizationParams + def simulate_authorization(params) + parsed, options = Lithic::TransactionSimulateAuthorizationParams.dump_request(params) + @client.request( + method: :post, + path: "v1/simulate/authorize", + body: parsed, + model: Lithic::Models::TransactionSimulateAuthorizationResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionSimulateAuthorizationAdviceParams} for more details. + # + # Simulates an authorization advice from the card network as if it came from a + # merchant acquirer. An authorization advice changes the pending amount of the + # transaction. + # + # @overload simulate_authorization_advice(token:, amount:, request_options: {}) + # + # @param token [String] The transaction token returned from the /v1/simulate/authorize. response. + # + # @param amount [Integer] Amount (in cents) to authorize. This amount will override the transaction's amou + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::TransactionSimulateAuthorizationAdviceResponse] + # + # @see Lithic::Models::TransactionSimulateAuthorizationAdviceParams + def simulate_authorization_advice(params) + parsed, options = Lithic::TransactionSimulateAuthorizationAdviceParams.dump_request(params) + @client.request( + method: :post, + path: "v1/simulate/authorization_advice", + body: parsed, + model: Lithic::Models::TransactionSimulateAuthorizationAdviceResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionSimulateClearingParams} for more details. + # + # Clears an existing authorization, either debit or credit. After this event, the + # transaction transitions from `PENDING` to `SETTLED` status. + # + # If `amount` is not set, the full amount of the transaction will be cleared. + # Transactions that have already cleared, either partially or fully, cannot be + # cleared again using this endpoint. + # + # @overload simulate_clearing(token:, amount: nil, request_options: {}) + # + # @param token [String] The transaction token returned from the /v1/simulate/authorize response. + # + # @param amount [Integer] Amount (in cents) to clear. Typically this will match the amount in the original + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::TransactionSimulateClearingResponse] + # + # @see Lithic::Models::TransactionSimulateClearingParams + def simulate_clearing(params) + parsed, options = Lithic::TransactionSimulateClearingParams.dump_request(params) + @client.request( + method: :post, + path: "v1/simulate/clearing", + body: parsed, + model: Lithic::Models::TransactionSimulateClearingResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionSimulateCreditAuthorizationAdviceParams} for more + # details. + # + # Simulates a credit authorization advice from the card network. This message + # indicates that the network approved a credit authorization on your behalf. + # + # @overload simulate_credit_authorization_advice(amount:, descriptor:, pan:, mcc: nil, merchant_acceptor_city: nil, merchant_acceptor_country: nil, merchant_acceptor_id: nil, merchant_acceptor_state: nil, request_options: {}) + # + # @param amount [Integer] Amount (in cents). Any value entered will be converted into a negative amount in + # + # @param descriptor [String] Merchant descriptor. + # + # @param pan [String] Sixteen digit card number. + # + # @param mcc [String] Merchant category code for the transaction to be simulated. A four-digit number + # + # @param merchant_acceptor_city [String] Merchant acceptor city + # + # @param merchant_acceptor_country [String] Merchant acceptor country code (ISO 3166-1 alpha-3) + # + # @param merchant_acceptor_id [String] Unique identifier to identify the payment card acceptor. + # + # @param merchant_acceptor_state [String] Merchant acceptor state/province (ISO 3166-2 subdivision code) + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::TransactionSimulateCreditAuthorizationAdviceResponse] + # + # @see Lithic::Models::TransactionSimulateCreditAuthorizationAdviceParams + def simulate_credit_authorization_advice(params) + parsed, options = Lithic::TransactionSimulateCreditAuthorizationAdviceParams.dump_request(params) + @client.request( + method: :post, + path: "v1/simulate/credit_authorization_advice", + body: parsed, + model: Lithic::Models::TransactionSimulateCreditAuthorizationAdviceResponse, + options: options + ) + end + + # Returns, or refunds, an amount back to a card. Returns simulated via this + # endpoint clear immediately, without prior authorization, and result in a + # `SETTLED` transaction status. + # + # @overload simulate_return(amount:, descriptor:, pan:, request_options: {}) + # + # @param amount [Integer] Amount (in cents) to authorize. + # + # @param descriptor [String] Merchant descriptor. + # + # @param pan [String] Sixteen digit card number. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::TransactionSimulateReturnResponse] + # + # @see Lithic::Models::TransactionSimulateReturnParams + def simulate_return(params) + parsed, options = Lithic::TransactionSimulateReturnParams.dump_request(params) + @client.request( + method: :post, + path: "v1/simulate/return", + body: parsed, + model: Lithic::Models::TransactionSimulateReturnResponse, + options: options + ) + end + + # Reverses a return, i.e. a credit transaction with a `SETTLED` status. Returns + # can be financial credit authorizations, or credit authorizations that have + # cleared. + # + # @overload simulate_return_reversal(token:, request_options: {}) + # + # @param token [String] The transaction token returned from the /v1/simulate/authorize response. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::TransactionSimulateReturnReversalResponse] + # + # @see Lithic::Models::TransactionSimulateReturnReversalParams + def simulate_return_reversal(params) + parsed, options = Lithic::TransactionSimulateReturnReversalParams.dump_request(params) + @client.request( + method: :post, + path: "v1/simulate/return_reversal", + body: parsed, + model: Lithic::Models::TransactionSimulateReturnReversalResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransactionSimulateVoidParams} for more details. + # + # Voids a pending authorization. If `amount` is not set, the full amount will be + # voided. Can be used on partially voided transactions but not partially cleared + # transactions. _Simulating an authorization expiry on credit authorizations or + # credit authorization advice is not currently supported but will be added soon._ + # + # @overload simulate_void(token:, amount: nil, type: nil, request_options: {}) + # + # @param token [String] The transaction token returned from the /v1/simulate/authorize response. + # + # @param amount [Integer] Amount (in cents) to void. Typically this will match the amount in the original + # + # @param type [Symbol, Lithic::Models::TransactionSimulateVoidParams::Type] Type of event to simulate. Defaults to `AUTHORIZATION_REVERSAL`. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::TransactionSimulateVoidResponse] + # + # @see Lithic::Models::TransactionSimulateVoidParams + def simulate_void(params) + parsed, options = Lithic::TransactionSimulateVoidParams.dump_request(params) + @client.request( + method: :post, + path: "v1/simulate/void", + body: parsed, + model: Lithic::Models::TransactionSimulateVoidResponse, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @enhanced_commercial_data = Lithic::Resources::Transactions::EnhancedCommercialData.new(client: client) + @events = Lithic::Resources::Transactions::Events.new(client: client) + end + end + end +end diff --git a/lib/lithic/resources/transactions/enhanced_commercial_data.rb b/lib/lithic/resources/transactions/enhanced_commercial_data.rb new file mode 100644 index 00000000..8cf8471e --- /dev/null +++ b/lib/lithic/resources/transactions/enhanced_commercial_data.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Transactions + class EnhancedCommercialData + # Get all L2/L3 enhanced commercial data associated with a transaction. Not + # available in sandbox. + # + # @overload retrieve(transaction_token, request_options: {}) + # + # @param transaction_token [String] The token of the transaction that the enhanced data is associated with. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Transactions::EnhancedCommercialDataRetrieveResponse] + # + # @see Lithic::Models::Transactions::EnhancedCommercialDataRetrieveParams + def retrieve(transaction_token, params = {}) + @client.request( + method: :get, + path: ["v1/transactions/%1$s/enhanced_commercial_data", transaction_token], + model: Lithic::Models::Transactions::EnhancedCommercialDataRetrieveResponse, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/lithic/resources/transactions/events.rb b/lib/lithic/resources/transactions/events.rb new file mode 100644 index 00000000..3e71d54f --- /dev/null +++ b/lib/lithic/resources/transactions/events.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Transactions + class Events + # @return [Lithic::Resources::Transactions::Events::EnhancedCommercialData] + attr_reader :enhanced_commercial_data + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + @enhanced_commercial_data = + Lithic::Resources::Transactions::Events::EnhancedCommercialData.new(client: client) + end + end + end + end +end diff --git a/lib/lithic/resources/transactions/events/enhanced_commercial_data.rb b/lib/lithic/resources/transactions/events/enhanced_commercial_data.rb new file mode 100644 index 00000000..47db88f9 --- /dev/null +++ b/lib/lithic/resources/transactions/events/enhanced_commercial_data.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Transactions + class Events + class EnhancedCommercialData + # Get L2/L3 enhanced commercial data associated with a transaction event. Not + # available in sandbox. + # + # @overload retrieve(event_token, request_options: {}) + # + # @param event_token [String] The token of the transaction event that the enhanced data is associated with. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Transactions::Events::EnhancedData] + # + # @see Lithic::Models::Transactions::Events::EnhancedCommercialDataRetrieveParams + def retrieve(event_token, params = {}) + @client.request( + method: :get, + path: ["v1/transactions/events/%1$s/enhanced_commercial_data", event_token], + model: Lithic::Transactions::Events::EnhancedData, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end + end + end +end diff --git a/lib/lithic/resources/transfer_limits.rb b/lib/lithic/resources/transfer_limits.rb new file mode 100644 index 00000000..68488490 --- /dev/null +++ b/lib/lithic/resources/transfer_limits.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class TransferLimits + # Get transfer limits for a specified date + # + # @overload list(date: nil, request_options: {}) + # + # @param date [Date] Date for which to retrieve transfer limits (ISO 8601 format) + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Internal::SinglePage] + # + # @see Lithic::Models::TransferLimitListParams + def list(params = {}) + parsed, options = Lithic::TransferLimitListParams.dump_request(params) + query = Lithic::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/transfer_limits", + query: query, + page: Lithic::Internal::SinglePage, + model: Lithic::TransferLimitsResponse::Data, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/transfers.rb b/lib/lithic/resources/transfers.rb new file mode 100644 index 00000000..a8709c61 --- /dev/null +++ b/lib/lithic/resources/transfers.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Transfers + # @deprecated + # + # Some parameter documentations has been truncated, see + # {Lithic::Models::TransferCreateParams} for more details. + # + # Transfer funds between two financial accounts or between a financial account and + # card + # + # @overload create(amount:, from:, to:, token: nil, memo: nil, request_options: {}) + # + # @param amount [Integer] Amount to be transferred in the currency’s smallest unit (e.g., cents for USD). + # + # @param from [String] Globally unique identifier for the financial account or card that will send the + # + # @param to [String] Globally unique identifier for the financial account or card that will receive t + # + # @param token [String] Customer-provided token that will serve as an idempotency token. This token will + # + # @param memo [String] Optional descriptor for the transfer. + # + # @param request_options [Lithic::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Lithic::Models::Transfer] + # + # @see Lithic::Models::TransferCreateParams + def create(params) + parsed, options = Lithic::TransferCreateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/transfer", + body: parsed, + model: Lithic::Transfer, + options: options + ) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/resources/webhooks.rb b/lib/lithic/resources/webhooks.rb new file mode 100644 index 00000000..e689895f --- /dev/null +++ b/lib/lithic/resources/webhooks.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Lithic + module Resources + class Webhooks + # @param payload [String] The raw webhook payload as a string + # + # @param headers [Hash{String=>String}] The raw HTTP headers that came with the payload + # + # @param key [String, nil] The webhook signing key + # + # @return [Lithic::Models::AccountHolderCreatedWebhookEvent, Lithic::Models::ParsedWebhookEvent::KYBPayload, Lithic::Models::ParsedWebhookEvent::KYCPayload, Lithic::Models::ParsedWebhookEvent::LegacyPayload, Lithic::Models::AccountHolderVerificationWebhookEvent, Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent, Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent, Lithic::Models::CardAuthorizationChallengeWebhookEvent, Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent, Lithic::Models::AuthRulesBacktestReportCreatedWebhookEvent, Lithic::Models::BalanceUpdatedWebhookEvent, Lithic::Models::BookTransferTransactionCreatedWebhookEvent, Lithic::Models::BookTransferTransactionUpdatedWebhookEvent, Lithic::Models::CardCreatedWebhookEvent, Lithic::Models::CardConvertedWebhookEvent, Lithic::Models::CardRenewedWebhookEvent, Lithic::Models::CardReissuedWebhookEvent, Lithic::Models::CardShippedWebhookEvent, Lithic::Models::CardUpdatedWebhookEvent, Lithic::Models::CardTransactionUpdatedWebhookEvent, Lithic::Models::CardTransactionEnhancedDataCreatedWebhookEvent, Lithic::Models::CardTransactionEnhancedDataUpdatedWebhookEvent, Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent, Lithic::Models::DigitalWalletTokenizationResultWebhookEvent, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent, Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent, Lithic::Models::DigitalWalletTokenizationUpdatedWebhookEvent, Lithic::Models::DisputeUpdatedWebhookEvent, Lithic::Models::DisputeEvidenceUploadFailedWebhookEvent, Lithic::Models::ExternalBankAccountCreatedWebhookEvent, Lithic::Models::ExternalBankAccountUpdatedWebhookEvent, Lithic::Models::ExternalPaymentCreatedWebhookEvent, Lithic::Models::ExternalPaymentUpdatedWebhookEvent, Lithic::Models::FinancialAccountCreatedWebhookEvent, Lithic::Models::FinancialAccountUpdatedWebhookEvent, Lithic::Models::FundingEventCreatedWebhookEvent, Lithic::Models::LoanTapeCreatedWebhookEvent, Lithic::Models::LoanTapeUpdatedWebhookEvent, Lithic::Models::ManagementOperationCreatedWebhookEvent, Lithic::Models::ManagementOperationUpdatedWebhookEvent, Lithic::Models::InternalTransactionCreatedWebhookEvent, Lithic::Models::InternalTransactionUpdatedWebhookEvent, Lithic::Models::NetworkTotalCreatedWebhookEvent, Lithic::Models::NetworkTotalUpdatedWebhookEvent, Lithic::Models::PaymentTransactionCreatedWebhookEvent, Lithic::Models::PaymentTransactionUpdatedWebhookEvent, Lithic::Models::SettlementReportUpdatedWebhookEvent, Lithic::Models::StatementsCreatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationCreatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationUpdatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent, Lithic::Models::TokenizationApprovalRequestWebhookEvent, Lithic::Models::TokenizationResultWebhookEvent, Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent, Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent, Lithic::Models::TokenizationUpdatedWebhookEvent, Lithic::Models::ThreeDSAuthenticationApprovalRequestWebhookEvent, Lithic::Models::DisputeTransactionCreatedWebhookEvent, Lithic::Models::DisputeTransactionUpdatedWebhookEvent] + def parsed(payload, headers:, key: @client.webhook_secret) + if key.nil? + raise ArgumentError.new("Cannot verify a webhook without a key on either the client's webhook_secret or passed in as an argument") + end + + ::StandardWebhooks::Webhook.new(key).verify(payload, headers) + + parsed = JSON.parse(payload, symbolize_names: true) + Lithic::Internal::Type::Converter.coerce(Lithic::Models::ParsedWebhookEvent, parsed) + end + + # @api private + # + # @param client [Lithic::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/lithic/version.rb b/lib/lithic/version.rb new file mode 100644 index 00000000..2f7f1028 --- /dev/null +++ b/lib/lithic/version.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +module Lithic + VERSION = "0.16.0" +end diff --git a/lithic.gemspec b/lithic.gemspec new file mode 100644 index 00000000..83ad0ee2 --- /dev/null +++ b/lithic.gemspec @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +require_relative "lib/lithic/version" + +Gem::Specification.new do |s| + s.name = "lithic" + s.version = Lithic::VERSION + s.summary = "Ruby library to access the Lithic API" + s.authors = ["Lithic"] + s.email = "sdk-feedback@lithic.com" + s.homepage = "https://gemdocs.org/gems/lithic" + s.metadata["homepage_uri"] = s.homepage + s.metadata["source_code_uri"] = "https://github.com/lithic-com/lithic-ruby" + s.metadata["rubygems_mfa_required"] = false.to_s + s.required_ruby_version = ">= 3.2.0" + + 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.add_dependency "standardwebhooks" +end diff --git a/manifest.yaml b/manifest.yaml new file mode 100644 index 00000000..a1fd74a9 --- /dev/null +++ b/manifest.yaml @@ -0,0 +1,17 @@ +dependencies: + - English + - base64 + - cgi + - date + - erb + - etc + - json + - net/http + - openssl + - pathname + - rbconfig + - securerandom + - set + - stringio + - time + - uri diff --git a/rbi/lithic/client.rbi b/rbi/lithic/client.rbi new file mode 100644 index 00000000..3ec35230 --- /dev/null +++ b/rbi/lithic/client.rbi @@ -0,0 +1,186 @@ +# typed: strong + +module Lithic + class Client < Lithic::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) + + ENVIRONMENTS = + T.let( + { + production: "https://api.lithic.com", + sandbox: "https://sandbox.lithic.com" + }, + T::Hash[Symbol, String] + ) + + sig { returns(String) } + attr_reader :api_key + + sig { returns(T.nilable(String)) } + attr_reader :webhook_secret + + sig { returns(Lithic::Resources::Accounts) } + attr_reader :accounts + + sig { returns(Lithic::Resources::AccountHolders) } + attr_reader :account_holders + + sig { returns(Lithic::Resources::AuthRules) } + attr_reader :auth_rules + + sig { returns(Lithic::Resources::TransactionMonitoring) } + attr_reader :transaction_monitoring + + sig { returns(Lithic::Resources::AuthStreamEnrollment) } + attr_reader :auth_stream_enrollment + + sig { returns(Lithic::Resources::TokenizationDecisioning) } + attr_reader :tokenization_decisioning + + sig { returns(Lithic::Resources::Tokenizations) } + attr_reader :tokenizations + + sig { returns(Lithic::Resources::Cards) } + attr_reader :cards + + sig { returns(Lithic::Resources::CardAuthorizations) } + attr_reader :card_authorizations + + sig { returns(Lithic::Resources::CardBulkOrders) } + attr_reader :card_bulk_orders + + sig { returns(Lithic::Resources::Balances) } + attr_reader :balances + + sig { returns(Lithic::Resources::Disputes) } + attr_reader :disputes + + sig { returns(Lithic::Resources::DisputesV2) } + attr_reader :disputes_v2 + + sig { returns(Lithic::Resources::Events) } + attr_reader :events + + sig { returns(Lithic::Resources::Transfers) } + attr_reader :transfers + + sig { returns(Lithic::Resources::FinancialAccounts) } + attr_reader :financial_accounts + + sig { returns(Lithic::Resources::Transactions) } + attr_reader :transactions + + sig { returns(Lithic::Resources::ResponderEndpoints) } + attr_reader :responder_endpoints + + sig { returns(Lithic::Resources::ExternalBankAccounts) } + attr_reader :external_bank_accounts + + sig { returns(Lithic::Resources::Payments) } + attr_reader :payments + + sig { returns(Lithic::Resources::ThreeDS) } + attr_reader :three_ds + + sig { returns(Lithic::Resources::Reports) } + attr_reader :reports + + sig { returns(Lithic::Resources::CardPrograms) } + attr_reader :card_programs + + sig { returns(Lithic::Resources::DigitalCardArt) } + attr_reader :digital_card_art + + sig { returns(Lithic::Resources::BookTransfers) } + attr_reader :book_transfers + + sig { returns(Lithic::Resources::CreditProducts) } + attr_reader :credit_products + + sig { returns(Lithic::Resources::ExternalPayments) } + attr_reader :external_payments + + sig { returns(Lithic::Resources::ManagementOperations) } + attr_reader :management_operations + + sig { returns(Lithic::Resources::InternalTransaction) } + attr_reader :internal_transaction + + sig { returns(Lithic::Resources::FundingEvents) } + attr_reader :funding_events + + sig { returns(Lithic::Resources::Fraud) } + attr_reader :fraud + + sig { returns(Lithic::Resources::NetworkPrograms) } + attr_reader :network_programs + + sig { returns(Lithic::Resources::Holds) } + attr_reader :holds + + sig { returns(Lithic::Resources::AccountActivity) } + attr_reader :account_activity + + sig { returns(Lithic::Resources::TransferLimits) } + attr_reader :transfer_limits + + sig { returns(Lithic::Resources::Webhooks) } + attr_reader :webhooks + + # Status of api + sig do + params(request_options: Lithic::RequestOptions::OrHash).returns( + Lithic::APIStatus + ) + end + def api_status(request_options: {}) + end + + # @api private + sig { override.returns(T::Hash[String, String]) } + private def auth_headers + end + + # Creates and returns a new client for interacting with the API. + sig do + params( + api_key: T.nilable(String), + webhook_secret: T.nilable(String), + environment: T.nilable(T.any(Symbol, 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["LITHIC_API_KEY"]` + api_key: ENV["LITHIC_API_KEY"], + # Defaults to `ENV["LITHIC_WEBHOOK_SECRET"]` + webhook_secret: ENV["LITHIC_WEBHOOK_SECRET"], + # Specifies the environment to use for the API. + # + # Each environment maps to a different base URL: + # + # - `production` corresponds to `https://api.lithic.com` + # - `sandbox` corresponds to `https://sandbox.lithic.com` + environment: nil, + # Override the default base URL for the API, e.g., + # `"https://api.example.com/v2/"`. Defaults to `ENV["LITHIC_BASE_URL"]` + base_url: ENV["LITHIC_BASE_URL"], + # Max number of retries to attempt after a failed retryable request. + max_retries: Lithic::Client::DEFAULT_MAX_RETRIES, + timeout: Lithic::Client::DEFAULT_TIMEOUT_IN_SECONDS, + initial_retry_delay: Lithic::Client::DEFAULT_INITIAL_RETRY_DELAY, + max_retry_delay: Lithic::Client::DEFAULT_MAX_RETRY_DELAY + ) + end + end +end diff --git a/rbi/lithic/errors.rbi b/rbi/lithic/errors.rbi new file mode 100644 index 00000000..8ccba80f --- /dev/null +++ b/rbi/lithic/errors.rbi @@ -0,0 +1,205 @@ +# typed: strong + +module Lithic + module Errors + class Error < StandardError + sig { returns(T.nilable(StandardError)) } + attr_accessor :cause + end + + class ConversionError < Lithic::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 < Lithic::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 < Lithic::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 < Lithic::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 < Lithic::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 < Lithic::Errors::APIStatusError + HTTP_STATUS = 400 + end + + class AuthenticationError < Lithic::Errors::APIStatusError + HTTP_STATUS = 401 + end + + class PermissionDeniedError < Lithic::Errors::APIStatusError + HTTP_STATUS = 403 + end + + class NotFoundError < Lithic::Errors::APIStatusError + HTTP_STATUS = 404 + end + + class ConflictError < Lithic::Errors::APIStatusError + HTTP_STATUS = 409 + end + + class UnprocessableEntityError < Lithic::Errors::APIStatusError + HTTP_STATUS = 422 + end + + class RateLimitError < Lithic::Errors::APIStatusError + HTTP_STATUS = 429 + end + + class InternalServerError < Lithic::Errors::APIStatusError + HTTP_STATUS = T.let((500..), T::Range[Integer]) + end + end +end diff --git a/rbi/lithic/file_part.rbi b/rbi/lithic/file_part.rbi new file mode 100644 index 00000000..974c9775 --- /dev/null +++ b/rbi/lithic/file_part.rbi @@ -0,0 +1,37 @@ +# typed: strong + +module Lithic + 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/lithic/internal.rbi b/rbi/lithic/internal.rbi new file mode 100644 index 00000000..dae8f273 --- /dev/null +++ b/rbi/lithic/internal.rbi @@ -0,0 +1,16 @@ +# typed: strong + +module Lithic + module Internal + extend Lithic::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 { T.any(Pathname, StringIO, IO, String, Lithic::FilePart) } + + OMIT = T.let(Object.new.freeze, T.anything) + end +end diff --git a/rbi/lithic/internal/cursor_page.rbi b/rbi/lithic/internal/cursor_page.rbi new file mode 100644 index 00000000..fbf395c9 --- /dev/null +++ b/rbi/lithic/internal/cursor_page.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Lithic + module Internal + class CursorPage + include Lithic::Internal::Type::BasePage + + Elem = type_member + + sig { returns(T.nilable(T::Array[Elem])) } + attr_accessor :data + + sig { returns(T::Boolean) } + attr_accessor :has_more + + # @api private + sig { returns(String) } + def inspect + end + end + end +end diff --git a/rbi/lithic/internal/single_page.rbi b/rbi/lithic/internal/single_page.rbi new file mode 100644 index 00000000..bc482e15 --- /dev/null +++ b/rbi/lithic/internal/single_page.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Lithic + module Internal + class SinglePage + include Lithic::Internal::Type::BasePage + + Elem = type_member + + sig { returns(T.nilable(T::Array[Elem])) } + attr_accessor :data + + sig { returns(T::Boolean) } + attr_accessor :has_more + + # @api private + sig { returns(String) } + def inspect + end + end + end +end diff --git a/rbi/lithic/internal/transport/base_client.rbi b/rbi/lithic/internal/transport/base_client.rbi new file mode 100644 index 00000000..1e89d8c5 --- /dev/null +++ b/rbi/lithic/internal/transport/base_client.rbi @@ -0,0 +1,297 @@ +# typed: strong + +module Lithic + module Internal + module Transport + # @api private + class BaseClient + extend Lithic::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[ + Lithic::Internal::Type::BasePage[ + Lithic::Internal::Type::BaseModel + ] + ] + ), + stream: T.nilable(T::Class[T.anything]), + model: T.nilable(Lithic::Internal::Type::Converter::Input), + options: T.nilable(Lithic::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: Lithic::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: Lithic::Internal::Transport::BaseClient::RequestInput, + status: Integer, + response_headers: T::Hash[String, String] + ).returns(Lithic::Internal::Transport::BaseClient::RequestInput) + end + def follow_redirect(request, status:, response_headers:) + end + + # @api private + sig do + params( + status: T.any(Integer, Lithic::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(Lithic::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: Lithic::Internal::Transport::BaseClient::RequestComponents, + opts: Lithic::Internal::AnyHash + ) + .returns(Lithic::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: Lithic::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: Lithic::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[ + Lithic::Internal::Type::BasePage[ + Lithic::Internal::Type::BaseModel + ] + ] + ), + stream: T.nilable(T::Class[T.anything]), + model: T.nilable(Lithic::Internal::Type::Converter::Input), + options: T.nilable(Lithic::RequestOptions::OrHash) + ).returns(T.anything) + end + def request( + method, + path, + query: {}, + headers: {}, + body: nil, + unwrap: nil, + page: nil, + stream: nil, + model: Lithic::Internal::Type::Unknown, + options: {} + ) + end + + # @api private + sig { returns(String) } + def inspect + end + end + end + end +end diff --git a/rbi/lithic/internal/transport/pooled_net_requester.rbi b/rbi/lithic/internal/transport/pooled_net_requester.rbi new file mode 100644 index 00000000..3748e6ac --- /dev/null +++ b/rbi/lithic/internal/transport/pooled_net_requester.rbi @@ -0,0 +1,82 @@ +# typed: strong + +module Lithic + module Internal + module Transport + # @api private + class PooledNetRequester + extend Lithic::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: Lithic::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: Lithic::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: Lithic::Internal::Transport::PooledNetRequester::DEFAULT_MAX_CONNECTIONS + ) + end + end + end + end +end diff --git a/rbi/lithic/internal/type/array_of.rbi b/rbi/lithic/internal/type/array_of.rbi new file mode 100644 index 00000000..362cdb66 --- /dev/null +++ b/rbi/lithic/internal/type/array_of.rbi @@ -0,0 +1,104 @@ +# typed: strong + +module Lithic + module Internal + module Type + # @api private + # + # Array of items of a given type. + class ArrayOf + include Lithic::Internal::Type::Converter + include Lithic::Internal::Util::SorbetRuntimeSupport + + abstract! + + Elem = type_member(:out) + + sig do + params( + type_info: + T.any( + Lithic::Internal::AnyHash, + T.proc.returns(Lithic::Internal::Type::Converter::Input), + Lithic::Internal::Type::Converter::Input + ), + spec: Lithic::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: Lithic::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: Lithic::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( + Lithic::Internal::AnyHash, + T.proc.returns(Lithic::Internal::Type::Converter::Input), + Lithic::Internal::Type::Converter::Input + ), + spec: Lithic::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/lithic/internal/type/base_model.rbi b/rbi/lithic/internal/type/base_model.rbi new file mode 100644 index 00000000..58545870 --- /dev/null +++ b/rbi/lithic/internal/type/base_model.rbi @@ -0,0 +1,299 @@ +# typed: strong + +module Lithic + module Internal + module Type + class BaseModel + extend Lithic::Internal::Type::Converter + extend Lithic::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(Lithic::Internal::Type::BaseModel, Lithic::Internal::AnyHash) + end + + class << self + # @api private + # + # Assumes superclass fields are totally defined before fields are accessed / + # defined on subclasses. + sig { params(child: Lithic::Internal::Type::BaseModel).void } + def inherited(child) + end + + # @api private + sig do + returns( + T::Hash[ + Symbol, + T.all( + Lithic::Internal::Type::BaseModel::KnownField, + { + type_fn: + T.proc.returns(Lithic::Internal::Type::Converter::Input) + } + ) + ] + ) + end + def known_fields + end + + # @api private + sig do + returns( + T::Hash[ + Symbol, + T.all( + Lithic::Internal::Type::BaseModel::KnownField, + { type: Lithic::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(Lithic::Internal::Type::Converter::Input) + ), + union: + T.nilable( + T.proc.returns(Lithic::Internal::Type::Converter::Input) + ), + api_name: Symbol, + nil?: T::Boolean + }, + T.proc.returns(Lithic::Internal::Type::Converter::Input), + Lithic::Internal::Type::Converter::Input + ), + spec: Lithic::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( + Lithic::Internal::AnyHash, + T.proc.returns(Lithic::Internal::Type::Converter::Input), + Lithic::Internal::Type::Converter::Input + ), + spec: Lithic::Internal::AnyHash + ).void + end + def required(name_sym, type_info, spec = {}) + end + + # @api private + sig do + params( + name_sym: Symbol, + type_info: + T.any( + Lithic::Internal::AnyHash, + T.proc.returns(Lithic::Internal::Type::Converter::Input), + Lithic::Internal::Type::Converter::Input + ), + spec: Lithic::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( + Lithic::Internal::Type::BaseModel, + T::Hash[T.anything, T.anything], + T.anything + ), + state: Lithic::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: Lithic::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: Lithic::Internal::Type::BaseModel, + convert: T::Boolean + ).returns(Lithic::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(Lithic::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(Lithic::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(Lithic::Internal::AnyHash) } + def deep_to_h + end + + sig do + params(keys: T.nilable(T::Array[Symbol])).returns( + Lithic::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], + Lithic::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/lithic/internal/type/base_page.rbi b/rbi/lithic/internal/type/base_page.rbi new file mode 100644 index 00000000..b26b1efd --- /dev/null +++ b/rbi/lithic/internal/type/base_page.rbi @@ -0,0 +1,42 @@ +# typed: strong + +module Lithic + 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: Lithic::Internal::Transport::BaseClient, + req: Lithic::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/lithic/internal/type/boolean.rbi b/rbi/lithic/internal/type/boolean.rbi new file mode 100644 index 00000000..59aa5083 --- /dev/null +++ b/rbi/lithic/internal/type/boolean.rbi @@ -0,0 +1,58 @@ +# typed: strong + +module Lithic + module Internal + module Type + # @api private + # + # Ruby has no Boolean class; this is something for models to refer to. + class Boolean + extend Lithic::Internal::Type::Converter + extend Lithic::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: Lithic::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: Lithic::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/lithic/internal/type/converter.rbi b/rbi/lithic/internal/type/converter.rbi new file mode 100644 index 00000000..02189511 --- /dev/null +++ b/rbi/lithic/internal/type/converter.rbi @@ -0,0 +1,204 @@ +# typed: strong + +module Lithic + module Internal + module Type + # @api private + module Converter + extend Lithic::Internal::Util::SorbetRuntimeSupport + + Input = + T.type_alias do + T.any(Lithic::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: Lithic::Internal::Type::Converter::CoerceState + ) + .returns(T.anything) + end + def coerce(value, state:) + end + + # @api private + sig do + overridable + .params( + value: T.anything, + state: Lithic::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(Lithic::Internal::Type::Converter::Input) + ), + union: + T.nilable( + T.proc.returns(Lithic::Internal::Type::Converter::Input) + ) + }, + T.proc.returns(Lithic::Internal::Type::Converter::Input), + Lithic::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(Lithic::Internal::Type::Converter::Input) + ), + union: + T.nilable( + T.proc.returns(Lithic::Internal::Type::Converter::Input) + ) + }, + T.proc.returns(Lithic::Internal::Type::Converter::Input), + Lithic::Internal::Type::Converter::Input + ), + spec: + T.any( + { + const: + T.nilable( + T.any(NilClass, T::Boolean, Integer, Float, Symbol) + ), + enum: + T.nilable( + T.proc.returns(Lithic::Internal::Type::Converter::Input) + ), + union: + T.nilable( + T.proc.returns(Lithic::Internal::Type::Converter::Input) + ) + }, + T.proc.returns(Lithic::Internal::Type::Converter::Input), + Lithic::Internal::Type::Converter::Input + ) + ).returns(Lithic::Internal::AnyHash) + end + def self.meta_info(type_info, spec) + end + + # @api private + sig do + params(translate_names: T::Boolean).returns( + Lithic::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: Lithic::Internal::Type::Converter::Input, + value: T.anything, + state: Lithic::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: Lithic::Internal::Type::Converter.new_coerce_state + ) + end + + # @api private + sig do + params( + target: Lithic::Internal::Type::Converter::Input, + value: T.anything, + state: Lithic::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/lithic/internal/type/enum.rbi b/rbi/lithic/internal/type/enum.rbi new file mode 100644 index 00000000..e66931a4 --- /dev/null +++ b/rbi/lithic/internal/type/enum.rbi @@ -0,0 +1,82 @@ +# typed: strong + +module Lithic + 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 Lithic::Internal::Type::Converter + include Lithic::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: Lithic::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: Lithic::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/lithic/internal/type/file_input.rbi b/rbi/lithic/internal/type/file_input.rbi new file mode 100644 index 00000000..1e2662bf --- /dev/null +++ b/rbi/lithic/internal/type/file_input.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module Lithic + module Internal + module Type + # @api private + # + # Either `Pathname` or `StringIO`, or `IO`, or + # `Lithic::Internal::Type::FileInput`. + # + # Note: when `IO` is used, all retries are disabled, since many IO` streams are + # not rewindable. + class FileInput + extend Lithic::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: Lithic::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: Lithic::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/lithic/internal/type/hash_of.rbi b/rbi/lithic/internal/type/hash_of.rbi new file mode 100644 index 00000000..3d2503f3 --- /dev/null +++ b/rbi/lithic/internal/type/hash_of.rbi @@ -0,0 +1,104 @@ +# typed: strong + +module Lithic + module Internal + module Type + # @api private + # + # Hash of items of a given type. + class HashOf + include Lithic::Internal::Type::Converter + include Lithic::Internal::Util::SorbetRuntimeSupport + + abstract! + + Elem = type_member(:out) + + sig do + params( + type_info: + T.any( + Lithic::Internal::AnyHash, + T.proc.returns(Lithic::Internal::Type::Converter::Input), + Lithic::Internal::Type::Converter::Input + ), + spec: Lithic::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: Lithic::Internal::Type::Converter::CoerceState + ) + .returns(T.any(Lithic::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: Lithic::Internal::Type::Converter::DumpState + ) + .returns(T.any(Lithic::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( + Lithic::Internal::AnyHash, + T.proc.returns(Lithic::Internal::Type::Converter::Input), + Lithic::Internal::Type::Converter::Input + ), + spec: Lithic::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/lithic/internal/type/request_parameters.rbi b/rbi/lithic/internal/type/request_parameters.rbi new file mode 100644 index 00000000..8751ac5c --- /dev/null +++ b/rbi/lithic/internal/type/request_parameters.rbi @@ -0,0 +1,29 @@ +# typed: strong + +module Lithic + module Internal + module Type + # @api private + module RequestParameters + # Options to specify HTTP behaviour for this request. + sig { returns(Lithic::RequestOptions) } + attr_reader :request_options + + sig { params(request_options: Lithic::RequestOptions::OrHash).void } + attr_writer :request_options + + # @api private + module Converter + # @api private + sig do + params(params: T.anything).returns( + [T.anything, Lithic::Internal::AnyHash] + ) + end + def dump_request(params) + end + end + end + end + end +end diff --git a/rbi/lithic/internal/type/union.rbi b/rbi/lithic/internal/type/union.rbi new file mode 100644 index 00000000..864e94c0 --- /dev/null +++ b/rbi/lithic/internal/type/union.rbi @@ -0,0 +1,126 @@ +# typed: strong + +module Lithic + module Internal + module Type + # @api private + module Union + include Lithic::Internal::Type::Converter + include Lithic::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(Lithic::Internal::Type::Converter::Input), + Lithic::Internal::AnyHash + ] + ] + ) + end + private def known_variants + end + + # @api private + sig do + returns( + T::Array[[T.nilable(Symbol), T.anything, Lithic::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, + Lithic::Internal::AnyHash, + T.proc.returns(T.anything), + T.anything + ), + spec: + T.any( + Lithic::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: Lithic::Internal::Type::Converter::CoerceState + ) + .returns(T.anything) + end + def coerce(value, state:) + end + + # @api private + sig do + override + .params( + value: T.anything, + state: Lithic::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/lithic/internal/type/unknown.rbi b/rbi/lithic/internal/type/unknown.rbi new file mode 100644 index 00000000..0afb189b --- /dev/null +++ b/rbi/lithic/internal/type/unknown.rbi @@ -0,0 +1,58 @@ +# typed: strong + +module Lithic + module Internal + module Type + # @api private + # + # When we don't know what to expect for the value. + class Unknown + extend Lithic::Internal::Type::Converter + extend Lithic::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: Lithic::Internal::Type::Converter::CoerceState + ) + .returns(T.anything) + end + def coerce(value, state:) + end + + # @api private + sig do + override + .params( + value: T.anything, + state: Lithic::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/lithic/internal/util.rbi b/rbi/lithic/internal/util.rbi new file mode 100644 index 00000000..2971ee60 --- /dev/null +++ b/rbi/lithic/internal/util.rbi @@ -0,0 +1,512 @@ +# typed: strong + +module Lithic + module Internal + # @api private + module Util + extend Lithic::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( + Lithic::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( + Lithic::Internal::Util::ParsedUri + ) + end + def parse_uri(url) + end + + # @api private + sig do + params(parsed: Lithic::Internal::Util::ParsedUri).returns( + URI::Generic + ) + end + def unparse_uri(parsed) + end + + # @api private + sig do + params( + lhs: Lithic::Internal::Util::ParsedUri, + rhs: Lithic::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: Lithic::Internal::AnyHash).returns( + Lithic::Internal::AnyHash + ) + end + def encode_query_params(query) + end + + # @api private + sig do + params( + collection: Lithic::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[Lithic::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(Lithic::Internal::Util::SorbetRuntimeSupport, T.anything) + ).returns(T.anything) + end + def to_sorbet_type(type) + end + end + end + end + end +end diff --git a/rbi/lithic/models.rbi b/rbi/lithic/models.rbi new file mode 100644 index 00000000..1ec0dbd0 --- /dev/null +++ b/rbi/lithic/models.rbi @@ -0,0 +1,648 @@ +# typed: strong + +module Lithic + Account = Lithic::Models::Account + + AccountActivityListParams = Lithic::Models::AccountActivityListParams + + AccountActivityRetrieveTransactionParams = + Lithic::Models::AccountActivityRetrieveTransactionParams + + AccountFinancialAccountType = Lithic::Models::AccountFinancialAccountType + + AccountHolder = Lithic::Models::AccountHolder + + AccountHolderCreatedWebhookEvent = + Lithic::Models::AccountHolderCreatedWebhookEvent + + AccountHolderCreateParams = Lithic::Models::AccountHolderCreateParams + + AccountHolderDocumentUpdatedWebhookEvent = + Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent + + AccountHolderListDocumentsParams = + Lithic::Models::AccountHolderListDocumentsParams + + AccountHolderListParams = Lithic::Models::AccountHolderListParams + + AccountHolderRetrieveDocumentParams = + Lithic::Models::AccountHolderRetrieveDocumentParams + + AccountHolderRetrieveParams = Lithic::Models::AccountHolderRetrieveParams + + AccountHolders = Lithic::Models::AccountHolders + + AccountHolderSimulateEnrollmentDocumentReviewParams = + Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams + + AccountHolderSimulateEnrollmentReviewParams = + Lithic::Models::AccountHolderSimulateEnrollmentReviewParams + + AccountHolderUpdatedWebhookEvent = + Lithic::Models::AccountHolderUpdatedWebhookEvent + + AccountHolderUpdateParams = Lithic::Models::AccountHolderUpdateParams + + AccountHolderUploadDocumentParams = + Lithic::Models::AccountHolderUploadDocumentParams + + AccountHolderVerificationWebhookEvent = + Lithic::Models::AccountHolderVerificationWebhookEvent + + AccountListParams = Lithic::Models::AccountListParams + + AccountRetrieveParams = Lithic::Models::AccountRetrieveParams + + AccountRetrieveSignalsParams = Lithic::Models::AccountRetrieveSignalsParams + + AccountRetrieveSpendLimitsParams = + Lithic::Models::AccountRetrieveSpendLimitsParams + + AccountSpendLimits = Lithic::Models::AccountSpendLimits + + AccountUpdateParams = Lithic::Models::AccountUpdateParams + + Address = Lithic::Models::Address + + AddressUpdate = Lithic::Models::AddressUpdate + + APIStatus = Lithic::Models::APIStatus + + AuthRules = Lithic::Models::AuthRules + + AuthRulesBacktestReportCreatedWebhookEvent = + Lithic::Models::AuthRulesBacktestReportCreatedWebhookEvent + + AuthStreamEnrollmentRetrieveSecretParams = + Lithic::Models::AuthStreamEnrollmentRetrieveSecretParams + + AuthStreamEnrollmentRotateSecretParams = + Lithic::Models::AuthStreamEnrollmentRotateSecretParams + + AuthStreamSecret = Lithic::Models::AuthStreamSecret + + Balance = Lithic::Models::Balance + + BalanceListParams = Lithic::Models::BalanceListParams + + BalanceUpdatedWebhookEvent = Lithic::Models::BalanceUpdatedWebhookEvent + + BookTransferCreateParams = Lithic::Models::BookTransferCreateParams + + BookTransferListParams = Lithic::Models::BookTransferListParams + + BookTransferResponse = Lithic::Models::BookTransferResponse + + BookTransferRetrieveParams = Lithic::Models::BookTransferRetrieveParams + + BookTransferRetryParams = Lithic::Models::BookTransferRetryParams + + BookTransferReverseParams = Lithic::Models::BookTransferReverseParams + + BookTransferTransactionCreatedWebhookEvent = + Lithic::Models::BookTransferTransactionCreatedWebhookEvent + + BookTransferTransactionUpdatedWebhookEvent = + Lithic::Models::BookTransferTransactionUpdatedWebhookEvent + + Card = Lithic::Models::Card + + CardAuthorization = Lithic::Models::CardAuthorization + + CardAuthorizationApprovalRequestWebhookEvent = + Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent + + CardAuthorizationChallengeResponseParams = + Lithic::Models::CardAuthorizationChallengeResponseParams + + CardAuthorizationChallengeResponseWebhookEvent = + Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent + + CardAuthorizationChallengeWebhookEvent = + Lithic::Models::CardAuthorizationChallengeWebhookEvent + + CardBulkOrder = Lithic::Models::CardBulkOrder + + CardBulkOrderCreateParams = Lithic::Models::CardBulkOrderCreateParams + + CardBulkOrderListParams = Lithic::Models::CardBulkOrderListParams + + CardBulkOrderRetrieveParams = Lithic::Models::CardBulkOrderRetrieveParams + + CardBulkOrderUpdateParams = Lithic::Models::CardBulkOrderUpdateParams + + CardConvertedWebhookEvent = Lithic::Models::CardConvertedWebhookEvent + + CardConvertPhysicalParams = Lithic::Models::CardConvertPhysicalParams + + CardCreatedWebhookEvent = Lithic::Models::CardCreatedWebhookEvent + + CardCreateParams = Lithic::Models::CardCreateParams + + CardEmbedParams = Lithic::Models::CardEmbedParams + + CardholderAuthentication = Lithic::Models::CardholderAuthentication + + CardListParams = Lithic::Models::CardListParams + + CardProgram = Lithic::Models::CardProgram + + CardProgramListParams = Lithic::Models::CardProgramListParams + + CardProgramRetrieveParams = Lithic::Models::CardProgramRetrieveParams + + CardProvisionParams = Lithic::Models::CardProvisionParams + + CardReissuedWebhookEvent = Lithic::Models::CardReissuedWebhookEvent + + CardReissueParams = Lithic::Models::CardReissueParams + + CardRenewedWebhookEvent = Lithic::Models::CardRenewedWebhookEvent + + CardRenewParams = Lithic::Models::CardRenewParams + + CardRetrieveParams = Lithic::Models::CardRetrieveParams + + CardRetrieveSignalsParams = Lithic::Models::CardRetrieveSignalsParams + + CardRetrieveSpendLimitsParams = Lithic::Models::CardRetrieveSpendLimitsParams + + Cards = Lithic::Models::Cards + + CardSearchByPanParams = Lithic::Models::CardSearchByPanParams + + CardShippedWebhookEvent = Lithic::Models::CardShippedWebhookEvent + + CardSpendLimits = Lithic::Models::CardSpendLimits + + CardTransactionEnhancedDataCreatedWebhookEvent = + Lithic::Models::CardTransactionEnhancedDataCreatedWebhookEvent + + CardTransactionEnhancedDataUpdatedWebhookEvent = + Lithic::Models::CardTransactionEnhancedDataUpdatedWebhookEvent + + CardTransactionUpdatedWebhookEvent = + Lithic::Models::CardTransactionUpdatedWebhookEvent + + CardUpdatedWebhookEvent = Lithic::Models::CardUpdatedWebhookEvent + + CardUpdateParams = Lithic::Models::CardUpdateParams + + CardWebProvisionParams = Lithic::Models::CardWebProvisionParams + + Carrier = Lithic::Models::Carrier + + CategoryDetails = Lithic::Models::CategoryDetails + + ClientAPIStatusParams = Lithic::Models::ClientAPIStatusParams + + CreditProducts = Lithic::Models::CreditProducts + + Currency = Lithic::Models::Currency + + Device = Lithic::Models::Device + + DigitalCardArtAPI = Lithic::Models::DigitalCardArtAPI + + DigitalCardArtListParams = Lithic::Models::DigitalCardArtListParams + + DigitalCardArtRetrieveParams = Lithic::Models::DigitalCardArtRetrieveParams + + DigitalWalletTokenizationApprovalRequestWebhookEvent = + Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent + + DigitalWalletTokenizationResultWebhookEvent = + Lithic::Models::DigitalWalletTokenizationResultWebhookEvent + + DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent = + Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent + + DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent = + Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent + + DigitalWalletTokenizationUpdatedWebhookEvent = + Lithic::Models::DigitalWalletTokenizationUpdatedWebhookEvent + + Dispute = Lithic::Models::Dispute + + DisputeCreateParams = Lithic::Models::DisputeCreateParams + + DisputeDeleteEvidenceParams = Lithic::Models::DisputeDeleteEvidenceParams + + DisputeDeleteParams = Lithic::Models::DisputeDeleteParams + + DisputeEvidence = Lithic::Models::DisputeEvidence + + DisputeEvidenceUploadFailedWebhookEvent = + Lithic::Models::DisputeEvidenceUploadFailedWebhookEvent + + DisputeInitiateEvidenceUploadParams = + Lithic::Models::DisputeInitiateEvidenceUploadParams + + DisputeListEvidencesParams = Lithic::Models::DisputeListEvidencesParams + + DisputeListParams = Lithic::Models::DisputeListParams + + DisputeRetrieveEvidenceParams = Lithic::Models::DisputeRetrieveEvidenceParams + + DisputeRetrieveParams = Lithic::Models::DisputeRetrieveParams + + DisputesV2ListParams = Lithic::Models::DisputesV2ListParams + + DisputesV2RetrieveParams = Lithic::Models::DisputesV2RetrieveParams + + DisputeTransactionCreatedWebhookEvent = + Lithic::Models::DisputeTransactionCreatedWebhookEvent + + DisputeTransactionUpdatedWebhookEvent = + Lithic::Models::DisputeTransactionUpdatedWebhookEvent + + DisputeUpdatedWebhookEvent = Lithic::Models::DisputeUpdatedWebhookEvent + + DisputeUpdateParams = Lithic::Models::DisputeUpdateParams + + DisputeV2 = Lithic::Models::DisputeV2 + + Document = Lithic::Models::Document + + Event = Lithic::Models::Event + + EventListAttemptsParams = Lithic::Models::EventListAttemptsParams + + EventListParams = Lithic::Models::EventListParams + + EventRetrieveParams = Lithic::Models::EventRetrieveParams + + Events = Lithic::Models::Events + + EventSubscription = Lithic::Models::EventSubscription + + ExternalBankAccount = Lithic::Models::ExternalBankAccount + + ExternalBankAccountAddress = Lithic::Models::ExternalBankAccountAddress + + ExternalBankAccountCreatedWebhookEvent = + Lithic::Models::ExternalBankAccountCreatedWebhookEvent + + ExternalBankAccountCreateParams = + Lithic::Models::ExternalBankAccountCreateParams + + ExternalBankAccountListParams = Lithic::Models::ExternalBankAccountListParams + + ExternalBankAccountPauseParams = + Lithic::Models::ExternalBankAccountPauseParams + + ExternalBankAccountRetrieveParams = + Lithic::Models::ExternalBankAccountRetrieveParams + + ExternalBankAccountRetryMicroDepositsParams = + Lithic::Models::ExternalBankAccountRetryMicroDepositsParams + + ExternalBankAccountRetryPrenoteParams = + Lithic::Models::ExternalBankAccountRetryPrenoteParams + + ExternalBankAccounts = Lithic::Models::ExternalBankAccounts + + ExternalBankAccountSetVerificationMethodParams = + Lithic::Models::ExternalBankAccountSetVerificationMethodParams + + ExternalBankAccountUnpauseParams = + Lithic::Models::ExternalBankAccountUnpauseParams + + ExternalBankAccountUpdatedWebhookEvent = + Lithic::Models::ExternalBankAccountUpdatedWebhookEvent + + ExternalBankAccountUpdateParams = + Lithic::Models::ExternalBankAccountUpdateParams + + ExternalPayment = Lithic::Models::ExternalPayment + + ExternalPaymentCancelParams = Lithic::Models::ExternalPaymentCancelParams + + ExternalPaymentCreatedWebhookEvent = + Lithic::Models::ExternalPaymentCreatedWebhookEvent + + ExternalPaymentCreateParams = Lithic::Models::ExternalPaymentCreateParams + + ExternalPaymentListParams = Lithic::Models::ExternalPaymentListParams + + ExternalPaymentReleaseParams = Lithic::Models::ExternalPaymentReleaseParams + + ExternalPaymentRetrieveParams = Lithic::Models::ExternalPaymentRetrieveParams + + ExternalPaymentReverseParams = Lithic::Models::ExternalPaymentReverseParams + + ExternalPaymentSettleParams = Lithic::Models::ExternalPaymentSettleParams + + ExternalPaymentUpdatedWebhookEvent = + Lithic::Models::ExternalPaymentUpdatedWebhookEvent + + ExternalResource = Lithic::Models::ExternalResource + + ExternalResourceType = Lithic::Models::ExternalResourceType + + FinancialAccount = Lithic::Models::FinancialAccount + + FinancialAccountBalance = Lithic::Models::FinancialAccountBalance + + FinancialAccountCreatedWebhookEvent = + Lithic::Models::FinancialAccountCreatedWebhookEvent + + FinancialAccountCreateParams = Lithic::Models::FinancialAccountCreateParams + + FinancialAccountListParams = Lithic::Models::FinancialAccountListParams + + FinancialAccountRegisterAccountNumberParams = + Lithic::Models::FinancialAccountRegisterAccountNumberParams + + FinancialAccountRetrieveParams = + Lithic::Models::FinancialAccountRetrieveParams + + FinancialAccounts = Lithic::Models::FinancialAccounts + + FinancialAccountUpdatedWebhookEvent = + Lithic::Models::FinancialAccountUpdatedWebhookEvent + + FinancialAccountUpdateParams = Lithic::Models::FinancialAccountUpdateParams + + FinancialAccountUpdateStatusParams = + Lithic::Models::FinancialAccountUpdateStatusParams + + FinancialEvent = Lithic::Models::FinancialEvent + + FinancialTransaction = Lithic::Models::FinancialTransaction + + Fraud = Lithic::Models::Fraud + + FundingEvent = Lithic::Models::FundingEvent + + FundingEventCreatedWebhookEvent = + Lithic::Models::FundingEventCreatedWebhookEvent + + FundingEventListParams = Lithic::Models::FundingEventListParams + + FundingEventRetrieveDetailsParams = + Lithic::Models::FundingEventRetrieveDetailsParams + + FundingEventRetrieveParams = Lithic::Models::FundingEventRetrieveParams + + Hold = Lithic::Models::Hold + + HoldCreateParams = Lithic::Models::HoldCreateParams + + HoldEvent = Lithic::Models::HoldEvent + + HoldListParams = Lithic::Models::HoldListParams + + HoldRetrieveParams = Lithic::Models::HoldRetrieveParams + + HoldVoidParams = Lithic::Models::HoldVoidParams + + InstanceFinancialAccountType = Lithic::Models::InstanceFinancialAccountType + + InternalTransactionAPI = Lithic::Models::InternalTransactionAPI + + InternalTransactionCreatedWebhookEvent = + Lithic::Models::InternalTransactionCreatedWebhookEvent + + InternalTransactionUpdatedWebhookEvent = + Lithic::Models::InternalTransactionUpdatedWebhookEvent + + KYB = Lithic::Models::KYB + + KYBBusinessEntity = Lithic::Models::KYBBusinessEntity + + KYC = Lithic::Models::KYC + + KYCExempt = Lithic::Models::KYCExempt + + LoanTapeCreatedWebhookEvent = Lithic::Models::LoanTapeCreatedWebhookEvent + + LoanTapeUpdatedWebhookEvent = Lithic::Models::LoanTapeUpdatedWebhookEvent + + ManagementOperationCreatedWebhookEvent = + Lithic::Models::ManagementOperationCreatedWebhookEvent + + ManagementOperationCreateParams = + Lithic::Models::ManagementOperationCreateParams + + ManagementOperationListParams = Lithic::Models::ManagementOperationListParams + + ManagementOperationRetrieveParams = + Lithic::Models::ManagementOperationRetrieveParams + + ManagementOperationReverseParams = + Lithic::Models::ManagementOperationReverseParams + + ManagementOperationTransaction = + Lithic::Models::ManagementOperationTransaction + + ManagementOperationUpdatedWebhookEvent = + Lithic::Models::ManagementOperationUpdatedWebhookEvent + + Merchant = Lithic::Models::Merchant + + MessageAttempt = Lithic::Models::MessageAttempt + + NetworkProgram = Lithic::Models::NetworkProgram + + NetworkProgramListParams = Lithic::Models::NetworkProgramListParams + + NetworkProgramRetrieveParams = Lithic::Models::NetworkProgramRetrieveParams + + NetworkTotal = Lithic::Models::NetworkTotal + + NetworkTotalCreatedWebhookEvent = + Lithic::Models::NetworkTotalCreatedWebhookEvent + + NetworkTotalUpdatedWebhookEvent = + Lithic::Models::NetworkTotalUpdatedWebhookEvent + + NonPCICard = Lithic::Models::NonPCICard + + OwnerType = Lithic::Models::OwnerType + + ParsedWebhookEvent = Lithic::Models::ParsedWebhookEvent + + Payment = Lithic::Models::Payment + + PaymentCreateParams = Lithic::Models::PaymentCreateParams + + PaymentListParams = Lithic::Models::PaymentListParams + + PaymentRetrieveParams = Lithic::Models::PaymentRetrieveParams + + PaymentRetryParams = Lithic::Models::PaymentRetryParams + + PaymentReturnParams = Lithic::Models::PaymentReturnParams + + PaymentSimulateActionParams = Lithic::Models::PaymentSimulateActionParams + + PaymentSimulateReceiptParams = Lithic::Models::PaymentSimulateReceiptParams + + PaymentSimulateReleaseParams = Lithic::Models::PaymentSimulateReleaseParams + + PaymentSimulateReturnParams = Lithic::Models::PaymentSimulateReturnParams + + PaymentTransactionCreatedWebhookEvent = + Lithic::Models::PaymentTransactionCreatedWebhookEvent + + PaymentTransactionUpdatedWebhookEvent = + Lithic::Models::PaymentTransactionUpdatedWebhookEvent + + ProvisionResponse = Lithic::Models::ProvisionResponse + + Reports = Lithic::Models::Reports + + RequiredDocument = Lithic::Models::RequiredDocument + + ResponderEndpointCheckStatusParams = + Lithic::Models::ResponderEndpointCheckStatusParams + + ResponderEndpointCreateParams = Lithic::Models::ResponderEndpointCreateParams + + ResponderEndpointDeleteParams = Lithic::Models::ResponderEndpointDeleteParams + + ResponderEndpointStatus = Lithic::Models::ResponderEndpointStatus + + SettlementDetail = Lithic::Models::SettlementDetail + + SettlementReport = Lithic::Models::SettlementReport + + SettlementReportUpdatedWebhookEvent = + Lithic::Models::SettlementReportUpdatedWebhookEvent + + SettlementSummaryDetails = Lithic::Models::SettlementSummaryDetails + + ShippingAddress = Lithic::Models::ShippingAddress + + SignalsResponse = Lithic::Models::SignalsResponse + + SpendLimitDuration = Lithic::Models::SpendLimitDuration + + StatementsCreatedWebhookEvent = Lithic::Models::StatementsCreatedWebhookEvent + + StatementTotals = Lithic::Models::StatementTotals + + ThreeDS = Lithic::Models::ThreeDS + + ThreeDSAuthentication = Lithic::Models::ThreeDSAuthentication + + ThreeDSAuthenticationApprovalRequestWebhookEvent = + Lithic::Models::ThreeDSAuthenticationApprovalRequestWebhookEvent + + ThreeDSAuthenticationChallengeWebhookEvent = + Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent + + ThreeDSAuthenticationCreatedWebhookEvent = + Lithic::Models::ThreeDSAuthenticationCreatedWebhookEvent + + ThreeDSAuthenticationUpdatedWebhookEvent = + Lithic::Models::ThreeDSAuthenticationUpdatedWebhookEvent + + TokenInfo = Lithic::Models::TokenInfo + + Tokenization = Lithic::Models::Tokenization + + TokenizationActivateParams = Lithic::Models::TokenizationActivateParams + + TokenizationApprovalRequestWebhookEvent = + Lithic::Models::TokenizationApprovalRequestWebhookEvent + + TokenizationDeactivateParams = Lithic::Models::TokenizationDeactivateParams + + TokenizationDecisioningRetrieveSecretParams = + Lithic::Models::TokenizationDecisioningRetrieveSecretParams + + TokenizationDecisioningRotateSecretParams = + Lithic::Models::TokenizationDecisioningRotateSecretParams + + TokenizationDeclineReason = Lithic::Models::TokenizationDeclineReason + + TokenizationListParams = Lithic::Models::TokenizationListParams + + TokenizationPauseParams = Lithic::Models::TokenizationPauseParams + + TokenizationResendActivationCodeParams = + Lithic::Models::TokenizationResendActivationCodeParams + + TokenizationResultWebhookEvent = + Lithic::Models::TokenizationResultWebhookEvent + + TokenizationRetrieveParams = Lithic::Models::TokenizationRetrieveParams + + TokenizationRuleResult = Lithic::Models::TokenizationRuleResult + + TokenizationSecret = Lithic::Models::TokenizationSecret + + TokenizationSimulateParams = Lithic::Models::TokenizationSimulateParams + + TokenizationTfaReason = Lithic::Models::TokenizationTfaReason + + TokenizationTwoFactorAuthenticationCodeSentWebhookEvent = + Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent + + TokenizationTwoFactorAuthenticationCodeWebhookEvent = + Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent + + TokenizationUnpauseParams = Lithic::Models::TokenizationUnpauseParams + + TokenizationUpdateDigitalCardArtParams = + Lithic::Models::TokenizationUpdateDigitalCardArtParams + + TokenizationUpdatedWebhookEvent = + Lithic::Models::TokenizationUpdatedWebhookEvent + + TokenMetadata = Lithic::Models::TokenMetadata + + Transaction = Lithic::Models::Transaction + + TransactionExpireAuthorizationParams = + Lithic::Models::TransactionExpireAuthorizationParams + + TransactionListParams = Lithic::Models::TransactionListParams + + TransactionMonitoring = Lithic::Models::TransactionMonitoring + + TransactionRetrieveParams = Lithic::Models::TransactionRetrieveParams + + TransactionRouteParams = Lithic::Models::TransactionRouteParams + + Transactions = Lithic::Models::Transactions + + TransactionSimulateAuthorizationAdviceParams = + Lithic::Models::TransactionSimulateAuthorizationAdviceParams + + TransactionSimulateAuthorizationParams = + Lithic::Models::TransactionSimulateAuthorizationParams + + TransactionSimulateClearingParams = + Lithic::Models::TransactionSimulateClearingParams + + TransactionSimulateCreditAuthorizationAdviceParams = + Lithic::Models::TransactionSimulateCreditAuthorizationAdviceParams + + TransactionSimulateReturnParams = + Lithic::Models::TransactionSimulateReturnParams + + TransactionSimulateReturnReversalParams = + Lithic::Models::TransactionSimulateReturnReversalParams + + TransactionSimulateVoidParams = Lithic::Models::TransactionSimulateVoidParams + + Transfer = Lithic::Models::Transfer + + TransferCreateParams = Lithic::Models::TransferCreateParams + + TransferLimitListParams = Lithic::Models::TransferLimitListParams + + TransferLimitsResponse = Lithic::Models::TransferLimitsResponse + + VerificationMethod = Lithic::Models::VerificationMethod + + WalletDecisioningInfo = Lithic::Models::WalletDecisioningInfo + + WebhookParsedParams = Lithic::Models::WebhookParsedParams + + WirePartyDetails = Lithic::Models::WirePartyDetails +end diff --git a/rbi/lithic/models/account.rbi b/rbi/lithic/models/account.rbi new file mode 100644 index 00000000..d94090bb --- /dev/null +++ b/rbi/lithic/models/account.rbi @@ -0,0 +1,491 @@ +# typed: strong + +module Lithic + module Models + class Account < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Lithic::Account, Lithic::Internal::AnyHash) } + + # Globally unique identifier for the account. This is the same as the + # account_token returned by the enroll endpoint. If using this parameter, do not + # include pagination. + sig { returns(String) } + attr_accessor :token + + # Timestamp of when the account was created. + sig { returns(T.nilable(Time)) } + attr_accessor :created + + # Spend limit information for the user containing the daily, monthly, and lifetime + # spend limit of the account. Any charges to a card owned by this account will be + # declined once their transaction volume has surpassed the value in the applicable + # time limit (rolling). A lifetime limit of 0 indicates that the lifetime limit + # feature is disabled. + sig { returns(Lithic::Account::SpendLimit) } + attr_reader :spend_limit + + sig { params(spend_limit: Lithic::Account::SpendLimit::OrHash).void } + attr_writer :spend_limit + + # Account state: + # + # - `ACTIVE` - Account is able to transact and create new cards. + # - `PAUSED` - Account will not be able to transact or create new cards. It can be + # set back to `ACTIVE`. + # - `CLOSED` - Account will not be able to transact or create new cards. `CLOSED` + # accounts are unable to be transitioned to `ACTIVE` or `PAUSED` states. + # Accounts can be manually set to `CLOSED`, or this can be done by Lithic due to + # failure to pass KYB/KYC or for risk/compliance reasons. Please contact + # [support.lithic.com](https://support.lithic.com/) if you believe this was done + # by mistake. + sig { returns(Lithic::Account::State::TaggedSymbol) } + attr_accessor :state + + sig { returns(T.nilable(Lithic::Account::AccountHolder)) } + attr_reader :account_holder + + sig do + params(account_holder: Lithic::Account::AccountHolder::OrHash).void + end + attr_writer :account_holder + + # List of identifiers for the Auth Rule(s) that are applied on the account. This + # field is deprecated and will no longer be populated in the `account_holder` + # object. The key will be removed from the schema in a future release. Use the + # `/auth_rules` endpoints to fetch Auth Rule information instead. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :auth_rule_tokens + + sig { params(auth_rule_tokens: T::Array[String]).void } + attr_writer :auth_rule_tokens + + # 3-character alphabetic ISO 4217 code for the currency of the cardholder. + sig { returns(T.nilable(String)) } + attr_reader :cardholder_currency + + sig { params(cardholder_currency: String).void } + attr_writer :cardholder_currency + + # Additional context or information related to the account. + sig { returns(T.nilable(String)) } + attr_reader :comment + + sig { params(comment: String).void } + attr_writer :comment + + # Account state substatus values: + # + # - `FRAUD_IDENTIFIED` - The account has been recognized as being created or used + # with stolen or fabricated identity information, encompassing both true + # identity theft and synthetic identities. + # - `SUSPICIOUS_ACTIVITY` - The account has exhibited suspicious behavior, such as + # unauthorized access or fraudulent transactions, necessitating further + # investigation. + # - `RISK_VIOLATION` - The account has been involved in deliberate misuse by the + # legitimate account holder. Examples include disputing valid transactions + # without cause, falsely claiming non-receipt of goods, or engaging in + # intentional bust-out schemes to exploit account services. + # - `END_USER_REQUEST` - The account holder has voluntarily requested the closure + # of the account for personal reasons. This encompasses situations such as + # bankruptcy, other financial considerations, or the account holder's death. + # - `ISSUER_REQUEST` - The issuer has initiated the closure of the account due to + # business strategy, risk management, inactivity, product changes, regulatory + # concerns, or violations of terms and conditions. + # - `NOT_ACTIVE` - The account has not had any transactions or payment activity + # within a specified period. This status applies to accounts that are paused or + # closed due to inactivity. + # - `INTERNAL_REVIEW` - The account is temporarily paused pending further internal + # review. In future implementations, this status may prevent clients from + # activating the account via APIs until the review is completed. + # - `OTHER` - The reason for the account's current status does not fall into any + # of the above categories. A comment should be provided to specify the + # particular reason. + sig { returns(T.nilable(Lithic::Account::Substatus::TaggedSymbol)) } + attr_accessor :substatus + + sig { returns(T.nilable(Lithic::Account::VerificationAddress)) } + attr_reader :verification_address + + sig do + params( + verification_address: Lithic::Account::VerificationAddress::OrHash + ).void + end + attr_writer :verification_address + + sig do + params( + token: String, + created: T.nilable(Time), + spend_limit: Lithic::Account::SpendLimit::OrHash, + state: Lithic::Account::State::OrSymbol, + account_holder: Lithic::Account::AccountHolder::OrHash, + auth_rule_tokens: T::Array[String], + cardholder_currency: String, + comment: String, + substatus: T.nilable(Lithic::Account::Substatus::OrSymbol), + verification_address: Lithic::Account::VerificationAddress::OrHash + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the account. This is the same as the + # account_token returned by the enroll endpoint. If using this parameter, do not + # include pagination. + token:, + # Timestamp of when the account was created. + created:, + # Spend limit information for the user containing the daily, monthly, and lifetime + # spend limit of the account. Any charges to a card owned by this account will be + # declined once their transaction volume has surpassed the value in the applicable + # time limit (rolling). A lifetime limit of 0 indicates that the lifetime limit + # feature is disabled. + spend_limit:, + # Account state: + # + # - `ACTIVE` - Account is able to transact and create new cards. + # - `PAUSED` - Account will not be able to transact or create new cards. It can be + # set back to `ACTIVE`. + # - `CLOSED` - Account will not be able to transact or create new cards. `CLOSED` + # accounts are unable to be transitioned to `ACTIVE` or `PAUSED` states. + # Accounts can be manually set to `CLOSED`, or this can be done by Lithic due to + # failure to pass KYB/KYC or for risk/compliance reasons. Please contact + # [support.lithic.com](https://support.lithic.com/) if you believe this was done + # by mistake. + state:, + account_holder: nil, + # List of identifiers for the Auth Rule(s) that are applied on the account. This + # field is deprecated and will no longer be populated in the `account_holder` + # object. The key will be removed from the schema in a future release. Use the + # `/auth_rules` endpoints to fetch Auth Rule information instead. + auth_rule_tokens: nil, + # 3-character alphabetic ISO 4217 code for the currency of the cardholder. + cardholder_currency: nil, + # Additional context or information related to the account. + comment: nil, + # Account state substatus values: + # + # - `FRAUD_IDENTIFIED` - The account has been recognized as being created or used + # with stolen or fabricated identity information, encompassing both true + # identity theft and synthetic identities. + # - `SUSPICIOUS_ACTIVITY` - The account has exhibited suspicious behavior, such as + # unauthorized access or fraudulent transactions, necessitating further + # investigation. + # - `RISK_VIOLATION` - The account has been involved in deliberate misuse by the + # legitimate account holder. Examples include disputing valid transactions + # without cause, falsely claiming non-receipt of goods, or engaging in + # intentional bust-out schemes to exploit account services. + # - `END_USER_REQUEST` - The account holder has voluntarily requested the closure + # of the account for personal reasons. This encompasses situations such as + # bankruptcy, other financial considerations, or the account holder's death. + # - `ISSUER_REQUEST` - The issuer has initiated the closure of the account due to + # business strategy, risk management, inactivity, product changes, regulatory + # concerns, or violations of terms and conditions. + # - `NOT_ACTIVE` - The account has not had any transactions or payment activity + # within a specified period. This status applies to accounts that are paused or + # closed due to inactivity. + # - `INTERNAL_REVIEW` - The account is temporarily paused pending further internal + # review. In future implementations, this status may prevent clients from + # activating the account via APIs until the review is completed. + # - `OTHER` - The reason for the account's current status does not fall into any + # of the above categories. A comment should be provided to specify the + # particular reason. + substatus: nil, + verification_address: nil + ) + end + + sig do + override.returns( + { + token: String, + created: T.nilable(Time), + spend_limit: Lithic::Account::SpendLimit, + state: Lithic::Account::State::TaggedSymbol, + account_holder: Lithic::Account::AccountHolder, + auth_rule_tokens: T::Array[String], + cardholder_currency: String, + comment: String, + substatus: T.nilable(Lithic::Account::Substatus::TaggedSymbol), + verification_address: Lithic::Account::VerificationAddress + } + ) + end + def to_hash + end + + class SpendLimit < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::Account::SpendLimit, Lithic::Internal::AnyHash) + end + + # Daily spend limit (in cents). + sig { returns(Integer) } + attr_accessor :daily + + # Total spend limit over account lifetime (in cents). + sig { returns(Integer) } + attr_accessor :lifetime + + # Monthly spend limit (in cents). + sig { returns(Integer) } + attr_accessor :monthly + + # Spend limit information for the user containing the daily, monthly, and lifetime + # spend limit of the account. Any charges to a card owned by this account will be + # declined once their transaction volume has surpassed the value in the applicable + # time limit (rolling). A lifetime limit of 0 indicates that the lifetime limit + # feature is disabled. + sig do + params(daily: Integer, lifetime: Integer, monthly: Integer).returns( + T.attached_class + ) + end + def self.new( + # Daily spend limit (in cents). + daily:, + # Total spend limit over account lifetime (in cents). + lifetime:, + # Monthly spend limit (in cents). + monthly: + ) + end + + sig do + override.returns( + { daily: Integer, lifetime: Integer, monthly: Integer } + ) + end + def to_hash + end + end + + # Account state: + # + # - `ACTIVE` - Account is able to transact and create new cards. + # - `PAUSED` - Account will not be able to transact or create new cards. It can be + # set back to `ACTIVE`. + # - `CLOSED` - Account will not be able to transact or create new cards. `CLOSED` + # accounts are unable to be transitioned to `ACTIVE` or `PAUSED` states. + # Accounts can be manually set to `CLOSED`, or this can be done by Lithic due to + # failure to pass KYB/KYC or for risk/compliance reasons. Please contact + # [support.lithic.com](https://support.lithic.com/) if you believe this was done + # by mistake. + module State + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Account::State) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = T.let(:ACTIVE, Lithic::Account::State::TaggedSymbol) + PAUSED = T.let(:PAUSED, Lithic::Account::State::TaggedSymbol) + CLOSED = T.let(:CLOSED, Lithic::Account::State::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Account::State::TaggedSymbol]) } + def self.values + end + end + + class AccountHolder < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::Account::AccountHolder, Lithic::Internal::AnyHash) + end + + # Globally unique identifier for the account holder. + sig { returns(String) } + attr_accessor :token + + # Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # users of businesses. Account_token of the enrolled business associated with an + # enrolled AUTHORIZED_USER individual. + sig { returns(String) } + attr_accessor :business_account_token + + # Email address. + sig { returns(String) } + attr_accessor :email + + # Phone number of the individual. + sig { returns(String) } + attr_accessor :phone_number + + sig do + params( + token: String, + business_account_token: String, + email: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the account holder. + token:, + # Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # users of businesses. Account_token of the enrolled business associated with an + # enrolled AUTHORIZED_USER individual. + business_account_token:, + # Email address. + email:, + # Phone number of the individual. + phone_number: + ) + end + + sig do + override.returns( + { + token: String, + business_account_token: String, + email: String, + phone_number: String + } + ) + end + def to_hash + end + end + + # Account state substatus values: + # + # - `FRAUD_IDENTIFIED` - The account has been recognized as being created or used + # with stolen or fabricated identity information, encompassing both true + # identity theft and synthetic identities. + # - `SUSPICIOUS_ACTIVITY` - The account has exhibited suspicious behavior, such as + # unauthorized access or fraudulent transactions, necessitating further + # investigation. + # - `RISK_VIOLATION` - The account has been involved in deliberate misuse by the + # legitimate account holder. Examples include disputing valid transactions + # without cause, falsely claiming non-receipt of goods, or engaging in + # intentional bust-out schemes to exploit account services. + # - `END_USER_REQUEST` - The account holder has voluntarily requested the closure + # of the account for personal reasons. This encompasses situations such as + # bankruptcy, other financial considerations, or the account holder's death. + # - `ISSUER_REQUEST` - The issuer has initiated the closure of the account due to + # business strategy, risk management, inactivity, product changes, regulatory + # concerns, or violations of terms and conditions. + # - `NOT_ACTIVE` - The account has not had any transactions or payment activity + # within a specified period. This status applies to accounts that are paused or + # closed due to inactivity. + # - `INTERNAL_REVIEW` - The account is temporarily paused pending further internal + # review. In future implementations, this status may prevent clients from + # activating the account via APIs until the review is completed. + # - `OTHER` - The reason for the account's current status does not fall into any + # of the above categories. A comment should be provided to specify the + # particular reason. + module Substatus + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Account::Substatus) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FRAUD_IDENTIFIED = + T.let(:FRAUD_IDENTIFIED, Lithic::Account::Substatus::TaggedSymbol) + SUSPICIOUS_ACTIVITY = + T.let(:SUSPICIOUS_ACTIVITY, Lithic::Account::Substatus::TaggedSymbol) + RISK_VIOLATION = + T.let(:RISK_VIOLATION, Lithic::Account::Substatus::TaggedSymbol) + END_USER_REQUEST = + T.let(:END_USER_REQUEST, Lithic::Account::Substatus::TaggedSymbol) + ISSUER_REQUEST = + T.let(:ISSUER_REQUEST, Lithic::Account::Substatus::TaggedSymbol) + NOT_ACTIVE = + T.let(:NOT_ACTIVE, Lithic::Account::Substatus::TaggedSymbol) + INTERNAL_REVIEW = + T.let(:INTERNAL_REVIEW, Lithic::Account::Substatus::TaggedSymbol) + OTHER = T.let(:OTHER, Lithic::Account::Substatus::TaggedSymbol) + + sig do + override.returns(T::Array[Lithic::Account::Substatus::TaggedSymbol]) + end + def self.values + end + end + + class VerificationAddress < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Account::VerificationAddress, + Lithic::Internal::AnyHash + ) + end + + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # City name. + sig { returns(String) } + attr_accessor :city + + # Country name. Only USA is currently supported. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA postal codes (ZIP codes) are currently supported, + # entered as a five-digit postal code or nine-digit postal code (ZIP+4) using the + # format 12345-1234. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ).returns(T.attached_class) + end + def self.new( + # Valid deliverable address (no PO boxes). + address1:, + # City name. + city:, + # Country name. Only USA is currently supported. + country:, + # Valid postal code. Only USA postal codes (ZIP codes) are currently supported, + # entered as a five-digit postal code or nine-digit postal code (ZIP+4) using the + # format 12345-1234. + postal_code:, + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + state:, + # Unit or apartment number (if applicable). + address2: nil + ) + end + + sig do + override.returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/account_activity_list_params.rbi b/rbi/lithic/models/account_activity_list_params.rbi new file mode 100644 index 00000000..6443103a --- /dev/null +++ b/rbi/lithic/models/account_activity_list_params.rbi @@ -0,0 +1,389 @@ +# typed: strong + +module Lithic + module Models + class AccountActivityListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::AccountActivityListParams, Lithic::Internal::AnyHash) + end + + # Filter by account token + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Filter by business account token + sig { returns(T.nilable(String)) } + attr_reader :business_account_token + + sig { params(business_account_token: String).void } + attr_writer :business_account_token + + # Filter by transaction category + sig do + returns( + T.nilable(Lithic::AccountActivityListParams::Category::OrSymbol) + ) + end + attr_reader :category + + sig do + params( + category: Lithic::AccountActivityListParams::Category::OrSymbol + ).void + end + attr_writer :category + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Filter by financial account token + sig { returns(T.nilable(String)) } + attr_reader :financial_account_token + + sig { params(financial_account_token: String).void } + attr_writer :financial_account_token + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # Filter by transaction result + sig do + returns(T.nilable(Lithic::AccountActivityListParams::Result::OrSymbol)) + end + attr_reader :result + + sig do + params(result: Lithic::AccountActivityListParams::Result::OrSymbol).void + end + attr_writer :result + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + # Filter by transaction status + sig do + returns(T.nilable(Lithic::AccountActivityListParams::Status::OrSymbol)) + end + attr_reader :status + + sig do + params(status: Lithic::AccountActivityListParams::Status::OrSymbol).void + end + attr_writer :status + + sig do + params( + account_token: String, + begin_: Time, + business_account_token: String, + category: Lithic::AccountActivityListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::AccountActivityListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::AccountActivityListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Filter by account token + account_token: nil, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Filter by business account token + business_account_token: nil, + # Filter by transaction category + category: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Filter by financial account token + financial_account_token: nil, + # Page size (for pagination). + page_size: nil, + # Filter by transaction result + result: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Filter by transaction status + status: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + account_token: String, + begin_: Time, + business_account_token: String, + category: Lithic::AccountActivityListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::AccountActivityListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::AccountActivityListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Filter by transaction category + module Category + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::AccountActivityListParams::Category) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACH = + T.let(:ACH, Lithic::AccountActivityListParams::Category::TaggedSymbol) + WIRE = + T.let( + :WIRE, + Lithic::AccountActivityListParams::Category::TaggedSymbol + ) + BALANCE_OR_FUNDING = + T.let( + :BALANCE_OR_FUNDING, + Lithic::AccountActivityListParams::Category::TaggedSymbol + ) + FEE = + T.let(:FEE, Lithic::AccountActivityListParams::Category::TaggedSymbol) + REWARD = + T.let( + :REWARD, + Lithic::AccountActivityListParams::Category::TaggedSymbol + ) + ADJUSTMENT = + T.let( + :ADJUSTMENT, + Lithic::AccountActivityListParams::Category::TaggedSymbol + ) + DERECOGNITION = + T.let( + :DERECOGNITION, + Lithic::AccountActivityListParams::Category::TaggedSymbol + ) + DISPUTE = + T.let( + :DISPUTE, + Lithic::AccountActivityListParams::Category::TaggedSymbol + ) + CARD = + T.let( + :CARD, + Lithic::AccountActivityListParams::Category::TaggedSymbol + ) + EXTERNAL_ACH = + T.let( + :EXTERNAL_ACH, + Lithic::AccountActivityListParams::Category::TaggedSymbol + ) + EXTERNAL_CHECK = + T.let( + :EXTERNAL_CHECK, + Lithic::AccountActivityListParams::Category::TaggedSymbol + ) + EXTERNAL_FEDNOW = + T.let( + :EXTERNAL_FEDNOW, + Lithic::AccountActivityListParams::Category::TaggedSymbol + ) + EXTERNAL_RTP = + T.let( + :EXTERNAL_RTP, + Lithic::AccountActivityListParams::Category::TaggedSymbol + ) + EXTERNAL_TRANSFER = + T.let( + :EXTERNAL_TRANSFER, + Lithic::AccountActivityListParams::Category::TaggedSymbol + ) + EXTERNAL_WIRE = + T.let( + :EXTERNAL_WIRE, + Lithic::AccountActivityListParams::Category::TaggedSymbol + ) + MANAGEMENT_ADJUSTMENT = + T.let( + :MANAGEMENT_ADJUSTMENT, + Lithic::AccountActivityListParams::Category::TaggedSymbol + ) + MANAGEMENT_DISPUTE = + T.let( + :MANAGEMENT_DISPUTE, + Lithic::AccountActivityListParams::Category::TaggedSymbol + ) + MANAGEMENT_FEE = + T.let( + :MANAGEMENT_FEE, + Lithic::AccountActivityListParams::Category::TaggedSymbol + ) + MANAGEMENT_REWARD = + T.let( + :MANAGEMENT_REWARD, + Lithic::AccountActivityListParams::Category::TaggedSymbol + ) + MANAGEMENT_DISBURSEMENT = + T.let( + :MANAGEMENT_DISBURSEMENT, + Lithic::AccountActivityListParams::Category::TaggedSymbol + ) + HOLD = + T.let( + :HOLD, + Lithic::AccountActivityListParams::Category::TaggedSymbol + ) + PROGRAM_FUNDING = + T.let( + :PROGRAM_FUNDING, + Lithic::AccountActivityListParams::Category::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::AccountActivityListParams::Category::TaggedSymbol] + ) + end + def self.values + end + end + + # Filter by transaction result + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::AccountActivityListParams::Result) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::AccountActivityListParams::Result::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::AccountActivityListParams::Result::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::AccountActivityListParams::Result::TaggedSymbol] + ) + end + def self.values + end + end + + # Filter by transaction status + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::AccountActivityListParams::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DECLINED = + T.let( + :DECLINED, + Lithic::AccountActivityListParams::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :EXPIRED, + Lithic::AccountActivityListParams::Status::TaggedSymbol + ) + PENDING = + T.let( + :PENDING, + Lithic::AccountActivityListParams::Status::TaggedSymbol + ) + RETURNED = + T.let( + :RETURNED, + Lithic::AccountActivityListParams::Status::TaggedSymbol + ) + REVERSED = + T.let( + :REVERSED, + Lithic::AccountActivityListParams::Status::TaggedSymbol + ) + SETTLED = + T.let( + :SETTLED, + Lithic::AccountActivityListParams::Status::TaggedSymbol + ) + VOIDED = + T.let( + :VOIDED, + Lithic::AccountActivityListParams::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::AccountActivityListParams::Status::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/account_activity_list_response.rbi b/rbi/lithic/models/account_activity_list_response.rbi new file mode 100644 index 00000000..a7b9751b --- /dev/null +++ b/rbi/lithic/models/account_activity_list_response.rbi @@ -0,0 +1,540 @@ +# typed: strong + +module Lithic + module Models + # Response containing multiple transaction types. The `family` field determines + # which transaction type is returned: INTERNAL returns FinancialTransaction, + # TRANSFER returns BookTransferTransaction, CARD returns CardTransaction, PAYMENT + # returns PaymentTransaction, EXTERNAL_PAYMENT returns ExternalPaymentResponse, + # MANAGEMENT_OPERATION returns ManagementOperationTransaction, and HOLD returns + # HoldTransaction + module AccountActivityListResponse + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::Models::AccountActivityListResponse::Internal, + Lithic::BookTransferResponse, + Lithic::Models::AccountActivityListResponse::Card, + Lithic::Payment, + Lithic::ExternalPayment, + Lithic::ManagementOperationTransaction, + Lithic::Hold + ) + end + + class Internal < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AccountActivityListResponse::Internal, + Lithic::Internal::AnyHash + ) + end + + # Unique identifier for the transaction + sig { returns(String) } + attr_accessor :token + + # Transaction category + sig do + returns( + Lithic::Models::AccountActivityListResponse::Internal::Category::TaggedSymbol + ) + end + attr_accessor :category + + # ISO 8601 timestamp of when the transaction was created + sig { returns(Time) } + attr_accessor :created + + # Currency of the transaction, represented in ISO 4217 format + sig { returns(String) } + attr_accessor :currency + + # Transaction descriptor + sig { returns(String) } + attr_accessor :descriptor + + # List of transaction events + sig { returns(T::Array[Lithic::FinancialEvent]) } + attr_accessor :events + + # INTERNAL - Financial Transaction + sig { returns(Symbol) } + attr_accessor :family + + # Financial account token associated with the transaction + sig { returns(String) } + attr_accessor :financial_account_token + + # Pending amount in cents + sig { returns(Integer) } + attr_accessor :pending_amount + + # Transaction result + sig do + returns( + Lithic::Models::AccountActivityListResponse::Internal::Result::TaggedSymbol + ) + end + attr_accessor :result + + # Settled amount in cents + sig { returns(Integer) } + attr_accessor :settled_amount + + # The status of the transaction + sig do + returns( + Lithic::Models::AccountActivityListResponse::Internal::Status::TaggedSymbol + ) + end + attr_accessor :status + + # ISO 8601 timestamp of when the transaction was last updated + sig { returns(Time) } + attr_accessor :updated + + # Financial transaction with inheritance from unified base transaction + sig do + params( + token: String, + category: + Lithic::Models::AccountActivityListResponse::Internal::Category::OrSymbol, + created: Time, + currency: String, + descriptor: String, + events: T::Array[Lithic::FinancialEvent::OrHash], + financial_account_token: String, + pending_amount: Integer, + result: + Lithic::Models::AccountActivityListResponse::Internal::Result::OrSymbol, + settled_amount: Integer, + status: + Lithic::Models::AccountActivityListResponse::Internal::Status::OrSymbol, + updated: Time, + family: Symbol + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the transaction + token:, + # Transaction category + category:, + # ISO 8601 timestamp of when the transaction was created + created:, + # Currency of the transaction, represented in ISO 4217 format + currency:, + # Transaction descriptor + descriptor:, + # List of transaction events + events:, + # Financial account token associated with the transaction + financial_account_token:, + # Pending amount in cents + pending_amount:, + # Transaction result + result:, + # Settled amount in cents + settled_amount:, + # The status of the transaction + status:, + # ISO 8601 timestamp of when the transaction was last updated + updated:, + # INTERNAL - Financial Transaction + family: :INTERNAL + ) + end + + sig do + override.returns( + { + token: String, + category: + Lithic::Models::AccountActivityListResponse::Internal::Category::TaggedSymbol, + created: Time, + currency: String, + descriptor: String, + events: T::Array[Lithic::FinancialEvent], + family: Symbol, + financial_account_token: String, + pending_amount: Integer, + result: + Lithic::Models::AccountActivityListResponse::Internal::Result::TaggedSymbol, + settled_amount: Integer, + status: + Lithic::Models::AccountActivityListResponse::Internal::Status::TaggedSymbol, + updated: Time + } + ) + end + def to_hash + end + + # Transaction category + module Category + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AccountActivityListResponse::Internal::Category + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACH = + T.let( + :ACH, + Lithic::Models::AccountActivityListResponse::Internal::Category::TaggedSymbol + ) + WIRE = + T.let( + :WIRE, + Lithic::Models::AccountActivityListResponse::Internal::Category::TaggedSymbol + ) + BALANCE_OR_FUNDING = + T.let( + :BALANCE_OR_FUNDING, + Lithic::Models::AccountActivityListResponse::Internal::Category::TaggedSymbol + ) + FEE = + T.let( + :FEE, + Lithic::Models::AccountActivityListResponse::Internal::Category::TaggedSymbol + ) + REWARD = + T.let( + :REWARD, + Lithic::Models::AccountActivityListResponse::Internal::Category::TaggedSymbol + ) + ADJUSTMENT = + T.let( + :ADJUSTMENT, + Lithic::Models::AccountActivityListResponse::Internal::Category::TaggedSymbol + ) + DERECOGNITION = + T.let( + :DERECOGNITION, + Lithic::Models::AccountActivityListResponse::Internal::Category::TaggedSymbol + ) + DISPUTE = + T.let( + :DISPUTE, + Lithic::Models::AccountActivityListResponse::Internal::Category::TaggedSymbol + ) + CARD = + T.let( + :CARD, + Lithic::Models::AccountActivityListResponse::Internal::Category::TaggedSymbol + ) + EXTERNAL_ACH = + T.let( + :EXTERNAL_ACH, + Lithic::Models::AccountActivityListResponse::Internal::Category::TaggedSymbol + ) + EXTERNAL_CHECK = + T.let( + :EXTERNAL_CHECK, + Lithic::Models::AccountActivityListResponse::Internal::Category::TaggedSymbol + ) + EXTERNAL_FEDNOW = + T.let( + :EXTERNAL_FEDNOW, + Lithic::Models::AccountActivityListResponse::Internal::Category::TaggedSymbol + ) + EXTERNAL_RTP = + T.let( + :EXTERNAL_RTP, + Lithic::Models::AccountActivityListResponse::Internal::Category::TaggedSymbol + ) + EXTERNAL_TRANSFER = + T.let( + :EXTERNAL_TRANSFER, + Lithic::Models::AccountActivityListResponse::Internal::Category::TaggedSymbol + ) + EXTERNAL_WIRE = + T.let( + :EXTERNAL_WIRE, + Lithic::Models::AccountActivityListResponse::Internal::Category::TaggedSymbol + ) + MANAGEMENT_ADJUSTMENT = + T.let( + :MANAGEMENT_ADJUSTMENT, + Lithic::Models::AccountActivityListResponse::Internal::Category::TaggedSymbol + ) + MANAGEMENT_DISPUTE = + T.let( + :MANAGEMENT_DISPUTE, + Lithic::Models::AccountActivityListResponse::Internal::Category::TaggedSymbol + ) + MANAGEMENT_FEE = + T.let( + :MANAGEMENT_FEE, + Lithic::Models::AccountActivityListResponse::Internal::Category::TaggedSymbol + ) + MANAGEMENT_REWARD = + T.let( + :MANAGEMENT_REWARD, + Lithic::Models::AccountActivityListResponse::Internal::Category::TaggedSymbol + ) + MANAGEMENT_DISBURSEMENT = + T.let( + :MANAGEMENT_DISBURSEMENT, + Lithic::Models::AccountActivityListResponse::Internal::Category::TaggedSymbol + ) + HOLD = + T.let( + :HOLD, + Lithic::Models::AccountActivityListResponse::Internal::Category::TaggedSymbol + ) + PROGRAM_FUNDING = + T.let( + :PROGRAM_FUNDING, + Lithic::Models::AccountActivityListResponse::Internal::Category::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AccountActivityListResponse::Internal::Category::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Transaction result + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AccountActivityListResponse::Internal::Result + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::Models::AccountActivityListResponse::Internal::Result::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::Models::AccountActivityListResponse::Internal::Result::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AccountActivityListResponse::Internal::Result::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The status of the transaction + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AccountActivityListResponse::Internal::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :PENDING, + Lithic::Models::AccountActivityListResponse::Internal::Status::TaggedSymbol + ) + SETTLED = + T.let( + :SETTLED, + Lithic::Models::AccountActivityListResponse::Internal::Status::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::Models::AccountActivityListResponse::Internal::Status::TaggedSymbol + ) + REVERSED = + T.let( + :REVERSED, + Lithic::Models::AccountActivityListResponse::Internal::Status::TaggedSymbol + ) + CANCELED = + T.let( + :CANCELED, + Lithic::Models::AccountActivityListResponse::Internal::Status::TaggedSymbol + ) + RETURNED = + T.let( + :RETURNED, + Lithic::Models::AccountActivityListResponse::Internal::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AccountActivityListResponse::Internal::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Card < Lithic::Models::Transaction + OrHash = + T.type_alias do + T.any( + Lithic::Models::AccountActivityListResponse::Card, + Lithic::Internal::AnyHash + ) + end + + # Unique identifier for the transaction + sig { returns(String) } + attr_accessor :token + + # ISO 8601 timestamp of when the transaction was created + sig { returns(Time) } + attr_accessor :created + + # CARD - Card Transaction + sig { returns(Symbol) } + attr_accessor :family + + # The status of the transaction + sig do + returns( + Lithic::Models::AccountActivityListResponse::Card::Status::TaggedSymbol + ) + end + attr_accessor :status + + # ISO 8601 timestamp of when the transaction was last updated + sig { returns(Time) } + attr_accessor :updated + + # Card transaction with ledger base properties + sig do + params( + token: String, + created: Time, + status: + Lithic::Models::AccountActivityListResponse::Card::Status::OrSymbol, + updated: Time, + family: Symbol + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the transaction + token:, + # ISO 8601 timestamp of when the transaction was created + created:, + # The status of the transaction + status:, + # ISO 8601 timestamp of when the transaction was last updated + updated:, + # CARD - Card Transaction + family: :CARD + ) + end + + sig do + override.returns( + { + token: String, + created: Time, + family: Symbol, + status: + Lithic::Models::AccountActivityListResponse::Card::Status::TaggedSymbol, + updated: Time + } + ) + end + def to_hash + end + + # The status of the transaction + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AccountActivityListResponse::Card::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :PENDING, + Lithic::Models::AccountActivityListResponse::Card::Status::TaggedSymbol + ) + SETTLED = + T.let( + :SETTLED, + Lithic::Models::AccountActivityListResponse::Card::Status::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::Models::AccountActivityListResponse::Card::Status::TaggedSymbol + ) + REVERSED = + T.let( + :REVERSED, + Lithic::Models::AccountActivityListResponse::Card::Status::TaggedSymbol + ) + CANCELED = + T.let( + :CANCELED, + Lithic::Models::AccountActivityListResponse::Card::Status::TaggedSymbol + ) + RETURNED = + T.let( + :RETURNED, + Lithic::Models::AccountActivityListResponse::Card::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AccountActivityListResponse::Card::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig do + override.returns( + T::Array[Lithic::Models::AccountActivityListResponse::Variants] + ) + end + def self.variants + end + end + end +end diff --git a/rbi/lithic/models/account_activity_retrieve_transaction_params.rbi b/rbi/lithic/models/account_activity_retrieve_transaction_params.rbi new file mode 100644 index 00000000..a66e098c --- /dev/null +++ b/rbi/lithic/models/account_activity_retrieve_transaction_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Lithic + module Models + class AccountActivityRetrieveTransactionParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::AccountActivityRetrieveTransactionParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :transaction_token + + sig do + params( + transaction_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(transaction_token:, request_options: {}) + end + + sig do + override.returns( + { transaction_token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/account_activity_retrieve_transaction_response.rbi b/rbi/lithic/models/account_activity_retrieve_transaction_response.rbi new file mode 100644 index 00000000..e1ead582 --- /dev/null +++ b/rbi/lithic/models/account_activity_retrieve_transaction_response.rbi @@ -0,0 +1,542 @@ +# typed: strong + +module Lithic + module Models + # Response containing multiple transaction types. The `family` field determines + # which transaction type is returned: INTERNAL returns FinancialTransaction, + # TRANSFER returns BookTransferTransaction, CARD returns CardTransaction, PAYMENT + # returns PaymentTransaction, EXTERNAL_PAYMENT returns ExternalPaymentResponse, + # MANAGEMENT_OPERATION returns ManagementOperationTransaction, and HOLD returns + # HoldTransaction + module AccountActivityRetrieveTransactionResponse + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal, + Lithic::BookTransferResponse, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Card, + Lithic::Payment, + Lithic::ExternalPayment, + Lithic::ManagementOperationTransaction, + Lithic::Hold + ) + end + + class Internal < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal, + Lithic::Internal::AnyHash + ) + end + + # Unique identifier for the transaction + sig { returns(String) } + attr_accessor :token + + # Transaction category + sig do + returns( + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category::TaggedSymbol + ) + end + attr_accessor :category + + # ISO 8601 timestamp of when the transaction was created + sig { returns(Time) } + attr_accessor :created + + # Currency of the transaction, represented in ISO 4217 format + sig { returns(String) } + attr_accessor :currency + + # Transaction descriptor + sig { returns(String) } + attr_accessor :descriptor + + # List of transaction events + sig { returns(T::Array[Lithic::FinancialEvent]) } + attr_accessor :events + + # INTERNAL - Financial Transaction + sig { returns(Symbol) } + attr_accessor :family + + # Financial account token associated with the transaction + sig { returns(String) } + attr_accessor :financial_account_token + + # Pending amount in cents + sig { returns(Integer) } + attr_accessor :pending_amount + + # Transaction result + sig do + returns( + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Result::TaggedSymbol + ) + end + attr_accessor :result + + # Settled amount in cents + sig { returns(Integer) } + attr_accessor :settled_amount + + # The status of the transaction + sig do + returns( + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Status::TaggedSymbol + ) + end + attr_accessor :status + + # ISO 8601 timestamp of when the transaction was last updated + sig { returns(Time) } + attr_accessor :updated + + # Financial transaction with inheritance from unified base transaction + sig do + params( + token: String, + category: + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category::OrSymbol, + created: Time, + currency: String, + descriptor: String, + events: T::Array[Lithic::FinancialEvent::OrHash], + financial_account_token: String, + pending_amount: Integer, + result: + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Result::OrSymbol, + settled_amount: Integer, + status: + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Status::OrSymbol, + updated: Time, + family: Symbol + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the transaction + token:, + # Transaction category + category:, + # ISO 8601 timestamp of when the transaction was created + created:, + # Currency of the transaction, represented in ISO 4217 format + currency:, + # Transaction descriptor + descriptor:, + # List of transaction events + events:, + # Financial account token associated with the transaction + financial_account_token:, + # Pending amount in cents + pending_amount:, + # Transaction result + result:, + # Settled amount in cents + settled_amount:, + # The status of the transaction + status:, + # ISO 8601 timestamp of when the transaction was last updated + updated:, + # INTERNAL - Financial Transaction + family: :INTERNAL + ) + end + + sig do + override.returns( + { + token: String, + category: + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category::TaggedSymbol, + created: Time, + currency: String, + descriptor: String, + events: T::Array[Lithic::FinancialEvent], + family: Symbol, + financial_account_token: String, + pending_amount: Integer, + result: + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Result::TaggedSymbol, + settled_amount: Integer, + status: + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Status::TaggedSymbol, + updated: Time + } + ) + end + def to_hash + end + + # Transaction category + module Category + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACH = + T.let( + :ACH, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category::TaggedSymbol + ) + WIRE = + T.let( + :WIRE, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category::TaggedSymbol + ) + BALANCE_OR_FUNDING = + T.let( + :BALANCE_OR_FUNDING, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category::TaggedSymbol + ) + FEE = + T.let( + :FEE, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category::TaggedSymbol + ) + REWARD = + T.let( + :REWARD, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category::TaggedSymbol + ) + ADJUSTMENT = + T.let( + :ADJUSTMENT, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category::TaggedSymbol + ) + DERECOGNITION = + T.let( + :DERECOGNITION, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category::TaggedSymbol + ) + DISPUTE = + T.let( + :DISPUTE, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category::TaggedSymbol + ) + CARD = + T.let( + :CARD, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category::TaggedSymbol + ) + EXTERNAL_ACH = + T.let( + :EXTERNAL_ACH, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category::TaggedSymbol + ) + EXTERNAL_CHECK = + T.let( + :EXTERNAL_CHECK, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category::TaggedSymbol + ) + EXTERNAL_FEDNOW = + T.let( + :EXTERNAL_FEDNOW, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category::TaggedSymbol + ) + EXTERNAL_RTP = + T.let( + :EXTERNAL_RTP, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category::TaggedSymbol + ) + EXTERNAL_TRANSFER = + T.let( + :EXTERNAL_TRANSFER, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category::TaggedSymbol + ) + EXTERNAL_WIRE = + T.let( + :EXTERNAL_WIRE, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category::TaggedSymbol + ) + MANAGEMENT_ADJUSTMENT = + T.let( + :MANAGEMENT_ADJUSTMENT, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category::TaggedSymbol + ) + MANAGEMENT_DISPUTE = + T.let( + :MANAGEMENT_DISPUTE, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category::TaggedSymbol + ) + MANAGEMENT_FEE = + T.let( + :MANAGEMENT_FEE, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category::TaggedSymbol + ) + MANAGEMENT_REWARD = + T.let( + :MANAGEMENT_REWARD, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category::TaggedSymbol + ) + MANAGEMENT_DISBURSEMENT = + T.let( + :MANAGEMENT_DISBURSEMENT, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category::TaggedSymbol + ) + HOLD = + T.let( + :HOLD, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category::TaggedSymbol + ) + PROGRAM_FUNDING = + T.let( + :PROGRAM_FUNDING, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Transaction result + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Result + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Result::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Result::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Result::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The status of the transaction + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :PENDING, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Status::TaggedSymbol + ) + SETTLED = + T.let( + :SETTLED, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Status::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Status::TaggedSymbol + ) + REVERSED = + T.let( + :REVERSED, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Status::TaggedSymbol + ) + CANCELED = + T.let( + :CANCELED, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Status::TaggedSymbol + ) + RETURNED = + T.let( + :RETURNED, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Card < Lithic::Models::Transaction + OrHash = + T.type_alias do + T.any( + Lithic::Models::AccountActivityRetrieveTransactionResponse::Card, + Lithic::Internal::AnyHash + ) + end + + # Unique identifier for the transaction + sig { returns(String) } + attr_accessor :token + + # ISO 8601 timestamp of when the transaction was created + sig { returns(Time) } + attr_accessor :created + + # CARD - Card Transaction + sig { returns(Symbol) } + attr_accessor :family + + # The status of the transaction + sig do + returns( + Lithic::Models::AccountActivityRetrieveTransactionResponse::Card::Status::TaggedSymbol + ) + end + attr_accessor :status + + # ISO 8601 timestamp of when the transaction was last updated + sig { returns(Time) } + attr_accessor :updated + + # Card transaction with ledger base properties + sig do + params( + token: String, + created: Time, + status: + Lithic::Models::AccountActivityRetrieveTransactionResponse::Card::Status::OrSymbol, + updated: Time, + family: Symbol + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the transaction + token:, + # ISO 8601 timestamp of when the transaction was created + created:, + # The status of the transaction + status:, + # ISO 8601 timestamp of when the transaction was last updated + updated:, + # CARD - Card Transaction + family: :CARD + ) + end + + sig do + override.returns( + { + token: String, + created: Time, + family: Symbol, + status: + Lithic::Models::AccountActivityRetrieveTransactionResponse::Card::Status::TaggedSymbol, + updated: Time + } + ) + end + def to_hash + end + + # The status of the transaction + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Card::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :PENDING, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Card::Status::TaggedSymbol + ) + SETTLED = + T.let( + :SETTLED, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Card::Status::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Card::Status::TaggedSymbol + ) + REVERSED = + T.let( + :REVERSED, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Card::Status::TaggedSymbol + ) + CANCELED = + T.let( + :CANCELED, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Card::Status::TaggedSymbol + ) + RETURNED = + T.let( + :RETURNED, + Lithic::Models::AccountActivityRetrieveTransactionResponse::Card::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AccountActivityRetrieveTransactionResponse::Card::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig do + override.returns( + T::Array[ + Lithic::Models::AccountActivityRetrieveTransactionResponse::Variants + ] + ) + end + def self.variants + end + end + end +end diff --git a/rbi/lithic/models/account_financial_account_type.rbi b/rbi/lithic/models/account_financial_account_type.rbi new file mode 100644 index 00000000..f3596199 --- /dev/null +++ b/rbi/lithic/models/account_financial_account_type.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Lithic + module Models + # Type of account financial account + module AccountFinancialAccountType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::AccountFinancialAccountType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ISSUING = + T.let(:ISSUING, Lithic::AccountFinancialAccountType::TaggedSymbol) + OPERATING = + T.let(:OPERATING, Lithic::AccountFinancialAccountType::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::AccountFinancialAccountType::TaggedSymbol] + ) + end + def self.values + end + end + end +end diff --git a/rbi/lithic/models/account_holder.rbi b/rbi/lithic/models/account_holder.rbi new file mode 100644 index 00000000..b4e497f9 --- /dev/null +++ b/rbi/lithic/models/account_holder.rbi @@ -0,0 +1,1125 @@ +# typed: strong + +module Lithic + module Models + class AccountHolder < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Lithic::AccountHolder, Lithic::Internal::AnyHash) } + + # Globally unique identifier for the account holder. + sig { returns(String) } + attr_accessor :token + + # Timestamp of when the account holder was created. + sig { returns(Time) } + attr_accessor :created + + # Globally unique identifier for the account. + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Only present when user_type == "BUSINESS". You must submit a list of all direct + # and indirect individuals with 25% or more ownership in the company. A maximum of + # 4 beneficial owners can be submitted. If no individual owns 25% of the company + # you do not need to send beneficial owner information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + sig do + returns( + T.nilable(T::Array[Lithic::AccountHolder::BeneficialOwnerIndividual]) + ) + end + attr_reader :beneficial_owner_individuals + + sig do + params( + beneficial_owner_individuals: + T::Array[Lithic::AccountHolder::BeneficialOwnerIndividual::OrHash] + ).void + end + attr_writer :beneficial_owner_individuals + + # Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # users of businesses. Pass the account_token of the enrolled business associated + # with the AUTHORIZED_USER in this field. + sig { returns(T.nilable(String)) } + attr_reader :business_account_token + + sig { params(business_account_token: String).void } + attr_writer :business_account_token + + # Only present when user_type == "BUSINESS". Information about the business for + # which the account is being opened and KYB is being run. + sig { returns(T.nilable(Lithic::AccountHolder::BusinessEntity)) } + attr_reader :business_entity + + sig do + params( + business_entity: Lithic::AccountHolder::BusinessEntity::OrHash + ).void + end + attr_writer :business_entity + + # Only present when user_type == "BUSINESS". An individual with significant + # responsibility for managing the legal entity (e.g., a Chief Executive Officer, + # Chief Financial Officer, Chief Operating Officer, Managing Member, General + # Partner, President, Vice President, or Treasurer). This can be an executive, or + # someone who will have program-wide access to the cards that Lithic will provide. + # In some cases, this individual could also be a beneficial owner listed above. + sig { returns(T.nilable(Lithic::AccountHolder::ControlPerson)) } + attr_reader :control_person + + sig do + params( + control_person: Lithic::AccountHolder::ControlPerson::OrHash + ).void + end + attr_writer :control_person + + # (Deprecated. Use control_person.email when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL".) Primary email of + # Account Holder. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # The type of KYC exemption for a KYC-Exempt Account Holder. + sig do + returns(T.nilable(Lithic::AccountHolder::ExemptionType::TaggedSymbol)) + end + attr_reader :exemption_type + + sig do + params( + exemption_type: Lithic::AccountHolder::ExemptionType::OrSymbol + ).void + end + attr_writer :exemption_type + + # Customer-provided token that indicates a relationship with an object outside of + # the Lithic ecosystem. + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # Only present when user_type == "INDIVIDUAL". Information about the individual + # for which the account is being opened and KYC is being run. + sig { returns(T.nilable(Lithic::AccountHolder::Individual)) } + attr_reader :individual + + sig { params(individual: Lithic::AccountHolder::Individual::OrHash).void } + attr_writer :individual + + # Only present when user_type == "BUSINESS". 6-digit North American Industry + # Classification System (NAICS) code for the business. + sig { returns(T.nilable(String)) } + attr_reader :naics_code + + sig { params(naics_code: String).void } + attr_writer :naics_code + + # Only present when user_type == "BUSINESS". User-submitted description of the + # business. + sig { returns(T.nilable(String)) } + attr_reader :nature_of_business + + sig { params(nature_of_business: String).void } + attr_writer :nature_of_business + + # (Deprecated. Use control_person.phone_number when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL".) Primary phone of + # Account Holder, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Only present for "KYB_BASIC" workflow. A list of documents required for the + # account holder to be approved. + sig { returns(T.nilable(T::Array[Lithic::RequiredDocument])) } + attr_reader :required_documents + + sig do + params( + required_documents: T::Array[Lithic::RequiredDocument::OrHash] + ).void + end + attr_writer :required_documents + + # (Deprecated. Use verification_application.status instead) + # + # KYC and KYB evaluation states. + # + # Note: + # + # - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. + sig { returns(T.nilable(Lithic::AccountHolder::Status::TaggedSymbol)) } + attr_reader :status + + sig { params(status: Lithic::AccountHolder::Status::OrSymbol).void } + attr_writer :status + + # (Deprecated. Use verification_application.status_reasons) + # + # Reason for the evaluation status. + sig do + returns( + T.nilable(T::Array[Lithic::AccountHolder::StatusReason::TaggedSymbol]) + ) + end + attr_reader :status_reasons + + sig do + params( + status_reasons: + T::Array[Lithic::AccountHolder::StatusReason::OrSymbol] + ).void + end + attr_writer :status_reasons + + # The type of Account Holder. If the type is "INDIVIDUAL", the "individual" + # attribute will be present. If the type is "BUSINESS" then the "business_entity", + # "control_person", "beneficial_owner_individuals", "naics_code", + # "nature_of_business", and "website_url" attributes will be present. + sig { returns(T.nilable(Lithic::AccountHolder::UserType::TaggedSymbol)) } + attr_reader :user_type + + sig { params(user_type: Lithic::AccountHolder::UserType::OrSymbol).void } + attr_writer :user_type + + # Information about the most recent identity verification attempt + sig { returns(T.nilable(Lithic::AccountHolder::VerificationApplication)) } + attr_reader :verification_application + + sig do + params( + verification_application: + Lithic::AccountHolder::VerificationApplication::OrHash + ).void + end + attr_writer :verification_application + + # Only present when user_type == "BUSINESS". Business's primary website. + sig { returns(T.nilable(String)) } + attr_reader :website_url + + sig { params(website_url: String).void } + attr_writer :website_url + + sig do + params( + token: String, + created: Time, + account_token: String, + beneficial_owner_individuals: + T::Array[Lithic::AccountHolder::BeneficialOwnerIndividual::OrHash], + business_account_token: String, + business_entity: Lithic::AccountHolder::BusinessEntity::OrHash, + control_person: Lithic::AccountHolder::ControlPerson::OrHash, + email: String, + exemption_type: Lithic::AccountHolder::ExemptionType::OrSymbol, + external_id: String, + individual: Lithic::AccountHolder::Individual::OrHash, + naics_code: String, + nature_of_business: String, + phone_number: String, + required_documents: T::Array[Lithic::RequiredDocument::OrHash], + status: Lithic::AccountHolder::Status::OrSymbol, + status_reasons: + T::Array[Lithic::AccountHolder::StatusReason::OrSymbol], + user_type: Lithic::AccountHolder::UserType::OrSymbol, + verification_application: + Lithic::AccountHolder::VerificationApplication::OrHash, + website_url: String + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the account holder. + token:, + # Timestamp of when the account holder was created. + created:, + # Globally unique identifier for the account. + account_token: nil, + # Only present when user_type == "BUSINESS". You must submit a list of all direct + # and indirect individuals with 25% or more ownership in the company. A maximum of + # 4 beneficial owners can be submitted. If no individual owns 25% of the company + # you do not need to send beneficial owner information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + beneficial_owner_individuals: nil, + # Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # users of businesses. Pass the account_token of the enrolled business associated + # with the AUTHORIZED_USER in this field. + business_account_token: nil, + # Only present when user_type == "BUSINESS". Information about the business for + # which the account is being opened and KYB is being run. + business_entity: nil, + # Only present when user_type == "BUSINESS". An individual with significant + # responsibility for managing the legal entity (e.g., a Chief Executive Officer, + # Chief Financial Officer, Chief Operating Officer, Managing Member, General + # Partner, President, Vice President, or Treasurer). This can be an executive, or + # someone who will have program-wide access to the cards that Lithic will provide. + # In some cases, this individual could also be a beneficial owner listed above. + control_person: nil, + # (Deprecated. Use control_person.email when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL".) Primary email of + # Account Holder. + email: nil, + # The type of KYC exemption for a KYC-Exempt Account Holder. + exemption_type: nil, + # Customer-provided token that indicates a relationship with an object outside of + # the Lithic ecosystem. + external_id: nil, + # Only present when user_type == "INDIVIDUAL". Information about the individual + # for which the account is being opened and KYC is being run. + individual: nil, + # Only present when user_type == "BUSINESS". 6-digit North American Industry + # Classification System (NAICS) code for the business. + naics_code: nil, + # Only present when user_type == "BUSINESS". User-submitted description of the + # business. + nature_of_business: nil, + # (Deprecated. Use control_person.phone_number when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL".) Primary phone of + # Account Holder, entered in E.164 format. + phone_number: nil, + # Only present for "KYB_BASIC" workflow. A list of documents required for the + # account holder to be approved. + required_documents: nil, + # (Deprecated. Use verification_application.status instead) + # + # KYC and KYB evaluation states. + # + # Note: + # + # - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. + status: nil, + # (Deprecated. Use verification_application.status_reasons) + # + # Reason for the evaluation status. + status_reasons: nil, + # The type of Account Holder. If the type is "INDIVIDUAL", the "individual" + # attribute will be present. If the type is "BUSINESS" then the "business_entity", + # "control_person", "beneficial_owner_individuals", "naics_code", + # "nature_of_business", and "website_url" attributes will be present. + user_type: nil, + # Information about the most recent identity verification attempt + verification_application: nil, + # Only present when user_type == "BUSINESS". Business's primary website. + website_url: nil + ) + end + + sig do + override.returns( + { + token: String, + created: Time, + account_token: String, + beneficial_owner_individuals: + T::Array[Lithic::AccountHolder::BeneficialOwnerIndividual], + business_account_token: String, + business_entity: Lithic::AccountHolder::BusinessEntity, + control_person: Lithic::AccountHolder::ControlPerson, + email: String, + exemption_type: Lithic::AccountHolder::ExemptionType::TaggedSymbol, + external_id: String, + individual: Lithic::AccountHolder::Individual, + naics_code: String, + nature_of_business: String, + phone_number: String, + required_documents: T::Array[Lithic::RequiredDocument], + status: Lithic::AccountHolder::Status::TaggedSymbol, + status_reasons: + T::Array[Lithic::AccountHolder::StatusReason::TaggedSymbol], + user_type: Lithic::AccountHolder::UserType::TaggedSymbol, + verification_application: + Lithic::AccountHolder::VerificationApplication, + website_url: String + } + ) + end + def to_hash + end + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolder::BeneficialOwnerIndividual, + Lithic::Internal::AnyHash + ) + end + + # Individual's current address + sig { returns(Lithic::Address) } + attr_reader :address + + sig { params(address: Lithic::Address::OrHash).void } + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(String) } + attr_accessor :dob + + # Individual's email address. + sig { returns(String) } + attr_accessor :email + + # Globally unique identifier for the entity. + sig { returns(String) } + attr_accessor :entity_token + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(String) } + attr_accessor :phone_number + + # Information about an individual associated with an account holder. A subset of + # the information provided via KYC. For example, we do not return the government + # id. + sig do + params( + address: Lithic::Address::OrHash, + dob: String, + email: String, + entity_token: String, + first_name: String, + last_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Individual's current address + address:, + # Individual's date of birth, as an RFC 3339 date. + dob:, + # Individual's email address. + email:, + # Globally unique identifier for the entity. + entity_token:, + # Individual's first name, as it appears on government-issued identity documents. + first_name:, + # Individual's last name, as it appears on government-issued identity documents. + last_name:, + # Individual's phone number, entered in E.164 format. + phone_number: + ) + end + + sig do + override.returns( + { + address: Lithic::Address, + dob: String, + email: String, + entity_token: String, + first_name: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + end + + class BusinessEntity < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolder::BusinessEntity, + Lithic::Internal::AnyHash + ) + end + + # Business's physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + sig { returns(Lithic::Address) } + attr_reader :address + + sig { params(address: Lithic::Address::OrHash).void } + attr_writer :address + + # Any name that the business operates under that is not its legal business name + # (if applicable). + sig { returns(String) } + attr_accessor :dba_business_name + + # Globally unique identifier for the entity. + sig { returns(String) } + attr_accessor :entity_token + + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + sig { returns(String) } + attr_accessor :government_id + + # Legal (formal) business name. + sig { returns(String) } + attr_accessor :legal_business_name + + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + sig { returns(T::Array[String]) } + attr_accessor :phone_numbers + + # Parent company name (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :parent_company + + sig { params(parent_company: String).void } + attr_writer :parent_company + + # Only present when user_type == "BUSINESS". Information about the business for + # which the account is being opened and KYB is being run. + sig do + params( + address: Lithic::Address::OrHash, + dba_business_name: String, + entity_token: String, + government_id: String, + legal_business_name: String, + phone_numbers: T::Array[String], + parent_company: String + ).returns(T.attached_class) + end + def self.new( + # Business's physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + address:, + # Any name that the business operates under that is not its legal business name + # (if applicable). + dba_business_name:, + # Globally unique identifier for the entity. + entity_token:, + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + government_id:, + # Legal (formal) business name. + legal_business_name:, + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + phone_numbers:, + # Parent company name (if applicable). + parent_company: nil + ) + end + + sig do + override.returns( + { + address: Lithic::Address, + dba_business_name: String, + entity_token: String, + government_id: String, + legal_business_name: String, + phone_numbers: T::Array[String], + parent_company: String + } + ) + end + def to_hash + end + end + + class ControlPerson < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolder::ControlPerson, + Lithic::Internal::AnyHash + ) + end + + # Individual's current address + sig { returns(Lithic::Address) } + attr_reader :address + + sig { params(address: Lithic::Address::OrHash).void } + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(String) } + attr_accessor :dob + + # Individual's email address. + sig { returns(String) } + attr_accessor :email + + # Globally unique identifier for the entity. + sig { returns(String) } + attr_accessor :entity_token + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(String) } + attr_accessor :phone_number + + # Only present when user_type == "BUSINESS". An individual with significant + # responsibility for managing the legal entity (e.g., a Chief Executive Officer, + # Chief Financial Officer, Chief Operating Officer, Managing Member, General + # Partner, President, Vice President, or Treasurer). This can be an executive, or + # someone who will have program-wide access to the cards that Lithic will provide. + # In some cases, this individual could also be a beneficial owner listed above. + sig do + params( + address: Lithic::Address::OrHash, + dob: String, + email: String, + entity_token: String, + first_name: String, + last_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Individual's current address + address:, + # Individual's date of birth, as an RFC 3339 date. + dob:, + # Individual's email address. + email:, + # Globally unique identifier for the entity. + entity_token:, + # Individual's first name, as it appears on government-issued identity documents. + first_name:, + # Individual's last name, as it appears on government-issued identity documents. + last_name:, + # Individual's phone number, entered in E.164 format. + phone_number: + ) + end + + sig do + override.returns( + { + address: Lithic::Address, + dob: String, + email: String, + entity_token: String, + first_name: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + end + + # The type of KYC exemption for a KYC-Exempt Account Holder. + module ExemptionType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::AccountHolder::ExemptionType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AUTHORIZED_USER = + T.let( + :AUTHORIZED_USER, + Lithic::AccountHolder::ExemptionType::TaggedSymbol + ) + PREPAID_CARD_USER = + T.let( + :PREPAID_CARD_USER, + Lithic::AccountHolder::ExemptionType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::AccountHolder::ExemptionType::TaggedSymbol] + ) + end + def self.values + end + end + + class Individual < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::AccountHolder::Individual, Lithic::Internal::AnyHash) + end + + # Individual's current address + sig { returns(Lithic::Address) } + attr_reader :address + + sig { params(address: Lithic::Address::OrHash).void } + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(String) } + attr_accessor :dob + + # Individual's email address. + sig { returns(String) } + attr_accessor :email + + # Globally unique identifier for the entity. + sig { returns(String) } + attr_accessor :entity_token + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(String) } + attr_accessor :phone_number + + # Only present when user_type == "INDIVIDUAL". Information about the individual + # for which the account is being opened and KYC is being run. + sig do + params( + address: Lithic::Address::OrHash, + dob: String, + email: String, + entity_token: String, + first_name: String, + last_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Individual's current address + address:, + # Individual's date of birth, as an RFC 3339 date. + dob:, + # Individual's email address. + email:, + # Globally unique identifier for the entity. + entity_token:, + # Individual's first name, as it appears on government-issued identity documents. + first_name:, + # Individual's last name, as it appears on government-issued identity documents. + last_name:, + # Individual's phone number, entered in E.164 format. + phone_number: + ) + end + + sig do + override.returns( + { + address: Lithic::Address, + dob: String, + email: String, + entity_token: String, + first_name: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + end + + # (Deprecated. Use verification_application.status instead) + # + # KYC and KYB evaluation states. + # + # Note: + # + # - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::AccountHolder::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = T.let(:ACCEPTED, Lithic::AccountHolder::Status::TaggedSymbol) + PENDING_REVIEW = + T.let(:PENDING_REVIEW, Lithic::AccountHolder::Status::TaggedSymbol) + PENDING_DOCUMENT = + T.let(:PENDING_DOCUMENT, Lithic::AccountHolder::Status::TaggedSymbol) + PENDING_RESUBMIT = + T.let(:PENDING_RESUBMIT, Lithic::AccountHolder::Status::TaggedSymbol) + REJECTED = T.let(:REJECTED, Lithic::AccountHolder::Status::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::AccountHolder::Status::TaggedSymbol] + ) + end + def self.values + end + end + + module StatusReason + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::AccountHolder::StatusReason) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ADDRESS_VERIFICATION_FAILURE = + T.let( + :ADDRESS_VERIFICATION_FAILURE, + Lithic::AccountHolder::StatusReason::TaggedSymbol + ) + AGE_THRESHOLD_FAILURE = + T.let( + :AGE_THRESHOLD_FAILURE, + Lithic::AccountHolder::StatusReason::TaggedSymbol + ) + COMPLETE_VERIFICATION_FAILURE = + T.let( + :COMPLETE_VERIFICATION_FAILURE, + Lithic::AccountHolder::StatusReason::TaggedSymbol + ) + DOB_VERIFICATION_FAILURE = + T.let( + :DOB_VERIFICATION_FAILURE, + Lithic::AccountHolder::StatusReason::TaggedSymbol + ) + ID_VERIFICATION_FAILURE = + T.let( + :ID_VERIFICATION_FAILURE, + Lithic::AccountHolder::StatusReason::TaggedSymbol + ) + MAX_DOCUMENT_ATTEMPTS = + T.let( + :MAX_DOCUMENT_ATTEMPTS, + Lithic::AccountHolder::StatusReason::TaggedSymbol + ) + MAX_RESUBMISSION_ATTEMPTS = + T.let( + :MAX_RESUBMISSION_ATTEMPTS, + Lithic::AccountHolder::StatusReason::TaggedSymbol + ) + NAME_VERIFICATION_FAILURE = + T.let( + :NAME_VERIFICATION_FAILURE, + Lithic::AccountHolder::StatusReason::TaggedSymbol + ) + OTHER_VERIFICATION_FAILURE = + T.let( + :OTHER_VERIFICATION_FAILURE, + Lithic::AccountHolder::StatusReason::TaggedSymbol + ) + RISK_THRESHOLD_FAILURE = + T.let( + :RISK_THRESHOLD_FAILURE, + Lithic::AccountHolder::StatusReason::TaggedSymbol + ) + WATCHLIST_ALERT_FAILURE = + T.let( + :WATCHLIST_ALERT_FAILURE, + Lithic::AccountHolder::StatusReason::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::AccountHolder::StatusReason::TaggedSymbol] + ) + end + def self.values + end + end + + # The type of Account Holder. If the type is "INDIVIDUAL", the "individual" + # attribute will be present. If the type is "BUSINESS" then the "business_entity", + # "control_person", "beneficial_owner_individuals", "naics_code", + # "nature_of_business", and "website_url" attributes will be present. + module UserType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::AccountHolder::UserType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BUSINESS = + T.let(:BUSINESS, Lithic::AccountHolder::UserType::TaggedSymbol) + INDIVIDUAL = + T.let(:INDIVIDUAL, Lithic::AccountHolder::UserType::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::AccountHolder::UserType::TaggedSymbol] + ) + end + def self.values + end + end + + class VerificationApplication < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolder::VerificationApplication, + Lithic::Internal::AnyHash + ) + end + + # Timestamp of when the application was created. + sig { returns(T.nilable(Time)) } + attr_reader :created + + sig { params(created: Time).void } + attr_writer :created + + # KYC and KYB evaluation states. + # + # Note: + # + # - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. + sig do + returns( + T.nilable( + Lithic::AccountHolder::VerificationApplication::Status::TaggedSymbol + ) + ) + end + attr_reader :status + + sig do + params( + status: + Lithic::AccountHolder::VerificationApplication::Status::OrSymbol + ).void + end + attr_writer :status + + # Reason for the evaluation status. + sig do + returns( + T.nilable( + T::Array[ + Lithic::AccountHolder::VerificationApplication::StatusReason::TaggedSymbol + ] + ) + ) + end + attr_reader :status_reasons + + sig do + params( + status_reasons: + T::Array[ + Lithic::AccountHolder::VerificationApplication::StatusReason::OrSymbol + ] + ).void + end + attr_writer :status_reasons + + # Timestamp of when the application was last updated. + sig { returns(T.nilable(Time)) } + attr_reader :updated + + sig { params(updated: Time).void } + attr_writer :updated + + # Information about the most recent identity verification attempt + sig do + params( + created: Time, + status: + Lithic::AccountHolder::VerificationApplication::Status::OrSymbol, + status_reasons: + T::Array[ + Lithic::AccountHolder::VerificationApplication::StatusReason::OrSymbol + ], + updated: Time + ).returns(T.attached_class) + end + def self.new( + # Timestamp of when the application was created. + created: nil, + # KYC and KYB evaluation states. + # + # Note: + # + # - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. + status: nil, + # Reason for the evaluation status. + status_reasons: nil, + # Timestamp of when the application was last updated. + updated: nil + ) + end + + sig do + override.returns( + { + created: Time, + status: + Lithic::AccountHolder::VerificationApplication::Status::TaggedSymbol, + status_reasons: + T::Array[ + Lithic::AccountHolder::VerificationApplication::StatusReason::TaggedSymbol + ], + updated: Time + } + ) + end + def to_hash + end + + # KYC and KYB evaluation states. + # + # Note: + # + # - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AccountHolder::VerificationApplication::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :ACCEPTED, + Lithic::AccountHolder::VerificationApplication::Status::TaggedSymbol + ) + PENDING_REVIEW = + T.let( + :PENDING_REVIEW, + Lithic::AccountHolder::VerificationApplication::Status::TaggedSymbol + ) + PENDING_DOCUMENT = + T.let( + :PENDING_DOCUMENT, + Lithic::AccountHolder::VerificationApplication::Status::TaggedSymbol + ) + PENDING_RESUBMIT = + T.let( + :PENDING_RESUBMIT, + Lithic::AccountHolder::VerificationApplication::Status::TaggedSymbol + ) + REJECTED = + T.let( + :REJECTED, + Lithic::AccountHolder::VerificationApplication::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AccountHolder::VerificationApplication::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + module StatusReason + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AccountHolder::VerificationApplication::StatusReason + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ADDRESS_VERIFICATION_FAILURE = + T.let( + :ADDRESS_VERIFICATION_FAILURE, + Lithic::AccountHolder::VerificationApplication::StatusReason::TaggedSymbol + ) + AGE_THRESHOLD_FAILURE = + T.let( + :AGE_THRESHOLD_FAILURE, + Lithic::AccountHolder::VerificationApplication::StatusReason::TaggedSymbol + ) + COMPLETE_VERIFICATION_FAILURE = + T.let( + :COMPLETE_VERIFICATION_FAILURE, + Lithic::AccountHolder::VerificationApplication::StatusReason::TaggedSymbol + ) + DOB_VERIFICATION_FAILURE = + T.let( + :DOB_VERIFICATION_FAILURE, + Lithic::AccountHolder::VerificationApplication::StatusReason::TaggedSymbol + ) + ID_VERIFICATION_FAILURE = + T.let( + :ID_VERIFICATION_FAILURE, + Lithic::AccountHolder::VerificationApplication::StatusReason::TaggedSymbol + ) + MAX_DOCUMENT_ATTEMPTS = + T.let( + :MAX_DOCUMENT_ATTEMPTS, + Lithic::AccountHolder::VerificationApplication::StatusReason::TaggedSymbol + ) + MAX_RESUBMISSION_ATTEMPTS = + T.let( + :MAX_RESUBMISSION_ATTEMPTS, + Lithic::AccountHolder::VerificationApplication::StatusReason::TaggedSymbol + ) + NAME_VERIFICATION_FAILURE = + T.let( + :NAME_VERIFICATION_FAILURE, + Lithic::AccountHolder::VerificationApplication::StatusReason::TaggedSymbol + ) + OTHER_VERIFICATION_FAILURE = + T.let( + :OTHER_VERIFICATION_FAILURE, + Lithic::AccountHolder::VerificationApplication::StatusReason::TaggedSymbol + ) + RISK_THRESHOLD_FAILURE = + T.let( + :RISK_THRESHOLD_FAILURE, + Lithic::AccountHolder::VerificationApplication::StatusReason::TaggedSymbol + ) + WATCHLIST_ALERT_FAILURE = + T.let( + :WATCHLIST_ALERT_FAILURE, + Lithic::AccountHolder::VerificationApplication::StatusReason::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AccountHolder::VerificationApplication::StatusReason::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/account_holder_create_params.rbi b/rbi/lithic/models/account_holder_create_params.rbi new file mode 100644 index 00000000..80fefa2b --- /dev/null +++ b/rbi/lithic/models/account_holder_create_params.rbi @@ -0,0 +1,658 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::AccountHolderCreateParams, Lithic::Internal::AnyHash) + end + + sig do + returns( + T.any( + Lithic::KYB, + Lithic::AccountHolderCreateParams::Body::KYBDelegated, + Lithic::KYC, + Lithic::KYCExempt + ) + ) + end + attr_accessor :body + + sig do + params( + body: + T.any( + Lithic::KYB::OrHash, + Lithic::AccountHolderCreateParams::Body::KYBDelegated::OrHash, + Lithic::KYC::OrHash, + Lithic::KYCExempt::OrHash + ), + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(body:, request_options: {}) + end + + sig do + override.returns( + { + body: + T.any( + Lithic::KYB, + Lithic::AccountHolderCreateParams::Body::KYBDelegated, + Lithic::KYC, + Lithic::KYCExempt + ), + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + module Body + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::KYB, + Lithic::AccountHolderCreateParams::Body::KYBDelegated, + Lithic::KYC, + Lithic::KYCExempt + ) + end + + class KYBDelegated < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderCreateParams::Body::KYBDelegated, + Lithic::Internal::AnyHash + ) + end + + # Information for business for which the account is being opened. + sig do + returns( + Lithic::AccountHolderCreateParams::Body::KYBDelegated::BusinessEntity + ) + end + attr_reader :business_entity + + sig do + params( + business_entity: + Lithic::AccountHolderCreateParams::Body::KYBDelegated::BusinessEntity::OrHash + ).void + end + attr_writer :business_entity + + # You can submit a list of all direct and indirect individuals with 25% or more + # ownership in the company. A maximum of 4 beneficial owners can be submitted. If + # no individual owns 25% of the company you do not need to send beneficial owner + # information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + sig do + returns( + T.nilable( + T::Array[ + Lithic::AccountHolderCreateParams::Body::KYBDelegated::BeneficialOwnerIndividual + ] + ) + ) + end + attr_reader :beneficial_owner_individuals + + sig do + params( + beneficial_owner_individuals: + T::Array[ + Lithic::AccountHolderCreateParams::Body::KYBDelegated::BeneficialOwnerIndividual::OrHash + ] + ).void + end + attr_writer :beneficial_owner_individuals + + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + sig do + returns( + T.nilable( + Lithic::AccountHolderCreateParams::Body::KYBDelegated::ControlPerson + ) + ) + end + attr_reader :control_person + + sig do + params( + control_person: + Lithic::AccountHolderCreateParams::Body::KYBDelegated::ControlPerson::OrHash + ).void + end + attr_writer :control_person + + # A user provided id that can be used to link an account holder with an external + # system + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # 6-digit North American Industry Classification System (NAICS) code for the + # business. + sig { returns(T.nilable(String)) } + attr_reader :naics_code + + sig { params(naics_code: String).void } + attr_writer :naics_code + + # Short description of the company's line of business (i.e., what does the company + # do?). Values longer than 255 characters will be truncated before KYB + # verification + sig { returns(T.nilable(String)) } + attr_reader :nature_of_business + + sig { params(nature_of_business: String).void } + attr_writer :nature_of_business + + # An RFC 3339 timestamp indicating when the account holder accepted the applicable + # legal agreements (e.g., cardholder terms) as agreed upon during API customer's + # implementation with Lithic. + sig { returns(T.nilable(String)) } + attr_reader :tos_timestamp + + sig { params(tos_timestamp: String).void } + attr_writer :tos_timestamp + + # Company website URL. + sig { returns(T.nilable(String)) } + attr_reader :website_url + + sig { params(website_url: String).void } + attr_writer :website_url + + # Specifies the type of KYB workflow to run. + sig do + returns( + T.nilable( + Lithic::AccountHolderCreateParams::Body::KYBDelegated::Workflow::OrSymbol + ) + ) + end + attr_reader :workflow + + sig do + params( + workflow: + Lithic::AccountHolderCreateParams::Body::KYBDelegated::Workflow::OrSymbol + ).void + end + attr_writer :workflow + + sig do + params( + business_entity: + Lithic::AccountHolderCreateParams::Body::KYBDelegated::BusinessEntity::OrHash, + beneficial_owner_individuals: + T::Array[ + Lithic::AccountHolderCreateParams::Body::KYBDelegated::BeneficialOwnerIndividual::OrHash + ], + control_person: + Lithic::AccountHolderCreateParams::Body::KYBDelegated::ControlPerson::OrHash, + external_id: String, + naics_code: String, + nature_of_business: String, + tos_timestamp: String, + website_url: String, + workflow: + Lithic::AccountHolderCreateParams::Body::KYBDelegated::Workflow::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Information for business for which the account is being opened. + business_entity:, + # You can submit a list of all direct and indirect individuals with 25% or more + # ownership in the company. A maximum of 4 beneficial owners can be submitted. If + # no individual owns 25% of the company you do not need to send beneficial owner + # information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + beneficial_owner_individuals: nil, + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + control_person: nil, + # A user provided id that can be used to link an account holder with an external + # system + external_id: nil, + # 6-digit North American Industry Classification System (NAICS) code for the + # business. + naics_code: nil, + # Short description of the company's line of business (i.e., what does the company + # do?). Values longer than 255 characters will be truncated before KYB + # verification + nature_of_business: nil, + # An RFC 3339 timestamp indicating when the account holder accepted the applicable + # legal agreements (e.g., cardholder terms) as agreed upon during API customer's + # implementation with Lithic. + tos_timestamp: nil, + # Company website URL. + website_url: nil, + # Specifies the type of KYB workflow to run. + workflow: nil + ) + end + + sig do + override.returns( + { + business_entity: + Lithic::AccountHolderCreateParams::Body::KYBDelegated::BusinessEntity, + beneficial_owner_individuals: + T::Array[ + Lithic::AccountHolderCreateParams::Body::KYBDelegated::BeneficialOwnerIndividual + ], + control_person: + Lithic::AccountHolderCreateParams::Body::KYBDelegated::ControlPerson, + external_id: String, + naics_code: String, + nature_of_business: String, + tos_timestamp: String, + website_url: String, + workflow: + Lithic::AccountHolderCreateParams::Body::KYBDelegated::Workflow::OrSymbol + } + ) + end + def to_hash + end + + class BusinessEntity < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderCreateParams::Body::KYBDelegated::BusinessEntity, + Lithic::Internal::AnyHash + ) + end + + # Business's physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + sig { returns(Lithic::Address) } + attr_reader :address + + sig { params(address: Lithic::Address::OrHash).void } + attr_writer :address + + # Legal (formal) business name. + sig { returns(String) } + attr_accessor :legal_business_name + + # Any name that the business operates under that is not its legal business name + # (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :dba_business_name + + sig { params(dba_business_name: String).void } + attr_writer :dba_business_name + + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + sig { returns(T.nilable(String)) } + attr_reader :government_id + + sig { params(government_id: String).void } + attr_writer :government_id + + # Parent company name (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :parent_company + + sig { params(parent_company: String).void } + attr_writer :parent_company + + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :phone_numbers + + sig { params(phone_numbers: T::Array[String]).void } + attr_writer :phone_numbers + + # Information for business for which the account is being opened. + sig do + params( + address: Lithic::Address::OrHash, + legal_business_name: String, + dba_business_name: String, + government_id: String, + parent_company: String, + phone_numbers: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # Business's physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + address:, + # Legal (formal) business name. + legal_business_name:, + # Any name that the business operates under that is not its legal business name + # (if applicable). + dba_business_name: nil, + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + government_id: nil, + # Parent company name (if applicable). + parent_company: nil, + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + phone_numbers: nil + ) + end + + sig do + override.returns( + { + address: Lithic::Address, + legal_business_name: String, + dba_business_name: String, + government_id: String, + parent_company: String, + phone_numbers: T::Array[String] + } + ) + end + def to_hash + end + end + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderCreateParams::Body::KYBDelegated::BeneficialOwnerIndividual, + Lithic::Internal::AnyHash + ) + end + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :last_name + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig { returns(T.nilable(Lithic::Address)) } + attr_reader :address + + sig { params(address: Lithic::Address::OrHash).void } + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + sig { returns(T.nilable(String)) } + attr_reader :government_id + + sig { params(government_id: String).void } + attr_writer :government_id + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Individuals associated with a KYB_DELEGATED application. Only first and last + # name are required. + sig do + params( + first_name: String, + last_name: String, + address: Lithic::Address::OrHash, + dob: String, + email: String, + government_id: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Individual's first name, as it appears on government-issued identity documents. + first_name:, + # Individual's last name, as it appears on government-issued identity documents. + last_name:, + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + address: nil, + # Individual's date of birth, as an RFC 3339 date. + dob: nil, + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + email: nil, + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + government_id: nil, + # Individual's phone number, entered in E.164 format. + phone_number: nil + ) + end + + sig do + override.returns( + { + first_name: String, + last_name: String, + address: Lithic::Address, + dob: String, + email: String, + government_id: String, + phone_number: String + } + ) + end + def to_hash + end + end + + class ControlPerson < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderCreateParams::Body::KYBDelegated::ControlPerson, + Lithic::Internal::AnyHash + ) + end + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :last_name + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig { returns(T.nilable(Lithic::Address)) } + attr_reader :address + + sig { params(address: Lithic::Address::OrHash).void } + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + sig { returns(T.nilable(String)) } + attr_reader :government_id + + sig { params(government_id: String).void } + attr_writer :government_id + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + sig do + params( + first_name: String, + last_name: String, + address: Lithic::Address::OrHash, + dob: String, + email: String, + government_id: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Individual's first name, as it appears on government-issued identity documents. + first_name:, + # Individual's last name, as it appears on government-issued identity documents. + last_name:, + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + address: nil, + # Individual's date of birth, as an RFC 3339 date. + dob: nil, + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + email: nil, + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + government_id: nil, + # Individual's phone number, entered in E.164 format. + phone_number: nil + ) + end + + sig do + override.returns( + { + first_name: String, + last_name: String, + address: Lithic::Address, + dob: String, + email: String, + government_id: String, + phone_number: String + } + ) + end + def to_hash + end + end + + # Specifies the type of KYB workflow to run. + module Workflow + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AccountHolderCreateParams::Body::KYBDelegated::Workflow + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + KYB_DELEGATED = + T.let( + :KYB_DELEGATED, + Lithic::AccountHolderCreateParams::Body::KYBDelegated::Workflow::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AccountHolderCreateParams::Body::KYBDelegated::Workflow::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig do + override.returns( + T::Array[Lithic::AccountHolderCreateParams::Body::Variants] + ) + end + def self.variants + end + end + end + end +end diff --git a/rbi/lithic/models/account_holder_create_response.rbi b/rbi/lithic/models/account_holder_create_response.rbi new file mode 100644 index 00000000..52eea0b8 --- /dev/null +++ b/rbi/lithic/models/account_holder_create_response.rbi @@ -0,0 +1,326 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderCreateResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AccountHolderCreateResponse, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for the account holder. + sig { returns(String) } + attr_accessor :token + + # Globally unique identifier for the account. + sig { returns(String) } + attr_accessor :account_token + + # KYC and KYB evaluation states. + # + # Note: + # + # - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. + sig do + returns( + Lithic::Models::AccountHolderCreateResponse::Status::TaggedSymbol + ) + end + attr_accessor :status + + # Reason for the evaluation status. + sig do + returns( + T::Array[ + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ] + ) + end + attr_accessor :status_reasons + + # Timestamp of when the account holder was created. + sig { returns(T.nilable(Time)) } + attr_reader :created + + sig { params(created: Time).void } + attr_writer :created + + # Customer-provided token that indicates a relationship with an object outside of + # the Lithic ecosystem. + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # Only present for "KYB_BASIC" workflow. A list of documents required for the + # account holder to be approved. + sig { returns(T.nilable(T::Array[Lithic::RequiredDocument])) } + attr_reader :required_documents + + sig do + params( + required_documents: T::Array[Lithic::RequiredDocument::OrHash] + ).void + end + attr_writer :required_documents + + sig do + params( + token: String, + account_token: String, + status: Lithic::Models::AccountHolderCreateResponse::Status::OrSymbol, + status_reasons: + T::Array[ + Lithic::Models::AccountHolderCreateResponse::StatusReason::OrSymbol + ], + created: Time, + external_id: String, + required_documents: T::Array[Lithic::RequiredDocument::OrHash] + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the account holder. + token:, + # Globally unique identifier for the account. + account_token:, + # KYC and KYB evaluation states. + # + # Note: + # + # - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. + status:, + # Reason for the evaluation status. + status_reasons:, + # Timestamp of when the account holder was created. + created: nil, + # Customer-provided token that indicates a relationship with an object outside of + # the Lithic ecosystem. + external_id: nil, + # Only present for "KYB_BASIC" workflow. A list of documents required for the + # account holder to be approved. + required_documents: nil + ) + end + + sig do + override.returns( + { + token: String, + account_token: String, + status: + Lithic::Models::AccountHolderCreateResponse::Status::TaggedSymbol, + status_reasons: + T::Array[ + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ], + created: Time, + external_id: String, + required_documents: T::Array[Lithic::RequiredDocument] + } + ) + end + def to_hash + end + + # KYC and KYB evaluation states. + # + # Note: + # + # - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Models::AccountHolderCreateResponse::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :ACCEPTED, + Lithic::Models::AccountHolderCreateResponse::Status::TaggedSymbol + ) + PENDING_REVIEW = + T.let( + :PENDING_REVIEW, + Lithic::Models::AccountHolderCreateResponse::Status::TaggedSymbol + ) + PENDING_DOCUMENT = + T.let( + :PENDING_DOCUMENT, + Lithic::Models::AccountHolderCreateResponse::Status::TaggedSymbol + ) + PENDING_RESUBMIT = + T.let( + :PENDING_RESUBMIT, + Lithic::Models::AccountHolderCreateResponse::Status::TaggedSymbol + ) + REJECTED = + T.let( + :REJECTED, + Lithic::Models::AccountHolderCreateResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AccountHolderCreateResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Status Reasons for KYC/KYB enrollment states + module StatusReason + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AccountHolderCreateResponse::StatusReason + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ADDRESS_VERIFICATION_FAILURE = + T.let( + :ADDRESS_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + AGE_THRESHOLD_FAILURE = + T.let( + :AGE_THRESHOLD_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + COMPLETE_VERIFICATION_FAILURE = + T.let( + :COMPLETE_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + DOB_VERIFICATION_FAILURE = + T.let( + :DOB_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + ID_VERIFICATION_FAILURE = + T.let( + :ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + MAX_DOCUMENT_ATTEMPTS = + T.let( + :MAX_DOCUMENT_ATTEMPTS, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + MAX_RESUBMISSION_ATTEMPTS = + T.let( + :MAX_RESUBMISSION_ATTEMPTS, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + NAME_VERIFICATION_FAILURE = + T.let( + :NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + OTHER_VERIFICATION_FAILURE = + T.let( + :OTHER_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + RISK_THRESHOLD_FAILURE = + T.let( + :RISK_THRESHOLD_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + WATCHLIST_ALERT_FAILURE = + T.let( + :WATCHLIST_ALERT_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED = + T.let( + :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE = + T.let( + :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED = + T.let( + :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE = + T.let( + :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_ID_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_DOB_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_DOB_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_NAME_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AccountHolderCreateResponse::StatusReason::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/account_holder_created_webhook_event.rbi b/rbi/lithic/models/account_holder_created_webhook_event.rbi new file mode 100644 index 00000000..84bc7189 --- /dev/null +++ b/rbi/lithic/models/account_holder_created_webhook_event.rbi @@ -0,0 +1,149 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderCreatedWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # The token of the account_holder that was created. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # The token of the account that was created. + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # When the account_holder was created + sig { returns(T.nilable(Time)) } + attr_reader :created + + sig { params(created: Time).void } + attr_writer :created + + sig { returns(T.nilable(T::Array[Lithic::RequiredDocument])) } + attr_reader :required_documents + + sig do + params( + required_documents: T::Array[Lithic::RequiredDocument::OrHash] + ).void + end + attr_writer :required_documents + + # The status of the account_holder that was created. + sig do + returns( + T.nilable( + Lithic::AccountHolderCreatedWebhookEvent::Status::TaggedSymbol + ) + ) + end + attr_reader :status + + sig do + params( + status: Lithic::AccountHolderCreatedWebhookEvent::Status::OrSymbol + ).void + end + attr_writer :status + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :status_reason + + sig { params(status_reason: T::Array[String]).void } + attr_writer :status_reason + + sig do + params( + token: String, + account_token: String, + created: Time, + required_documents: T::Array[Lithic::RequiredDocument::OrHash], + status: Lithic::AccountHolderCreatedWebhookEvent::Status::OrSymbol, + status_reason: T::Array[String], + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The token of the account_holder that was created. + token: nil, + # The token of the account that was created. + account_token: nil, + # When the account_holder was created + created: nil, + required_documents: nil, + # The status of the account_holder that was created. + status: nil, + status_reason: nil, + # The type of event that occurred. + event_type: :"account_holder.created" + ) + end + + sig do + override.returns( + { + event_type: Symbol, + token: String, + account_token: String, + created: Time, + required_documents: T::Array[Lithic::RequiredDocument], + status: + Lithic::AccountHolderCreatedWebhookEvent::Status::TaggedSymbol, + status_reason: T::Array[String] + } + ) + end + def to_hash + end + + # The status of the account_holder that was created. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::AccountHolderCreatedWebhookEvent::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :ACCEPTED, + Lithic::AccountHolderCreatedWebhookEvent::Status::TaggedSymbol + ) + PENDING_REVIEW = + T.let( + :PENDING_REVIEW, + Lithic::AccountHolderCreatedWebhookEvent::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AccountHolderCreatedWebhookEvent::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/account_holder_document_updated_webhook_event.rbi b/rbi/lithic/models/account_holder_document_updated_webhook_event.rbi new file mode 100644 index 00000000..c7637490 --- /dev/null +++ b/rbi/lithic/models/account_holder_document_updated_webhook_event.rbi @@ -0,0 +1,479 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderDocumentUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderDocumentUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # The token of the account holder document + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # The token of the account_holder that the document belongs to + sig { returns(T.nilable(String)) } + attr_reader :account_holder_token + + sig { params(account_holder_token: String).void } + attr_writer :account_holder_token + + # When the account_holder was created + sig { returns(T.nilable(Time)) } + attr_reader :created + + sig { params(created: Time).void } + attr_writer :created + + # Type of documentation to be submitted for verification of an account holder + sig do + returns( + T.nilable( + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + ) + end + attr_reader :document_type + + sig do + params( + document_type: + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::OrSymbol + ).void + end + attr_writer :document_type + + # The token of the entity that the document belongs to + sig { returns(T.nilable(String)) } + attr_reader :entity_token + + sig { params(entity_token: String).void } + attr_writer :entity_token + + sig do + returns( + T.nilable( + T::Array[ + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload + ] + ) + ) + end + attr_reader :required_document_uploads + + sig do + params( + required_document_uploads: + T::Array[ + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::OrHash + ] + ).void + end + attr_writer :required_document_uploads + + sig do + params( + token: String, + account_holder_token: String, + created: Time, + document_type: + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::OrSymbol, + entity_token: String, + required_document_uploads: + T::Array[ + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::OrHash + ], + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The token of the account holder document + token: nil, + # The token of the account_holder that the document belongs to + account_holder_token: nil, + # When the account_holder was created + created: nil, + # Type of documentation to be submitted for verification of an account holder + document_type: nil, + # The token of the entity that the document belongs to + entity_token: nil, + required_document_uploads: nil, + # The type of event that occurred. + event_type: :"account_holder_document.updated" + ) + end + + sig do + override.returns( + { + event_type: Symbol, + token: String, + account_holder_token: String, + created: Time, + document_type: + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol, + entity_token: String, + required_document_uploads: + T::Array[ + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload + ] + } + ) + end + def to_hash + end + + # Type of documentation to be submitted for verification of an account holder + module DocumentType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DRIVERS_LICENSE = + T.let( + :DRIVERS_LICENSE, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + PASSPORT = + T.let( + :PASSPORT, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + PASSPORT_CARD = + T.let( + :PASSPORT_CARD, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + EIN_LETTER = + T.let( + :EIN_LETTER, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + TAX_RETURN = + T.let( + :TAX_RETURN, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + OPERATING_AGREEMENT = + T.let( + :OPERATING_AGREEMENT, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + CERTIFICATE_OF_FORMATION = + T.let( + :CERTIFICATE_OF_FORMATION, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + CERTIFICATE_OF_GOOD_STANDING = + T.let( + :CERTIFICATE_OF_GOOD_STANDING, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + ARTICLES_OF_INCORPORATION = + T.let( + :ARTICLES_OF_INCORPORATION, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + ARTICLES_OF_ORGANIZATION = + T.let( + :ARTICLES_OF_ORGANIZATION, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + BYLAWS = + T.let( + :BYLAWS, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + GOVERNMENT_BUSINESS_LICENSE = + T.let( + :GOVERNMENT_BUSINESS_LICENSE, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + PARTNERSHIP_AGREEMENT = + T.let( + :PARTNERSHIP_AGREEMENT, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + SS4_FORM = + T.let( + :SS4_FORM, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + BANK_STATEMENT = + T.let( + :BANK_STATEMENT, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + UTILITY_BILL_STATEMENT = + T.let( + :UTILITY_BILL_STATEMENT, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + SSN_CARD = + T.let( + :SSN_CARD, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + ITIN_LETTER = + T.let( + :ITIN_LETTER, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + FINCEN_BOI_REPORT = + T.let( + :FINCEN_BOI_REPORT, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AccountHolderDocumentUpdatedWebhookEvent::DocumentType::TaggedSymbol + ] + ) + end + def self.values + end + end + + class RequiredDocumentUpload < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload, + Lithic::Internal::AnyHash + ) + end + + # The token of the document upload + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :accepted_entity_status_reasons + + sig { params(accepted_entity_status_reasons: T::Array[String]).void } + attr_writer :accepted_entity_status_reasons + + # When the document upload was created + sig { returns(T.nilable(Time)) } + attr_reader :created + + sig { params(created: Time).void } + attr_writer :created + + # The type of image that was uploaded + sig do + returns( + T.nilable( + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::ImageType::TaggedSymbol + ) + ) + end + attr_reader :image_type + + sig do + params( + image_type: + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::ImageType::OrSymbol + ).void + end + attr_writer :image_type + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :rejected_entity_status_reasons + + sig { params(rejected_entity_status_reasons: T::Array[String]).void } + attr_writer :rejected_entity_status_reasons + + # The status of the document upload + sig do + returns( + T.nilable( + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::Status::TaggedSymbol + ) + ) + end + attr_reader :status + + sig do + params( + status: + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::Status::OrSymbol + ).void + end + attr_writer :status + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :status_reasons + + sig { params(status_reasons: T::Array[String]).void } + attr_writer :status_reasons + + # When the document upload was last updated + sig { returns(T.nilable(Time)) } + attr_reader :updated + + sig { params(updated: Time).void } + attr_writer :updated + + # A document upload that belongs to the overall account holder document + sig do + params( + token: String, + accepted_entity_status_reasons: T::Array[String], + created: Time, + image_type: + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::ImageType::OrSymbol, + rejected_entity_status_reasons: T::Array[String], + status: + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::Status::OrSymbol, + status_reasons: T::Array[String], + updated: Time + ).returns(T.attached_class) + end + def self.new( + # The token of the document upload + token: nil, + accepted_entity_status_reasons: nil, + # When the document upload was created + created: nil, + # The type of image that was uploaded + image_type: nil, + rejected_entity_status_reasons: nil, + # The status of the document upload + status: nil, + status_reasons: nil, + # When the document upload was last updated + updated: nil + ) + end + + sig do + override.returns( + { + token: String, + accepted_entity_status_reasons: T::Array[String], + created: Time, + image_type: + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::ImageType::TaggedSymbol, + rejected_entity_status_reasons: T::Array[String], + status: + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::Status::TaggedSymbol, + status_reasons: T::Array[String], + updated: Time + } + ) + end + def to_hash + end + + # The type of image that was uploaded + module ImageType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::ImageType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FRONT = + T.let( + :FRONT, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::ImageType::TaggedSymbol + ) + BACK = + T.let( + :BACK, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::ImageType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::ImageType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The status of the document upload + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :ACCEPTED, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::Status::TaggedSymbol + ) + REJECTED = + T.let( + :REJECTED, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::Status::TaggedSymbol + ) + PENDING_UPLOAD = + T.let( + :PENDING_UPLOAD, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::Status::TaggedSymbol + ) + UPLOADED = + T.let( + :UPLOADED, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::Status::TaggedSymbol + ) + PARTIAL_APPROVAL = + T.let( + :PARTIAL_APPROVAL, + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/account_holder_list_documents_params.rbi b/rbi/lithic/models/account_holder_list_documents_params.rbi new file mode 100644 index 00000000..a1c3f7f0 --- /dev/null +++ b/rbi/lithic/models/account_holder_list_documents_params.rbi @@ -0,0 +1,41 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderListDocumentsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderListDocumentsParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :account_holder_token + + sig do + params( + account_holder_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(account_holder_token:, request_options: {}) + end + + sig do + override.returns( + { + account_holder_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/account_holder_list_documents_response.rbi b/rbi/lithic/models/account_holder_list_documents_response.rbi new file mode 100644 index 00000000..4bd99c91 --- /dev/null +++ b/rbi/lithic/models/account_holder_list_documents_response.rbi @@ -0,0 +1,33 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderListDocumentsResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AccountHolderListDocumentsResponse, + Lithic::Internal::AnyHash + ) + end + + sig { returns(T.nilable(T::Array[Lithic::Document])) } + attr_reader :data + + sig { params(data: T::Array[Lithic::Document::OrHash]).void } + attr_writer :data + + sig do + params(data: T::Array[Lithic::Document::OrHash]).returns( + T.attached_class + ) + end + def self.new(data: nil) + end + + sig { override.returns({ data: T::Array[Lithic::Document] }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/account_holder_list_params.rbi b/rbi/lithic/models/account_holder_list_params.rbi new file mode 100644 index 00000000..dcd972f7 --- /dev/null +++ b/rbi/lithic/models/account_holder_list_params.rbi @@ -0,0 +1,172 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::AccountHolderListParams, Lithic::Internal::AnyHash) + end + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Email address of the account holder. The query must be an exact match, case + # insensitive. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # If applicable, represents the external_id associated with the account_holder. + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # (Individual Account Holders only) The first name of the account holder. The + # query is case insensitive and supports partial matches. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # (Individual Account Holders only) The last name of the account holder. The query + # is case insensitive and supports partial matches. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # (Business Account Holders only) The legal business name of the account holder. + # The query is case insensitive and supports partial matches. + sig { returns(T.nilable(String)) } + attr_reader :legal_business_name + + sig { params(legal_business_name: String).void } + attr_writer :legal_business_name + + # The number of account_holders to limit the response to. + sig { returns(T.nilable(Integer)) } + attr_reader :limit + + sig { params(limit: Integer).void } + attr_writer :limit + + # Phone number of the account holder. The query must be an exact match. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + begin_: Time, + email: String, + end_: Time, + ending_before: String, + external_id: String, + first_name: String, + last_name: String, + legal_business_name: String, + limit: Integer, + phone_number: String, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Email address of the account holder. The query must be an exact match, case + # insensitive. + email: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # If applicable, represents the external_id associated with the account_holder. + external_id: nil, + # (Individual Account Holders only) The first name of the account holder. The + # query is case insensitive and supports partial matches. + first_name: nil, + # (Individual Account Holders only) The last name of the account holder. The query + # is case insensitive and supports partial matches. + last_name: nil, + # (Business Account Holders only) The legal business name of the account holder. + # The query is case insensitive and supports partial matches. + legal_business_name: nil, + # The number of account_holders to limit the response to. + limit: nil, + # Phone number of the account holder. The query must be an exact match. + phone_number: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + begin_: Time, + email: String, + end_: Time, + ending_before: String, + external_id: String, + first_name: String, + last_name: String, + legal_business_name: String, + limit: Integer, + phone_number: String, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/account_holder_retrieve_document_params.rbi b/rbi/lithic/models/account_holder_retrieve_document_params.rbi new file mode 100644 index 00000000..266526d6 --- /dev/null +++ b/rbi/lithic/models/account_holder_retrieve_document_params.rbi @@ -0,0 +1,46 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderRetrieveDocumentParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderRetrieveDocumentParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :account_holder_token + + sig { returns(String) } + attr_accessor :document_token + + sig do + params( + account_holder_token: String, + document_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(account_holder_token:, document_token:, request_options: {}) + end + + sig do + override.returns( + { + account_holder_token: String, + document_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/account_holder_retrieve_params.rbi b/rbi/lithic/models/account_holder_retrieve_params.rbi new file mode 100644 index 00000000..6ea2e615 --- /dev/null +++ b/rbi/lithic/models/account_holder_retrieve_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::AccountHolderRetrieveParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :account_holder_token + + sig do + params( + account_holder_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(account_holder_token:, request_options: {}) + end + + sig do + override.returns( + { + account_holder_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/account_holder_simulate_enrollment_document_review_params.rbi b/rbi/lithic/models/account_holder_simulate_enrollment_document_review_params.rbi new file mode 100644 index 00000000..db2ab0b8 --- /dev/null +++ b/rbi/lithic/models/account_holder_simulate_enrollment_document_review_params.rbi @@ -0,0 +1,223 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderSimulateEnrollmentDocumentReviewParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams, + Lithic::Internal::AnyHash + ) + end + + # The account holder document upload which to perform the simulation upon. + sig { returns(String) } + attr_accessor :document_upload_token + + # An account holder document's upload status for use within the simulation. + sig do + returns( + Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::Status::OrSymbol + ) + end + attr_accessor :status + + # A list of status reasons associated with a KYB account holder in PENDING_REVIEW + sig { returns(T.nilable(T::Array[String])) } + attr_reader :accepted_entity_status_reasons + + sig { params(accepted_entity_status_reasons: T::Array[String]).void } + attr_writer :accepted_entity_status_reasons + + # Status reason that will be associated with the simulated account holder status. + # Only required for a `REJECTED` status or `PARTIAL_APPROVAL` status. + sig do + returns( + T.nilable( + Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::OrSymbol + ) + ) + end + attr_reader :status_reason + + sig do + params( + status_reason: + Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::OrSymbol + ).void + end + attr_writer :status_reason + + sig do + params( + document_upload_token: String, + status: + Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::Status::OrSymbol, + accepted_entity_status_reasons: T::Array[String], + status_reason: + Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The account holder document upload which to perform the simulation upon. + document_upload_token:, + # An account holder document's upload status for use within the simulation. + status:, + # A list of status reasons associated with a KYB account holder in PENDING_REVIEW + accepted_entity_status_reasons: nil, + # Status reason that will be associated with the simulated account holder status. + # Only required for a `REJECTED` status or `PARTIAL_APPROVAL` status. + status_reason: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + document_upload_token: String, + status: + Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::Status::OrSymbol, + accepted_entity_status_reasons: T::Array[String], + status_reason: + Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # An account holder document's upload status for use within the simulation. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + UPLOADED = + T.let( + :UPLOADED, + Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::Status::TaggedSymbol + ) + ACCEPTED = + T.let( + :ACCEPTED, + Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::Status::TaggedSymbol + ) + REJECTED = + T.let( + :REJECTED, + Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::Status::TaggedSymbol + ) + PARTIAL_APPROVAL = + T.let( + :PARTIAL_APPROVAL, + Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Status reason that will be associated with the simulated account holder status. + # Only required for a `REJECTED` status or `PARTIAL_APPROVAL` status. + module StatusReason + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DOCUMENT_MISSING_REQUIRED_DATA = + T.let( + :DOCUMENT_MISSING_REQUIRED_DATA, + Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::TaggedSymbol + ) + DOCUMENT_UPLOAD_TOO_BLURRY = + T.let( + :DOCUMENT_UPLOAD_TOO_BLURRY, + Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::TaggedSymbol + ) + FILE_SIZE_TOO_LARGE = + T.let( + :FILE_SIZE_TOO_LARGE, + Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::TaggedSymbol + ) + INVALID_DOCUMENT_TYPE = + T.let( + :INVALID_DOCUMENT_TYPE, + Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::TaggedSymbol + ) + INVALID_DOCUMENT_UPLOAD = + T.let( + :INVALID_DOCUMENT_UPLOAD, + Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::TaggedSymbol + ) + INVALID_ENTITY = + T.let( + :INVALID_ENTITY, + Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::TaggedSymbol + ) + DOCUMENT_EXPIRED = + T.let( + :DOCUMENT_EXPIRED, + Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::TaggedSymbol + ) + DOCUMENT_ISSUED_GREATER_THAN_30_DAYS = + T.let( + :DOCUMENT_ISSUED_GREATER_THAN_30_DAYS, + Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::TaggedSymbol + ) + DOCUMENT_TYPE_NOT_SUPPORTED = + T.let( + :DOCUMENT_TYPE_NOT_SUPPORTED, + Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::TaggedSymbol + ) + UNKNOWN_FAILURE_REASON = + T.let( + :UNKNOWN_FAILURE_REASON, + Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::TaggedSymbol + ) + UNKNOWN_ERROR = + T.let( + :UNKNOWN_ERROR, + Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/account_holder_simulate_enrollment_review_params.rbi b/rbi/lithic/models/account_holder_simulate_enrollment_review_params.rbi new file mode 100644 index 00000000..e6b2af05 --- /dev/null +++ b/rbi/lithic/models/account_holder_simulate_enrollment_review_params.rbi @@ -0,0 +1,256 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderSimulateEnrollmentReviewParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderSimulateEnrollmentReviewParams, + Lithic::Internal::AnyHash + ) + end + + # The account holder which to perform the simulation upon. + sig { returns(T.nilable(String)) } + attr_reader :account_holder_token + + sig { params(account_holder_token: String).void } + attr_writer :account_holder_token + + # An account holder's status for use within the simulation. + sig do + returns( + T.nilable( + Lithic::AccountHolderSimulateEnrollmentReviewParams::Status::OrSymbol + ) + ) + end + attr_reader :status + + sig do + params( + status: + Lithic::AccountHolderSimulateEnrollmentReviewParams::Status::OrSymbol + ).void + end + attr_writer :status + + # Status reason that will be associated with the simulated account holder status. + # Only required for a `REJECTED` status. + sig do + returns( + T.nilable( + T::Array[ + Lithic::AccountHolderSimulateEnrollmentReviewParams::StatusReason::OrSymbol + ] + ) + ) + end + attr_reader :status_reasons + + sig do + params( + status_reasons: + T::Array[ + Lithic::AccountHolderSimulateEnrollmentReviewParams::StatusReason::OrSymbol + ] + ).void + end + attr_writer :status_reasons + + sig do + params( + account_holder_token: String, + status: + Lithic::AccountHolderSimulateEnrollmentReviewParams::Status::OrSymbol, + status_reasons: + T::Array[ + Lithic::AccountHolderSimulateEnrollmentReviewParams::StatusReason::OrSymbol + ], + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The account holder which to perform the simulation upon. + account_holder_token: nil, + # An account holder's status for use within the simulation. + status: nil, + # Status reason that will be associated with the simulated account holder status. + # Only required for a `REJECTED` status. + status_reasons: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + account_holder_token: String, + status: + Lithic::AccountHolderSimulateEnrollmentReviewParams::Status::OrSymbol, + status_reasons: + T::Array[ + Lithic::AccountHolderSimulateEnrollmentReviewParams::StatusReason::OrSymbol + ], + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # An account holder's status for use within the simulation. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AccountHolderSimulateEnrollmentReviewParams::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :ACCEPTED, + Lithic::AccountHolderSimulateEnrollmentReviewParams::Status::TaggedSymbol + ) + REJECTED = + T.let( + :REJECTED, + Lithic::AccountHolderSimulateEnrollmentReviewParams::Status::TaggedSymbol + ) + PENDING_REVIEW = + T.let( + :PENDING_REVIEW, + Lithic::AccountHolderSimulateEnrollmentReviewParams::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AccountHolderSimulateEnrollmentReviewParams::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + module StatusReason + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AccountHolderSimulateEnrollmentReviewParams::StatusReason + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE, + Lithic::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE, + Lithic::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE, + Lithic::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED = + T.let( + :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED, + Lithic::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE = + T.let( + :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE, + Lithic::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED = + T.let( + :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED, + Lithic::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE, + Lithic::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE, + Lithic::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE, + Lithic::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE = + T.let( + :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE, + Lithic::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_ID_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_ID_VERIFICATION_FAILURE, + Lithic::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_DOB_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_DOB_VERIFICATION_FAILURE, + Lithic::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_NAME_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_NAME_VERIFICATION_FAILURE, + Lithic::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + BENEFICIAL_OWNER_INDIVIDUAL_DOB_VERIFICATION_FAILURE = + T.let( + :BENEFICIAL_OWNER_INDIVIDUAL_DOB_VERIFICATION_FAILURE, + Lithic::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + BENEFICIAL_OWNER_INDIVIDUAL_BLOCKLIST_ALERT_FAILURE = + T.let( + :BENEFICIAL_OWNER_INDIVIDUAL_BLOCKLIST_ALERT_FAILURE, + Lithic::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + BENEFICIAL_OWNER_INDIVIDUAL_ID_VERIFICATION_FAILURE = + T.let( + :BENEFICIAL_OWNER_INDIVIDUAL_ID_VERIFICATION_FAILURE, + Lithic::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + BENEFICIAL_OWNER_INDIVIDUAL_NAME_VERIFICATION_FAILURE = + T.let( + :BENEFICIAL_OWNER_INDIVIDUAL_NAME_VERIFICATION_FAILURE, + Lithic::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AccountHolderSimulateEnrollmentReviewParams::StatusReason::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/account_holder_simulate_enrollment_review_response.rbi b/rbi/lithic/models/account_holder_simulate_enrollment_review_response.rbi new file mode 100644 index 00000000..60c3aeda --- /dev/null +++ b/rbi/lithic/models/account_holder_simulate_enrollment_review_response.rbi @@ -0,0 +1,1603 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderSimulateEnrollmentReviewResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for the account holder. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # Globally unique identifier for the account. + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Only present when user_type == "BUSINESS". You must submit a list of all direct + # and indirect individuals with 25% or more ownership in the company. A maximum of + # 4 beneficial owners can be submitted. If no individual owns 25% of the company + # you do not need to send beneficial owner information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + sig do + returns( + T.nilable( + T::Array[ + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual + ] + ) + ) + end + attr_reader :beneficial_owner_individuals + + sig do + params( + beneficial_owner_individuals: + T::Array[ + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::OrHash + ] + ).void + end + attr_writer :beneficial_owner_individuals + + # Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # users of businesses. Pass the account_token of the enrolled business associated + # with the AUTHORIZED_USER in this field. + sig { returns(T.nilable(String)) } + attr_accessor :business_account_token + + # Only present when user_type == "BUSINESS". Information about the business for + # which the account is being opened and KYB is being run. + sig { returns(T.nilable(Lithic::KYBBusinessEntity)) } + attr_reader :business_entity + + sig { params(business_entity: Lithic::KYBBusinessEntity::OrHash).void } + attr_writer :business_entity + + # Only present when user_type == "BUSINESS". + # + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, + # + # Managing Member, General Partner, President, Vice President, or Treasurer). This + # can be an executive, or someone who will have program-wide access + # + # to the cards that Lithic will provide. In some cases, this individual could also + # be a beneficial owner listed above. + sig do + returns( + T.nilable( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson + ) + ) + end + attr_reader :control_person + + sig do + params( + control_person: + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::OrHash + ).void + end + attr_writer :control_person + + # Timestamp of when the account holder was created. + sig { returns(T.nilable(Time)) } + attr_reader :created + + sig { params(created: Time).void } + attr_writer :created + + # (Deprecated. Use control_person.email when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL".) Primary email of + # Account Holder. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account + # holder is not KYC-Exempt. + sig do + returns( + T.nilable( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType::TaggedSymbol + ) + ) + end + attr_accessor :exemption_type + + # Customer-provided token that indicates a relationship with an object outside of + # the Lithic ecosystem. + sig { returns(T.nilable(String)) } + attr_accessor :external_id + + # Only present when user_type == "INDIVIDUAL". Information about the individual + # for which the account is being opened and KYC is being run. + sig do + returns( + T.nilable( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual + ) + ) + end + attr_reader :individual + + sig do + params( + individual: + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::OrHash + ).void + end + attr_writer :individual + + # Only present when user_type == "BUSINESS". 6-digit North American Industry + # Classification System (NAICS) code for the business. + sig { returns(T.nilable(String)) } + attr_accessor :naics_code + + # Only present when user_type == "BUSINESS". User-submitted description of the + # business. + sig { returns(T.nilable(String)) } + attr_reader :nature_of_business + + sig { params(nature_of_business: String).void } + attr_writer :nature_of_business + + # (Deprecated. Use control_person.phone_number when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL".) Primary phone of + # Account Holder, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Only present for "KYB_BASIC" and "KYC_ADVANCED" workflows. A list of documents + # required for the account holder to be approved. + sig { returns(T.nilable(T::Array[Lithic::RequiredDocument])) } + attr_reader :required_documents + + sig do + params( + required_documents: T::Array[Lithic::RequiredDocument::OrHash] + ).void + end + attr_writer :required_documents + + # (Deprecated. Use verification_application.status instead) KYC and KYB evaluation + # states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + sig do + returns( + T.nilable( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status::TaggedSymbol + ) + ) + end + attr_reader :status + + sig do + params( + status: + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status::OrSymbol + ).void + end + attr_writer :status + + # (Deprecated. Use verification_application.status_reasons) Reason for the + # evaluation status. + sig do + returns( + T.nilable( + T::Array[ + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ] + ) + ) + end + attr_reader :status_reasons + + sig do + params( + status_reasons: + T::Array[ + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::OrSymbol + ] + ).void + end + attr_writer :status_reasons + + # The type of Account Holder. If the type is "INDIVIDUAL", the "individual" + # attribute will be present. + # + # If the type is "BUSINESS" then the "business_entity", "control_person", + # "beneficial_owner_individuals", "naics_code", "nature_of_business", and + # "website_url" attributes will be present. + sig do + returns( + T.nilable( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::UserType::TaggedSymbol + ) + ) + end + attr_reader :user_type + + sig do + params( + user_type: + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::UserType::OrSymbol + ).void + end + attr_writer :user_type + + # Information about the most recent identity verification attempt + sig do + returns( + T.nilable( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication + ) + ) + end + attr_reader :verification_application + + sig do + params( + verification_application: + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::OrHash + ).void + end + attr_writer :verification_application + + # Only present when user_type == "BUSINESS". Business's primary website. + sig { returns(T.nilable(String)) } + attr_reader :website_url + + sig { params(website_url: String).void } + attr_writer :website_url + + sig do + params( + token: String, + account_token: String, + beneficial_owner_individuals: + T::Array[ + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::OrHash + ], + business_account_token: T.nilable(String), + business_entity: Lithic::KYBBusinessEntity::OrHash, + control_person: + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::OrHash, + created: Time, + email: String, + exemption_type: + T.nilable( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType::OrSymbol + ), + external_id: T.nilable(String), + individual: + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::OrHash, + naics_code: T.nilable(String), + nature_of_business: String, + phone_number: String, + required_documents: T::Array[Lithic::RequiredDocument::OrHash], + status: + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status::OrSymbol, + status_reasons: + T::Array[ + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::OrSymbol + ], + user_type: + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::UserType::OrSymbol, + verification_application: + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::OrHash, + website_url: String + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the account holder. + token: nil, + # Globally unique identifier for the account. + account_token: nil, + # Only present when user_type == "BUSINESS". You must submit a list of all direct + # and indirect individuals with 25% or more ownership in the company. A maximum of + # 4 beneficial owners can be submitted. If no individual owns 25% of the company + # you do not need to send beneficial owner information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + beneficial_owner_individuals: nil, + # Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # users of businesses. Pass the account_token of the enrolled business associated + # with the AUTHORIZED_USER in this field. + business_account_token: nil, + # Only present when user_type == "BUSINESS". Information about the business for + # which the account is being opened and KYB is being run. + business_entity: nil, + # Only present when user_type == "BUSINESS". + # + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, + # + # Managing Member, General Partner, President, Vice President, or Treasurer). This + # can be an executive, or someone who will have program-wide access + # + # to the cards that Lithic will provide. In some cases, this individual could also + # be a beneficial owner listed above. + control_person: nil, + # Timestamp of when the account holder was created. + created: nil, + # (Deprecated. Use control_person.email when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL".) Primary email of + # Account Holder. + email: nil, + # The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account + # holder is not KYC-Exempt. + exemption_type: nil, + # Customer-provided token that indicates a relationship with an object outside of + # the Lithic ecosystem. + external_id: nil, + # Only present when user_type == "INDIVIDUAL". Information about the individual + # for which the account is being opened and KYC is being run. + individual: nil, + # Only present when user_type == "BUSINESS". 6-digit North American Industry + # Classification System (NAICS) code for the business. + naics_code: nil, + # Only present when user_type == "BUSINESS". User-submitted description of the + # business. + nature_of_business: nil, + # (Deprecated. Use control_person.phone_number when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL".) Primary phone of + # Account Holder, entered in E.164 format. + phone_number: nil, + # Only present for "KYB_BASIC" and "KYC_ADVANCED" workflows. A list of documents + # required for the account holder to be approved. + required_documents: nil, + # (Deprecated. Use verification_application.status instead) KYC and KYB evaluation + # states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + status: nil, + # (Deprecated. Use verification_application.status_reasons) Reason for the + # evaluation status. + status_reasons: nil, + # The type of Account Holder. If the type is "INDIVIDUAL", the "individual" + # attribute will be present. + # + # If the type is "BUSINESS" then the "business_entity", "control_person", + # "beneficial_owner_individuals", "naics_code", "nature_of_business", and + # "website_url" attributes will be present. + user_type: nil, + # Information about the most recent identity verification attempt + verification_application: nil, + # Only present when user_type == "BUSINESS". Business's primary website. + website_url: nil + ) + end + + sig do + override.returns( + { + token: String, + account_token: String, + beneficial_owner_individuals: + T::Array[ + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual + ], + business_account_token: T.nilable(String), + business_entity: Lithic::KYBBusinessEntity, + control_person: + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson, + created: Time, + email: String, + exemption_type: + T.nilable( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType::TaggedSymbol + ), + external_id: T.nilable(String), + individual: + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual, + naics_code: T.nilable(String), + nature_of_business: String, + phone_number: String, + required_documents: T::Array[Lithic::RequiredDocument], + status: + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status::TaggedSymbol, + status_reasons: + T::Array[ + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ], + user_type: + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::UserType::TaggedSymbol, + verification_application: + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication, + website_url: String + } + ) + end + def to_hash + end + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual, + Lithic::Internal::AnyHash + ) + end + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + returns( + T.nilable( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::Address + ) + ) + end + attr_reader :address + + sig do + params( + address: + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::Address::OrHash + ).void + end + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + sig do + params( + address: + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::Address::OrHash, + dob: String, + email: String, + first_name: String, + last_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + address: nil, + # Individual's date of birth, as an RFC 3339 date. + dob: nil, + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + email: nil, + # Individual's first name, as it appears on government-issued identity documents. + first_name: nil, + # Individual's last name, as it appears on government-issued identity documents. + last_name: nil, + # Individual's phone number, entered in E.164 format. + phone_number: nil + ) + end + + sig do + override.returns( + { + address: + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + + class Address < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::Address, + Lithic::Internal::AnyHash + ) + end + + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ).returns(T.attached_class) + end + def self.new( + # Valid deliverable address (no PO boxes). + address1:, + # Name of city. + city:, + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + country:, + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + postal_code:, + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + state:, + # Unit or apartment number (if applicable). + address2: nil + ) + end + + sig do + override.returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + + class ControlPerson < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson, + Lithic::Internal::AnyHash + ) + end + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + returns( + T.nilable( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::Address + ) + ) + end + attr_reader :address + + sig do + params( + address: + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::Address::OrHash + ).void + end + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Only present when user_type == "BUSINESS". + # + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, + # + # Managing Member, General Partner, President, Vice President, or Treasurer). This + # can be an executive, or someone who will have program-wide access + # + # to the cards that Lithic will provide. In some cases, this individual could also + # be a beneficial owner listed above. + sig do + params( + address: + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::Address::OrHash, + dob: String, + email: String, + first_name: String, + last_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + address: nil, + # Individual's date of birth, as an RFC 3339 date. + dob: nil, + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + email: nil, + # Individual's first name, as it appears on government-issued identity documents. + first_name: nil, + # Individual's last name, as it appears on government-issued identity documents. + last_name: nil, + # Individual's phone number, entered in E.164 format. + phone_number: nil + ) + end + + sig do + override.returns( + { + address: + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + + class Address < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::Address, + Lithic::Internal::AnyHash + ) + end + + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ).returns(T.attached_class) + end + def self.new( + # Valid deliverable address (no PO boxes). + address1:, + # Name of city. + city:, + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + country:, + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + postal_code:, + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + state:, + # Unit or apartment number (if applicable). + address2: nil + ) + end + + sig do + override.returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + + # The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account + # holder is not KYC-Exempt. + module ExemptionType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AUTHORIZED_USER = + T.let( + :AUTHORIZED_USER, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType::TaggedSymbol + ) + PREPAID_CARD_USER = + T.let( + :PREPAID_CARD_USER, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Individual < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual, + Lithic::Internal::AnyHash + ) + end + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + returns( + T.nilable( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::Address + ) + ) + end + attr_reader :address + + sig do + params( + address: + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::Address::OrHash + ).void + end + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Only present when user_type == "INDIVIDUAL". Information about the individual + # for which the account is being opened and KYC is being run. + sig do + params( + address: + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::Address::OrHash, + dob: String, + email: String, + first_name: String, + last_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + address: nil, + # Individual's date of birth, as an RFC 3339 date. + dob: nil, + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + email: nil, + # Individual's first name, as it appears on government-issued identity documents. + first_name: nil, + # Individual's last name, as it appears on government-issued identity documents. + last_name: nil, + # Individual's phone number, entered in E.164 format. + phone_number: nil + ) + end + + sig do + override.returns( + { + address: + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + + class Address < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::Address, + Lithic::Internal::AnyHash + ) + end + + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ).returns(T.attached_class) + end + def self.new( + # Valid deliverable address (no PO boxes). + address1:, + # Name of city. + city:, + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + country:, + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + postal_code:, + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + state:, + # Unit or apartment number (if applicable). + address2: nil + ) + end + + sig do + override.returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + + # (Deprecated. Use verification_application.status instead) KYC and KYB evaluation + # states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :ACCEPTED, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status::TaggedSymbol + ) + PENDING_DOCUMENT = + T.let( + :PENDING_DOCUMENT, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status::TaggedSymbol + ) + PENDING_RESUBMIT = + T.let( + :PENDING_RESUBMIT, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status::TaggedSymbol + ) + REJECTED = + T.let( + :REJECTED, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Status Reasons for KYC/KYB enrollment states + module StatusReason + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ADDRESS_VERIFICATION_FAILURE = + T.let( + :ADDRESS_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + AGE_THRESHOLD_FAILURE = + T.let( + :AGE_THRESHOLD_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + COMPLETE_VERIFICATION_FAILURE = + T.let( + :COMPLETE_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + DOB_VERIFICATION_FAILURE = + T.let( + :DOB_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + ID_VERIFICATION_FAILURE = + T.let( + :ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + MAX_DOCUMENT_ATTEMPTS = + T.let( + :MAX_DOCUMENT_ATTEMPTS, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + MAX_RESUBMISSION_ATTEMPTS = + T.let( + :MAX_RESUBMISSION_ATTEMPTS, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + NAME_VERIFICATION_FAILURE = + T.let( + :NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + OTHER_VERIFICATION_FAILURE = + T.let( + :OTHER_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + RISK_THRESHOLD_FAILURE = + T.let( + :RISK_THRESHOLD_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + WATCHLIST_ALERT_FAILURE = + T.let( + :WATCHLIST_ALERT_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED = + T.let( + :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE = + T.let( + :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED = + T.let( + :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE = + T.let( + :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_ID_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_DOB_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_DOB_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_NAME_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The type of Account Holder. If the type is "INDIVIDUAL", the "individual" + # attribute will be present. + # + # If the type is "BUSINESS" then the "business_entity", "control_person", + # "beneficial_owner_individuals", "naics_code", "nature_of_business", and + # "website_url" attributes will be present. + module UserType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::UserType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BUSINESS = + T.let( + :BUSINESS, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::UserType::TaggedSymbol + ) + INDIVIDUAL = + T.let( + :INDIVIDUAL, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::UserType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::UserType::TaggedSymbol + ] + ) + end + def self.values + end + end + + class VerificationApplication < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication, + Lithic::Internal::AnyHash + ) + end + + # Timestamp of when the application was created. + sig { returns(Time) } + attr_accessor :created + + # KYC and KYB evaluation states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + sig do + returns( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::Status::TaggedSymbol + ) + end + attr_accessor :status + + # Reason for the evaluation status. + sig do + returns( + T::Array[ + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ] + ) + end + attr_accessor :status_reasons + + # Timestamp of when the application was last updated. + sig { returns(Time) } + attr_accessor :updated + + # Timestamp of when the application passed the verification process. Only present + # if `status` is `ACCEPTED` + sig { returns(T.nilable(Time)) } + attr_reader :ky_passed_at + + sig { params(ky_passed_at: Time).void } + attr_writer :ky_passed_at + + # Information about the most recent identity verification attempt + sig do + params( + created: Time, + status: + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::Status::OrSymbol, + status_reasons: + T::Array[ + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::OrSymbol + ], + updated: Time, + ky_passed_at: Time + ).returns(T.attached_class) + end + def self.new( + # Timestamp of when the application was created. + created:, + # KYC and KYB evaluation states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + status:, + # Reason for the evaluation status. + status_reasons:, + # Timestamp of when the application was last updated. + updated:, + # Timestamp of when the application passed the verification process. Only present + # if `status` is `ACCEPTED` + ky_passed_at: nil + ) + end + + sig do + override.returns( + { + created: Time, + status: + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::Status::TaggedSymbol, + status_reasons: + T::Array[ + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ], + updated: Time, + ky_passed_at: Time + } + ) + end + def to_hash + end + + # KYC and KYB evaluation states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :ACCEPTED, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::Status::TaggedSymbol + ) + PENDING_DOCUMENT = + T.let( + :PENDING_DOCUMENT, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::Status::TaggedSymbol + ) + PENDING_RESUBMIT = + T.let( + :PENDING_RESUBMIT, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::Status::TaggedSymbol + ) + REJECTED = + T.let( + :REJECTED, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Status Reasons for KYC/KYB enrollment states + module StatusReason + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ADDRESS_VERIFICATION_FAILURE = + T.let( + :ADDRESS_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + AGE_THRESHOLD_FAILURE = + T.let( + :AGE_THRESHOLD_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + COMPLETE_VERIFICATION_FAILURE = + T.let( + :COMPLETE_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + DOB_VERIFICATION_FAILURE = + T.let( + :DOB_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + ID_VERIFICATION_FAILURE = + T.let( + :ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + MAX_DOCUMENT_ATTEMPTS = + T.let( + :MAX_DOCUMENT_ATTEMPTS, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + MAX_RESUBMISSION_ATTEMPTS = + T.let( + :MAX_RESUBMISSION_ATTEMPTS, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + NAME_VERIFICATION_FAILURE = + T.let( + :NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + OTHER_VERIFICATION_FAILURE = + T.let( + :OTHER_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + RISK_THRESHOLD_FAILURE = + T.let( + :RISK_THRESHOLD_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + WATCHLIST_ALERT_FAILURE = + T.let( + :WATCHLIST_ALERT_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED = + T.let( + :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE = + T.let( + :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED = + T.let( + :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE = + T.let( + :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_ID_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_DOB_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_DOB_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_NAME_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::StatusReason::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/account_holder_update_params.rbi b/rbi/lithic/models/account_holder_update_params.rbi new file mode 100644 index 00000000..de2ab7c6 --- /dev/null +++ b/rbi/lithic/models/account_holder_update_params.rbi @@ -0,0 +1,947 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::AccountHolderUpdateParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :account_holder_token + + # The KYB request payload for updating a business. + sig do + returns( + T.any( + Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest, + Lithic::AccountHolderUpdateParams::Body::KYCPatchRequest, + Lithic::AccountHolderUpdateParams::Body::PatchRequest + ) + ) + end + attr_accessor :body + + sig do + params( + account_holder_token: String, + body: + T.any( + Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::OrHash, + Lithic::AccountHolderUpdateParams::Body::KYCPatchRequest::OrHash, + Lithic::AccountHolderUpdateParams::Body::PatchRequest::OrHash + ), + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + account_holder_token:, + # The KYB request payload for updating a business. + body:, + request_options: {} + ) + end + + sig do + override.returns( + { + account_holder_token: String, + body: + T.any( + Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest, + Lithic::AccountHolderUpdateParams::Body::KYCPatchRequest, + Lithic::AccountHolderUpdateParams::Body::PatchRequest + ), + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # The KYB request payload for updating a business. + module Body + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest, + Lithic::AccountHolderUpdateParams::Body::KYCPatchRequest, + Lithic::AccountHolderUpdateParams::Body::PatchRequest + ) + end + + class KYBPatchRequest < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest, + Lithic::Internal::AnyHash + ) + end + + # You must submit a list of all direct and indirect individuals with 25% or more + # ownership in the company. A maximum of 4 beneficial owners can be submitted. If + # no individual owns 25% of the company you do not need to send beneficial owner + # information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + sig do + returns( + T.nilable( + T::Array[ + Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::BeneficialOwnerIndividual + ] + ) + ) + end + attr_reader :beneficial_owner_individuals + + sig do + params( + beneficial_owner_individuals: + T::Array[ + Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::BeneficialOwnerIndividual::OrHash + ] + ).void + end + attr_writer :beneficial_owner_individuals + + # Information for business for which the account is being opened and KYB is being + # run. + sig do + returns( + T.nilable( + Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::BusinessEntity + ) + ) + end + attr_reader :business_entity + + sig do + params( + business_entity: + Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::BusinessEntity::OrHash + ).void + end + attr_writer :business_entity + + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + sig do + returns( + T.nilable( + Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::ControlPerson + ) + ) + end + attr_reader :control_person + + sig do + params( + control_person: + Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::ControlPerson::OrHash + ).void + end + attr_writer :control_person + + # A user provided id that can be used to link an account holder with an external + # system + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # 6-digit North American Industry Classification System (NAICS) code for the + # business. + sig { returns(T.nilable(String)) } + attr_reader :naics_code + + sig { params(naics_code: String).void } + attr_writer :naics_code + + # Short description of the company's line of business (i.e., what does the company + # do?). Values longer than 255 characters will be truncated before KYB + # verification + sig { returns(T.nilable(String)) } + attr_reader :nature_of_business + + sig { params(nature_of_business: String).void } + attr_writer :nature_of_business + + # Company website URL. + sig { returns(T.nilable(String)) } + attr_reader :website_url + + sig { params(website_url: String).void } + attr_writer :website_url + + # The KYB request payload for updating a business. + sig do + params( + beneficial_owner_individuals: + T::Array[ + Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::BeneficialOwnerIndividual::OrHash + ], + business_entity: + Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::BusinessEntity::OrHash, + control_person: + Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::ControlPerson::OrHash, + external_id: String, + naics_code: String, + nature_of_business: String, + website_url: String + ).returns(T.attached_class) + end + def self.new( + # You must submit a list of all direct and indirect individuals with 25% or more + # ownership in the company. A maximum of 4 beneficial owners can be submitted. If + # no individual owns 25% of the company you do not need to send beneficial owner + # information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + beneficial_owner_individuals: nil, + # Information for business for which the account is being opened and KYB is being + # run. + business_entity: nil, + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + control_person: nil, + # A user provided id that can be used to link an account holder with an external + # system + external_id: nil, + # 6-digit North American Industry Classification System (NAICS) code for the + # business. + naics_code: nil, + # Short description of the company's line of business (i.e., what does the company + # do?). Values longer than 255 characters will be truncated before KYB + # verification + nature_of_business: nil, + # Company website URL. + website_url: nil + ) + end + + sig do + override.returns( + { + beneficial_owner_individuals: + T::Array[ + Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::BeneficialOwnerIndividual + ], + business_entity: + Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::BusinessEntity, + control_person: + Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::ControlPerson, + external_id: String, + naics_code: String, + nature_of_business: String, + website_url: String + } + ) + end + def to_hash + end + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::BeneficialOwnerIndividual, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for an entity. + sig { returns(String) } + attr_accessor :entity_token + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig { returns(T.nilable(Lithic::AddressUpdate)) } + attr_reader :address + + sig { params(address: Lithic::AddressUpdate::OrHash).void } + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + sig { returns(T.nilable(String)) } + attr_reader :government_id + + sig { params(government_id: String).void } + attr_writer :government_id + + # Individuals associated with a KYB application. Phone number is optional. + sig do + params( + entity_token: String, + address: Lithic::AddressUpdate::OrHash, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for an entity. + entity_token:, + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + address: nil, + # Individual's date of birth, as an RFC 3339 date. + dob: nil, + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + email: nil, + # Individual's first name, as it appears on government-issued identity documents. + first_name: nil, + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + government_id: nil, + # Individual's last name, as it appears on government-issued identity documents. + last_name: nil, + # Individual's phone number, entered in E.164 format. + phone_number: nil + ) + end + + sig do + override.returns( + { + entity_token: String, + address: Lithic::AddressUpdate, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + end + + class BusinessEntity < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::BusinessEntity, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for an entity. + sig { returns(String) } + attr_accessor :entity_token + + # Business''s physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + sig { returns(T.nilable(Lithic::AddressUpdate)) } + attr_reader :address + + sig { params(address: Lithic::AddressUpdate::OrHash).void } + attr_writer :address + + # Any name that the business operates under that is not its legal business name + # (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :dba_business_name + + sig { params(dba_business_name: String).void } + attr_writer :dba_business_name + + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + sig { returns(T.nilable(String)) } + attr_reader :government_id + + sig { params(government_id: String).void } + attr_writer :government_id + + # Legal (formal) business name. + sig { returns(T.nilable(String)) } + attr_reader :legal_business_name + + sig { params(legal_business_name: String).void } + attr_writer :legal_business_name + + # Parent company name (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :parent_company + + sig { params(parent_company: String).void } + attr_writer :parent_company + + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :phone_numbers + + sig { params(phone_numbers: T::Array[String]).void } + attr_writer :phone_numbers + + # Information for business for which the account is being opened and KYB is being + # run. + sig do + params( + entity_token: String, + address: Lithic::AddressUpdate::OrHash, + dba_business_name: String, + government_id: String, + legal_business_name: String, + parent_company: String, + phone_numbers: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for an entity. + entity_token:, + # Business''s physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + address: nil, + # Any name that the business operates under that is not its legal business name + # (if applicable). + dba_business_name: nil, + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + government_id: nil, + # Legal (formal) business name. + legal_business_name: nil, + # Parent company name (if applicable). + parent_company: nil, + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + phone_numbers: nil + ) + end + + sig do + override.returns( + { + entity_token: String, + address: Lithic::AddressUpdate, + dba_business_name: String, + government_id: String, + legal_business_name: String, + parent_company: String, + phone_numbers: T::Array[String] + } + ) + end + def to_hash + end + end + + class ControlPerson < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::ControlPerson, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for an entity. + sig { returns(String) } + attr_accessor :entity_token + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig { returns(T.nilable(Lithic::AddressUpdate)) } + attr_reader :address + + sig { params(address: Lithic::AddressUpdate::OrHash).void } + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + sig { returns(T.nilable(String)) } + attr_reader :government_id + + sig { params(government_id: String).void } + attr_writer :government_id + + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + sig do + params( + entity_token: String, + address: Lithic::AddressUpdate::OrHash, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for an entity. + entity_token:, + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + address: nil, + # Individual's date of birth, as an RFC 3339 date. + dob: nil, + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + email: nil, + # Individual's first name, as it appears on government-issued identity documents. + first_name: nil, + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + government_id: nil, + # Individual's last name, as it appears on government-issued identity documents. + last_name: nil, + # Individual's phone number, entered in E.164 format. + phone_number: nil + ) + end + + sig do + override.returns( + { + entity_token: String, + address: Lithic::AddressUpdate, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + end + end + + class KYCPatchRequest < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUpdateParams::Body::KYCPatchRequest, + Lithic::Internal::AnyHash + ) + end + + # A user provided id that can be used to link an account holder with an external + # system + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # Information on the individual for whom the account is being opened and KYC is + # being run. + sig do + returns( + T.nilable( + Lithic::AccountHolderUpdateParams::Body::KYCPatchRequest::Individual + ) + ) + end + attr_reader :individual + + sig do + params( + individual: + Lithic::AccountHolderUpdateParams::Body::KYCPatchRequest::Individual::OrHash + ).void + end + attr_writer :individual + + # The KYC request payload for updating an account holder. + sig do + params( + external_id: String, + individual: + Lithic::AccountHolderUpdateParams::Body::KYCPatchRequest::Individual::OrHash + ).returns(T.attached_class) + end + def self.new( + # A user provided id that can be used to link an account holder with an external + # system + external_id: nil, + # Information on the individual for whom the account is being opened and KYC is + # being run. + individual: nil + ) + end + + sig do + override.returns( + { + external_id: String, + individual: + Lithic::AccountHolderUpdateParams::Body::KYCPatchRequest::Individual + } + ) + end + def to_hash + end + + class Individual < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUpdateParams::Body::KYCPatchRequest::Individual, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for an entity. + sig { returns(String) } + attr_accessor :entity_token + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig { returns(T.nilable(Lithic::AddressUpdate)) } + attr_reader :address + + sig { params(address: Lithic::AddressUpdate::OrHash).void } + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + sig { returns(T.nilable(String)) } + attr_reader :government_id + + sig { params(government_id: String).void } + attr_writer :government_id + + # Information on the individual for whom the account is being opened and KYC is + # being run. + sig do + params( + entity_token: String, + address: Lithic::AddressUpdate::OrHash, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for an entity. + entity_token:, + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + address: nil, + # Individual's date of birth, as an RFC 3339 date. + dob: nil, + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + email: nil, + # Individual's first name, as it appears on government-issued identity documents. + first_name: nil, + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + government_id: nil, + # Individual's last name, as it appears on government-issued identity documents. + last_name: nil, + # Individual's phone number, entered in E.164 format. + phone_number: nil + ) + end + + sig do + override.returns( + { + entity_token: String, + address: Lithic::AddressUpdate, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + end + end + + class PatchRequest < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUpdateParams::Body::PatchRequest, + Lithic::Internal::AnyHash + ) + end + + # Allowed for: KYC-Exempt, BYO-KYC, BYO-KYB. + sig { returns(T.nilable(Lithic::AddressUpdate)) } + attr_reader :address + + sig { params(address: Lithic::AddressUpdate::OrHash).void } + attr_writer :address + + # Allowed for: KYC-Exempt, BYO-KYC. The token of the business account to which the + # account holder is associated. + sig { returns(T.nilable(String)) } + attr_reader :business_account_token + + sig { params(business_account_token: String).void } + attr_writer :business_account_token + + # Allowed for all Account Holders. Account holder's email address. The primary + # purpose of this field is for cardholder identification and verification during + # the digital wallet tokenization process. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Allowed for KYC-Exempt, BYO-KYC. Account holder's first name. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Allowed for KYC-Exempt, BYO-KYC. Account holder's last name. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Allowed for BYO-KYB. Legal business name of the account holder. + sig { returns(T.nilable(String)) } + attr_reader :legal_business_name + + sig { params(legal_business_name: String).void } + attr_writer :legal_business_name + + # Allowed for all Account Holders. Account holder's phone number, entered in E.164 + # format. The primary purpose of this field is for cardholder identification and + # verification during the digital wallet tokenization process. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # The legacy request for updating an account holder. + sig do + params( + address: Lithic::AddressUpdate::OrHash, + business_account_token: String, + email: String, + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Allowed for: KYC-Exempt, BYO-KYC, BYO-KYB. + address: nil, + # Allowed for: KYC-Exempt, BYO-KYC. The token of the business account to which the + # account holder is associated. + business_account_token: nil, + # Allowed for all Account Holders. Account holder's email address. The primary + # purpose of this field is for cardholder identification and verification during + # the digital wallet tokenization process. + email: nil, + # Allowed for KYC-Exempt, BYO-KYC. Account holder's first name. + first_name: nil, + # Allowed for KYC-Exempt, BYO-KYC. Account holder's last name. + last_name: nil, + # Allowed for BYO-KYB. Legal business name of the account holder. + legal_business_name: nil, + # Allowed for all Account Holders. Account holder's phone number, entered in E.164 + # format. The primary purpose of this field is for cardholder identification and + # verification during the digital wallet tokenization process. + phone_number: nil + ) + end + + sig do + override.returns( + { + address: Lithic::AddressUpdate, + business_account_token: String, + email: String, + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String + } + ) + end + def to_hash + end + end + + sig do + override.returns( + T::Array[Lithic::AccountHolderUpdateParams::Body::Variants] + ) + end + def self.variants + end + end + end + end +end diff --git a/rbi/lithic/models/account_holder_update_response.rbi b/rbi/lithic/models/account_holder_update_response.rbi new file mode 100644 index 00000000..1ebd29ec --- /dev/null +++ b/rbi/lithic/models/account_holder_update_response.rbi @@ -0,0 +1,1843 @@ +# typed: strong + +module Lithic + module Models + module AccountHolderUpdateResponse + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse, + Lithic::Models::AccountHolderUpdateResponse::PatchResponse + ) + end + + class KYBKYCPatchResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for the account holder. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # Globally unique identifier for the account. + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Only present when user_type == "BUSINESS". You must submit a list of all direct + # and indirect individuals with 25% or more ownership in the company. A maximum of + # 4 beneficial owners can be submitted. If no individual owns 25% of the company + # you do not need to send beneficial owner information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + sig do + returns( + T.nilable( + T::Array[ + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual + ] + ) + ) + end + attr_reader :beneficial_owner_individuals + + sig do + params( + beneficial_owner_individuals: + T::Array[ + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::OrHash + ] + ).void + end + attr_writer :beneficial_owner_individuals + + # Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # users of businesses. Pass the account_token of the enrolled business associated + # with the AUTHORIZED_USER in this field. + sig { returns(T.nilable(String)) } + attr_accessor :business_account_token + + # Only present when user_type == "BUSINESS". Information about the business for + # which the account is being opened and KYB is being run. + sig { returns(T.nilable(Lithic::KYBBusinessEntity)) } + attr_reader :business_entity + + sig { params(business_entity: Lithic::KYBBusinessEntity::OrHash).void } + attr_writer :business_entity + + # Only present when user_type == "BUSINESS". + # + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, + # + # Managing Member, General Partner, President, Vice President, or Treasurer). This + # can be an executive, or someone who will have program-wide access + # + # to the cards that Lithic will provide. In some cases, this individual could also + # be a beneficial owner listed above. + sig do + returns( + T.nilable( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson + ) + ) + end + attr_reader :control_person + + sig do + params( + control_person: + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::OrHash + ).void + end + attr_writer :control_person + + # Timestamp of when the account holder was created. + sig { returns(T.nilable(Time)) } + attr_reader :created + + sig { params(created: Time).void } + attr_writer :created + + # (Deprecated. Use control_person.email when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL".) Primary email of + # Account Holder. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account + # holder is not KYC-Exempt. + sig do + returns( + T.nilable( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ExemptionType::TaggedSymbol + ) + ) + end + attr_reader :exemption_type + + sig do + params( + exemption_type: + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ExemptionType::OrSymbol + ).void + end + attr_writer :exemption_type + + # Customer-provided token that indicates a relationship with an object outside of + # the Lithic ecosystem. + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # Only present when user_type == "INDIVIDUAL". Information about the individual + # for which the account is being opened and KYC is being run. + sig do + returns( + T.nilable( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual + ) + ) + end + attr_reader :individual + + sig do + params( + individual: + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::OrHash + ).void + end + attr_writer :individual + + # Only present when user_type == "BUSINESS". 6-digit North American Industry + # Classification System (NAICS) code for the business. + sig { returns(T.nilable(String)) } + attr_reader :naics_code + + sig { params(naics_code: String).void } + attr_writer :naics_code + + # Only present when user_type == "BUSINESS". User-submitted description of the + # business. + sig { returns(T.nilable(String)) } + attr_reader :nature_of_business + + sig { params(nature_of_business: String).void } + attr_writer :nature_of_business + + # (Deprecated. Use control_person.phone_number when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL".) Primary phone of + # Account Holder, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Only present for "KYB_BASIC" and "KYC_ADVANCED" workflows. A list of documents + # required for the account holder to be approved. + sig { returns(T.nilable(T::Array[Lithic::RequiredDocument])) } + attr_reader :required_documents + + sig do + params( + required_documents: T::Array[Lithic::RequiredDocument::OrHash] + ).void + end + attr_writer :required_documents + + # (Deprecated. Use verification_application.status instead) KYC and KYB evaluation + # states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + sig do + returns( + T.nilable( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Status::TaggedSymbol + ) + ) + end + attr_reader :status + + sig do + params( + status: + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Status::OrSymbol + ).void + end + attr_writer :status + + # (Deprecated. Use verification_application.status_reasons) Reason for the + # evaluation status. + sig do + returns( + T.nilable( + T::Array[ + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ] + ) + ) + end + attr_reader :status_reasons + + sig do + params( + status_reasons: + T::Array[ + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::OrSymbol + ] + ).void + end + attr_writer :status_reasons + + # The type of Account Holder. If the type is "INDIVIDUAL", the "individual" + # attribute will be present. + # + # If the type is "BUSINESS" then the "business_entity", "control_person", + # "beneficial_owner_individuals", "naics_code", "nature_of_business", and + # "website_url" attributes will be present. + sig do + returns( + T.nilable( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::UserType::TaggedSymbol + ) + ) + end + attr_reader :user_type + + sig do + params( + user_type: + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::UserType::OrSymbol + ).void + end + attr_writer :user_type + + # Information about the most recent identity verification attempt + sig do + returns( + T.nilable( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication + ) + ) + end + attr_reader :verification_application + + sig do + params( + verification_application: + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::OrHash + ).void + end + attr_writer :verification_application + + # Only present when user_type == "BUSINESS". Business's primary website. + sig { returns(T.nilable(String)) } + attr_reader :website_url + + sig { params(website_url: String).void } + attr_writer :website_url + + sig do + params( + token: String, + account_token: String, + beneficial_owner_individuals: + T::Array[ + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::OrHash + ], + business_account_token: T.nilable(String), + business_entity: Lithic::KYBBusinessEntity::OrHash, + control_person: + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::OrHash, + created: Time, + email: String, + exemption_type: + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ExemptionType::OrSymbol, + external_id: String, + individual: + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::OrHash, + naics_code: String, + nature_of_business: String, + phone_number: String, + required_documents: T::Array[Lithic::RequiredDocument::OrHash], + status: + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Status::OrSymbol, + status_reasons: + T::Array[ + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::OrSymbol + ], + user_type: + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::UserType::OrSymbol, + verification_application: + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::OrHash, + website_url: String + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the account holder. + token: nil, + # Globally unique identifier for the account. + account_token: nil, + # Only present when user_type == "BUSINESS". You must submit a list of all direct + # and indirect individuals with 25% or more ownership in the company. A maximum of + # 4 beneficial owners can be submitted. If no individual owns 25% of the company + # you do not need to send beneficial owner information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + beneficial_owner_individuals: nil, + # Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # users of businesses. Pass the account_token of the enrolled business associated + # with the AUTHORIZED_USER in this field. + business_account_token: nil, + # Only present when user_type == "BUSINESS". Information about the business for + # which the account is being opened and KYB is being run. + business_entity: nil, + # Only present when user_type == "BUSINESS". + # + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, + # + # Managing Member, General Partner, President, Vice President, or Treasurer). This + # can be an executive, or someone who will have program-wide access + # + # to the cards that Lithic will provide. In some cases, this individual could also + # be a beneficial owner listed above. + control_person: nil, + # Timestamp of when the account holder was created. + created: nil, + # (Deprecated. Use control_person.email when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL".) Primary email of + # Account Holder. + email: nil, + # The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account + # holder is not KYC-Exempt. + exemption_type: nil, + # Customer-provided token that indicates a relationship with an object outside of + # the Lithic ecosystem. + external_id: nil, + # Only present when user_type == "INDIVIDUAL". Information about the individual + # for which the account is being opened and KYC is being run. + individual: nil, + # Only present when user_type == "BUSINESS". 6-digit North American Industry + # Classification System (NAICS) code for the business. + naics_code: nil, + # Only present when user_type == "BUSINESS". User-submitted description of the + # business. + nature_of_business: nil, + # (Deprecated. Use control_person.phone_number when user_type == "BUSINESS". Use + # individual.phone_number when user_type == "INDIVIDUAL".) Primary phone of + # Account Holder, entered in E.164 format. + phone_number: nil, + # Only present for "KYB_BASIC" and "KYC_ADVANCED" workflows. A list of documents + # required for the account holder to be approved. + required_documents: nil, + # (Deprecated. Use verification_application.status instead) KYC and KYB evaluation + # states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + status: nil, + # (Deprecated. Use verification_application.status_reasons) Reason for the + # evaluation status. + status_reasons: nil, + # The type of Account Holder. If the type is "INDIVIDUAL", the "individual" + # attribute will be present. + # + # If the type is "BUSINESS" then the "business_entity", "control_person", + # "beneficial_owner_individuals", "naics_code", "nature_of_business", and + # "website_url" attributes will be present. + user_type: nil, + # Information about the most recent identity verification attempt + verification_application: nil, + # Only present when user_type == "BUSINESS". Business's primary website. + website_url: nil + ) + end + + sig do + override.returns( + { + token: String, + account_token: String, + beneficial_owner_individuals: + T::Array[ + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual + ], + business_account_token: T.nilable(String), + business_entity: Lithic::KYBBusinessEntity, + control_person: + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson, + created: Time, + email: String, + exemption_type: + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ExemptionType::TaggedSymbol, + external_id: String, + individual: + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual, + naics_code: String, + nature_of_business: String, + phone_number: String, + required_documents: T::Array[Lithic::RequiredDocument], + status: + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Status::TaggedSymbol, + status_reasons: + T::Array[ + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ], + user_type: + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::UserType::TaggedSymbol, + verification_application: + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication, + website_url: String + } + ) + end + def to_hash + end + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual, + Lithic::Internal::AnyHash + ) + end + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + returns( + T.nilable( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::Address + ) + ) + end + attr_reader :address + + sig do + params( + address: + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::Address::OrHash + ).void + end + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + sig do + params( + address: + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::Address::OrHash, + dob: String, + email: String, + first_name: String, + last_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + address: nil, + # Individual's date of birth, as an RFC 3339 date. + dob: nil, + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + email: nil, + # Individual's first name, as it appears on government-issued identity documents. + first_name: nil, + # Individual's last name, as it appears on government-issued identity documents. + last_name: nil, + # Individual's phone number, entered in E.164 format. + phone_number: nil + ) + end + + sig do + override.returns( + { + address: + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + + class Address < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::Address, + Lithic::Internal::AnyHash + ) + end + + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ).returns(T.attached_class) + end + def self.new( + # Valid deliverable address (no PO boxes). + address1:, + # Name of city. + city:, + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + country:, + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + postal_code:, + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + state:, + # Unit or apartment number (if applicable). + address2: nil + ) + end + + sig do + override.returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + + class ControlPerson < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson, + Lithic::Internal::AnyHash + ) + end + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + returns( + T.nilable( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::Address + ) + ) + end + attr_reader :address + + sig do + params( + address: + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::Address::OrHash + ).void + end + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Only present when user_type == "BUSINESS". + # + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, + # + # Managing Member, General Partner, President, Vice President, or Treasurer). This + # can be an executive, or someone who will have program-wide access + # + # to the cards that Lithic will provide. In some cases, this individual could also + # be a beneficial owner listed above. + sig do + params( + address: + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::Address::OrHash, + dob: String, + email: String, + first_name: String, + last_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + address: nil, + # Individual's date of birth, as an RFC 3339 date. + dob: nil, + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + email: nil, + # Individual's first name, as it appears on government-issued identity documents. + first_name: nil, + # Individual's last name, as it appears on government-issued identity documents. + last_name: nil, + # Individual's phone number, entered in E.164 format. + phone_number: nil + ) + end + + sig do + override.returns( + { + address: + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + + class Address < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::Address, + Lithic::Internal::AnyHash + ) + end + + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ).returns(T.attached_class) + end + def self.new( + # Valid deliverable address (no PO boxes). + address1:, + # Name of city. + city:, + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + country:, + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + postal_code:, + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + state:, + # Unit or apartment number (if applicable). + address2: nil + ) + end + + sig do + override.returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + + # The type of KYC exemption for a KYC-Exempt Account Holder. `null` if the account + # holder is not KYC-Exempt. + module ExemptionType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ExemptionType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AUTHORIZED_USER = + T.let( + :AUTHORIZED_USER, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ExemptionType::TaggedSymbol + ) + PREPAID_CARD_USER = + T.let( + :PREPAID_CARD_USER, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ExemptionType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ExemptionType::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Individual < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual, + Lithic::Internal::AnyHash + ) + end + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + returns( + T.nilable( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::Address + ) + ) + end + attr_reader :address + + sig do + params( + address: + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::Address::OrHash + ).void + end + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Only present when user_type == "INDIVIDUAL". Information about the individual + # for which the account is being opened and KYC is being run. + sig do + params( + address: + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::Address::OrHash, + dob: String, + email: String, + first_name: String, + last_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + address: nil, + # Individual's date of birth, as an RFC 3339 date. + dob: nil, + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + email: nil, + # Individual's first name, as it appears on government-issued identity documents. + first_name: nil, + # Individual's last name, as it appears on government-issued identity documents. + last_name: nil, + # Individual's phone number, entered in E.164 format. + phone_number: nil + ) + end + + sig do + override.returns( + { + address: + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + + class Address < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::Address, + Lithic::Internal::AnyHash + ) + end + + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ).returns(T.attached_class) + end + def self.new( + # Valid deliverable address (no PO boxes). + address1:, + # Name of city. + city:, + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + country:, + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + postal_code:, + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + state:, + # Unit or apartment number (if applicable). + address2: nil + ) + end + + sig do + override.returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + + # (Deprecated. Use verification_application.status instead) KYC and KYB evaluation + # states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :ACCEPTED, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Status::TaggedSymbol + ) + PENDING_DOCUMENT = + T.let( + :PENDING_DOCUMENT, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Status::TaggedSymbol + ) + PENDING_RESUBMIT = + T.let( + :PENDING_RESUBMIT, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Status::TaggedSymbol + ) + REJECTED = + T.let( + :REJECTED, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Status Reasons for KYC/KYB enrollment states + module StatusReason + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ADDRESS_VERIFICATION_FAILURE = + T.let( + :ADDRESS_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + AGE_THRESHOLD_FAILURE = + T.let( + :AGE_THRESHOLD_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + COMPLETE_VERIFICATION_FAILURE = + T.let( + :COMPLETE_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + DOB_VERIFICATION_FAILURE = + T.let( + :DOB_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + ID_VERIFICATION_FAILURE = + T.let( + :ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + MAX_DOCUMENT_ATTEMPTS = + T.let( + :MAX_DOCUMENT_ATTEMPTS, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + MAX_RESUBMISSION_ATTEMPTS = + T.let( + :MAX_RESUBMISSION_ATTEMPTS, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + NAME_VERIFICATION_FAILURE = + T.let( + :NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + OTHER_VERIFICATION_FAILURE = + T.let( + :OTHER_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + RISK_THRESHOLD_FAILURE = + T.let( + :RISK_THRESHOLD_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + WATCHLIST_ALERT_FAILURE = + T.let( + :WATCHLIST_ALERT_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED = + T.let( + :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE = + T.let( + :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED = + T.let( + :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE = + T.let( + :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_ID_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_DOB_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_DOB_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_NAME_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::StatusReason::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The type of Account Holder. If the type is "INDIVIDUAL", the "individual" + # attribute will be present. + # + # If the type is "BUSINESS" then the "business_entity", "control_person", + # "beneficial_owner_individuals", "naics_code", "nature_of_business", and + # "website_url" attributes will be present. + module UserType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::UserType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BUSINESS = + T.let( + :BUSINESS, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::UserType::TaggedSymbol + ) + INDIVIDUAL = + T.let( + :INDIVIDUAL, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::UserType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::UserType::TaggedSymbol + ] + ) + end + def self.values + end + end + + class VerificationApplication < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication, + Lithic::Internal::AnyHash + ) + end + + # Timestamp of when the application was created. + sig { returns(Time) } + attr_accessor :created + + # KYC and KYB evaluation states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + sig do + returns( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::Status::TaggedSymbol + ) + end + attr_accessor :status + + # Reason for the evaluation status. + sig do + returns( + T::Array[ + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ] + ) + end + attr_accessor :status_reasons + + # Timestamp of when the application was last updated. + sig { returns(Time) } + attr_accessor :updated + + # Timestamp of when the application passed the verification process. Only present + # if `status` is `ACCEPTED` + sig { returns(T.nilable(Time)) } + attr_reader :ky_passed_at + + sig { params(ky_passed_at: Time).void } + attr_writer :ky_passed_at + + # Information about the most recent identity verification attempt + sig do + params( + created: Time, + status: + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::Status::OrSymbol, + status_reasons: + T::Array[ + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::OrSymbol + ], + updated: Time, + ky_passed_at: Time + ).returns(T.attached_class) + end + def self.new( + # Timestamp of when the application was created. + created:, + # KYC and KYB evaluation states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + status:, + # Reason for the evaluation status. + status_reasons:, + # Timestamp of when the application was last updated. + updated:, + # Timestamp of when the application passed the verification process. Only present + # if `status` is `ACCEPTED` + ky_passed_at: nil + ) + end + + sig do + override.returns( + { + created: Time, + status: + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::Status::TaggedSymbol, + status_reasons: + T::Array[ + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ], + updated: Time, + ky_passed_at: Time + } + ) + end + def to_hash + end + + # KYC and KYB evaluation states. + # + # Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the + # `ADVANCED` workflow. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :ACCEPTED, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::Status::TaggedSymbol + ) + PENDING_DOCUMENT = + T.let( + :PENDING_DOCUMENT, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::Status::TaggedSymbol + ) + PENDING_RESUBMIT = + T.let( + :PENDING_RESUBMIT, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::Status::TaggedSymbol + ) + REJECTED = + T.let( + :REJECTED, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Status Reasons for KYC/KYB enrollment states + module StatusReason + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ADDRESS_VERIFICATION_FAILURE = + T.let( + :ADDRESS_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + AGE_THRESHOLD_FAILURE = + T.let( + :AGE_THRESHOLD_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + COMPLETE_VERIFICATION_FAILURE = + T.let( + :COMPLETE_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + DOB_VERIFICATION_FAILURE = + T.let( + :DOB_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + ID_VERIFICATION_FAILURE = + T.let( + :ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + MAX_DOCUMENT_ATTEMPTS = + T.let( + :MAX_DOCUMENT_ATTEMPTS, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + MAX_RESUBMISSION_ATTEMPTS = + T.let( + :MAX_RESUBMISSION_ATTEMPTS, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + NAME_VERIFICATION_FAILURE = + T.let( + :NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + OTHER_VERIFICATION_FAILURE = + T.let( + :OTHER_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + RISK_THRESHOLD_FAILURE = + T.let( + :RISK_THRESHOLD_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + WATCHLIST_ALERT_FAILURE = + T.let( + :WATCHLIST_ALERT_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED = + T.let( + :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE = + T.let( + :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED = + T.let( + :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE = + T.let( + :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_ID_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_DOB_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_DOB_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_NAME_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::StatusReason::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + + class PatchResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AccountHolderUpdateResponse::PatchResponse, + Lithic::Internal::AnyHash + ) + end + + # The token for the account holder that was updated + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # The address for the account holder + sig do + returns( + T.nilable( + Lithic::Models::AccountHolderUpdateResponse::PatchResponse::Address + ) + ) + end + attr_reader :address + + sig do + params( + address: + Lithic::Models::AccountHolderUpdateResponse::PatchResponse::Address::OrHash + ).void + end + attr_writer :address + + # The token for the business account that the account holder is associated with + sig { returns(T.nilable(String)) } + attr_accessor :business_account_token + + # The email for the account holder + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # The first name for the account holder + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # The last name for the account holder + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # The legal business name for the account holder + sig { returns(T.nilable(String)) } + attr_reader :legal_business_name + + sig { params(legal_business_name: String).void } + attr_writer :legal_business_name + + # The phone_number for the account holder + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + sig do + params( + token: String, + address: + Lithic::Models::AccountHolderUpdateResponse::PatchResponse::Address::OrHash, + business_account_token: T.nilable(String), + email: String, + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # The token for the account holder that was updated + token: nil, + # The address for the account holder + address: nil, + # The token for the business account that the account holder is associated with + business_account_token: nil, + # The email for the account holder + email: nil, + # The first name for the account holder + first_name: nil, + # The last name for the account holder + last_name: nil, + # The legal business name for the account holder + legal_business_name: nil, + # The phone_number for the account holder + phone_number: nil + ) + end + + sig do + override.returns( + { + token: String, + address: + Lithic::Models::AccountHolderUpdateResponse::PatchResponse::Address, + business_account_token: T.nilable(String), + email: String, + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String + } + ) + end + def to_hash + end + + class Address < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AccountHolderUpdateResponse::PatchResponse::Address, + Lithic::Internal::AnyHash + ) + end + + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # The address for the account holder + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ).returns(T.attached_class) + end + def self.new( + # Valid deliverable address (no PO boxes). + address1:, + # Name of city. + city:, + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + country:, + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + postal_code:, + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + state:, + # Unit or apartment number (if applicable). + address2: nil + ) + end + + sig do + override.returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + + sig do + override.returns( + T::Array[Lithic::Models::AccountHolderUpdateResponse::Variants] + ) + end + def self.variants + end + end + end +end diff --git a/rbi/lithic/models/account_holder_updated_webhook_event.rbi b/rbi/lithic/models/account_holder_updated_webhook_event.rbi new file mode 100644 index 00000000..3a645b56 --- /dev/null +++ b/rbi/lithic/models/account_holder_updated_webhook_event.rbi @@ -0,0 +1,1272 @@ +# typed: strong + +module Lithic + module Models + # KYB payload for an updated account holder. + module AccountHolderUpdatedWebhookEvent + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload, + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload, + Lithic::AccountHolderUpdatedWebhookEvent::LegacyPayload + ) + end + + class KYBPayload < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload, + Lithic::Internal::AnyHash + ) + end + + # The token of the account_holder that was created. + sig { returns(String) } + attr_accessor :token + + # Original request to update the account holder. + sig do + returns( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest + ) + end + attr_reader :update_request + + sig do + params( + update_request: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::OrHash + ).void + end + attr_writer :update_request + + # The type of event that occurred. + sig do + returns( + T.nilable( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::EventType::TaggedSymbol + ) + ) + end + attr_reader :event_type + + sig do + params( + event_type: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::EventType::OrSymbol + ).void + end + attr_writer :event_type + + # A user provided id that can be used to link an account holder with an external + # system + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # 6-digit North American Industry Classification System (NAICS) code for the + # business. Only present if naics_code was included in the update request. + sig { returns(T.nilable(String)) } + attr_reader :naics_code + + sig { params(naics_code: String).void } + attr_writer :naics_code + + # Short description of the company's line of business (i.e., what does the company + # do?). Values longer than 255 characters will be truncated before KYB + # verification + sig { returns(T.nilable(String)) } + attr_reader :nature_of_business + + sig { params(nature_of_business: String).void } + attr_writer :nature_of_business + + # Company website URL. + sig { returns(T.nilable(String)) } + attr_reader :website_url + + sig { params(website_url: String).void } + attr_writer :website_url + + # KYB payload for an updated account holder. + sig do + params( + token: String, + update_request: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::OrHash, + event_type: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::EventType::OrSymbol, + external_id: String, + naics_code: String, + nature_of_business: String, + website_url: String + ).returns(T.attached_class) + end + def self.new( + # The token of the account_holder that was created. + token:, + # Original request to update the account holder. + update_request:, + # The type of event that occurred. + event_type: nil, + # A user provided id that can be used to link an account holder with an external + # system + external_id: nil, + # 6-digit North American Industry Classification System (NAICS) code for the + # business. Only present if naics_code was included in the update request. + naics_code: nil, + # Short description of the company's line of business (i.e., what does the company + # do?). Values longer than 255 characters will be truncated before KYB + # verification + nature_of_business: nil, + # Company website URL. + website_url: nil + ) + end + + sig do + override.returns( + { + token: String, + update_request: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest, + event_type: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::EventType::TaggedSymbol, + external_id: String, + naics_code: String, + nature_of_business: String, + website_url: String + } + ) + end + def to_hash + end + + class UpdateRequest < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest, + Lithic::Internal::AnyHash + ) + end + + # You must submit a list of all direct and indirect individuals with 25% or more + # ownership in the company. A maximum of 4 beneficial owners can be submitted. If + # no individual owns 25% of the company you do not need to send beneficial owner + # information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + sig do + returns( + T.nilable( + T::Array[ + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual + ] + ) + ) + end + attr_reader :beneficial_owner_individuals + + sig do + params( + beneficial_owner_individuals: + T::Array[ + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::OrHash + ] + ).void + end + attr_writer :beneficial_owner_individuals + + # Information for business for which the account is being opened and KYB is being + # run. + sig { returns(T.nilable(Lithic::KYBBusinessEntity)) } + attr_reader :business_entity + + sig do + params(business_entity: Lithic::KYBBusinessEntity::OrHash).void + end + attr_writer :business_entity + + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + sig do + returns( + T.nilable( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson + ) + ) + end + attr_reader :control_person + + sig do + params( + control_person: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::OrHash + ).void + end + attr_writer :control_person + + # Original request to update the account holder. + sig do + params( + beneficial_owner_individuals: + T::Array[ + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::OrHash + ], + business_entity: Lithic::KYBBusinessEntity::OrHash, + control_person: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::OrHash + ).returns(T.attached_class) + end + def self.new( + # You must submit a list of all direct and indirect individuals with 25% or more + # ownership in the company. A maximum of 4 beneficial owners can be submitted. If + # no individual owns 25% of the company you do not need to send beneficial owner + # information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + beneficial_owner_individuals: nil, + # Information for business for which the account is being opened and KYB is being + # run. + business_entity: nil, + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + control_person: nil + ) + end + + sig do + override.returns( + { + beneficial_owner_individuals: + T::Array[ + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual + ], + business_entity: Lithic::KYBBusinessEntity, + control_person: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson + } + ) + end + def to_hash + end + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual, + Lithic::Internal::AnyHash + ) + end + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + returns( + T.nilable( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address + ) + ) + end + attr_reader :address + + sig do + params( + address: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address::OrHash + ).void + end + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + sig do + params( + address: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address::OrHash, + dob: String, + email: String, + first_name: String, + last_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + address: nil, + # Individual's date of birth, as an RFC 3339 date. + dob: nil, + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + email: nil, + # Individual's first name, as it appears on government-issued identity documents. + first_name: nil, + # Individual's last name, as it appears on government-issued identity documents. + last_name: nil, + # Individual's phone number, entered in E.164 format. + phone_number: nil + ) + end + + sig do + override.returns( + { + address: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + + class Address < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address, + Lithic::Internal::AnyHash + ) + end + + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ).returns(T.attached_class) + end + def self.new( + # Valid deliverable address (no PO boxes). + address1:, + # Name of city. + city:, + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + country:, + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + postal_code:, + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + state:, + # Unit or apartment number (if applicable). + address2: nil + ) + end + + sig do + override.returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + + class ControlPerson < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson, + Lithic::Internal::AnyHash + ) + end + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + returns( + T.nilable( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address + ) + ) + end + attr_reader :address + + sig do + params( + address: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address::OrHash + ).void + end + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + sig do + params( + address: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address::OrHash, + dob: String, + email: String, + first_name: String, + last_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + address: nil, + # Individual's date of birth, as an RFC 3339 date. + dob: nil, + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + email: nil, + # Individual's first name, as it appears on government-issued identity documents. + first_name: nil, + # Individual's last name, as it appears on government-issued identity documents. + last_name: nil, + # Individual's phone number, entered in E.164 format. + phone_number: nil + ) + end + + sig do + override.returns( + { + address: + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + + class Address < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address, + Lithic::Internal::AnyHash + ) + end + + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ).returns(T.attached_class) + end + def self.new( + # Valid deliverable address (no PO boxes). + address1:, + # Name of city. + city:, + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + country:, + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + postal_code:, + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + state:, + # Unit or apartment number (if applicable). + address2: nil + ) + end + + sig do + override.returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + end + + # The type of event that occurred. + module EventType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::EventType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_HOLDER_UPDATED = + T.let( + :"account_holder.updated", + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::EventType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::EventType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class KYCPayload < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload, + Lithic::Internal::AnyHash + ) + end + + # The token of the account_holder that was created. + sig { returns(String) } + attr_accessor :token + + # Original request to update the account holder. + sig do + returns( + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest + ) + end + attr_reader :update_request + + sig do + params( + update_request: + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::OrHash + ).void + end + attr_writer :update_request + + # The type of event that occurred. + sig do + returns( + T.nilable( + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::EventType::TaggedSymbol + ) + ) + end + attr_reader :event_type + + sig do + params( + event_type: + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::EventType::OrSymbol + ).void + end + attr_writer :event_type + + # A user provided id that can be used to link an account holder with an external + # system + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # KYC payload for an updated account holder. + sig do + params( + token: String, + update_request: + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::OrHash, + event_type: + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::EventType::OrSymbol, + external_id: String + ).returns(T.attached_class) + end + def self.new( + # The token of the account_holder that was created. + token:, + # Original request to update the account holder. + update_request:, + # The type of event that occurred. + event_type: nil, + # A user provided id that can be used to link an account holder with an external + # system + external_id: nil + ) + end + + sig do + override.returns( + { + token: String, + update_request: + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest, + event_type: + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::EventType::TaggedSymbol, + external_id: String + } + ) + end + def to_hash + end + + class UpdateRequest < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest, + Lithic::Internal::AnyHash + ) + end + + # Information on the individual for whom the account is being opened and KYC is + # being run. + sig do + returns( + T.nilable( + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual + ) + ) + end + attr_reader :individual + + sig do + params( + individual: + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::OrHash + ).void + end + attr_writer :individual + + # Original request to update the account holder. + sig do + params( + individual: + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::OrHash + ).returns(T.attached_class) + end + def self.new( + # Information on the individual for whom the account is being opened and KYC is + # being run. + individual: nil + ) + end + + sig do + override.returns( + { + individual: + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual + } + ) + end + def to_hash + end + + class Individual < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual, + Lithic::Internal::AnyHash + ) + end + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + returns( + T.nilable( + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address + ) + ) + end + attr_reader :address + + sig do + params( + address: + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address::OrHash + ).void + end + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Information on the individual for whom the account is being opened and KYC is + # being run. + sig do + params( + address: + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address::OrHash, + dob: String, + email: String, + first_name: String, + last_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + address: nil, + # Individual's date of birth, as an RFC 3339 date. + dob: nil, + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + email: nil, + # Individual's first name, as it appears on government-issued identity documents. + first_name: nil, + # Individual's last name, as it appears on government-issued identity documents. + last_name: nil, + # Individual's phone number, entered in E.164 format. + phone_number: nil + ) + end + + sig do + override.returns( + { + address: + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + + class Address < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address, + Lithic::Internal::AnyHash + ) + end + + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ).returns(T.attached_class) + end + def self.new( + # Valid deliverable address (no PO boxes). + address1:, + # Name of city. + city:, + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + country:, + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + postal_code:, + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + state:, + # Unit or apartment number (if applicable). + address2: nil + ) + end + + sig do + override.returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + end + + # The type of event that occurred. + module EventType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::EventType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_HOLDER_UPDATED = + T.let( + :"account_holder.updated", + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::EventType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::EventType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class LegacyPayload < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUpdatedWebhookEvent::LegacyPayload, + Lithic::Internal::AnyHash + ) + end + + # The token of the account_holder that was created. + sig { returns(String) } + attr_accessor :token + + # If applicable, represents the business account token associated with the + # account_holder. + sig { returns(T.nilable(String)) } + attr_accessor :business_account_token + + # When the account_holder updated event was created + sig { returns(T.nilable(Time)) } + attr_reader :created + + sig { params(created: Time).void } + attr_writer :created + + # If updated, the newly updated email associated with the account_holder otherwise + # the existing email is provided. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # The type of event that occurred. + sig do + returns( + T.nilable( + Lithic::AccountHolderUpdatedWebhookEvent::LegacyPayload::EventType::TaggedSymbol + ) + ) + end + attr_reader :event_type + + sig do + params( + event_type: + Lithic::AccountHolderUpdatedWebhookEvent::LegacyPayload::EventType::OrSymbol + ).void + end + attr_writer :event_type + + # If applicable, represents the external_id associated with the account_holder. + sig { returns(T.nilable(String)) } + attr_accessor :external_id + + # If applicable, represents the account_holder's first name. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # If applicable, represents the account_holder's last name. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # If applicable, represents the account_holder's business name. + sig { returns(T.nilable(String)) } + attr_reader :legal_business_name + + sig { params(legal_business_name: String).void } + attr_writer :legal_business_name + + # If updated, the newly updated phone_number associated with the account_holder + # otherwise the existing phone_number is provided. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Legacy payload for an updated account holder. + sig do + params( + token: String, + business_account_token: T.nilable(String), + created: Time, + email: String, + event_type: + Lithic::AccountHolderUpdatedWebhookEvent::LegacyPayload::EventType::OrSymbol, + external_id: T.nilable(String), + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # The token of the account_holder that was created. + token:, + # If applicable, represents the business account token associated with the + # account_holder. + business_account_token: nil, + # When the account_holder updated event was created + created: nil, + # If updated, the newly updated email associated with the account_holder otherwise + # the existing email is provided. + email: nil, + # The type of event that occurred. + event_type: nil, + # If applicable, represents the external_id associated with the account_holder. + external_id: nil, + # If applicable, represents the account_holder's first name. + first_name: nil, + # If applicable, represents the account_holder's last name. + last_name: nil, + # If applicable, represents the account_holder's business name. + legal_business_name: nil, + # If updated, the newly updated phone_number associated with the account_holder + # otherwise the existing phone_number is provided. + phone_number: nil + ) + end + + sig do + override.returns( + { + token: String, + business_account_token: T.nilable(String), + created: Time, + email: String, + event_type: + Lithic::AccountHolderUpdatedWebhookEvent::LegacyPayload::EventType::TaggedSymbol, + external_id: T.nilable(String), + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String + } + ) + end + def to_hash + end + + # The type of event that occurred. + module EventType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AccountHolderUpdatedWebhookEvent::LegacyPayload::EventType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_HOLDER_UPDATED = + T.let( + :"account_holder.updated", + Lithic::AccountHolderUpdatedWebhookEvent::LegacyPayload::EventType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AccountHolderUpdatedWebhookEvent::LegacyPayload::EventType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig do + override.returns( + T::Array[Lithic::AccountHolderUpdatedWebhookEvent::Variants] + ) + end + def self.variants + end + end + end +end diff --git a/rbi/lithic/models/account_holder_upload_document_params.rbi b/rbi/lithic/models/account_holder_upload_document_params.rbi new file mode 100644 index 00000000..444e216d --- /dev/null +++ b/rbi/lithic/models/account_holder_upload_document_params.rbi @@ -0,0 +1,186 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderUploadDocumentParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderUploadDocumentParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :account_holder_token + + # The type of document to upload + sig do + returns( + Lithic::AccountHolderUploadDocumentParams::DocumentType::OrSymbol + ) + end + attr_accessor :document_type + + # Globally unique identifier for the entity. + sig { returns(String) } + attr_accessor :entity_token + + sig do + params( + account_holder_token: String, + document_type: + Lithic::AccountHolderUploadDocumentParams::DocumentType::OrSymbol, + entity_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + account_holder_token:, + # The type of document to upload + document_type:, + # Globally unique identifier for the entity. + entity_token:, + request_options: {} + ) + end + + sig do + override.returns( + { + account_holder_token: String, + document_type: + Lithic::AccountHolderUploadDocumentParams::DocumentType::OrSymbol, + entity_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # The type of document to upload + module DocumentType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AccountHolderUploadDocumentParams::DocumentType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EIN_LETTER = + T.let( + :EIN_LETTER, + Lithic::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol + ) + TAX_RETURN = + T.let( + :TAX_RETURN, + Lithic::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol + ) + OPERATING_AGREEMENT = + T.let( + :OPERATING_AGREEMENT, + Lithic::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol + ) + CERTIFICATE_OF_FORMATION = + T.let( + :CERTIFICATE_OF_FORMATION, + Lithic::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol + ) + DRIVERS_LICENSE = + T.let( + :DRIVERS_LICENSE, + Lithic::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol + ) + PASSPORT = + T.let( + :PASSPORT, + Lithic::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol + ) + PASSPORT_CARD = + T.let( + :PASSPORT_CARD, + Lithic::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol + ) + CERTIFICATE_OF_GOOD_STANDING = + T.let( + :CERTIFICATE_OF_GOOD_STANDING, + Lithic::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol + ) + ARTICLES_OF_INCORPORATION = + T.let( + :ARTICLES_OF_INCORPORATION, + Lithic::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol + ) + ARTICLES_OF_ORGANIZATION = + T.let( + :ARTICLES_OF_ORGANIZATION, + Lithic::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol + ) + BYLAWS = + T.let( + :BYLAWS, + Lithic::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol + ) + GOVERNMENT_BUSINESS_LICENSE = + T.let( + :GOVERNMENT_BUSINESS_LICENSE, + Lithic::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol + ) + PARTNERSHIP_AGREEMENT = + T.let( + :PARTNERSHIP_AGREEMENT, + Lithic::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol + ) + SS4_FORM = + T.let( + :SS4_FORM, + Lithic::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol + ) + BANK_STATEMENT = + T.let( + :BANK_STATEMENT, + Lithic::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol + ) + UTILITY_BILL_STATEMENT = + T.let( + :UTILITY_BILL_STATEMENT, + Lithic::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol + ) + SSN_CARD = + T.let( + :SSN_CARD, + Lithic::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol + ) + ITIN_LETTER = + T.let( + :ITIN_LETTER, + Lithic::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol + ) + FINCEN_BOI_REPORT = + T.let( + :FINCEN_BOI_REPORT, + Lithic::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AccountHolderUploadDocumentParams::DocumentType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/account_holder_verification_webhook_event.rbi b/rbi/lithic/models/account_holder_verification_webhook_event.rbi new file mode 100644 index 00000000..a8174be7 --- /dev/null +++ b/rbi/lithic/models/account_holder_verification_webhook_event.rbi @@ -0,0 +1,143 @@ +# typed: strong + +module Lithic + module Models + class AccountHolderVerificationWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolderVerificationWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # The token of the account_holder being verified. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # The token of the account being verified. + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # When the account_holder verification status was updated + sig { returns(T.nilable(Time)) } + attr_reader :created + + sig { params(created: Time).void } + attr_writer :created + + # The status of the account_holder that was created + sig do + returns( + T.nilable( + Lithic::AccountHolderVerificationWebhookEvent::Status::TaggedSymbol + ) + ) + end + attr_reader :status + + sig do + params( + status: + Lithic::AccountHolderVerificationWebhookEvent::Status::OrSymbol + ).void + end + attr_writer :status + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :status_reasons + + sig { params(status_reasons: T::Array[String]).void } + attr_writer :status_reasons + + sig do + params( + token: String, + account_token: String, + created: Time, + status: + Lithic::AccountHolderVerificationWebhookEvent::Status::OrSymbol, + status_reasons: T::Array[String], + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The token of the account_holder being verified. + token: nil, + # The token of the account being verified. + account_token: nil, + # When the account_holder verification status was updated + created: nil, + # The status of the account_holder that was created + status: nil, + status_reasons: nil, + # The type of event that occurred. + event_type: :"account_holder.verification" + ) + end + + sig do + override.returns( + { + event_type: Symbol, + token: String, + account_token: String, + created: Time, + status: + Lithic::AccountHolderVerificationWebhookEvent::Status::TaggedSymbol, + status_reasons: T::Array[String] + } + ) + end + def to_hash + end + + # The status of the account_holder that was created + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::AccountHolderVerificationWebhookEvent::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :ACCEPTED, + Lithic::AccountHolderVerificationWebhookEvent::Status::TaggedSymbol + ) + PENDING_REVIEW = + T.let( + :PENDING_REVIEW, + Lithic::AccountHolderVerificationWebhookEvent::Status::TaggedSymbol + ) + REJECTED = + T.let( + :REJECTED, + Lithic::AccountHolderVerificationWebhookEvent::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AccountHolderVerificationWebhookEvent::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/account_holders/account_holder_entity.rbi b/rbi/lithic/models/account_holders/account_holder_entity.rbi new file mode 100644 index 00000000..5121588e --- /dev/null +++ b/rbi/lithic/models/account_holders/account_holder_entity.rbi @@ -0,0 +1,259 @@ +# typed: strong + +module Lithic + module Models + AccountHolderEntity = AccountHolders::AccountHolderEntity + + module AccountHolders + class AccountHolderEntity < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolders::AccountHolderEntity, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for the entity + sig { returns(String) } + attr_accessor :token + + # Globally unique identifier for the account holder + sig { returns(String) } + attr_accessor :account_holder_token + + # Individual's current address + sig { returns(Lithic::AccountHolders::AccountHolderEntity::Address) } + attr_reader :address + + sig do + params( + address: + Lithic::AccountHolders::AccountHolderEntity::Address::OrHash + ).void + end + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date + sig { returns(T.nilable(String)) } + attr_accessor :dob + + # Individual's email address + sig { returns(T.nilable(String)) } + attr_accessor :email + + # Individual's first name, as it appears on government-issued identity documents + sig { returns(T.nilable(String)) } + attr_accessor :first_name + + # Individual's last name, as it appears on government-issued identity documents + sig { returns(T.nilable(String)) } + attr_accessor :last_name + + # Individual's phone number, entered in E.164 format + sig { returns(T.nilable(String)) } + attr_accessor :phone_number + + # The status of the entity + sig do + returns( + Lithic::AccountHolders::AccountHolderEntity::Status::TaggedSymbol + ) + end + attr_accessor :status + + # The type of entity + sig { returns(Lithic::TransactionMonitoring::EntityType::TaggedSymbol) } + attr_accessor :type + + # Information about an entity associated with an account holder + sig do + params( + token: String, + account_holder_token: String, + address: + Lithic::AccountHolders::AccountHolderEntity::Address::OrHash, + dob: T.nilable(String), + email: T.nilable(String), + first_name: T.nilable(String), + last_name: T.nilable(String), + phone_number: T.nilable(String), + status: + Lithic::AccountHolders::AccountHolderEntity::Status::OrSymbol, + type: Lithic::TransactionMonitoring::EntityType::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the entity + token:, + # Globally unique identifier for the account holder + account_holder_token:, + # Individual's current address + address:, + # Individual's date of birth, as an RFC 3339 date + dob:, + # Individual's email address + email:, + # Individual's first name, as it appears on government-issued identity documents + first_name:, + # Individual's last name, as it appears on government-issued identity documents + last_name:, + # Individual's phone number, entered in E.164 format + phone_number:, + # The status of the entity + status:, + # The type of entity + type: + ) + end + + sig do + override.returns( + { + token: String, + account_holder_token: String, + address: Lithic::AccountHolders::AccountHolderEntity::Address, + dob: T.nilable(String), + email: T.nilable(String), + first_name: T.nilable(String), + last_name: T.nilable(String), + phone_number: T.nilable(String), + status: + Lithic::AccountHolders::AccountHolderEntity::Status::TaggedSymbol, + type: Lithic::TransactionMonitoring::EntityType::TaggedSymbol + } + ) + end + def to_hash + end + + class Address < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolders::AccountHolderEntity::Address, + Lithic::Internal::AnyHash + ) + end + + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Individual's current address + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ).returns(T.attached_class) + end + def self.new( + # Valid deliverable address (no PO boxes). + address1:, + # Name of city. + city:, + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + country:, + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + postal_code:, + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + state:, + # Unit or apartment number (if applicable). + address2: nil + ) + end + + sig do + override.returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + + # The status of the entity + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::AccountHolders::AccountHolderEntity::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :ACCEPTED, + Lithic::AccountHolders::AccountHolderEntity::Status::TaggedSymbol + ) + INACTIVE = + T.let( + :INACTIVE, + Lithic::AccountHolders::AccountHolderEntity::Status::TaggedSymbol + ) + PENDING_REVIEW = + T.let( + :PENDING_REVIEW, + Lithic::AccountHolders::AccountHolderEntity::Status::TaggedSymbol + ) + REJECTED = + T.let( + :REJECTED, + Lithic::AccountHolders::AccountHolderEntity::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AccountHolders::AccountHolderEntity::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/account_holders/entity_create_params.rbi b/rbi/lithic/models/account_holders/entity_create_params.rbi new file mode 100644 index 00000000..66ee8ce5 --- /dev/null +++ b/rbi/lithic/models/account_holders/entity_create_params.rbi @@ -0,0 +1,214 @@ +# typed: strong + +module Lithic + module Models + module AccountHolders + class EntityCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolders::EntityCreateParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :account_holder_token + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig { returns(Lithic::AccountHolders::EntityCreateParams::Address) } + attr_reader :address + + sig do + params( + address: Lithic::AccountHolders::EntityCreateParams::Address::OrHash + ).void + end + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(String) } + attr_accessor :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(String) } + attr_accessor :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :first_name + + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + sig { returns(String) } + attr_accessor :government_id + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(String) } + attr_accessor :phone_number + + # The type of entity to create on the account holder + sig { returns(Lithic::TransactionMonitoring::EntityType::OrSymbol) } + attr_accessor :type + + sig do + params( + account_holder_token: String, + address: + Lithic::AccountHolders::EntityCreateParams::Address::OrHash, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String, + type: Lithic::TransactionMonitoring::EntityType::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + account_holder_token:, + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + address:, + # Individual's date of birth, as an RFC 3339 date. + dob:, + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + email:, + # Individual's first name, as it appears on government-issued identity documents. + first_name:, + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + government_id:, + # Individual's last name, as it appears on government-issued identity documents. + last_name:, + # Individual's phone number, entered in E.164 format. + phone_number:, + # The type of entity to create on the account holder + type:, + request_options: {} + ) + end + + sig do + override.returns( + { + account_holder_token: String, + address: Lithic::AccountHolders::EntityCreateParams::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String, + type: Lithic::TransactionMonitoring::EntityType::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + class Address < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolders::EntityCreateParams::Address, + Lithic::Internal::AnyHash + ) + end + + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ).returns(T.attached_class) + end + def self.new( + # Valid deliverable address (no PO boxes). + address1:, + # Name of city. + city:, + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + country:, + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + postal_code:, + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + state:, + # Unit or apartment number (if applicable). + address2: nil + ) + end + + sig do + override.returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/lithic/models/account_holders/entity_create_response.rbi b/rbi/lithic/models/account_holders/entity_create_response.rbi new file mode 100644 index 00000000..59f33de3 --- /dev/null +++ b/rbi/lithic/models/account_holders/entity_create_response.rbi @@ -0,0 +1,292 @@ +# typed: strong + +module Lithic + module Models + module AccountHolders + class EntityCreateResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AccountHolders::EntityCreateResponse, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for the entity + sig { returns(String) } + attr_accessor :token + + # Globally unique identifier for the account holder + sig { returns(String) } + attr_accessor :account_holder_token + + # Timestamp of when the entity was created + sig { returns(Time) } + attr_accessor :created + + # A list of documents required for the entity to be approved + sig { returns(T::Array[Lithic::RequiredDocument]) } + attr_accessor :required_documents + + # Entity verification status + sig do + returns( + Lithic::Models::AccountHolders::EntityCreateResponse::Status::TaggedSymbol + ) + end + attr_accessor :status + + # Reason for the evaluation status + sig do + returns( + T::Array[ + Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason::TaggedSymbol + ] + ) + end + attr_accessor :status_reasons + + # Response body for creating a new beneficial owner or replacing the control + # person entity on an existing KYB account holder. + sig do + params( + token: String, + account_holder_token: String, + created: Time, + required_documents: T::Array[Lithic::RequiredDocument::OrHash], + status: + Lithic::Models::AccountHolders::EntityCreateResponse::Status::OrSymbol, + status_reasons: + T::Array[ + Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason::OrSymbol + ] + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the entity + token:, + # Globally unique identifier for the account holder + account_holder_token:, + # Timestamp of when the entity was created + created:, + # A list of documents required for the entity to be approved + required_documents:, + # Entity verification status + status:, + # Reason for the evaluation status + status_reasons: + ) + end + + sig do + override.returns( + { + token: String, + account_holder_token: String, + created: Time, + required_documents: T::Array[Lithic::RequiredDocument], + status: + Lithic::Models::AccountHolders::EntityCreateResponse::Status::TaggedSymbol, + status_reasons: + T::Array[ + Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason::TaggedSymbol + ] + } + ) + end + def to_hash + end + + # Entity verification status + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AccountHolders::EntityCreateResponse::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :ACCEPTED, + Lithic::Models::AccountHolders::EntityCreateResponse::Status::TaggedSymbol + ) + INACTIVE = + T.let( + :INACTIVE, + Lithic::Models::AccountHolders::EntityCreateResponse::Status::TaggedSymbol + ) + PENDING_REVIEW = + T.let( + :PENDING_REVIEW, + Lithic::Models::AccountHolders::EntityCreateResponse::Status::TaggedSymbol + ) + REJECTED = + T.let( + :REJECTED, + Lithic::Models::AccountHolders::EntityCreateResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AccountHolders::EntityCreateResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Status Reasons for KYC/KYB enrollment states + module StatusReason + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ADDRESS_VERIFICATION_FAILURE = + T.let( + :ADDRESS_VERIFICATION_FAILURE, + Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason::TaggedSymbol + ) + AGE_THRESHOLD_FAILURE = + T.let( + :AGE_THRESHOLD_FAILURE, + Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason::TaggedSymbol + ) + COMPLETE_VERIFICATION_FAILURE = + T.let( + :COMPLETE_VERIFICATION_FAILURE, + Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason::TaggedSymbol + ) + DOB_VERIFICATION_FAILURE = + T.let( + :DOB_VERIFICATION_FAILURE, + Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason::TaggedSymbol + ) + ID_VERIFICATION_FAILURE = + T.let( + :ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason::TaggedSymbol + ) + MAX_DOCUMENT_ATTEMPTS = + T.let( + :MAX_DOCUMENT_ATTEMPTS, + Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason::TaggedSymbol + ) + MAX_RESUBMISSION_ATTEMPTS = + T.let( + :MAX_RESUBMISSION_ATTEMPTS, + Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason::TaggedSymbol + ) + NAME_VERIFICATION_FAILURE = + T.let( + :NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason::TaggedSymbol + ) + OTHER_VERIFICATION_FAILURE = + T.let( + :OTHER_VERIFICATION_FAILURE, + Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason::TaggedSymbol + ) + RISK_THRESHOLD_FAILURE = + T.let( + :RISK_THRESHOLD_FAILURE, + Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason::TaggedSymbol + ) + WATCHLIST_ALERT_FAILURE = + T.let( + :WATCHLIST_ALERT_FAILURE, + Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE, + Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED = + T.let( + :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED, + Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE = + T.let( + :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE, + Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED = + T.let( + :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED, + Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE, + Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE, + Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason::TaggedSymbol + ) + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE = + T.let( + :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE, + Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE = + T.let( + :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE, + Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_ID_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_ID_VERIFICATION_FAILURE, + Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_DOB_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_DOB_VERIFICATION_FAILURE, + Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason::TaggedSymbol + ) + CONTROL_PERSON_NAME_VERIFICATION_FAILURE = + T.let( + :CONTROL_PERSON_NAME_VERIFICATION_FAILURE, + Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/account_holders/entity_delete_params.rbi b/rbi/lithic/models/account_holders/entity_delete_params.rbi new file mode 100644 index 00000000..f959fc97 --- /dev/null +++ b/rbi/lithic/models/account_holders/entity_delete_params.rbi @@ -0,0 +1,48 @@ +# typed: strong + +module Lithic + module Models + module AccountHolders + class EntityDeleteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::AccountHolders::EntityDeleteParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :account_holder_token + + sig { returns(String) } + attr_accessor :entity_token + + sig do + params( + account_holder_token: String, + entity_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(account_holder_token:, entity_token:, request_options: {}) + end + + sig do + override.returns( + { + account_holder_token: String, + entity_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/account_list_params.rbi b/rbi/lithic/models/account_list_params.rbi new file mode 100644 index 00000000..004d78a7 --- /dev/null +++ b/rbi/lithic/models/account_list_params.rbi @@ -0,0 +1,98 @@ +# typed: strong + +module Lithic + module Models + class AccountListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::AccountListParams, Lithic::Internal::AnyHash) + end + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/account_retrieve_params.rbi b/rbi/lithic/models/account_retrieve_params.rbi new file mode 100644 index 00000000..847d0828 --- /dev/null +++ b/rbi/lithic/models/account_retrieve_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Lithic + module Models + class AccountRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::AccountRetrieveParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :account_token + + sig do + params( + account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(account_token:, request_options: {}) + end + + sig do + override.returns( + { account_token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/account_retrieve_signals_params.rbi b/rbi/lithic/models/account_retrieve_signals_params.rbi new file mode 100644 index 00000000..c5b15ace --- /dev/null +++ b/rbi/lithic/models/account_retrieve_signals_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Lithic + module Models + class AccountRetrieveSignalsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::AccountRetrieveSignalsParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :account_token + + sig do + params( + account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(account_token:, request_options: {}) + end + + sig do + override.returns( + { account_token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/account_retrieve_spend_limits_params.rbi b/rbi/lithic/models/account_retrieve_spend_limits_params.rbi new file mode 100644 index 00000000..c631ca92 --- /dev/null +++ b/rbi/lithic/models/account_retrieve_spend_limits_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Lithic + module Models + class AccountRetrieveSpendLimitsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::AccountRetrieveSpendLimitsParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :account_token + + sig do + params( + account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(account_token:, request_options: {}) + end + + sig do + override.returns( + { account_token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/account_spend_limits.rbi b/rbi/lithic/models/account_spend_limits.rbi new file mode 100644 index 00000000..8e849d68 --- /dev/null +++ b/rbi/lithic/models/account_spend_limits.rbi @@ -0,0 +1,243 @@ +# typed: strong + +module Lithic + module Models + class AccountSpendLimits < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::AccountSpendLimits, Lithic::Internal::AnyHash) + end + + sig { returns(Lithic::AccountSpendLimits::AvailableSpendLimit) } + attr_reader :available_spend_limit + + sig do + params( + available_spend_limit: + Lithic::AccountSpendLimits::AvailableSpendLimit::OrHash + ).void + end + attr_writer :available_spend_limit + + sig { returns(T.nilable(Lithic::AccountSpendLimits::SpendLimit)) } + attr_reader :spend_limit + + sig do + params(spend_limit: Lithic::AccountSpendLimits::SpendLimit::OrHash).void + end + attr_writer :spend_limit + + sig { returns(T.nilable(Lithic::AccountSpendLimits::SpendVelocity)) } + attr_reader :spend_velocity + + sig do + params( + spend_velocity: Lithic::AccountSpendLimits::SpendVelocity::OrHash + ).void + end + attr_writer :spend_velocity + + sig do + params( + available_spend_limit: + Lithic::AccountSpendLimits::AvailableSpendLimit::OrHash, + spend_limit: Lithic::AccountSpendLimits::SpendLimit::OrHash, + spend_velocity: Lithic::AccountSpendLimits::SpendVelocity::OrHash + ).returns(T.attached_class) + end + def self.new( + available_spend_limit:, + spend_limit: nil, + spend_velocity: nil + ) + end + + sig do + override.returns( + { + available_spend_limit: + Lithic::AccountSpendLimits::AvailableSpendLimit, + spend_limit: Lithic::AccountSpendLimits::SpendLimit, + spend_velocity: Lithic::AccountSpendLimits::SpendVelocity + } + ) + end + def to_hash + end + + class AvailableSpendLimit < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountSpendLimits::AvailableSpendLimit, + Lithic::Internal::AnyHash + ) + end + + # The available spend limit (in cents) relative to the daily limit configured on + # the Account (e.g. 100000 would be a $1,000 limit). + sig { returns(T.nilable(Integer)) } + attr_reader :daily + + sig { params(daily: Integer).void } + attr_writer :daily + + # The available spend limit (in cents) relative to the lifetime limit configured + # on the Account. + sig { returns(T.nilable(Integer)) } + attr_reader :lifetime + + sig { params(lifetime: Integer).void } + attr_writer :lifetime + + # The available spend limit (in cents) relative to the monthly limit configured on + # the Account. + sig { returns(T.nilable(Integer)) } + attr_reader :monthly + + sig { params(monthly: Integer).void } + attr_writer :monthly + + sig do + params(daily: Integer, lifetime: Integer, monthly: Integer).returns( + T.attached_class + ) + end + def self.new( + # The available spend limit (in cents) relative to the daily limit configured on + # the Account (e.g. 100000 would be a $1,000 limit). + daily: nil, + # The available spend limit (in cents) relative to the lifetime limit configured + # on the Account. + lifetime: nil, + # The available spend limit (in cents) relative to the monthly limit configured on + # the Account. + monthly: nil + ) + end + + sig do + override.returns( + { daily: Integer, lifetime: Integer, monthly: Integer } + ) + end + def to_hash + end + end + + class SpendLimit < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountSpendLimits::SpendLimit, + Lithic::Internal::AnyHash + ) + end + + # The configured daily spend limit (in cents) on the Account. + sig { returns(T.nilable(Integer)) } + attr_reader :daily + + sig { params(daily: Integer).void } + attr_writer :daily + + # The configured lifetime spend limit (in cents) on the Account. + sig { returns(T.nilable(Integer)) } + attr_reader :lifetime + + sig { params(lifetime: Integer).void } + attr_writer :lifetime + + # The configured monthly spend limit (in cents) on the Account. + sig { returns(T.nilable(Integer)) } + attr_reader :monthly + + sig { params(monthly: Integer).void } + attr_writer :monthly + + sig do + params(daily: Integer, lifetime: Integer, monthly: Integer).returns( + T.attached_class + ) + end + def self.new( + # The configured daily spend limit (in cents) on the Account. + daily: nil, + # The configured lifetime spend limit (in cents) on the Account. + lifetime: nil, + # The configured monthly spend limit (in cents) on the Account. + monthly: nil + ) + end + + sig do + override.returns( + { daily: Integer, lifetime: Integer, monthly: Integer } + ) + end + def to_hash + end + end + + class SpendVelocity < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountSpendLimits::SpendVelocity, + Lithic::Internal::AnyHash + ) + end + + # Current daily spend velocity (in cents) on the Account. Present if daily spend + # limit is set. + sig { returns(T.nilable(Integer)) } + attr_reader :daily + + sig { params(daily: Integer).void } + attr_writer :daily + + # Current lifetime spend velocity (in cents) on the Account. Present if lifetime + # spend limit is set. + sig { returns(T.nilable(Integer)) } + attr_reader :lifetime + + sig { params(lifetime: Integer).void } + attr_writer :lifetime + + # Current monthly spend velocity (in cents) on the Account. Present if monthly + # spend limit is set. + sig { returns(T.nilable(Integer)) } + attr_reader :monthly + + sig { params(monthly: Integer).void } + attr_writer :monthly + + sig do + params(daily: Integer, lifetime: Integer, monthly: Integer).returns( + T.attached_class + ) + end + def self.new( + # Current daily spend velocity (in cents) on the Account. Present if daily spend + # limit is set. + daily: nil, + # Current lifetime spend velocity (in cents) on the Account. Present if lifetime + # spend limit is set. + lifetime: nil, + # Current monthly spend velocity (in cents) on the Account. Present if monthly + # spend limit is set. + monthly: nil + ) + end + + sig do + override.returns( + { daily: Integer, lifetime: Integer, monthly: Integer } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/account_update_params.rbi b/rbi/lithic/models/account_update_params.rbi new file mode 100644 index 00000000..739baf85 --- /dev/null +++ b/rbi/lithic/models/account_update_params.rbi @@ -0,0 +1,392 @@ +# typed: strong + +module Lithic + module Models + class AccountUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::AccountUpdateParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :account_token + + # Additional context or information related to the account. + sig { returns(T.nilable(String)) } + attr_reader :comment + + sig { params(comment: String).void } + attr_writer :comment + + # Amount (in cents) for the account's daily spend limit (e.g. 100000 would be a + # $1,000 limit). By default the daily spend limit is set to $1,250. + sig { returns(T.nilable(Integer)) } + attr_reader :daily_spend_limit + + sig { params(daily_spend_limit: Integer).void } + attr_writer :daily_spend_limit + + # Amount (in cents) for the account's lifetime spend limit (e.g. 100000 would be a + # $1,000 limit). Once this limit is reached, no transactions will be accepted on + # any card created for this account until the limit is updated. Note that a spend + # limit of 0 is effectively no limit, and should only be used to reset or remove a + # prior limit. Only a limit of 1 or above will result in declined transactions due + # to checks against the account limit. This behavior differs from the daily spend + # limit and the monthly spend limit. + sig { returns(T.nilable(Integer)) } + attr_reader :lifetime_spend_limit + + sig { params(lifetime_spend_limit: Integer).void } + attr_writer :lifetime_spend_limit + + # Amount (in cents) for the account's monthly spend limit (e.g. 100000 would be a + # $1,000 limit). By default the monthly spend limit is set to $5,000. + sig { returns(T.nilable(Integer)) } + attr_reader :monthly_spend_limit + + sig { params(monthly_spend_limit: Integer).void } + attr_writer :monthly_spend_limit + + # Account states. + sig { returns(T.nilable(Lithic::AccountUpdateParams::State::OrSymbol)) } + attr_reader :state + + sig { params(state: Lithic::AccountUpdateParams::State::OrSymbol).void } + attr_writer :state + + # Account state substatus values: + # + # - `FRAUD_IDENTIFIED` - The account has been recognized as being created or used + # with stolen or fabricated identity information, encompassing both true + # identity theft and synthetic identities. + # - `SUSPICIOUS_ACTIVITY` - The account has exhibited suspicious behavior, such as + # unauthorized access or fraudulent transactions, necessitating further + # investigation. + # - `RISK_VIOLATION` - The account has been involved in deliberate misuse by the + # legitimate account holder. Examples include disputing valid transactions + # without cause, falsely claiming non-receipt of goods, or engaging in + # intentional bust-out schemes to exploit account services. + # - `END_USER_REQUEST` - The account holder has voluntarily requested the closure + # of the account for personal reasons. This encompasses situations such as + # bankruptcy, other financial considerations, or the account holder's death. + # - `ISSUER_REQUEST` - The issuer has initiated the closure of the account due to + # business strategy, risk management, inactivity, product changes, regulatory + # concerns, or violations of terms and conditions. + # - `NOT_ACTIVE` - The account has not had any transactions or payment activity + # within a specified period. This status applies to accounts that are paused or + # closed due to inactivity. + # - `INTERNAL_REVIEW` - The account is temporarily paused pending further internal + # review. In future implementations, this status may prevent clients from + # activating the account via APIs until the review is completed. + # - `OTHER` - The reason for the account's current status does not fall into any + # of the above categories. A comment should be provided to specify the + # particular reason. + sig do + returns(T.nilable(Lithic::AccountUpdateParams::Substatus::OrSymbol)) + end + attr_accessor :substatus + + # Address used during Address Verification Service (AVS) checks during + # transactions if enabled via Auth Rules. This field is deprecated as AVS checks + # are no longer supported by Auth Rules. The field will be removed from the schema + # in a future release. + sig do + returns(T.nilable(Lithic::AccountUpdateParams::VerificationAddress)) + end + attr_reader :verification_address + + sig do + params( + verification_address: + Lithic::AccountUpdateParams::VerificationAddress::OrHash + ).void + end + attr_writer :verification_address + + sig do + params( + account_token: String, + comment: String, + daily_spend_limit: Integer, + lifetime_spend_limit: Integer, + monthly_spend_limit: Integer, + state: Lithic::AccountUpdateParams::State::OrSymbol, + substatus: + T.nilable(Lithic::AccountUpdateParams::Substatus::OrSymbol), + verification_address: + Lithic::AccountUpdateParams::VerificationAddress::OrHash, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + account_token:, + # Additional context or information related to the account. + comment: nil, + # Amount (in cents) for the account's daily spend limit (e.g. 100000 would be a + # $1,000 limit). By default the daily spend limit is set to $1,250. + daily_spend_limit: nil, + # Amount (in cents) for the account's lifetime spend limit (e.g. 100000 would be a + # $1,000 limit). Once this limit is reached, no transactions will be accepted on + # any card created for this account until the limit is updated. Note that a spend + # limit of 0 is effectively no limit, and should only be used to reset or remove a + # prior limit. Only a limit of 1 or above will result in declined transactions due + # to checks against the account limit. This behavior differs from the daily spend + # limit and the monthly spend limit. + lifetime_spend_limit: nil, + # Amount (in cents) for the account's monthly spend limit (e.g. 100000 would be a + # $1,000 limit). By default the monthly spend limit is set to $5,000. + monthly_spend_limit: nil, + # Account states. + state: nil, + # Account state substatus values: + # + # - `FRAUD_IDENTIFIED` - The account has been recognized as being created or used + # with stolen or fabricated identity information, encompassing both true + # identity theft and synthetic identities. + # - `SUSPICIOUS_ACTIVITY` - The account has exhibited suspicious behavior, such as + # unauthorized access or fraudulent transactions, necessitating further + # investigation. + # - `RISK_VIOLATION` - The account has been involved in deliberate misuse by the + # legitimate account holder. Examples include disputing valid transactions + # without cause, falsely claiming non-receipt of goods, or engaging in + # intentional bust-out schemes to exploit account services. + # - `END_USER_REQUEST` - The account holder has voluntarily requested the closure + # of the account for personal reasons. This encompasses situations such as + # bankruptcy, other financial considerations, or the account holder's death. + # - `ISSUER_REQUEST` - The issuer has initiated the closure of the account due to + # business strategy, risk management, inactivity, product changes, regulatory + # concerns, or violations of terms and conditions. + # - `NOT_ACTIVE` - The account has not had any transactions or payment activity + # within a specified period. This status applies to accounts that are paused or + # closed due to inactivity. + # - `INTERNAL_REVIEW` - The account is temporarily paused pending further internal + # review. In future implementations, this status may prevent clients from + # activating the account via APIs until the review is completed. + # - `OTHER` - The reason for the account's current status does not fall into any + # of the above categories. A comment should be provided to specify the + # particular reason. + substatus: nil, + # Address used during Address Verification Service (AVS) checks during + # transactions if enabled via Auth Rules. This field is deprecated as AVS checks + # are no longer supported by Auth Rules. The field will be removed from the schema + # in a future release. + verification_address: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + account_token: String, + comment: String, + daily_spend_limit: Integer, + lifetime_spend_limit: Integer, + monthly_spend_limit: Integer, + state: Lithic::AccountUpdateParams::State::OrSymbol, + substatus: + T.nilable(Lithic::AccountUpdateParams::Substatus::OrSymbol), + verification_address: + Lithic::AccountUpdateParams::VerificationAddress, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Account states. + module State + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::AccountUpdateParams::State) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let(:ACTIVE, Lithic::AccountUpdateParams::State::TaggedSymbol) + PAUSED = + T.let(:PAUSED, Lithic::AccountUpdateParams::State::TaggedSymbol) + CLOSED = + T.let(:CLOSED, Lithic::AccountUpdateParams::State::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::AccountUpdateParams::State::TaggedSymbol] + ) + end + def self.values + end + end + + # Account state substatus values: + # + # - `FRAUD_IDENTIFIED` - The account has been recognized as being created or used + # with stolen or fabricated identity information, encompassing both true + # identity theft and synthetic identities. + # - `SUSPICIOUS_ACTIVITY` - The account has exhibited suspicious behavior, such as + # unauthorized access or fraudulent transactions, necessitating further + # investigation. + # - `RISK_VIOLATION` - The account has been involved in deliberate misuse by the + # legitimate account holder. Examples include disputing valid transactions + # without cause, falsely claiming non-receipt of goods, or engaging in + # intentional bust-out schemes to exploit account services. + # - `END_USER_REQUEST` - The account holder has voluntarily requested the closure + # of the account for personal reasons. This encompasses situations such as + # bankruptcy, other financial considerations, or the account holder's death. + # - `ISSUER_REQUEST` - The issuer has initiated the closure of the account due to + # business strategy, risk management, inactivity, product changes, regulatory + # concerns, or violations of terms and conditions. + # - `NOT_ACTIVE` - The account has not had any transactions or payment activity + # within a specified period. This status applies to accounts that are paused or + # closed due to inactivity. + # - `INTERNAL_REVIEW` - The account is temporarily paused pending further internal + # review. In future implementations, this status may prevent clients from + # activating the account via APIs until the review is completed. + # - `OTHER` - The reason for the account's current status does not fall into any + # of the above categories. A comment should be provided to specify the + # particular reason. + module Substatus + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::AccountUpdateParams::Substatus) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FRAUD_IDENTIFIED = + T.let( + :FRAUD_IDENTIFIED, + Lithic::AccountUpdateParams::Substatus::TaggedSymbol + ) + SUSPICIOUS_ACTIVITY = + T.let( + :SUSPICIOUS_ACTIVITY, + Lithic::AccountUpdateParams::Substatus::TaggedSymbol + ) + RISK_VIOLATION = + T.let( + :RISK_VIOLATION, + Lithic::AccountUpdateParams::Substatus::TaggedSymbol + ) + END_USER_REQUEST = + T.let( + :END_USER_REQUEST, + Lithic::AccountUpdateParams::Substatus::TaggedSymbol + ) + ISSUER_REQUEST = + T.let( + :ISSUER_REQUEST, + Lithic::AccountUpdateParams::Substatus::TaggedSymbol + ) + NOT_ACTIVE = + T.let( + :NOT_ACTIVE, + Lithic::AccountUpdateParams::Substatus::TaggedSymbol + ) + INTERNAL_REVIEW = + T.let( + :INTERNAL_REVIEW, + Lithic::AccountUpdateParams::Substatus::TaggedSymbol + ) + OTHER = + T.let(:OTHER, Lithic::AccountUpdateParams::Substatus::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::AccountUpdateParams::Substatus::TaggedSymbol] + ) + end + def self.values + end + end + + class VerificationAddress < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AccountUpdateParams::VerificationAddress, + Lithic::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :address1 + + sig { params(address1: String).void } + attr_writer :address1 + + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + sig { returns(T.nilable(String)) } + attr_reader :city + + sig { params(city: String).void } + attr_writer :city + + sig { returns(T.nilable(String)) } + attr_reader :country + + sig { params(country: String).void } + attr_writer :country + + sig { returns(T.nilable(String)) } + attr_reader :postal_code + + sig { params(postal_code: String).void } + attr_writer :postal_code + + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + # Address used during Address Verification Service (AVS) checks during + # transactions if enabled via Auth Rules. This field is deprecated as AVS checks + # are no longer supported by Auth Rules. The field will be removed from the schema + # in a future release. + sig do + params( + address1: String, + address2: String, + city: String, + country: String, + postal_code: String, + state: String + ).returns(T.attached_class) + end + def self.new( + address1: nil, + address2: nil, + city: nil, + country: nil, + postal_code: nil, + state: nil + ) + end + + sig do + override.returns( + { + address1: String, + address2: String, + city: String, + country: String, + postal_code: String, + state: String + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/address.rbi b/rbi/lithic/models/address.rbi new file mode 100644 index 00000000..bf602554 --- /dev/null +++ b/rbi/lithic/models/address.rbi @@ -0,0 +1,88 @@ +# typed: strong + +module Lithic + module Models + class Address < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Lithic::Address, Lithic::Internal::AnyHash) } + + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code, entered in uppercase ISO 3166-1 alpha-3 three-character + # format. Only USA is currently supported for all workflows. KYC_EXEMPT supports + # CAN additionally. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. USA postal codes (ZIP codes) are supported, entered as a + # five-digit postal code or nine-digit postal code (ZIP+4) using the format + # 12345-1234. KYC_EXEMPT supports Canadian postal codes. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. USA state codes are supported, entered in uppercase ISO 3166-2 + # two-character format. KYC_EXEMPT supports Canadian province codes. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ).returns(T.attached_class) + end + def self.new( + # Valid deliverable address (no PO boxes). + address1:, + # Name of city. + city:, + # Valid country code, entered in uppercase ISO 3166-1 alpha-3 three-character + # format. Only USA is currently supported for all workflows. KYC_EXEMPT supports + # CAN additionally. + country:, + # Valid postal code. USA postal codes (ZIP codes) are supported, entered as a + # five-digit postal code or nine-digit postal code (ZIP+4) using the format + # 12345-1234. KYC_EXEMPT supports Canadian postal codes. + postal_code:, + # Valid state code. USA state codes are supported, entered in uppercase ISO 3166-2 + # two-character format. KYC_EXEMPT supports Canadian province codes. + state:, + # Unit or apartment number (if applicable). + address2: nil + ) + end + + sig do + override.returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/address_update.rbi b/rbi/lithic/models/address_update.rbi new file mode 100644 index 00000000..a0a1e178 --- /dev/null +++ b/rbi/lithic/models/address_update.rbi @@ -0,0 +1,99 @@ +# typed: strong + +module Lithic + module Models + class AddressUpdate < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Lithic::AddressUpdate, Lithic::Internal::AnyHash) } + + # Valid deliverable address (no PO boxes). + sig { returns(T.nilable(String)) } + attr_reader :address1 + + sig { params(address1: String).void } + attr_writer :address1 + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Name of city. + sig { returns(T.nilable(String)) } + attr_reader :city + + sig { params(city: String).void } + attr_writer :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(T.nilable(String)) } + attr_reader :country + + sig { params(country: String).void } + attr_writer :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + + sig { params(postal_code: String).void } + attr_writer :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(T.nilable(String)) } + attr_reader :state + + sig { params(state: String).void } + attr_writer :state + + sig do + params( + address1: String, + address2: String, + city: String, + country: String, + postal_code: String, + state: String + ).returns(T.attached_class) + end + def self.new( + # Valid deliverable address (no PO boxes). + address1: nil, + # Unit or apartment number (if applicable). + address2: nil, + # Name of city. + city: nil, + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + country: nil, + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + postal_code: nil, + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + state: nil + ) + end + + sig do + override.returns( + { + address1: String, + address2: String, + city: String, + country: String, + postal_code: String, + state: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/api_status.rbi b/rbi/lithic/models/api_status.rbi new file mode 100644 index 00000000..83459133 --- /dev/null +++ b/rbi/lithic/models/api_status.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Lithic + module Models + class APIStatus < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Lithic::APIStatus, Lithic::Internal::AnyHash) } + + sig { returns(T.nilable(String)) } + attr_reader :message + + sig { params(message: String).void } + attr_writer :message + + sig { params(message: String).returns(T.attached_class) } + def self.new(message: nil) + end + + sig { override.returns({ message: String }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/auth_rule.rbi b/rbi/lithic/models/auth_rules/auth_rule.rbi new file mode 100644 index 00000000..fe9b330e --- /dev/null +++ b/rbi/lithic/models/auth_rules/auth_rule.rbi @@ -0,0 +1,560 @@ +# typed: strong + +module Lithic + module Models + AuthRule = AuthRules::AuthRule + + module AuthRules + class AuthRule < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::AuthRules::AuthRule, Lithic::Internal::AnyHash) + end + + # Auth Rule Token + sig { returns(String) } + attr_accessor :token + + # Account tokens to which the Auth Rule applies. + sig { returns(T::Array[String]) } + attr_accessor :account_tokens + + # Business Account tokens to which the Auth Rule applies. + sig { returns(T::Array[String]) } + attr_accessor :business_account_tokens + + # Card tokens to which the Auth Rule applies. + sig { returns(T::Array[String]) } + attr_accessor :card_tokens + + sig { returns(T.nilable(Lithic::AuthRules::AuthRule::CurrentVersion)) } + attr_reader :current_version + + sig do + params( + current_version: + T.nilable(Lithic::AuthRules::AuthRule::CurrentVersion::OrHash) + ).void + end + attr_writer :current_version + + sig { returns(T.nilable(Lithic::AuthRules::AuthRule::DraftVersion)) } + attr_reader :draft_version + + sig do + params( + draft_version: + T.nilable(Lithic::AuthRules::AuthRule::DraftVersion::OrHash) + ).void + end + attr_writer :draft_version + + # The event stream during which the rule will be evaluated. + sig { returns(Lithic::AuthRules::EventStream::TaggedSymbol) } + attr_accessor :event_stream + + # Indicates whether this auth rule is managed by Lithic. If true, the rule cannot + # be modified or deleted by the user + sig { returns(T::Boolean) } + attr_accessor :lithic_managed + + # Auth Rule Name + sig { returns(T.nilable(String)) } + attr_accessor :name + + # Whether the Auth Rule applies to all authorizations on the card program. + sig { returns(T::Boolean) } + attr_accessor :program_level + + # The state of the Auth Rule + sig { returns(Lithic::AuthRules::AuthRule::State::TaggedSymbol) } + attr_accessor :state + + # The type of Auth Rule. For certain rule types, this determines the event stream + # during which it will be evaluated. For rules that can be applied to one of + # several event streams, the effective one is defined by the separate + # `event_stream` field. + # + # - `CONDITIONAL_BLOCK`: Deprecated. Use `CONDITIONAL_ACTION` instead. + # AUTHORIZATION event stream. + # - `VELOCITY_LIMIT`: AUTHORIZATION event stream. + # - `MERCHANT_LOCK`: AUTHORIZATION event stream. + # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + sig { returns(Lithic::AuthRules::AuthRule::Type::TaggedSymbol) } + attr_accessor :type + + # Account tokens to which the Auth Rule does not apply. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :excluded_account_tokens + + sig { params(excluded_account_tokens: T::Array[String]).void } + attr_writer :excluded_account_tokens + + # Business account tokens to which the Auth Rule does not apply. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :excluded_business_account_tokens + + sig { params(excluded_business_account_tokens: T::Array[String]).void } + attr_writer :excluded_business_account_tokens + + # Card tokens to which the Auth Rule does not apply. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :excluded_card_tokens + + sig { params(excluded_card_tokens: T::Array[String]).void } + attr_writer :excluded_card_tokens + + sig do + params( + token: String, + account_tokens: T::Array[String], + business_account_tokens: T::Array[String], + card_tokens: T::Array[String], + current_version: + T.nilable(Lithic::AuthRules::AuthRule::CurrentVersion::OrHash), + draft_version: + T.nilable(Lithic::AuthRules::AuthRule::DraftVersion::OrHash), + event_stream: Lithic::AuthRules::EventStream::OrSymbol, + lithic_managed: T::Boolean, + name: T.nilable(String), + program_level: T::Boolean, + state: Lithic::AuthRules::AuthRule::State::OrSymbol, + type: Lithic::AuthRules::AuthRule::Type::OrSymbol, + excluded_account_tokens: T::Array[String], + excluded_business_account_tokens: T::Array[String], + excluded_card_tokens: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # Auth Rule Token + token:, + # Account tokens to which the Auth Rule applies. + account_tokens:, + # Business Account tokens to which the Auth Rule applies. + business_account_tokens:, + # Card tokens to which the Auth Rule applies. + card_tokens:, + current_version:, + draft_version:, + # The event stream during which the rule will be evaluated. + event_stream:, + # Indicates whether this auth rule is managed by Lithic. If true, the rule cannot + # be modified or deleted by the user + lithic_managed:, + # Auth Rule Name + name:, + # Whether the Auth Rule applies to all authorizations on the card program. + program_level:, + # The state of the Auth Rule + state:, + # The type of Auth Rule. For certain rule types, this determines the event stream + # during which it will be evaluated. For rules that can be applied to one of + # several event streams, the effective one is defined by the separate + # `event_stream` field. + # + # - `CONDITIONAL_BLOCK`: Deprecated. Use `CONDITIONAL_ACTION` instead. + # AUTHORIZATION event stream. + # - `VELOCITY_LIMIT`: AUTHORIZATION event stream. + # - `MERCHANT_LOCK`: AUTHORIZATION event stream. + # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + type:, + # Account tokens to which the Auth Rule does not apply. + excluded_account_tokens: nil, + # Business account tokens to which the Auth Rule does not apply. + excluded_business_account_tokens: nil, + # Card tokens to which the Auth Rule does not apply. + excluded_card_tokens: nil + ) + end + + sig do + override.returns( + { + token: String, + account_tokens: T::Array[String], + business_account_tokens: T::Array[String], + card_tokens: T::Array[String], + current_version: + T.nilable(Lithic::AuthRules::AuthRule::CurrentVersion), + draft_version: + T.nilable(Lithic::AuthRules::AuthRule::DraftVersion), + event_stream: Lithic::AuthRules::EventStream::TaggedSymbol, + lithic_managed: T::Boolean, + name: T.nilable(String), + program_level: T::Boolean, + state: Lithic::AuthRules::AuthRule::State::TaggedSymbol, + type: Lithic::AuthRules::AuthRule::Type::TaggedSymbol, + excluded_account_tokens: T::Array[String], + excluded_business_account_tokens: T::Array[String], + excluded_card_tokens: T::Array[String] + } + ) + end + def to_hash + end + + class CurrentVersion < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::AuthRule::CurrentVersion, + Lithic::Internal::AnyHash + ) + end + + # Parameters for the Auth Rule + sig do + returns( + Lithic::AuthRules::AuthRule::CurrentVersion::Parameters::Variants + ) + end + attr_accessor :parameters + + # The version of the rule, this is incremented whenever the rule's parameters + # change. + sig { returns(Integer) } + attr_accessor :version + + sig do + params( + parameters: + T.any( + Lithic::AuthRules::ConditionalBlockParameters::OrHash, + Lithic::AuthRules::VelocityLimitParams::OrHash, + Lithic::AuthRules::MerchantLockParameters::OrHash, + Lithic::AuthRules::Conditional3DSActionParameters::OrHash, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::OrHash, + Lithic::AuthRules::ConditionalACHActionParameters::OrHash, + Lithic::AuthRules::ConditionalTokenizationActionParameters::OrHash, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::OrHash, + Lithic::AuthRules::TypescriptCodeParameters::OrHash, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::OrHash + ), + version: Integer + ).returns(T.attached_class) + end + def self.new( + # Parameters for the Auth Rule + parameters:, + # The version of the rule, this is incremented whenever the rule's parameters + # change. + version: + ) + end + + sig do + override.returns( + { + parameters: + Lithic::AuthRules::AuthRule::CurrentVersion::Parameters::Variants, + version: Integer + } + ) + end + def to_hash + end + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::AuthRules::ConditionalBlockParameters, + Lithic::AuthRules::VelocityLimitParams, + Lithic::AuthRules::MerchantLockParameters, + Lithic::AuthRules::Conditional3DSActionParameters, + Lithic::AuthRules::ConditionalAuthorizationActionParameters, + Lithic::AuthRules::ConditionalACHActionParameters, + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters, + Lithic::AuthRules::TypescriptCodeParameters, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters + ) + end + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::AuthRule::CurrentVersion::Parameters::Variants + ] + ) + end + def self.variants + end + end + end + + class DraftVersion < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::AuthRule::DraftVersion, + Lithic::Internal::AnyHash + ) + end + + # An error message if the draft version failed compilation. Populated when `state` + # is `ERROR`, `null` otherwise. + sig { returns(T.nilable(String)) } + attr_accessor :error + + # Parameters for the Auth Rule + sig do + returns( + Lithic::AuthRules::AuthRule::DraftVersion::Parameters::Variants + ) + end + attr_accessor :parameters + + # The state of the draft version. Most rules are created synchronously and the + # state is immediately `SHADOWING`. Rules backed by TypeScript code are compiled + # asynchronously — the state starts as `PENDING` and transitions to `SHADOWING` on + # success or `ERROR` on failure. + # + # - `PENDING`: Compilation of the rule is in progress (TypeScript rules only). + # - `SHADOWING`: The draft version is ready and evaluating in shadow mode + # alongside the current active version. It can be promoted to the active + # version. + # - `ERROR`: Compilation of the rule failed. Check the `error` field for details. + sig do + returns( + Lithic::AuthRules::AuthRule::DraftVersion::State::TaggedSymbol + ) + end + attr_accessor :state + + # The version of the rule, this is incremented whenever the rule's parameters + # change. + sig { returns(Integer) } + attr_accessor :version + + sig do + params( + error: T.nilable(String), + parameters: + T.any( + Lithic::AuthRules::ConditionalBlockParameters::OrHash, + Lithic::AuthRules::VelocityLimitParams::OrHash, + Lithic::AuthRules::MerchantLockParameters::OrHash, + Lithic::AuthRules::Conditional3DSActionParameters::OrHash, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::OrHash, + Lithic::AuthRules::ConditionalACHActionParameters::OrHash, + Lithic::AuthRules::ConditionalTokenizationActionParameters::OrHash, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::OrHash, + Lithic::AuthRules::TypescriptCodeParameters::OrHash, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::OrHash + ), + state: Lithic::AuthRules::AuthRule::DraftVersion::State::OrSymbol, + version: Integer + ).returns(T.attached_class) + end + def self.new( + # An error message if the draft version failed compilation. Populated when `state` + # is `ERROR`, `null` otherwise. + error:, + # Parameters for the Auth Rule + parameters:, + # The state of the draft version. Most rules are created synchronously and the + # state is immediately `SHADOWING`. Rules backed by TypeScript code are compiled + # asynchronously — the state starts as `PENDING` and transitions to `SHADOWING` on + # success or `ERROR` on failure. + # + # - `PENDING`: Compilation of the rule is in progress (TypeScript rules only). + # - `SHADOWING`: The draft version is ready and evaluating in shadow mode + # alongside the current active version. It can be promoted to the active + # version. + # - `ERROR`: Compilation of the rule failed. Check the `error` field for details. + state:, + # The version of the rule, this is incremented whenever the rule's parameters + # change. + version: + ) + end + + sig do + override.returns( + { + error: T.nilable(String), + parameters: + Lithic::AuthRules::AuthRule::DraftVersion::Parameters::Variants, + state: + Lithic::AuthRules::AuthRule::DraftVersion::State::TaggedSymbol, + version: Integer + } + ) + end + def to_hash + end + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::AuthRules::ConditionalBlockParameters, + Lithic::AuthRules::VelocityLimitParams, + Lithic::AuthRules::MerchantLockParameters, + Lithic::AuthRules::Conditional3DSActionParameters, + Lithic::AuthRules::ConditionalAuthorizationActionParameters, + Lithic::AuthRules::ConditionalACHActionParameters, + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters, + Lithic::AuthRules::TypescriptCodeParameters, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters + ) + end + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::AuthRule::DraftVersion::Parameters::Variants + ] + ) + end + def self.variants + end + end + + # The state of the draft version. Most rules are created synchronously and the + # state is immediately `SHADOWING`. Rules backed by TypeScript code are compiled + # asynchronously — the state starts as `PENDING` and transitions to `SHADOWING` on + # success or `ERROR` on failure. + # + # - `PENDING`: Compilation of the rule is in progress (TypeScript rules only). + # - `SHADOWING`: The draft version is ready and evaluating in shadow mode + # alongside the current active version. It can be promoted to the active + # version. + # - `ERROR`: Compilation of the rule failed. Check the `error` field for details. + module State + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::AuthRules::AuthRule::DraftVersion::State) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :PENDING, + Lithic::AuthRules::AuthRule::DraftVersion::State::TaggedSymbol + ) + SHADOWING = + T.let( + :SHADOWING, + Lithic::AuthRules::AuthRule::DraftVersion::State::TaggedSymbol + ) + ERROR = + T.let( + :ERROR, + Lithic::AuthRules::AuthRule::DraftVersion::State::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::AuthRule::DraftVersion::State::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + # The state of the Auth Rule + module State + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::AuthRules::AuthRule::State) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let(:ACTIVE, Lithic::AuthRules::AuthRule::State::TaggedSymbol) + INACTIVE = + T.let(:INACTIVE, Lithic::AuthRules::AuthRule::State::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::AuthRules::AuthRule::State::TaggedSymbol] + ) + end + def self.values + end + end + + # The type of Auth Rule. For certain rule types, this determines the event stream + # during which it will be evaluated. For rules that can be applied to one of + # several event streams, the effective one is defined by the separate + # `event_stream` field. + # + # - `CONDITIONAL_BLOCK`: Deprecated. Use `CONDITIONAL_ACTION` instead. + # AUTHORIZATION event stream. + # - `VELOCITY_LIMIT`: AUTHORIZATION event stream. + # - `MERCHANT_LOCK`: AUTHORIZATION event stream. + # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::AuthRules::AuthRule::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CONDITIONAL_BLOCK = + T.let( + :CONDITIONAL_BLOCK, + Lithic::AuthRules::AuthRule::Type::TaggedSymbol + ) + VELOCITY_LIMIT = + T.let( + :VELOCITY_LIMIT, + Lithic::AuthRules::AuthRule::Type::TaggedSymbol + ) + MERCHANT_LOCK = + T.let( + :MERCHANT_LOCK, + Lithic::AuthRules::AuthRule::Type::TaggedSymbol + ) + CONDITIONAL_ACTION = + T.let( + :CONDITIONAL_ACTION, + Lithic::AuthRules::AuthRule::Type::TaggedSymbol + ) + TYPESCRIPT_CODE = + T.let( + :TYPESCRIPT_CODE, + Lithic::AuthRules::AuthRule::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::AuthRules::AuthRule::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/auth_rule_condition.rbi b/rbi/lithic/models/auth_rules/auth_rule_condition.rbi new file mode 100644 index 00000000..aa8a00a4 --- /dev/null +++ b/rbi/lithic/models/auth_rules/auth_rule_condition.rbi @@ -0,0 +1,158 @@ +# typed: strong + +module Lithic + module Models + AuthRuleCondition = AuthRules::AuthRuleCondition + + module AuthRules + class AuthRuleCondition < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::AuthRuleCondition, + Lithic::Internal::AnyHash + ) + end + + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + # business by the types of goods or services it provides. + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + # Netherlands Antilles. + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + # the transaction. + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + # (merchant). + # - `DESCRIPTOR`: Short description of card acceptor. + # - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer + # applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + # `TOKEN_AUTHENTICATED`. + # - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number + # (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, + # `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, + # `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, + # `UNKNOWN`, `CREDENTIAL_ON_FILE`, or `ECOMMERCE`. + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + # fee field in the settlement/cardholder billing currency. This is the amount + # the issuer should authorize against unless the issuer is paying the acquirer + # fee on behalf of the cardholder. + # - `RISK_SCORE`: Network-provided score assessing risk level associated with a + # given authorization. Scores are on a range of 0-999, with 0 representing the + # lowest risk and 999 representing the highest risk. For Visa transactions, + # where the raw score has a range of 0-99, Lithic will normalize the score by + # multiplying the raw score by 10x. + # - `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in the + # trailing 15 minutes before the authorization. + # - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the + # trailing hour up and until the authorization. + # - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the + # trailing 24 hours up and until the authorization. + # - `CARD_STATE`: The current state of the card associated with the transaction. + # Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, + # `PENDING_FULFILLMENT`. + # - `PIN_ENTERED`: Indicates whether a PIN was entered during the transaction. + # Valid values are `TRUE`, `FALSE`. + # - `PIN_STATUS`: The current state of card's PIN. Valid values are `NOT_SET`, + # `OK`, `BLOCKED`. + # - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the + # source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, + # `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. + # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address + # data with the cardholder KYC data if it exists. Valid values are `MATCH`, + # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`. + sig { returns(Lithic::AuthRules::ConditionalAttribute::OrSymbol) } + attr_accessor :attribute + + # The operation to apply to the attribute + sig { returns(Lithic::AuthRules::ConditionalOperation::OrSymbol) } + attr_accessor :operation + + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + sig { returns(Lithic::AuthRules::ConditionalValue::Variants) } + attr_accessor :value + + sig do + params( + attribute: Lithic::AuthRules::ConditionalAttribute::OrSymbol, + operation: Lithic::AuthRules::ConditionalOperation::OrSymbol, + value: Lithic::AuthRules::ConditionalValue::Variants + ).returns(T.attached_class) + end + def self.new( + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + # business by the types of goods or services it provides. + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + # Netherlands Antilles. + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + # the transaction. + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + # (merchant). + # - `DESCRIPTOR`: Short description of card acceptor. + # - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer + # applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + # `TOKEN_AUTHENTICATED`. + # - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number + # (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, + # `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, + # `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, + # `UNKNOWN`, `CREDENTIAL_ON_FILE`, or `ECOMMERCE`. + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + # fee field in the settlement/cardholder billing currency. This is the amount + # the issuer should authorize against unless the issuer is paying the acquirer + # fee on behalf of the cardholder. + # - `RISK_SCORE`: Network-provided score assessing risk level associated with a + # given authorization. Scores are on a range of 0-999, with 0 representing the + # lowest risk and 999 representing the highest risk. For Visa transactions, + # where the raw score has a range of 0-99, Lithic will normalize the score by + # multiplying the raw score by 10x. + # - `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in the + # trailing 15 minutes before the authorization. + # - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the + # trailing hour up and until the authorization. + # - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the + # trailing 24 hours up and until the authorization. + # - `CARD_STATE`: The current state of the card associated with the transaction. + # Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, + # `PENDING_FULFILLMENT`. + # - `PIN_ENTERED`: Indicates whether a PIN was entered during the transaction. + # Valid values are `TRUE`, `FALSE`. + # - `PIN_STATUS`: The current state of card's PIN. Valid values are `NOT_SET`, + # `OK`, `BLOCKED`. + # - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the + # source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, + # `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. + # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address + # data with the cardholder KYC data if it exists. Valid values are `MATCH`, + # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`. + attribute:, + # The operation to apply to the attribute + operation:, + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + value: + ) + end + + sig do + override.returns( + { + attribute: Lithic::AuthRules::ConditionalAttribute::OrSymbol, + operation: Lithic::AuthRules::ConditionalOperation::OrSymbol, + value: Lithic::AuthRules::ConditionalValue::Variants + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/auth_rule_version.rbi b/rbi/lithic/models/auth_rules/auth_rule_version.rbi new file mode 100644 index 00000000..639cf1e1 --- /dev/null +++ b/rbi/lithic/models/auth_rules/auth_rule_version.rbi @@ -0,0 +1,146 @@ +# typed: strong + +module Lithic + module Models + AuthRuleVersion = AuthRules::AuthRuleVersion + + module AuthRules + class AuthRuleVersion < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::AuthRules::AuthRuleVersion, Lithic::Internal::AnyHash) + end + + # Timestamp of when this version was created. + sig { returns(Time) } + attr_accessor :created + + # Parameters for the Auth Rule + sig do + returns(Lithic::AuthRules::AuthRuleVersion::Parameters::Variants) + end + attr_accessor :parameters + + # The current state of this version. + sig { returns(Lithic::AuthRules::AuthRuleVersion::State::TaggedSymbol) } + attr_accessor :state + + # The version of the rule, this is incremented whenever the rule's parameters + # change. + sig { returns(Integer) } + attr_accessor :version + + sig do + params( + created: Time, + parameters: + T.any( + Lithic::AuthRules::ConditionalBlockParameters::OrHash, + Lithic::AuthRules::VelocityLimitParams::OrHash, + Lithic::AuthRules::MerchantLockParameters::OrHash, + Lithic::AuthRules::Conditional3DSActionParameters::OrHash, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::OrHash, + Lithic::AuthRules::ConditionalACHActionParameters::OrHash, + Lithic::AuthRules::ConditionalTokenizationActionParameters::OrHash, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::OrHash, + Lithic::AuthRules::TypescriptCodeParameters::OrHash, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::OrHash + ), + state: Lithic::AuthRules::AuthRuleVersion::State::OrSymbol, + version: Integer + ).returns(T.attached_class) + end + def self.new( + # Timestamp of when this version was created. + created:, + # Parameters for the Auth Rule + parameters:, + # The current state of this version. + state:, + # The version of the rule, this is incremented whenever the rule's parameters + # change. + version: + ) + end + + sig do + override.returns( + { + created: Time, + parameters: + Lithic::AuthRules::AuthRuleVersion::Parameters::Variants, + state: Lithic::AuthRules::AuthRuleVersion::State::TaggedSymbol, + version: Integer + } + ) + end + def to_hash + end + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::AuthRules::ConditionalBlockParameters, + Lithic::AuthRules::VelocityLimitParams, + Lithic::AuthRules::MerchantLockParameters, + Lithic::AuthRules::Conditional3DSActionParameters, + Lithic::AuthRules::ConditionalAuthorizationActionParameters, + Lithic::AuthRules::ConditionalACHActionParameters, + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters, + Lithic::AuthRules::TypescriptCodeParameters, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters + ) + end + + sig do + override.returns( + T::Array[Lithic::AuthRules::AuthRuleVersion::Parameters::Variants] + ) + end + def self.variants + end + end + + # The current state of this version. + module State + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::AuthRules::AuthRuleVersion::State) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :ACTIVE, + Lithic::AuthRules::AuthRuleVersion::State::TaggedSymbol + ) + SHADOW = + T.let( + :SHADOW, + Lithic::AuthRules::AuthRuleVersion::State::TaggedSymbol + ) + INACTIVE = + T.let( + :INACTIVE, + Lithic::AuthRules::AuthRuleVersion::State::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::AuthRules::AuthRuleVersion::State::TaggedSymbol] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/backtest_stats.rbi b/rbi/lithic/models/auth_rules/backtest_stats.rbi new file mode 100644 index 00000000..2e6549df --- /dev/null +++ b/rbi/lithic/models/auth_rules/backtest_stats.rbi @@ -0,0 +1,233 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class BacktestStats < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::AuthRules::BacktestStats, Lithic::Internal::AnyHash) + end + + # The total number of historical transactions approved by this rule during the + # backtest period, or the number of transactions that would have been approved if + # the rule was evaluated in shadow mode. + sig { returns(T.nilable(Integer)) } + attr_reader :approved + + sig { params(approved: Integer).void } + attr_writer :approved + + # The total number of historical transactions challenged by this rule during the + # backtest period, or the number of transactions that would have been challenged + # if the rule was evaluated in shadow mode. Currently applicable only for 3DS Auth + # Rules. + sig { returns(T.nilable(Integer)) } + attr_reader :challenged + + sig { params(challenged: Integer).void } + attr_writer :challenged + + # The total number of historical transactions declined by this rule during the + # backtest period, or the number of transactions that would have been declined if + # the rule was evaluated in shadow mode. + sig { returns(T.nilable(Integer)) } + attr_reader :declined + + sig { params(declined: Integer).void } + attr_writer :declined + + # Example events and their outcomes. + sig do + returns( + T.nilable(T::Array[Lithic::AuthRules::BacktestStats::Example]) + ) + end + attr_reader :examples + + sig do + params( + examples: + T::Array[Lithic::AuthRules::BacktestStats::Example::OrHash] + ).void + end + attr_writer :examples + + # The version of the rule, this is incremented whenever the rule's parameters + # change. + sig { returns(T.nilable(Integer)) } + attr_reader :version + + sig { params(version: Integer).void } + attr_writer :version + + sig do + params( + approved: Integer, + challenged: Integer, + declined: Integer, + examples: + T::Array[Lithic::AuthRules::BacktestStats::Example::OrHash], + version: Integer + ).returns(T.attached_class) + end + def self.new( + # The total number of historical transactions approved by this rule during the + # backtest period, or the number of transactions that would have been approved if + # the rule was evaluated in shadow mode. + approved: nil, + # The total number of historical transactions challenged by this rule during the + # backtest period, or the number of transactions that would have been challenged + # if the rule was evaluated in shadow mode. Currently applicable only for 3DS Auth + # Rules. + challenged: nil, + # The total number of historical transactions declined by this rule during the + # backtest period, or the number of transactions that would have been declined if + # the rule was evaluated in shadow mode. + declined: nil, + # Example events and their outcomes. + examples: nil, + # The version of the rule, this is incremented whenever the rule's parameters + # change. + version: nil + ) + end + + sig do + override.returns( + { + approved: Integer, + challenged: Integer, + declined: Integer, + examples: T::Array[Lithic::AuthRules::BacktestStats::Example], + version: Integer + } + ) + end + def to_hash + end + + class Example < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::BacktestStats::Example, + Lithic::Internal::AnyHash + ) + end + + # The decision made by the rule for this event. + sig do + returns( + T.nilable( + Lithic::AuthRules::BacktestStats::Example::Decision::TaggedSymbol + ) + ) + end + attr_reader :decision + + sig do + params( + decision: + Lithic::AuthRules::BacktestStats::Example::Decision::OrSymbol + ).void + end + attr_writer :decision + + # The event token. + sig { returns(T.nilable(String)) } + attr_reader :event_token + + sig { params(event_token: String).void } + attr_writer :event_token + + # The timestamp of the event. + sig { returns(T.nilable(Time)) } + attr_reader :timestamp + + sig { params(timestamp: Time).void } + attr_writer :timestamp + + # The token of the transaction associated with the event + sig { returns(T.nilable(String)) } + attr_accessor :transaction_token + + sig do + params( + decision: + Lithic::AuthRules::BacktestStats::Example::Decision::OrSymbol, + event_token: String, + timestamp: Time, + transaction_token: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The decision made by the rule for this event. + decision: nil, + # The event token. + event_token: nil, + # The timestamp of the event. + timestamp: nil, + # The token of the transaction associated with the event + transaction_token: nil + ) + end + + sig do + override.returns( + { + decision: + Lithic::AuthRules::BacktestStats::Example::Decision::TaggedSymbol, + event_token: String, + timestamp: Time, + transaction_token: T.nilable(String) + } + ) + end + def to_hash + end + + # The decision made by the rule for this event. + module Decision + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::BacktestStats::Example::Decision + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::AuthRules::BacktestStats::Example::Decision::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::AuthRules::BacktestStats::Example::Decision::TaggedSymbol + ) + CHALLENGED = + T.let( + :CHALLENGED, + Lithic::AuthRules::BacktestStats::Example::Decision::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::BacktestStats::Example::Decision::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/card_transaction_update_action.rbi b/rbi/lithic/models/auth_rules/card_transaction_update_action.rbi new file mode 100644 index 00000000..9801b902 --- /dev/null +++ b/rbi/lithic/models/auth_rules/card_transaction_update_action.rbi @@ -0,0 +1,242 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + module CardTransactionUpdateAction + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::AuthRules::CardTransactionUpdateAction::TagAction, + Lithic::AuthRules::CardTransactionUpdateAction::CreateCaseAction + ) + end + + class TagAction < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::CardTransactionUpdateAction::TagAction, + Lithic::Internal::AnyHash + ) + end + + # The key of the tag to apply to the transaction + sig { returns(String) } + attr_accessor :key + + # Tag the transaction with key-value metadata + sig do + returns( + Lithic::AuthRules::CardTransactionUpdateAction::TagAction::Type::OrSymbol + ) + end + attr_accessor :type + + # The value of the tag to apply to the transaction + sig { returns(String) } + attr_accessor :value + + sig do + params( + key: String, + type: + Lithic::AuthRules::CardTransactionUpdateAction::TagAction::Type::OrSymbol, + value: String + ).returns(T.attached_class) + end + def self.new( + # The key of the tag to apply to the transaction + key:, + # Tag the transaction with key-value metadata + type:, + # The value of the tag to apply to the transaction + value: + ) + end + + sig do + override.returns( + { + key: String, + type: + Lithic::AuthRules::CardTransactionUpdateAction::TagAction::Type::OrSymbol, + value: String + } + ) + end + def to_hash + end + + # Tag the transaction with key-value metadata + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::CardTransactionUpdateAction::TagAction::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TAG = + T.let( + :TAG, + Lithic::AuthRules::CardTransactionUpdateAction::TagAction::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::CardTransactionUpdateAction::TagAction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class CreateCaseAction < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::CardTransactionUpdateAction::CreateCaseAction, + Lithic::Internal::AnyHash + ) + end + + # The token of the queue to create the case in + sig { returns(String) } + attr_accessor :queue_token + + # The scope of the case to create + sig do + returns( + Lithic::AuthRules::CardTransactionUpdateAction::CreateCaseAction::Scope::OrSymbol + ) + end + attr_accessor :scope + + # Create a case for the transaction + sig do + returns( + Lithic::AuthRules::CardTransactionUpdateAction::CreateCaseAction::Type::OrSymbol + ) + end + attr_accessor :type + + sig do + params( + queue_token: String, + scope: + Lithic::AuthRules::CardTransactionUpdateAction::CreateCaseAction::Scope::OrSymbol, + type: + Lithic::AuthRules::CardTransactionUpdateAction::CreateCaseAction::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The token of the queue to create the case in + queue_token:, + # The scope of the case to create + scope:, + # Create a case for the transaction + type: + ) + end + + sig do + override.returns( + { + queue_token: String, + scope: + Lithic::AuthRules::CardTransactionUpdateAction::CreateCaseAction::Scope::OrSymbol, + type: + Lithic::AuthRules::CardTransactionUpdateAction::CreateCaseAction::Type::OrSymbol + } + ) + end + def to_hash + end + + # The scope of the case to create + module Scope + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::CardTransactionUpdateAction::CreateCaseAction::Scope + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CARD = + T.let( + :CARD, + Lithic::AuthRules::CardTransactionUpdateAction::CreateCaseAction::Scope::TaggedSymbol + ) + ACCOUNT = + T.let( + :ACCOUNT, + Lithic::AuthRules::CardTransactionUpdateAction::CreateCaseAction::Scope::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::CardTransactionUpdateAction::CreateCaseAction::Scope::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Create a case for the transaction + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::CardTransactionUpdateAction::CreateCaseAction::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATE_CASE = + T.let( + :CREATE_CASE, + Lithic::AuthRules::CardTransactionUpdateAction::CreateCaseAction::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::CardTransactionUpdateAction::CreateCaseAction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig do + override.returns( + T::Array[Lithic::AuthRules::CardTransactionUpdateAction::Variants] + ) + end + def self.variants + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/conditional_3ds_action_parameters.rbi b/rbi/lithic/models/auth_rules/conditional_3ds_action_parameters.rbi new file mode 100644 index 00000000..77885bde --- /dev/null +++ b/rbi/lithic/models/auth_rules/conditional_3ds_action_parameters.rbi @@ -0,0 +1,300 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class Conditional3DSActionParameters < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::Conditional3DSActionParameters, + Lithic::Internal::AnyHash + ) + end + + # The action to take if the conditions are met. + sig do + returns( + Lithic::AuthRules::Conditional3DSActionParameters::Action::OrSymbol + ) + end + attr_accessor :action + + sig do + returns( + T::Array[ + Lithic::AuthRules::Conditional3DSActionParameters::Condition + ] + ) + end + attr_accessor :conditions + + sig do + params( + action: + Lithic::AuthRules::Conditional3DSActionParameters::Action::OrSymbol, + conditions: + T::Array[ + Lithic::AuthRules::Conditional3DSActionParameters::Condition::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # The action to take if the conditions are met. + action:, + conditions: + ) + end + + sig do + override.returns( + { + action: + Lithic::AuthRules::Conditional3DSActionParameters::Action::OrSymbol, + conditions: + T::Array[ + Lithic::AuthRules::Conditional3DSActionParameters::Condition + ] + } + ) + end + def to_hash + end + + # The action to take if the conditions are met. + module Action + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::Conditional3DSActionParameters::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DECLINE = + T.let( + :DECLINE, + Lithic::AuthRules::Conditional3DSActionParameters::Action::TaggedSymbol + ) + CHALLENGE = + T.let( + :CHALLENGE, + Lithic::AuthRules::Conditional3DSActionParameters::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::Conditional3DSActionParameters::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Condition < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::Conditional3DSActionParameters::Condition, + Lithic::Internal::AnyHash + ) + end + + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + # business by the types of goods or services it provides. + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + # Netherlands Antilles. + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + # the transaction. + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + # (merchant). + # - `DESCRIPTOR`: Short description of card acceptor. + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + # fee field in the settlement/cardholder billing currency. This is the amount + # the issuer should authorize against unless the issuer is paying the acquirer + # fee on behalf of the cardholder. Use an integer value. + # - `RISK_SCORE`: Mastercard only: Assessment by the network of the authentication + # risk level, with a higher value indicating a higher amount of risk. Use an + # integer value. + # - `MESSAGE_CATEGORY`: The category of the authentication being processed. + # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address + # data with the cardholder KYC data if it exists. Valid values are `MATCH`, + # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`. + sig do + returns( + Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute::OrSymbol + ) + end + attr_accessor :attribute + + # The operation to apply to the attribute + sig { returns(Lithic::AuthRules::ConditionalOperation::OrSymbol) } + attr_accessor :operation + + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + sig { returns(Lithic::AuthRules::ConditionalValue::Variants) } + attr_accessor :value + + sig do + params( + attribute: + Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute::OrSymbol, + operation: Lithic::AuthRules::ConditionalOperation::OrSymbol, + value: Lithic::AuthRules::ConditionalValue::Variants + ).returns(T.attached_class) + end + def self.new( + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + # business by the types of goods or services it provides. + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + # Netherlands Antilles. + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + # the transaction. + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + # (merchant). + # - `DESCRIPTOR`: Short description of card acceptor. + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + # fee field in the settlement/cardholder billing currency. This is the amount + # the issuer should authorize against unless the issuer is paying the acquirer + # fee on behalf of the cardholder. Use an integer value. + # - `RISK_SCORE`: Mastercard only: Assessment by the network of the authentication + # risk level, with a higher value indicating a higher amount of risk. Use an + # integer value. + # - `MESSAGE_CATEGORY`: The category of the authentication being processed. + # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address + # data with the cardholder KYC data if it exists. Valid values are `MATCH`, + # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`. + attribute:, + # The operation to apply to the attribute + operation:, + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + value: + ) + end + + sig do + override.returns( + { + attribute: + Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute::OrSymbol, + operation: Lithic::AuthRules::ConditionalOperation::OrSymbol, + value: Lithic::AuthRules::ConditionalValue::Variants + } + ) + end + def to_hash + end + + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + # business by the types of goods or services it provides. + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + # Netherlands Antilles. + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + # the transaction. + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + # (merchant). + # - `DESCRIPTOR`: Short description of card acceptor. + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + # fee field in the settlement/cardholder billing currency. This is the amount + # the issuer should authorize against unless the issuer is paying the acquirer + # fee on behalf of the cardholder. Use an integer value. + # - `RISK_SCORE`: Mastercard only: Assessment by the network of the authentication + # risk level, with a higher value indicating a higher amount of risk. Use an + # integer value. + # - `MESSAGE_CATEGORY`: The category of the authentication being processed. + # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address + # data with the cardholder KYC data if it exists. Valid values are `MATCH`, + # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`. + module Attribute + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MCC = + T.let( + :MCC, + Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute::TaggedSymbol + ) + COUNTRY = + T.let( + :COUNTRY, + Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute::TaggedSymbol + ) + CURRENCY = + T.let( + :CURRENCY, + Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute::TaggedSymbol + ) + MERCHANT_ID = + T.let( + :MERCHANT_ID, + Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute::TaggedSymbol + ) + DESCRIPTOR = + T.let( + :DESCRIPTOR, + Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute::TaggedSymbol + ) + TRANSACTION_AMOUNT = + T.let( + :TRANSACTION_AMOUNT, + Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute::TaggedSymbol + ) + RISK_SCORE = + T.let( + :RISK_SCORE, + Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute::TaggedSymbol + ) + MESSAGE_CATEGORY = + T.let( + :MESSAGE_CATEGORY, + Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute::TaggedSymbol + ) + ADDRESS_MATCH = + T.let( + :ADDRESS_MATCH, + Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::Conditional3DSActionParameters::Condition::Attribute::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/conditional_ach_action_parameters.rbi b/rbi/lithic/models/auth_rules/conditional_ach_action_parameters.rbi new file mode 100644 index 00000000..c51ae8b1 --- /dev/null +++ b/rbi/lithic/models/auth_rules/conditional_ach_action_parameters.rbi @@ -0,0 +1,789 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class ConditionalACHActionParameters < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::ConditionalACHActionParameters, + Lithic::Internal::AnyHash + ) + end + + # The action to take if the conditions are met. + sig do + returns( + T.any( + Lithic::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction + ) + ) + end + attr_accessor :action + + sig do + returns( + T::Array[ + Lithic::AuthRules::ConditionalACHActionParameters::Condition + ] + ) + end + attr_accessor :conditions + + sig do + params( + action: + T.any( + Lithic::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH::OrHash, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::OrHash + ), + conditions: + T::Array[ + Lithic::AuthRules::ConditionalACHActionParameters::Condition::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # The action to take if the conditions are met. + action:, + conditions: + ) + end + + sig do + override.returns( + { + action: + T.any( + Lithic::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction + ), + conditions: + T::Array[ + Lithic::AuthRules::ConditionalACHActionParameters::Condition + ] + } + ) + end + def to_hash + end + + # The action to take if the conditions are met. + module Action + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction + ) + end + + class ApproveActionACH < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH, + Lithic::Internal::AnyHash + ) + end + + # Approve the ACH transaction + sig do + returns( + Lithic::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH::Type::OrSymbol + ) + end + attr_accessor :type + + sig do + params( + type: + Lithic::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Approve the ACH transaction + type: + ) + end + + sig do + override.returns( + { + type: + Lithic::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH::Type::OrSymbol + } + ) + end + def to_hash + end + + # Approve the ACH transaction + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVE = + T.let( + :APPROVE, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class ReturnAction < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction, + Lithic::Internal::AnyHash + ) + end + + # NACHA return code to use when returning the transaction. Note that the list of + # available return codes is subject to an allowlist configured at the program + # level + sig do + returns( + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::OrSymbol + ) + end + attr_accessor :code + + # Return the ACH transaction + sig do + returns( + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Type::OrSymbol + ) + end + attr_accessor :type + + sig do + params( + code: + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::OrSymbol, + type: + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # NACHA return code to use when returning the transaction. Note that the list of + # available return codes is subject to an allowlist configured at the program + # level + code:, + # Return the ACH transaction + type: + ) + end + + sig do + override.returns( + { + code: + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::OrSymbol, + type: + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Type::OrSymbol + } + ) + end + def to_hash + end + + # NACHA return code to use when returning the transaction. Note that the list of + # available return codes is subject to an allowlist configured at the program + # level + module Code + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + R01 = + T.let( + :R01, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R02 = + T.let( + :R02, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R03 = + T.let( + :R03, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R04 = + T.let( + :R04, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R05 = + T.let( + :R05, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R06 = + T.let( + :R06, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R07 = + T.let( + :R07, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R08 = + T.let( + :R08, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R09 = + T.let( + :R09, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R10 = + T.let( + :R10, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R11 = + T.let( + :R11, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R12 = + T.let( + :R12, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R13 = + T.let( + :R13, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R14 = + T.let( + :R14, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R15 = + T.let( + :R15, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R16 = + T.let( + :R16, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R17 = + T.let( + :R17, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R18 = + T.let( + :R18, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R19 = + T.let( + :R19, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R20 = + T.let( + :R20, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R21 = + T.let( + :R21, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R22 = + T.let( + :R22, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R23 = + T.let( + :R23, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R24 = + T.let( + :R24, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R25 = + T.let( + :R25, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R26 = + T.let( + :R26, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R27 = + T.let( + :R27, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R28 = + T.let( + :R28, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R29 = + T.let( + :R29, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R30 = + T.let( + :R30, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R31 = + T.let( + :R31, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R32 = + T.let( + :R32, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R33 = + T.let( + :R33, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R34 = + T.let( + :R34, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R35 = + T.let( + :R35, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R36 = + T.let( + :R36, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R37 = + T.let( + :R37, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R38 = + T.let( + :R38, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R39 = + T.let( + :R39, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R40 = + T.let( + :R40, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R41 = + T.let( + :R41, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R42 = + T.let( + :R42, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R43 = + T.let( + :R43, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R44 = + T.let( + :R44, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R45 = + T.let( + :R45, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R46 = + T.let( + :R46, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R47 = + T.let( + :R47, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R50 = + T.let( + :R50, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R51 = + T.let( + :R51, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R52 = + T.let( + :R52, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R53 = + T.let( + :R53, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R61 = + T.let( + :R61, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R62 = + T.let( + :R62, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R67 = + T.let( + :R67, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R68 = + T.let( + :R68, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R69 = + T.let( + :R69, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R70 = + T.let( + :R70, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R71 = + T.let( + :R71, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R72 = + T.let( + :R72, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R73 = + T.let( + :R73, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R74 = + T.let( + :R74, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R75 = + T.let( + :R75, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R76 = + T.let( + :R76, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R77 = + T.let( + :R77, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R80 = + T.let( + :R80, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R81 = + T.let( + :R81, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R82 = + T.let( + :R82, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R83 = + T.let( + :R83, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R84 = + T.let( + :R84, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + R85 = + T.let( + :R85, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Code::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Return the ACH transaction + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + RETURN = + T.let( + :RETURN, + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ConditionalACHActionParameters::Action::Variants + ] + ) + end + def self.variants + end + end + + class Condition < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::ConditionalACHActionParameters::Condition, + Lithic::Internal::AnyHash + ) + end + + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `COMPANY_NAME`: The name of the company initiating the ACH transaction. + # - `COMPANY_ID`: The company ID (also known as Standard Entry Class (SEC) Company + # ID) of the entity initiating the ACH transaction. + # - `TIMESTAMP`: The timestamp of the ACH transaction in ISO 8601 format. + # - `TRANSACTION_AMOUNT`: The amount of the ACH transaction in minor units + # (cents). Use an integer value. + # - `SEC_CODE`: Standard Entry Class code indicating the type of ACH transaction. + # Valid values include PPD (Prearranged Payment and Deposit Entry), CCD + # (Corporate Credit or Debit Entry), WEB (Internet-Initiated/Mobile Entry), TEL + # (Telephone-Initiated Entry), and others. + # - `MEMO`: Optional memo or description field included with the ACH transaction. + sig do + returns( + Lithic::AuthRules::ConditionalACHActionParameters::Condition::Attribute::OrSymbol + ) + end + attr_accessor :attribute + + # The operation to apply to the attribute + sig { returns(Lithic::AuthRules::ConditionalOperation::OrSymbol) } + attr_accessor :operation + + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + sig { returns(Lithic::AuthRules::ConditionalValue::Variants) } + attr_accessor :value + + sig do + params( + attribute: + Lithic::AuthRules::ConditionalACHActionParameters::Condition::Attribute::OrSymbol, + operation: Lithic::AuthRules::ConditionalOperation::OrSymbol, + value: Lithic::AuthRules::ConditionalValue::Variants + ).returns(T.attached_class) + end + def self.new( + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `COMPANY_NAME`: The name of the company initiating the ACH transaction. + # - `COMPANY_ID`: The company ID (also known as Standard Entry Class (SEC) Company + # ID) of the entity initiating the ACH transaction. + # - `TIMESTAMP`: The timestamp of the ACH transaction in ISO 8601 format. + # - `TRANSACTION_AMOUNT`: The amount of the ACH transaction in minor units + # (cents). Use an integer value. + # - `SEC_CODE`: Standard Entry Class code indicating the type of ACH transaction. + # Valid values include PPD (Prearranged Payment and Deposit Entry), CCD + # (Corporate Credit or Debit Entry), WEB (Internet-Initiated/Mobile Entry), TEL + # (Telephone-Initiated Entry), and others. + # - `MEMO`: Optional memo or description field included with the ACH transaction. + attribute:, + # The operation to apply to the attribute + operation:, + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + value: + ) + end + + sig do + override.returns( + { + attribute: + Lithic::AuthRules::ConditionalACHActionParameters::Condition::Attribute::OrSymbol, + operation: Lithic::AuthRules::ConditionalOperation::OrSymbol, + value: Lithic::AuthRules::ConditionalValue::Variants + } + ) + end + def to_hash + end + + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `COMPANY_NAME`: The name of the company initiating the ACH transaction. + # - `COMPANY_ID`: The company ID (also known as Standard Entry Class (SEC) Company + # ID) of the entity initiating the ACH transaction. + # - `TIMESTAMP`: The timestamp of the ACH transaction in ISO 8601 format. + # - `TRANSACTION_AMOUNT`: The amount of the ACH transaction in minor units + # (cents). Use an integer value. + # - `SEC_CODE`: Standard Entry Class code indicating the type of ACH transaction. + # Valid values include PPD (Prearranged Payment and Deposit Entry), CCD + # (Corporate Credit or Debit Entry), WEB (Internet-Initiated/Mobile Entry), TEL + # (Telephone-Initiated Entry), and others. + # - `MEMO`: Optional memo or description field included with the ACH transaction. + module Attribute + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ConditionalACHActionParameters::Condition::Attribute + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + COMPANY_NAME = + T.let( + :COMPANY_NAME, + Lithic::AuthRules::ConditionalACHActionParameters::Condition::Attribute::TaggedSymbol + ) + COMPANY_ID = + T.let( + :COMPANY_ID, + Lithic::AuthRules::ConditionalACHActionParameters::Condition::Attribute::TaggedSymbol + ) + TIMESTAMP = + T.let( + :TIMESTAMP, + Lithic::AuthRules::ConditionalACHActionParameters::Condition::Attribute::TaggedSymbol + ) + TRANSACTION_AMOUNT = + T.let( + :TRANSACTION_AMOUNT, + Lithic::AuthRules::ConditionalACHActionParameters::Condition::Attribute::TaggedSymbol + ) + SEC_CODE = + T.let( + :SEC_CODE, + Lithic::AuthRules::ConditionalACHActionParameters::Condition::Attribute::TaggedSymbol + ) + MEMO = + T.let( + :MEMO, + Lithic::AuthRules::ConditionalACHActionParameters::Condition::Attribute::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ConditionalACHActionParameters::Condition::Attribute::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/conditional_attribute.rbi b/rbi/lithic/models/auth_rules/conditional_attribute.rbi new file mode 100644 index 00000000..5b6a60f8 --- /dev/null +++ b/rbi/lithic/models/auth_rules/conditional_attribute.rbi @@ -0,0 +1,154 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + # business by the types of goods or services it provides. + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + # Netherlands Antilles. + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + # the transaction. + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + # (merchant). + # - `DESCRIPTOR`: Short description of card acceptor. + # - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer + # applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + # `TOKEN_AUTHENTICATED`. + # - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number + # (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, + # `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, + # `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, + # `UNKNOWN`, `CREDENTIAL_ON_FILE`, or `ECOMMERCE`. + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + # fee field in the settlement/cardholder billing currency. This is the amount + # the issuer should authorize against unless the issuer is paying the acquirer + # fee on behalf of the cardholder. + # - `RISK_SCORE`: Network-provided score assessing risk level associated with a + # given authorization. Scores are on a range of 0-999, with 0 representing the + # lowest risk and 999 representing the highest risk. For Visa transactions, + # where the raw score has a range of 0-99, Lithic will normalize the score by + # multiplying the raw score by 10x. + # - `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in the + # trailing 15 minutes before the authorization. + # - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the + # trailing hour up and until the authorization. + # - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the + # trailing 24 hours up and until the authorization. + # - `CARD_STATE`: The current state of the card associated with the transaction. + # Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, + # `PENDING_FULFILLMENT`. + # - `PIN_ENTERED`: Indicates whether a PIN was entered during the transaction. + # Valid values are `TRUE`, `FALSE`. + # - `PIN_STATUS`: The current state of card's PIN. Valid values are `NOT_SET`, + # `OK`, `BLOCKED`. + # - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the + # source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, + # `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. + # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address + # data with the cardholder KYC data if it exists. Valid values are `MATCH`, + # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`. + module ConditionalAttribute + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::AuthRules::ConditionalAttribute) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MCC = T.let(:MCC, Lithic::AuthRules::ConditionalAttribute::TaggedSymbol) + COUNTRY = + T.let(:COUNTRY, Lithic::AuthRules::ConditionalAttribute::TaggedSymbol) + CURRENCY = + T.let( + :CURRENCY, + Lithic::AuthRules::ConditionalAttribute::TaggedSymbol + ) + MERCHANT_ID = + T.let( + :MERCHANT_ID, + Lithic::AuthRules::ConditionalAttribute::TaggedSymbol + ) + DESCRIPTOR = + T.let( + :DESCRIPTOR, + Lithic::AuthRules::ConditionalAttribute::TaggedSymbol + ) + LIABILITY_SHIFT = + T.let( + :LIABILITY_SHIFT, + Lithic::AuthRules::ConditionalAttribute::TaggedSymbol + ) + PAN_ENTRY_MODE = + T.let( + :PAN_ENTRY_MODE, + Lithic::AuthRules::ConditionalAttribute::TaggedSymbol + ) + TRANSACTION_AMOUNT = + T.let( + :TRANSACTION_AMOUNT, + Lithic::AuthRules::ConditionalAttribute::TaggedSymbol + ) + RISK_SCORE = + T.let( + :RISK_SCORE, + Lithic::AuthRules::ConditionalAttribute::TaggedSymbol + ) + CARD_TRANSACTION_COUNT_15_M = + T.let( + :CARD_TRANSACTION_COUNT_15M, + Lithic::AuthRules::ConditionalAttribute::TaggedSymbol + ) + CARD_TRANSACTION_COUNT_1_H = + T.let( + :CARD_TRANSACTION_COUNT_1H, + Lithic::AuthRules::ConditionalAttribute::TaggedSymbol + ) + CARD_TRANSACTION_COUNT_24_H = + T.let( + :CARD_TRANSACTION_COUNT_24H, + Lithic::AuthRules::ConditionalAttribute::TaggedSymbol + ) + CARD_STATE = + T.let( + :CARD_STATE, + Lithic::AuthRules::ConditionalAttribute::TaggedSymbol + ) + PIN_ENTERED = + T.let( + :PIN_ENTERED, + Lithic::AuthRules::ConditionalAttribute::TaggedSymbol + ) + PIN_STATUS = + T.let( + :PIN_STATUS, + Lithic::AuthRules::ConditionalAttribute::TaggedSymbol + ) + WALLET_TYPE = + T.let( + :WALLET_TYPE, + Lithic::AuthRules::ConditionalAttribute::TaggedSymbol + ) + ADDRESS_MATCH = + T.let( + :ADDRESS_MATCH, + Lithic::AuthRules::ConditionalAttribute::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::AuthRules::ConditionalAttribute::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/conditional_authorization_action_parameters.rbi b/rbi/lithic/models/auth_rules/conditional_authorization_action_parameters.rbi new file mode 100644 index 00000000..b6ac7a11 --- /dev/null +++ b/rbi/lithic/models/auth_rules/conditional_authorization_action_parameters.rbi @@ -0,0 +1,1025 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class ConditionalAuthorizationActionParameters < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::ConditionalAuthorizationActionParameters, + Lithic::Internal::AnyHash + ) + end + + # The action to take if the conditions are met. + sig do + returns( + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Action::OrSymbol + ) + end + attr_accessor :action + + sig do + returns( + T::Array[ + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition + ] + ) + end + attr_accessor :conditions + + sig do + params( + action: + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Action::OrSymbol, + conditions: + T::Array[ + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # The action to take if the conditions are met. + action:, + conditions: + ) + end + + sig do + override.returns( + { + action: + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Action::OrSymbol, + conditions: + T::Array[ + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition + ] + } + ) + end + def to_hash + end + + # The action to take if the conditions are met. + module Action + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DECLINE = + T.let( + :DECLINE, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Action::TaggedSymbol + ) + CHALLENGE = + T.let( + :CHALLENGE, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Condition < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition, + Lithic::Internal::AnyHash + ) + end + + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + # business by the types of goods or services it provides. + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + # Netherlands Antilles. + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + # the transaction. + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + # (merchant). + # - `DESCRIPTOR`: Short description of card acceptor. + # - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer + # applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + # `TOKEN_AUTHENTICATED`. + # - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number + # (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, + # `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, + # `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, + # `UNKNOWN`, `CREDENTIAL_ON_FILE`, or `ECOMMERCE`. + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + # fee field in the settlement/cardholder billing currency. This is the amount + # the issuer should authorize against unless the issuer is paying the acquirer + # fee on behalf of the cardholder. Use an integer value. + # - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This + # represents the amount of cash being withdrawn or advanced. Use an integer + # value. + # - `RISK_SCORE`: Network-provided score assessing risk level associated with a + # given authorization. Scores are on a range of 0-999, with 0 representing the + # lowest risk and 999 representing the highest risk. For Visa transactions, + # where the raw score has a range of 0-99, Lithic will normalize the score by + # multiplying the raw score by 10x. Use an integer value. + # - `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in the + # trailing 15 minutes before the authorization. Use an integer value. + # - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the + # trailing hour up and until the authorization. Use an integer value. + # - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the + # trailing 24 hours up and until the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_15M`: The number of declined transactions on the card in + # the trailing 15 minutes before the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_1H`: The number of declined transactions on the card in + # the trailing hour up and until the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_24H`: The number of declined transactions on the card in + # the trailing 24 hours up and until the authorization. Use an integer value. + # - `CARD_STATE`: The current state of the card associated with the transaction. + # Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, + # `PENDING_FULFILLMENT`. + # - `PIN_ENTERED`: Indicates whether a PIN was entered during the transaction. + # Valid values are `TRUE`, `FALSE`. + # - `PIN_STATUS`: The current state of card's PIN. Valid values are `NOT_SET`, + # `OK`, `BLOCKED`. + # - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the + # source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, + # `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. + # - `TRANSACTION_INITIATOR`: The entity that initiated the transaction indicates + # the source of the token. Valid values are `CARDHOLDER`, `MERCHANT`, `UNKNOWN`. + # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address + # data with the cardholder KYC data if it exists. Valid values are `MATCH`, + # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`. + # - `SERVICE_LOCATION_STATE`: The state/province code (ISO 3166-2) where the + # cardholder received the service, e.g. "NY". When a service location is present + # in the network data, the service location state is used. Otherwise, falls back + # to the card acceptor state. + # - `SERVICE_LOCATION_POSTAL_CODE`: The postal code where the cardholder received + # the service, e.g. "10001". When a service location is present in the network + # data, the service location postal code is used. Otherwise, falls back to the + # card acceptor postal code. + # - `CARD_AGE`: The age of the card in seconds at the time of the authorization. + # Use an integer value. + # - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time + # of the authorization. Use an integer value. For programs where Lithic does not + # manage or retain account holder data, this attribute does not evaluate. + # - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the + # entity's transaction history. Null if fewer than 30 approved transactions in + # the specified window. Requires `parameters.scope` and `parameters.interval`. + # Use a decimal value. + # - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the + # entity over the specified window, in cents. Requires `parameters.scope` and + # `parameters.interval`. Use a decimal value. + # - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction + # amounts for the entity over the specified window, in cents. Null if fewer than + # 30 approved transactions in the specified window. Requires `parameters.scope` + # and `parameters.interval`. Use a decimal value. + # - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen + # in the entity's transaction history. Valid values are `TRUE`, `FALSE`. + # Requires `parameters.scope`. + # - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's + # transaction history. Valid values are `TRUE`, `FALSE`. Requires + # `parameters.scope`. + # - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity. + # Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`. + # - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for + # the entity over the last 30 days (rolling). Requires `parameters.scope`. Not + # supported for `BUSINESS_ACCOUNT` scope. Use an integer value. + # - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved + # transaction for the entity, rounded to the nearest whole day. Requires + # `parameters.scope`. Use an integer value. + # - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in + # the entity's transaction history. Requires `parameters.scope`. Use an integer + # value. + # - `IS_NEW_MERCHANT`: Whether the card acceptor ID has not been seen in the + # card's approved transaction history (capped at the 1000 most recently seen + # merchants). Valid values are `TRUE`, `FALSE`. Card-scoped only; no + # `parameters` required. + # - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as + # a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required. + # Use a decimal value. + # - `TRAVEL_SPEED`: The estimated speed of travel derived from the distance + # between the postal code centers of the last card-present transaction and the + # current transaction, divided by the elapsed time. Null if there is no prior + # card-present transaction, if either postal code cannot be geocoded, or if + # elapsed time is zero. Requires `parameters.unit` set to `MPH` or `KPH`. Use a + # decimal value. + # - `DISTANCE_FROM_LAST_TRANSACTION`: The estimated distance between the postal + # code centers of the last card-present transaction and the current transaction. + # Null if there is no prior card-present transaction or if either postal code + # cannot be geocoded. Requires `parameters.unit` set to `MILES` or `KILOMETERS`. + # Use a decimal value. + sig do + returns( + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::OrSymbol + ) + end + attr_accessor :attribute + + # The operation to apply to the attribute + sig { returns(Lithic::AuthRules::ConditionalOperation::OrSymbol) } + attr_accessor :operation + + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + sig { returns(Lithic::AuthRules::ConditionalValue::Variants) } + attr_accessor :value + + # Additional parameters for certain attributes. Required when `attribute` is one + # of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`, + # `IS_NEW_COUNTRY`, `IS_NEW_MCC`, `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, + # `TIME_SINCE_LAST_TRANSACTION`, or `DISTINCT_COUNTRY_COUNT` (require `scope`); or + # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`). Not used + # for other attributes. + sig do + returns( + T.nilable( + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters + ) + ) + end + attr_reader :parameters + + sig do + params( + parameters: + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::OrHash + ).void + end + attr_writer :parameters + + sig do + params( + attribute: + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::OrSymbol, + operation: Lithic::AuthRules::ConditionalOperation::OrSymbol, + value: Lithic::AuthRules::ConditionalValue::Variants, + parameters: + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::OrHash + ).returns(T.attached_class) + end + def self.new( + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + # business by the types of goods or services it provides. + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + # Netherlands Antilles. + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + # the transaction. + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + # (merchant). + # - `DESCRIPTOR`: Short description of card acceptor. + # - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer + # applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + # `TOKEN_AUTHENTICATED`. + # - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number + # (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, + # `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, + # `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, + # `UNKNOWN`, `CREDENTIAL_ON_FILE`, or `ECOMMERCE`. + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + # fee field in the settlement/cardholder billing currency. This is the amount + # the issuer should authorize against unless the issuer is paying the acquirer + # fee on behalf of the cardholder. Use an integer value. + # - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This + # represents the amount of cash being withdrawn or advanced. Use an integer + # value. + # - `RISK_SCORE`: Network-provided score assessing risk level associated with a + # given authorization. Scores are on a range of 0-999, with 0 representing the + # lowest risk and 999 representing the highest risk. For Visa transactions, + # where the raw score has a range of 0-99, Lithic will normalize the score by + # multiplying the raw score by 10x. Use an integer value. + # - `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in the + # trailing 15 minutes before the authorization. Use an integer value. + # - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the + # trailing hour up and until the authorization. Use an integer value. + # - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the + # trailing 24 hours up and until the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_15M`: The number of declined transactions on the card in + # the trailing 15 minutes before the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_1H`: The number of declined transactions on the card in + # the trailing hour up and until the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_24H`: The number of declined transactions on the card in + # the trailing 24 hours up and until the authorization. Use an integer value. + # - `CARD_STATE`: The current state of the card associated with the transaction. + # Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, + # `PENDING_FULFILLMENT`. + # - `PIN_ENTERED`: Indicates whether a PIN was entered during the transaction. + # Valid values are `TRUE`, `FALSE`. + # - `PIN_STATUS`: The current state of card's PIN. Valid values are `NOT_SET`, + # `OK`, `BLOCKED`. + # - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the + # source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, + # `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. + # - `TRANSACTION_INITIATOR`: The entity that initiated the transaction indicates + # the source of the token. Valid values are `CARDHOLDER`, `MERCHANT`, `UNKNOWN`. + # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address + # data with the cardholder KYC data if it exists. Valid values are `MATCH`, + # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`. + # - `SERVICE_LOCATION_STATE`: The state/province code (ISO 3166-2) where the + # cardholder received the service, e.g. "NY". When a service location is present + # in the network data, the service location state is used. Otherwise, falls back + # to the card acceptor state. + # - `SERVICE_LOCATION_POSTAL_CODE`: The postal code where the cardholder received + # the service, e.g. "10001". When a service location is present in the network + # data, the service location postal code is used. Otherwise, falls back to the + # card acceptor postal code. + # - `CARD_AGE`: The age of the card in seconds at the time of the authorization. + # Use an integer value. + # - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time + # of the authorization. Use an integer value. For programs where Lithic does not + # manage or retain account holder data, this attribute does not evaluate. + # - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the + # entity's transaction history. Null if fewer than 30 approved transactions in + # the specified window. Requires `parameters.scope` and `parameters.interval`. + # Use a decimal value. + # - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the + # entity over the specified window, in cents. Requires `parameters.scope` and + # `parameters.interval`. Use a decimal value. + # - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction + # amounts for the entity over the specified window, in cents. Null if fewer than + # 30 approved transactions in the specified window. Requires `parameters.scope` + # and `parameters.interval`. Use a decimal value. + # - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen + # in the entity's transaction history. Valid values are `TRUE`, `FALSE`. + # Requires `parameters.scope`. + # - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's + # transaction history. Valid values are `TRUE`, `FALSE`. Requires + # `parameters.scope`. + # - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity. + # Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`. + # - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for + # the entity over the last 30 days (rolling). Requires `parameters.scope`. Not + # supported for `BUSINESS_ACCOUNT` scope. Use an integer value. + # - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved + # transaction for the entity, rounded to the nearest whole day. Requires + # `parameters.scope`. Use an integer value. + # - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in + # the entity's transaction history. Requires `parameters.scope`. Use an integer + # value. + # - `IS_NEW_MERCHANT`: Whether the card acceptor ID has not been seen in the + # card's approved transaction history (capped at the 1000 most recently seen + # merchants). Valid values are `TRUE`, `FALSE`. Card-scoped only; no + # `parameters` required. + # - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as + # a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required. + # Use a decimal value. + # - `TRAVEL_SPEED`: The estimated speed of travel derived from the distance + # between the postal code centers of the last card-present transaction and the + # current transaction, divided by the elapsed time. Null if there is no prior + # card-present transaction, if either postal code cannot be geocoded, or if + # elapsed time is zero. Requires `parameters.unit` set to `MPH` or `KPH`. Use a + # decimal value. + # - `DISTANCE_FROM_LAST_TRANSACTION`: The estimated distance between the postal + # code centers of the last card-present transaction and the current transaction. + # Null if there is no prior card-present transaction or if either postal code + # cannot be geocoded. Requires `parameters.unit` set to `MILES` or `KILOMETERS`. + # Use a decimal value. + attribute:, + # The operation to apply to the attribute + operation:, + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + value:, + # Additional parameters for certain attributes. Required when `attribute` is one + # of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`, + # `IS_NEW_COUNTRY`, `IS_NEW_MCC`, `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, + # `TIME_SINCE_LAST_TRANSACTION`, or `DISTINCT_COUNTRY_COUNT` (require `scope`); or + # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`). Not used + # for other attributes. + parameters: nil + ) + end + + sig do + override.returns( + { + attribute: + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::OrSymbol, + operation: Lithic::AuthRules::ConditionalOperation::OrSymbol, + value: Lithic::AuthRules::ConditionalValue::Variants, + parameters: + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters + } + ) + end + def to_hash + end + + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + # business by the types of goods or services it provides. + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + # Netherlands Antilles. + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + # the transaction. + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + # (merchant). + # - `DESCRIPTOR`: Short description of card acceptor. + # - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer + # applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + # `TOKEN_AUTHENTICATED`. + # - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number + # (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, + # `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, + # `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, + # `UNKNOWN`, `CREDENTIAL_ON_FILE`, or `ECOMMERCE`. + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + # fee field in the settlement/cardholder billing currency. This is the amount + # the issuer should authorize against unless the issuer is paying the acquirer + # fee on behalf of the cardholder. Use an integer value. + # - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This + # represents the amount of cash being withdrawn or advanced. Use an integer + # value. + # - `RISK_SCORE`: Network-provided score assessing risk level associated with a + # given authorization. Scores are on a range of 0-999, with 0 representing the + # lowest risk and 999 representing the highest risk. For Visa transactions, + # where the raw score has a range of 0-99, Lithic will normalize the score by + # multiplying the raw score by 10x. Use an integer value. + # - `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in the + # trailing 15 minutes before the authorization. Use an integer value. + # - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the + # trailing hour up and until the authorization. Use an integer value. + # - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the + # trailing 24 hours up and until the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_15M`: The number of declined transactions on the card in + # the trailing 15 minutes before the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_1H`: The number of declined transactions on the card in + # the trailing hour up and until the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_24H`: The number of declined transactions on the card in + # the trailing 24 hours up and until the authorization. Use an integer value. + # - `CARD_STATE`: The current state of the card associated with the transaction. + # Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, + # `PENDING_FULFILLMENT`. + # - `PIN_ENTERED`: Indicates whether a PIN was entered during the transaction. + # Valid values are `TRUE`, `FALSE`. + # - `PIN_STATUS`: The current state of card's PIN. Valid values are `NOT_SET`, + # `OK`, `BLOCKED`. + # - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the + # source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, + # `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. + # - `TRANSACTION_INITIATOR`: The entity that initiated the transaction indicates + # the source of the token. Valid values are `CARDHOLDER`, `MERCHANT`, `UNKNOWN`. + # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address + # data with the cardholder KYC data if it exists. Valid values are `MATCH`, + # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`. + # - `SERVICE_LOCATION_STATE`: The state/province code (ISO 3166-2) where the + # cardholder received the service, e.g. "NY". When a service location is present + # in the network data, the service location state is used. Otherwise, falls back + # to the card acceptor state. + # - `SERVICE_LOCATION_POSTAL_CODE`: The postal code where the cardholder received + # the service, e.g. "10001". When a service location is present in the network + # data, the service location postal code is used. Otherwise, falls back to the + # card acceptor postal code. + # - `CARD_AGE`: The age of the card in seconds at the time of the authorization. + # Use an integer value. + # - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time + # of the authorization. Use an integer value. For programs where Lithic does not + # manage or retain account holder data, this attribute does not evaluate. + # - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the + # entity's transaction history. Null if fewer than 30 approved transactions in + # the specified window. Requires `parameters.scope` and `parameters.interval`. + # Use a decimal value. + # - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the + # entity over the specified window, in cents. Requires `parameters.scope` and + # `parameters.interval`. Use a decimal value. + # - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction + # amounts for the entity over the specified window, in cents. Null if fewer than + # 30 approved transactions in the specified window. Requires `parameters.scope` + # and `parameters.interval`. Use a decimal value. + # - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen + # in the entity's transaction history. Valid values are `TRUE`, `FALSE`. + # Requires `parameters.scope`. + # - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's + # transaction history. Valid values are `TRUE`, `FALSE`. Requires + # `parameters.scope`. + # - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity. + # Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`. + # - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for + # the entity over the last 30 days (rolling). Requires `parameters.scope`. Not + # supported for `BUSINESS_ACCOUNT` scope. Use an integer value. + # - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved + # transaction for the entity, rounded to the nearest whole day. Requires + # `parameters.scope`. Use an integer value. + # - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in + # the entity's transaction history. Requires `parameters.scope`. Use an integer + # value. + # - `IS_NEW_MERCHANT`: Whether the card acceptor ID has not been seen in the + # card's approved transaction history (capped at the 1000 most recently seen + # merchants). Valid values are `TRUE`, `FALSE`. Card-scoped only; no + # `parameters` required. + # - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as + # a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required. + # Use a decimal value. + # - `TRAVEL_SPEED`: The estimated speed of travel derived from the distance + # between the postal code centers of the last card-present transaction and the + # current transaction, divided by the elapsed time. Null if there is no prior + # card-present transaction, if either postal code cannot be geocoded, or if + # elapsed time is zero. Requires `parameters.unit` set to `MPH` or `KPH`. Use a + # decimal value. + # - `DISTANCE_FROM_LAST_TRANSACTION`: The estimated distance between the postal + # code centers of the last card-present transaction and the current transaction. + # Null if there is no prior card-present transaction or if either postal code + # cannot be geocoded. Requires `parameters.unit` set to `MILES` or `KILOMETERS`. + # Use a decimal value. + module Attribute + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MCC = + T.let( + :MCC, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + COUNTRY = + T.let( + :COUNTRY, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + CURRENCY = + T.let( + :CURRENCY, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + MERCHANT_ID = + T.let( + :MERCHANT_ID, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + DESCRIPTOR = + T.let( + :DESCRIPTOR, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + LIABILITY_SHIFT = + T.let( + :LIABILITY_SHIFT, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + PAN_ENTRY_MODE = + T.let( + :PAN_ENTRY_MODE, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + TRANSACTION_AMOUNT = + T.let( + :TRANSACTION_AMOUNT, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + CASH_AMOUNT = + T.let( + :CASH_AMOUNT, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + RISK_SCORE = + T.let( + :RISK_SCORE, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + CARD_TRANSACTION_COUNT_15_M = + T.let( + :CARD_TRANSACTION_COUNT_15M, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + CARD_TRANSACTION_COUNT_1_H = + T.let( + :CARD_TRANSACTION_COUNT_1H, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + CARD_TRANSACTION_COUNT_24_H = + T.let( + :CARD_TRANSACTION_COUNT_24H, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + CARD_DECLINE_COUNT_15_M = + T.let( + :CARD_DECLINE_COUNT_15M, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + CARD_DECLINE_COUNT_1_H = + T.let( + :CARD_DECLINE_COUNT_1H, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + CARD_DECLINE_COUNT_24_H = + T.let( + :CARD_DECLINE_COUNT_24H, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + CARD_STATE = + T.let( + :CARD_STATE, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + PIN_ENTERED = + T.let( + :PIN_ENTERED, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + PIN_STATUS = + T.let( + :PIN_STATUS, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + WALLET_TYPE = + T.let( + :WALLET_TYPE, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + TRANSACTION_INITIATOR = + T.let( + :TRANSACTION_INITIATOR, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + ADDRESS_MATCH = + T.let( + :ADDRESS_MATCH, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + SERVICE_LOCATION_STATE = + T.let( + :SERVICE_LOCATION_STATE, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + SERVICE_LOCATION_POSTAL_CODE = + T.let( + :SERVICE_LOCATION_POSTAL_CODE, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + CARD_AGE = + T.let( + :CARD_AGE, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + ACCOUNT_AGE = + T.let( + :ACCOUNT_AGE, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + AMOUNT_Z_SCORE = + T.let( + :AMOUNT_Z_SCORE, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + AVG_TRANSACTION_AMOUNT = + T.let( + :AVG_TRANSACTION_AMOUNT, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + STDEV_TRANSACTION_AMOUNT = + T.let( + :STDEV_TRANSACTION_AMOUNT, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + IS_NEW_COUNTRY = + T.let( + :IS_NEW_COUNTRY, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + IS_NEW_MCC = + T.let( + :IS_NEW_MCC, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + IS_FIRST_TRANSACTION = + T.let( + :IS_FIRST_TRANSACTION, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + CONSECUTIVE_DECLINES = + T.let( + :CONSECUTIVE_DECLINES, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + TIME_SINCE_LAST_TRANSACTION = + T.let( + :TIME_SINCE_LAST_TRANSACTION, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + DISTINCT_COUNTRY_COUNT = + T.let( + :DISTINCT_COUNTRY_COUNT, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + IS_NEW_MERCHANT = + T.let( + :IS_NEW_MERCHANT, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + THREE_DS_SUCCESS_RATE = + T.let( + :THREE_DS_SUCCESS_RATE, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + TRAVEL_SPEED = + T.let( + :TRAVEL_SPEED, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + DISTANCE_FROM_LAST_TRANSACTION = + T.let( + :DISTANCE_FROM_LAST_TRANSACTION, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Attribute::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Parameters < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters, + Lithic::Internal::AnyHash + ) + end + + # The time window for statistical attributes (`AMOUNT_Z_SCORE`, + # `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for + # all-time history or a specific window (`7D`, `30D`, `90D`). + sig do + returns( + T.nilable( + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval::OrSymbol + ) + ) + end + attr_reader :interval + + sig do + params( + interval: + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval::OrSymbol + ).void + end + attr_writer :interval + + # The entity scope to evaluate the attribute against. + sig do + returns( + T.nilable( + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope::OrSymbol + ) + ) + end + attr_reader :scope + + sig do + params( + scope: + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope::OrSymbol + ).void + end + attr_writer :scope + + # The unit for impossible travel attributes. Required when `attribute` is + # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION`. + # + # For `TRAVEL_SPEED`: `MPH` (miles per hour) or `KPH` (kilometers per hour). + # + # For `DISTANCE_FROM_LAST_TRANSACTION`: `MILES` or `KILOMETERS`. + sig do + returns( + T.nilable( + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Unit::OrSymbol + ) + ) + end + attr_reader :unit + + sig do + params( + unit: + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Unit::OrSymbol + ).void + end + attr_writer :unit + + # Additional parameters for certain attributes. Required when `attribute` is one + # of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`, + # `IS_NEW_COUNTRY`, `IS_NEW_MCC`, `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, + # `TIME_SINCE_LAST_TRANSACTION`, or `DISTINCT_COUNTRY_COUNT` (require `scope`); or + # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`). Not used + # for other attributes. + sig do + params( + interval: + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval::OrSymbol, + scope: + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope::OrSymbol, + unit: + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Unit::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The time window for statistical attributes (`AMOUNT_Z_SCORE`, + # `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for + # all-time history or a specific window (`7D`, `30D`, `90D`). + interval: nil, + # The entity scope to evaluate the attribute against. + scope: nil, + # The unit for impossible travel attributes. Required when `attribute` is + # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION`. + # + # For `TRAVEL_SPEED`: `MPH` (miles per hour) or `KPH` (kilometers per hour). + # + # For `DISTANCE_FROM_LAST_TRANSACTION`: `MILES` or `KILOMETERS`. + unit: nil + ) + end + + sig do + override.returns( + { + interval: + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval::OrSymbol, + scope: + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope::OrSymbol, + unit: + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Unit::OrSymbol + } + ) + end + def to_hash + end + + # The time window for statistical attributes (`AMOUNT_Z_SCORE`, + # `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for + # all-time history or a specific window (`7D`, `30D`, `90D`). + module Interval + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LIFETIME = + T.let( + :LIFETIME, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval::TaggedSymbol + ) + INTERVAL_7_D = + T.let( + :"7D", + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval::TaggedSymbol + ) + INTERVAL_30_D = + T.let( + :"30D", + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval::TaggedSymbol + ) + INTERVAL_90_D = + T.let( + :"90D", + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Interval::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The entity scope to evaluate the attribute against. + module Scope + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CARD = + T.let( + :CARD, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope::TaggedSymbol + ) + ACCOUNT = + T.let( + :ACCOUNT, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope::TaggedSymbol + ) + BUSINESS_ACCOUNT = + T.let( + :BUSINESS_ACCOUNT, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Scope::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The unit for impossible travel attributes. Required when `attribute` is + # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION`. + # + # For `TRAVEL_SPEED`: `MPH` (miles per hour) or `KPH` (kilometers per hour). + # + # For `DISTANCE_FROM_LAST_TRANSACTION`: `MILES` or `KILOMETERS`. + module Unit + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Unit + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MPH = + T.let( + :MPH, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Unit::TaggedSymbol + ) + KPH = + T.let( + :KPH, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Unit::TaggedSymbol + ) + MILES = + T.let( + :MILES, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Unit::TaggedSymbol + ) + KILOMETERS = + T.let( + :KILOMETERS, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Unit::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::Unit::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/conditional_authorization_adjustment_parameters.rbi b/rbi/lithic/models/auth_rules/conditional_authorization_adjustment_parameters.rbi new file mode 100644 index 00000000..0eedd3bc --- /dev/null +++ b/rbi/lithic/models/auth_rules/conditional_authorization_adjustment_parameters.rbi @@ -0,0 +1,1147 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class ConditionalAuthorizationAdjustmentParameters < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters, + Lithic::Internal::AnyHash + ) + end + + # The hold adjustment to apply if the conditions are met. + sig do + returns( + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action + ) + end + attr_reader :action + + sig do + params( + action: + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::OrHash + ).void + end + attr_writer :action + + sig do + returns( + T::Array[ + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition + ] + ) + end + attr_accessor :conditions + + sig do + params( + action: + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::OrHash, + conditions: + T::Array[ + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # The hold adjustment to apply if the conditions are met. + action:, + conditions: + ) + end + + sig do + override.returns( + { + action: + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action, + conditions: + T::Array[ + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition + ] + } + ) + end + def to_hash + end + + class Action < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action, + Lithic::Internal::AnyHash + ) + end + + # The mode of the hold adjustment, determining how the value is interpreted: + # + # - `REPLACE_WITH_AMOUNT`: The value is the approved hold amount in cents. + # - `ADD_PERCENTAGE`: The value adjusts the hold amount by a percentage. 1000 + # represents a 10% increase, 0 represents no change. + # - `ADD_AMOUNT`: The value is added to the hold amount in cents. + sig do + returns( + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::Mode::OrSymbol + ) + end + attr_accessor :mode + + # The type of adjustment to apply + sig do + returns( + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::Type::OrSymbol + ) + end + attr_accessor :type + + # The value used for the hold adjustment, interpreted based on the mode + sig { returns(Integer) } + attr_accessor :value + + # The hold adjustment to apply if the conditions are met. + sig do + params( + mode: + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::Mode::OrSymbol, + type: + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::Type::OrSymbol, + value: Integer + ).returns(T.attached_class) + end + def self.new( + # The mode of the hold adjustment, determining how the value is interpreted: + # + # - `REPLACE_WITH_AMOUNT`: The value is the approved hold amount in cents. + # - `ADD_PERCENTAGE`: The value adjusts the hold amount by a percentage. 1000 + # represents a 10% increase, 0 represents no change. + # - `ADD_AMOUNT`: The value is added to the hold amount in cents. + mode:, + # The type of adjustment to apply + type:, + # The value used for the hold adjustment, interpreted based on the mode + value: + ) + end + + sig do + override.returns( + { + mode: + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::Mode::OrSymbol, + type: + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::Type::OrSymbol, + value: Integer + } + ) + end + def to_hash + end + + # The mode of the hold adjustment, determining how the value is interpreted: + # + # - `REPLACE_WITH_AMOUNT`: The value is the approved hold amount in cents. + # - `ADD_PERCENTAGE`: The value adjusts the hold amount by a percentage. 1000 + # represents a 10% increase, 0 represents no change. + # - `ADD_AMOUNT`: The value is added to the hold amount in cents. + module Mode + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::Mode + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + REPLACE_WITH_AMOUNT = + T.let( + :REPLACE_WITH_AMOUNT, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::Mode::TaggedSymbol + ) + ADD_PERCENTAGE = + T.let( + :ADD_PERCENTAGE, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::Mode::TaggedSymbol + ) + ADD_AMOUNT = + T.let( + :ADD_AMOUNT, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::Mode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::Mode::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The type of adjustment to apply + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + HOLD_ADJUSTMENT = + T.let( + :HOLD_ADJUSTMENT, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Condition < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition, + Lithic::Internal::AnyHash + ) + end + + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + # business by the types of goods or services it provides. + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + # Netherlands Antilles. + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + # the transaction. + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + # (merchant). + # - `DESCRIPTOR`: Short description of card acceptor. + # - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer + # applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + # `TOKEN_AUTHENTICATED`. + # - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number + # (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, + # `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, + # `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, + # `UNKNOWN`, `CREDENTIAL_ON_FILE`, or `ECOMMERCE`. + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + # fee field in the settlement/cardholder billing currency. This is the amount + # the issuer should authorize against unless the issuer is paying the acquirer + # fee on behalf of the cardholder. Use an integer value. + # - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This + # represents the amount of cash being withdrawn or advanced. Use an integer + # value. + # - `RISK_SCORE`: Network-provided score assessing risk level associated with a + # given authorization. Scores are on a range of 0-999, with 0 representing the + # lowest risk and 999 representing the highest risk. For Visa transactions, + # where the raw score has a range of 0-99, Lithic will normalize the score by + # multiplying the raw score by 10x. Use an integer value. + # - `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in the + # trailing 15 minutes before the authorization. Use an integer value. + # - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the + # trailing hour up and until the authorization. Use an integer value. + # - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the + # trailing 24 hours up and until the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_15M`: The number of declined transactions on the card in + # the trailing 15 minutes before the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_1H`: The number of declined transactions on the card in + # the trailing hour up and until the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_24H`: The number of declined transactions on the card in + # the trailing 24 hours up and until the authorization. Use an integer value. + # - `CARD_STATE`: The current state of the card associated with the transaction. + # Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, + # `PENDING_FULFILLMENT`. + # - `PIN_ENTERED`: Indicates whether a PIN was entered during the transaction. + # Valid values are `TRUE`, `FALSE`. + # - `PIN_STATUS`: The current state of card's PIN. Valid values are `NOT_SET`, + # `OK`, `BLOCKED`. + # - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the + # source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, + # `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. + # - `TRANSACTION_INITIATOR`: The entity that initiated the transaction indicates + # the source of the token. Valid values are `CARDHOLDER`, `MERCHANT`, `UNKNOWN`. + # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address + # data with the cardholder KYC data if it exists. Valid values are `MATCH`, + # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`. + # - `SERVICE_LOCATION_STATE`: The state/province code (ISO 3166-2) where the + # cardholder received the service, e.g. "NY". When a service location is present + # in the network data, the service location state is used. Otherwise, falls back + # to the card acceptor state. + # - `SERVICE_LOCATION_POSTAL_CODE`: The postal code where the cardholder received + # the service, e.g. "10001". When a service location is present in the network + # data, the service location postal code is used. Otherwise, falls back to the + # card acceptor postal code. + # - `CARD_AGE`: The age of the card in seconds at the time of the authorization. + # Use an integer value. + # - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time + # of the authorization. Use an integer value. For programs where Lithic does not + # manage or retain account holder data, this attribute does not evaluate. + # - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the + # entity's transaction history. Null if fewer than 30 approved transactions in + # the specified window. Requires `parameters.scope` and `parameters.interval`. + # Use a decimal value. + # - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the + # entity over the specified window, in cents. Requires `parameters.scope` and + # `parameters.interval`. Use a decimal value. + # - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction + # amounts for the entity over the specified window, in cents. Null if fewer than + # 30 approved transactions in the specified window. Requires `parameters.scope` + # and `parameters.interval`. Use a decimal value. + # - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen + # in the entity's transaction history. Valid values are `TRUE`, `FALSE`. + # Requires `parameters.scope`. + # - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's + # transaction history. Valid values are `TRUE`, `FALSE`. Requires + # `parameters.scope`. + # - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity. + # Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`. + # - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for + # the entity over the last 30 days (rolling). Requires `parameters.scope`. Not + # supported for `BUSINESS_ACCOUNT` scope. Use an integer value. + # - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved + # transaction for the entity, rounded to the nearest whole day. Requires + # `parameters.scope`. Use an integer value. + # - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in + # the entity's transaction history. Requires `parameters.scope`. Use an integer + # value. + # - `IS_NEW_MERCHANT`: Whether the card acceptor ID has not been seen in the + # card's approved transaction history (capped at the 1000 most recently seen + # merchants). Valid values are `TRUE`, `FALSE`. Card-scoped only; no + # `parameters` required. + # - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as + # a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required. + # Use a decimal value. + # - `TRAVEL_SPEED`: The estimated speed of travel derived from the distance + # between the postal code centers of the last card-present transaction and the + # current transaction, divided by the elapsed time. Null if there is no prior + # card-present transaction, if either postal code cannot be geocoded, or if + # elapsed time is zero. Requires `parameters.unit` set to `MPH` or `KPH`. Use a + # decimal value. + # - `DISTANCE_FROM_LAST_TRANSACTION`: The estimated distance between the postal + # code centers of the last card-present transaction and the current transaction. + # Null if there is no prior card-present transaction or if either postal code + # cannot be geocoded. Requires `parameters.unit` set to `MILES` or `KILOMETERS`. + # Use a decimal value. + sig do + returns( + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::OrSymbol + ) + end + attr_accessor :attribute + + # The operation to apply to the attribute + sig { returns(Lithic::AuthRules::ConditionalOperation::OrSymbol) } + attr_accessor :operation + + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + sig { returns(Lithic::AuthRules::ConditionalValue::Variants) } + attr_accessor :value + + # Additional parameters for certain attributes. Required when `attribute` is one + # of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`, + # `IS_NEW_COUNTRY`, `IS_NEW_MCC`, `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, + # `TIME_SINCE_LAST_TRANSACTION`, or `DISTINCT_COUNTRY_COUNT` (require `scope`); or + # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`). Not used + # for other attributes. + sig do + returns( + T.nilable( + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters + ) + ) + end + attr_reader :parameters + + sig do + params( + parameters: + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::OrHash + ).void + end + attr_writer :parameters + + sig do + params( + attribute: + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::OrSymbol, + operation: Lithic::AuthRules::ConditionalOperation::OrSymbol, + value: Lithic::AuthRules::ConditionalValue::Variants, + parameters: + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::OrHash + ).returns(T.attached_class) + end + def self.new( + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + # business by the types of goods or services it provides. + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + # Netherlands Antilles. + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + # the transaction. + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + # (merchant). + # - `DESCRIPTOR`: Short description of card acceptor. + # - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer + # applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + # `TOKEN_AUTHENTICATED`. + # - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number + # (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, + # `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, + # `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, + # `UNKNOWN`, `CREDENTIAL_ON_FILE`, or `ECOMMERCE`. + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + # fee field in the settlement/cardholder billing currency. This is the amount + # the issuer should authorize against unless the issuer is paying the acquirer + # fee on behalf of the cardholder. Use an integer value. + # - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This + # represents the amount of cash being withdrawn or advanced. Use an integer + # value. + # - `RISK_SCORE`: Network-provided score assessing risk level associated with a + # given authorization. Scores are on a range of 0-999, with 0 representing the + # lowest risk and 999 representing the highest risk. For Visa transactions, + # where the raw score has a range of 0-99, Lithic will normalize the score by + # multiplying the raw score by 10x. Use an integer value. + # - `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in the + # trailing 15 minutes before the authorization. Use an integer value. + # - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the + # trailing hour up and until the authorization. Use an integer value. + # - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the + # trailing 24 hours up and until the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_15M`: The number of declined transactions on the card in + # the trailing 15 minutes before the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_1H`: The number of declined transactions on the card in + # the trailing hour up and until the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_24H`: The number of declined transactions on the card in + # the trailing 24 hours up and until the authorization. Use an integer value. + # - `CARD_STATE`: The current state of the card associated with the transaction. + # Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, + # `PENDING_FULFILLMENT`. + # - `PIN_ENTERED`: Indicates whether a PIN was entered during the transaction. + # Valid values are `TRUE`, `FALSE`. + # - `PIN_STATUS`: The current state of card's PIN. Valid values are `NOT_SET`, + # `OK`, `BLOCKED`. + # - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the + # source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, + # `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. + # - `TRANSACTION_INITIATOR`: The entity that initiated the transaction indicates + # the source of the token. Valid values are `CARDHOLDER`, `MERCHANT`, `UNKNOWN`. + # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address + # data with the cardholder KYC data if it exists. Valid values are `MATCH`, + # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`. + # - `SERVICE_LOCATION_STATE`: The state/province code (ISO 3166-2) where the + # cardholder received the service, e.g. "NY". When a service location is present + # in the network data, the service location state is used. Otherwise, falls back + # to the card acceptor state. + # - `SERVICE_LOCATION_POSTAL_CODE`: The postal code where the cardholder received + # the service, e.g. "10001". When a service location is present in the network + # data, the service location postal code is used. Otherwise, falls back to the + # card acceptor postal code. + # - `CARD_AGE`: The age of the card in seconds at the time of the authorization. + # Use an integer value. + # - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time + # of the authorization. Use an integer value. For programs where Lithic does not + # manage or retain account holder data, this attribute does not evaluate. + # - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the + # entity's transaction history. Null if fewer than 30 approved transactions in + # the specified window. Requires `parameters.scope` and `parameters.interval`. + # Use a decimal value. + # - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the + # entity over the specified window, in cents. Requires `parameters.scope` and + # `parameters.interval`. Use a decimal value. + # - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction + # amounts for the entity over the specified window, in cents. Null if fewer than + # 30 approved transactions in the specified window. Requires `parameters.scope` + # and `parameters.interval`. Use a decimal value. + # - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen + # in the entity's transaction history. Valid values are `TRUE`, `FALSE`. + # Requires `parameters.scope`. + # - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's + # transaction history. Valid values are `TRUE`, `FALSE`. Requires + # `parameters.scope`. + # - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity. + # Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`. + # - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for + # the entity over the last 30 days (rolling). Requires `parameters.scope`. Not + # supported for `BUSINESS_ACCOUNT` scope. Use an integer value. + # - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved + # transaction for the entity, rounded to the nearest whole day. Requires + # `parameters.scope`. Use an integer value. + # - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in + # the entity's transaction history. Requires `parameters.scope`. Use an integer + # value. + # - `IS_NEW_MERCHANT`: Whether the card acceptor ID has not been seen in the + # card's approved transaction history (capped at the 1000 most recently seen + # merchants). Valid values are `TRUE`, `FALSE`. Card-scoped only; no + # `parameters` required. + # - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as + # a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required. + # Use a decimal value. + # - `TRAVEL_SPEED`: The estimated speed of travel derived from the distance + # between the postal code centers of the last card-present transaction and the + # current transaction, divided by the elapsed time. Null if there is no prior + # card-present transaction, if either postal code cannot be geocoded, or if + # elapsed time is zero. Requires `parameters.unit` set to `MPH` or `KPH`. Use a + # decimal value. + # - `DISTANCE_FROM_LAST_TRANSACTION`: The estimated distance between the postal + # code centers of the last card-present transaction and the current transaction. + # Null if there is no prior card-present transaction or if either postal code + # cannot be geocoded. Requires `parameters.unit` set to `MILES` or `KILOMETERS`. + # Use a decimal value. + attribute:, + # The operation to apply to the attribute + operation:, + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + value:, + # Additional parameters for certain attributes. Required when `attribute` is one + # of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`, + # `IS_NEW_COUNTRY`, `IS_NEW_MCC`, `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, + # `TIME_SINCE_LAST_TRANSACTION`, or `DISTINCT_COUNTRY_COUNT` (require `scope`); or + # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`). Not used + # for other attributes. + parameters: nil + ) + end + + sig do + override.returns( + { + attribute: + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::OrSymbol, + operation: Lithic::AuthRules::ConditionalOperation::OrSymbol, + value: Lithic::AuthRules::ConditionalValue::Variants, + parameters: + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters + } + ) + end + def to_hash + end + + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + # business by the types of goods or services it provides. + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + # Netherlands Antilles. + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + # the transaction. + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + # (merchant). + # - `DESCRIPTOR`: Short description of card acceptor. + # - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer + # applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + # `TOKEN_AUTHENTICATED`. + # - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number + # (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, + # `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, + # `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, + # `UNKNOWN`, `CREDENTIAL_ON_FILE`, or `ECOMMERCE`. + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + # fee field in the settlement/cardholder billing currency. This is the amount + # the issuer should authorize against unless the issuer is paying the acquirer + # fee on behalf of the cardholder. Use an integer value. + # - `CASH_AMOUNT`: The cash amount of the transaction in minor units (cents). This + # represents the amount of cash being withdrawn or advanced. Use an integer + # value. + # - `RISK_SCORE`: Network-provided score assessing risk level associated with a + # given authorization. Scores are on a range of 0-999, with 0 representing the + # lowest risk and 999 representing the highest risk. For Visa transactions, + # where the raw score has a range of 0-99, Lithic will normalize the score by + # multiplying the raw score by 10x. Use an integer value. + # - `CARD_TRANSACTION_COUNT_15M`: The number of transactions on the card in the + # trailing 15 minutes before the authorization. Use an integer value. + # - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the + # trailing hour up and until the authorization. Use an integer value. + # - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the + # trailing 24 hours up and until the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_15M`: The number of declined transactions on the card in + # the trailing 15 minutes before the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_1H`: The number of declined transactions on the card in + # the trailing hour up and until the authorization. Use an integer value. + # - `CARD_DECLINE_COUNT_24H`: The number of declined transactions on the card in + # the trailing 24 hours up and until the authorization. Use an integer value. + # - `CARD_STATE`: The current state of the card associated with the transaction. + # Valid values are `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, + # `PENDING_FULFILLMENT`. + # - `PIN_ENTERED`: Indicates whether a PIN was entered during the transaction. + # Valid values are `TRUE`, `FALSE`. + # - `PIN_STATUS`: The current state of card's PIN. Valid values are `NOT_SET`, + # `OK`, `BLOCKED`. + # - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the + # source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, + # `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. + # - `TRANSACTION_INITIATOR`: The entity that initiated the transaction indicates + # the source of the token. Valid values are `CARDHOLDER`, `MERCHANT`, `UNKNOWN`. + # - `ADDRESS_MATCH`: Lithic's evaluation result comparing transaction's address + # data with the cardholder KYC data if it exists. Valid values are `MATCH`, + # `MATCH_ADDRESS_ONLY`, `MATCH_ZIP_ONLY`,`MISMATCH`,`NOT_PRESENT`. + # - `SERVICE_LOCATION_STATE`: The state/province code (ISO 3166-2) where the + # cardholder received the service, e.g. "NY". When a service location is present + # in the network data, the service location state is used. Otherwise, falls back + # to the card acceptor state. + # - `SERVICE_LOCATION_POSTAL_CODE`: The postal code where the cardholder received + # the service, e.g. "10001". When a service location is present in the network + # data, the service location postal code is used. Otherwise, falls back to the + # card acceptor postal code. + # - `CARD_AGE`: The age of the card in seconds at the time of the authorization. + # Use an integer value. + # - `ACCOUNT_AGE`: The age of the account holder's account in seconds at the time + # of the authorization. Use an integer value. For programs where Lithic does not + # manage or retain account holder data, this attribute does not evaluate. + # - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the + # entity's transaction history. Null if fewer than 30 approved transactions in + # the specified window. Requires `parameters.scope` and `parameters.interval`. + # Use a decimal value. + # - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the + # entity over the specified window, in cents. Requires `parameters.scope` and + # `parameters.interval`. Use a decimal value. + # - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction + # amounts for the entity over the specified window, in cents. Null if fewer than + # 30 approved transactions in the specified window. Requires `parameters.scope` + # and `parameters.interval`. Use a decimal value. + # - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen + # in the entity's transaction history. Valid values are `TRUE`, `FALSE`. + # Requires `parameters.scope`. + # - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's + # transaction history. Valid values are `TRUE`, `FALSE`. Requires + # `parameters.scope`. + # - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity. + # Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`. + # - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for + # the entity over the last 30 days (rolling). Requires `parameters.scope`. Not + # supported for `BUSINESS_ACCOUNT` scope. Use an integer value. + # - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved + # transaction for the entity, rounded to the nearest whole day. Requires + # `parameters.scope`. Use an integer value. + # - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in + # the entity's transaction history. Requires `parameters.scope`. Use an integer + # value. + # - `IS_NEW_MERCHANT`: Whether the card acceptor ID has not been seen in the + # card's approved transaction history (capped at the 1000 most recently seen + # merchants). Valid values are `TRUE`, `FALSE`. Card-scoped only; no + # `parameters` required. + # - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as + # a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required. + # Use a decimal value. + # - `TRAVEL_SPEED`: The estimated speed of travel derived from the distance + # between the postal code centers of the last card-present transaction and the + # current transaction, divided by the elapsed time. Null if there is no prior + # card-present transaction, if either postal code cannot be geocoded, or if + # elapsed time is zero. Requires `parameters.unit` set to `MPH` or `KPH`. Use a + # decimal value. + # - `DISTANCE_FROM_LAST_TRANSACTION`: The estimated distance between the postal + # code centers of the last card-present transaction and the current transaction. + # Null if there is no prior card-present transaction or if either postal code + # cannot be geocoded. Requires `parameters.unit` set to `MILES` or `KILOMETERS`. + # Use a decimal value. + module Attribute + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MCC = + T.let( + :MCC, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + COUNTRY = + T.let( + :COUNTRY, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + CURRENCY = + T.let( + :CURRENCY, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + MERCHANT_ID = + T.let( + :MERCHANT_ID, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + DESCRIPTOR = + T.let( + :DESCRIPTOR, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + LIABILITY_SHIFT = + T.let( + :LIABILITY_SHIFT, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + PAN_ENTRY_MODE = + T.let( + :PAN_ENTRY_MODE, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + TRANSACTION_AMOUNT = + T.let( + :TRANSACTION_AMOUNT, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + CASH_AMOUNT = + T.let( + :CASH_AMOUNT, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + RISK_SCORE = + T.let( + :RISK_SCORE, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + CARD_TRANSACTION_COUNT_15_M = + T.let( + :CARD_TRANSACTION_COUNT_15M, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + CARD_TRANSACTION_COUNT_1_H = + T.let( + :CARD_TRANSACTION_COUNT_1H, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + CARD_TRANSACTION_COUNT_24_H = + T.let( + :CARD_TRANSACTION_COUNT_24H, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + CARD_DECLINE_COUNT_15_M = + T.let( + :CARD_DECLINE_COUNT_15M, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + CARD_DECLINE_COUNT_1_H = + T.let( + :CARD_DECLINE_COUNT_1H, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + CARD_DECLINE_COUNT_24_H = + T.let( + :CARD_DECLINE_COUNT_24H, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + CARD_STATE = + T.let( + :CARD_STATE, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + PIN_ENTERED = + T.let( + :PIN_ENTERED, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + PIN_STATUS = + T.let( + :PIN_STATUS, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + WALLET_TYPE = + T.let( + :WALLET_TYPE, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + TRANSACTION_INITIATOR = + T.let( + :TRANSACTION_INITIATOR, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + ADDRESS_MATCH = + T.let( + :ADDRESS_MATCH, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + SERVICE_LOCATION_STATE = + T.let( + :SERVICE_LOCATION_STATE, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + SERVICE_LOCATION_POSTAL_CODE = + T.let( + :SERVICE_LOCATION_POSTAL_CODE, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + CARD_AGE = + T.let( + :CARD_AGE, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + ACCOUNT_AGE = + T.let( + :ACCOUNT_AGE, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + AMOUNT_Z_SCORE = + T.let( + :AMOUNT_Z_SCORE, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + AVG_TRANSACTION_AMOUNT = + T.let( + :AVG_TRANSACTION_AMOUNT, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + STDEV_TRANSACTION_AMOUNT = + T.let( + :STDEV_TRANSACTION_AMOUNT, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + IS_NEW_COUNTRY = + T.let( + :IS_NEW_COUNTRY, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + IS_NEW_MCC = + T.let( + :IS_NEW_MCC, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + IS_FIRST_TRANSACTION = + T.let( + :IS_FIRST_TRANSACTION, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + CONSECUTIVE_DECLINES = + T.let( + :CONSECUTIVE_DECLINES, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + TIME_SINCE_LAST_TRANSACTION = + T.let( + :TIME_SINCE_LAST_TRANSACTION, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + DISTINCT_COUNTRY_COUNT = + T.let( + :DISTINCT_COUNTRY_COUNT, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + IS_NEW_MERCHANT = + T.let( + :IS_NEW_MERCHANT, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + THREE_DS_SUCCESS_RATE = + T.let( + :THREE_DS_SUCCESS_RATE, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + TRAVEL_SPEED = + T.let( + :TRAVEL_SPEED, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + DISTANCE_FROM_LAST_TRANSACTION = + T.let( + :DISTANCE_FROM_LAST_TRANSACTION, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Attribute::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Parameters < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters, + Lithic::Internal::AnyHash + ) + end + + # The time window for statistical attributes (`AMOUNT_Z_SCORE`, + # `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for + # all-time history or a specific window (`7D`, `30D`, `90D`). + sig do + returns( + T.nilable( + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Interval::OrSymbol + ) + ) + end + attr_reader :interval + + sig do + params( + interval: + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Interval::OrSymbol + ).void + end + attr_writer :interval + + # The entity scope to evaluate the attribute against. + sig do + returns( + T.nilable( + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Scope::OrSymbol + ) + ) + end + attr_reader :scope + + sig do + params( + scope: + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Scope::OrSymbol + ).void + end + attr_writer :scope + + # The unit for impossible travel attributes. Required when `attribute` is + # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION`. + # + # For `TRAVEL_SPEED`: `MPH` (miles per hour) or `KPH` (kilometers per hour). + # + # For `DISTANCE_FROM_LAST_TRANSACTION`: `MILES` or `KILOMETERS`. + sig do + returns( + T.nilable( + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Unit::OrSymbol + ) + ) + end + attr_reader :unit + + sig do + params( + unit: + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Unit::OrSymbol + ).void + end + attr_writer :unit + + # Additional parameters for certain attributes. Required when `attribute` is one + # of `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`, + # `IS_NEW_COUNTRY`, `IS_NEW_MCC`, `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, + # `TIME_SINCE_LAST_TRANSACTION`, or `DISTINCT_COUNTRY_COUNT` (require `scope`); or + # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`). Not used + # for other attributes. + sig do + params( + interval: + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Interval::OrSymbol, + scope: + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Scope::OrSymbol, + unit: + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Unit::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The time window for statistical attributes (`AMOUNT_Z_SCORE`, + # `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for + # all-time history or a specific window (`7D`, `30D`, `90D`). + interval: nil, + # The entity scope to evaluate the attribute against. + scope: nil, + # The unit for impossible travel attributes. Required when `attribute` is + # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION`. + # + # For `TRAVEL_SPEED`: `MPH` (miles per hour) or `KPH` (kilometers per hour). + # + # For `DISTANCE_FROM_LAST_TRANSACTION`: `MILES` or `KILOMETERS`. + unit: nil + ) + end + + sig do + override.returns( + { + interval: + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Interval::OrSymbol, + scope: + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Scope::OrSymbol, + unit: + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Unit::OrSymbol + } + ) + end + def to_hash + end + + # The time window for statistical attributes (`AMOUNT_Z_SCORE`, + # `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for + # all-time history or a specific window (`7D`, `30D`, `90D`). + module Interval + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Interval + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LIFETIME = + T.let( + :LIFETIME, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Interval::TaggedSymbol + ) + INTERVAL_7_D = + T.let( + :"7D", + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Interval::TaggedSymbol + ) + INTERVAL_30_D = + T.let( + :"30D", + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Interval::TaggedSymbol + ) + INTERVAL_90_D = + T.let( + :"90D", + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Interval::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Interval::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The entity scope to evaluate the attribute against. + module Scope + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Scope + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CARD = + T.let( + :CARD, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Scope::TaggedSymbol + ) + ACCOUNT = + T.let( + :ACCOUNT, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Scope::TaggedSymbol + ) + BUSINESS_ACCOUNT = + T.let( + :BUSINESS_ACCOUNT, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Scope::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Scope::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The unit for impossible travel attributes. Required when `attribute` is + # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION`. + # + # For `TRAVEL_SPEED`: `MPH` (miles per hour) or `KPH` (kilometers per hour). + # + # For `DISTANCE_FROM_LAST_TRANSACTION`: `MILES` or `KILOMETERS`. + module Unit + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Unit + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MPH = + T.let( + :MPH, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Unit::TaggedSymbol + ) + KPH = + T.let( + :KPH, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Unit::TaggedSymbol + ) + MILES = + T.let( + :MILES, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Unit::TaggedSymbol + ) + KILOMETERS = + T.let( + :KILOMETERS, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Unit::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::Unit::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/conditional_block_parameters.rbi b/rbi/lithic/models/auth_rules/conditional_block_parameters.rbi new file mode 100644 index 00000000..72f4885a --- /dev/null +++ b/rbi/lithic/models/auth_rules/conditional_block_parameters.rbi @@ -0,0 +1,37 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class ConditionalBlockParameters < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::ConditionalBlockParameters, + Lithic::Internal::AnyHash + ) + end + + sig { returns(T::Array[Lithic::AuthRules::AuthRuleCondition]) } + attr_accessor :conditions + + # Deprecated: Use CONDITIONAL_ACTION instead. + sig do + params( + conditions: T::Array[Lithic::AuthRules::AuthRuleCondition::OrHash] + ).returns(T.attached_class) + end + def self.new(conditions:) + end + + sig do + override.returns( + { conditions: T::Array[Lithic::AuthRules::AuthRuleCondition] } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/conditional_card_transaction_update_action_parameters.rbi b/rbi/lithic/models/auth_rules/conditional_card_transaction_update_action_parameters.rbi new file mode 100644 index 00000000..11befbb1 --- /dev/null +++ b/rbi/lithic/models/auth_rules/conditional_card_transaction_update_action_parameters.rbi @@ -0,0 +1,962 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class ConditionalCardTransactionUpdateActionParameters < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters, + Lithic::Internal::AnyHash + ) + end + + # The action to take if the conditions are met. + sig do + returns( + T.any( + Lithic::AuthRules::CardTransactionUpdateAction::TagAction, + Lithic::AuthRules::CardTransactionUpdateAction::CreateCaseAction + ) + ) + end + attr_accessor :action + + sig do + returns( + T::Array[ + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition + ] + ) + end + attr_accessor :conditions + + sig do + params( + action: + T.any( + Lithic::AuthRules::CardTransactionUpdateAction::TagAction::OrHash, + Lithic::AuthRules::CardTransactionUpdateAction::CreateCaseAction::OrHash + ), + conditions: + T::Array[ + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # The action to take if the conditions are met. + action:, + conditions: + ) + end + + sig do + override.returns( + { + action: + T.any( + Lithic::AuthRules::CardTransactionUpdateAction::TagAction, + Lithic::AuthRules::CardTransactionUpdateAction::CreateCaseAction + ), + conditions: + T::Array[ + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition + ] + } + ) + end + def to_hash + end + + class Condition < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition, + Lithic::Internal::AnyHash + ) + end + + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + # business by the types of goods or services it provides. + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + # Netherlands Antilles. + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + # the transaction. + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + # (merchant). + # - `DESCRIPTOR`: Short description of card acceptor. + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + # fee field in the settlement/cardholder billing currency. This is the amount + # the issuer should authorize against unless the issuer is paying the acquirer + # fee on behalf of the cardholder. Use an integer value. + # - `RISK_SCORE`: Network-provided score assessing risk level associated with a + # given authorization. Scores are on a range of 0-999, with 0 representing the + # lowest risk and 999 representing the highest risk. For Visa transactions, + # where the raw score has a range of 0-99, Lithic will normalize the score by + # multiplying the raw score by 10x. Use an integer value. + # - `TRANSACTION_STATUS`: The status of the transaction. Valid values are + # `PENDING`, `VOIDED`, `SETTLING`, `SETTLED`, `BOUNCED`, `RETURNED`, `DECLINED`, + # `EXPIRED`. + # - `LAST_EVENT_TYPE`: The type of the most recent event on the transaction. Valid + # values are `AUTHORIZATION`, `AUTHORIZATION_ADVICE`, `AUTHORIZATION_EXPIRY`, + # `AUTHORIZATION_REVERSAL`, `BALANCE_INQUIRY`, `CLEARING`, `CORRECTION_CREDIT`, + # `CORRECTION_DEBIT`, `CREDIT_AUTHORIZATION`, `CREDIT_AUTHORIZATION_ADVICE`, + # `FINANCIAL_AUTHORIZATION`, `FINANCIAL_CREDIT_AUTHORIZATION`, `RETURN`, + # `RETURN_REVERSAL`. + # - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer + # applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + # `TOKEN_AUTHENTICATED`. + # - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number + # (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, + # `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, + # `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, + # `UNKNOWN`, or `CREDENTIAL_ON_FILE`. + # - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the + # source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, + # `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. + # - `CARD_AGE`: The age of the card in seconds at the time of the transaction. Use + # an integer value. + # - `ACCOUNT_AGE`: The age of the account in seconds at the time of the + # transaction. Use an integer value. For programs where Lithic does not manage + # or retain account holder data, this attribute does not evaluate. + # - `SPEND_VELOCITY_COUNT`: The number of transactions matching the specified + # filters within the given period. Requires `parameters` with `scope`, `period`, + # and optional `filters`. Use an integer value. + # - `SPEND_VELOCITY_AMOUNT`: The total spend amount (in cents) of transactions + # matching the specified filters within the given period. Requires `parameters` + # with `scope`, `period`, and optional `filters`. Use an integer value. + # - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the + # entity's transaction history. Null if fewer than 30 approved transactions in + # the specified window. Requires `parameters.scope` and `parameters.interval`. + # Use a decimal value. + # - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the + # entity over the specified window, in cents. Requires `parameters.scope` and + # `parameters.interval`. Use a decimal value. + # - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction + # amounts for the entity over the specified window, in cents. Null if fewer than + # 30 approved transactions in the specified window. Requires `parameters.scope` + # and `parameters.interval`. Use a decimal value. + # - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen + # in the entity's transaction history. Valid values are `TRUE`, `FALSE`. + # Requires `parameters.scope`. + # - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's + # transaction history. Valid values are `TRUE`, `FALSE`. Requires + # `parameters.scope`. + # - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity. + # Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`. + # - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for + # the entity over the last 30 days (rolling). Requires `parameters.scope`. Use + # an integer value. + # - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved + # transaction for the entity, rounded to the nearest whole day. Requires + # `parameters.scope`. Use an integer value. + # - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in + # the entity's transaction history. Requires `parameters.scope`. Use an integer + # value. + # - `IS_NEW_MERCHANT`: Whether the card acceptor ID has not been seen in the + # card's approved transaction history (capped at the 1000 most recently seen + # merchants). Valid values are `TRUE`, `FALSE`. Card-scoped only; no + # `parameters` required. + # - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as + # a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required. + # Use a decimal value. + # - `TRAVEL_SPEED`: The estimated speed of travel derived from the distance + # between the postal code centers of the last card-present transaction and the + # current transaction, divided by the elapsed time. Null if there is no prior + # card-present transaction, if either postal code cannot be geocoded, or if + # elapsed time is zero. Requires `parameters.unit` set to `MPH` or `KPH`. Use a + # decimal value. + # - `DISTANCE_FROM_LAST_TRANSACTION`: The estimated distance between the postal + # code centers of the last card-present transaction and the current transaction. + # Null if there is no prior card-present transaction or if either postal code + # cannot be geocoded. Requires `parameters.unit` set to `MILES` or `KILOMETERS`. + # Use a decimal value. + sig do + returns( + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::OrSymbol + ) + end + attr_accessor :attribute + + # The operation to apply to the attribute + sig { returns(Lithic::AuthRules::ConditionalOperation::OrSymbol) } + attr_accessor :operation + + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + sig { returns(Lithic::AuthRules::ConditionalValue::Variants) } + attr_accessor :value + + # Additional parameters for certain attributes. Required when `attribute` is + # `SPEND_VELOCITY_COUNT` or `SPEND_VELOCITY_AMOUNT` (require `scope`, `period`, + # and optional `filters`); `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, + # `STDEV_TRANSACTION_AMOUNT`, `IS_NEW_COUNTRY`, `IS_NEW_MCC`, + # `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, `TIME_SINCE_LAST_TRANSACTION`, + # or `DISTINCT_COUNTRY_COUNT` (require `scope`, and additionally `interval` for + # the statistical attributes); or `TRAVEL_SPEED` or + # `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`). Not used for other + # attributes. + sig do + returns( + T.nilable( + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters + ) + ) + end + attr_reader :parameters + + sig do + params( + parameters: + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::OrHash + ).void + end + attr_writer :parameters + + sig do + params( + attribute: + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::OrSymbol, + operation: Lithic::AuthRules::ConditionalOperation::OrSymbol, + value: Lithic::AuthRules::ConditionalValue::Variants, + parameters: + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::OrHash + ).returns(T.attached_class) + end + def self.new( + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + # business by the types of goods or services it provides. + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + # Netherlands Antilles. + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + # the transaction. + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + # (merchant). + # - `DESCRIPTOR`: Short description of card acceptor. + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + # fee field in the settlement/cardholder billing currency. This is the amount + # the issuer should authorize against unless the issuer is paying the acquirer + # fee on behalf of the cardholder. Use an integer value. + # - `RISK_SCORE`: Network-provided score assessing risk level associated with a + # given authorization. Scores are on a range of 0-999, with 0 representing the + # lowest risk and 999 representing the highest risk. For Visa transactions, + # where the raw score has a range of 0-99, Lithic will normalize the score by + # multiplying the raw score by 10x. Use an integer value. + # - `TRANSACTION_STATUS`: The status of the transaction. Valid values are + # `PENDING`, `VOIDED`, `SETTLING`, `SETTLED`, `BOUNCED`, `RETURNED`, `DECLINED`, + # `EXPIRED`. + # - `LAST_EVENT_TYPE`: The type of the most recent event on the transaction. Valid + # values are `AUTHORIZATION`, `AUTHORIZATION_ADVICE`, `AUTHORIZATION_EXPIRY`, + # `AUTHORIZATION_REVERSAL`, `BALANCE_INQUIRY`, `CLEARING`, `CORRECTION_CREDIT`, + # `CORRECTION_DEBIT`, `CREDIT_AUTHORIZATION`, `CREDIT_AUTHORIZATION_ADVICE`, + # `FINANCIAL_AUTHORIZATION`, `FINANCIAL_CREDIT_AUTHORIZATION`, `RETURN`, + # `RETURN_REVERSAL`. + # - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer + # applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + # `TOKEN_AUTHENTICATED`. + # - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number + # (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, + # `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, + # `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, + # `UNKNOWN`, or `CREDENTIAL_ON_FILE`. + # - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the + # source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, + # `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. + # - `CARD_AGE`: The age of the card in seconds at the time of the transaction. Use + # an integer value. + # - `ACCOUNT_AGE`: The age of the account in seconds at the time of the + # transaction. Use an integer value. For programs where Lithic does not manage + # or retain account holder data, this attribute does not evaluate. + # - `SPEND_VELOCITY_COUNT`: The number of transactions matching the specified + # filters within the given period. Requires `parameters` with `scope`, `period`, + # and optional `filters`. Use an integer value. + # - `SPEND_VELOCITY_AMOUNT`: The total spend amount (in cents) of transactions + # matching the specified filters within the given period. Requires `parameters` + # with `scope`, `period`, and optional `filters`. Use an integer value. + # - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the + # entity's transaction history. Null if fewer than 30 approved transactions in + # the specified window. Requires `parameters.scope` and `parameters.interval`. + # Use a decimal value. + # - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the + # entity over the specified window, in cents. Requires `parameters.scope` and + # `parameters.interval`. Use a decimal value. + # - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction + # amounts for the entity over the specified window, in cents. Null if fewer than + # 30 approved transactions in the specified window. Requires `parameters.scope` + # and `parameters.interval`. Use a decimal value. + # - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen + # in the entity's transaction history. Valid values are `TRUE`, `FALSE`. + # Requires `parameters.scope`. + # - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's + # transaction history. Valid values are `TRUE`, `FALSE`. Requires + # `parameters.scope`. + # - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity. + # Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`. + # - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for + # the entity over the last 30 days (rolling). Requires `parameters.scope`. Use + # an integer value. + # - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved + # transaction for the entity, rounded to the nearest whole day. Requires + # `parameters.scope`. Use an integer value. + # - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in + # the entity's transaction history. Requires `parameters.scope`. Use an integer + # value. + # - `IS_NEW_MERCHANT`: Whether the card acceptor ID has not been seen in the + # card's approved transaction history (capped at the 1000 most recently seen + # merchants). Valid values are `TRUE`, `FALSE`. Card-scoped only; no + # `parameters` required. + # - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as + # a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required. + # Use a decimal value. + # - `TRAVEL_SPEED`: The estimated speed of travel derived from the distance + # between the postal code centers of the last card-present transaction and the + # current transaction, divided by the elapsed time. Null if there is no prior + # card-present transaction, if either postal code cannot be geocoded, or if + # elapsed time is zero. Requires `parameters.unit` set to `MPH` or `KPH`. Use a + # decimal value. + # - `DISTANCE_FROM_LAST_TRANSACTION`: The estimated distance between the postal + # code centers of the last card-present transaction and the current transaction. + # Null if there is no prior card-present transaction or if either postal code + # cannot be geocoded. Requires `parameters.unit` set to `MILES` or `KILOMETERS`. + # Use a decimal value. + attribute:, + # The operation to apply to the attribute + operation:, + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + value:, + # Additional parameters for certain attributes. Required when `attribute` is + # `SPEND_VELOCITY_COUNT` or `SPEND_VELOCITY_AMOUNT` (require `scope`, `period`, + # and optional `filters`); `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, + # `STDEV_TRANSACTION_AMOUNT`, `IS_NEW_COUNTRY`, `IS_NEW_MCC`, + # `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, `TIME_SINCE_LAST_TRANSACTION`, + # or `DISTINCT_COUNTRY_COUNT` (require `scope`, and additionally `interval` for + # the statistical attributes); or `TRAVEL_SPEED` or + # `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`). Not used for other + # attributes. + parameters: nil + ) + end + + sig do + override.returns( + { + attribute: + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::OrSymbol, + operation: Lithic::AuthRules::ConditionalOperation::OrSymbol, + value: Lithic::AuthRules::ConditionalValue::Variants, + parameters: + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters + } + ) + end + def to_hash + end + + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `MCC`: A four-digit number listed in ISO 18245. An MCC is used to classify a + # business by the types of goods or services it provides. + # - `COUNTRY`: Country of entity of card acceptor. Possible values are: (1) all + # ISO 3166-1 alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for + # Netherlands Antilles. + # - `CURRENCY`: 3-character alphabetic ISO 4217 code for the merchant currency of + # the transaction. + # - `MERCHANT_ID`: Unique alphanumeric identifier for the payment card acceptor + # (merchant). + # - `DESCRIPTOR`: Short description of card acceptor. + # - `TRANSACTION_AMOUNT`: The base transaction amount (in cents) plus the acquirer + # fee field in the settlement/cardholder billing currency. This is the amount + # the issuer should authorize against unless the issuer is paying the acquirer + # fee on behalf of the cardholder. Use an integer value. + # - `RISK_SCORE`: Network-provided score assessing risk level associated with a + # given authorization. Scores are on a range of 0-999, with 0 representing the + # lowest risk and 999 representing the highest risk. For Visa transactions, + # where the raw score has a range of 0-99, Lithic will normalize the score by + # multiplying the raw score by 10x. Use an integer value. + # - `TRANSACTION_STATUS`: The status of the transaction. Valid values are + # `PENDING`, `VOIDED`, `SETTLING`, `SETTLED`, `BOUNCED`, `RETURNED`, `DECLINED`, + # `EXPIRED`. + # - `LAST_EVENT_TYPE`: The type of the most recent event on the transaction. Valid + # values are `AUTHORIZATION`, `AUTHORIZATION_ADVICE`, `AUTHORIZATION_EXPIRY`, + # `AUTHORIZATION_REVERSAL`, `BALANCE_INQUIRY`, `CLEARING`, `CORRECTION_CREDIT`, + # `CORRECTION_DEBIT`, `CREDIT_AUTHORIZATION`, `CREDIT_AUTHORIZATION_ADVICE`, + # `FINANCIAL_AUTHORIZATION`, `FINANCIAL_CREDIT_AUTHORIZATION`, `RETURN`, + # `RETURN_REVERSAL`. + # - `LIABILITY_SHIFT`: Indicates whether chargeback liability shift to the issuer + # applies to the transaction. Valid values are `NONE`, `3DS_AUTHENTICATED`, or + # `TOKEN_AUTHENTICATED`. + # - `PAN_ENTRY_MODE`: The method by which the cardholder's primary account number + # (PAN) was entered. Valid values are `AUTO_ENTRY`, `BAR_CODE`, `CONTACTLESS`, + # `ECOMMERCE`, `ERROR_KEYED`, `ERROR_MAGNETIC_STRIPE`, `ICC`, `KEY_ENTERED`, + # `MAGNETIC_STRIPE`, `MANUAL`, `OCR`, `SECURE_CARDLESS`, `UNSPECIFIED`, + # `UNKNOWN`, or `CREDENTIAL_ON_FILE`. + # - `WALLET_TYPE`: For transactions using a digital wallet token, indicates the + # source of the token. Valid values are `APPLE_PAY`, `GOOGLE_PAY`, + # `SAMSUNG_PAY`, `MASTERPASS`, `MERCHANT`, `OTHER`, `NONE`. + # - `CARD_AGE`: The age of the card in seconds at the time of the transaction. Use + # an integer value. + # - `ACCOUNT_AGE`: The age of the account in seconds at the time of the + # transaction. Use an integer value. For programs where Lithic does not manage + # or retain account holder data, this attribute does not evaluate. + # - `SPEND_VELOCITY_COUNT`: The number of transactions matching the specified + # filters within the given period. Requires `parameters` with `scope`, `period`, + # and optional `filters`. Use an integer value. + # - `SPEND_VELOCITY_AMOUNT`: The total spend amount (in cents) of transactions + # matching the specified filters within the given period. Requires `parameters` + # with `scope`, `period`, and optional `filters`. Use an integer value. + # - `AMOUNT_Z_SCORE`: The z-score of the transaction amount relative to the + # entity's transaction history. Null if fewer than 30 approved transactions in + # the specified window. Requires `parameters.scope` and `parameters.interval`. + # Use a decimal value. + # - `AVG_TRANSACTION_AMOUNT`: The average approved transaction amount for the + # entity over the specified window, in cents. Requires `parameters.scope` and + # `parameters.interval`. Use a decimal value. + # - `STDEV_TRANSACTION_AMOUNT`: The standard deviation of approved transaction + # amounts for the entity over the specified window, in cents. Null if fewer than + # 30 approved transactions in the specified window. Requires `parameters.scope` + # and `parameters.interval`. Use a decimal value. + # - `IS_NEW_COUNTRY`: Whether the transaction's merchant country has not been seen + # in the entity's transaction history. Valid values are `TRUE`, `FALSE`. + # Requires `parameters.scope`. + # - `IS_NEW_MCC`: Whether the transaction's MCC has not been seen in the entity's + # transaction history. Valid values are `TRUE`, `FALSE`. Requires + # `parameters.scope`. + # - `IS_FIRST_TRANSACTION`: Whether this is the first transaction for the entity. + # Valid values are `TRUE`, `FALSE`. Requires `parameters.scope`. + # - `CONSECUTIVE_DECLINES`: The number of consecutive declined transactions for + # the entity over the last 30 days (rolling). Requires `parameters.scope`. Use + # an integer value. + # - `TIME_SINCE_LAST_TRANSACTION`: The number of days since the last approved + # transaction for the entity, rounded to the nearest whole day. Requires + # `parameters.scope`. Use an integer value. + # - `DISTINCT_COUNTRY_COUNT`: The number of distinct merchant countries seen in + # the entity's transaction history. Requires `parameters.scope`. Use an integer + # value. + # - `IS_NEW_MERCHANT`: Whether the card acceptor ID has not been seen in the + # card's approved transaction history (capped at the 1000 most recently seen + # merchants). Valid values are `TRUE`, `FALSE`. Card-scoped only; no + # `parameters` required. + # - `THREE_DS_SUCCESS_RATE`: The 3DS authentication success rate for the card, as + # a percentage from 0.0 to 100.0. Card-scoped only; no `parameters` required. + # Use a decimal value. + # - `TRAVEL_SPEED`: The estimated speed of travel derived from the distance + # between the postal code centers of the last card-present transaction and the + # current transaction, divided by the elapsed time. Null if there is no prior + # card-present transaction, if either postal code cannot be geocoded, or if + # elapsed time is zero. Requires `parameters.unit` set to `MPH` or `KPH`. Use a + # decimal value. + # - `DISTANCE_FROM_LAST_TRANSACTION`: The estimated distance between the postal + # code centers of the last card-present transaction and the current transaction. + # Null if there is no prior card-present transaction or if either postal code + # cannot be geocoded. Requires `parameters.unit` set to `MILES` or `KILOMETERS`. + # Use a decimal value. + module Attribute + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MCC = + T.let( + :MCC, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ) + COUNTRY = + T.let( + :COUNTRY, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ) + CURRENCY = + T.let( + :CURRENCY, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ) + MERCHANT_ID = + T.let( + :MERCHANT_ID, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ) + DESCRIPTOR = + T.let( + :DESCRIPTOR, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ) + TRANSACTION_AMOUNT = + T.let( + :TRANSACTION_AMOUNT, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ) + RISK_SCORE = + T.let( + :RISK_SCORE, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ) + TRANSACTION_STATUS = + T.let( + :TRANSACTION_STATUS, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ) + LAST_EVENT_TYPE = + T.let( + :LAST_EVENT_TYPE, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ) + LIABILITY_SHIFT = + T.let( + :LIABILITY_SHIFT, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ) + PAN_ENTRY_MODE = + T.let( + :PAN_ENTRY_MODE, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ) + WALLET_TYPE = + T.let( + :WALLET_TYPE, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ) + CARD_AGE = + T.let( + :CARD_AGE, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ) + ACCOUNT_AGE = + T.let( + :ACCOUNT_AGE, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ) + SPEND_VELOCITY_COUNT = + T.let( + :SPEND_VELOCITY_COUNT, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ) + SPEND_VELOCITY_AMOUNT = + T.let( + :SPEND_VELOCITY_AMOUNT, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ) + AMOUNT_Z_SCORE = + T.let( + :AMOUNT_Z_SCORE, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ) + AVG_TRANSACTION_AMOUNT = + T.let( + :AVG_TRANSACTION_AMOUNT, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ) + STDEV_TRANSACTION_AMOUNT = + T.let( + :STDEV_TRANSACTION_AMOUNT, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ) + IS_NEW_COUNTRY = + T.let( + :IS_NEW_COUNTRY, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ) + IS_NEW_MCC = + T.let( + :IS_NEW_MCC, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ) + IS_FIRST_TRANSACTION = + T.let( + :IS_FIRST_TRANSACTION, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ) + CONSECUTIVE_DECLINES = + T.let( + :CONSECUTIVE_DECLINES, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ) + TIME_SINCE_LAST_TRANSACTION = + T.let( + :TIME_SINCE_LAST_TRANSACTION, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ) + DISTINCT_COUNTRY_COUNT = + T.let( + :DISTINCT_COUNTRY_COUNT, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ) + IS_NEW_MERCHANT = + T.let( + :IS_NEW_MERCHANT, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ) + THREE_DS_SUCCESS_RATE = + T.let( + :THREE_DS_SUCCESS_RATE, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ) + TRAVEL_SPEED = + T.let( + :TRAVEL_SPEED, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ) + DISTANCE_FROM_LAST_TRANSACTION = + T.let( + :DISTANCE_FROM_LAST_TRANSACTION, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Attribute::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Parameters < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters, + Lithic::Internal::AnyHash + ) + end + + sig { returns(T.nilable(Lithic::AuthRules::SpendVelocityFilters)) } + attr_reader :filters + + sig do + params( + filters: Lithic::AuthRules::SpendVelocityFilters::OrHash + ).void + end + attr_writer :filters + + # The time window for statistical attributes (`AMOUNT_Z_SCORE`, + # `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for + # all-time history or a specific window (`7D`, `30D`, `90D`). + sig do + returns( + T.nilable( + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Interval::OrSymbol + ) + ) + end + attr_reader :interval + + sig do + params( + interval: + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Interval::OrSymbol + ).void + end + attr_writer :interval + + # The time period over which to calculate the spend velocity. + sig do + returns( + T.nilable( + T.any( + Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowDay, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowWeek, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowMonth, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear + ) + ) + ) + end + attr_reader :period + + sig do + params( + period: + T.any( + Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject::OrHash, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowDay::OrHash, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowWeek::OrHash, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowMonth::OrHash, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear::OrHash + ) + ).void + end + attr_writer :period + + # The entity scope to evaluate the attribute against. `GLOBAL` is only valid for + # spend velocity attributes. + sig do + returns( + T.nilable( + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Scope::OrSymbol + ) + ) + end + attr_reader :scope + + sig do + params( + scope: + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Scope::OrSymbol + ).void + end + attr_writer :scope + + # The unit for impossible travel attributes. Required when `attribute` is + # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION`. + # + # For `TRAVEL_SPEED`: `MPH` (miles per hour) or `KPH` (kilometers per hour). + # + # For `DISTANCE_FROM_LAST_TRANSACTION`: `MILES` or `KILOMETERS`. + sig do + returns( + T.nilable( + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Unit::OrSymbol + ) + ) + end + attr_reader :unit + + sig do + params( + unit: + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Unit::OrSymbol + ).void + end + attr_writer :unit + + # Additional parameters for certain attributes. Required when `attribute` is + # `SPEND_VELOCITY_COUNT` or `SPEND_VELOCITY_AMOUNT` (require `scope`, `period`, + # and optional `filters`); `AMOUNT_Z_SCORE`, `AVG_TRANSACTION_AMOUNT`, + # `STDEV_TRANSACTION_AMOUNT`, `IS_NEW_COUNTRY`, `IS_NEW_MCC`, + # `IS_FIRST_TRANSACTION`, `CONSECUTIVE_DECLINES`, `TIME_SINCE_LAST_TRANSACTION`, + # or `DISTINCT_COUNTRY_COUNT` (require `scope`, and additionally `interval` for + # the statistical attributes); or `TRAVEL_SPEED` or + # `DISTANCE_FROM_LAST_TRANSACTION` (require `unit`). Not used for other + # attributes. + sig do + params( + filters: Lithic::AuthRules::SpendVelocityFilters::OrHash, + interval: + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Interval::OrSymbol, + period: + T.any( + Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject::OrHash, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowDay::OrHash, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowWeek::OrHash, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowMonth::OrHash, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear::OrHash + ), + scope: + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Scope::OrSymbol, + unit: + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Unit::OrSymbol + ).returns(T.attached_class) + end + def self.new( + filters: nil, + # The time window for statistical attributes (`AMOUNT_Z_SCORE`, + # `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for + # all-time history or a specific window (`7D`, `30D`, `90D`). + interval: nil, + # The time period over which to calculate the spend velocity. + period: nil, + # The entity scope to evaluate the attribute against. `GLOBAL` is only valid for + # spend velocity attributes. + scope: nil, + # The unit for impossible travel attributes. Required when `attribute` is + # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION`. + # + # For `TRAVEL_SPEED`: `MPH` (miles per hour) or `KPH` (kilometers per hour). + # + # For `DISTANCE_FROM_LAST_TRANSACTION`: `MILES` or `KILOMETERS`. + unit: nil + ) + end + + sig do + override.returns( + { + filters: Lithic::AuthRules::SpendVelocityFilters, + interval: + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Interval::OrSymbol, + period: + T.any( + Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowDay, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowWeek, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowMonth, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear + ), + scope: + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Scope::OrSymbol, + unit: + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Unit::OrSymbol + } + ) + end + def to_hash + end + + # The time window for statistical attributes (`AMOUNT_Z_SCORE`, + # `AVG_TRANSACTION_AMOUNT`, `STDEV_TRANSACTION_AMOUNT`). Use `LIFETIME` for + # all-time history or a specific window (`7D`, `30D`, `90D`). + module Interval + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Interval + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LIFETIME = + T.let( + :LIFETIME, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Interval::TaggedSymbol + ) + INTERVAL_7_D = + T.let( + :"7D", + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Interval::TaggedSymbol + ) + INTERVAL_30_D = + T.let( + :"30D", + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Interval::TaggedSymbol + ) + INTERVAL_90_D = + T.let( + :"90D", + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Interval::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Interval::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The entity scope to evaluate the attribute against. `GLOBAL` is only valid for + # spend velocity attributes. + module Scope + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Scope + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CARD = + T.let( + :CARD, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Scope::TaggedSymbol + ) + ACCOUNT = + T.let( + :ACCOUNT, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Scope::TaggedSymbol + ) + GLOBAL = + T.let( + :GLOBAL, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Scope::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Scope::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The unit for impossible travel attributes. Required when `attribute` is + # `TRAVEL_SPEED` or `DISTANCE_FROM_LAST_TRANSACTION`. + # + # For `TRAVEL_SPEED`: `MPH` (miles per hour) or `KPH` (kilometers per hour). + # + # For `DISTANCE_FROM_LAST_TRANSACTION`: `MILES` or `KILOMETERS`. + module Unit + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Unit + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MPH = + T.let( + :MPH, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Unit::TaggedSymbol + ) + KPH = + T.let( + :KPH, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Unit::TaggedSymbol + ) + MILES = + T.let( + :MILES, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Unit::TaggedSymbol + ) + KILOMETERS = + T.let( + :KILOMETERS, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Unit::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::Unit::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/conditional_operation.rbi b/rbi/lithic/models/auth_rules/conditional_operation.rbi new file mode 100644 index 00000000..c21d8fd6 --- /dev/null +++ b/rbi/lithic/models/auth_rules/conditional_operation.rbi @@ -0,0 +1,99 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + # The operation to apply to the attribute + module ConditionalOperation + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::AuthRules::ConditionalOperation) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IS_ONE_OF = + T.let( + :IS_ONE_OF, + Lithic::AuthRules::ConditionalOperation::TaggedSymbol + ) + IS_NOT_ONE_OF = + T.let( + :IS_NOT_ONE_OF, + Lithic::AuthRules::ConditionalOperation::TaggedSymbol + ) + MATCHES = + T.let(:MATCHES, Lithic::AuthRules::ConditionalOperation::TaggedSymbol) + DOES_NOT_MATCH = + T.let( + :DOES_NOT_MATCH, + Lithic::AuthRules::ConditionalOperation::TaggedSymbol + ) + IS_EQUAL_TO = + T.let( + :IS_EQUAL_TO, + Lithic::AuthRules::ConditionalOperation::TaggedSymbol + ) + IS_NOT_EQUAL_TO = + T.let( + :IS_NOT_EQUAL_TO, + Lithic::AuthRules::ConditionalOperation::TaggedSymbol + ) + IS_GREATER_THAN = + T.let( + :IS_GREATER_THAN, + Lithic::AuthRules::ConditionalOperation::TaggedSymbol + ) + IS_GREATER_THAN_OR_EQUAL_TO = + T.let( + :IS_GREATER_THAN_OR_EQUAL_TO, + Lithic::AuthRules::ConditionalOperation::TaggedSymbol + ) + IS_LESS_THAN = + T.let( + :IS_LESS_THAN, + Lithic::AuthRules::ConditionalOperation::TaggedSymbol + ) + IS_LESS_THAN_OR_EQUAL_TO = + T.let( + :IS_LESS_THAN_OR_EQUAL_TO, + Lithic::AuthRules::ConditionalOperation::TaggedSymbol + ) + IS_AFTER = + T.let( + :IS_AFTER, + Lithic::AuthRules::ConditionalOperation::TaggedSymbol + ) + IS_BEFORE = + T.let( + :IS_BEFORE, + Lithic::AuthRules::ConditionalOperation::TaggedSymbol + ) + CONTAINS_ANY = + T.let( + :CONTAINS_ANY, + Lithic::AuthRules::ConditionalOperation::TaggedSymbol + ) + CONTAINS_ALL = + T.let( + :CONTAINS_ALL, + Lithic::AuthRules::ConditionalOperation::TaggedSymbol + ) + CONTAINS_NONE = + T.let( + :CONTAINS_NONE, + Lithic::AuthRules::ConditionalOperation::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::AuthRules::ConditionalOperation::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/conditional_tokenization_action_parameters.rbi b/rbi/lithic/models/auth_rules/conditional_tokenization_action_parameters.rbi new file mode 100644 index 00000000..79b66623 --- /dev/null +++ b/rbi/lithic/models/auth_rules/conditional_tokenization_action_parameters.rbi @@ -0,0 +1,753 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class ConditionalTokenizationActionParameters < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::Internal::AnyHash + ) + end + + # The action to take if the conditions are met. + sig do + returns( + T.any( + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction + ) + ) + end + attr_accessor :action + + sig do + returns( + T::Array[ + Lithic::AuthRules::ConditionalTokenizationActionParameters::Condition + ] + ) + end + attr_accessor :conditions + + sig do + params( + action: + T.any( + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::OrHash, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::OrHash + ), + conditions: + T::Array[ + Lithic::AuthRules::ConditionalTokenizationActionParameters::Condition::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # The action to take if the conditions are met. + action:, + conditions: + ) + end + + sig do + override.returns( + { + action: + T.any( + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction + ), + conditions: + T::Array[ + Lithic::AuthRules::ConditionalTokenizationActionParameters::Condition + ] + } + ) + end + def to_hash + end + + # The action to take if the conditions are met. + module Action + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction + ) + end + + class DeclineActionTokenization < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization, + Lithic::Internal::AnyHash + ) + end + + # Decline the tokenization request + sig do + returns( + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Type::OrSymbol + ) + end + attr_accessor :type + + # Reason code for declining the tokenization request + sig do + returns( + T.nilable( + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Reason::OrSymbol + ) + ) + end + attr_reader :reason + + sig do + params( + reason: + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Reason::OrSymbol + ).void + end + attr_writer :reason + + sig do + params( + type: + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Type::OrSymbol, + reason: + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Reason::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Decline the tokenization request + type:, + # Reason code for declining the tokenization request + reason: nil + ) + end + + sig do + override.returns( + { + type: + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Type::OrSymbol, + reason: + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Reason::OrSymbol + } + ) + end + def to_hash + end + + # Decline the tokenization request + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DECLINE = + T.let( + :DECLINE, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Reason code for declining the tokenization request + module Reason + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Reason + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_SCORE_1 = + T.let( + :ACCOUNT_SCORE_1, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + DEVICE_SCORE_1 = + T.let( + :DEVICE_SCORE_1, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + ALL_WALLET_DECLINE_REASONS_PRESENT = + T.let( + :ALL_WALLET_DECLINE_REASONS_PRESENT, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + WALLET_RECOMMENDED_DECISION_RED = + T.let( + :WALLET_RECOMMENDED_DECISION_RED, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + CVC_MISMATCH = + T.let( + :CVC_MISMATCH, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + CARD_EXPIRY_MONTH_MISMATCH = + T.let( + :CARD_EXPIRY_MONTH_MISMATCH, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + CARD_EXPIRY_YEAR_MISMATCH = + T.let( + :CARD_EXPIRY_YEAR_MISMATCH, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + CARD_INVALID_STATE = + T.let( + :CARD_INVALID_STATE, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + CUSTOMER_RED_PATH = + T.let( + :CUSTOMER_RED_PATH, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + INVALID_CUSTOMER_RESPONSE = + T.let( + :INVALID_CUSTOMER_RESPONSE, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + NETWORK_FAILURE = + T.let( + :NETWORK_FAILURE, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + GENERIC_DECLINE = + T.let( + :GENERIC_DECLINE, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + DIGITAL_CARD_ART_REQUIRED = + T.let( + :DIGITAL_CARD_ART_REQUIRED, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::Reason::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class RequireTfaAction < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction, + Lithic::Internal::AnyHash + ) + end + + # Require two-factor authentication for the tokenization request + sig do + returns( + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Type::OrSymbol + ) + end + attr_accessor :type + + # Reason code for requiring two-factor authentication + sig do + returns( + T.nilable( + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Reason::OrSymbol + ) + ) + end + attr_reader :reason + + sig do + params( + reason: + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Reason::OrSymbol + ).void + end + attr_writer :reason + + sig do + params( + type: + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Type::OrSymbol, + reason: + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Reason::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Require two-factor authentication for the tokenization request + type:, + # Reason code for requiring two-factor authentication + reason: nil + ) + end + + sig do + override.returns( + { + type: + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Type::OrSymbol, + reason: + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Reason::OrSymbol + } + ) + end + def to_hash + end + + # Require two-factor authentication for the tokenization request + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + REQUIRE_TFA = + T.let( + :REQUIRE_TFA, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Reason code for requiring two-factor authentication + module Reason + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Reason + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_RECOMMENDED_TFA = + T.let( + :WALLET_RECOMMENDED_TFA, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Reason::TaggedSymbol + ) + SUSPICIOUS_ACTIVITY = + T.let( + :SUSPICIOUS_ACTIVITY, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Reason::TaggedSymbol + ) + DEVICE_RECENTLY_LOST = + T.let( + :DEVICE_RECENTLY_LOST, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Reason::TaggedSymbol + ) + TOO_MANY_RECENT_ATTEMPTS = + T.let( + :TOO_MANY_RECENT_ATTEMPTS, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Reason::TaggedSymbol + ) + TOO_MANY_RECENT_TOKENS = + T.let( + :TOO_MANY_RECENT_TOKENS, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Reason::TaggedSymbol + ) + TOO_MANY_DIFFERENT_CARDHOLDERS = + T.let( + :TOO_MANY_DIFFERENT_CARDHOLDERS, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Reason::TaggedSymbol + ) + OUTSIDE_HOME_TERRITORY = + T.let( + :OUTSIDE_HOME_TERRITORY, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Reason::TaggedSymbol + ) + HAS_SUSPENDED_TOKENS = + T.let( + :HAS_SUSPENDED_TOKENS, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Reason::TaggedSymbol + ) + HIGH_RISK = + T.let( + :HIGH_RISK, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Reason::TaggedSymbol + ) + ACCOUNT_SCORE_LOW = + T.let( + :ACCOUNT_SCORE_LOW, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Reason::TaggedSymbol + ) + DEVICE_SCORE_LOW = + T.let( + :DEVICE_SCORE_LOW, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Reason::TaggedSymbol + ) + CARD_STATE_TFA = + T.let( + :CARD_STATE_TFA, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Reason::TaggedSymbol + ) + HARDCODED_TFA = + T.let( + :HARDCODED_TFA, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Reason::TaggedSymbol + ) + CUSTOMER_RULE_TFA = + T.let( + :CUSTOMER_RULE_TFA, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Reason::TaggedSymbol + ) + DEVICE_HOST_CARD_EMULATION = + T.let( + :DEVICE_HOST_CARD_EMULATION, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Reason::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::Reason::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::Variants + ] + ) + end + def self.variants + end + end + + class Condition < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::ConditionalTokenizationActionParameters::Condition, + Lithic::Internal::AnyHash + ) + end + + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `TIMESTAMP`: The timestamp of the tokenization request in ISO 8601 format. + # - `TOKENIZATION_CHANNEL`: The channel through which the tokenization request was + # initiated. Valid values are `DIGITAL_WALLET`, `MERCHANT`. + # - `TOKENIZATION_SOURCE`: The source of the tokenization request. Valid values + # are `ACCOUNT_ON_FILE`, `MANUAL_PROVISION`, `PUSH_PROVISION`, `CHIP_DIP`, + # `CONTACTLESS_TAP`, `TOKEN`, `UNKNOWN`. + # - `TOKEN_REQUESTOR_NAME`: The name of the entity requesting the token. Valid + # values are `ALT_ID`, `AMAZON_ONE`, `AMERICAN_EXPRESS_TOKEN_SERVICE`, + # `ANDROID_PAY`, `APPLE_PAY`, `FACEBOOK`, `FITBIT_PAY`, `GARMIN_PAY`, + # `GOOGLE_PAY`, `GOOGLE_VCN`, `ISSUER_HCE`, `MICROSOFT_PAY`, `NETFLIX`, + # `SAMSUNG_PAY`, `UNKNOWN`, `VISA_CHECKOUT`. + # - `WALLET_ACCOUNT_SCORE`: Risk score for the account in the digital wallet. + # Numeric value where lower numbers indicate higher risk (e.g., 1 = high risk, 2 + # = medium risk). Use an integer value. + # - `WALLET_DEVICE_SCORE`: Risk score for the device in the digital wallet. + # Numeric value where lower numbers indicate higher risk (e.g., 1 = high risk, 2 + # = medium risk). Use an integer value. + # - `WALLET_RECOMMENDED_DECISION`: The decision recommended by the digital wallet + # provider. Valid values include APPROVE, DECLINE, + # REQUIRE_ADDITIONAL_AUTHENTICATION. + # - `WALLET_RECOMMENDATION_REASONS`: List of reasons provided by the digital + # wallet provider for the recommended decision. Valid values are: + # - Common: `ACCOUNT_CARD_TOO_NEW`, `ACCOUNT_RECENTLY_CHANGED`, + # `ACCOUNT_TOO_NEW`, `ACCOUNT_TOO_NEW_SINCE_LAUNCH`, `DEVICE_RECENTLY_LOST`, + # `HAS_SUSPENDED_TOKENS`, `HIGH_RISK`, `INACTIVE_ACCOUNT`, + # `LOW_ACCOUNT_SCORE`, `LOW_DEVICE_SCORE`, `OUTSIDE_HOME_TERRITORY`, + # `SUSPICIOUS_ACTIVITY`, `TOO_MANY_DIFFERENT_CARDHOLDERS`, + # `TOO_MANY_RECENT_ATTEMPTS`, `TOO_MANY_RECENT_TOKENS`, `UNABLE_TO_ASSESS` + # - Visa only: `ACCOUNT_DATA_RECENTLY_CHANGED`, `ACCOUNT_PAN_PAIRING_TOO_NEW`, + # `LOW_TRANSACTION_VOLUME`, `USER_ACCOUNT_DEVICE_TOO_NEW`, + # `WALLET_ACCOUNT_TOO_NEW` + # - Amex only: `DEVICE_USING_VPN_PROXY`, + # `EXCESSIVE_BILLING_NAME_ATTEMPTS_MODERATE`, + # `EXCESSIVE_BILLING_NAME_ATTEMPTS_SEVERE`, + # `EXCESSIVE_CARD_PROVISION_ATTEMPTS_MODERATE`, + # `EXCESSIVE_CARD_PROVISION_ATTEMPTS_SEVERE`, `EXCESSIVE_WALLET_RESETS`, + # `EXCESSIVE_ZIP_ATTEMPTS_MODERATE`, `EXCESSIVE_ZIP_ATTEMPTS_SEVERE`, + # `USER_ID_CARD_PAIRING_TOO_NEW`, `USER_ID_DEVICE_ID_PAIRING_TOO_NEW`, + # `USER_ID_OS_ID_PAIRING_TOO_NEW`, `USER_ID_TOO_NEW` + # - `TOKEN_REQUESTOR_ID`: Unique identifier for the entity requesting the token. + # - `WALLET_TOKEN_STATUS`: The current status of the wallet token. + # - `CARD_STATE`: The state of the card being tokenized. Valid values are + # `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, `PENDING_FULFILLMENT`. + sig do + returns( + Lithic::AuthRules::ConditionalTokenizationActionParameters::Condition::Attribute::OrSymbol + ) + end + attr_accessor :attribute + + # The operation to apply to the attribute + sig { returns(Lithic::AuthRules::ConditionalOperation::OrSymbol) } + attr_accessor :operation + + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + sig { returns(Lithic::AuthRules::ConditionalValue::Variants) } + attr_accessor :value + + sig do + params( + attribute: + Lithic::AuthRules::ConditionalTokenizationActionParameters::Condition::Attribute::OrSymbol, + operation: Lithic::AuthRules::ConditionalOperation::OrSymbol, + value: Lithic::AuthRules::ConditionalValue::Variants + ).returns(T.attached_class) + end + def self.new( + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `TIMESTAMP`: The timestamp of the tokenization request in ISO 8601 format. + # - `TOKENIZATION_CHANNEL`: The channel through which the tokenization request was + # initiated. Valid values are `DIGITAL_WALLET`, `MERCHANT`. + # - `TOKENIZATION_SOURCE`: The source of the tokenization request. Valid values + # are `ACCOUNT_ON_FILE`, `MANUAL_PROVISION`, `PUSH_PROVISION`, `CHIP_DIP`, + # `CONTACTLESS_TAP`, `TOKEN`, `UNKNOWN`. + # - `TOKEN_REQUESTOR_NAME`: The name of the entity requesting the token. Valid + # values are `ALT_ID`, `AMAZON_ONE`, `AMERICAN_EXPRESS_TOKEN_SERVICE`, + # `ANDROID_PAY`, `APPLE_PAY`, `FACEBOOK`, `FITBIT_PAY`, `GARMIN_PAY`, + # `GOOGLE_PAY`, `GOOGLE_VCN`, `ISSUER_HCE`, `MICROSOFT_PAY`, `NETFLIX`, + # `SAMSUNG_PAY`, `UNKNOWN`, `VISA_CHECKOUT`. + # - `WALLET_ACCOUNT_SCORE`: Risk score for the account in the digital wallet. + # Numeric value where lower numbers indicate higher risk (e.g., 1 = high risk, 2 + # = medium risk). Use an integer value. + # - `WALLET_DEVICE_SCORE`: Risk score for the device in the digital wallet. + # Numeric value where lower numbers indicate higher risk (e.g., 1 = high risk, 2 + # = medium risk). Use an integer value. + # - `WALLET_RECOMMENDED_DECISION`: The decision recommended by the digital wallet + # provider. Valid values include APPROVE, DECLINE, + # REQUIRE_ADDITIONAL_AUTHENTICATION. + # - `WALLET_RECOMMENDATION_REASONS`: List of reasons provided by the digital + # wallet provider for the recommended decision. Valid values are: + # - Common: `ACCOUNT_CARD_TOO_NEW`, `ACCOUNT_RECENTLY_CHANGED`, + # `ACCOUNT_TOO_NEW`, `ACCOUNT_TOO_NEW_SINCE_LAUNCH`, `DEVICE_RECENTLY_LOST`, + # `HAS_SUSPENDED_TOKENS`, `HIGH_RISK`, `INACTIVE_ACCOUNT`, + # `LOW_ACCOUNT_SCORE`, `LOW_DEVICE_SCORE`, `OUTSIDE_HOME_TERRITORY`, + # `SUSPICIOUS_ACTIVITY`, `TOO_MANY_DIFFERENT_CARDHOLDERS`, + # `TOO_MANY_RECENT_ATTEMPTS`, `TOO_MANY_RECENT_TOKENS`, `UNABLE_TO_ASSESS` + # - Visa only: `ACCOUNT_DATA_RECENTLY_CHANGED`, `ACCOUNT_PAN_PAIRING_TOO_NEW`, + # `LOW_TRANSACTION_VOLUME`, `USER_ACCOUNT_DEVICE_TOO_NEW`, + # `WALLET_ACCOUNT_TOO_NEW` + # - Amex only: `DEVICE_USING_VPN_PROXY`, + # `EXCESSIVE_BILLING_NAME_ATTEMPTS_MODERATE`, + # `EXCESSIVE_BILLING_NAME_ATTEMPTS_SEVERE`, + # `EXCESSIVE_CARD_PROVISION_ATTEMPTS_MODERATE`, + # `EXCESSIVE_CARD_PROVISION_ATTEMPTS_SEVERE`, `EXCESSIVE_WALLET_RESETS`, + # `EXCESSIVE_ZIP_ATTEMPTS_MODERATE`, `EXCESSIVE_ZIP_ATTEMPTS_SEVERE`, + # `USER_ID_CARD_PAIRING_TOO_NEW`, `USER_ID_DEVICE_ID_PAIRING_TOO_NEW`, + # `USER_ID_OS_ID_PAIRING_TOO_NEW`, `USER_ID_TOO_NEW` + # - `TOKEN_REQUESTOR_ID`: Unique identifier for the entity requesting the token. + # - `WALLET_TOKEN_STATUS`: The current status of the wallet token. + # - `CARD_STATE`: The state of the card being tokenized. Valid values are + # `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, `PENDING_FULFILLMENT`. + attribute:, + # The operation to apply to the attribute + operation:, + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + value: + ) + end + + sig do + override.returns( + { + attribute: + Lithic::AuthRules::ConditionalTokenizationActionParameters::Condition::Attribute::OrSymbol, + operation: Lithic::AuthRules::ConditionalOperation::OrSymbol, + value: Lithic::AuthRules::ConditionalValue::Variants + } + ) + end + def to_hash + end + + # The attribute to target. + # + # The following attributes may be targeted: + # + # - `TIMESTAMP`: The timestamp of the tokenization request in ISO 8601 format. + # - `TOKENIZATION_CHANNEL`: The channel through which the tokenization request was + # initiated. Valid values are `DIGITAL_WALLET`, `MERCHANT`. + # - `TOKENIZATION_SOURCE`: The source of the tokenization request. Valid values + # are `ACCOUNT_ON_FILE`, `MANUAL_PROVISION`, `PUSH_PROVISION`, `CHIP_DIP`, + # `CONTACTLESS_TAP`, `TOKEN`, `UNKNOWN`. + # - `TOKEN_REQUESTOR_NAME`: The name of the entity requesting the token. Valid + # values are `ALT_ID`, `AMAZON_ONE`, `AMERICAN_EXPRESS_TOKEN_SERVICE`, + # `ANDROID_PAY`, `APPLE_PAY`, `FACEBOOK`, `FITBIT_PAY`, `GARMIN_PAY`, + # `GOOGLE_PAY`, `GOOGLE_VCN`, `ISSUER_HCE`, `MICROSOFT_PAY`, `NETFLIX`, + # `SAMSUNG_PAY`, `UNKNOWN`, `VISA_CHECKOUT`. + # - `WALLET_ACCOUNT_SCORE`: Risk score for the account in the digital wallet. + # Numeric value where lower numbers indicate higher risk (e.g., 1 = high risk, 2 + # = medium risk). Use an integer value. + # - `WALLET_DEVICE_SCORE`: Risk score for the device in the digital wallet. + # Numeric value where lower numbers indicate higher risk (e.g., 1 = high risk, 2 + # = medium risk). Use an integer value. + # - `WALLET_RECOMMENDED_DECISION`: The decision recommended by the digital wallet + # provider. Valid values include APPROVE, DECLINE, + # REQUIRE_ADDITIONAL_AUTHENTICATION. + # - `WALLET_RECOMMENDATION_REASONS`: List of reasons provided by the digital + # wallet provider for the recommended decision. Valid values are: + # - Common: `ACCOUNT_CARD_TOO_NEW`, `ACCOUNT_RECENTLY_CHANGED`, + # `ACCOUNT_TOO_NEW`, `ACCOUNT_TOO_NEW_SINCE_LAUNCH`, `DEVICE_RECENTLY_LOST`, + # `HAS_SUSPENDED_TOKENS`, `HIGH_RISK`, `INACTIVE_ACCOUNT`, + # `LOW_ACCOUNT_SCORE`, `LOW_DEVICE_SCORE`, `OUTSIDE_HOME_TERRITORY`, + # `SUSPICIOUS_ACTIVITY`, `TOO_MANY_DIFFERENT_CARDHOLDERS`, + # `TOO_MANY_RECENT_ATTEMPTS`, `TOO_MANY_RECENT_TOKENS`, `UNABLE_TO_ASSESS` + # - Visa only: `ACCOUNT_DATA_RECENTLY_CHANGED`, `ACCOUNT_PAN_PAIRING_TOO_NEW`, + # `LOW_TRANSACTION_VOLUME`, `USER_ACCOUNT_DEVICE_TOO_NEW`, + # `WALLET_ACCOUNT_TOO_NEW` + # - Amex only: `DEVICE_USING_VPN_PROXY`, + # `EXCESSIVE_BILLING_NAME_ATTEMPTS_MODERATE`, + # `EXCESSIVE_BILLING_NAME_ATTEMPTS_SEVERE`, + # `EXCESSIVE_CARD_PROVISION_ATTEMPTS_MODERATE`, + # `EXCESSIVE_CARD_PROVISION_ATTEMPTS_SEVERE`, `EXCESSIVE_WALLET_RESETS`, + # `EXCESSIVE_ZIP_ATTEMPTS_MODERATE`, `EXCESSIVE_ZIP_ATTEMPTS_SEVERE`, + # `USER_ID_CARD_PAIRING_TOO_NEW`, `USER_ID_DEVICE_ID_PAIRING_TOO_NEW`, + # `USER_ID_OS_ID_PAIRING_TOO_NEW`, `USER_ID_TOO_NEW` + # - `TOKEN_REQUESTOR_ID`: Unique identifier for the entity requesting the token. + # - `WALLET_TOKEN_STATUS`: The current status of the wallet token. + # - `CARD_STATE`: The state of the card being tokenized. Valid values are + # `CLOSED`, `OPEN`, `PAUSED`, `PENDING_ACTIVATION`, `PENDING_FULFILLMENT`. + module Attribute + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Condition::Attribute + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TIMESTAMP = + T.let( + :TIMESTAMP, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Condition::Attribute::TaggedSymbol + ) + TOKENIZATION_CHANNEL = + T.let( + :TOKENIZATION_CHANNEL, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Condition::Attribute::TaggedSymbol + ) + TOKENIZATION_SOURCE = + T.let( + :TOKENIZATION_SOURCE, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Condition::Attribute::TaggedSymbol + ) + TOKEN_REQUESTOR_NAME = + T.let( + :TOKEN_REQUESTOR_NAME, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Condition::Attribute::TaggedSymbol + ) + WALLET_ACCOUNT_SCORE = + T.let( + :WALLET_ACCOUNT_SCORE, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Condition::Attribute::TaggedSymbol + ) + WALLET_DEVICE_SCORE = + T.let( + :WALLET_DEVICE_SCORE, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Condition::Attribute::TaggedSymbol + ) + WALLET_RECOMMENDED_DECISION = + T.let( + :WALLET_RECOMMENDED_DECISION, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Condition::Attribute::TaggedSymbol + ) + WALLET_RECOMMENDATION_REASONS = + T.let( + :WALLET_RECOMMENDATION_REASONS, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Condition::Attribute::TaggedSymbol + ) + TOKEN_REQUESTOR_ID = + T.let( + :TOKEN_REQUESTOR_ID, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Condition::Attribute::TaggedSymbol + ) + WALLET_TOKEN_STATUS = + T.let( + :WALLET_TOKEN_STATUS, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Condition::Attribute::TaggedSymbol + ) + CARD_STATE = + T.let( + :CARD_STATE, + Lithic::AuthRules::ConditionalTokenizationActionParameters::Condition::Attribute::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ConditionalTokenizationActionParameters::Condition::Attribute::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/conditional_value.rbi b/rbi/lithic/models/auth_rules/conditional_value.rbi new file mode 100644 index 00000000..a9fbcfb5 --- /dev/null +++ b/rbi/lithic/models/auth_rules/conditional_value.rbi @@ -0,0 +1,29 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + # A regex string, to be used with `MATCHES` or `DOES_NOT_MATCH` + module ConditionalValue + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias { T.any(String, Integer, Float, T::Array[String], Time) } + + sig do + override.returns( + T::Array[Lithic::AuthRules::ConditionalValue::Variants] + ) + end + def self.variants + end + + StringArray = + T.let( + Lithic::Internal::Type::ArrayOf[String], + Lithic::Internal::Type::Converter + ) + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/event_stream.rbi b/rbi/lithic/models/auth_rules/event_stream.rbi new file mode 100644 index 00000000..d86de88c --- /dev/null +++ b/rbi/lithic/models/auth_rules/event_stream.rbi @@ -0,0 +1,49 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + # The event stream during which the rule will be evaluated. + module EventStream + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::AuthRules::EventStream) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AUTHORIZATION = + T.let(:AUTHORIZATION, Lithic::AuthRules::EventStream::TaggedSymbol) + THREE_DS_AUTHENTICATION = + T.let( + :THREE_DS_AUTHENTICATION, + Lithic::AuthRules::EventStream::TaggedSymbol + ) + TOKENIZATION = + T.let(:TOKENIZATION, Lithic::AuthRules::EventStream::TaggedSymbol) + ACH_CREDIT_RECEIPT = + T.let( + :ACH_CREDIT_RECEIPT, + Lithic::AuthRules::EventStream::TaggedSymbol + ) + ACH_DEBIT_RECEIPT = + T.let( + :ACH_DEBIT_RECEIPT, + Lithic::AuthRules::EventStream::TaggedSymbol + ) + CARD_TRANSACTION_UPDATE = + T.let( + :CARD_TRANSACTION_UPDATE, + Lithic::AuthRules::EventStream::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::AuthRules::EventStream::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/merchant_lock_parameters.rbi b/rbi/lithic/models/auth_rules/merchant_lock_parameters.rbi new file mode 100644 index 00000000..bfef7410 --- /dev/null +++ b/rbi/lithic/models/auth_rules/merchant_lock_parameters.rbi @@ -0,0 +1,119 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class MerchantLockParameters < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::MerchantLockParameters, + Lithic::Internal::AnyHash + ) + end + + # A list of merchant locks defining specific merchants or groups of merchants + # (based on descriptors or IDs) that the lock applies to. + sig do + returns(T::Array[Lithic::AuthRules::MerchantLockParameters::Merchant]) + end + attr_accessor :merchants + + sig do + params( + merchants: + T::Array[ + Lithic::AuthRules::MerchantLockParameters::Merchant::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # A list of merchant locks defining specific merchants or groups of merchants + # (based on descriptors or IDs) that the lock applies to. + merchants: + ) + end + + sig do + override.returns( + { + merchants: + T::Array[Lithic::AuthRules::MerchantLockParameters::Merchant] + } + ) + end + def to_hash + end + + class Merchant < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::MerchantLockParameters::Merchant, + Lithic::Internal::AnyHash + ) + end + + # A comment or explanation about the merchant, used internally for rule management + # purposes. + sig { returns(T.nilable(String)) } + attr_reader :comment + + sig { params(comment: String).void } + attr_writer :comment + + # Short description of the merchant, often used to provide more human-readable + # context about the transaction merchant. This is typically the name or label + # shown on transaction summaries. + sig { returns(T.nilable(String)) } + attr_reader :descriptor + + sig { params(descriptor: String).void } + attr_writer :descriptor + + # Unique alphanumeric identifier for the payment card acceptor (merchant). This + # attribute specifies the merchant entity that will be locked or referenced for + # authorization rules. + sig { returns(T.nilable(String)) } + attr_reader :merchant_id + + sig { params(merchant_id: String).void } + attr_writer :merchant_id + + # Represents a specific merchant lock based on their ID or descriptor. Each + # merchant object allows transaction rules to work at a granular level and + # requires at least one of merchant_id or descriptor. + sig do + params( + comment: String, + descriptor: String, + merchant_id: String + ).returns(T.attached_class) + end + def self.new( + # A comment or explanation about the merchant, used internally for rule management + # purposes. + comment: nil, + # Short description of the merchant, often used to provide more human-readable + # context about the transaction merchant. This is typically the name or label + # shown on transaction summaries. + descriptor: nil, + # Unique alphanumeric identifier for the payment card acceptor (merchant). This + # attribute specifies the merchant entity that will be locked or referenced for + # authorization rules. + merchant_id: nil + ) + end + + sig do + override.returns( + { comment: String, descriptor: String, merchant_id: String } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/report_stats.rbi b/rbi/lithic/models/auth_rules/report_stats.rbi new file mode 100644 index 00000000..00452eba --- /dev/null +++ b/rbi/lithic/models/auth_rules/report_stats.rbi @@ -0,0 +1,1650 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class ReportStats < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::AuthRules::ReportStats, Lithic::Internal::AnyHash) + end + + # A mapping of action types to the number of times that action was returned by + # this version during the relevant period. Actions are the possible outcomes of a + # rule evaluation, such as DECLINE, CHALLENGE, REQUIRE_TFA, etc. In case rule + # didn't trigger any action, it's counted under NO_ACTION key. + sig { returns(T::Hash[Symbol, Integer]) } + attr_accessor :action_counts + + # Example events and their outcomes for this version. + sig { returns(T::Array[Lithic::AuthRules::ReportStats::Example]) } + attr_accessor :examples + + # The evaluation mode of this version during the reported period. + sig { returns(Lithic::AuthRules::ReportStats::State::TaggedSymbol) } + attr_accessor :state + + # The rule version number. + sig { returns(Integer) } + attr_accessor :version + + sig do + params( + action_counts: T::Hash[Symbol, Integer], + examples: T::Array[Lithic::AuthRules::ReportStats::Example::OrHash], + state: Lithic::AuthRules::ReportStats::State::OrSymbol, + version: Integer + ).returns(T.attached_class) + end + def self.new( + # A mapping of action types to the number of times that action was returned by + # this version during the relevant period. Actions are the possible outcomes of a + # rule evaluation, such as DECLINE, CHALLENGE, REQUIRE_TFA, etc. In case rule + # didn't trigger any action, it's counted under NO_ACTION key. + action_counts:, + # Example events and their outcomes for this version. + examples:, + # The evaluation mode of this version during the reported period. + state:, + # The rule version number. + version: + ) + end + + sig do + override.returns( + { + action_counts: T::Hash[Symbol, Integer], + examples: T::Array[Lithic::AuthRules::ReportStats::Example], + state: Lithic::AuthRules::ReportStats::State::TaggedSymbol, + version: Integer + } + ) + end + def to_hash + end + + class Example < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::ReportStats::Example, + Lithic::Internal::AnyHash + ) + end + + # The actions taken by this version for this event. + sig do + returns( + T::Array[ + Lithic::AuthRules::ReportStats::Example::Action::Variants + ] + ) + end + attr_accessor :actions + + # The event token. + sig { returns(String) } + attr_accessor :event_token + + # The timestamp of the event. + sig { returns(Time) } + attr_accessor :timestamp + + # The token of the transaction associated with the event + sig { returns(T.nilable(String)) } + attr_accessor :transaction_token + + sig do + params( + actions: + T::Array[ + T.any( + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::OrHash, + Lithic::AuthRules::ReportStats::Example::Action::ChallengeActionAuthorization::OrHash, + Lithic::AuthRules::ReportStats::Example::Action::ResultAuthentication3DSAction::OrHash, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::OrHash, + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::OrHash, + Lithic::AuthRules::ReportStats::Example::Action::ApproveActionACH::OrHash, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::OrHash + ) + ], + event_token: String, + timestamp: Time, + transaction_token: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The actions taken by this version for this event. + actions:, + # The event token. + event_token:, + # The timestamp of the event. + timestamp:, + # The token of the transaction associated with the event + transaction_token: nil + ) + end + + sig do + override.returns( + { + actions: + T::Array[ + Lithic::AuthRules::ReportStats::Example::Action::Variants + ], + event_token: String, + timestamp: Time, + transaction_token: T.nilable(String) + } + ) + end + def to_hash + end + + module Action + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization, + Lithic::AuthRules::ReportStats::Example::Action::ChallengeActionAuthorization, + Lithic::AuthRules::ReportStats::Example::Action::ResultAuthentication3DSAction, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization, + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction, + Lithic::AuthRules::ReportStats::Example::Action::ApproveActionACH, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction + ) + end + + class DeclineActionAuthorization < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization, + Lithic::Internal::AnyHash + ) + end + + # The detailed result code explaining the specific reason for the decline + sig do + returns( + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + end + attr_accessor :code + + sig do + returns( + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig do + params( + code: + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::OrSymbol, + type: + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The detailed result code explaining the specific reason for the decline + code:, + type: + ) + end + + sig do + override.returns( + { + code: + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol, + type: + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Type::TaggedSymbol + } + ) + end + def to_hash + end + + # The detailed result code explaining the specific reason for the decline + module Code + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED = + T.let( + :ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + ACCOUNT_DELINQUENT = + T.let( + :ACCOUNT_DELINQUENT, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + ACCOUNT_INACTIVE = + T.let( + :ACCOUNT_INACTIVE, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED = + T.let( + :ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED = + T.let( + :ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + ACCOUNT_PAUSED = + T.let( + :ACCOUNT_PAUSED, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + ACCOUNT_UNDER_REVIEW = + T.let( + :ACCOUNT_UNDER_REVIEW, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + ADDRESS_INCORRECT = + T.let( + :ADDRESS_INCORRECT, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + APPROVED = + T.let( + :APPROVED, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + AUTH_RULE_ALLOWED_COUNTRY = + T.let( + :AUTH_RULE_ALLOWED_COUNTRY, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + AUTH_RULE_ALLOWED_MCC = + T.let( + :AUTH_RULE_ALLOWED_MCC, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + AUTH_RULE_BLOCKED_COUNTRY = + T.let( + :AUTH_RULE_BLOCKED_COUNTRY, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + AUTH_RULE_BLOCKED_MCC = + T.let( + :AUTH_RULE_BLOCKED_MCC, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + AUTH_RULE = + T.let( + :AUTH_RULE, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CARD_CLOSED = + T.let( + :CARD_CLOSED, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CARD_CRYPTOGRAM_VALIDATION_FAILURE = + T.let( + :CARD_CRYPTOGRAM_VALIDATION_FAILURE, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CARD_EXPIRED = + T.let( + :CARD_EXPIRED, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CARD_EXPIRY_DATE_INCORRECT = + T.let( + :CARD_EXPIRY_DATE_INCORRECT, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CARD_INVALID = + T.let( + :CARD_INVALID, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CARD_NOT_ACTIVATED = + T.let( + :CARD_NOT_ACTIVATED, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CARD_PAUSED = + T.let( + :CARD_PAUSED, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CARD_PIN_INCORRECT = + T.let( + :CARD_PIN_INCORRECT, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CARD_RESTRICTED = + T.let( + :CARD_RESTRICTED, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CARD_SECURITY_CODE_INCORRECT = + T.let( + :CARD_SECURITY_CODE_INCORRECT, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CARD_SPEND_LIMIT_EXCEEDED = + T.let( + :CARD_SPEND_LIMIT_EXCEEDED, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CONTACT_CARD_ISSUER = + T.let( + :CONTACT_CARD_ISSUER, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CUSTOMER_ASA_TIMEOUT = + T.let( + :CUSTOMER_ASA_TIMEOUT, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CUSTOM_ASA_RESULT = + T.let( + :CUSTOM_ASA_RESULT, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + DO_NOT_HONOR = + T.let( + :DO_NOT_HONOR, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + DRIVER_NUMBER_INVALID = + T.let( + :DRIVER_NUMBER_INVALID, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + FORMAT_ERROR = + T.let( + :FORMAT_ERROR, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + INSUFFICIENT_FUNDING_SOURCE_BALANCE = + T.let( + :INSUFFICIENT_FUNDING_SOURCE_BALANCE, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + INSUFFICIENT_FUNDS = + T.let( + :INSUFFICIENT_FUNDS, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + LITHIC_SYSTEM_ERROR = + T.let( + :LITHIC_SYSTEM_ERROR, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + LITHIC_SYSTEM_RATE_LIMIT = + T.let( + :LITHIC_SYSTEM_RATE_LIMIT, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + MALFORMED_ASA_RESPONSE = + T.let( + :MALFORMED_ASA_RESPONSE, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + MERCHANT_INVALID = + T.let( + :MERCHANT_INVALID, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE = + T.let( + :MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + MERCHANT_NOT_PERMITTED = + T.let( + :MERCHANT_NOT_PERMITTED, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + OVER_REVERSAL_ATTEMPTED = + T.let( + :OVER_REVERSAL_ATTEMPTED, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + PIN_BLOCKED = + T.let( + :PIN_BLOCKED, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + PROGRAM_CARD_SPEND_LIMIT_EXCEEDED = + T.let( + :PROGRAM_CARD_SPEND_LIMIT_EXCEEDED, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + PROGRAM_SUSPENDED = + T.let( + :PROGRAM_SUSPENDED, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + PROGRAM_USAGE_RESTRICTION = + T.let( + :PROGRAM_USAGE_RESTRICTION, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + REVERSAL_UNMATCHED = + T.let( + :REVERSAL_UNMATCHED, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + SECURITY_VIOLATION = + T.let( + :SECURITY_VIOLATION, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + SINGLE_USE_CARD_REATTEMPTED = + T.let( + :SINGLE_USE_CARD_REATTEMPTED, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + SUSPECTED_FRAUD = + T.let( + :SUSPECTED_FRAUD, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + TRANSACTION_INVALID = + T.let( + :TRANSACTION_INVALID, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL = + T.let( + :TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER = + T.let( + :TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + TRANSACTION_PREVIOUSLY_COMPLETED = + T.let( + :TRANSACTION_PREVIOUSLY_COMPLETED, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + UNAUTHORIZED_MERCHANT = + T.let( + :UNAUTHORIZED_MERCHANT, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + VEHICLE_NUMBER_INVALID = + T.let( + :VEHICLE_NUMBER_INVALID, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CARDHOLDER_CHALLENGED = + T.let( + :CARDHOLDER_CHALLENGED, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CARDHOLDER_CHALLENGE_FAILED = + T.let( + :CARDHOLDER_CHALLENGE_FAILED, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Code::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DECLINE = + T.let( + :DECLINE, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class ChallengeActionAuthorization < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::ReportStats::Example::Action::ChallengeActionAuthorization, + Lithic::Internal::AnyHash + ) + end + + sig do + returns( + Lithic::AuthRules::ReportStats::Example::Action::ChallengeActionAuthorization::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig do + params( + type: + Lithic::AuthRules::ReportStats::Example::Action::ChallengeActionAuthorization::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(type:) + end + + sig do + override.returns( + { + type: + Lithic::AuthRules::ReportStats::Example::Action::ChallengeActionAuthorization::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ReportStats::Example::Action::ChallengeActionAuthorization::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHALLENGE = + T.let( + :CHALLENGE, + Lithic::AuthRules::ReportStats::Example::Action::ChallengeActionAuthorization::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ReportStats::Example::Action::ChallengeActionAuthorization::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class ResultAuthentication3DSAction < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::ReportStats::Example::Action::ResultAuthentication3DSAction, + Lithic::Internal::AnyHash + ) + end + + sig do + returns( + Lithic::AuthRules::ReportStats::Example::Action::ResultAuthentication3DSAction::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig do + params( + type: + Lithic::AuthRules::ReportStats::Example::Action::ResultAuthentication3DSAction::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(type:) + end + + sig do + override.returns( + { + type: + Lithic::AuthRules::ReportStats::Example::Action::ResultAuthentication3DSAction::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ReportStats::Example::Action::ResultAuthentication3DSAction::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DECLINE = + T.let( + :DECLINE, + Lithic::AuthRules::ReportStats::Example::Action::ResultAuthentication3DSAction::Type::TaggedSymbol + ) + CHALLENGE = + T.let( + :CHALLENGE, + Lithic::AuthRules::ReportStats::Example::Action::ResultAuthentication3DSAction::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ReportStats::Example::Action::ResultAuthentication3DSAction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class DeclineActionTokenization < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization, + Lithic::Internal::AnyHash + ) + end + + # Decline the tokenization request + sig do + returns( + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Reason code for declining the tokenization request + sig do + returns( + T.nilable( + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + ) + end + attr_reader :reason + + sig do + params( + reason: + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Reason::OrSymbol + ).void + end + attr_writer :reason + + sig do + params( + type: + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Type::OrSymbol, + reason: + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Reason::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Decline the tokenization request + type:, + # Reason code for declining the tokenization request + reason: nil + ) + end + + sig do + override.returns( + { + type: + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Type::TaggedSymbol, + reason: + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Reason::TaggedSymbol + } + ) + end + def to_hash + end + + # Decline the tokenization request + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DECLINE = + T.let( + :DECLINE, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Reason code for declining the tokenization request + module Reason + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Reason + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_SCORE_1 = + T.let( + :ACCOUNT_SCORE_1, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + DEVICE_SCORE_1 = + T.let( + :DEVICE_SCORE_1, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + ALL_WALLET_DECLINE_REASONS_PRESENT = + T.let( + :ALL_WALLET_DECLINE_REASONS_PRESENT, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + WALLET_RECOMMENDED_DECISION_RED = + T.let( + :WALLET_RECOMMENDED_DECISION_RED, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + CVC_MISMATCH = + T.let( + :CVC_MISMATCH, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + CARD_EXPIRY_MONTH_MISMATCH = + T.let( + :CARD_EXPIRY_MONTH_MISMATCH, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + CARD_EXPIRY_YEAR_MISMATCH = + T.let( + :CARD_EXPIRY_YEAR_MISMATCH, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + CARD_INVALID_STATE = + T.let( + :CARD_INVALID_STATE, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + CUSTOMER_RED_PATH = + T.let( + :CUSTOMER_RED_PATH, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + INVALID_CUSTOMER_RESPONSE = + T.let( + :INVALID_CUSTOMER_RESPONSE, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + NETWORK_FAILURE = + T.let( + :NETWORK_FAILURE, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + GENERIC_DECLINE = + T.let( + :GENERIC_DECLINE, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + DIGITAL_CARD_ART_REQUIRED = + T.let( + :DIGITAL_CARD_ART_REQUIRED, + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::Reason::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class RequireTfaAction < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction, + Lithic::Internal::AnyHash + ) + end + + # Require two-factor authentication for the tokenization request + sig do + returns( + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Reason code for requiring two-factor authentication + sig do + returns( + T.nilable( + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::Reason::TaggedSymbol + ) + ) + end + attr_reader :reason + + sig do + params( + reason: + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::Reason::OrSymbol + ).void + end + attr_writer :reason + + sig do + params( + type: + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::Type::OrSymbol, + reason: + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::Reason::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Require two-factor authentication for the tokenization request + type:, + # Reason code for requiring two-factor authentication + reason: nil + ) + end + + sig do + override.returns( + { + type: + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::Type::TaggedSymbol, + reason: + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::Reason::TaggedSymbol + } + ) + end + def to_hash + end + + # Require two-factor authentication for the tokenization request + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + REQUIRE_TFA = + T.let( + :REQUIRE_TFA, + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Reason code for requiring two-factor authentication + module Reason + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::Reason + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_RECOMMENDED_TFA = + T.let( + :WALLET_RECOMMENDED_TFA, + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::Reason::TaggedSymbol + ) + SUSPICIOUS_ACTIVITY = + T.let( + :SUSPICIOUS_ACTIVITY, + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::Reason::TaggedSymbol + ) + DEVICE_RECENTLY_LOST = + T.let( + :DEVICE_RECENTLY_LOST, + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::Reason::TaggedSymbol + ) + TOO_MANY_RECENT_ATTEMPTS = + T.let( + :TOO_MANY_RECENT_ATTEMPTS, + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::Reason::TaggedSymbol + ) + TOO_MANY_RECENT_TOKENS = + T.let( + :TOO_MANY_RECENT_TOKENS, + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::Reason::TaggedSymbol + ) + TOO_MANY_DIFFERENT_CARDHOLDERS = + T.let( + :TOO_MANY_DIFFERENT_CARDHOLDERS, + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::Reason::TaggedSymbol + ) + OUTSIDE_HOME_TERRITORY = + T.let( + :OUTSIDE_HOME_TERRITORY, + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::Reason::TaggedSymbol + ) + HAS_SUSPENDED_TOKENS = + T.let( + :HAS_SUSPENDED_TOKENS, + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::Reason::TaggedSymbol + ) + HIGH_RISK = + T.let( + :HIGH_RISK, + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::Reason::TaggedSymbol + ) + ACCOUNT_SCORE_LOW = + T.let( + :ACCOUNT_SCORE_LOW, + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::Reason::TaggedSymbol + ) + DEVICE_SCORE_LOW = + T.let( + :DEVICE_SCORE_LOW, + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::Reason::TaggedSymbol + ) + CARD_STATE_TFA = + T.let( + :CARD_STATE_TFA, + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::Reason::TaggedSymbol + ) + HARDCODED_TFA = + T.let( + :HARDCODED_TFA, + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::Reason::TaggedSymbol + ) + CUSTOMER_RULE_TFA = + T.let( + :CUSTOMER_RULE_TFA, + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::Reason::TaggedSymbol + ) + DEVICE_HOST_CARD_EMULATION = + T.let( + :DEVICE_HOST_CARD_EMULATION, + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::Reason::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction::Reason::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class ApproveActionACH < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::ReportStats::Example::Action::ApproveActionACH, + Lithic::Internal::AnyHash + ) + end + + # Approve the ACH transaction + sig do + returns( + Lithic::AuthRules::ReportStats::Example::Action::ApproveActionACH::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig do + params( + type: + Lithic::AuthRules::ReportStats::Example::Action::ApproveActionACH::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Approve the ACH transaction + type: + ) + end + + sig do + override.returns( + { + type: + Lithic::AuthRules::ReportStats::Example::Action::ApproveActionACH::Type::TaggedSymbol + } + ) + end + def to_hash + end + + # Approve the ACH transaction + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ReportStats::Example::Action::ApproveActionACH::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVE = + T.let( + :APPROVE, + Lithic::AuthRules::ReportStats::Example::Action::ApproveActionACH::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ReportStats::Example::Action::ApproveActionACH::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class ReturnAction < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction, + Lithic::Internal::AnyHash + ) + end + + # NACHA return code to use when returning the transaction. Note that the list of + # available return codes is subject to an allowlist configured at the program + # level + sig do + returns( + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + end + attr_accessor :code + + # Return the ACH transaction + sig do + returns( + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig do + params( + code: + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::OrSymbol, + type: + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # NACHA return code to use when returning the transaction. Note that the list of + # available return codes is subject to an allowlist configured at the program + # level + code:, + # Return the ACH transaction + type: + ) + end + + sig do + override.returns( + { + code: + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol, + type: + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Type::TaggedSymbol + } + ) + end + def to_hash + end + + # NACHA return code to use when returning the transaction. Note that the list of + # available return codes is subject to an allowlist configured at the program + # level + module Code + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + R01 = + T.let( + :R01, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R02 = + T.let( + :R02, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R03 = + T.let( + :R03, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R04 = + T.let( + :R04, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R05 = + T.let( + :R05, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R06 = + T.let( + :R06, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R07 = + T.let( + :R07, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R08 = + T.let( + :R08, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R09 = + T.let( + :R09, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R10 = + T.let( + :R10, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R11 = + T.let( + :R11, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R12 = + T.let( + :R12, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R13 = + T.let( + :R13, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R14 = + T.let( + :R14, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R15 = + T.let( + :R15, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R16 = + T.let( + :R16, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R17 = + T.let( + :R17, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R18 = + T.let( + :R18, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R19 = + T.let( + :R19, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R20 = + T.let( + :R20, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R21 = + T.let( + :R21, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R22 = + T.let( + :R22, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R23 = + T.let( + :R23, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R24 = + T.let( + :R24, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R25 = + T.let( + :R25, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R26 = + T.let( + :R26, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R27 = + T.let( + :R27, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R28 = + T.let( + :R28, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R29 = + T.let( + :R29, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R30 = + T.let( + :R30, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R31 = + T.let( + :R31, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R32 = + T.let( + :R32, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R33 = + T.let( + :R33, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R34 = + T.let( + :R34, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R35 = + T.let( + :R35, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R36 = + T.let( + :R36, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R37 = + T.let( + :R37, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R38 = + T.let( + :R38, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R39 = + T.let( + :R39, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R40 = + T.let( + :R40, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R41 = + T.let( + :R41, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R42 = + T.let( + :R42, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R43 = + T.let( + :R43, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R44 = + T.let( + :R44, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R45 = + T.let( + :R45, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R46 = + T.let( + :R46, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R47 = + T.let( + :R47, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R50 = + T.let( + :R50, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R51 = + T.let( + :R51, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R52 = + T.let( + :R52, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R53 = + T.let( + :R53, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R61 = + T.let( + :R61, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R62 = + T.let( + :R62, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R67 = + T.let( + :R67, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R68 = + T.let( + :R68, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R69 = + T.let( + :R69, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R70 = + T.let( + :R70, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R71 = + T.let( + :R71, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R72 = + T.let( + :R72, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R73 = + T.let( + :R73, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R74 = + T.let( + :R74, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R75 = + T.let( + :R75, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R76 = + T.let( + :R76, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R77 = + T.let( + :R77, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R80 = + T.let( + :R80, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R81 = + T.let( + :R81, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R82 = + T.let( + :R82, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R83 = + T.let( + :R83, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R84 = + T.let( + :R84, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + R85 = + T.let( + :R85, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Code::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Return the ACH transaction + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + RETURN = + T.let( + :RETURN, + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ReportStats::Example::Action::ReturnAction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::ReportStats::Example::Action::Variants + ] + ) + end + def self.variants + end + end + end + + # The evaluation mode of this version during the reported period. + module State + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::AuthRules::ReportStats::State) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let(:ACTIVE, Lithic::AuthRules::ReportStats::State::TaggedSymbol) + SHADOW = + T.let(:SHADOW, Lithic::AuthRules::ReportStats::State::TaggedSymbol) + INACTIVE = + T.let( + :INACTIVE, + Lithic::AuthRules::ReportStats::State::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::AuthRules::ReportStats::State::TaggedSymbol] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/rule_feature.rbi b/rbi/lithic/models/auth_rules/rule_feature.rbi new file mode 100644 index 00000000..6a405e6f --- /dev/null +++ b/rbi/lithic/models/auth_rules/rule_feature.rbi @@ -0,0 +1,553 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + # A feature made available to the rule. The `name` field is the variable name used + # in the rule function signature. The `type` field determines which data the + # feature provides to the rule at evaluation time. + # + # - `AUTHORIZATION`: The authorization request being evaluated. Only available for + # AUTHORIZATION event stream rules. + # - `AUTHENTICATION`: The 3DS authentication request being evaluated. Only + # available for THREE_DS_AUTHENTICATION event stream rules. + # - `TOKENIZATION`: The tokenization request being evaluated. Only available for + # TOKENIZATION event stream rules. + # - `ACH_RECEIPT`: The ACH receipt being evaluated. Only available for + # ACH_CREDIT_RECEIPT and ACH_DEBIT_RECEIPT event stream rules. + # - `CARD_TRANSACTION`: The card transaction being evaluated. Only available for + # CARD_TRANSACTION_UPDATE event stream rules. + # - `CARD`: The card associated with the event. Available for AUTHORIZATION, + # THREE_DS_AUTHENTICATION, and CARD_TRANSACTION_UPDATE event stream rules. + # - `ACCOUNT_HOLDER`: The account holder associated with the card. Available for + # AUTHORIZATION, THREE_DS_AUTHENTICATION, and CARD_TRANSACTION_UPDATE event + # stream rules. + # - `IP_METADATA`: IP address metadata for the request. Available for + # THREE_DS_AUTHENTICATION event stream rules. + # - `SPEND_VELOCITY`: Spend velocity data for the card or account. Requires + # `scope`, `period`, and optionally `filters` to configure the velocity + # calculation. Available for AUTHORIZATION event stream rules. + # - `TRANSACTION_HISTORY_SIGNALS`: Behavioral feature state derived from the + # entity's transaction history. Requires `scope` to specify whether to load + # card, account, or business account history. Available for AUTHORIZATION and + # CARD_TRANSACTION_UPDATE event stream rules. + module RuleFeature + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::AuthRules::RuleFeature::AuthorizationFeature, + Lithic::AuthRules::RuleFeature::AuthenticationFeature, + Lithic::AuthRules::RuleFeature::TokenizationFeature, + Lithic::AuthRules::RuleFeature::ACHReceiptFeature, + Lithic::AuthRules::RuleFeature::CardTransactionFeature, + Lithic::AuthRules::RuleFeature::CardFeature, + Lithic::AuthRules::RuleFeature::AccountHolderFeature, + Lithic::AuthRules::RuleFeature::IPMetadataFeature, + Lithic::AuthRules::RuleFeature::SpendVelocityFeature, + Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature + ) + end + + class AuthorizationFeature < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::RuleFeature::AuthorizationFeature, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Symbol) } + attr_accessor :type + + # The variable name for this feature in the rule function signature + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { params(name: String, type: Symbol).returns(T.attached_class) } + def self.new( + # The variable name for this feature in the rule function signature + name: nil, + type: :AUTHORIZATION + ) + end + + sig { override.returns({ type: Symbol, name: String }) } + def to_hash + end + end + + class AuthenticationFeature < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::RuleFeature::AuthenticationFeature, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Symbol) } + attr_accessor :type + + # The variable name for this feature in the rule function signature + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { params(name: String, type: Symbol).returns(T.attached_class) } + def self.new( + # The variable name for this feature in the rule function signature + name: nil, + type: :AUTHENTICATION + ) + end + + sig { override.returns({ type: Symbol, name: String }) } + def to_hash + end + end + + class TokenizationFeature < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::RuleFeature::TokenizationFeature, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Symbol) } + attr_accessor :type + + # The variable name for this feature in the rule function signature + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { params(name: String, type: Symbol).returns(T.attached_class) } + def self.new( + # The variable name for this feature in the rule function signature + name: nil, + type: :TOKENIZATION + ) + end + + sig { override.returns({ type: Symbol, name: String }) } + def to_hash + end + end + + class ACHReceiptFeature < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::RuleFeature::ACHReceiptFeature, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Symbol) } + attr_accessor :type + + # The variable name for this feature in the rule function signature + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { params(name: String, type: Symbol).returns(T.attached_class) } + def self.new( + # The variable name for this feature in the rule function signature + name: nil, + type: :ACH_RECEIPT + ) + end + + sig { override.returns({ type: Symbol, name: String }) } + def to_hash + end + end + + class CardTransactionFeature < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::RuleFeature::CardTransactionFeature, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Symbol) } + attr_accessor :type + + # The variable name for this feature in the rule function signature + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { params(name: String, type: Symbol).returns(T.attached_class) } + def self.new( + # The variable name for this feature in the rule function signature + name: nil, + type: :CARD_TRANSACTION + ) + end + + sig { override.returns({ type: Symbol, name: String }) } + def to_hash + end + end + + class CardFeature < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::RuleFeature::CardFeature, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Symbol) } + attr_accessor :type + + # The variable name for this feature in the rule function signature + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { params(name: String, type: Symbol).returns(T.attached_class) } + def self.new( + # The variable name for this feature in the rule function signature + name: nil, + type: :CARD + ) + end + + sig { override.returns({ type: Symbol, name: String }) } + def to_hash + end + end + + class AccountHolderFeature < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::RuleFeature::AccountHolderFeature, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Symbol) } + attr_accessor :type + + # The variable name for this feature in the rule function signature + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { params(name: String, type: Symbol).returns(T.attached_class) } + def self.new( + # The variable name for this feature in the rule function signature + name: nil, + type: :ACCOUNT_HOLDER + ) + end + + sig { override.returns({ type: Symbol, name: String }) } + def to_hash + end + end + + class IPMetadataFeature < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::RuleFeature::IPMetadataFeature, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Symbol) } + attr_accessor :type + + # The variable name for this feature in the rule function signature + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { params(name: String, type: Symbol).returns(T.attached_class) } + def self.new( + # The variable name for this feature in the rule function signature + name: nil, + type: :IP_METADATA + ) + end + + sig { override.returns({ type: Symbol, name: String }) } + def to_hash + end + end + + class SpendVelocityFeature < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::RuleFeature::SpendVelocityFeature, + Lithic::Internal::AnyHash + ) + end + + # Velocity over the current day since 00:00 / 12 AM in Eastern Time + sig do + returns( + T.any( + Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowDay, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowWeek, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowMonth, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear + ) + ) + end + attr_accessor :period + + # The scope the velocity is calculated for + sig do + returns( + Lithic::AuthRules::RuleFeature::SpendVelocityFeature::Scope::OrSymbol + ) + end + attr_accessor :scope + + sig { returns(Symbol) } + attr_accessor :type + + sig { returns(T.nilable(Lithic::AuthRules::VelocityLimitFilters)) } + attr_reader :filters + + sig do + params( + filters: Lithic::AuthRules::VelocityLimitFilters::OrHash + ).void + end + attr_writer :filters + + # The variable name for this feature in the rule function signature + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig do + params( + period: + T.any( + Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject::OrHash, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowDay::OrHash, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowWeek::OrHash, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowMonth::OrHash, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear::OrHash + ), + scope: + Lithic::AuthRules::RuleFeature::SpendVelocityFeature::Scope::OrSymbol, + filters: Lithic::AuthRules::VelocityLimitFilters::OrHash, + name: String, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Velocity over the current day since 00:00 / 12 AM in Eastern Time + period:, + # The scope the velocity is calculated for + scope:, + filters: nil, + # The variable name for this feature in the rule function signature + name: nil, + type: :SPEND_VELOCITY + ) + end + + sig do + override.returns( + { + period: + T.any( + Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowDay, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowWeek, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowMonth, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear + ), + scope: + Lithic::AuthRules::RuleFeature::SpendVelocityFeature::Scope::OrSymbol, + type: Symbol, + filters: Lithic::AuthRules::VelocityLimitFilters, + name: String + } + ) + end + def to_hash + end + + # The scope the velocity is calculated for + module Scope + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::RuleFeature::SpendVelocityFeature::Scope + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CARD = + T.let( + :CARD, + Lithic::AuthRules::RuleFeature::SpendVelocityFeature::Scope::TaggedSymbol + ) + ACCOUNT = + T.let( + :ACCOUNT, + Lithic::AuthRules::RuleFeature::SpendVelocityFeature::Scope::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::RuleFeature::SpendVelocityFeature::Scope::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class TransactionHistorySignalsFeature < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature, + Lithic::Internal::AnyHash + ) + end + + # The entity scope to load transaction history signals for. + sig do + returns( + Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature::Scope::OrSymbol + ) + end + attr_accessor :scope + + sig { returns(Symbol) } + attr_accessor :type + + # The variable name for this feature in the rule function signature + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig do + params( + scope: + Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature::Scope::OrSymbol, + name: String, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The entity scope to load transaction history signals for. + scope:, + # The variable name for this feature in the rule function signature + name: nil, + type: :TRANSACTION_HISTORY_SIGNALS + ) + end + + sig do + override.returns( + { + scope: + Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature::Scope::OrSymbol, + type: Symbol, + name: String + } + ) + end + def to_hash + end + + # The entity scope to load transaction history signals for. + module Scope + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature::Scope + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CARD = + T.let( + :CARD, + Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature::Scope::TaggedSymbol + ) + ACCOUNT = + T.let( + :ACCOUNT, + Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature::Scope::TaggedSymbol + ) + BUSINESS_ACCOUNT = + T.let( + :BUSINESS_ACCOUNT, + Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature::Scope::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature::Scope::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig do + override.returns(T::Array[Lithic::AuthRules::RuleFeature::Variants]) + end + def self.variants + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/spend_velocity_filters.rbi b/rbi/lithic/models/auth_rules/spend_velocity_filters.rbi new file mode 100644 index 00000000..0bafc15e --- /dev/null +++ b/rbi/lithic/models/auth_rules/spend_velocity_filters.rbi @@ -0,0 +1,58 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class SpendVelocityFilters < Lithic::Models::AuthRules::VelocityLimitFilters + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::SpendVelocityFilters, + Lithic::Internal::AnyHash + ) + end + + # Tag key-value pairs to exclude from the velocity calculation. Transactions + # matching all specified tag key-value pairs will be excluded from the calculated + # velocity. + sig { returns(T.nilable(T::Hash[Symbol, String])) } + attr_accessor :exclude_tags + + # Tag key-value pairs to include in the velocity calculation. Only transactions + # matching all specified tag key-value pairs will be included in the calculated + # velocity. + sig { returns(T.nilable(T::Hash[Symbol, String])) } + attr_accessor :include_tags + + sig do + params( + exclude_tags: T.nilable(T::Hash[Symbol, String]), + include_tags: T.nilable(T::Hash[Symbol, String]) + ).returns(T.attached_class) + end + def self.new( + # Tag key-value pairs to exclude from the velocity calculation. Transactions + # matching all specified tag key-value pairs will be excluded from the calculated + # velocity. + exclude_tags: nil, + # Tag key-value pairs to include in the velocity calculation. Only transactions + # matching all specified tag key-value pairs will be included in the calculated + # velocity. + include_tags: nil + ) + end + + sig do + override.returns( + { + exclude_tags: T.nilable(T::Hash[Symbol, String]), + include_tags: T.nilable(T::Hash[Symbol, String]) + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/typescript_code_parameters.rbi b/rbi/lithic/models/auth_rules/typescript_code_parameters.rbi new file mode 100644 index 00000000..15c0c6c6 --- /dev/null +++ b/rbi/lithic/models/auth_rules/typescript_code_parameters.rbi @@ -0,0 +1,100 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class TypescriptCodeParameters < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::TypescriptCodeParameters, + Lithic::Internal::AnyHash + ) + end + + # The TypeScript source code of the rule. Must define a `rule()` function that + # accepts the declared features as positional arguments (in the same order as the + # `features` array) and returns an array of actions. + sig { returns(String) } + attr_accessor :code + + # Features available to the TypeScript code at evaluation time + sig do + returns( + T::Array[ + T.any( + Lithic::AuthRules::RuleFeature::AuthorizationFeature, + Lithic::AuthRules::RuleFeature::AuthenticationFeature, + Lithic::AuthRules::RuleFeature::TokenizationFeature, + Lithic::AuthRules::RuleFeature::ACHReceiptFeature, + Lithic::AuthRules::RuleFeature::CardTransactionFeature, + Lithic::AuthRules::RuleFeature::CardFeature, + Lithic::AuthRules::RuleFeature::AccountHolderFeature, + Lithic::AuthRules::RuleFeature::IPMetadataFeature, + Lithic::AuthRules::RuleFeature::SpendVelocityFeature, + Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature + ) + ] + ) + end + attr_accessor :features + + # Parameters for defining a TypeScript code rule + sig do + params( + code: String, + features: + T::Array[ + T.any( + Lithic::AuthRules::RuleFeature::AuthorizationFeature::OrHash, + Lithic::AuthRules::RuleFeature::AuthenticationFeature::OrHash, + Lithic::AuthRules::RuleFeature::TokenizationFeature::OrHash, + Lithic::AuthRules::RuleFeature::ACHReceiptFeature::OrHash, + Lithic::AuthRules::RuleFeature::CardTransactionFeature::OrHash, + Lithic::AuthRules::RuleFeature::CardFeature::OrHash, + Lithic::AuthRules::RuleFeature::AccountHolderFeature::OrHash, + Lithic::AuthRules::RuleFeature::IPMetadataFeature::OrHash, + Lithic::AuthRules::RuleFeature::SpendVelocityFeature::OrHash, + Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature::OrHash + ) + ] + ).returns(T.attached_class) + end + def self.new( + # The TypeScript source code of the rule. Must define a `rule()` function that + # accepts the declared features as positional arguments (in the same order as the + # `features` array) and returns an array of actions. + code:, + # Features available to the TypeScript code at evaluation time + features: + ) + end + + sig do + override.returns( + { + code: String, + features: + T::Array[ + T.any( + Lithic::AuthRules::RuleFeature::AuthorizationFeature, + Lithic::AuthRules::RuleFeature::AuthenticationFeature, + Lithic::AuthRules::RuleFeature::TokenizationFeature, + Lithic::AuthRules::RuleFeature::ACHReceiptFeature, + Lithic::AuthRules::RuleFeature::CardTransactionFeature, + Lithic::AuthRules::RuleFeature::CardFeature, + Lithic::AuthRules::RuleFeature::AccountHolderFeature, + Lithic::AuthRules::RuleFeature::IPMetadataFeature, + Lithic::AuthRules::RuleFeature::SpendVelocityFeature, + Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature + ) + ] + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/v2/backtest_create_params.rbi b/rbi/lithic/models/auth_rules/v2/backtest_create_params.rbi new file mode 100644 index 00000000..7a98059c --- /dev/null +++ b/rbi/lithic/models/auth_rules/v2/backtest_create_params.rbi @@ -0,0 +1,70 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + module V2 + class BacktestCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::V2::BacktestCreateParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :auth_rule_token + + # The end time of the backtest. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # The start time of the backtest. + sig { returns(T.nilable(Time)) } + attr_reader :start + + sig { params(start: Time).void } + attr_writer :start + + sig do + params( + auth_rule_token: String, + end_: Time, + start: Time, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + auth_rule_token:, + # The end time of the backtest. + end_: nil, + # The start time of the backtest. + start: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + auth_rule_token: String, + end_: Time, + start: Time, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/v2/backtest_create_response.rbi b/rbi/lithic/models/auth_rules/v2/backtest_create_response.rbi new file mode 100644 index 00000000..d6483ddb --- /dev/null +++ b/rbi/lithic/models/auth_rules/v2/backtest_create_response.rbi @@ -0,0 +1,37 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + module V2 + class BacktestCreateResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AuthRules::V2::BacktestCreateResponse, + Lithic::Internal::AnyHash + ) + end + + # Auth Rule Backtest Token + sig { returns(T.nilable(String)) } + attr_reader :backtest_token + + sig { params(backtest_token: String).void } + attr_writer :backtest_token + + sig { params(backtest_token: String).returns(T.attached_class) } + def self.new( + # Auth Rule Backtest Token + backtest_token: nil + ) + end + + sig { override.returns({ backtest_token: String }) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/v2/backtest_results.rbi b/rbi/lithic/models/auth_rules/v2/backtest_results.rbi new file mode 100644 index 00000000..6a4acd03 --- /dev/null +++ b/rbi/lithic/models/auth_rules/v2/backtest_results.rbi @@ -0,0 +1,162 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + module V2 + class BacktestResults < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::V2::BacktestResults, + Lithic::Internal::AnyHash + ) + end + + # Auth Rule Backtest Token + sig { returns(String) } + attr_accessor :backtest_token + + sig { returns(Lithic::AuthRules::V2::BacktestResults::Results) } + attr_reader :results + + sig do + params( + results: Lithic::AuthRules::V2::BacktestResults::Results::OrHash + ).void + end + attr_writer :results + + sig do + returns( + Lithic::AuthRules::V2::BacktestResults::SimulationParameters + ) + end + attr_reader :simulation_parameters + + sig do + params( + simulation_parameters: + Lithic::AuthRules::V2::BacktestResults::SimulationParameters::OrHash + ).void + end + attr_writer :simulation_parameters + + sig do + params( + backtest_token: String, + results: Lithic::AuthRules::V2::BacktestResults::Results::OrHash, + simulation_parameters: + Lithic::AuthRules::V2::BacktestResults::SimulationParameters::OrHash + ).returns(T.attached_class) + end + def self.new( + # Auth Rule Backtest Token + backtest_token:, + results:, + simulation_parameters: + ) + end + + sig do + override.returns( + { + backtest_token: String, + results: Lithic::AuthRules::V2::BacktestResults::Results, + simulation_parameters: + Lithic::AuthRules::V2::BacktestResults::SimulationParameters + } + ) + end + def to_hash + end + + class Results < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::V2::BacktestResults::Results, + Lithic::Internal::AnyHash + ) + end + + sig { returns(T.nilable(Lithic::AuthRules::BacktestStats)) } + attr_reader :current_version + + sig do + params( + current_version: + T.nilable(Lithic::AuthRules::BacktestStats::OrHash) + ).void + end + attr_writer :current_version + + sig { returns(T.nilable(Lithic::AuthRules::BacktestStats)) } + attr_reader :draft_version + + sig do + params( + draft_version: + T.nilable(Lithic::AuthRules::BacktestStats::OrHash) + ).void + end + attr_writer :draft_version + + sig do + params( + current_version: + T.nilable(Lithic::AuthRules::BacktestStats::OrHash), + draft_version: + T.nilable(Lithic::AuthRules::BacktestStats::OrHash) + ).returns(T.attached_class) + end + def self.new(current_version: nil, draft_version: nil) + end + + sig do + override.returns( + { + current_version: T.nilable(Lithic::AuthRules::BacktestStats), + draft_version: T.nilable(Lithic::AuthRules::BacktestStats) + } + ) + end + def to_hash + end + end + + class SimulationParameters < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::V2::BacktestResults::SimulationParameters, + Lithic::Internal::AnyHash + ) + end + + # The end time of the simulation + sig { returns(Time) } + attr_accessor :end_ + + # The start time of the simulation + sig { returns(Time) } + attr_accessor :start + + sig { params(end_: Time, start: Time).returns(T.attached_class) } + def self.new( + # The end time of the simulation + end_:, + # The start time of the simulation + start: + ) + end + + sig { override.returns({ end_: Time, start: Time }) } + def to_hash + end + end + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/v2/backtest_retrieve_params.rbi b/rbi/lithic/models/auth_rules/v2/backtest_retrieve_params.rbi new file mode 100644 index 00000000..74a3a9c8 --- /dev/null +++ b/rbi/lithic/models/auth_rules/v2/backtest_retrieve_params.rbi @@ -0,0 +1,54 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + module V2 + class BacktestRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::V2::BacktestRetrieveParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :auth_rule_token + + sig { returns(String) } + attr_accessor :auth_rule_backtest_token + + sig do + params( + auth_rule_token: String, + auth_rule_backtest_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + auth_rule_token:, + auth_rule_backtest_token:, + request_options: {} + ) + end + + sig do + override.returns( + { + auth_rule_token: String, + auth_rule_backtest_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/v2_create_params.rbi b/rbi/lithic/models/auth_rules/v2_create_params.rbi new file mode 100644 index 00000000..9cabfae4 --- /dev/null +++ b/rbi/lithic/models/auth_rules/v2_create_params.rbi @@ -0,0 +1,854 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2CreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::AuthRules::V2CreateParams, Lithic::Internal::AnyHash) + end + + sig do + returns( + T.any( + Lithic::AuthRules::V2CreateParams::Body::AccountLevelRule, + Lithic::AuthRules::V2CreateParams::Body::CardLevelRule, + Lithic::AuthRules::V2CreateParams::Body::ProgramLevelRule + ) + ) + end + attr_accessor :body + + sig do + params( + body: + T.any( + Lithic::AuthRules::V2CreateParams::Body::AccountLevelRule::OrHash, + Lithic::AuthRules::V2CreateParams::Body::CardLevelRule::OrHash, + Lithic::AuthRules::V2CreateParams::Body::ProgramLevelRule::OrHash + ), + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(body:, request_options: {}) + end + + sig do + override.returns( + { + body: + T.any( + Lithic::AuthRules::V2CreateParams::Body::AccountLevelRule, + Lithic::AuthRules::V2CreateParams::Body::CardLevelRule, + Lithic::AuthRules::V2CreateParams::Body::ProgramLevelRule + ), + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + module Body + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::AuthRules::V2CreateParams::Body::AccountLevelRule, + Lithic::AuthRules::V2CreateParams::Body::CardLevelRule, + Lithic::AuthRules::V2CreateParams::Body::ProgramLevelRule + ) + end + + class AccountLevelRule < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::V2CreateParams::Body::AccountLevelRule, + Lithic::Internal::AnyHash + ) + end + + # Parameters for the Auth Rule + sig do + returns( + T.any( + Lithic::AuthRules::ConditionalBlockParameters, + Lithic::AuthRules::VelocityLimitParams, + Lithic::AuthRules::MerchantLockParameters, + Lithic::AuthRules::Conditional3DSActionParameters, + Lithic::AuthRules::ConditionalAuthorizationActionParameters, + Lithic::AuthRules::ConditionalACHActionParameters, + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters, + Lithic::AuthRules::TypescriptCodeParameters, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters + ) + ) + end + attr_accessor :parameters + + # The type of Auth Rule. For certain rule types, this determines the event stream + # during which it will be evaluated. For rules that can be applied to one of + # several event streams, the effective one is defined by the separate + # `event_stream` field. + # + # - `CONDITIONAL_BLOCK`: Deprecated. Use `CONDITIONAL_ACTION` instead. + # AUTHORIZATION event stream. + # - `VELOCITY_LIMIT`: AUTHORIZATION event stream. + # - `MERCHANT_LOCK`: AUTHORIZATION event stream. + # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + sig do + returns( + Lithic::AuthRules::V2CreateParams::Body::AccountLevelRule::Type::OrSymbol + ) + end + attr_accessor :type + + # Account tokens to which the Auth Rule applies. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :account_tokens + + sig { params(account_tokens: T::Array[String]).void } + attr_writer :account_tokens + + # Business Account tokens to which the Auth Rule applies. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :business_account_tokens + + sig { params(business_account_tokens: T::Array[String]).void } + attr_writer :business_account_tokens + + # The event stream during which the rule will be evaluated. + sig { returns(T.nilable(Lithic::AuthRules::EventStream::OrSymbol)) } + attr_reader :event_stream + + sig do + params( + event_stream: Lithic::AuthRules::EventStream::OrSymbol + ).void + end + attr_writer :event_stream + + # Auth Rule Name + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig do + params( + parameters: + T.any( + Lithic::AuthRules::ConditionalBlockParameters::OrHash, + Lithic::AuthRules::VelocityLimitParams::OrHash, + Lithic::AuthRules::MerchantLockParameters::OrHash, + Lithic::AuthRules::Conditional3DSActionParameters::OrHash, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::OrHash, + Lithic::AuthRules::ConditionalACHActionParameters::OrHash, + Lithic::AuthRules::ConditionalTokenizationActionParameters::OrHash, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::OrHash, + Lithic::AuthRules::TypescriptCodeParameters::OrHash, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::OrHash + ), + type: + Lithic::AuthRules::V2CreateParams::Body::AccountLevelRule::Type::OrSymbol, + account_tokens: T::Array[String], + business_account_tokens: T::Array[String], + event_stream: Lithic::AuthRules::EventStream::OrSymbol, + name: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Parameters for the Auth Rule + parameters:, + # The type of Auth Rule. For certain rule types, this determines the event stream + # during which it will be evaluated. For rules that can be applied to one of + # several event streams, the effective one is defined by the separate + # `event_stream` field. + # + # - `CONDITIONAL_BLOCK`: Deprecated. Use `CONDITIONAL_ACTION` instead. + # AUTHORIZATION event stream. + # - `VELOCITY_LIMIT`: AUTHORIZATION event stream. + # - `MERCHANT_LOCK`: AUTHORIZATION event stream. + # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + type:, + # Account tokens to which the Auth Rule applies. + account_tokens: nil, + # Business Account tokens to which the Auth Rule applies. + business_account_tokens: nil, + # The event stream during which the rule will be evaluated. + event_stream: nil, + # Auth Rule Name + name: nil + ) + end + + sig do + override.returns( + { + parameters: + T.any( + Lithic::AuthRules::ConditionalBlockParameters, + Lithic::AuthRules::VelocityLimitParams, + Lithic::AuthRules::MerchantLockParameters, + Lithic::AuthRules::Conditional3DSActionParameters, + Lithic::AuthRules::ConditionalAuthorizationActionParameters, + Lithic::AuthRules::ConditionalACHActionParameters, + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters, + Lithic::AuthRules::TypescriptCodeParameters, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters + ), + type: + Lithic::AuthRules::V2CreateParams::Body::AccountLevelRule::Type::OrSymbol, + account_tokens: T::Array[String], + business_account_tokens: T::Array[String], + event_stream: Lithic::AuthRules::EventStream::OrSymbol, + name: T.nilable(String) + } + ) + end + def to_hash + end + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::AuthRules::ConditionalBlockParameters, + Lithic::AuthRules::VelocityLimitParams, + Lithic::AuthRules::MerchantLockParameters, + Lithic::AuthRules::Conditional3DSActionParameters, + Lithic::AuthRules::ConditionalAuthorizationActionParameters, + Lithic::AuthRules::ConditionalACHActionParameters, + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters, + Lithic::AuthRules::TypescriptCodeParameters, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters + ) + end + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::V2CreateParams::Body::AccountLevelRule::Parameters::Variants + ] + ) + end + def self.variants + end + end + + # The type of Auth Rule. For certain rule types, this determines the event stream + # during which it will be evaluated. For rules that can be applied to one of + # several event streams, the effective one is defined by the separate + # `event_stream` field. + # + # - `CONDITIONAL_BLOCK`: Deprecated. Use `CONDITIONAL_ACTION` instead. + # AUTHORIZATION event stream. + # - `VELOCITY_LIMIT`: AUTHORIZATION event stream. + # - `MERCHANT_LOCK`: AUTHORIZATION event stream. + # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::V2CreateParams::Body::AccountLevelRule::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CONDITIONAL_BLOCK = + T.let( + :CONDITIONAL_BLOCK, + Lithic::AuthRules::V2CreateParams::Body::AccountLevelRule::Type::TaggedSymbol + ) + VELOCITY_LIMIT = + T.let( + :VELOCITY_LIMIT, + Lithic::AuthRules::V2CreateParams::Body::AccountLevelRule::Type::TaggedSymbol + ) + MERCHANT_LOCK = + T.let( + :MERCHANT_LOCK, + Lithic::AuthRules::V2CreateParams::Body::AccountLevelRule::Type::TaggedSymbol + ) + CONDITIONAL_ACTION = + T.let( + :CONDITIONAL_ACTION, + Lithic::AuthRules::V2CreateParams::Body::AccountLevelRule::Type::TaggedSymbol + ) + TYPESCRIPT_CODE = + T.let( + :TYPESCRIPT_CODE, + Lithic::AuthRules::V2CreateParams::Body::AccountLevelRule::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::V2CreateParams::Body::AccountLevelRule::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class CardLevelRule < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::V2CreateParams::Body::CardLevelRule, + Lithic::Internal::AnyHash + ) + end + + # Card tokens to which the Auth Rule applies. + sig { returns(T::Array[String]) } + attr_accessor :card_tokens + + # Parameters for the Auth Rule + sig do + returns( + T.any( + Lithic::AuthRules::ConditionalBlockParameters, + Lithic::AuthRules::VelocityLimitParams, + Lithic::AuthRules::MerchantLockParameters, + Lithic::AuthRules::Conditional3DSActionParameters, + Lithic::AuthRules::ConditionalAuthorizationActionParameters, + Lithic::AuthRules::ConditionalACHActionParameters, + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters, + Lithic::AuthRules::TypescriptCodeParameters, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters + ) + ) + end + attr_accessor :parameters + + # The type of Auth Rule. For certain rule types, this determines the event stream + # during which it will be evaluated. For rules that can be applied to one of + # several event streams, the effective one is defined by the separate + # `event_stream` field. + # + # - `CONDITIONAL_BLOCK`: Deprecated. Use `CONDITIONAL_ACTION` instead. + # AUTHORIZATION event stream. + # - `VELOCITY_LIMIT`: AUTHORIZATION event stream. + # - `MERCHANT_LOCK`: AUTHORIZATION event stream. + # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + sig do + returns( + Lithic::AuthRules::V2CreateParams::Body::CardLevelRule::Type::OrSymbol + ) + end + attr_accessor :type + + # The event stream during which the rule will be evaluated. + sig { returns(T.nilable(Lithic::AuthRules::EventStream::OrSymbol)) } + attr_reader :event_stream + + sig do + params( + event_stream: Lithic::AuthRules::EventStream::OrSymbol + ).void + end + attr_writer :event_stream + + # Auth Rule Name + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig do + params( + card_tokens: T::Array[String], + parameters: + T.any( + Lithic::AuthRules::ConditionalBlockParameters::OrHash, + Lithic::AuthRules::VelocityLimitParams::OrHash, + Lithic::AuthRules::MerchantLockParameters::OrHash, + Lithic::AuthRules::Conditional3DSActionParameters::OrHash, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::OrHash, + Lithic::AuthRules::ConditionalACHActionParameters::OrHash, + Lithic::AuthRules::ConditionalTokenizationActionParameters::OrHash, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::OrHash, + Lithic::AuthRules::TypescriptCodeParameters::OrHash, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::OrHash + ), + type: + Lithic::AuthRules::V2CreateParams::Body::CardLevelRule::Type::OrSymbol, + event_stream: Lithic::AuthRules::EventStream::OrSymbol, + name: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Card tokens to which the Auth Rule applies. + card_tokens:, + # Parameters for the Auth Rule + parameters:, + # The type of Auth Rule. For certain rule types, this determines the event stream + # during which it will be evaluated. For rules that can be applied to one of + # several event streams, the effective one is defined by the separate + # `event_stream` field. + # + # - `CONDITIONAL_BLOCK`: Deprecated. Use `CONDITIONAL_ACTION` instead. + # AUTHORIZATION event stream. + # - `VELOCITY_LIMIT`: AUTHORIZATION event stream. + # - `MERCHANT_LOCK`: AUTHORIZATION event stream. + # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + type:, + # The event stream during which the rule will be evaluated. + event_stream: nil, + # Auth Rule Name + name: nil + ) + end + + sig do + override.returns( + { + card_tokens: T::Array[String], + parameters: + T.any( + Lithic::AuthRules::ConditionalBlockParameters, + Lithic::AuthRules::VelocityLimitParams, + Lithic::AuthRules::MerchantLockParameters, + Lithic::AuthRules::Conditional3DSActionParameters, + Lithic::AuthRules::ConditionalAuthorizationActionParameters, + Lithic::AuthRules::ConditionalACHActionParameters, + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters, + Lithic::AuthRules::TypescriptCodeParameters, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters + ), + type: + Lithic::AuthRules::V2CreateParams::Body::CardLevelRule::Type::OrSymbol, + event_stream: Lithic::AuthRules::EventStream::OrSymbol, + name: T.nilable(String) + } + ) + end + def to_hash + end + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::AuthRules::ConditionalBlockParameters, + Lithic::AuthRules::VelocityLimitParams, + Lithic::AuthRules::MerchantLockParameters, + Lithic::AuthRules::Conditional3DSActionParameters, + Lithic::AuthRules::ConditionalAuthorizationActionParameters, + Lithic::AuthRules::ConditionalACHActionParameters, + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters, + Lithic::AuthRules::TypescriptCodeParameters, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters + ) + end + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::V2CreateParams::Body::CardLevelRule::Parameters::Variants + ] + ) + end + def self.variants + end + end + + # The type of Auth Rule. For certain rule types, this determines the event stream + # during which it will be evaluated. For rules that can be applied to one of + # several event streams, the effective one is defined by the separate + # `event_stream` field. + # + # - `CONDITIONAL_BLOCK`: Deprecated. Use `CONDITIONAL_ACTION` instead. + # AUTHORIZATION event stream. + # - `VELOCITY_LIMIT`: AUTHORIZATION event stream. + # - `MERCHANT_LOCK`: AUTHORIZATION event stream. + # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::V2CreateParams::Body::CardLevelRule::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CONDITIONAL_BLOCK = + T.let( + :CONDITIONAL_BLOCK, + Lithic::AuthRules::V2CreateParams::Body::CardLevelRule::Type::TaggedSymbol + ) + VELOCITY_LIMIT = + T.let( + :VELOCITY_LIMIT, + Lithic::AuthRules::V2CreateParams::Body::CardLevelRule::Type::TaggedSymbol + ) + MERCHANT_LOCK = + T.let( + :MERCHANT_LOCK, + Lithic::AuthRules::V2CreateParams::Body::CardLevelRule::Type::TaggedSymbol + ) + CONDITIONAL_ACTION = + T.let( + :CONDITIONAL_ACTION, + Lithic::AuthRules::V2CreateParams::Body::CardLevelRule::Type::TaggedSymbol + ) + TYPESCRIPT_CODE = + T.let( + :TYPESCRIPT_CODE, + Lithic::AuthRules::V2CreateParams::Body::CardLevelRule::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::V2CreateParams::Body::CardLevelRule::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class ProgramLevelRule < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::V2CreateParams::Body::ProgramLevelRule, + Lithic::Internal::AnyHash + ) + end + + # Parameters for the Auth Rule + sig do + returns( + T.any( + Lithic::AuthRules::ConditionalBlockParameters, + Lithic::AuthRules::VelocityLimitParams, + Lithic::AuthRules::MerchantLockParameters, + Lithic::AuthRules::Conditional3DSActionParameters, + Lithic::AuthRules::ConditionalAuthorizationActionParameters, + Lithic::AuthRules::ConditionalACHActionParameters, + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters, + Lithic::AuthRules::TypescriptCodeParameters, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters + ) + ) + end + attr_accessor :parameters + + # Whether the Auth Rule applies to all authorizations on the card program. + sig { returns(T::Boolean) } + attr_accessor :program_level + + # The type of Auth Rule. For certain rule types, this determines the event stream + # during which it will be evaluated. For rules that can be applied to one of + # several event streams, the effective one is defined by the separate + # `event_stream` field. + # + # - `CONDITIONAL_BLOCK`: Deprecated. Use `CONDITIONAL_ACTION` instead. + # AUTHORIZATION event stream. + # - `VELOCITY_LIMIT`: AUTHORIZATION event stream. + # - `MERCHANT_LOCK`: AUTHORIZATION event stream. + # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + sig do + returns( + Lithic::AuthRules::V2CreateParams::Body::ProgramLevelRule::Type::OrSymbol + ) + end + attr_accessor :type + + # The event stream during which the rule will be evaluated. + sig { returns(T.nilable(Lithic::AuthRules::EventStream::OrSymbol)) } + attr_reader :event_stream + + sig do + params( + event_stream: Lithic::AuthRules::EventStream::OrSymbol + ).void + end + attr_writer :event_stream + + # Account tokens to which the Auth Rule does not apply. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :excluded_account_tokens + + sig { params(excluded_account_tokens: T::Array[String]).void } + attr_writer :excluded_account_tokens + + # Business account tokens to which the Auth Rule does not apply. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :excluded_business_account_tokens + + sig do + params(excluded_business_account_tokens: T::Array[String]).void + end + attr_writer :excluded_business_account_tokens + + # Card tokens to which the Auth Rule does not apply. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :excluded_card_tokens + + sig { params(excluded_card_tokens: T::Array[String]).void } + attr_writer :excluded_card_tokens + + # Auth Rule Name + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig do + params( + parameters: + T.any( + Lithic::AuthRules::ConditionalBlockParameters::OrHash, + Lithic::AuthRules::VelocityLimitParams::OrHash, + Lithic::AuthRules::MerchantLockParameters::OrHash, + Lithic::AuthRules::Conditional3DSActionParameters::OrHash, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::OrHash, + Lithic::AuthRules::ConditionalACHActionParameters::OrHash, + Lithic::AuthRules::ConditionalTokenizationActionParameters::OrHash, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::OrHash, + Lithic::AuthRules::TypescriptCodeParameters::OrHash, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::OrHash + ), + program_level: T::Boolean, + type: + Lithic::AuthRules::V2CreateParams::Body::ProgramLevelRule::Type::OrSymbol, + event_stream: Lithic::AuthRules::EventStream::OrSymbol, + excluded_account_tokens: T::Array[String], + excluded_business_account_tokens: T::Array[String], + excluded_card_tokens: T::Array[String], + name: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Parameters for the Auth Rule + parameters:, + # Whether the Auth Rule applies to all authorizations on the card program. + program_level:, + # The type of Auth Rule. For certain rule types, this determines the event stream + # during which it will be evaluated. For rules that can be applied to one of + # several event streams, the effective one is defined by the separate + # `event_stream` field. + # + # - `CONDITIONAL_BLOCK`: Deprecated. Use `CONDITIONAL_ACTION` instead. + # AUTHORIZATION event stream. + # - `VELOCITY_LIMIT`: AUTHORIZATION event stream. + # - `MERCHANT_LOCK`: AUTHORIZATION event stream. + # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + type:, + # The event stream during which the rule will be evaluated. + event_stream: nil, + # Account tokens to which the Auth Rule does not apply. + excluded_account_tokens: nil, + # Business account tokens to which the Auth Rule does not apply. + excluded_business_account_tokens: nil, + # Card tokens to which the Auth Rule does not apply. + excluded_card_tokens: nil, + # Auth Rule Name + name: nil + ) + end + + sig do + override.returns( + { + parameters: + T.any( + Lithic::AuthRules::ConditionalBlockParameters, + Lithic::AuthRules::VelocityLimitParams, + Lithic::AuthRules::MerchantLockParameters, + Lithic::AuthRules::Conditional3DSActionParameters, + Lithic::AuthRules::ConditionalAuthorizationActionParameters, + Lithic::AuthRules::ConditionalACHActionParameters, + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters, + Lithic::AuthRules::TypescriptCodeParameters, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters + ), + program_level: T::Boolean, + type: + Lithic::AuthRules::V2CreateParams::Body::ProgramLevelRule::Type::OrSymbol, + event_stream: Lithic::AuthRules::EventStream::OrSymbol, + excluded_account_tokens: T::Array[String], + excluded_business_account_tokens: T::Array[String], + excluded_card_tokens: T::Array[String], + name: T.nilable(String) + } + ) + end + def to_hash + end + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::AuthRules::ConditionalBlockParameters, + Lithic::AuthRules::VelocityLimitParams, + Lithic::AuthRules::MerchantLockParameters, + Lithic::AuthRules::Conditional3DSActionParameters, + Lithic::AuthRules::ConditionalAuthorizationActionParameters, + Lithic::AuthRules::ConditionalACHActionParameters, + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters, + Lithic::AuthRules::TypescriptCodeParameters, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters + ) + end + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::V2CreateParams::Body::ProgramLevelRule::Parameters::Variants + ] + ) + end + def self.variants + end + end + + # The type of Auth Rule. For certain rule types, this determines the event stream + # during which it will be evaluated. For rules that can be applied to one of + # several event streams, the effective one is defined by the separate + # `event_stream` field. + # + # - `CONDITIONAL_BLOCK`: Deprecated. Use `CONDITIONAL_ACTION` instead. + # AUTHORIZATION event stream. + # - `VELOCITY_LIMIT`: AUTHORIZATION event stream. + # - `MERCHANT_LOCK`: AUTHORIZATION event stream. + # - `CONDITIONAL_ACTION`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + # - `TYPESCRIPT_CODE`: AUTHORIZATION, THREE_DS_AUTHENTICATION, TOKENIZATION, + # ACH_CREDIT_RECEIPT, ACH_DEBIT_RECEIPT, or CARD_TRANSACTION_UPDATE event + # stream. + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::V2CreateParams::Body::ProgramLevelRule::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CONDITIONAL_BLOCK = + T.let( + :CONDITIONAL_BLOCK, + Lithic::AuthRules::V2CreateParams::Body::ProgramLevelRule::Type::TaggedSymbol + ) + VELOCITY_LIMIT = + T.let( + :VELOCITY_LIMIT, + Lithic::AuthRules::V2CreateParams::Body::ProgramLevelRule::Type::TaggedSymbol + ) + MERCHANT_LOCK = + T.let( + :MERCHANT_LOCK, + Lithic::AuthRules::V2CreateParams::Body::ProgramLevelRule::Type::TaggedSymbol + ) + CONDITIONAL_ACTION = + T.let( + :CONDITIONAL_ACTION, + Lithic::AuthRules::V2CreateParams::Body::ProgramLevelRule::Type::TaggedSymbol + ) + TYPESCRIPT_CODE = + T.let( + :TYPESCRIPT_CODE, + Lithic::AuthRules::V2CreateParams::Body::ProgramLevelRule::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::V2CreateParams::Body::ProgramLevelRule::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig do + override.returns( + T::Array[Lithic::AuthRules::V2CreateParams::Body::Variants] + ) + end + def self.variants + end + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/v2_delete_params.rbi b/rbi/lithic/models/auth_rules/v2_delete_params.rbi new file mode 100644 index 00000000..a409c81c --- /dev/null +++ b/rbi/lithic/models/auth_rules/v2_delete_params.rbi @@ -0,0 +1,37 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2DeleteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::AuthRules::V2DeleteParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :auth_rule_token + + sig do + params( + auth_rule_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(auth_rule_token:, request_options: {}) + end + + sig do + override.returns( + { auth_rule_token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/v2_draft_params.rbi b/rbi/lithic/models/auth_rules/v2_draft_params.rbi new file mode 100644 index 00000000..d7988bbd --- /dev/null +++ b/rbi/lithic/models/auth_rules/v2_draft_params.rbi @@ -0,0 +1,125 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2DraftParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::AuthRules::V2DraftParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :auth_rule_token + + # Parameters for the Auth Rule + sig do + returns( + T.nilable( + T.any( + Lithic::AuthRules::ConditionalBlockParameters, + Lithic::AuthRules::VelocityLimitParams, + Lithic::AuthRules::MerchantLockParameters, + Lithic::AuthRules::Conditional3DSActionParameters, + Lithic::AuthRules::ConditionalAuthorizationActionParameters, + Lithic::AuthRules::ConditionalACHActionParameters, + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters, + Lithic::AuthRules::TypescriptCodeParameters, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters + ) + ) + ) + end + attr_accessor :parameters + + sig do + params( + auth_rule_token: String, + parameters: + T.nilable( + T.any( + Lithic::AuthRules::ConditionalBlockParameters::OrHash, + Lithic::AuthRules::VelocityLimitParams::OrHash, + Lithic::AuthRules::MerchantLockParameters::OrHash, + Lithic::AuthRules::Conditional3DSActionParameters::OrHash, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::OrHash, + Lithic::AuthRules::ConditionalACHActionParameters::OrHash, + Lithic::AuthRules::ConditionalTokenizationActionParameters::OrHash, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::OrHash, + Lithic::AuthRules::TypescriptCodeParameters::OrHash, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::OrHash + ) + ), + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + auth_rule_token:, + # Parameters for the Auth Rule + parameters: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + auth_rule_token: String, + parameters: + T.nilable( + T.any( + Lithic::AuthRules::ConditionalBlockParameters, + Lithic::AuthRules::VelocityLimitParams, + Lithic::AuthRules::MerchantLockParameters, + Lithic::AuthRules::Conditional3DSActionParameters, + Lithic::AuthRules::ConditionalAuthorizationActionParameters, + Lithic::AuthRules::ConditionalACHActionParameters, + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters, + Lithic::AuthRules::TypescriptCodeParameters, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters + ) + ), + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Parameters for the Auth Rule + module Parameters + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::AuthRules::ConditionalBlockParameters, + Lithic::AuthRules::VelocityLimitParams, + Lithic::AuthRules::MerchantLockParameters, + Lithic::AuthRules::Conditional3DSActionParameters, + Lithic::AuthRules::ConditionalAuthorizationActionParameters, + Lithic::AuthRules::ConditionalACHActionParameters, + Lithic::AuthRules::ConditionalTokenizationActionParameters, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters, + Lithic::AuthRules::TypescriptCodeParameters, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters + ) + end + + sig do + override.returns( + T::Array[Lithic::AuthRules::V2DraftParams::Parameters::Variants] + ) + end + def self.variants + end + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/v2_list_params.rbi b/rbi/lithic/models/auth_rules/v2_list_params.rbi new file mode 100644 index 00000000..25adb197 --- /dev/null +++ b/rbi/lithic/models/auth_rules/v2_list_params.rbi @@ -0,0 +1,197 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2ListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::AuthRules::V2ListParams, Lithic::Internal::AnyHash) + end + + # Only return Auth Rules that are bound to the provided account token. + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Only return Auth Rules that are bound to the provided business account token. + sig { returns(T.nilable(String)) } + attr_reader :business_account_token + + sig { params(business_account_token: String).void } + attr_writer :business_account_token + + # Only return Auth Rules that are bound to the provided card token. + sig { returns(T.nilable(String)) } + attr_reader :card_token + + sig { params(card_token: String).void } + attr_writer :card_token + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Deprecated: Use event_streams instead. Only return Auth rules that are executed + # during the provided event stream. + sig { returns(T.nilable(Lithic::AuthRules::EventStream::OrSymbol)) } + attr_reader :event_stream + + sig do + params(event_stream: Lithic::AuthRules::EventStream::OrSymbol).void + end + attr_writer :event_stream + + # Only return Auth rules that are executed during any of the provided event + # streams. If event_streams and event_stream are specified, the values will be + # combined. + sig do + returns(T.nilable(T::Array[Lithic::AuthRules::EventStream::OrSymbol])) + end + attr_reader :event_streams + + sig do + params( + event_streams: T::Array[Lithic::AuthRules::EventStream::OrSymbol] + ).void + end + attr_writer :event_streams + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # Only return Auth Rules that are bound to the provided scope. + sig do + returns(T.nilable(Lithic::AuthRules::V2ListParams::Scope::OrSymbol)) + end + attr_reader :scope + + sig do + params(scope: Lithic::AuthRules::V2ListParams::Scope::OrSymbol).void + end + attr_writer :scope + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + account_token: String, + business_account_token: String, + card_token: String, + ending_before: String, + event_stream: Lithic::AuthRules::EventStream::OrSymbol, + event_streams: T::Array[Lithic::AuthRules::EventStream::OrSymbol], + page_size: Integer, + scope: Lithic::AuthRules::V2ListParams::Scope::OrSymbol, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Only return Auth Rules that are bound to the provided account token. + account_token: nil, + # Only return Auth Rules that are bound to the provided business account token. + business_account_token: nil, + # Only return Auth Rules that are bound to the provided card token. + card_token: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Deprecated: Use event_streams instead. Only return Auth rules that are executed + # during the provided event stream. + event_stream: nil, + # Only return Auth rules that are executed during any of the provided event + # streams. If event_streams and event_stream are specified, the values will be + # combined. + event_streams: nil, + # Page size (for pagination). + page_size: nil, + # Only return Auth Rules that are bound to the provided scope. + scope: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + account_token: String, + business_account_token: String, + card_token: String, + ending_before: String, + event_stream: Lithic::AuthRules::EventStream::OrSymbol, + event_streams: T::Array[Lithic::AuthRules::EventStream::OrSymbol], + page_size: Integer, + scope: Lithic::AuthRules::V2ListParams::Scope::OrSymbol, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Only return Auth Rules that are bound to the provided scope. + module Scope + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::AuthRules::V2ListParams::Scope) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PROGRAM = + T.let( + :PROGRAM, + Lithic::AuthRules::V2ListParams::Scope::TaggedSymbol + ) + ACCOUNT = + T.let( + :ACCOUNT, + Lithic::AuthRules::V2ListParams::Scope::TaggedSymbol + ) + BUSINESS_ACCOUNT = + T.let( + :BUSINESS_ACCOUNT, + Lithic::AuthRules::V2ListParams::Scope::TaggedSymbol + ) + CARD = + T.let(:CARD, Lithic::AuthRules::V2ListParams::Scope::TaggedSymbol) + ANY = + T.let(:ANY, Lithic::AuthRules::V2ListParams::Scope::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::AuthRules::V2ListParams::Scope::TaggedSymbol] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/v2_list_results_params.rbi b/rbi/lithic/models/auth_rules/v2_list_results_params.rbi new file mode 100644 index 00000000..345dc2d5 --- /dev/null +++ b/rbi/lithic/models/auth_rules/v2_list_results_params.rbi @@ -0,0 +1,138 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2ListResultsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::V2ListResultsParams, + Lithic::Internal::AnyHash + ) + end + + # Filter by Auth Rule token + sig { returns(T.nilable(String)) } + attr_reader :auth_rule_token + + sig { params(auth_rule_token: String).void } + attr_writer :auth_rule_token + + # Date string in RFC 3339 format. Only events evaluated after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Date string in RFC 3339 format. Only events evaluated before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Filter by event token + sig { returns(T.nilable(String)) } + attr_reader :event_token + + sig { params(event_token: String).void } + attr_writer :event_token + + # Filter by whether the rule evaluation produced any actions. When not provided, + # all results are returned. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :has_actions + + sig { params(has_actions: T::Boolean).void } + attr_writer :has_actions + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + auth_rule_token: String, + begin_: Time, + end_: Time, + ending_before: String, + event_token: String, + has_actions: T::Boolean, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Filter by Auth Rule token + auth_rule_token: nil, + # Date string in RFC 3339 format. Only events evaluated after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only events evaluated before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Filter by event token + event_token: nil, + # Filter by whether the rule evaluation produced any actions. When not provided, + # all results are returned. + has_actions: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + auth_rule_token: String, + begin_: Time, + end_: Time, + ending_before: String, + event_token: String, + has_actions: T::Boolean, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/v2_list_results_response.rbi b/rbi/lithic/models/auth_rules/v2_list_results_response.rbi new file mode 100644 index 00000000..4570d1d5 --- /dev/null +++ b/rbi/lithic/models/auth_rules/v2_list_results_response.rbi @@ -0,0 +1,2281 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + # Result of an Auth Rule evaluation + module V2ListResultsResponse + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult, + Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult + ) + end + + class AuthorizationResult < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for the evaluation + sig { returns(String) } + attr_accessor :token + + # Actions returned by the rule evaluation + sig do + returns( + T::Array[ + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::Variants + ] + ) + end + attr_accessor :actions + + # The Auth Rule token + sig { returns(String) } + attr_accessor :auth_rule_token + + # Timestamp of the rule evaluation + sig { returns(Time) } + attr_accessor :evaluation_time + + # The event stream during which the rule was evaluated + sig { returns(Symbol) } + attr_accessor :event_stream + + # Token of the event that triggered the evaluation + sig { returns(String) } + attr_accessor :event_token + + # The state of the Auth Rule + sig do + returns( + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Mode::TaggedSymbol + ) + end + attr_accessor :mode + + # Version of the rule that was evaluated + sig { returns(Integer) } + attr_accessor :rule_version + + # The token of the transaction that triggered the rule evaluation + sig { returns(T.nilable(String)) } + attr_accessor :transaction_token + + sig do + params( + token: String, + actions: + T::Array[ + T.any( + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::OrHash, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::ChallengeActionAuthorization::OrHash + ) + ], + auth_rule_token: String, + evaluation_time: Time, + event_token: String, + mode: + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Mode::OrSymbol, + rule_version: Integer, + transaction_token: T.nilable(String), + event_stream: Symbol + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the evaluation + token:, + # Actions returned by the rule evaluation + actions:, + # The Auth Rule token + auth_rule_token:, + # Timestamp of the rule evaluation + evaluation_time:, + # Token of the event that triggered the evaluation + event_token:, + # The state of the Auth Rule + mode:, + # Version of the rule that was evaluated + rule_version:, + # The token of the transaction that triggered the rule evaluation + transaction_token:, + # The event stream during which the rule was evaluated + event_stream: :AUTHORIZATION + ) + end + + sig do + override.returns( + { + token: String, + actions: + T::Array[ + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::Variants + ], + auth_rule_token: String, + evaluation_time: Time, + event_stream: Symbol, + event_token: String, + mode: + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Mode::TaggedSymbol, + rule_version: Integer, + transaction_token: T.nilable(String) + } + ) + end + def to_hash + end + + module Action + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::ChallengeActionAuthorization + ) + end + + class DeclineActionAuthorization < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization, + Lithic::Internal::AnyHash + ) + end + + # The detailed result code explaining the specific reason for the decline + sig do + returns( + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + end + attr_accessor :code + + sig do + returns( + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Optional explanation for why this action was taken + sig { returns(T.nilable(String)) } + attr_reader :explanation + + sig { params(explanation: String).void } + attr_writer :explanation + + sig do + params( + code: + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::OrSymbol, + type: + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Type::OrSymbol, + explanation: String + ).returns(T.attached_class) + end + def self.new( + # The detailed result code explaining the specific reason for the decline + code:, + type:, + # Optional explanation for why this action was taken + explanation: nil + ) + end + + sig do + override.returns( + { + code: + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol, + type: + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Type::TaggedSymbol, + explanation: String + } + ) + end + def to_hash + end + + # The detailed result code explaining the specific reason for the decline + module Code + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED = + T.let( + :ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + ACCOUNT_DELINQUENT = + T.let( + :ACCOUNT_DELINQUENT, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + ACCOUNT_INACTIVE = + T.let( + :ACCOUNT_INACTIVE, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED = + T.let( + :ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED = + T.let( + :ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + ACCOUNT_PAUSED = + T.let( + :ACCOUNT_PAUSED, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + ACCOUNT_UNDER_REVIEW = + T.let( + :ACCOUNT_UNDER_REVIEW, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + ADDRESS_INCORRECT = + T.let( + :ADDRESS_INCORRECT, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + APPROVED = + T.let( + :APPROVED, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + AUTH_RULE_ALLOWED_COUNTRY = + T.let( + :AUTH_RULE_ALLOWED_COUNTRY, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + AUTH_RULE_ALLOWED_MCC = + T.let( + :AUTH_RULE_ALLOWED_MCC, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + AUTH_RULE_BLOCKED_COUNTRY = + T.let( + :AUTH_RULE_BLOCKED_COUNTRY, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + AUTH_RULE_BLOCKED_MCC = + T.let( + :AUTH_RULE_BLOCKED_MCC, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + AUTH_RULE = + T.let( + :AUTH_RULE, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CARD_CLOSED = + T.let( + :CARD_CLOSED, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CARD_CRYPTOGRAM_VALIDATION_FAILURE = + T.let( + :CARD_CRYPTOGRAM_VALIDATION_FAILURE, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CARD_EXPIRED = + T.let( + :CARD_EXPIRED, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CARD_EXPIRY_DATE_INCORRECT = + T.let( + :CARD_EXPIRY_DATE_INCORRECT, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CARD_INVALID = + T.let( + :CARD_INVALID, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CARD_NOT_ACTIVATED = + T.let( + :CARD_NOT_ACTIVATED, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CARD_PAUSED = + T.let( + :CARD_PAUSED, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CARD_PIN_INCORRECT = + T.let( + :CARD_PIN_INCORRECT, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CARD_RESTRICTED = + T.let( + :CARD_RESTRICTED, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CARD_SECURITY_CODE_INCORRECT = + T.let( + :CARD_SECURITY_CODE_INCORRECT, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CARD_SPEND_LIMIT_EXCEEDED = + T.let( + :CARD_SPEND_LIMIT_EXCEEDED, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CONTACT_CARD_ISSUER = + T.let( + :CONTACT_CARD_ISSUER, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CUSTOMER_ASA_TIMEOUT = + T.let( + :CUSTOMER_ASA_TIMEOUT, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CUSTOM_ASA_RESULT = + T.let( + :CUSTOM_ASA_RESULT, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + DO_NOT_HONOR = + T.let( + :DO_NOT_HONOR, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + DRIVER_NUMBER_INVALID = + T.let( + :DRIVER_NUMBER_INVALID, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + FORMAT_ERROR = + T.let( + :FORMAT_ERROR, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + INSUFFICIENT_FUNDING_SOURCE_BALANCE = + T.let( + :INSUFFICIENT_FUNDING_SOURCE_BALANCE, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + INSUFFICIENT_FUNDS = + T.let( + :INSUFFICIENT_FUNDS, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + LITHIC_SYSTEM_ERROR = + T.let( + :LITHIC_SYSTEM_ERROR, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + LITHIC_SYSTEM_RATE_LIMIT = + T.let( + :LITHIC_SYSTEM_RATE_LIMIT, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + MALFORMED_ASA_RESPONSE = + T.let( + :MALFORMED_ASA_RESPONSE, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + MERCHANT_INVALID = + T.let( + :MERCHANT_INVALID, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE = + T.let( + :MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + MERCHANT_NOT_PERMITTED = + T.let( + :MERCHANT_NOT_PERMITTED, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + OVER_REVERSAL_ATTEMPTED = + T.let( + :OVER_REVERSAL_ATTEMPTED, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + PIN_BLOCKED = + T.let( + :PIN_BLOCKED, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + PROGRAM_CARD_SPEND_LIMIT_EXCEEDED = + T.let( + :PROGRAM_CARD_SPEND_LIMIT_EXCEEDED, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + PROGRAM_SUSPENDED = + T.let( + :PROGRAM_SUSPENDED, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + PROGRAM_USAGE_RESTRICTION = + T.let( + :PROGRAM_USAGE_RESTRICTION, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + REVERSAL_UNMATCHED = + T.let( + :REVERSAL_UNMATCHED, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + SECURITY_VIOLATION = + T.let( + :SECURITY_VIOLATION, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + SINGLE_USE_CARD_REATTEMPTED = + T.let( + :SINGLE_USE_CARD_REATTEMPTED, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + SUSPECTED_FRAUD = + T.let( + :SUSPECTED_FRAUD, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + TRANSACTION_INVALID = + T.let( + :TRANSACTION_INVALID, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL = + T.let( + :TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER = + T.let( + :TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + TRANSACTION_PREVIOUSLY_COMPLETED = + T.let( + :TRANSACTION_PREVIOUSLY_COMPLETED, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + UNAUTHORIZED_MERCHANT = + T.let( + :UNAUTHORIZED_MERCHANT, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + VEHICLE_NUMBER_INVALID = + T.let( + :VEHICLE_NUMBER_INVALID, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CARDHOLDER_CHALLENGED = + T.let( + :CARDHOLDER_CHALLENGED, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + CARDHOLDER_CHALLENGE_FAILED = + T.let( + :CARDHOLDER_CHALLENGE_FAILED, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Code::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DECLINE = + T.let( + :DECLINE, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class ChallengeActionAuthorization < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::ChallengeActionAuthorization, + Lithic::Internal::AnyHash + ) + end + + sig do + returns( + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::ChallengeActionAuthorization::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Optional explanation for why this action was taken + sig { returns(T.nilable(String)) } + attr_reader :explanation + + sig { params(explanation: String).void } + attr_writer :explanation + + sig do + params( + type: + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::ChallengeActionAuthorization::Type::OrSymbol, + explanation: String + ).returns(T.attached_class) + end + def self.new( + type:, + # Optional explanation for why this action was taken + explanation: nil + ) + end + + sig do + override.returns( + { + type: + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::ChallengeActionAuthorization::Type::TaggedSymbol, + explanation: String + } + ) + end + def to_hash + end + + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::ChallengeActionAuthorization::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHALLENGE = + T.let( + :CHALLENGE, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::ChallengeActionAuthorization::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::ChallengeActionAuthorization::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig do + override.returns( + T::Array[ + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::Variants + ] + ) + end + def self.variants + end + end + + # The state of the Auth Rule + module Mode + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Mode + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :ACTIVE, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Mode::TaggedSymbol + ) + INACTIVE = + T.let( + :INACTIVE, + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Mode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Mode::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Authentication3DSResult < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for the evaluation + sig { returns(String) } + attr_accessor :token + + # Actions returned by the rule evaluation + sig do + returns( + T::Array[ + Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Action + ] + ) + end + attr_accessor :actions + + # The Auth Rule token + sig { returns(String) } + attr_accessor :auth_rule_token + + # Timestamp of the rule evaluation + sig { returns(Time) } + attr_accessor :evaluation_time + + # The event stream during which the rule was evaluated + sig { returns(Symbol) } + attr_accessor :event_stream + + # Token of the event that triggered the evaluation + sig { returns(String) } + attr_accessor :event_token + + # The state of the Auth Rule + sig do + returns( + Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Mode::TaggedSymbol + ) + end + attr_accessor :mode + + # Version of the rule that was evaluated + sig { returns(Integer) } + attr_accessor :rule_version + + # The token of the transaction that triggered the rule evaluation + sig { returns(T.nilable(String)) } + attr_accessor :transaction_token + + sig do + params( + token: String, + actions: + T::Array[ + Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Action::OrHash + ], + auth_rule_token: String, + evaluation_time: Time, + event_token: String, + mode: + Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Mode::OrSymbol, + rule_version: Integer, + transaction_token: T.nilable(String), + event_stream: Symbol + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the evaluation + token:, + # Actions returned by the rule evaluation + actions:, + # The Auth Rule token + auth_rule_token:, + # Timestamp of the rule evaluation + evaluation_time:, + # Token of the event that triggered the evaluation + event_token:, + # The state of the Auth Rule + mode:, + # Version of the rule that was evaluated + rule_version:, + # The token of the transaction that triggered the rule evaluation + transaction_token:, + # The event stream during which the rule was evaluated + event_stream: :THREE_DS_AUTHENTICATION + ) + end + + sig do + override.returns( + { + token: String, + actions: + T::Array[ + Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Action + ], + auth_rule_token: String, + evaluation_time: Time, + event_stream: Symbol, + event_token: String, + mode: + Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Mode::TaggedSymbol, + rule_version: Integer, + transaction_token: T.nilable(String) + } + ) + end + def to_hash + end + + class Action < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Action, + Lithic::Internal::AnyHash + ) + end + + sig do + returns( + Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Action::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Optional explanation for why this action was taken + sig { returns(T.nilable(String)) } + attr_reader :explanation + + sig { params(explanation: String).void } + attr_writer :explanation + + sig do + params( + type: + Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Action::Type::OrSymbol, + explanation: String + ).returns(T.attached_class) + end + def self.new( + type:, + # Optional explanation for why this action was taken + explanation: nil + ) + end + + sig do + override.returns( + { + type: + Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Action::Type::TaggedSymbol, + explanation: String + } + ) + end + def to_hash + end + + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Action::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DECLINE = + T.let( + :DECLINE, + Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Action::Type::TaggedSymbol + ) + CHALLENGE = + T.let( + :CHALLENGE, + Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Action::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Action::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + # The state of the Auth Rule + module Mode + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Mode + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :ACTIVE, + Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Mode::TaggedSymbol + ) + INACTIVE = + T.let( + :INACTIVE, + Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Mode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Mode::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class TokenizationResult < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for the evaluation + sig { returns(String) } + attr_accessor :token + + # Actions returned by the rule evaluation + sig do + returns( + T::Array[ + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::Variants + ] + ) + end + attr_accessor :actions + + # The Auth Rule token + sig { returns(String) } + attr_accessor :auth_rule_token + + # Timestamp of the rule evaluation + sig { returns(Time) } + attr_accessor :evaluation_time + + # The event stream during which the rule was evaluated + sig { returns(Symbol) } + attr_accessor :event_stream + + # Token of the event that triggered the evaluation + sig { returns(String) } + attr_accessor :event_token + + # The state of the Auth Rule + sig do + returns( + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Mode::TaggedSymbol + ) + end + attr_accessor :mode + + # Version of the rule that was evaluated + sig { returns(Integer) } + attr_accessor :rule_version + + # The token of the transaction that triggered the rule evaluation + sig { returns(T.nilable(String)) } + attr_accessor :transaction_token + + sig do + params( + token: String, + actions: + T::Array[ + T.any( + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::OrHash, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::OrHash + ) + ], + auth_rule_token: String, + evaluation_time: Time, + event_token: String, + mode: + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Mode::OrSymbol, + rule_version: Integer, + transaction_token: T.nilable(String), + event_stream: Symbol + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the evaluation + token:, + # Actions returned by the rule evaluation + actions:, + # The Auth Rule token + auth_rule_token:, + # Timestamp of the rule evaluation + evaluation_time:, + # Token of the event that triggered the evaluation + event_token:, + # The state of the Auth Rule + mode:, + # Version of the rule that was evaluated + rule_version:, + # The token of the transaction that triggered the rule evaluation + transaction_token:, + # The event stream during which the rule was evaluated + event_stream: :TOKENIZATION + ) + end + + sig do + override.returns( + { + token: String, + actions: + T::Array[ + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::Variants + ], + auth_rule_token: String, + evaluation_time: Time, + event_stream: Symbol, + event_token: String, + mode: + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Mode::TaggedSymbol, + rule_version: Integer, + transaction_token: T.nilable(String) + } + ) + end + def to_hash + end + + module Action + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction + ) + end + + class DeclineActionTokenization < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization, + Lithic::Internal::AnyHash + ) + end + + # Decline the tokenization request + sig do + returns( + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Optional explanation for why this action was taken + sig { returns(T.nilable(String)) } + attr_reader :explanation + + sig { params(explanation: String).void } + attr_writer :explanation + + # Reason code for declining the tokenization request + sig do + returns( + T.nilable( + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + ) + end + attr_reader :reason + + sig do + params( + reason: + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Reason::OrSymbol + ).void + end + attr_writer :reason + + sig do + params( + type: + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Type::OrSymbol, + explanation: String, + reason: + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Reason::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Decline the tokenization request + type:, + # Optional explanation for why this action was taken + explanation: nil, + # Reason code for declining the tokenization request + reason: nil + ) + end + + sig do + override.returns( + { + type: + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Type::TaggedSymbol, + explanation: String, + reason: + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Reason::TaggedSymbol + } + ) + end + def to_hash + end + + # Decline the tokenization request + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DECLINE = + T.let( + :DECLINE, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Reason code for declining the tokenization request + module Reason + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Reason + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_SCORE_1 = + T.let( + :ACCOUNT_SCORE_1, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + DEVICE_SCORE_1 = + T.let( + :DEVICE_SCORE_1, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + ALL_WALLET_DECLINE_REASONS_PRESENT = + T.let( + :ALL_WALLET_DECLINE_REASONS_PRESENT, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + WALLET_RECOMMENDED_DECISION_RED = + T.let( + :WALLET_RECOMMENDED_DECISION_RED, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + CVC_MISMATCH = + T.let( + :CVC_MISMATCH, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + CARD_EXPIRY_MONTH_MISMATCH = + T.let( + :CARD_EXPIRY_MONTH_MISMATCH, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + CARD_EXPIRY_YEAR_MISMATCH = + T.let( + :CARD_EXPIRY_YEAR_MISMATCH, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + CARD_INVALID_STATE = + T.let( + :CARD_INVALID_STATE, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + CUSTOMER_RED_PATH = + T.let( + :CUSTOMER_RED_PATH, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + INVALID_CUSTOMER_RESPONSE = + T.let( + :INVALID_CUSTOMER_RESPONSE, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + NETWORK_FAILURE = + T.let( + :NETWORK_FAILURE, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + GENERIC_DECLINE = + T.let( + :GENERIC_DECLINE, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + DIGITAL_CARD_ART_REQUIRED = + T.let( + :DIGITAL_CARD_ART_REQUIRED, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Reason::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::Reason::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class RequireTfaAction < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction, + Lithic::Internal::AnyHash + ) + end + + # Require two-factor authentication for the tokenization request + sig do + returns( + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Optional explanation for why this action was taken + sig { returns(T.nilable(String)) } + attr_reader :explanation + + sig { params(explanation: String).void } + attr_writer :explanation + + # Reason code for requiring two-factor authentication + sig do + returns( + T.nilable( + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Reason::TaggedSymbol + ) + ) + end + attr_reader :reason + + sig do + params( + reason: + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Reason::OrSymbol + ).void + end + attr_writer :reason + + sig do + params( + type: + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Type::OrSymbol, + explanation: String, + reason: + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Reason::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Require two-factor authentication for the tokenization request + type:, + # Optional explanation for why this action was taken + explanation: nil, + # Reason code for requiring two-factor authentication + reason: nil + ) + end + + sig do + override.returns( + { + type: + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Type::TaggedSymbol, + explanation: String, + reason: + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Reason::TaggedSymbol + } + ) + end + def to_hash + end + + # Require two-factor authentication for the tokenization request + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + REQUIRE_TFA = + T.let( + :REQUIRE_TFA, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Reason code for requiring two-factor authentication + module Reason + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Reason + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_RECOMMENDED_TFA = + T.let( + :WALLET_RECOMMENDED_TFA, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Reason::TaggedSymbol + ) + SUSPICIOUS_ACTIVITY = + T.let( + :SUSPICIOUS_ACTIVITY, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Reason::TaggedSymbol + ) + DEVICE_RECENTLY_LOST = + T.let( + :DEVICE_RECENTLY_LOST, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Reason::TaggedSymbol + ) + TOO_MANY_RECENT_ATTEMPTS = + T.let( + :TOO_MANY_RECENT_ATTEMPTS, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Reason::TaggedSymbol + ) + TOO_MANY_RECENT_TOKENS = + T.let( + :TOO_MANY_RECENT_TOKENS, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Reason::TaggedSymbol + ) + TOO_MANY_DIFFERENT_CARDHOLDERS = + T.let( + :TOO_MANY_DIFFERENT_CARDHOLDERS, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Reason::TaggedSymbol + ) + OUTSIDE_HOME_TERRITORY = + T.let( + :OUTSIDE_HOME_TERRITORY, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Reason::TaggedSymbol + ) + HAS_SUSPENDED_TOKENS = + T.let( + :HAS_SUSPENDED_TOKENS, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Reason::TaggedSymbol + ) + HIGH_RISK = + T.let( + :HIGH_RISK, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Reason::TaggedSymbol + ) + ACCOUNT_SCORE_LOW = + T.let( + :ACCOUNT_SCORE_LOW, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Reason::TaggedSymbol + ) + DEVICE_SCORE_LOW = + T.let( + :DEVICE_SCORE_LOW, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Reason::TaggedSymbol + ) + CARD_STATE_TFA = + T.let( + :CARD_STATE_TFA, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Reason::TaggedSymbol + ) + HARDCODED_TFA = + T.let( + :HARDCODED_TFA, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Reason::TaggedSymbol + ) + CUSTOMER_RULE_TFA = + T.let( + :CUSTOMER_RULE_TFA, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Reason::TaggedSymbol + ) + DEVICE_HOST_CARD_EMULATION = + T.let( + :DEVICE_HOST_CARD_EMULATION, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Reason::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::Reason::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig do + override.returns( + T::Array[ + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::Variants + ] + ) + end + def self.variants + end + end + + # The state of the Auth Rule + module Mode + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Mode + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :ACTIVE, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Mode::TaggedSymbol + ) + INACTIVE = + T.let( + :INACTIVE, + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Mode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Mode::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class ACHResult < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for the evaluation + sig { returns(String) } + attr_accessor :token + + # Actions returned by the rule evaluation + sig do + returns( + T::Array[ + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::Variants + ] + ) + end + attr_accessor :actions + + # The Auth Rule token + sig { returns(String) } + attr_accessor :auth_rule_token + + # Timestamp of the rule evaluation + sig { returns(Time) } + attr_accessor :evaluation_time + + # The event stream during which the rule was evaluated + sig do + returns( + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::EventStream::TaggedSymbol + ) + end + attr_accessor :event_stream + + # Token of the event that triggered the evaluation + sig { returns(String) } + attr_accessor :event_token + + # The state of the Auth Rule + sig do + returns( + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Mode::TaggedSymbol + ) + end + attr_accessor :mode + + # Version of the rule that was evaluated + sig { returns(Integer) } + attr_accessor :rule_version + + # The token of the transaction that triggered the rule evaluation + sig { returns(T.nilable(String)) } + attr_accessor :transaction_token + + sig do + params( + token: String, + actions: + T::Array[ + T.any( + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ApproveActionACH::OrHash, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::OrHash + ) + ], + auth_rule_token: String, + evaluation_time: Time, + event_stream: + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::EventStream::OrSymbol, + event_token: String, + mode: + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Mode::OrSymbol, + rule_version: Integer, + transaction_token: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the evaluation + token:, + # Actions returned by the rule evaluation + actions:, + # The Auth Rule token + auth_rule_token:, + # Timestamp of the rule evaluation + evaluation_time:, + # The event stream during which the rule was evaluated + event_stream:, + # Token of the event that triggered the evaluation + event_token:, + # The state of the Auth Rule + mode:, + # Version of the rule that was evaluated + rule_version:, + # The token of the transaction that triggered the rule evaluation + transaction_token: + ) + end + + sig do + override.returns( + { + token: String, + actions: + T::Array[ + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::Variants + ], + auth_rule_token: String, + evaluation_time: Time, + event_stream: + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::EventStream::TaggedSymbol, + event_token: String, + mode: + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Mode::TaggedSymbol, + rule_version: Integer, + transaction_token: T.nilable(String) + } + ) + end + def to_hash + end + + module Action + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ApproveActionACH, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction + ) + end + + class ApproveActionACH < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ApproveActionACH, + Lithic::Internal::AnyHash + ) + end + + # Approve the ACH transaction + sig do + returns( + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ApproveActionACH::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Optional explanation for why this action was taken + sig { returns(T.nilable(String)) } + attr_reader :explanation + + sig { params(explanation: String).void } + attr_writer :explanation + + sig do + params( + type: + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ApproveActionACH::Type::OrSymbol, + explanation: String + ).returns(T.attached_class) + end + def self.new( + # Approve the ACH transaction + type:, + # Optional explanation for why this action was taken + explanation: nil + ) + end + + sig do + override.returns( + { + type: + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ApproveActionACH::Type::TaggedSymbol, + explanation: String + } + ) + end + def to_hash + end + + # Approve the ACH transaction + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ApproveActionACH::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVE = + T.let( + :APPROVE, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ApproveActionACH::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ApproveActionACH::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class ReturnAction < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction, + Lithic::Internal::AnyHash + ) + end + + # NACHA return code to use when returning the transaction. Note that the list of + # available return codes is subject to an allowlist configured at the program + # level + sig do + returns( + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + end + attr_accessor :code + + # Return the ACH transaction + sig do + returns( + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Optional explanation for why this action was taken + sig { returns(T.nilable(String)) } + attr_reader :explanation + + sig { params(explanation: String).void } + attr_writer :explanation + + sig do + params( + code: + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::OrSymbol, + type: + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Type::OrSymbol, + explanation: String + ).returns(T.attached_class) + end + def self.new( + # NACHA return code to use when returning the transaction. Note that the list of + # available return codes is subject to an allowlist configured at the program + # level + code:, + # Return the ACH transaction + type:, + # Optional explanation for why this action was taken + explanation: nil + ) + end + + sig do + override.returns( + { + code: + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol, + type: + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Type::TaggedSymbol, + explanation: String + } + ) + end + def to_hash + end + + # NACHA return code to use when returning the transaction. Note that the list of + # available return codes is subject to an allowlist configured at the program + # level + module Code + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + R01 = + T.let( + :R01, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R02 = + T.let( + :R02, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R03 = + T.let( + :R03, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R04 = + T.let( + :R04, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R05 = + T.let( + :R05, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R06 = + T.let( + :R06, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R07 = + T.let( + :R07, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R08 = + T.let( + :R08, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R09 = + T.let( + :R09, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R10 = + T.let( + :R10, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R11 = + T.let( + :R11, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R12 = + T.let( + :R12, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R13 = + T.let( + :R13, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R14 = + T.let( + :R14, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R15 = + T.let( + :R15, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R16 = + T.let( + :R16, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R17 = + T.let( + :R17, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R18 = + T.let( + :R18, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R19 = + T.let( + :R19, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R20 = + T.let( + :R20, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R21 = + T.let( + :R21, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R22 = + T.let( + :R22, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R23 = + T.let( + :R23, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R24 = + T.let( + :R24, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R25 = + T.let( + :R25, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R26 = + T.let( + :R26, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R27 = + T.let( + :R27, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R28 = + T.let( + :R28, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R29 = + T.let( + :R29, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R30 = + T.let( + :R30, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R31 = + T.let( + :R31, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R32 = + T.let( + :R32, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R33 = + T.let( + :R33, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R34 = + T.let( + :R34, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R35 = + T.let( + :R35, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R36 = + T.let( + :R36, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R37 = + T.let( + :R37, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R38 = + T.let( + :R38, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R39 = + T.let( + :R39, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R40 = + T.let( + :R40, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R41 = + T.let( + :R41, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R42 = + T.let( + :R42, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R43 = + T.let( + :R43, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R44 = + T.let( + :R44, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R45 = + T.let( + :R45, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R46 = + T.let( + :R46, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R47 = + T.let( + :R47, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R50 = + T.let( + :R50, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R51 = + T.let( + :R51, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R52 = + T.let( + :R52, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R53 = + T.let( + :R53, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R61 = + T.let( + :R61, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R62 = + T.let( + :R62, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R67 = + T.let( + :R67, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R68 = + T.let( + :R68, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R69 = + T.let( + :R69, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R70 = + T.let( + :R70, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R71 = + T.let( + :R71, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R72 = + T.let( + :R72, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R73 = + T.let( + :R73, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R74 = + T.let( + :R74, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R75 = + T.let( + :R75, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R76 = + T.let( + :R76, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R77 = + T.let( + :R77, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R80 = + T.let( + :R80, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R81 = + T.let( + :R81, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R82 = + T.let( + :R82, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R83 = + T.let( + :R83, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R84 = + T.let( + :R84, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + R85 = + T.let( + :R85, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Code::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Return the ACH transaction + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + RETURN = + T.let( + :RETURN, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig do + override.returns( + T::Array[ + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::Variants + ] + ) + end + def self.variants + end + end + + # The event stream during which the rule was evaluated + module EventStream + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::EventStream + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACH_CREDIT_RECEIPT = + T.let( + :ACH_CREDIT_RECEIPT, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::EventStream::TaggedSymbol + ) + ACH_DEBIT_RECEIPT = + T.let( + :ACH_DEBIT_RECEIPT, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::EventStream::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::EventStream::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The state of the Auth Rule + module Mode + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Mode + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = + T.let( + :ACTIVE, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Mode::TaggedSymbol + ) + INACTIVE = + T.let( + :INACTIVE, + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Mode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Mode::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig do + override.returns( + T::Array[Lithic::Models::AuthRules::V2ListResultsResponse::Variants] + ) + end + def self.variants + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/v2_list_versions_params.rbi b/rbi/lithic/models/auth_rules/v2_list_versions_params.rbi new file mode 100644 index 00000000..35fd55ae --- /dev/null +++ b/rbi/lithic/models/auth_rules/v2_list_versions_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2ListVersionsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::V2ListVersionsParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :auth_rule_token + + sig do + params( + auth_rule_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(auth_rule_token:, request_options: {}) + end + + sig do + override.returns( + { auth_rule_token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/v2_list_versions_response.rbi b/rbi/lithic/models/auth_rules/v2_list_versions_response.rbi new file mode 100644 index 00000000..ef17a294 --- /dev/null +++ b/rbi/lithic/models/auth_rules/v2_list_versions_response.rbi @@ -0,0 +1,36 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2ListVersionsResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AuthRules::V2ListVersionsResponse, + Lithic::Internal::AnyHash + ) + end + + sig { returns(T::Array[Lithic::AuthRules::AuthRuleVersion]) } + attr_accessor :data + + sig do + params( + data: T::Array[Lithic::AuthRules::AuthRuleVersion::OrHash] + ).returns(T.attached_class) + end + def self.new(data:) + end + + sig do + override.returns( + { data: T::Array[Lithic::AuthRules::AuthRuleVersion] } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/v2_promote_params.rbi b/rbi/lithic/models/auth_rules/v2_promote_params.rbi new file mode 100644 index 00000000..1090606a --- /dev/null +++ b/rbi/lithic/models/auth_rules/v2_promote_params.rbi @@ -0,0 +1,37 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2PromoteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::AuthRules::V2PromoteParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :auth_rule_token + + sig do + params( + auth_rule_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(auth_rule_token:, request_options: {}) + end + + sig do + override.returns( + { auth_rule_token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/v2_retrieve_features_params.rbi b/rbi/lithic/models/auth_rules/v2_retrieve_features_params.rbi new file mode 100644 index 00000000..4f5981c8 --- /dev/null +++ b/rbi/lithic/models/auth_rules/v2_retrieve_features_params.rbi @@ -0,0 +1,64 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2RetrieveFeaturesParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::V2RetrieveFeaturesParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :auth_rule_token + + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + sig { returns(T.nilable(String)) } + attr_reader :card_token + + sig { params(card_token: String).void } + attr_writer :card_token + + sig do + params( + auth_rule_token: String, + account_token: String, + card_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + auth_rule_token:, + account_token: nil, + card_token: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + auth_rule_token: String, + account_token: String, + card_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/v2_retrieve_features_response.rbi b/rbi/lithic/models/auth_rules/v2_retrieve_features_response.rbi new file mode 100644 index 00000000..9e29a311 --- /dev/null +++ b/rbi/lithic/models/auth_rules/v2_retrieve_features_response.rbi @@ -0,0 +1,225 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2RetrieveFeaturesResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AuthRules::V2RetrieveFeaturesResponse, + Lithic::Internal::AnyHash + ) + end + + # Timestamp at which the Features were evaluated + sig { returns(Time) } + attr_accessor :evaluated + + # Calculated Features used for evaluation of the provided Auth Rule + sig do + returns( + T::Array[ + Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature + ] + ) + end + attr_accessor :features + + sig do + params( + evaluated: Time, + features: + T::Array[ + Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::OrHash + ] + ).returns(T.attached_class) + end + def self.new( + # Timestamp at which the Features were evaluated + evaluated:, + # Calculated Features used for evaluation of the provided Auth Rule + features: + ) + end + + sig do + override.returns( + { + evaluated: Time, + features: + T::Array[ + Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature + ] + } + ) + end + def to_hash + end + + class Feature < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Lithic::AuthRules::VelocityLimitFilters) } + attr_reader :filters + + sig do + params( + filters: Lithic::AuthRules::VelocityLimitFilters::OrHash + ).void + end + attr_writer :filters + + # Velocity over the current day since 00:00 / 12 AM in Eastern Time + sig { returns(Lithic::AuthRules::VelocityLimitPeriod::Variants) } + attr_accessor :period + + # The scope the velocity is calculated for + sig do + returns( + Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Scope::TaggedSymbol + ) + end + attr_accessor :scope + + sig do + returns( + Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Value + ) + end + attr_reader :value + + sig do + params( + value: + Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Value::OrHash + ).void + end + attr_writer :value + + sig do + params( + filters: Lithic::AuthRules::VelocityLimitFilters::OrHash, + period: + T.any( + Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject::OrHash, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowDay::OrHash, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowWeek::OrHash, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowMonth::OrHash, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear::OrHash + ), + scope: + Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Scope::OrSymbol, + value: + Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Value::OrHash + ).returns(T.attached_class) + end + def self.new( + filters:, + # Velocity over the current day since 00:00 / 12 AM in Eastern Time + period:, + # The scope the velocity is calculated for + scope:, + value: + ) + end + + sig do + override.returns( + { + filters: Lithic::AuthRules::VelocityLimitFilters, + period: Lithic::AuthRules::VelocityLimitPeriod::Variants, + scope: + Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Scope::TaggedSymbol, + value: + Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Value + } + ) + end + def to_hash + end + + # The scope the velocity is calculated for + module Scope + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Scope + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CARD = + T.let( + :CARD, + Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Scope::TaggedSymbol + ) + ACCOUNT = + T.let( + :ACCOUNT, + Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Scope::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Scope::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Value < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Value, + Lithic::Internal::AnyHash + ) + end + + # Amount (in cents) for the given Auth Rule that is used as input for calculating + # the rule. For Velocity Limit rules this would be the calculated Velocity. For + # Conditional Rules using CARD*TRANSACTION_COUNT*\* this will be 0 + sig { returns(Integer) } + attr_accessor :amount + + # Number of velocity impacting transactions matching the given scope, period and + # filters + sig { returns(Integer) } + attr_accessor :count + + sig do + params(amount: Integer, count: Integer).returns(T.attached_class) + end + def self.new( + # Amount (in cents) for the given Auth Rule that is used as input for calculating + # the rule. For Velocity Limit rules this would be the calculated Velocity. For + # Conditional Rules using CARD*TRANSACTION_COUNT*\* this will be 0 + amount:, + # Number of velocity impacting transactions matching the given scope, period and + # filters + count: + ) + end + + sig { override.returns({ amount: Integer, count: Integer }) } + def to_hash + end + end + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/v2_retrieve_params.rbi b/rbi/lithic/models/auth_rules/v2_retrieve_params.rbi new file mode 100644 index 00000000..01f6df99 --- /dev/null +++ b/rbi/lithic/models/auth_rules/v2_retrieve_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2RetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::V2RetrieveParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :auth_rule_token + + sig do + params( + auth_rule_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(auth_rule_token:, request_options: {}) + end + + sig do + override.returns( + { auth_rule_token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/v2_retrieve_report_params.rbi b/rbi/lithic/models/auth_rules/v2_retrieve_report_params.rbi new file mode 100644 index 00000000..2a185f8e --- /dev/null +++ b/rbi/lithic/models/auth_rules/v2_retrieve_report_params.rbi @@ -0,0 +1,62 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2RetrieveReportParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::V2RetrieveReportParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :auth_rule_token + + # Start date for the report + sig { returns(Date) } + attr_accessor :begin_ + + # End date for the report + sig { returns(Date) } + attr_accessor :end_ + + sig do + params( + auth_rule_token: String, + begin_: Date, + end_: Date, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + auth_rule_token:, + # Start date for the report + begin_:, + # End date for the report + end_:, + request_options: {} + ) + end + + sig do + override.returns( + { + auth_rule_token: String, + begin_: Date, + end_: Date, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/v2_retrieve_report_response.rbi b/rbi/lithic/models/auth_rules/v2_retrieve_report_response.rbi new file mode 100644 index 00000000..0faf2fa9 --- /dev/null +++ b/rbi/lithic/models/auth_rules/v2_retrieve_report_response.rbi @@ -0,0 +1,120 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2RetrieveReportResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AuthRules::V2RetrieveReportResponse, + Lithic::Internal::AnyHash + ) + end + + # Auth Rule Token + sig { returns(String) } + attr_accessor :auth_rule_token + + # The start date (UTC) of the report. + sig { returns(Date) } + attr_accessor :begin_ + + # Daily evaluation statistics for the Auth Rule. + sig do + returns( + T::Array[ + Lithic::Models::AuthRules::V2RetrieveReportResponse::DailyStatistic + ] + ) + end + attr_accessor :daily_statistics + + # The end date (UTC) of the report. + sig { returns(Date) } + attr_accessor :end_ + + sig do + params( + auth_rule_token: String, + begin_: Date, + daily_statistics: + T::Array[ + Lithic::Models::AuthRules::V2RetrieveReportResponse::DailyStatistic::OrHash + ], + end_: Date + ).returns(T.attached_class) + end + def self.new( + # Auth Rule Token + auth_rule_token:, + # The start date (UTC) of the report. + begin_:, + # Daily evaluation statistics for the Auth Rule. + daily_statistics:, + # The end date (UTC) of the report. + end_: + ) + end + + sig do + override.returns( + { + auth_rule_token: String, + begin_: Date, + daily_statistics: + T::Array[ + Lithic::Models::AuthRules::V2RetrieveReportResponse::DailyStatistic + ], + end_: Date + } + ) + end + def to_hash + end + + class DailyStatistic < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::AuthRules::V2RetrieveReportResponse::DailyStatistic, + Lithic::Internal::AnyHash + ) + end + + # The date (UTC) for which the statistics are reported. + sig { returns(Date) } + attr_accessor :date + + # Statistics for each version of the rule that was evaluated during the reported + # day. + sig { returns(T::Array[Lithic::AuthRules::ReportStats]) } + attr_accessor :versions + + sig do + params( + date: Date, + versions: T::Array[Lithic::AuthRules::ReportStats::OrHash] + ).returns(T.attached_class) + end + def self.new( + # The date (UTC) for which the statistics are reported. + date:, + # Statistics for each version of the rule that was evaluated during the reported + # day. + versions: + ) + end + + sig do + override.returns( + { date: Date, versions: T::Array[Lithic::AuthRules::ReportStats] } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/v2_update_params.rbi b/rbi/lithic/models/auth_rules/v2_update_params.rbi new file mode 100644 index 00000000..91390c49 --- /dev/null +++ b/rbi/lithic/models/auth_rules/v2_update_params.rbi @@ -0,0 +1,466 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class V2UpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::AuthRules::V2UpdateParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :auth_rule_token + + sig do + returns( + T.any( + Lithic::AuthRules::V2UpdateParams::Body::AccountLevelRule, + Lithic::AuthRules::V2UpdateParams::Body::CardLevelRule, + Lithic::AuthRules::V2UpdateParams::Body::ProgramLevelRule + ) + ) + end + attr_accessor :body + + sig do + params( + auth_rule_token: String, + body: + T.any( + Lithic::AuthRules::V2UpdateParams::Body::AccountLevelRule::OrHash, + Lithic::AuthRules::V2UpdateParams::Body::CardLevelRule::OrHash, + Lithic::AuthRules::V2UpdateParams::Body::ProgramLevelRule::OrHash + ), + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(auth_rule_token:, body:, request_options: {}) + end + + sig do + override.returns( + { + auth_rule_token: String, + body: + T.any( + Lithic::AuthRules::V2UpdateParams::Body::AccountLevelRule, + Lithic::AuthRules::V2UpdateParams::Body::CardLevelRule, + Lithic::AuthRules::V2UpdateParams::Body::ProgramLevelRule + ), + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + module Body + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::AuthRules::V2UpdateParams::Body::AccountLevelRule, + Lithic::AuthRules::V2UpdateParams::Body::CardLevelRule, + Lithic::AuthRules::V2UpdateParams::Body::ProgramLevelRule + ) + end + + class AccountLevelRule < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::V2UpdateParams::Body::AccountLevelRule, + Lithic::Internal::AnyHash + ) + end + + # Account tokens to which the Auth Rule applies. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :account_tokens + + sig { params(account_tokens: T::Array[String]).void } + attr_writer :account_tokens + + # Business Account tokens to which the Auth Rule applies. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :business_account_tokens + + sig { params(business_account_tokens: T::Array[String]).void } + attr_writer :business_account_tokens + + # Auth Rule Name + sig { returns(T.nilable(String)) } + attr_accessor :name + + # The desired state of the Auth Rule. + # + # Note that only deactivating an Auth Rule through this endpoint is supported at + # this time. If you need to (re-)activate an Auth Rule the /promote endpoint + # should be used to promote a draft to the currently active version. + sig do + returns( + T.nilable( + Lithic::AuthRules::V2UpdateParams::Body::AccountLevelRule::State::OrSymbol + ) + ) + end + attr_reader :state + + sig do + params( + state: + Lithic::AuthRules::V2UpdateParams::Body::AccountLevelRule::State::OrSymbol + ).void + end + attr_writer :state + + sig do + params( + account_tokens: T::Array[String], + business_account_tokens: T::Array[String], + name: T.nilable(String), + state: + Lithic::AuthRules::V2UpdateParams::Body::AccountLevelRule::State::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Account tokens to which the Auth Rule applies. + account_tokens: nil, + # Business Account tokens to which the Auth Rule applies. + business_account_tokens: nil, + # Auth Rule Name + name: nil, + # The desired state of the Auth Rule. + # + # Note that only deactivating an Auth Rule through this endpoint is supported at + # this time. If you need to (re-)activate an Auth Rule the /promote endpoint + # should be used to promote a draft to the currently active version. + state: nil + ) + end + + sig do + override.returns( + { + account_tokens: T::Array[String], + business_account_tokens: T::Array[String], + name: T.nilable(String), + state: + Lithic::AuthRules::V2UpdateParams::Body::AccountLevelRule::State::OrSymbol + } + ) + end + def to_hash + end + + # The desired state of the Auth Rule. + # + # Note that only deactivating an Auth Rule through this endpoint is supported at + # this time. If you need to (re-)activate an Auth Rule the /promote endpoint + # should be used to promote a draft to the currently active version. + module State + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::V2UpdateParams::Body::AccountLevelRule::State + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INACTIVE = + T.let( + :INACTIVE, + Lithic::AuthRules::V2UpdateParams::Body::AccountLevelRule::State::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::V2UpdateParams::Body::AccountLevelRule::State::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class CardLevelRule < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::V2UpdateParams::Body::CardLevelRule, + Lithic::Internal::AnyHash + ) + end + + # Card tokens to which the Auth Rule applies. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :card_tokens + + sig { params(card_tokens: T::Array[String]).void } + attr_writer :card_tokens + + # Auth Rule Name + sig { returns(T.nilable(String)) } + attr_accessor :name + + # The desired state of the Auth Rule. + # + # Note that only deactivating an Auth Rule through this endpoint is supported at + # this time. If you need to (re-)activate an Auth Rule the /promote endpoint + # should be used to promote a draft to the currently active version. + sig do + returns( + T.nilable( + Lithic::AuthRules::V2UpdateParams::Body::CardLevelRule::State::OrSymbol + ) + ) + end + attr_reader :state + + sig do + params( + state: + Lithic::AuthRules::V2UpdateParams::Body::CardLevelRule::State::OrSymbol + ).void + end + attr_writer :state + + sig do + params( + card_tokens: T::Array[String], + name: T.nilable(String), + state: + Lithic::AuthRules::V2UpdateParams::Body::CardLevelRule::State::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Card tokens to which the Auth Rule applies. + card_tokens: nil, + # Auth Rule Name + name: nil, + # The desired state of the Auth Rule. + # + # Note that only deactivating an Auth Rule through this endpoint is supported at + # this time. If you need to (re-)activate an Auth Rule the /promote endpoint + # should be used to promote a draft to the currently active version. + state: nil + ) + end + + sig do + override.returns( + { + card_tokens: T::Array[String], + name: T.nilable(String), + state: + Lithic::AuthRules::V2UpdateParams::Body::CardLevelRule::State::OrSymbol + } + ) + end + def to_hash + end + + # The desired state of the Auth Rule. + # + # Note that only deactivating an Auth Rule through this endpoint is supported at + # this time. If you need to (re-)activate an Auth Rule the /promote endpoint + # should be used to promote a draft to the currently active version. + module State + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::V2UpdateParams::Body::CardLevelRule::State + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INACTIVE = + T.let( + :INACTIVE, + Lithic::AuthRules::V2UpdateParams::Body::CardLevelRule::State::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::V2UpdateParams::Body::CardLevelRule::State::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class ProgramLevelRule < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::V2UpdateParams::Body::ProgramLevelRule, + Lithic::Internal::AnyHash + ) + end + + # Account tokens to which the Auth Rule does not apply. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :excluded_account_tokens + + sig { params(excluded_account_tokens: T::Array[String]).void } + attr_writer :excluded_account_tokens + + # Business account tokens to which the Auth Rule does not apply. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :excluded_business_account_tokens + + sig do + params(excluded_business_account_tokens: T::Array[String]).void + end + attr_writer :excluded_business_account_tokens + + # Card tokens to which the Auth Rule does not apply. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :excluded_card_tokens + + sig { params(excluded_card_tokens: T::Array[String]).void } + attr_writer :excluded_card_tokens + + # Auth Rule Name + sig { returns(T.nilable(String)) } + attr_accessor :name + + # Whether the Auth Rule applies to all authorizations on the card program. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :program_level + + sig { params(program_level: T::Boolean).void } + attr_writer :program_level + + # The desired state of the Auth Rule. + # + # Note that only deactivating an Auth Rule through this endpoint is supported at + # this time. If you need to (re-)activate an Auth Rule the /promote endpoint + # should be used to promote a draft to the currently active version. + sig do + returns( + T.nilable( + Lithic::AuthRules::V2UpdateParams::Body::ProgramLevelRule::State::OrSymbol + ) + ) + end + attr_reader :state + + sig do + params( + state: + Lithic::AuthRules::V2UpdateParams::Body::ProgramLevelRule::State::OrSymbol + ).void + end + attr_writer :state + + sig do + params( + excluded_account_tokens: T::Array[String], + excluded_business_account_tokens: T::Array[String], + excluded_card_tokens: T::Array[String], + name: T.nilable(String), + program_level: T::Boolean, + state: + Lithic::AuthRules::V2UpdateParams::Body::ProgramLevelRule::State::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Account tokens to which the Auth Rule does not apply. + excluded_account_tokens: nil, + # Business account tokens to which the Auth Rule does not apply. + excluded_business_account_tokens: nil, + # Card tokens to which the Auth Rule does not apply. + excluded_card_tokens: nil, + # Auth Rule Name + name: nil, + # Whether the Auth Rule applies to all authorizations on the card program. + program_level: nil, + # The desired state of the Auth Rule. + # + # Note that only deactivating an Auth Rule through this endpoint is supported at + # this time. If you need to (re-)activate an Auth Rule the /promote endpoint + # should be used to promote a draft to the currently active version. + state: nil + ) + end + + sig do + override.returns( + { + excluded_account_tokens: T::Array[String], + excluded_business_account_tokens: T::Array[String], + excluded_card_tokens: T::Array[String], + name: T.nilable(String), + program_level: T::Boolean, + state: + Lithic::AuthRules::V2UpdateParams::Body::ProgramLevelRule::State::OrSymbol + } + ) + end + def to_hash + end + + # The desired state of the Auth Rule. + # + # Note that only deactivating an Auth Rule through this endpoint is supported at + # this time. If you need to (re-)activate an Auth Rule the /promote endpoint + # should be used to promote a draft to the currently active version. + module State + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::V2UpdateParams::Body::ProgramLevelRule::State + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INACTIVE = + T.let( + :INACTIVE, + Lithic::AuthRules::V2UpdateParams::Body::ProgramLevelRule::State::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::V2UpdateParams::Body::ProgramLevelRule::State::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig do + override.returns( + T::Array[Lithic::AuthRules::V2UpdateParams::Body::Variants] + ) + end + def self.variants + end + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/velocity_limit_filters.rbi b/rbi/lithic/models/auth_rules/velocity_limit_filters.rbi new file mode 100644 index 00000000..36bdeb7c --- /dev/null +++ b/rbi/lithic/models/auth_rules/velocity_limit_filters.rbi @@ -0,0 +1,205 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class VelocityLimitFilters < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::VelocityLimitFilters, + Lithic::Internal::AnyHash + ) + end + + # ISO-3166-1 alpha-3 Country Codes to exclude from the velocity calculation. + # Transactions matching any of the provided will be excluded from the calculated + # velocity. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :exclude_countries + + # Merchant Category Codes to exclude from the velocity calculation. Transactions + # matching this MCC will be excluded from the calculated velocity. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :exclude_mccs + + # ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. + # Transactions not matching any of the provided will not be included in the + # calculated velocity. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :include_countries + + # Merchant Category Codes to include in the velocity calculation. Transactions not + # matching this MCC will not be included in the calculated velocity. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :include_mccs + + # PAN entry modes to include in the velocity calculation. Transactions not + # matching any of the provided will not be included in the calculated velocity. + sig do + returns( + T.nilable( + T::Array[ + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::OrSymbol + ] + ) + ) + end + attr_accessor :include_pan_entry_modes + + sig do + params( + exclude_countries: T.nilable(T::Array[String]), + exclude_mccs: T.nilable(T::Array[String]), + include_countries: T.nilable(T::Array[String]), + include_mccs: T.nilable(T::Array[String]), + include_pan_entry_modes: + T.nilable( + T::Array[ + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::OrSymbol + ] + ) + ).returns(T.attached_class) + end + def self.new( + # ISO-3166-1 alpha-3 Country Codes to exclude from the velocity calculation. + # Transactions matching any of the provided will be excluded from the calculated + # velocity. + exclude_countries: nil, + # Merchant Category Codes to exclude from the velocity calculation. Transactions + # matching this MCC will be excluded from the calculated velocity. + exclude_mccs: nil, + # ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. + # Transactions not matching any of the provided will not be included in the + # calculated velocity. + include_countries: nil, + # Merchant Category Codes to include in the velocity calculation. Transactions not + # matching this MCC will not be included in the calculated velocity. + include_mccs: nil, + # PAN entry modes to include in the velocity calculation. Transactions not + # matching any of the provided will not be included in the calculated velocity. + include_pan_entry_modes: nil + ) + end + + sig do + override.returns( + { + exclude_countries: T.nilable(T::Array[String]), + exclude_mccs: T.nilable(T::Array[String]), + include_countries: T.nilable(T::Array[String]), + include_mccs: T.nilable(T::Array[String]), + include_pan_entry_modes: + T.nilable( + T::Array[ + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::OrSymbol + ] + ) + } + ) + end + def to_hash + end + + module IncludePanEntryMode + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AUTO_ENTRY = + T.let( + :AUTO_ENTRY, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + BAR_CODE = + T.let( + :BAR_CODE, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + CONTACTLESS = + T.let( + :CONTACTLESS, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + CREDENTIAL_ON_FILE = + T.let( + :CREDENTIAL_ON_FILE, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + ECOMMERCE = + T.let( + :ECOMMERCE, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + ERROR_KEYED = + T.let( + :ERROR_KEYED, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + ERROR_MAGNETIC_STRIPE = + T.let( + :ERROR_MAGNETIC_STRIPE, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + ICC = + T.let( + :ICC, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + KEY_ENTERED = + T.let( + :KEY_ENTERED, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + MAGNETIC_STRIPE = + T.let( + :MAGNETIC_STRIPE, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + MANUAL = + T.let( + :MANUAL, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + OCR = + T.let( + :OCR, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + SECURE_CARDLESS = + T.let( + :SECURE_CARDLESS, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + UNSPECIFIED = + T.let( + :UNSPECIFIED, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::VelocityLimitFilters::IncludePanEntryMode::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/velocity_limit_params.rbi b/rbi/lithic/models/auth_rules/velocity_limit_params.rbi new file mode 100644 index 00000000..d050b654 --- /dev/null +++ b/rbi/lithic/models/auth_rules/velocity_limit_params.rbi @@ -0,0 +1,145 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + class VelocityLimitParams < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::VelocityLimitParams, + Lithic::Internal::AnyHash + ) + end + + # Velocity over the current day since 00:00 / 12 AM in Eastern Time + sig do + returns( + T.any( + Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowDay, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowWeek, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowMonth, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear + ) + ) + end + attr_accessor :period + + # The scope the velocity is calculated for + sig { returns(Lithic::AuthRules::VelocityLimitParams::Scope::OrSymbol) } + attr_accessor :scope + + sig { returns(T.nilable(Lithic::AuthRules::VelocityLimitFilters)) } + attr_reader :filters + + sig do + params(filters: Lithic::AuthRules::VelocityLimitFilters::OrHash).void + end + attr_writer :filters + + # The maximum amount of spend velocity allowed in the period in minor units (the + # smallest unit of a currency, e.g. cents for USD). Transactions exceeding this + # limit will be declined. + sig { returns(T.nilable(Integer)) } + attr_accessor :limit_amount + + # The number of spend velocity impacting transactions may not exceed this limit in + # the period. Transactions exceeding this limit will be declined. A spend velocity + # impacting transaction is a transaction that has been authorized, and optionally + # settled, or a force post (a transaction that settled without prior + # authorization). + sig { returns(T.nilable(Integer)) } + attr_accessor :limit_count + + sig do + params( + period: + T.any( + Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject::OrHash, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowDay::OrHash, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowWeek::OrHash, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowMonth::OrHash, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear::OrHash + ), + scope: Lithic::AuthRules::VelocityLimitParams::Scope::OrSymbol, + filters: Lithic::AuthRules::VelocityLimitFilters::OrHash, + limit_amount: T.nilable(Integer), + limit_count: T.nilable(Integer) + ).returns(T.attached_class) + end + def self.new( + # Velocity over the current day since 00:00 / 12 AM in Eastern Time + period:, + # The scope the velocity is calculated for + scope:, + filters: nil, + # The maximum amount of spend velocity allowed in the period in minor units (the + # smallest unit of a currency, e.g. cents for USD). Transactions exceeding this + # limit will be declined. + limit_amount: nil, + # The number of spend velocity impacting transactions may not exceed this limit in + # the period. Transactions exceeding this limit will be declined. A spend velocity + # impacting transaction is a transaction that has been authorized, and optionally + # settled, or a force post (a transaction that settled without prior + # authorization). + limit_count: nil + ) + end + + sig do + override.returns( + { + period: + T.any( + Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowDay, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowWeek, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowMonth, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear + ), + scope: Lithic::AuthRules::VelocityLimitParams::Scope::OrSymbol, + filters: Lithic::AuthRules::VelocityLimitFilters, + limit_amount: T.nilable(Integer), + limit_count: T.nilable(Integer) + } + ) + end + def to_hash + end + + # The scope the velocity is calculated for + module Scope + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::AuthRules::VelocityLimitParams::Scope) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CARD = + T.let( + :CARD, + Lithic::AuthRules::VelocityLimitParams::Scope::TaggedSymbol + ) + ACCOUNT = + T.let( + :ACCOUNT, + Lithic::AuthRules::VelocityLimitParams::Scope::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::AuthRules::VelocityLimitParams::Scope::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules/velocity_limit_period.rbi b/rbi/lithic/models/auth_rules/velocity_limit_period.rbi new file mode 100644 index 00000000..82871b54 --- /dev/null +++ b/rbi/lithic/models/auth_rules/velocity_limit_period.rbi @@ -0,0 +1,223 @@ +# typed: strong + +module Lithic + module Models + module AuthRules + # Velocity over the current day since 00:00 / 12 AM in Eastern Time + module VelocityLimitPeriod + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowDay, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowWeek, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowMonth, + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear + ) + end + + class TrailingWindowObject < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject, + Lithic::Internal::AnyHash + ) + end + + # The size of the trailing window to calculate Spend Velocity over in seconds. The + # minimum value is 10 seconds, and the maximum value is 2678400 seconds (31 days). + sig { returns(Integer) } + attr_accessor :duration + + sig { returns(Symbol) } + attr_accessor :type + + sig do + params(duration: Integer, type: Symbol).returns(T.attached_class) + end + def self.new( + # The size of the trailing window to calculate Spend Velocity over in seconds. The + # minimum value is 10 seconds, and the maximum value is 2678400 seconds (31 days). + duration:, + type: :CUSTOM + ) + end + + sig { override.returns({ duration: Integer, type: Symbol }) } + def to_hash + end + end + + class FixedWindowDay < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowDay, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Symbol) } + attr_accessor :type + + # Velocity over the current day since 00:00 / 12 AM in Eastern Time + sig { params(type: Symbol).returns(T.attached_class) } + def self.new(type: :DAY) + end + + sig { override.returns({ type: Symbol }) } + def to_hash + end + end + + class FixedWindowWeek < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowWeek, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Symbol) } + attr_accessor :type + + # The day of the week to start the week from. Following ISO-8601, 1 is Monday and + # 7 is Sunday. Defaults to Monday if not specified. + sig { returns(T.nilable(Integer)) } + attr_reader :day_of_week + + sig { params(day_of_week: Integer).void } + attr_writer :day_of_week + + # Velocity over the current week since 00:00 / 12 AM in Eastern Time on specified + # `day_of_week` + sig do + params(day_of_week: Integer, type: Symbol).returns(T.attached_class) + end + def self.new( + # The day of the week to start the week from. Following ISO-8601, 1 is Monday and + # 7 is Sunday. Defaults to Monday if not specified. + day_of_week: nil, + type: :WEEK + ) + end + + sig { override.returns({ type: Symbol, day_of_week: Integer }) } + def to_hash + end + end + + class FixedWindowMonth < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowMonth, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Symbol) } + attr_accessor :type + + # The day of the month to start from. Accepts values from 1 to 31, and will reset + # at the end of the month if the day exceeds the number of days in the month. + # Defaults to the 1st of the month if not specified. + sig { returns(T.nilable(Integer)) } + attr_reader :day_of_month + + sig { params(day_of_month: Integer).void } + attr_writer :day_of_month + + # Velocity over the current month since 00:00 / 12 AM in Eastern Time on specified + # `day_of_month`. + sig do + params(day_of_month: Integer, type: Symbol).returns( + T.attached_class + ) + end + def self.new( + # The day of the month to start from. Accepts values from 1 to 31, and will reset + # at the end of the month if the day exceeds the number of days in the month. + # Defaults to the 1st of the month if not specified. + day_of_month: nil, + type: :MONTH + ) + end + + sig { override.returns({ type: Symbol, day_of_month: Integer }) } + def to_hash + end + end + + class FixedWindowYear < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Symbol) } + attr_accessor :type + + # The day of the month to start from. Defaults to the 1st of the month if not + # specified. + sig { returns(T.nilable(Integer)) } + attr_reader :day_of_month + + sig { params(day_of_month: Integer).void } + attr_writer :day_of_month + + # The month to start from. 1 is January and 12 is December. Defaults to January if + # not specified. + sig { returns(T.nilable(Integer)) } + attr_reader :month + + sig { params(month: Integer).void } + attr_writer :month + + # Velocity over the current year since 00:00 / 12 AM in Eastern Time on specified + # `month` and `day_of_month`. This validates the month and day of the year to + # start from is a real date. In the event that February 29th is selected, in + # non-leap years, the window will start from February 28th. + sig do + params(day_of_month: Integer, month: Integer, type: Symbol).returns( + T.attached_class + ) + end + def self.new( + # The day of the month to start from. Defaults to the 1st of the month if not + # specified. + day_of_month: nil, + # The month to start from. 1 is January and 12 is December. Defaults to January if + # not specified. + month: nil, + type: :YEAR + ) + end + + sig do + override.returns( + { type: Symbol, day_of_month: Integer, month: Integer } + ) + end + def to_hash + end + end + + sig do + override.returns( + T::Array[Lithic::AuthRules::VelocityLimitPeriod::Variants] + ) + end + def self.variants + end + end + end + end +end diff --git a/rbi/lithic/models/auth_rules_backtest_report_created_webhook_event.rbi b/rbi/lithic/models/auth_rules_backtest_report_created_webhook_event.rbi new file mode 100644 index 00000000..ceedce00 --- /dev/null +++ b/rbi/lithic/models/auth_rules_backtest_report_created_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class AuthRulesBacktestReportCreatedWebhookEvent < Lithic::Models::AuthRules::V2::BacktestResults + OrHash = + T.type_alias do + T.any( + Lithic::AuthRulesBacktestReportCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"auth_rules.backtest_report.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/auth_stream_enrollment_retrieve_secret_params.rbi b/rbi/lithic/models/auth_stream_enrollment_retrieve_secret_params.rbi new file mode 100644 index 00000000..ae1a9357 --- /dev/null +++ b/rbi/lithic/models/auth_stream_enrollment_retrieve_secret_params.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class AuthStreamEnrollmentRetrieveSecretParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::AuthStreamEnrollmentRetrieveSecretParams, + Lithic::Internal::AnyHash + ) + end + + sig do + params(request_options: Lithic::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: Lithic::RequestOptions }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/auth_stream_enrollment_rotate_secret_params.rbi b/rbi/lithic/models/auth_stream_enrollment_rotate_secret_params.rbi new file mode 100644 index 00000000..98559b07 --- /dev/null +++ b/rbi/lithic/models/auth_stream_enrollment_rotate_secret_params.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class AuthStreamEnrollmentRotateSecretParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::AuthStreamEnrollmentRotateSecretParams, + Lithic::Internal::AnyHash + ) + end + + sig do + params(request_options: Lithic::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: Lithic::RequestOptions }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/auth_stream_secret.rbi b/rbi/lithic/models/auth_stream_secret.rbi new file mode 100644 index 00000000..2bd3c290 --- /dev/null +++ b/rbi/lithic/models/auth_stream_secret.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class AuthStreamSecret < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::AuthStreamSecret, Lithic::Internal::AnyHash) + end + + # The shared HMAC ASA secret + sig { returns(T.nilable(String)) } + attr_reader :secret + + sig { params(secret: String).void } + attr_writer :secret + + sig { params(secret: String).returns(T.attached_class) } + def self.new( + # The shared HMAC ASA secret + secret: nil + ) + end + + sig { override.returns({ secret: String }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/balance.rbi b/rbi/lithic/models/balance.rbi new file mode 100644 index 00000000..f444fbc7 --- /dev/null +++ b/rbi/lithic/models/balance.rbi @@ -0,0 +1,150 @@ +# typed: strong + +module Lithic + module Models + class Balance < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Lithic::Balance, Lithic::Internal::AnyHash) } + + # Funds available for spend in the currency's smallest unit (e.g., cents for USD) + sig { returns(Integer) } + attr_accessor :available_amount + + # Date and time for when the balance was first created. + sig { returns(Time) } + attr_accessor :created + + # 3-character alphabetic ISO 4217 code for the local currency of the balance. + sig { returns(String) } + attr_accessor :currency + + # Globally unique identifier for the financial account that holds this balance. + sig { returns(String) } + attr_accessor :financial_account_token + + # Type of financial account. + sig { returns(Lithic::Balance::FinancialAccountType::TaggedSymbol) } + attr_accessor :financial_account_type + + # Globally unique identifier for the last financial transaction event that + # impacted this balance. + sig { returns(T.nilable(String)) } + attr_accessor :last_transaction_event_token + + # Globally unique identifier for the last financial transaction that impacted this + # balance. + sig { returns(T.nilable(String)) } + attr_accessor :last_transaction_token + + # Funds not available for spend due to card authorizations or pending ACH release. + # Shown in the currency's smallest unit (e.g., cents for USD). + sig { returns(Integer) } + attr_accessor :pending_amount + + # The sum of available and pending balance in the currency's smallest unit (e.g., + # cents for USD). + sig { returns(Integer) } + attr_accessor :total_amount + + # Date and time for when the balance was last updated. + sig { returns(Time) } + attr_accessor :updated + + # Balance + sig do + params( + available_amount: Integer, + created: Time, + currency: String, + financial_account_token: String, + financial_account_type: + Lithic::Balance::FinancialAccountType::OrSymbol, + last_transaction_event_token: T.nilable(String), + last_transaction_token: T.nilable(String), + pending_amount: Integer, + total_amount: Integer, + updated: Time + ).returns(T.attached_class) + end + def self.new( + # Funds available for spend in the currency's smallest unit (e.g., cents for USD) + available_amount:, + # Date and time for when the balance was first created. + created:, + # 3-character alphabetic ISO 4217 code for the local currency of the balance. + currency:, + # Globally unique identifier for the financial account that holds this balance. + financial_account_token:, + # Type of financial account. + financial_account_type:, + # Globally unique identifier for the last financial transaction event that + # impacted this balance. + last_transaction_event_token:, + # Globally unique identifier for the last financial transaction that impacted this + # balance. + last_transaction_token:, + # Funds not available for spend due to card authorizations or pending ACH release. + # Shown in the currency's smallest unit (e.g., cents for USD). + pending_amount:, + # The sum of available and pending balance in the currency's smallest unit (e.g., + # cents for USD). + total_amount:, + # Date and time for when the balance was last updated. + updated: + ) + end + + sig do + override.returns( + { + available_amount: Integer, + created: Time, + currency: String, + financial_account_token: String, + financial_account_type: + Lithic::Balance::FinancialAccountType::TaggedSymbol, + last_transaction_event_token: T.nilable(String), + last_transaction_token: T.nilable(String), + pending_amount: Integer, + total_amount: Integer, + updated: Time + } + ) + end + def to_hash + end + + # Type of financial account. + module FinancialAccountType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Balance::FinancialAccountType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CARD = T.let(:CARD, Lithic::Balance::FinancialAccountType::TaggedSymbol) + ISSUING = + T.let(:ISSUING, Lithic::Balance::FinancialAccountType::TaggedSymbol) + OPERATING = + T.let(:OPERATING, Lithic::Balance::FinancialAccountType::TaggedSymbol) + PROGRAM_RECEIVABLES = + T.let( + :PROGRAM_RECEIVABLES, + Lithic::Balance::FinancialAccountType::TaggedSymbol + ) + RESERVE = + T.let(:RESERVE, Lithic::Balance::FinancialAccountType::TaggedSymbol) + SECURITY = + T.let(:SECURITY, Lithic::Balance::FinancialAccountType::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::Balance::FinancialAccountType::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/balance_list_params.rbi b/rbi/lithic/models/balance_list_params.rbi new file mode 100644 index 00000000..d7aa0b31 --- /dev/null +++ b/rbi/lithic/models/balance_list_params.rbi @@ -0,0 +1,134 @@ +# typed: strong + +module Lithic + module Models + class BalanceListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::BalanceListParams, Lithic::Internal::AnyHash) + end + + # List balances for all financial accounts of a given account_token. + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # UTC date and time of the balances to retrieve. Defaults to latest available + # balances + sig { returns(T.nilable(Time)) } + attr_reader :balance_date + + sig { params(balance_date: Time).void } + attr_writer :balance_date + + # List balances for all financial accounts of a given business_account_token. + sig { returns(T.nilable(String)) } + attr_reader :business_account_token + + sig { params(business_account_token: String).void } + attr_writer :business_account_token + + # List balances for a given Financial Account type. + sig do + returns( + T.nilable(Lithic::BalanceListParams::FinancialAccountType::OrSymbol) + ) + end + attr_reader :financial_account_type + + sig do + params( + financial_account_type: + Lithic::BalanceListParams::FinancialAccountType::OrSymbol + ).void + end + attr_writer :financial_account_type + + sig do + params( + account_token: String, + balance_date: Time, + business_account_token: String, + financial_account_type: + Lithic::BalanceListParams::FinancialAccountType::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # List balances for all financial accounts of a given account_token. + account_token: nil, + # UTC date and time of the balances to retrieve. Defaults to latest available + # balances + balance_date: nil, + # List balances for all financial accounts of a given business_account_token. + business_account_token: nil, + # List balances for a given Financial Account type. + financial_account_type: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + account_token: String, + balance_date: Time, + business_account_token: String, + financial_account_type: + Lithic::BalanceListParams::FinancialAccountType::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # List balances for a given Financial Account type. + module FinancialAccountType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::BalanceListParams::FinancialAccountType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ISSUING = + T.let( + :ISSUING, + Lithic::BalanceListParams::FinancialAccountType::TaggedSymbol + ) + OPERATING = + T.let( + :OPERATING, + Lithic::BalanceListParams::FinancialAccountType::TaggedSymbol + ) + RESERVE = + T.let( + :RESERVE, + Lithic::BalanceListParams::FinancialAccountType::TaggedSymbol + ) + SECURITY = + T.let( + :SECURITY, + Lithic::BalanceListParams::FinancialAccountType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::BalanceListParams::FinancialAccountType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/balance_updated_webhook_event.rbi b/rbi/lithic/models/balance_updated_webhook_event.rbi new file mode 100644 index 00000000..3b279ea0 --- /dev/null +++ b/rbi/lithic/models/balance_updated_webhook_event.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Lithic + module Models + class BalanceUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::BalanceUpdatedWebhookEvent, Lithic::Internal::AnyHash) + end + + sig { returns(T::Array[Lithic::FinancialAccountBalance]) } + attr_accessor :data + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig do + params( + data: T::Array[Lithic::FinancialAccountBalance::OrHash], + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + data:, + # The type of event that occurred. + event_type: :"balance.updated" + ) + end + + sig do + override.returns( + { + data: T::Array[Lithic::FinancialAccountBalance], + event_type: Symbol + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/book_transfer_create_params.rbi b/rbi/lithic/models/book_transfer_create_params.rbi new file mode 100644 index 00000000..abf9bd88 --- /dev/null +++ b/rbi/lithic/models/book_transfer_create_params.rbi @@ -0,0 +1,423 @@ +# typed: strong + +module Lithic + module Models + class BookTransferCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::BookTransferCreateParams, Lithic::Internal::AnyHash) + end + + # Amount to be transferred in the currency's smallest unit (e.g., cents for USD). + # This should always be a positive value. + sig { returns(Integer) } + attr_accessor :amount + + sig { returns(Lithic::BookTransferCreateParams::Category::OrSymbol) } + attr_accessor :category + + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + sig { returns(String) } + attr_accessor :from_financial_account_token + + # The program specific subtype code for the specified category/type. + sig { returns(String) } + attr_accessor :subtype + + # Globally unique identifier for the financial account or card that will receive + # the funds. Accepted type dependent on the program's use case. + sig { returns(String) } + attr_accessor :to_financial_account_token + + # Type of the book transfer + sig { returns(Lithic::BookTransferCreateParams::Type::OrSymbol) } + attr_accessor :type + + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # External ID defined by the customer + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # Token of an existing hold to settle when this transfer is initiated + sig { returns(T.nilable(String)) } + attr_reader :hold_token + + sig { params(hold_token: String).void } + attr_writer :hold_token + + # Optional descriptor for the transfer. + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + # What to do if the financial account is closed when posting an operation + sig do + returns( + T.nilable(Lithic::BookTransferCreateParams::OnClosedAccount::OrSymbol) + ) + end + attr_reader :on_closed_account + + sig do + params( + on_closed_account: + Lithic::BookTransferCreateParams::OnClosedAccount::OrSymbol + ).void + end + attr_writer :on_closed_account + + sig do + params( + amount: Integer, + category: Lithic::BookTransferCreateParams::Category::OrSymbol, + from_financial_account_token: String, + subtype: String, + to_financial_account_token: String, + type: Lithic::BookTransferCreateParams::Type::OrSymbol, + token: String, + external_id: String, + hold_token: String, + memo: String, + on_closed_account: + Lithic::BookTransferCreateParams::OnClosedAccount::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Amount to be transferred in the currency's smallest unit (e.g., cents for USD). + # This should always be a positive value. + amount:, + category:, + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + from_financial_account_token:, + # The program specific subtype code for the specified category/type. + subtype:, + # Globally unique identifier for the financial account or card that will receive + # the funds. Accepted type dependent on the program's use case. + to_financial_account_token:, + # Type of the book transfer + type:, + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + token: nil, + # External ID defined by the customer + external_id: nil, + # Token of an existing hold to settle when this transfer is initiated + hold_token: nil, + # Optional descriptor for the transfer. + memo: nil, + # What to do if the financial account is closed when posting an operation + on_closed_account: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + amount: Integer, + category: Lithic::BookTransferCreateParams::Category::OrSymbol, + from_financial_account_token: String, + subtype: String, + to_financial_account_token: String, + type: Lithic::BookTransferCreateParams::Type::OrSymbol, + token: String, + external_id: String, + hold_token: String, + memo: String, + on_closed_account: + Lithic::BookTransferCreateParams::OnClosedAccount::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + module Category + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::BookTransferCreateParams::Category) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ADJUSTMENT = + T.let( + :ADJUSTMENT, + Lithic::BookTransferCreateParams::Category::TaggedSymbol + ) + BALANCE_OR_FUNDING = + T.let( + :BALANCE_OR_FUNDING, + Lithic::BookTransferCreateParams::Category::TaggedSymbol + ) + DERECOGNITION = + T.let( + :DERECOGNITION, + Lithic::BookTransferCreateParams::Category::TaggedSymbol + ) + DISPUTE = + T.let( + :DISPUTE, + Lithic::BookTransferCreateParams::Category::TaggedSymbol + ) + FEE = + T.let(:FEE, Lithic::BookTransferCreateParams::Category::TaggedSymbol) + INTERNAL = + T.let( + :INTERNAL, + Lithic::BookTransferCreateParams::Category::TaggedSymbol + ) + REWARD = + T.let( + :REWARD, + Lithic::BookTransferCreateParams::Category::TaggedSymbol + ) + PROGRAM_FUNDING = + T.let( + :PROGRAM_FUNDING, + Lithic::BookTransferCreateParams::Category::TaggedSymbol + ) + TRANSFER = + T.let( + :TRANSFER, + Lithic::BookTransferCreateParams::Category::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::BookTransferCreateParams::Category::TaggedSymbol] + ) + end + def self.values + end + end + + # Type of the book transfer + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::BookTransferCreateParams::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ATM_BALANCE_INQUIRY = + T.let( + :ATM_BALANCE_INQUIRY, + Lithic::BookTransferCreateParams::Type::TaggedSymbol + ) + ATM_WITHDRAWAL = + T.let( + :ATM_WITHDRAWAL, + Lithic::BookTransferCreateParams::Type::TaggedSymbol + ) + ATM_DECLINE = + T.let( + :ATM_DECLINE, + Lithic::BookTransferCreateParams::Type::TaggedSymbol + ) + INTERNATIONAL_ATM_WITHDRAWAL = + T.let( + :INTERNATIONAL_ATM_WITHDRAWAL, + Lithic::BookTransferCreateParams::Type::TaggedSymbol + ) + INACTIVITY = + T.let( + :INACTIVITY, + Lithic::BookTransferCreateParams::Type::TaggedSymbol + ) + STATEMENT = + T.let( + :STATEMENT, + Lithic::BookTransferCreateParams::Type::TaggedSymbol + ) + MONTHLY = + T.let(:MONTHLY, Lithic::BookTransferCreateParams::Type::TaggedSymbol) + QUARTERLY = + T.let( + :QUARTERLY, + Lithic::BookTransferCreateParams::Type::TaggedSymbol + ) + ANNUAL = + T.let(:ANNUAL, Lithic::BookTransferCreateParams::Type::TaggedSymbol) + CUSTOMER_SERVICE = + T.let( + :CUSTOMER_SERVICE, + Lithic::BookTransferCreateParams::Type::TaggedSymbol + ) + ACCOUNT_MAINTENANCE = + T.let( + :ACCOUNT_MAINTENANCE, + Lithic::BookTransferCreateParams::Type::TaggedSymbol + ) + ACCOUNT_ACTIVATION = + T.let( + :ACCOUNT_ACTIVATION, + Lithic::BookTransferCreateParams::Type::TaggedSymbol + ) + ACCOUNT_CLOSURE = + T.let( + :ACCOUNT_CLOSURE, + Lithic::BookTransferCreateParams::Type::TaggedSymbol + ) + CARD_REPLACEMENT = + T.let( + :CARD_REPLACEMENT, + Lithic::BookTransferCreateParams::Type::TaggedSymbol + ) + CARD_DELIVERY = + T.let( + :CARD_DELIVERY, + Lithic::BookTransferCreateParams::Type::TaggedSymbol + ) + CARD_CREATE = + T.let( + :CARD_CREATE, + Lithic::BookTransferCreateParams::Type::TaggedSymbol + ) + CURRENCY_CONVERSION = + T.let( + :CURRENCY_CONVERSION, + Lithic::BookTransferCreateParams::Type::TaggedSymbol + ) + INTEREST = + T.let(:INTEREST, Lithic::BookTransferCreateParams::Type::TaggedSymbol) + LATE_PAYMENT = + T.let( + :LATE_PAYMENT, + Lithic::BookTransferCreateParams::Type::TaggedSymbol + ) + BILL_PAYMENT = + T.let( + :BILL_PAYMENT, + Lithic::BookTransferCreateParams::Type::TaggedSymbol + ) + CASH_BACK = + T.let( + :CASH_BACK, + Lithic::BookTransferCreateParams::Type::TaggedSymbol + ) + ACCOUNT_TO_ACCOUNT = + T.let( + :ACCOUNT_TO_ACCOUNT, + Lithic::BookTransferCreateParams::Type::TaggedSymbol + ) + CARD_TO_CARD = + T.let( + :CARD_TO_CARD, + Lithic::BookTransferCreateParams::Type::TaggedSymbol + ) + DISBURSE = + T.let(:DISBURSE, Lithic::BookTransferCreateParams::Type::TaggedSymbol) + BILLING_ERROR = + T.let( + :BILLING_ERROR, + Lithic::BookTransferCreateParams::Type::TaggedSymbol + ) + LOSS_WRITE_OFF = + T.let( + :LOSS_WRITE_OFF, + Lithic::BookTransferCreateParams::Type::TaggedSymbol + ) + EXPIRED_CARD = + T.let( + :EXPIRED_CARD, + Lithic::BookTransferCreateParams::Type::TaggedSymbol + ) + EARLY_DERECOGNITION = + T.let( + :EARLY_DERECOGNITION, + Lithic::BookTransferCreateParams::Type::TaggedSymbol + ) + ESCHEATMENT = + T.let( + :ESCHEATMENT, + Lithic::BookTransferCreateParams::Type::TaggedSymbol + ) + INACTIVITY_FEE_DOWN = + T.let( + :INACTIVITY_FEE_DOWN, + Lithic::BookTransferCreateParams::Type::TaggedSymbol + ) + PROVISIONAL_CREDIT = + T.let( + :PROVISIONAL_CREDIT, + Lithic::BookTransferCreateParams::Type::TaggedSymbol + ) + DISPUTE_WON = + T.let( + :DISPUTE_WON, + Lithic::BookTransferCreateParams::Type::TaggedSymbol + ) + SERVICE = + T.let(:SERVICE, Lithic::BookTransferCreateParams::Type::TaggedSymbol) + TRANSFER = + T.let(:TRANSFER, Lithic::BookTransferCreateParams::Type::TaggedSymbol) + COLLECTION = + T.let( + :COLLECTION, + Lithic::BookTransferCreateParams::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::BookTransferCreateParams::Type::TaggedSymbol] + ) + end + def self.values + end + end + + # What to do if the financial account is closed when posting an operation + module OnClosedAccount + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::BookTransferCreateParams::OnClosedAccount) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FAIL = + T.let( + :FAIL, + Lithic::BookTransferCreateParams::OnClosedAccount::TaggedSymbol + ) + USE_SUSPENSE = + T.let( + :USE_SUSPENSE, + Lithic::BookTransferCreateParams::OnClosedAccount::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::BookTransferCreateParams::OnClosedAccount::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/book_transfer_list_params.rbi b/rbi/lithic/models/book_transfer_list_params.rbi new file mode 100644 index 00000000..38a99db3 --- /dev/null +++ b/rbi/lithic/models/book_transfer_list_params.rbi @@ -0,0 +1,279 @@ +# typed: strong + +module Lithic + module Models + class BookTransferListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::BookTransferListParams, Lithic::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + sig { returns(T.nilable(String)) } + attr_reader :business_account_token + + sig { params(business_account_token: String).void } + attr_writer :business_account_token + + # Book Transfer category to be returned. + sig do + returns(T.nilable(Lithic::BookTransferListParams::Category::OrSymbol)) + end + attr_reader :category + + sig do + params( + category: Lithic::BookTransferListParams::Category::OrSymbol + ).void + end + attr_writer :category + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + sig { returns(T.nilable(String)) } + attr_reader :financial_account_token + + sig { params(financial_account_token: String).void } + attr_writer :financial_account_token + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # Book transfer result to be returned. + sig do + returns(T.nilable(Lithic::BookTransferListParams::Result::OrSymbol)) + end + attr_reader :result + + sig do + params(result: Lithic::BookTransferListParams::Result::OrSymbol).void + end + attr_writer :result + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + # Book transfer status to be returned. + sig do + returns(T.nilable(Lithic::BookTransferListParams::Status::OrSymbol)) + end + attr_reader :status + + sig do + params(status: Lithic::BookTransferListParams::Status::OrSymbol).void + end + attr_writer :status + + sig do + params( + account_token: String, + begin_: Time, + business_account_token: String, + category: Lithic::BookTransferListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::BookTransferListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::BookTransferListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + account_token: nil, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + business_account_token: nil, + # Book Transfer category to be returned. + category: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + financial_account_token: nil, + # Page size (for pagination). + page_size: nil, + # Book transfer result to be returned. + result: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Book transfer status to be returned. + status: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + account_token: String, + begin_: Time, + business_account_token: String, + category: Lithic::BookTransferListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::BookTransferListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::BookTransferListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Book Transfer category to be returned. + module Category + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::BookTransferListParams::Category) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ADJUSTMENT = + T.let( + :ADJUSTMENT, + Lithic::BookTransferListParams::Category::TaggedSymbol + ) + BALANCE_OR_FUNDING = + T.let( + :BALANCE_OR_FUNDING, + Lithic::BookTransferListParams::Category::TaggedSymbol + ) + DERECOGNITION = + T.let( + :DERECOGNITION, + Lithic::BookTransferListParams::Category::TaggedSymbol + ) + DISPUTE = + T.let( + :DISPUTE, + Lithic::BookTransferListParams::Category::TaggedSymbol + ) + FEE = + T.let(:FEE, Lithic::BookTransferListParams::Category::TaggedSymbol) + INTERNAL = + T.let( + :INTERNAL, + Lithic::BookTransferListParams::Category::TaggedSymbol + ) + REWARD = + T.let(:REWARD, Lithic::BookTransferListParams::Category::TaggedSymbol) + PROGRAM_FUNDING = + T.let( + :PROGRAM_FUNDING, + Lithic::BookTransferListParams::Category::TaggedSymbol + ) + TRANSFER = + T.let( + :TRANSFER, + Lithic::BookTransferListParams::Category::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::BookTransferListParams::Category::TaggedSymbol] + ) + end + def self.values + end + end + + # Book transfer result to be returned. + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::BookTransferListParams::Result) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let(:APPROVED, Lithic::BookTransferListParams::Result::TaggedSymbol) + DECLINED = + T.let(:DECLINED, Lithic::BookTransferListParams::Result::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::BookTransferListParams::Result::TaggedSymbol] + ) + end + def self.values + end + end + + # Book transfer status to be returned. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::BookTransferListParams::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DECLINED = + T.let(:DECLINED, Lithic::BookTransferListParams::Status::TaggedSymbol) + SETTLED = + T.let(:SETTLED, Lithic::BookTransferListParams::Status::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::BookTransferListParams::Status::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/book_transfer_response.rbi b/rbi/lithic/models/book_transfer_response.rbi new file mode 100644 index 00000000..a5115590 --- /dev/null +++ b/rbi/lithic/models/book_transfer_response.rbi @@ -0,0 +1,699 @@ +# typed: strong + +module Lithic + module Models + class BookTransferResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::BookTransferResponse, Lithic::Internal::AnyHash) + end + + # Unique identifier for the transaction + sig { returns(String) } + attr_accessor :token + + sig { returns(Lithic::BookTransferResponse::Category::TaggedSymbol) } + attr_accessor :category + + # ISO 8601 timestamp of when the transaction was created + sig { returns(Time) } + attr_accessor :created + + # 3-character alphabetic ISO 4217 code for the settling currency of the + # transaction + sig { returns(String) } + attr_accessor :currency + + # A list of all financial events that have modified this transfer + sig { returns(T::Array[Lithic::BookTransferResponse::Event]) } + attr_accessor :events + + # TRANSFER - Book Transfer Transaction + sig { returns(Symbol) } + attr_accessor :family + + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case + sig { returns(String) } + attr_accessor :from_financial_account_token + + # Pending amount of the transaction in the currency's smallest unit (e.g., cents), + # including any acquirer fees. + # + # The value of this field will go to zero over time once the financial transaction + # is settled. + sig { returns(Integer) } + attr_accessor :pending_amount + + sig { returns(Lithic::BookTransferResponse::Result::TaggedSymbol) } + attr_accessor :result + + # Amount of the transaction that has been settled in the currency's smallest unit + # (e.g., cents) + sig { returns(Integer) } + attr_accessor :settled_amount + + # The status of the transaction + sig { returns(Lithic::BookTransferResponse::Status::TaggedSymbol) } + attr_accessor :status + + # Globally unique identifier for the financial account or card that will receive + # the funds. Accepted type dependent on the program's use case + sig { returns(String) } + attr_accessor :to_financial_account_token + + # ISO 8601 timestamp of when the transaction was last updated + sig { returns(Time) } + attr_accessor :updated + + # External ID defined by the customer + sig { returns(T.nilable(String)) } + attr_accessor :external_id + + # External resource associated with the management operation + sig { returns(T.nilable(Lithic::ExternalResource)) } + attr_reader :external_resource + + sig do + params( + external_resource: T.nilable(Lithic::ExternalResource::OrHash) + ).void + end + attr_writer :external_resource + + # A series of transactions that are grouped together + sig do + returns(T.nilable(Lithic::BookTransferResponse::TransactionSeries)) + end + attr_reader :transaction_series + + sig do + params( + transaction_series: + T.nilable(Lithic::BookTransferResponse::TransactionSeries::OrHash) + ).void + end + attr_writer :transaction_series + + # Book transfer transaction + sig do + params( + token: String, + category: Lithic::BookTransferResponse::Category::OrSymbol, + created: Time, + currency: String, + events: T::Array[Lithic::BookTransferResponse::Event::OrHash], + from_financial_account_token: String, + pending_amount: Integer, + result: Lithic::BookTransferResponse::Result::OrSymbol, + settled_amount: Integer, + status: Lithic::BookTransferResponse::Status::OrSymbol, + to_financial_account_token: String, + updated: Time, + external_id: T.nilable(String), + external_resource: T.nilable(Lithic::ExternalResource::OrHash), + transaction_series: + T.nilable(Lithic::BookTransferResponse::TransactionSeries::OrHash), + family: Symbol + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the transaction + token:, + category:, + # ISO 8601 timestamp of when the transaction was created + created:, + # 3-character alphabetic ISO 4217 code for the settling currency of the + # transaction + currency:, + # A list of all financial events that have modified this transfer + events:, + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case + from_financial_account_token:, + # Pending amount of the transaction in the currency's smallest unit (e.g., cents), + # including any acquirer fees. + # + # The value of this field will go to zero over time once the financial transaction + # is settled. + pending_amount:, + result:, + # Amount of the transaction that has been settled in the currency's smallest unit + # (e.g., cents) + settled_amount:, + # The status of the transaction + status:, + # Globally unique identifier for the financial account or card that will receive + # the funds. Accepted type dependent on the program's use case + to_financial_account_token:, + # ISO 8601 timestamp of when the transaction was last updated + updated:, + # External ID defined by the customer + external_id: nil, + # External resource associated with the management operation + external_resource: nil, + # A series of transactions that are grouped together + transaction_series: nil, + # TRANSFER - Book Transfer Transaction + family: :TRANSFER + ) + end + + sig do + override.returns( + { + token: String, + category: Lithic::BookTransferResponse::Category::TaggedSymbol, + created: Time, + currency: String, + events: T::Array[Lithic::BookTransferResponse::Event], + family: Symbol, + from_financial_account_token: String, + pending_amount: Integer, + result: Lithic::BookTransferResponse::Result::TaggedSymbol, + settled_amount: Integer, + status: Lithic::BookTransferResponse::Status::TaggedSymbol, + to_financial_account_token: String, + updated: Time, + external_id: T.nilable(String), + external_resource: T.nilable(Lithic::ExternalResource), + transaction_series: + T.nilable(Lithic::BookTransferResponse::TransactionSeries) + } + ) + end + def to_hash + end + + module Category + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::BookTransferResponse::Category) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ADJUSTMENT = + T.let( + :ADJUSTMENT, + Lithic::BookTransferResponse::Category::TaggedSymbol + ) + BALANCE_OR_FUNDING = + T.let( + :BALANCE_OR_FUNDING, + Lithic::BookTransferResponse::Category::TaggedSymbol + ) + DERECOGNITION = + T.let( + :DERECOGNITION, + Lithic::BookTransferResponse::Category::TaggedSymbol + ) + DISPUTE = + T.let(:DISPUTE, Lithic::BookTransferResponse::Category::TaggedSymbol) + FEE = T.let(:FEE, Lithic::BookTransferResponse::Category::TaggedSymbol) + INTERNAL = + T.let(:INTERNAL, Lithic::BookTransferResponse::Category::TaggedSymbol) + REWARD = + T.let(:REWARD, Lithic::BookTransferResponse::Category::TaggedSymbol) + PROGRAM_FUNDING = + T.let( + :PROGRAM_FUNDING, + Lithic::BookTransferResponse::Category::TaggedSymbol + ) + TRANSFER = + T.let(:TRANSFER, Lithic::BookTransferResponse::Category::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::BookTransferResponse::Category::TaggedSymbol] + ) + end + def self.values + end + end + + class Event < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::BookTransferResponse::Event, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier. + sig { returns(String) } + attr_accessor :token + + # Amount of the financial event that has been settled in the currency's smallest + # unit (e.g., cents). + sig { returns(Integer) } + attr_accessor :amount + + # Date and time when the financial event occurred. UTC time zone. + sig { returns(Time) } + attr_accessor :created + + sig do + returns( + T::Array[ + Lithic::BookTransferResponse::Event::DetailedResult::TaggedSymbol + ] + ) + end + attr_accessor :detailed_results + + # Memo for the transfer. + sig { returns(String) } + attr_accessor :memo + + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + sig do + returns(Lithic::BookTransferResponse::Event::Result::TaggedSymbol) + end + attr_accessor :result + + # The program specific subtype code for the specified category/type. + sig { returns(String) } + attr_accessor :subtype + + # Type of the book transfer + sig { returns(Lithic::BookTransferResponse::Event::Type::TaggedSymbol) } + attr_accessor :type + + # Book transfer Event + sig do + params( + token: String, + amount: Integer, + created: Time, + detailed_results: + T::Array[ + Lithic::BookTransferResponse::Event::DetailedResult::OrSymbol + ], + memo: String, + result: Lithic::BookTransferResponse::Event::Result::OrSymbol, + subtype: String, + type: Lithic::BookTransferResponse::Event::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier. + token:, + # Amount of the financial event that has been settled in the currency's smallest + # unit (e.g., cents). + amount:, + # Date and time when the financial event occurred. UTC time zone. + created:, + detailed_results:, + # Memo for the transfer. + memo:, + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + result:, + # The program specific subtype code for the specified category/type. + subtype:, + # Type of the book transfer + type: + ) + end + + sig do + override.returns( + { + token: String, + amount: Integer, + created: Time, + detailed_results: + T::Array[ + Lithic::BookTransferResponse::Event::DetailedResult::TaggedSymbol + ], + memo: String, + result: Lithic::BookTransferResponse::Event::Result::TaggedSymbol, + subtype: String, + type: Lithic::BookTransferResponse::Event::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module DetailedResult + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::BookTransferResponse::Event::DetailedResult) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::BookTransferResponse::Event::DetailedResult::TaggedSymbol + ) + FUNDS_INSUFFICIENT = + T.let( + :FUNDS_INSUFFICIENT, + Lithic::BookTransferResponse::Event::DetailedResult::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::BookTransferResponse::Event::DetailedResult::TaggedSymbol + ] + ) + end + def self.values + end + end + + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::BookTransferResponse::Event::Result) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::BookTransferResponse::Event::Result::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::BookTransferResponse::Event::Result::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::BookTransferResponse::Event::Result::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Type of the book transfer + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::BookTransferResponse::Event::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ATM_BALANCE_INQUIRY = + T.let( + :ATM_BALANCE_INQUIRY, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + ATM_WITHDRAWAL = + T.let( + :ATM_WITHDRAWAL, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + ATM_DECLINE = + T.let( + :ATM_DECLINE, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + INTERNATIONAL_ATM_WITHDRAWAL = + T.let( + :INTERNATIONAL_ATM_WITHDRAWAL, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + INACTIVITY = + T.let( + :INACTIVITY, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + STATEMENT = + T.let( + :STATEMENT, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + MONTHLY = + T.let( + :MONTHLY, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + QUARTERLY = + T.let( + :QUARTERLY, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + ANNUAL = + T.let( + :ANNUAL, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + CUSTOMER_SERVICE = + T.let( + :CUSTOMER_SERVICE, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + ACCOUNT_MAINTENANCE = + T.let( + :ACCOUNT_MAINTENANCE, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + ACCOUNT_ACTIVATION = + T.let( + :ACCOUNT_ACTIVATION, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + ACCOUNT_CLOSURE = + T.let( + :ACCOUNT_CLOSURE, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + CARD_REPLACEMENT = + T.let( + :CARD_REPLACEMENT, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + CARD_DELIVERY = + T.let( + :CARD_DELIVERY, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + CARD_CREATE = + T.let( + :CARD_CREATE, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + CURRENCY_CONVERSION = + T.let( + :CURRENCY_CONVERSION, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + INTEREST = + T.let( + :INTEREST, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + LATE_PAYMENT = + T.let( + :LATE_PAYMENT, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + BILL_PAYMENT = + T.let( + :BILL_PAYMENT, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + CASH_BACK = + T.let( + :CASH_BACK, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + ACCOUNT_TO_ACCOUNT = + T.let( + :ACCOUNT_TO_ACCOUNT, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + CARD_TO_CARD = + T.let( + :CARD_TO_CARD, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + DISBURSE = + T.let( + :DISBURSE, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + BILLING_ERROR = + T.let( + :BILLING_ERROR, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + LOSS_WRITE_OFF = + T.let( + :LOSS_WRITE_OFF, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + EXPIRED_CARD = + T.let( + :EXPIRED_CARD, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + EARLY_DERECOGNITION = + T.let( + :EARLY_DERECOGNITION, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + ESCHEATMENT = + T.let( + :ESCHEATMENT, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + INACTIVITY_FEE_DOWN = + T.let( + :INACTIVITY_FEE_DOWN, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + PROVISIONAL_CREDIT = + T.let( + :PROVISIONAL_CREDIT, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + DISPUTE_WON = + T.let( + :DISPUTE_WON, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + SERVICE = + T.let( + :SERVICE, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + TRANSFER = + T.let( + :TRANSFER, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + COLLECTION = + T.let( + :COLLECTION, + Lithic::BookTransferResponse::Event::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::BookTransferResponse::Event::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::BookTransferResponse::Result) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let(:APPROVED, Lithic::BookTransferResponse::Result::TaggedSymbol) + DECLINED = + T.let(:DECLINED, Lithic::BookTransferResponse::Result::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::BookTransferResponse::Result::TaggedSymbol] + ) + end + def self.values + end + end + + # The status of the transaction + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::BookTransferResponse::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let(:PENDING, Lithic::BookTransferResponse::Status::TaggedSymbol) + SETTLED = + T.let(:SETTLED, Lithic::BookTransferResponse::Status::TaggedSymbol) + DECLINED = + T.let(:DECLINED, Lithic::BookTransferResponse::Status::TaggedSymbol) + REVERSED = + T.let(:REVERSED, Lithic::BookTransferResponse::Status::TaggedSymbol) + CANCELED = + T.let(:CANCELED, Lithic::BookTransferResponse::Status::TaggedSymbol) + RETURNED = + T.let(:RETURNED, Lithic::BookTransferResponse::Status::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::BookTransferResponse::Status::TaggedSymbol] + ) + end + def self.values + end + end + + class TransactionSeries < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::BookTransferResponse::TransactionSeries, + Lithic::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :related_transaction_event_token + + sig { returns(T.nilable(String)) } + attr_accessor :related_transaction_token + + sig { returns(String) } + attr_accessor :type + + # A series of transactions that are grouped together + sig do + params( + related_transaction_event_token: T.nilable(String), + related_transaction_token: T.nilable(String), + type: String + ).returns(T.attached_class) + end + def self.new( + related_transaction_event_token:, + related_transaction_token:, + type: + ) + end + + sig do + override.returns( + { + related_transaction_event_token: T.nilable(String), + related_transaction_token: T.nilable(String), + type: String + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/book_transfer_retrieve_params.rbi b/rbi/lithic/models/book_transfer_retrieve_params.rbi new file mode 100644 index 00000000..d6a06d26 --- /dev/null +++ b/rbi/lithic/models/book_transfer_retrieve_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Lithic + module Models + class BookTransferRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::BookTransferRetrieveParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :book_transfer_token + + sig do + params( + book_transfer_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(book_transfer_token:, request_options: {}) + end + + sig do + override.returns( + { + book_transfer_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/book_transfer_retry_params.rbi b/rbi/lithic/models/book_transfer_retry_params.rbi new file mode 100644 index 00000000..822f8dce --- /dev/null +++ b/rbi/lithic/models/book_transfer_retry_params.rbi @@ -0,0 +1,51 @@ +# typed: strong + +module Lithic + module Models + class BookTransferRetryParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::BookTransferRetryParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :book_transfer_token + + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + sig { returns(String) } + attr_accessor :retry_token + + sig do + params( + book_transfer_token: String, + retry_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + book_transfer_token:, + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + retry_token:, + request_options: {} + ) + end + + sig do + override.returns( + { + book_transfer_token: String, + retry_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/book_transfer_reverse_params.rbi b/rbi/lithic/models/book_transfer_reverse_params.rbi new file mode 100644 index 00000000..907c06fa --- /dev/null +++ b/rbi/lithic/models/book_transfer_reverse_params.rbi @@ -0,0 +1,52 @@ +# typed: strong + +module Lithic + module Models + class BookTransferReverseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::BookTransferReverseParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :book_transfer_token + + # Optional descriptor for the reversal. + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + sig do + params( + book_transfer_token: String, + memo: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + book_transfer_token:, + # Optional descriptor for the reversal. + memo: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + book_transfer_token: String, + memo: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/book_transfer_transaction_created_webhook_event.rbi b/rbi/lithic/models/book_transfer_transaction_created_webhook_event.rbi new file mode 100644 index 00000000..bc907e6d --- /dev/null +++ b/rbi/lithic/models/book_transfer_transaction_created_webhook_event.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Lithic + module Models + class BookTransferTransactionCreatedWebhookEvent < Lithic::Models::BookTransferResponse + OrHash = + T.type_alias do + T.any( + Lithic::BookTransferTransactionCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # Book transfer transaction + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"book_transfer_transaction.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/book_transfer_transaction_updated_webhook_event.rbi b/rbi/lithic/models/book_transfer_transaction_updated_webhook_event.rbi new file mode 100644 index 00000000..73a80459 --- /dev/null +++ b/rbi/lithic/models/book_transfer_transaction_updated_webhook_event.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Lithic + module Models + class BookTransferTransactionUpdatedWebhookEvent < Lithic::Models::BookTransferResponse + OrHash = + T.type_alias do + T.any( + Lithic::BookTransferTransactionUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # Book transfer transaction + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"book_transfer_transaction.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/card.rbi b/rbi/lithic/models/card.rbi new file mode 100644 index 00000000..61acefb0 --- /dev/null +++ b/rbi/lithic/models/card.rbi @@ -0,0 +1,41 @@ +# typed: strong + +module Lithic + module Models + class Card < Lithic::Models::NonPCICard + OrHash = T.type_alias { T.any(Lithic::Card, Lithic::Internal::AnyHash) } + + # Three digit cvv printed on the back of the card. + sig { returns(T.nilable(String)) } + attr_reader :cvv + + sig { params(cvv: String).void } + attr_writer :cvv + + # Primary Account Number (PAN) (i.e. the card number). Customers must be PCI + # compliant to have PAN returned as a field in production. Please contact + # https://support.lithic.com/ for questions. + sig { returns(T.nilable(String)) } + attr_reader :pan + + sig { params(pan: String).void } + attr_writer :pan + + # Card details with potentially PCI sensitive information for Enterprise customers + sig { params(cvv: String, pan: String).returns(T.attached_class) } + def self.new( + # Three digit cvv printed on the back of the card. + cvv: nil, + # Primary Account Number (PAN) (i.e. the card number). Customers must be PCI + # compliant to have PAN returned as a field in production. Please contact + # https://support.lithic.com/ for questions. + pan: nil + ) + end + + sig { override.returns({ cvv: String, pan: String }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/card_authorization.rbi b/rbi/lithic/models/card_authorization.rbi new file mode 100644 index 00000000..f068d17e --- /dev/null +++ b/rbi/lithic/models/card_authorization.rbi @@ -0,0 +1,2769 @@ +# typed: strong + +module Lithic + module Models + class CardAuthorization < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::CardAuthorization, Lithic::Internal::AnyHash) + end + + # The provisional transaction group uuid associated with the authorization + sig { returns(String) } + attr_accessor :token + + # Fee (in cents) assessed by the merchant and paid for by the cardholder. Will be + # zero if no fee is assessed. Rebates may be transmitted as a negative value to + # indicate credited fees. + sig { returns(Integer) } + attr_accessor :acquirer_fee + + # Deprecated, use `amounts`. Authorization amount of the transaction (in cents), + # including any acquirer fees. The contents of this field are identical to + # `authorization_amount`. + sig { returns(Integer) } + attr_accessor :amount + + # Structured amounts for this authorization. The `cardholder` and `merchant` + # amounts reflect the original network authorization values. For programs with + # hold adjustments enabled (e.g., automated fuel dispensers or tipping MCCs), the + # `hold` amount may exceed the `cardholder` and `merchant` amounts to account for + # anticipated final transaction amounts such as tips or fuel fill-ups + sig { returns(Lithic::CardAuthorization::Amounts) } + attr_reader :amounts + + sig { params(amounts: Lithic::CardAuthorization::Amounts::OrHash).void } + attr_writer :amounts + + # Deprecated, use `amounts`. The base transaction amount (in cents) plus the + # acquirer fee field. This is the amount the issuer should authorize against + # unless the issuer is paying the acquirer fee on behalf of the cardholder. + sig { returns(Integer) } + attr_accessor :authorization_amount + + sig { returns(Lithic::CardAuthorization::Avs) } + attr_reader :avs + + sig { params(avs: Lithic::CardAuthorization::Avs::OrHash).void } + attr_writer :avs + + # Card object in ASA + sig { returns(Lithic::CardAuthorization::Card) } + attr_reader :card + + sig { params(card: Lithic::CardAuthorization::Card::OrHash).void } + attr_writer :card + + # Deprecated, use `amounts`. 3-character alphabetic ISO 4217 code for cardholder's + # billing currency. + sig { returns(String) } + attr_accessor :cardholder_currency + + # The portion of the transaction requested as cash back by the cardholder, and + # does not include any acquirer fees. The amount field includes the purchase + # amount, the requested cash back amount, and any acquirer fees. + # + # If no cash back was requested, the value of this field will be 0, and the field + # will always be present. + sig { returns(Integer) } + attr_accessor :cash_amount + + # Date and time when the transaction first occurred in UTC. + sig { returns(Time) } + attr_accessor :created + + # Merchant information including full location details. + sig { returns(Lithic::CardAuthorization::Merchant) } + attr_reader :merchant + + sig { params(merchant: Lithic::CardAuthorization::Merchant::OrHash).void } + attr_writer :merchant + + # Deprecated, use `amounts`. The amount that the merchant will receive, + # denominated in `merchant_currency` and in the smallest currency unit. Note the + # amount includes `acquirer_fee`, similar to `authorization_amount`. It will be + # different from `authorization_amount` if the merchant is taking payment in a + # different currency. + sig { returns(Integer) } + attr_accessor :merchant_amount + + # 3-character alphabetic ISO 4217 code for the local currency of the transaction. + sig { returns(String) } + attr_accessor :merchant_currency + + # Network name validation data, present when the card network requested name + # validation for this transaction. Contains the cardholder name provided by the + # network and Lithic's computed match result against KYC data on file. + sig { returns(T.nilable(Lithic::CardAuthorization::NameValidation)) } + attr_reader :name_validation + + sig do + params( + name_validation: + T.nilable(Lithic::CardAuthorization::NameValidation::OrHash) + ).void + end + attr_writer :name_validation + + # Where the cardholder received the service, when different from the card acceptor + # location. This is populated from network data elements such as Mastercard DE-122 + # SE1 SF9-14 and Visa F34 DS02. + sig { returns(T.nilable(Lithic::CardAuthorization::ServiceLocation)) } + attr_reader :service_location + + sig do + params( + service_location: + T.nilable(Lithic::CardAuthorization::ServiceLocation::OrHash) + ).void + end + attr_writer :service_location + + # Deprecated, use `amounts`. Amount (in cents) of the transaction that has been + # settled, including any acquirer fees. + sig { returns(Integer) } + attr_accessor :settled_amount + + # The type of authorization request that this request is for. Note that + # `CREDIT_AUTHORIZATION` and `FINANCIAL_CREDIT_AUTHORIZATION` is only available to + # users with credit decisioning via ASA enabled. + sig { returns(Lithic::CardAuthorization::Status::TaggedSymbol) } + attr_accessor :status + + # The entity that initiated the transaction. + sig do + returns(Lithic::CardAuthorization::TransactionInitiator::TaggedSymbol) + end + attr_accessor :transaction_initiator + + sig do + returns(T.nilable(Lithic::CardAuthorization::AccountType::TaggedSymbol)) + end + attr_reader :account_type + + sig do + params( + account_type: Lithic::CardAuthorization::AccountType::OrSymbol + ).void + end + attr_writer :account_type + + sig { returns(T.nilable(Lithic::CardholderAuthentication)) } + attr_reader :cardholder_authentication + + sig do + params( + cardholder_authentication: Lithic::CardholderAuthentication::OrHash + ).void + end + attr_writer :cardholder_authentication + + # Deprecated, use `cash_amount`. + sig { returns(T.nilable(Integer)) } + attr_reader :cashback + + sig { params(cashback: Integer).void } + attr_writer :cashback + + # Deprecated, use `amounts`. If the transaction was requested in a currency other + # than the settlement currency, this field will be populated to indicate the rate + # used to translate the merchant_amount to the amount (i.e., `merchant_amount` x + # `conversion_rate` = `amount`). Note that the `merchant_amount` is in the local + # currency and the amount is in the settlement currency. + sig { returns(T.nilable(Float)) } + attr_reader :conversion_rate + + sig { params(conversion_rate: Float).void } + attr_writer :conversion_rate + + # The event token associated with the authorization. This field is only set for + # programs enrolled into the beta. + sig { returns(T.nilable(String)) } + attr_reader :event_token + + sig { params(event_token: String).void } + attr_writer :event_token + + # Optional Object containing information if the Card is a part of a Fleet managed + # program + sig { returns(T.nilable(Lithic::CardAuthorization::FleetInfo)) } + attr_reader :fleet_info + + sig do + params( + fleet_info: T.nilable(Lithic::CardAuthorization::FleetInfo::OrHash) + ).void + end + attr_writer :fleet_info + + # The latest Authorization Challenge that was issued to the cardholder for this + # merchant. + sig { returns(T.nilable(Lithic::CardAuthorization::LatestChallenge)) } + attr_reader :latest_challenge + + sig do + params( + latest_challenge: Lithic::CardAuthorization::LatestChallenge::OrHash + ).void + end + attr_writer :latest_challenge + + # Card network of the authorization. + sig do + returns(T.nilable(Lithic::CardAuthorization::Network::TaggedSymbol)) + end + attr_reader :network + + sig { params(network: Lithic::CardAuthorization::Network::OrSymbol).void } + attr_writer :network + + # Network-provided score assessing risk level associated with a given + # authorization. Scores are on a range of 0-999, with 0 representing the lowest + # risk and 999 representing the highest risk. For Visa transactions, where the raw + # score has a range of 0-99, Lithic will normalize the score by multiplying the + # raw score by 10x. + sig { returns(T.nilable(Integer)) } + attr_accessor :network_risk_score + + # Contains raw data provided by the card network, including attributes that + # provide further context about the authorization. If populated by the network, + # data is organized by Lithic and passed through without further modification. + # Please consult the official network documentation for more details about these + # values and how to use them. This object is only available to certain programs- + # contact your Customer Success Manager to discuss enabling access. + sig { returns(T.nilable(Lithic::CardAuthorization::NetworkSpecificData)) } + attr_reader :network_specific_data + + sig do + params( + network_specific_data: + T.nilable(Lithic::CardAuthorization::NetworkSpecificData::OrHash) + ).void + end + attr_writer :network_specific_data + + sig { returns(T.nilable(Lithic::CardAuthorization::Pos)) } + attr_reader :pos + + sig { params(pos: Lithic::CardAuthorization::Pos::OrHash).void } + attr_writer :pos + + sig { returns(T.nilable(Lithic::TokenInfo)) } + attr_reader :token_info + + sig { params(token_info: T.nilable(Lithic::TokenInfo::OrHash)).void } + attr_writer :token_info + + # Deprecated: approximate time-to-live for the authorization. + sig { returns(T.nilable(Time)) } + attr_reader :ttl + + sig { params(ttl: Time).void } + attr_writer :ttl + + # Card Authorization + sig do + params( + token: String, + acquirer_fee: Integer, + amount: Integer, + amounts: Lithic::CardAuthorization::Amounts::OrHash, + authorization_amount: Integer, + avs: Lithic::CardAuthorization::Avs::OrHash, + card: Lithic::CardAuthorization::Card::OrHash, + cardholder_currency: String, + cash_amount: Integer, + created: Time, + merchant: Lithic::CardAuthorization::Merchant::OrHash, + merchant_amount: Integer, + merchant_currency: String, + name_validation: + T.nilable(Lithic::CardAuthorization::NameValidation::OrHash), + service_location: + T.nilable(Lithic::CardAuthorization::ServiceLocation::OrHash), + settled_amount: Integer, + status: Lithic::CardAuthorization::Status::OrSymbol, + transaction_initiator: + Lithic::CardAuthorization::TransactionInitiator::OrSymbol, + account_type: Lithic::CardAuthorization::AccountType::OrSymbol, + cardholder_authentication: Lithic::CardholderAuthentication::OrHash, + cashback: Integer, + conversion_rate: Float, + event_token: String, + fleet_info: T.nilable(Lithic::CardAuthorization::FleetInfo::OrHash), + latest_challenge: Lithic::CardAuthorization::LatestChallenge::OrHash, + network: Lithic::CardAuthorization::Network::OrSymbol, + network_risk_score: T.nilable(Integer), + network_specific_data: + T.nilable(Lithic::CardAuthorization::NetworkSpecificData::OrHash), + pos: Lithic::CardAuthorization::Pos::OrHash, + token_info: T.nilable(Lithic::TokenInfo::OrHash), + ttl: Time + ).returns(T.attached_class) + end + def self.new( + # The provisional transaction group uuid associated with the authorization + token:, + # Fee (in cents) assessed by the merchant and paid for by the cardholder. Will be + # zero if no fee is assessed. Rebates may be transmitted as a negative value to + # indicate credited fees. + acquirer_fee:, + # Deprecated, use `amounts`. Authorization amount of the transaction (in cents), + # including any acquirer fees. The contents of this field are identical to + # `authorization_amount`. + amount:, + # Structured amounts for this authorization. The `cardholder` and `merchant` + # amounts reflect the original network authorization values. For programs with + # hold adjustments enabled (e.g., automated fuel dispensers or tipping MCCs), the + # `hold` amount may exceed the `cardholder` and `merchant` amounts to account for + # anticipated final transaction amounts such as tips or fuel fill-ups + amounts:, + # Deprecated, use `amounts`. The base transaction amount (in cents) plus the + # acquirer fee field. This is the amount the issuer should authorize against + # unless the issuer is paying the acquirer fee on behalf of the cardholder. + authorization_amount:, + avs:, + # Card object in ASA + card:, + # Deprecated, use `amounts`. 3-character alphabetic ISO 4217 code for cardholder's + # billing currency. + cardholder_currency:, + # The portion of the transaction requested as cash back by the cardholder, and + # does not include any acquirer fees. The amount field includes the purchase + # amount, the requested cash back amount, and any acquirer fees. + # + # If no cash back was requested, the value of this field will be 0, and the field + # will always be present. + cash_amount:, + # Date and time when the transaction first occurred in UTC. + created:, + # Merchant information including full location details. + merchant:, + # Deprecated, use `amounts`. The amount that the merchant will receive, + # denominated in `merchant_currency` and in the smallest currency unit. Note the + # amount includes `acquirer_fee`, similar to `authorization_amount`. It will be + # different from `authorization_amount` if the merchant is taking payment in a + # different currency. + merchant_amount:, + # 3-character alphabetic ISO 4217 code for the local currency of the transaction. + merchant_currency:, + # Network name validation data, present when the card network requested name + # validation for this transaction. Contains the cardholder name provided by the + # network and Lithic's computed match result against KYC data on file. + name_validation:, + # Where the cardholder received the service, when different from the card acceptor + # location. This is populated from network data elements such as Mastercard DE-122 + # SE1 SF9-14 and Visa F34 DS02. + service_location:, + # Deprecated, use `amounts`. Amount (in cents) of the transaction that has been + # settled, including any acquirer fees. + settled_amount:, + # The type of authorization request that this request is for. Note that + # `CREDIT_AUTHORIZATION` and `FINANCIAL_CREDIT_AUTHORIZATION` is only available to + # users with credit decisioning via ASA enabled. + status:, + # The entity that initiated the transaction. + transaction_initiator:, + account_type: nil, + cardholder_authentication: nil, + # Deprecated, use `cash_amount`. + cashback: nil, + # Deprecated, use `amounts`. If the transaction was requested in a currency other + # than the settlement currency, this field will be populated to indicate the rate + # used to translate the merchant_amount to the amount (i.e., `merchant_amount` x + # `conversion_rate` = `amount`). Note that the `merchant_amount` is in the local + # currency and the amount is in the settlement currency. + conversion_rate: nil, + # The event token associated with the authorization. This field is only set for + # programs enrolled into the beta. + event_token: nil, + # Optional Object containing information if the Card is a part of a Fleet managed + # program + fleet_info: nil, + # The latest Authorization Challenge that was issued to the cardholder for this + # merchant. + latest_challenge: nil, + # Card network of the authorization. + network: nil, + # Network-provided score assessing risk level associated with a given + # authorization. Scores are on a range of 0-999, with 0 representing the lowest + # risk and 999 representing the highest risk. For Visa transactions, where the raw + # score has a range of 0-99, Lithic will normalize the score by multiplying the + # raw score by 10x. + network_risk_score: nil, + # Contains raw data provided by the card network, including attributes that + # provide further context about the authorization. If populated by the network, + # data is organized by Lithic and passed through without further modification. + # Please consult the official network documentation for more details about these + # values and how to use them. This object is only available to certain programs- + # contact your Customer Success Manager to discuss enabling access. + network_specific_data: nil, + pos: nil, + token_info: nil, + # Deprecated: approximate time-to-live for the authorization. + ttl: nil + ) + end + + sig do + override.returns( + { + token: String, + acquirer_fee: Integer, + amount: Integer, + amounts: Lithic::CardAuthorization::Amounts, + authorization_amount: Integer, + avs: Lithic::CardAuthorization::Avs, + card: Lithic::CardAuthorization::Card, + cardholder_currency: String, + cash_amount: Integer, + created: Time, + merchant: Lithic::CardAuthorization::Merchant, + merchant_amount: Integer, + merchant_currency: String, + name_validation: + T.nilable(Lithic::CardAuthorization::NameValidation), + service_location: + T.nilable(Lithic::CardAuthorization::ServiceLocation), + settled_amount: Integer, + status: Lithic::CardAuthorization::Status::TaggedSymbol, + transaction_initiator: + Lithic::CardAuthorization::TransactionInitiator::TaggedSymbol, + account_type: Lithic::CardAuthorization::AccountType::TaggedSymbol, + cardholder_authentication: Lithic::CardholderAuthentication, + cashback: Integer, + conversion_rate: Float, + event_token: String, + fleet_info: T.nilable(Lithic::CardAuthorization::FleetInfo), + latest_challenge: Lithic::CardAuthorization::LatestChallenge, + network: Lithic::CardAuthorization::Network::TaggedSymbol, + network_risk_score: T.nilable(Integer), + network_specific_data: + T.nilable(Lithic::CardAuthorization::NetworkSpecificData), + pos: Lithic::CardAuthorization::Pos, + token_info: T.nilable(Lithic::TokenInfo), + ttl: Time + } + ) + end + def to_hash + end + + class Amounts < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::CardAuthorization::Amounts, Lithic::Internal::AnyHash) + end + + sig { returns(Lithic::CardAuthorization::Amounts::Cardholder) } + attr_reader :cardholder + + sig do + params( + cardholder: Lithic::CardAuthorization::Amounts::Cardholder::OrHash + ).void + end + attr_writer :cardholder + + sig { returns(T.nilable(Lithic::CardAuthorization::Amounts::Hold)) } + attr_reader :hold + + sig do + params( + hold: T.nilable(Lithic::CardAuthorization::Amounts::Hold::OrHash) + ).void + end + attr_writer :hold + + sig { returns(Lithic::CardAuthorization::Amounts::Merchant) } + attr_reader :merchant + + sig do + params( + merchant: Lithic::CardAuthorization::Amounts::Merchant::OrHash + ).void + end + attr_writer :merchant + + sig do + returns(T.nilable(Lithic::CardAuthorization::Amounts::Settlement)) + end + attr_reader :settlement + + sig do + params( + settlement: + T.nilable(Lithic::CardAuthorization::Amounts::Settlement::OrHash) + ).void + end + attr_writer :settlement + + # Structured amounts for this authorization. The `cardholder` and `merchant` + # amounts reflect the original network authorization values. For programs with + # hold adjustments enabled (e.g., automated fuel dispensers or tipping MCCs), the + # `hold` amount may exceed the `cardholder` and `merchant` amounts to account for + # anticipated final transaction amounts such as tips or fuel fill-ups + sig do + params( + cardholder: Lithic::CardAuthorization::Amounts::Cardholder::OrHash, + hold: T.nilable(Lithic::CardAuthorization::Amounts::Hold::OrHash), + merchant: Lithic::CardAuthorization::Amounts::Merchant::OrHash, + settlement: + T.nilable(Lithic::CardAuthorization::Amounts::Settlement::OrHash) + ).returns(T.attached_class) + end + def self.new(cardholder:, hold:, merchant:, settlement:) + end + + sig do + override.returns( + { + cardholder: Lithic::CardAuthorization::Amounts::Cardholder, + hold: T.nilable(Lithic::CardAuthorization::Amounts::Hold), + merchant: Lithic::CardAuthorization::Amounts::Merchant, + settlement: + T.nilable(Lithic::CardAuthorization::Amounts::Settlement) + } + ) + end + def to_hash + end + + class Cardholder < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::CardAuthorization::Amounts::Cardholder, + Lithic::Internal::AnyHash + ) + end + + # Amount in the smallest unit of the applicable currency (e.g., cents) + sig { returns(Integer) } + attr_accessor :amount + + # Exchange rate used for currency conversion + sig { returns(String) } + attr_accessor :conversion_rate + + # 3-character alphabetic ISO 4217 currency + sig { returns(String) } + attr_accessor :currency + + sig do + params( + amount: Integer, + conversion_rate: String, + currency: String + ).returns(T.attached_class) + end + def self.new( + # Amount in the smallest unit of the applicable currency (e.g., cents) + amount:, + # Exchange rate used for currency conversion + conversion_rate:, + # 3-character alphabetic ISO 4217 currency + currency: + ) + end + + sig do + override.returns( + { amount: Integer, conversion_rate: String, currency: String } + ) + end + def to_hash + end + end + + class Hold < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::CardAuthorization::Amounts::Hold, + Lithic::Internal::AnyHash + ) + end + + # Amount in the smallest unit of the applicable currency (e.g., cents) + sig { returns(Integer) } + attr_accessor :amount + + # 3-character alphabetic ISO 4217 currency + sig { returns(String) } + attr_accessor :currency + + sig do + params(amount: Integer, currency: String).returns(T.attached_class) + end + def self.new( + # Amount in the smallest unit of the applicable currency (e.g., cents) + amount:, + # 3-character alphabetic ISO 4217 currency + currency: + ) + end + + sig { override.returns({ amount: Integer, currency: String }) } + def to_hash + end + end + + class Merchant < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::CardAuthorization::Amounts::Merchant, + Lithic::Internal::AnyHash + ) + end + + # Amount in the smallest unit of the applicable currency (e.g., cents) + sig { returns(Integer) } + attr_accessor :amount + + # 3-character alphabetic ISO 4217 currency + sig { returns(String) } + attr_accessor :currency + + sig do + params(amount: Integer, currency: String).returns(T.attached_class) + end + def self.new( + # Amount in the smallest unit of the applicable currency (e.g., cents) + amount:, + # 3-character alphabetic ISO 4217 currency + currency: + ) + end + + sig { override.returns({ amount: Integer, currency: String }) } + def to_hash + end + end + + class Settlement < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::CardAuthorization::Amounts::Settlement, + Lithic::Internal::AnyHash + ) + end + + # Amount in the smallest unit of the applicable currency (e.g., cents) + sig { returns(Integer) } + attr_accessor :amount + + # 3-character alphabetic ISO 4217 currency + sig { returns(String) } + attr_accessor :currency + + sig do + params(amount: Integer, currency: String).returns(T.attached_class) + end + def self.new( + # Amount in the smallest unit of the applicable currency (e.g., cents) + amount:, + # 3-character alphabetic ISO 4217 currency + currency: + ) + end + + sig { override.returns({ amount: Integer, currency: String }) } + def to_hash + end + end + end + + class Avs < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::CardAuthorization::Avs, Lithic::Internal::AnyHash) + end + + # Cardholder address + sig { returns(String) } + attr_accessor :address + + # Lithic's evaluation result comparing the transaction's address data with the + # cardholder KYC data if it exists. In the event Lithic does not have any + # Cardholder KYC data, or the transaction does not contain any address data, + # NOT_PRESENT will be returned + sig do + returns( + Lithic::CardAuthorization::Avs::AddressOnFileMatch::TaggedSymbol + ) + end + attr_accessor :address_on_file_match + + # Cardholder ZIP code + sig { returns(String) } + attr_accessor :zipcode + + sig do + params( + address: String, + address_on_file_match: + Lithic::CardAuthorization::Avs::AddressOnFileMatch::OrSymbol, + zipcode: String + ).returns(T.attached_class) + end + def self.new( + # Cardholder address + address:, + # Lithic's evaluation result comparing the transaction's address data with the + # cardholder KYC data if it exists. In the event Lithic does not have any + # Cardholder KYC data, or the transaction does not contain any address data, + # NOT_PRESENT will be returned + address_on_file_match:, + # Cardholder ZIP code + zipcode: + ) + end + + sig do + override.returns( + { + address: String, + address_on_file_match: + Lithic::CardAuthorization::Avs::AddressOnFileMatch::TaggedSymbol, + zipcode: String + } + ) + end + def to_hash + end + + # Lithic's evaluation result comparing the transaction's address data with the + # cardholder KYC data if it exists. In the event Lithic does not have any + # Cardholder KYC data, or the transaction does not contain any address data, + # NOT_PRESENT will be returned + module AddressOnFileMatch + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::CardAuthorization::Avs::AddressOnFileMatch) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MATCH = + T.let( + :MATCH, + Lithic::CardAuthorization::Avs::AddressOnFileMatch::TaggedSymbol + ) + MATCH_ADDRESS_ONLY = + T.let( + :MATCH_ADDRESS_ONLY, + Lithic::CardAuthorization::Avs::AddressOnFileMatch::TaggedSymbol + ) + MATCH_ZIP_ONLY = + T.let( + :MATCH_ZIP_ONLY, + Lithic::CardAuthorization::Avs::AddressOnFileMatch::TaggedSymbol + ) + MISMATCH = + T.let( + :MISMATCH, + Lithic::CardAuthorization::Avs::AddressOnFileMatch::TaggedSymbol + ) + NOT_PRESENT = + T.let( + :NOT_PRESENT, + Lithic::CardAuthorization::Avs::AddressOnFileMatch::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::CardAuthorization::Avs::AddressOnFileMatch::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Card < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::CardAuthorization::Card, Lithic::Internal::AnyHash) + end + + # Globally unique identifier for the card. + sig { returns(String) } + attr_accessor :token + + # Last four digits of the card number + sig { returns(String) } + attr_accessor :last_four + + # Customizable name to identify the card + sig { returns(String) } + attr_accessor :memo + + # Amount (in cents) to limit approved authorizations. Purchase requests above the + # spend limit will be declined (refunds and credits will be approved). + # + # Note that while spend limits are enforced based on authorized and settled volume + # on a card, they are not recommended to be used for balance or + # reconciliation-level accuracy. Spend limits also cannot block force posted + # charges (i.e., when a merchant sends a clearing message without a prior + # authorization). + sig { returns(Integer) } + attr_accessor :spend_limit + + # Note that to support recurring monthly payments, which can occur on different + # day every month, the time window we consider for MONTHLY velocity starts 6 days + # after the current calendar date one month prior. + sig do + returns( + Lithic::CardAuthorization::Card::SpendLimitDuration::TaggedSymbol + ) + end + attr_accessor :spend_limit_duration + + sig { returns(Lithic::CardAuthorization::Card::State::TaggedSymbol) } + attr_accessor :state + + sig { returns(Lithic::CardAuthorization::Card::Type::TaggedSymbol) } + attr_accessor :type + + # Card object in ASA + sig do + params( + token: String, + last_four: String, + memo: String, + spend_limit: Integer, + spend_limit_duration: + Lithic::CardAuthorization::Card::SpendLimitDuration::OrSymbol, + state: Lithic::CardAuthorization::Card::State::OrSymbol, + type: Lithic::CardAuthorization::Card::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the card. + token:, + # Last four digits of the card number + last_four:, + # Customizable name to identify the card + memo:, + # Amount (in cents) to limit approved authorizations. Purchase requests above the + # spend limit will be declined (refunds and credits will be approved). + # + # Note that while spend limits are enforced based on authorized and settled volume + # on a card, they are not recommended to be used for balance or + # reconciliation-level accuracy. Spend limits also cannot block force posted + # charges (i.e., when a merchant sends a clearing message without a prior + # authorization). + spend_limit:, + # Note that to support recurring monthly payments, which can occur on different + # day every month, the time window we consider for MONTHLY velocity starts 6 days + # after the current calendar date one month prior. + spend_limit_duration:, + state:, + type: + ) + end + + sig do + override.returns( + { + token: String, + last_four: String, + memo: String, + spend_limit: Integer, + spend_limit_duration: + Lithic::CardAuthorization::Card::SpendLimitDuration::TaggedSymbol, + state: Lithic::CardAuthorization::Card::State::TaggedSymbol, + type: Lithic::CardAuthorization::Card::Type::TaggedSymbol + } + ) + end + def to_hash + end + + # Note that to support recurring monthly payments, which can occur on different + # day every month, the time window we consider for MONTHLY velocity starts 6 days + # after the current calendar date one month prior. + module SpendLimitDuration + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::CardAuthorization::Card::SpendLimitDuration) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUALLY = + T.let( + :ANNUALLY, + Lithic::CardAuthorization::Card::SpendLimitDuration::TaggedSymbol + ) + FOREVER = + T.let( + :FOREVER, + Lithic::CardAuthorization::Card::SpendLimitDuration::TaggedSymbol + ) + MONTHLY = + T.let( + :MONTHLY, + Lithic::CardAuthorization::Card::SpendLimitDuration::TaggedSymbol + ) + TRANSACTION = + T.let( + :TRANSACTION, + Lithic::CardAuthorization::Card::SpendLimitDuration::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::CardAuthorization::Card::SpendLimitDuration::TaggedSymbol + ] + ) + end + def self.values + end + end + + module State + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::CardAuthorization::Card::State) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CLOSED = + T.let(:CLOSED, Lithic::CardAuthorization::Card::State::TaggedSymbol) + OPEN = + T.let(:OPEN, Lithic::CardAuthorization::Card::State::TaggedSymbol) + PAUSED = + T.let(:PAUSED, Lithic::CardAuthorization::Card::State::TaggedSymbol) + PENDING_ACTIVATION = + T.let( + :PENDING_ACTIVATION, + Lithic::CardAuthorization::Card::State::TaggedSymbol + ) + PENDING_FULFILLMENT = + T.let( + :PENDING_FULFILLMENT, + Lithic::CardAuthorization::Card::State::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::CardAuthorization::Card::State::TaggedSymbol] + ) + end + def self.values + end + end + + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::CardAuthorization::Card::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SINGLE_USE = + T.let( + :SINGLE_USE, + Lithic::CardAuthorization::Card::Type::TaggedSymbol + ) + MERCHANT_LOCKED = + T.let( + :MERCHANT_LOCKED, + Lithic::CardAuthorization::Card::Type::TaggedSymbol + ) + UNLOCKED = + T.let( + :UNLOCKED, + Lithic::CardAuthorization::Card::Type::TaggedSymbol + ) + PHYSICAL = + T.let( + :PHYSICAL, + Lithic::CardAuthorization::Card::Type::TaggedSymbol + ) + DIGITAL_WALLET = + T.let( + :DIGITAL_WALLET, + Lithic::CardAuthorization::Card::Type::TaggedSymbol + ) + VIRTUAL = + T.let(:VIRTUAL, Lithic::CardAuthorization::Card::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::CardAuthorization::Card::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + + class Merchant < Lithic::Models::Merchant + OrHash = + T.type_alias do + T.any( + Lithic::CardAuthorization::Merchant, + Lithic::Internal::AnyHash + ) + end + + # Phone number of card acceptor. + sig { returns(T.nilable(String)) } + attr_accessor :phone_number + + # Postal code of card acceptor. + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + # Street address of card acceptor. + sig { returns(T.nilable(String)) } + attr_accessor :street_address + + # Merchant information including full location details. + sig do + params( + phone_number: T.nilable(String), + postal_code: T.nilable(String), + street_address: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Phone number of card acceptor. + phone_number:, + # Postal code of card acceptor. + postal_code:, + # Street address of card acceptor. + street_address: + ) + end + + sig do + override.returns( + { + phone_number: T.nilable(String), + postal_code: T.nilable(String), + street_address: T.nilable(String) + } + ) + end + def to_hash + end + end + + class NameValidation < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::CardAuthorization::NameValidation, + Lithic::Internal::AnyHash + ) + end + + # Cardholder name as provided by the card network. + sig { returns(Lithic::CardAuthorization::NameValidation::Name) } + attr_reader :name + + sig do + params( + name: Lithic::CardAuthorization::NameValidation::Name::OrHash + ).void + end + attr_writer :name + + # Lithic's computed match result comparing the network-provided name to the name + # on file. + sig do + returns(Lithic::CardAuthorization::NameValidation::NameOnFileMatch) + end + attr_reader :name_on_file_match + + sig do + params( + name_on_file_match: + Lithic::CardAuthorization::NameValidation::NameOnFileMatch::OrHash + ).void + end + attr_writer :name_on_file_match + + # Network name validation data, present when the card network requested name + # validation for this transaction. Contains the cardholder name provided by the + # network and Lithic's computed match result against KYC data on file. + sig do + params( + name: Lithic::CardAuthorization::NameValidation::Name::OrHash, + name_on_file_match: + Lithic::CardAuthorization::NameValidation::NameOnFileMatch::OrHash + ).returns(T.attached_class) + end + def self.new( + # Cardholder name as provided by the card network. + name:, + # Lithic's computed match result comparing the network-provided name to the name + # on file. + name_on_file_match: + ) + end + + sig do + override.returns( + { + name: Lithic::CardAuthorization::NameValidation::Name, + name_on_file_match: + Lithic::CardAuthorization::NameValidation::NameOnFileMatch + } + ) + end + def to_hash + end + + class Name < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::CardAuthorization::NameValidation::Name, + Lithic::Internal::AnyHash + ) + end + + # First name + sig { returns(String) } + attr_accessor :first + + # Last name + sig { returns(String) } + attr_accessor :last + + # Middle name + sig { returns(T.nilable(String)) } + attr_accessor :middle + + # Cardholder name as provided by the card network. + sig do + params( + first: String, + last: String, + middle: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # First name + first:, + # Last name + last:, + # Middle name + middle: + ) + end + + sig do + override.returns( + { first: String, last: String, middle: T.nilable(String) } + ) + end + def to_hash + end + end + + class NameOnFileMatch < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::CardAuthorization::NameValidation::NameOnFileMatch, + Lithic::Internal::AnyHash + ) + end + + # Overall name match result. + sig do + returns( + Lithic::CardAuthorization::NameValidation::NameOnFileMatch::FullName::TaggedSymbol + ) + end + attr_accessor :full_name + + # Lithic's computed match result comparing the network-provided name to the name + # on file. + sig do + params( + full_name: + Lithic::CardAuthorization::NameValidation::NameOnFileMatch::FullName::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Overall name match result. + full_name: + ) + end + + sig do + override.returns( + { + full_name: + Lithic::CardAuthorization::NameValidation::NameOnFileMatch::FullName::TaggedSymbol + } + ) + end + def to_hash + end + + # Overall name match result. + module FullName + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::CardAuthorization::NameValidation::NameOnFileMatch::FullName + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MATCH = + T.let( + :MATCH, + Lithic::CardAuthorization::NameValidation::NameOnFileMatch::FullName::TaggedSymbol + ) + PARTIAL_MATCH = + T.let( + :PARTIAL_MATCH, + Lithic::CardAuthorization::NameValidation::NameOnFileMatch::FullName::TaggedSymbol + ) + NO_MATCH = + T.let( + :NO_MATCH, + Lithic::CardAuthorization::NameValidation::NameOnFileMatch::FullName::TaggedSymbol + ) + UNVERIFIED = + T.let( + :UNVERIFIED, + Lithic::CardAuthorization::NameValidation::NameOnFileMatch::FullName::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::CardAuthorization::NameValidation::NameOnFileMatch::FullName::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + + class ServiceLocation < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::CardAuthorization::ServiceLocation, + Lithic::Internal::AnyHash + ) + end + + # City of service location. + sig { returns(T.nilable(String)) } + attr_accessor :city + + # Country code of service location, ISO 3166-1 alpha-3. + sig { returns(T.nilable(String)) } + attr_accessor :country + + # Postal code of service location. + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + # State/province code of service location, ISO 3166-2. + sig { returns(T.nilable(String)) } + attr_accessor :state + + # Street address of service location. + sig { returns(T.nilable(String)) } + attr_accessor :street_address + + # Where the cardholder received the service, when different from the card acceptor + # location. This is populated from network data elements such as Mastercard DE-122 + # SE1 SF9-14 and Visa F34 DS02. + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String), + street_address: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # City of service location. + city:, + # Country code of service location, ISO 3166-1 alpha-3. + country:, + # Postal code of service location. + postal_code:, + # State/province code of service location, ISO 3166-2. + state:, + # Street address of service location. + street_address: + ) + end + + sig do + override.returns( + { + city: T.nilable(String), + country: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String), + street_address: T.nilable(String) + } + ) + end + def to_hash + end + end + + # The type of authorization request that this request is for. Note that + # `CREDIT_AUTHORIZATION` and `FINANCIAL_CREDIT_AUTHORIZATION` is only available to + # users with credit decisioning via ASA enabled. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::CardAuthorization::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AUTHORIZATION = + T.let(:AUTHORIZATION, Lithic::CardAuthorization::Status::TaggedSymbol) + CREDIT_AUTHORIZATION = + T.let( + :CREDIT_AUTHORIZATION, + Lithic::CardAuthorization::Status::TaggedSymbol + ) + FINANCIAL_AUTHORIZATION = + T.let( + :FINANCIAL_AUTHORIZATION, + Lithic::CardAuthorization::Status::TaggedSymbol + ) + FINANCIAL_CREDIT_AUTHORIZATION = + T.let( + :FINANCIAL_CREDIT_AUTHORIZATION, + Lithic::CardAuthorization::Status::TaggedSymbol + ) + BALANCE_INQUIRY = + T.let( + :BALANCE_INQUIRY, + Lithic::CardAuthorization::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::CardAuthorization::Status::TaggedSymbol] + ) + end + def self.values + end + end + + # The entity that initiated the transaction. + module TransactionInitiator + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::CardAuthorization::TransactionInitiator) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CARDHOLDER = + T.let( + :CARDHOLDER, + Lithic::CardAuthorization::TransactionInitiator::TaggedSymbol + ) + MERCHANT = + T.let( + :MERCHANT, + Lithic::CardAuthorization::TransactionInitiator::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::CardAuthorization::TransactionInitiator::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::CardAuthorization::TransactionInitiator::TaggedSymbol + ] + ) + end + def self.values + end + end + + module AccountType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::CardAuthorization::AccountType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHECKING = + T.let(:CHECKING, Lithic::CardAuthorization::AccountType::TaggedSymbol) + SAVINGS = + T.let(:SAVINGS, Lithic::CardAuthorization::AccountType::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::CardAuthorization::AccountType::TaggedSymbol] + ) + end + def self.values + end + end + + class FleetInfo < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::CardAuthorization::FleetInfo, + Lithic::Internal::AnyHash + ) + end + + # Code indicating what the driver was prompted to enter at time of purchase. This + # is configured at a program level and is a static configuration, and does not + # change on a request to request basis + sig do + returns( + Lithic::CardAuthorization::FleetInfo::FleetPromptCode::TaggedSymbol + ) + end + attr_accessor :fleet_prompt_code + + # Code indicating which restrictions, if any, there are on purchase. This is + # configured at a program level and is a static configuration, and does not change + # on a request to request basis + sig do + returns( + Lithic::CardAuthorization::FleetInfo::FleetRestrictionCode::TaggedSymbol + ) + end + attr_accessor :fleet_restriction_code + + # Number representing the driver + sig { returns(T.nilable(String)) } + attr_accessor :driver_number + + # Number associated with the vehicle + sig { returns(T.nilable(String)) } + attr_accessor :vehicle_number + + # Optional Object containing information if the Card is a part of a Fleet managed + # program + sig do + params( + fleet_prompt_code: + Lithic::CardAuthorization::FleetInfo::FleetPromptCode::OrSymbol, + fleet_restriction_code: + Lithic::CardAuthorization::FleetInfo::FleetRestrictionCode::OrSymbol, + driver_number: T.nilable(String), + vehicle_number: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Code indicating what the driver was prompted to enter at time of purchase. This + # is configured at a program level and is a static configuration, and does not + # change on a request to request basis + fleet_prompt_code:, + # Code indicating which restrictions, if any, there are on purchase. This is + # configured at a program level and is a static configuration, and does not change + # on a request to request basis + fleet_restriction_code:, + # Number representing the driver + driver_number: nil, + # Number associated with the vehicle + vehicle_number: nil + ) + end + + sig do + override.returns( + { + fleet_prompt_code: + Lithic::CardAuthorization::FleetInfo::FleetPromptCode::TaggedSymbol, + fleet_restriction_code: + Lithic::CardAuthorization::FleetInfo::FleetRestrictionCode::TaggedSymbol, + driver_number: T.nilable(String), + vehicle_number: T.nilable(String) + } + ) + end + def to_hash + end + + # Code indicating what the driver was prompted to enter at time of purchase. This + # is configured at a program level and is a static configuration, and does not + # change on a request to request basis + module FleetPromptCode + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::CardAuthorization::FleetInfo::FleetPromptCode + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NO_PROMPT = + T.let( + :NO_PROMPT, + Lithic::CardAuthorization::FleetInfo::FleetPromptCode::TaggedSymbol + ) + VEHICLE_NUMBER = + T.let( + :VEHICLE_NUMBER, + Lithic::CardAuthorization::FleetInfo::FleetPromptCode::TaggedSymbol + ) + DRIVER_NUMBER = + T.let( + :DRIVER_NUMBER, + Lithic::CardAuthorization::FleetInfo::FleetPromptCode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::CardAuthorization::FleetInfo::FleetPromptCode::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Code indicating which restrictions, if any, there are on purchase. This is + # configured at a program level and is a static configuration, and does not change + # on a request to request basis + module FleetRestrictionCode + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::CardAuthorization::FleetInfo::FleetRestrictionCode + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NO_RESTRICTIONS = + T.let( + :NO_RESTRICTIONS, + Lithic::CardAuthorization::FleetInfo::FleetRestrictionCode::TaggedSymbol + ) + FUEL_ONLY = + T.let( + :FUEL_ONLY, + Lithic::CardAuthorization::FleetInfo::FleetRestrictionCode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::CardAuthorization::FleetInfo::FleetRestrictionCode::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class LatestChallenge < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::CardAuthorization::LatestChallenge, + Lithic::Internal::AnyHash + ) + end + + # The date and time when the Authorization Challenge was completed in UTC. Filled + # only if the challenge has been completed. + sig { returns(T.nilable(Time)) } + attr_accessor :completed_at + + # The date and time when the Authorization Challenge was created in UTC + sig { returns(Time) } + attr_accessor :created + + # The method used to deliver the challenge to the cardholder + # + # - `SMS` - Challenge was delivered via SMS + # - `OUT_OF_BAND` - Challenge was delivered via an out-of-band method + sig do + returns( + Lithic::CardAuthorization::LatestChallenge::Method::TaggedSymbol + ) + end + attr_accessor :method_ + + # The phone number used for sending the Authorization Challenge. Present only when + # the challenge method is `SMS`. + sig { returns(T.nilable(String)) } + attr_accessor :phone_number + + # The status of the Authorization Challenge + # + # - `COMPLETED` - Challenge was successfully completed by the cardholder + # - `DECLINED` - Challenge was declined by the cardholder + # - `PENDING` - Challenge is still open + # - `EXPIRED` - Challenge has expired without being completed + # - `ERROR` - There was an error processing the challenge + sig do + returns( + Lithic::CardAuthorization::LatestChallenge::Status::TaggedSymbol + ) + end + attr_accessor :status + + # The latest Authorization Challenge that was issued to the cardholder for this + # merchant. + sig do + params( + completed_at: T.nilable(Time), + created: Time, + method_: + Lithic::CardAuthorization::LatestChallenge::Method::OrSymbol, + phone_number: T.nilable(String), + status: Lithic::CardAuthorization::LatestChallenge::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The date and time when the Authorization Challenge was completed in UTC. Filled + # only if the challenge has been completed. + completed_at:, + # The date and time when the Authorization Challenge was created in UTC + created:, + # The method used to deliver the challenge to the cardholder + # + # - `SMS` - Challenge was delivered via SMS + # - `OUT_OF_BAND` - Challenge was delivered via an out-of-band method + method_:, + # The phone number used for sending the Authorization Challenge. Present only when + # the challenge method is `SMS`. + phone_number:, + # The status of the Authorization Challenge + # + # - `COMPLETED` - Challenge was successfully completed by the cardholder + # - `DECLINED` - Challenge was declined by the cardholder + # - `PENDING` - Challenge is still open + # - `EXPIRED` - Challenge has expired without being completed + # - `ERROR` - There was an error processing the challenge + status: + ) + end + + sig do + override.returns( + { + completed_at: T.nilable(Time), + created: Time, + method_: + Lithic::CardAuthorization::LatestChallenge::Method::TaggedSymbol, + phone_number: T.nilable(String), + status: + Lithic::CardAuthorization::LatestChallenge::Status::TaggedSymbol + } + ) + end + def to_hash + end + + # The method used to deliver the challenge to the cardholder + # + # - `SMS` - Challenge was delivered via SMS + # - `OUT_OF_BAND` - Challenge was delivered via an out-of-band method + module Method + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::CardAuthorization::LatestChallenge::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SMS = + T.let( + :SMS, + Lithic::CardAuthorization::LatestChallenge::Method::TaggedSymbol + ) + OUT_OF_BAND = + T.let( + :OUT_OF_BAND, + Lithic::CardAuthorization::LatestChallenge::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::CardAuthorization::LatestChallenge::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The status of the Authorization Challenge + # + # - `COMPLETED` - Challenge was successfully completed by the cardholder + # - `DECLINED` - Challenge was declined by the cardholder + # - `PENDING` - Challenge is still open + # - `EXPIRED` - Challenge has expired without being completed + # - `ERROR` - There was an error processing the challenge + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::CardAuthorization::LatestChallenge::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + COMPLETED = + T.let( + :COMPLETED, + Lithic::CardAuthorization::LatestChallenge::Status::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::CardAuthorization::LatestChallenge::Status::TaggedSymbol + ) + PENDING = + T.let( + :PENDING, + Lithic::CardAuthorization::LatestChallenge::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :EXPIRED, + Lithic::CardAuthorization::LatestChallenge::Status::TaggedSymbol + ) + ERROR = + T.let( + :ERROR, + Lithic::CardAuthorization::LatestChallenge::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::CardAuthorization::LatestChallenge::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + # Card network of the authorization. + module Network + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::CardAuthorization::Network) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AMEX = T.let(:AMEX, Lithic::CardAuthorization::Network::TaggedSymbol) + INTERLINK = + T.let(:INTERLINK, Lithic::CardAuthorization::Network::TaggedSymbol) + MAESTRO = + T.let(:MAESTRO, Lithic::CardAuthorization::Network::TaggedSymbol) + MASTERCARD = + T.let(:MASTERCARD, Lithic::CardAuthorization::Network::TaggedSymbol) + UNKNOWN = + T.let(:UNKNOWN, Lithic::CardAuthorization::Network::TaggedSymbol) + VISA = T.let(:VISA, Lithic::CardAuthorization::Network::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::CardAuthorization::Network::TaggedSymbol] + ) + end + def self.values + end + end + + class NetworkSpecificData < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::CardAuthorization::NetworkSpecificData, + Lithic::Internal::AnyHash + ) + end + + sig do + returns( + T.nilable( + Lithic::CardAuthorization::NetworkSpecificData::Mastercard + ) + ) + end + attr_reader :mastercard + + sig do + params( + mastercard: + T.nilable( + Lithic::CardAuthorization::NetworkSpecificData::Mastercard::OrHash + ) + ).void + end + attr_writer :mastercard + + sig do + returns( + T.nilable(Lithic::CardAuthorization::NetworkSpecificData::Visa) + ) + end + attr_reader :visa + + sig do + params( + visa: + T.nilable( + Lithic::CardAuthorization::NetworkSpecificData::Visa::OrHash + ) + ).void + end + attr_writer :visa + + # Contains raw data provided by the card network, including attributes that + # provide further context about the authorization. If populated by the network, + # data is organized by Lithic and passed through without further modification. + # Please consult the official network documentation for more details about these + # values and how to use them. This object is only available to certain programs- + # contact your Customer Success Manager to discuss enabling access. + sig do + params( + mastercard: + T.nilable( + Lithic::CardAuthorization::NetworkSpecificData::Mastercard::OrHash + ), + visa: + T.nilable( + Lithic::CardAuthorization::NetworkSpecificData::Visa::OrHash + ) + ).returns(T.attached_class) + end + def self.new(mastercard: nil, visa: nil) + end + + sig do + override.returns( + { + mastercard: + T.nilable( + Lithic::CardAuthorization::NetworkSpecificData::Mastercard + ), + visa: + T.nilable(Lithic::CardAuthorization::NetworkSpecificData::Visa) + } + ) + end + def to_hash + end + + class Mastercard < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::CardAuthorization::NetworkSpecificData::Mastercard, + Lithic::Internal::AnyHash + ) + end + + # Indicates the electronic commerce security level and UCAF collection. + sig { returns(T.nilable(String)) } + attr_accessor :ecommerce_security_level_indicator + + # The On-behalf Service performed on the transaction and the results. Contains all + # applicable, on-behalf service results that were performed on a given + # transaction. + sig do + returns( + T.nilable( + T::Array[ + Lithic::CardAuthorization::NetworkSpecificData::Mastercard::OnBehalfServiceResult + ] + ) + ) + end + attr_accessor :on_behalf_service_result + + # Indicates the type of additional transaction purpose. + sig { returns(T.nilable(String)) } + attr_accessor :transaction_type_identifier + + sig do + params( + ecommerce_security_level_indicator: T.nilable(String), + on_behalf_service_result: + T.nilable( + T::Array[ + Lithic::CardAuthorization::NetworkSpecificData::Mastercard::OnBehalfServiceResult::OrHash + ] + ), + transaction_type_identifier: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Indicates the electronic commerce security level and UCAF collection. + ecommerce_security_level_indicator: nil, + # The On-behalf Service performed on the transaction and the results. Contains all + # applicable, on-behalf service results that were performed on a given + # transaction. + on_behalf_service_result: nil, + # Indicates the type of additional transaction purpose. + transaction_type_identifier: nil + ) + end + + sig do + override.returns( + { + ecommerce_security_level_indicator: T.nilable(String), + on_behalf_service_result: + T.nilable( + T::Array[ + Lithic::CardAuthorization::NetworkSpecificData::Mastercard::OnBehalfServiceResult + ] + ), + transaction_type_identifier: T.nilable(String) + } + ) + end + def to_hash + end + + class OnBehalfServiceResult < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::CardAuthorization::NetworkSpecificData::Mastercard::OnBehalfServiceResult, + Lithic::Internal::AnyHash + ) + end + + # Indicates the results of the service processing. + sig { returns(String) } + attr_accessor :result_1 + + # Identifies the results of the service processing. + sig { returns(String) } + attr_accessor :result_2 + + # Indicates the service performed on the transaction. + sig { returns(String) } + attr_accessor :service + + sig do + params( + result_1: String, + result_2: String, + service: String + ).returns(T.attached_class) + end + def self.new( + # Indicates the results of the service processing. + result_1:, + # Identifies the results of the service processing. + result_2:, + # Indicates the service performed on the transaction. + service: + ) + end + + sig do + override.returns( + { result_1: String, result_2: String, service: String } + ) + end + def to_hash + end + end + end + + class Visa < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::CardAuthorization::NetworkSpecificData::Visa, + Lithic::Internal::AnyHash + ) + end + + # Identifies the purpose or category of a transaction, used to classify and + # process transactions according to Visa’s rules. + sig { returns(T.nilable(String)) } + attr_accessor :business_application_identifier + + sig do + params(business_application_identifier: T.nilable(String)).returns( + T.attached_class + ) + end + def self.new( + # Identifies the purpose or category of a transaction, used to classify and + # process transactions according to Visa’s rules. + business_application_identifier: nil + ) + end + + sig do + override.returns( + { business_application_identifier: T.nilable(String) } + ) + end + def to_hash + end + end + end + + class Pos < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::CardAuthorization::Pos, Lithic::Internal::AnyHash) + end + + # POS > Entry Mode object in ASA + sig { returns(T.nilable(Lithic::CardAuthorization::Pos::EntryMode)) } + attr_reader :entry_mode + + sig do + params( + entry_mode: Lithic::CardAuthorization::Pos::EntryMode::OrHash + ).void + end + attr_writer :entry_mode + + sig { returns(T.nilable(Lithic::CardAuthorization::Pos::Terminal)) } + attr_reader :terminal + + sig do + params( + terminal: Lithic::CardAuthorization::Pos::Terminal::OrHash + ).void + end + attr_writer :terminal + + sig do + params( + entry_mode: Lithic::CardAuthorization::Pos::EntryMode::OrHash, + terminal: Lithic::CardAuthorization::Pos::Terminal::OrHash + ).returns(T.attached_class) + end + def self.new( + # POS > Entry Mode object in ASA + entry_mode: nil, + terminal: nil + ) + end + + sig do + override.returns( + { + entry_mode: Lithic::CardAuthorization::Pos::EntryMode, + terminal: Lithic::CardAuthorization::Pos::Terminal + } + ) + end + def to_hash + end + + class EntryMode < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::CardAuthorization::Pos::EntryMode, + Lithic::Internal::AnyHash + ) + end + + # Card Presence Indicator + sig do + returns( + T.nilable( + Lithic::CardAuthorization::Pos::EntryMode::Card::TaggedSymbol + ) + ) + end + attr_reader :card + + sig do + params( + card: Lithic::CardAuthorization::Pos::EntryMode::Card::OrSymbol + ).void + end + attr_writer :card + + # Cardholder Presence Indicator + sig do + returns( + T.nilable( + Lithic::CardAuthorization::Pos::EntryMode::Cardholder::TaggedSymbol + ) + ) + end + attr_reader :cardholder + + sig do + params( + cardholder: + Lithic::CardAuthorization::Pos::EntryMode::Cardholder::OrSymbol + ).void + end + attr_writer :cardholder + + # Method of entry for the PAN + sig do + returns( + T.nilable( + Lithic::CardAuthorization::Pos::EntryMode::Pan::TaggedSymbol + ) + ) + end + attr_reader :pan + + sig do + params( + pan: Lithic::CardAuthorization::Pos::EntryMode::Pan::OrSymbol + ).void + end + attr_writer :pan + + # Indicates whether the cardholder entered the PIN. True if the PIN was entered. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :pin_entered + + sig { params(pin_entered: T::Boolean).void } + attr_writer :pin_entered + + # POS > Entry Mode object in ASA + sig do + params( + card: Lithic::CardAuthorization::Pos::EntryMode::Card::OrSymbol, + cardholder: + Lithic::CardAuthorization::Pos::EntryMode::Cardholder::OrSymbol, + pan: Lithic::CardAuthorization::Pos::EntryMode::Pan::OrSymbol, + pin_entered: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # Card Presence Indicator + card: nil, + # Cardholder Presence Indicator + cardholder: nil, + # Method of entry for the PAN + pan: nil, + # Indicates whether the cardholder entered the PIN. True if the PIN was entered. + pin_entered: nil + ) + end + + sig do + override.returns( + { + card: + Lithic::CardAuthorization::Pos::EntryMode::Card::TaggedSymbol, + cardholder: + Lithic::CardAuthorization::Pos::EntryMode::Cardholder::TaggedSymbol, + pan: + Lithic::CardAuthorization::Pos::EntryMode::Pan::TaggedSymbol, + pin_entered: T::Boolean + } + ) + end + def to_hash + end + + # Card Presence Indicator + module Card + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::CardAuthorization::Pos::EntryMode::Card) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PRESENT = + T.let( + :PRESENT, + Lithic::CardAuthorization::Pos::EntryMode::Card::TaggedSymbol + ) + NOT_PRESENT = + T.let( + :NOT_PRESENT, + Lithic::CardAuthorization::Pos::EntryMode::Card::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::CardAuthorization::Pos::EntryMode::Card::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::CardAuthorization::Pos::EntryMode::Card::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Cardholder Presence Indicator + module Cardholder + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::CardAuthorization::Pos::EntryMode::Cardholder + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DEFERRED_BILLING = + T.let( + :DEFERRED_BILLING, + Lithic::CardAuthorization::Pos::EntryMode::Cardholder::TaggedSymbol + ) + ELECTRONIC_ORDER = + T.let( + :ELECTRONIC_ORDER, + Lithic::CardAuthorization::Pos::EntryMode::Cardholder::TaggedSymbol + ) + INSTALLMENT = + T.let( + :INSTALLMENT, + Lithic::CardAuthorization::Pos::EntryMode::Cardholder::TaggedSymbol + ) + MAIL_ORDER = + T.let( + :MAIL_ORDER, + Lithic::CardAuthorization::Pos::EntryMode::Cardholder::TaggedSymbol + ) + NOT_PRESENT = + T.let( + :NOT_PRESENT, + Lithic::CardAuthorization::Pos::EntryMode::Cardholder::TaggedSymbol + ) + PRESENT = + T.let( + :PRESENT, + Lithic::CardAuthorization::Pos::EntryMode::Cardholder::TaggedSymbol + ) + REOCCURRING = + T.let( + :REOCCURRING, + Lithic::CardAuthorization::Pos::EntryMode::Cardholder::TaggedSymbol + ) + TELEPHONE_ORDER = + T.let( + :TELEPHONE_ORDER, + Lithic::CardAuthorization::Pos::EntryMode::Cardholder::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::CardAuthorization::Pos::EntryMode::Cardholder::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::CardAuthorization::Pos::EntryMode::Cardholder::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Method of entry for the PAN + module Pan + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::CardAuthorization::Pos::EntryMode::Pan) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AUTO_ENTRY = + T.let( + :AUTO_ENTRY, + Lithic::CardAuthorization::Pos::EntryMode::Pan::TaggedSymbol + ) + BAR_CODE = + T.let( + :BAR_CODE, + Lithic::CardAuthorization::Pos::EntryMode::Pan::TaggedSymbol + ) + CONTACTLESS = + T.let( + :CONTACTLESS, + Lithic::CardAuthorization::Pos::EntryMode::Pan::TaggedSymbol + ) + ECOMMERCE = + T.let( + :ECOMMERCE, + Lithic::CardAuthorization::Pos::EntryMode::Pan::TaggedSymbol + ) + ERROR_KEYED = + T.let( + :ERROR_KEYED, + Lithic::CardAuthorization::Pos::EntryMode::Pan::TaggedSymbol + ) + ERROR_MAGNETIC_STRIPE = + T.let( + :ERROR_MAGNETIC_STRIPE, + Lithic::CardAuthorization::Pos::EntryMode::Pan::TaggedSymbol + ) + ICC = + T.let( + :ICC, + Lithic::CardAuthorization::Pos::EntryMode::Pan::TaggedSymbol + ) + KEY_ENTERED = + T.let( + :KEY_ENTERED, + Lithic::CardAuthorization::Pos::EntryMode::Pan::TaggedSymbol + ) + MAGNETIC_STRIPE = + T.let( + :MAGNETIC_STRIPE, + Lithic::CardAuthorization::Pos::EntryMode::Pan::TaggedSymbol + ) + MANUAL = + T.let( + :MANUAL, + Lithic::CardAuthorization::Pos::EntryMode::Pan::TaggedSymbol + ) + OCR = + T.let( + :OCR, + Lithic::CardAuthorization::Pos::EntryMode::Pan::TaggedSymbol + ) + SECURE_CARDLESS = + T.let( + :SECURE_CARDLESS, + Lithic::CardAuthorization::Pos::EntryMode::Pan::TaggedSymbol + ) + UNSPECIFIED = + T.let( + :UNSPECIFIED, + Lithic::CardAuthorization::Pos::EntryMode::Pan::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::CardAuthorization::Pos::EntryMode::Pan::TaggedSymbol + ) + CREDENTIAL_ON_FILE = + T.let( + :CREDENTIAL_ON_FILE, + Lithic::CardAuthorization::Pos::EntryMode::Pan::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::CardAuthorization::Pos::EntryMode::Pan::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Terminal < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::CardAuthorization::Pos::Terminal, + Lithic::Internal::AnyHash + ) + end + + # True if a clerk is present at the sale. + sig { returns(T::Boolean) } + attr_accessor :attended + + # True if the terminal is capable of retaining the card. + sig { returns(T::Boolean) } + attr_accessor :card_retention_capable + + # True if the sale was made at the place of business (vs. mobile). + sig { returns(T::Boolean) } + attr_accessor :on_premise + + # The person that is designated to swipe the card + sig do + returns( + Lithic::CardAuthorization::Pos::Terminal::Operator::TaggedSymbol + ) + end + attr_accessor :operator + + # True if the terminal is capable of partial approval. Partial approval is when + # part of a transaction is approved and another payment must be used for the + # remainder. Example scenario: A $40 transaction is attempted on a prepaid card + # with a $25 balance. If partial approval is enabled, $25 can be authorized, at + # which point the POS will prompt the user for an additional payment of $15. + sig { returns(T::Boolean) } + attr_accessor :partial_approval_capable + + # Status of whether the POS is able to accept PINs + sig do + returns( + Lithic::CardAuthorization::Pos::Terminal::PinCapability::TaggedSymbol + ) + end + attr_accessor :pin_capability + + # POS Type + sig do + returns( + Lithic::CardAuthorization::Pos::Terminal::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Uniquely identifies a terminal at the card acceptor location of acquiring + # institutions or merchant POS Systems. Left justified with trailing spaces. + sig { returns(T.nilable(String)) } + attr_accessor :acceptor_terminal_id + + sig do + params( + attended: T::Boolean, + card_retention_capable: T::Boolean, + on_premise: T::Boolean, + operator: + Lithic::CardAuthorization::Pos::Terminal::Operator::OrSymbol, + partial_approval_capable: T::Boolean, + pin_capability: + Lithic::CardAuthorization::Pos::Terminal::PinCapability::OrSymbol, + type: Lithic::CardAuthorization::Pos::Terminal::Type::OrSymbol, + acceptor_terminal_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # True if a clerk is present at the sale. + attended:, + # True if the terminal is capable of retaining the card. + card_retention_capable:, + # True if the sale was made at the place of business (vs. mobile). + on_premise:, + # The person that is designated to swipe the card + operator:, + # True if the terminal is capable of partial approval. Partial approval is when + # part of a transaction is approved and another payment must be used for the + # remainder. Example scenario: A $40 transaction is attempted on a prepaid card + # with a $25 balance. If partial approval is enabled, $25 can be authorized, at + # which point the POS will prompt the user for an additional payment of $15. + partial_approval_capable:, + # Status of whether the POS is able to accept PINs + pin_capability:, + # POS Type + type:, + # Uniquely identifies a terminal at the card acceptor location of acquiring + # institutions or merchant POS Systems. Left justified with trailing spaces. + acceptor_terminal_id: nil + ) + end + + sig do + override.returns( + { + attended: T::Boolean, + card_retention_capable: T::Boolean, + on_premise: T::Boolean, + operator: + Lithic::CardAuthorization::Pos::Terminal::Operator::TaggedSymbol, + partial_approval_capable: T::Boolean, + pin_capability: + Lithic::CardAuthorization::Pos::Terminal::PinCapability::TaggedSymbol, + type: + Lithic::CardAuthorization::Pos::Terminal::Type::TaggedSymbol, + acceptor_terminal_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The person that is designated to swipe the card + module Operator + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::CardAuthorization::Pos::Terminal::Operator + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ADMINISTRATIVE = + T.let( + :ADMINISTRATIVE, + Lithic::CardAuthorization::Pos::Terminal::Operator::TaggedSymbol + ) + CARDHOLDER = + T.let( + :CARDHOLDER, + Lithic::CardAuthorization::Pos::Terminal::Operator::TaggedSymbol + ) + CARD_ACCEPTOR = + T.let( + :CARD_ACCEPTOR, + Lithic::CardAuthorization::Pos::Terminal::Operator::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::CardAuthorization::Pos::Terminal::Operator::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::CardAuthorization::Pos::Terminal::Operator::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Status of whether the POS is able to accept PINs + module PinCapability + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::CardAuthorization::Pos::Terminal::PinCapability + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CAPABLE = + T.let( + :CAPABLE, + Lithic::CardAuthorization::Pos::Terminal::PinCapability::TaggedSymbol + ) + INOPERATIVE = + T.let( + :INOPERATIVE, + Lithic::CardAuthorization::Pos::Terminal::PinCapability::TaggedSymbol + ) + NOT_CAPABLE = + T.let( + :NOT_CAPABLE, + Lithic::CardAuthorization::Pos::Terminal::PinCapability::TaggedSymbol + ) + UNSPECIFIED = + T.let( + :UNSPECIFIED, + Lithic::CardAuthorization::Pos::Terminal::PinCapability::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::CardAuthorization::Pos::Terminal::PinCapability::TaggedSymbol + ] + ) + end + def self.values + end + end + + # POS Type + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::CardAuthorization::Pos::Terminal::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ADMINISTRATIVE = + T.let( + :ADMINISTRATIVE, + Lithic::CardAuthorization::Pos::Terminal::Type::TaggedSymbol + ) + ATM = + T.let( + :ATM, + Lithic::CardAuthorization::Pos::Terminal::Type::TaggedSymbol + ) + AUTHORIZATION = + T.let( + :AUTHORIZATION, + Lithic::CardAuthorization::Pos::Terminal::Type::TaggedSymbol + ) + COUPON_MACHINE = + T.let( + :COUPON_MACHINE, + Lithic::CardAuthorization::Pos::Terminal::Type::TaggedSymbol + ) + DIAL_TERMINAL = + T.let( + :DIAL_TERMINAL, + Lithic::CardAuthorization::Pos::Terminal::Type::TaggedSymbol + ) + ECOMMERCE = + T.let( + :ECOMMERCE, + Lithic::CardAuthorization::Pos::Terminal::Type::TaggedSymbol + ) + ECR = + T.let( + :ECR, + Lithic::CardAuthorization::Pos::Terminal::Type::TaggedSymbol + ) + FUEL_MACHINE = + T.let( + :FUEL_MACHINE, + Lithic::CardAuthorization::Pos::Terminal::Type::TaggedSymbol + ) + HOME_TERMINAL = + T.let( + :HOME_TERMINAL, + Lithic::CardAuthorization::Pos::Terminal::Type::TaggedSymbol + ) + MICR = + T.let( + :MICR, + Lithic::CardAuthorization::Pos::Terminal::Type::TaggedSymbol + ) + OFF_PREMISE = + T.let( + :OFF_PREMISE, + Lithic::CardAuthorization::Pos::Terminal::Type::TaggedSymbol + ) + PAYMENT = + T.let( + :PAYMENT, + Lithic::CardAuthorization::Pos::Terminal::Type::TaggedSymbol + ) + PDA = + T.let( + :PDA, + Lithic::CardAuthorization::Pos::Terminal::Type::TaggedSymbol + ) + PHONE = + T.let( + :PHONE, + Lithic::CardAuthorization::Pos::Terminal::Type::TaggedSymbol + ) + POINT = + T.let( + :POINT, + Lithic::CardAuthorization::Pos::Terminal::Type::TaggedSymbol + ) + POS_TERMINAL = + T.let( + :POS_TERMINAL, + Lithic::CardAuthorization::Pos::Terminal::Type::TaggedSymbol + ) + PUBLIC_UTILITY = + T.let( + :PUBLIC_UTILITY, + Lithic::CardAuthorization::Pos::Terminal::Type::TaggedSymbol + ) + SELF_SERVICE = + T.let( + :SELF_SERVICE, + Lithic::CardAuthorization::Pos::Terminal::Type::TaggedSymbol + ) + TELEVISION = + T.let( + :TELEVISION, + Lithic::CardAuthorization::Pos::Terminal::Type::TaggedSymbol + ) + TELLER = + T.let( + :TELLER, + Lithic::CardAuthorization::Pos::Terminal::Type::TaggedSymbol + ) + TRAVELERS_CHECK_MACHINE = + T.let( + :TRAVELERS_CHECK_MACHINE, + Lithic::CardAuthorization::Pos::Terminal::Type::TaggedSymbol + ) + VENDING = + T.let( + :VENDING, + Lithic::CardAuthorization::Pos::Terminal::Type::TaggedSymbol + ) + VOICE = + T.let( + :VOICE, + Lithic::CardAuthorization::Pos::Terminal::Type::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::CardAuthorization::Pos::Terminal::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::CardAuthorization::Pos::Terminal::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/lithic/models/card_authorization_approval_request_webhook_event.rbi b/rbi/lithic/models/card_authorization_approval_request_webhook_event.rbi new file mode 100644 index 00000000..e0f07753 --- /dev/null +++ b/rbi/lithic/models/card_authorization_approval_request_webhook_event.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Lithic + module Models + class CardAuthorizationApprovalRequestWebhookEvent < Lithic::Models::CardAuthorization + OrHash = + T.type_alias do + T.any( + Lithic::CardAuthorizationApprovalRequestWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Symbol) } + attr_accessor :event_type + + # The Auth Stream Access request payload that was sent to the ASA responder. + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new(event_type: :"card_authorization.approval_request") + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/card_authorization_challenge_response_params.rbi b/rbi/lithic/models/card_authorization_challenge_response_params.rbi new file mode 100644 index 00000000..b4802090 --- /dev/null +++ b/rbi/lithic/models/card_authorization_challenge_response_params.rbi @@ -0,0 +1,93 @@ +# typed: strong + +module Lithic + module Models + class CardAuthorizationChallengeResponseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::CardAuthorizationChallengeResponseParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :event_token + + # Whether the cardholder has approved or declined the issued challenge + sig do + returns( + Lithic::CardAuthorizationChallengeResponseParams::Response::OrSymbol + ) + end + attr_accessor :response + + sig do + params( + event_token: String, + response: + Lithic::CardAuthorizationChallengeResponseParams::Response::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + event_token:, + # Whether the cardholder has approved or declined the issued challenge + response:, + request_options: {} + ) + end + + sig do + override.returns( + { + event_token: String, + response: + Lithic::CardAuthorizationChallengeResponseParams::Response::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Whether the cardholder has approved or declined the issued challenge + module Response + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::CardAuthorizationChallengeResponseParams::Response + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVE = + T.let( + :APPROVE, + Lithic::CardAuthorizationChallengeResponseParams::Response::TaggedSymbol + ) + DECLINE = + T.let( + :DECLINE, + Lithic::CardAuthorizationChallengeResponseParams::Response::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::CardAuthorizationChallengeResponseParams::Response::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/card_authorization_challenge_response_webhook_event.rbi b/rbi/lithic/models/card_authorization_challenge_response_webhook_event.rbi new file mode 100644 index 00000000..9d109077 --- /dev/null +++ b/rbi/lithic/models/card_authorization_challenge_response_webhook_event.rbi @@ -0,0 +1,180 @@ +# typed: strong + +module Lithic + module Models + class CardAuthorizationChallengeResponseWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::CardAuthorizationChallengeResponseWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The token of the card associated with the challenge + sig { returns(T.nilable(String)) } + attr_accessor :card_token + + # The method used to deliver the challenge to the cardholder + sig do + returns( + Lithic::CardAuthorizationChallengeResponseWebhookEvent::ChallengeMethod::TaggedSymbol + ) + end + attr_accessor :challenge_method + + # The timestamp of when the challenge was completed + sig { returns(T.nilable(Time)) } + attr_accessor :completed + + # The timestamp of when the challenge was created + sig { returns(Time) } + attr_accessor :created + + # Globally unique identifier for the event + sig { returns(String) } + attr_accessor :event_token + + # Event type + sig { returns(Symbol) } + attr_accessor :event_type + + # The cardholder's response to the challenge + sig do + returns( + Lithic::CardAuthorizationChallengeResponseWebhookEvent::Response::TaggedSymbol + ) + end + attr_accessor :response + + # The token of the transaction associated with the authorization event being + # challenged + sig { returns(T.nilable(String)) } + attr_accessor :transaction_token + + sig do + params( + card_token: T.nilable(String), + challenge_method: + Lithic::CardAuthorizationChallengeResponseWebhookEvent::ChallengeMethod::OrSymbol, + completed: T.nilable(Time), + created: Time, + event_token: String, + response: + Lithic::CardAuthorizationChallengeResponseWebhookEvent::Response::OrSymbol, + transaction_token: T.nilable(String), + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The token of the card associated with the challenge + card_token:, + # The method used to deliver the challenge to the cardholder + challenge_method:, + # The timestamp of when the challenge was completed + completed:, + # The timestamp of when the challenge was created + created:, + # Globally unique identifier for the event + event_token:, + # The cardholder's response to the challenge + response:, + # The token of the transaction associated with the authorization event being + # challenged + transaction_token:, + # Event type + event_type: :"card_authorization.challenge_response" + ) + end + + sig do + override.returns( + { + card_token: T.nilable(String), + challenge_method: + Lithic::CardAuthorizationChallengeResponseWebhookEvent::ChallengeMethod::TaggedSymbol, + completed: T.nilable(Time), + created: Time, + event_token: String, + event_type: Symbol, + response: + Lithic::CardAuthorizationChallengeResponseWebhookEvent::Response::TaggedSymbol, + transaction_token: T.nilable(String) + } + ) + end + def to_hash + end + + # The method used to deliver the challenge to the cardholder + module ChallengeMethod + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::CardAuthorizationChallengeResponseWebhookEvent::ChallengeMethod + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SMS = + T.let( + :SMS, + Lithic::CardAuthorizationChallengeResponseWebhookEvent::ChallengeMethod::TaggedSymbol + ) + OUT_OF_BAND = + T.let( + :OUT_OF_BAND, + Lithic::CardAuthorizationChallengeResponseWebhookEvent::ChallengeMethod::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::CardAuthorizationChallengeResponseWebhookEvent::ChallengeMethod::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The cardholder's response to the challenge + module Response + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::CardAuthorizationChallengeResponseWebhookEvent::Response + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVE = + T.let( + :APPROVE, + Lithic::CardAuthorizationChallengeResponseWebhookEvent::Response::TaggedSymbol + ) + DECLINE = + T.let( + :DECLINE, + Lithic::CardAuthorizationChallengeResponseWebhookEvent::Response::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::CardAuthorizationChallengeResponseWebhookEvent::Response::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/card_authorization_challenge_webhook_event.rbi b/rbi/lithic/models/card_authorization_challenge_webhook_event.rbi new file mode 100644 index 00000000..2f4918b5 --- /dev/null +++ b/rbi/lithic/models/card_authorization_challenge_webhook_event.rbi @@ -0,0 +1,119 @@ +# typed: strong + +module Lithic + module Models + class CardAuthorizationChallengeWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::CardAuthorizationChallengeWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The authorization that triggered the challenge + sig { returns(Lithic::CardAuthorization) } + attr_reader :authorization + + sig { params(authorization: Lithic::CardAuthorization::OrHash).void } + attr_writer :authorization + + # Details of the Authorization Challenge issued during card authorization + sig { returns(Lithic::CardAuthorizationChallengeWebhookEvent::Challenge) } + attr_reader :challenge + + sig do + params( + challenge: + Lithic::CardAuthorizationChallengeWebhookEvent::Challenge::OrHash + ).void + end + attr_writer :challenge + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig do + params( + authorization: Lithic::CardAuthorization::OrHash, + challenge: + Lithic::CardAuthorizationChallengeWebhookEvent::Challenge::OrHash, + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The authorization that triggered the challenge + authorization:, + # Details of the Authorization Challenge issued during card authorization + challenge:, + # The type of event that occurred. + event_type: :"card_authorization.challenge" + ) + end + + sig do + override.returns( + { + authorization: Lithic::CardAuthorization, + challenge: + Lithic::CardAuthorizationChallengeWebhookEvent::Challenge, + event_type: Symbol + } + ) + end + def to_hash + end + + class Challenge < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::CardAuthorizationChallengeWebhookEvent::Challenge, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for the event that triggered the challenge. Use this + # token when calling the challenge response endpoint + sig { returns(String) } + attr_accessor :event_token + + # ISO-8601 time at which the challenge expires + sig { returns(Time) } + attr_accessor :expiry_time + + # ISO-8601 time at which the challenge was issued + sig { returns(Time) } + attr_accessor :start_time + + # Details of the Authorization Challenge issued during card authorization + sig do + params( + event_token: String, + expiry_time: Time, + start_time: Time + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the event that triggered the challenge. Use this + # token when calling the challenge response endpoint + event_token:, + # ISO-8601 time at which the challenge expires + expiry_time:, + # ISO-8601 time at which the challenge was issued + start_time: + ) + end + + sig do + override.returns( + { event_token: String, expiry_time: Time, start_time: Time } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/card_bulk_order.rbi b/rbi/lithic/models/card_bulk_order.rbi new file mode 100644 index 00000000..f99811f9 --- /dev/null +++ b/rbi/lithic/models/card_bulk_order.rbi @@ -0,0 +1,159 @@ +# typed: strong + +module Lithic + module Models + class CardBulkOrder < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Lithic::CardBulkOrder, Lithic::Internal::AnyHash) } + + # Globally unique identifier for the bulk order + sig { returns(String) } + attr_accessor :token + + # List of card tokens associated with this bulk order + sig { returns(T::Array[String]) } + attr_accessor :card_tokens + + # An RFC 3339 timestamp for when the bulk order was created. UTC time zone + sig { returns(Time) } + attr_accessor :created + + # Customer-specified product configuration for physical card manufacturing. This + # must be configured with Lithic before use + sig { returns(T.nilable(String)) } + attr_accessor :customer_product_id + + # Shipping address for all cards in this bulk order + sig { returns(T.anything) } + attr_accessor :shipping_address + + # Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and + # BULK_EXPRESS are only available with Perfect Plastic Printing + sig { returns(Lithic::CardBulkOrder::ShippingMethod::TaggedSymbol) } + attr_accessor :shipping_method + + # Status of the bulk order. OPEN indicates the order is accepting cards. LOCKED + # indicates the order is finalized and no more cards can be added + sig { returns(Lithic::CardBulkOrder::Status::TaggedSymbol) } + attr_accessor :status + + # An RFC 3339 timestamp for when the bulk order was last updated. UTC time zone + sig { returns(Time) } + attr_accessor :updated + + # Represents a bulk order for physical card shipments + sig do + params( + token: String, + card_tokens: T::Array[String], + created: Time, + customer_product_id: T.nilable(String), + shipping_address: T.anything, + shipping_method: Lithic::CardBulkOrder::ShippingMethod::OrSymbol, + status: Lithic::CardBulkOrder::Status::OrSymbol, + updated: Time + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the bulk order + token:, + # List of card tokens associated with this bulk order + card_tokens:, + # An RFC 3339 timestamp for when the bulk order was created. UTC time zone + created:, + # Customer-specified product configuration for physical card manufacturing. This + # must be configured with Lithic before use + customer_product_id:, + # Shipping address for all cards in this bulk order + shipping_address:, + # Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and + # BULK_EXPRESS are only available with Perfect Plastic Printing + shipping_method:, + # Status of the bulk order. OPEN indicates the order is accepting cards. LOCKED + # indicates the order is finalized and no more cards can be added + status:, + # An RFC 3339 timestamp for when the bulk order was last updated. UTC time zone + updated: + ) + end + + sig do + override.returns( + { + token: String, + card_tokens: T::Array[String], + created: Time, + customer_product_id: T.nilable(String), + shipping_address: T.anything, + shipping_method: + Lithic::CardBulkOrder::ShippingMethod::TaggedSymbol, + status: Lithic::CardBulkOrder::Status::TaggedSymbol, + updated: Time + } + ) + end + def to_hash + end + + # Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and + # BULK_EXPRESS are only available with Perfect Plastic Printing + module ShippingMethod + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::CardBulkOrder::ShippingMethod) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BULK_EXPEDITED = + T.let( + :BULK_EXPEDITED, + Lithic::CardBulkOrder::ShippingMethod::TaggedSymbol + ) + BULK_PRIORITY = + T.let( + :BULK_PRIORITY, + Lithic::CardBulkOrder::ShippingMethod::TaggedSymbol + ) + BULK_2_DAY = + T.let( + :BULK_2_DAY, + Lithic::CardBulkOrder::ShippingMethod::TaggedSymbol + ) + BULK_EXPRESS = + T.let( + :BULK_EXPRESS, + Lithic::CardBulkOrder::ShippingMethod::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::CardBulkOrder::ShippingMethod::TaggedSymbol] + ) + end + def self.values + end + end + + # Status of the bulk order. OPEN indicates the order is accepting cards. LOCKED + # indicates the order is finalized and no more cards can be added + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::CardBulkOrder::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + OPEN = T.let(:OPEN, Lithic::CardBulkOrder::Status::TaggedSymbol) + LOCKED = T.let(:LOCKED, Lithic::CardBulkOrder::Status::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::CardBulkOrder::Status::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/card_bulk_order_create_params.rbi b/rbi/lithic/models/card_bulk_order_create_params.rbi new file mode 100644 index 00000000..27647ef5 --- /dev/null +++ b/rbi/lithic/models/card_bulk_order_create_params.rbi @@ -0,0 +1,110 @@ +# typed: strong + +module Lithic + module Models + class CardBulkOrderCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::CardBulkOrderCreateParams, Lithic::Internal::AnyHash) + end + + # Customer-specified product configuration for physical card manufacturing. This + # must be configured with Lithic before use + sig { returns(String) } + attr_accessor :customer_product_id + + # Shipping address for all cards in this bulk order + sig { returns(T.anything) } + attr_accessor :shipping_address + + # Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and + # BULK_EXPRESS are only available with Perfect Plastic Printing + sig do + returns(Lithic::CardBulkOrderCreateParams::ShippingMethod::OrSymbol) + end + attr_accessor :shipping_method + + sig do + params( + customer_product_id: String, + shipping_address: T.anything, + shipping_method: + Lithic::CardBulkOrderCreateParams::ShippingMethod::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Customer-specified product configuration for physical card manufacturing. This + # must be configured with Lithic before use + customer_product_id:, + # Shipping address for all cards in this bulk order + shipping_address:, + # Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and + # BULK_EXPRESS are only available with Perfect Plastic Printing + shipping_method:, + request_options: {} + ) + end + + sig do + override.returns( + { + customer_product_id: String, + shipping_address: T.anything, + shipping_method: + Lithic::CardBulkOrderCreateParams::ShippingMethod::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and + # BULK_EXPRESS are only available with Perfect Plastic Printing + module ShippingMethod + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::CardBulkOrderCreateParams::ShippingMethod) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BULK_EXPEDITED = + T.let( + :BULK_EXPEDITED, + Lithic::CardBulkOrderCreateParams::ShippingMethod::TaggedSymbol + ) + BULK_PRIORITY = + T.let( + :BULK_PRIORITY, + Lithic::CardBulkOrderCreateParams::ShippingMethod::TaggedSymbol + ) + BULK_2_DAY = + T.let( + :BULK_2_DAY, + Lithic::CardBulkOrderCreateParams::ShippingMethod::TaggedSymbol + ) + BULK_EXPRESS = + T.let( + :BULK_EXPRESS, + Lithic::CardBulkOrderCreateParams::ShippingMethod::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::CardBulkOrderCreateParams::ShippingMethod::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/card_bulk_order_list_params.rbi b/rbi/lithic/models/card_bulk_order_list_params.rbi new file mode 100644 index 00000000..57abfd25 --- /dev/null +++ b/rbi/lithic/models/card_bulk_order_list_params.rbi @@ -0,0 +1,98 @@ +# typed: strong + +module Lithic + module Models + class CardBulkOrderListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::CardBulkOrderListParams, Lithic::Internal::AnyHash) + end + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/card_bulk_order_retrieve_params.rbi b/rbi/lithic/models/card_bulk_order_retrieve_params.rbi new file mode 100644 index 00000000..c3e41fa5 --- /dev/null +++ b/rbi/lithic/models/card_bulk_order_retrieve_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Lithic + module Models + class CardBulkOrderRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::CardBulkOrderRetrieveParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :bulk_order_token + + sig do + params( + bulk_order_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(bulk_order_token:, request_options: {}) + end + + sig do + override.returns( + { bulk_order_token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/card_bulk_order_update_params.rbi b/rbi/lithic/models/card_bulk_order_update_params.rbi new file mode 100644 index 00000000..97deb69c --- /dev/null +++ b/rbi/lithic/models/card_bulk_order_update_params.rbi @@ -0,0 +1,74 @@ +# typed: strong + +module Lithic + module Models + class CardBulkOrderUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::CardBulkOrderUpdateParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :bulk_order_token + + # Status to update the bulk order to. Use LOCKED to finalize the order + sig { returns(Lithic::CardBulkOrderUpdateParams::Status::OrSymbol) } + attr_accessor :status + + sig do + params( + bulk_order_token: String, + status: Lithic::CardBulkOrderUpdateParams::Status::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + bulk_order_token:, + # Status to update the bulk order to. Use LOCKED to finalize the order + status:, + request_options: {} + ) + end + + sig do + override.returns( + { + bulk_order_token: String, + status: Lithic::CardBulkOrderUpdateParams::Status::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Status to update the bulk order to. Use LOCKED to finalize the order + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::CardBulkOrderUpdateParams::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LOCKED = + T.let( + :LOCKED, + Lithic::CardBulkOrderUpdateParams::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::CardBulkOrderUpdateParams::Status::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/card_convert_physical_params.rbi b/rbi/lithic/models/card_convert_physical_params.rbi new file mode 100644 index 00000000..37383a4d --- /dev/null +++ b/rbi/lithic/models/card_convert_physical_params.rbi @@ -0,0 +1,202 @@ +# typed: strong + +module Lithic + module Models + class CardConvertPhysicalParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::CardConvertPhysicalParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :card_token + + # The shipping address this card will be sent to. + sig { returns(Lithic::ShippingAddress) } + attr_reader :shipping_address + + sig { params(shipping_address: Lithic::ShippingAddress::OrHash).void } + attr_writer :shipping_address + + # If omitted, the previous carrier will be used. + sig { returns(T.nilable(Lithic::Carrier)) } + attr_reader :carrier + + sig { params(carrier: Lithic::Carrier::OrHash).void } + attr_writer :carrier + + # Specifies the configuration (e.g. physical card art) that the card should be + # manufactured with, and only applies to cards of type `PHYSICAL`. This must be + # configured with Lithic before use. + sig { returns(T.nilable(String)) } + attr_reader :product_id + + sig { params(product_id: String).void } + attr_writer :product_id + + # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of + # options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx or UPS depending on card manufacturer, Express, 3-day + # shipping, with tracking + # - `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with + # tracking + # - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight + # or similar international option, with tracking + # - `BULK` - Card will be shipped as part of a bulk fulfillment order. The + # shipping method and timeline are inherited from the parent bulk order. + sig do + returns( + T.nilable(Lithic::CardConvertPhysicalParams::ShippingMethod::OrSymbol) + ) + end + attr_reader :shipping_method + + sig do + params( + shipping_method: + Lithic::CardConvertPhysicalParams::ShippingMethod::OrSymbol + ).void + end + attr_writer :shipping_method + + sig do + params( + card_token: String, + shipping_address: Lithic::ShippingAddress::OrHash, + carrier: Lithic::Carrier::OrHash, + product_id: String, + shipping_method: + Lithic::CardConvertPhysicalParams::ShippingMethod::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + card_token:, + # The shipping address this card will be sent to. + shipping_address:, + # If omitted, the previous carrier will be used. + carrier: nil, + # Specifies the configuration (e.g. physical card art) that the card should be + # manufactured with, and only applies to cards of type `PHYSICAL`. This must be + # configured with Lithic before use. + product_id: nil, + # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of + # options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx or UPS depending on card manufacturer, Express, 3-day + # shipping, with tracking + # - `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with + # tracking + # - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight + # or similar international option, with tracking + # - `BULK` - Card will be shipped as part of a bulk fulfillment order. The + # shipping method and timeline are inherited from the parent bulk order. + shipping_method: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + card_token: String, + shipping_address: Lithic::ShippingAddress, + carrier: Lithic::Carrier, + product_id: String, + shipping_method: + Lithic::CardConvertPhysicalParams::ShippingMethod::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of + # options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx or UPS depending on card manufacturer, Express, 3-day + # shipping, with tracking + # - `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with + # tracking + # - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight + # or similar international option, with tracking + # - `BULK` - Card will be shipped as part of a bulk fulfillment order. The + # shipping method and timeline are inherited from the parent bulk order. + module ShippingMethod + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::CardConvertPhysicalParams::ShippingMethod) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SHIPPING_METHOD_2_DAY = + T.let( + :"2_DAY", + Lithic::CardConvertPhysicalParams::ShippingMethod::TaggedSymbol + ) + BULK = + T.let( + :BULK, + Lithic::CardConvertPhysicalParams::ShippingMethod::TaggedSymbol + ) + EXPEDITED = + T.let( + :EXPEDITED, + Lithic::CardConvertPhysicalParams::ShippingMethod::TaggedSymbol + ) + EXPRESS = + T.let( + :EXPRESS, + Lithic::CardConvertPhysicalParams::ShippingMethod::TaggedSymbol + ) + PRIORITY = + T.let( + :PRIORITY, + Lithic::CardConvertPhysicalParams::ShippingMethod::TaggedSymbol + ) + STANDARD = + T.let( + :STANDARD, + Lithic::CardConvertPhysicalParams::ShippingMethod::TaggedSymbol + ) + STANDARD_WITH_TRACKING = + T.let( + :STANDARD_WITH_TRACKING, + Lithic::CardConvertPhysicalParams::ShippingMethod::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::CardConvertPhysicalParams::ShippingMethod::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/card_converted_webhook_event.rbi b/rbi/lithic/models/card_converted_webhook_event.rbi new file mode 100644 index 00000000..b0c57a65 --- /dev/null +++ b/rbi/lithic/models/card_converted_webhook_event.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Lithic + module Models + class CardConvertedWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::CardConvertedWebhookEvent, Lithic::Internal::AnyHash) + end + + # The token of the card that was created. + sig { returns(String) } + attr_accessor :card_token + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig do + params(card_token: String, event_type: Symbol).returns(T.attached_class) + end + def self.new( + # The token of the card that was created. + card_token:, + # The type of event that occurred. + event_type: :"card.converted" + ) + end + + sig { override.returns({ card_token: String, event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/card_create_params.rbi b/rbi/lithic/models/card_create_params.rbi new file mode 100644 index 00000000..2757fcc8 --- /dev/null +++ b/rbi/lithic/models/card_create_params.rbi @@ -0,0 +1,723 @@ +# typed: strong + +module Lithic + module Models + class CardCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::CardCreateParams, Lithic::Internal::AnyHash) + end + + # Card types: + # + # - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital + # wallet like Apple Pay or Google Pay (if the card program is digital + # wallet-enabled). + # - `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label + # branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality. + # Reach out at [lithic.com/contact](https://lithic.com/contact) for more + # information. + # - `SINGLE_USE` - Card is closed upon first successful authorization. + # - `MERCHANT_LOCKED` - Card is locked to the first merchant that successfully + # authorizes the card. + # - `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use + # VIRTUAL instead. + # - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please + # use VIRTUAL instead. + sig { returns(Lithic::CardCreateParams::Type::OrSymbol) } + attr_accessor :type + + # Globally unique identifier for the account that the card will be associated + # with. Required for programs enrolling users using the + # [/account_holders endpoint](https://docs.lithic.com/docs/account-holders-kyc). + # See [Managing Your Program](doc:managing-your-program) for more information. + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Globally unique identifier for an existing bulk order to associate this card + # with. When specified, the card will be added to the bulk order for batch + # shipment. Only applicable to cards of type PHYSICAL + sig { returns(T.nilable(String)) } + attr_reader :bulk_order_token + + sig { params(bulk_order_token: String).void } + attr_writer :bulk_order_token + + # For card programs with more than one BIN range. This must be configured with + # Lithic before use. Identifies the card program/BIN range under which to create + # the card. If omitted, will utilize the program's default `card_program_token`. + # In Sandbox, use 00000000-0000-0000-1000-000000000000 and + # 00000000-0000-0000-2000-000000000000 to test creating cards on specific card + # programs. + sig { returns(T.nilable(String)) } + attr_reader :card_program_token + + sig { params(card_program_token: String).void } + attr_writer :card_program_token + + sig { returns(T.nilable(Lithic::Carrier)) } + attr_reader :carrier + + sig { params(carrier: Lithic::Carrier::OrHash).void } + attr_writer :carrier + + # Specifies the digital card art to be displayed in the user’s digital wallet + # after tokenization. This artwork must be approved by Mastercard and configured + # by Lithic to use. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + sig { returns(T.nilable(String)) } + attr_reader :digital_card_art_token + + sig { params(digital_card_art_token: String).void } + attr_writer :digital_card_art_token + + # Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, + # an expiration date five years in the future will be generated. Five years is the + # maximum expiration date. + sig { returns(T.nilable(String)) } + attr_reader :exp_month + + sig { params(exp_month: String).void } + attr_writer :exp_month + + # Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is + # provided, an expiration date five years in the future will be generated. Five + # years is the maximum expiration date. + sig { returns(T.nilable(String)) } + attr_reader :exp_year + + sig { params(exp_year: String).void } + attr_writer :exp_year + + # Friendly name to identify the card. + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + # Encrypted PIN block (in base64). Applies to cards of type `PHYSICAL` and + # `VIRTUAL`. See + # [Encrypted PIN Block](https://docs.lithic.com/docs/cards#encrypted-pin-block). + sig { returns(T.nilable(String)) } + attr_reader :pin + + sig { params(pin: String).void } + attr_writer :pin + + # Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic + # before use. Specifies the configuration (i.e., physical card art) that the card + # should be manufactured with. + sig { returns(T.nilable(String)) } + attr_reader :product_id + + sig { params(product_id: String).void } + attr_writer :product_id + + # Restricted field limited to select use cases. Lithic will reach out directly if + # this field should be used. Globally unique identifier for the replacement card's + # account. If this field is specified, `replacement_for` must also be specified. + # If `replacement_for` is specified and this field is omitted, the replacement + # card's account will be inferred from the card being replaced. + sig { returns(T.nilable(String)) } + attr_reader :replacement_account_token + + sig { params(replacement_account_token: String).void } + attr_writer :replacement_account_token + + # Additional context or information related to the card that this card will + # replace. + sig { returns(T.nilable(String)) } + attr_reader :replacement_comment + + sig { params(replacement_comment: String).void } + attr_writer :replacement_comment + + # Globally unique identifier for the card that this card will replace. If the card + # type is `PHYSICAL` it will be replaced by a `PHYSICAL` card. If the card type is + # `VIRTUAL` it will be replaced by a `VIRTUAL` card. + sig { returns(T.nilable(String)) } + attr_reader :replacement_for + + sig { params(replacement_for: String).void } + attr_writer :replacement_for + + # Card state substatus values for the card that this card will replace: + # + # - `LOST` - The physical card is no longer in the cardholder's possession due to + # being lost or never received by the cardholder. + # - `COMPROMISED` - Card information has been exposed, potentially leading to + # unauthorized access. This may involve physical card theft, cloning, or online + # data breaches. + # - `DAMAGED` - The physical card is not functioning properly, such as having chip + # failures or a demagnetized magnetic stripe. + # - `END_USER_REQUEST` - The cardholder requested the closure of the card for + # reasons unrelated to fraud or damage, such as switching to a different product + # or closing the account. + # - `ISSUER_REQUEST` - The issuer closed the card for reasons unrelated to fraud + # or damage, such as account inactivity, product or policy changes, or + # technology upgrades. + # - `NOT_ACTIVE` - The card hasn’t had any transaction activity for a specified + # period, applicable to statuses like `PAUSED` or `CLOSED`. + # - `SUSPICIOUS_ACTIVITY` - The card has one or more suspicious transactions or + # activities that require review. This can involve prompting the cardholder to + # confirm legitimate use or report confirmed fraud. + # - `INTERNAL_REVIEW` - The card is temporarily paused pending further internal + # review. + # - `EXPIRED` - The card has expired and has been closed without being reissued. + # - `UNDELIVERABLE` - The card cannot be delivered to the cardholder and has been + # returned. + # - `OTHER` - The reason for the status does not fall into any of the above + # categories. A comment should be provided to specify the reason. + sig do + returns( + T.nilable(Lithic::CardCreateParams::ReplacementSubstatus::OrSymbol) + ) + end + attr_reader :replacement_substatus + + sig do + params( + replacement_substatus: + Lithic::CardCreateParams::ReplacementSubstatus::OrSymbol + ).void + end + attr_writer :replacement_substatus + + sig { returns(T.nilable(Lithic::ShippingAddress)) } + attr_reader :shipping_address + + sig { params(shipping_address: Lithic::ShippingAddress::OrHash).void } + attr_writer :shipping_address + + # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of + # options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx or UPS depending on card manufacturer, Express, 3-day + # shipping, with tracking + # - `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with + # tracking + # - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight + # or similar international option, with tracking + # - `BULK` - Card will be shipped as part of a bulk fulfillment order. The + # shipping method and timeline are inherited from the parent bulk order. + sig do + returns(T.nilable(Lithic::CardCreateParams::ShippingMethod::OrSymbol)) + end + attr_reader :shipping_method + + sig do + params( + shipping_method: Lithic::CardCreateParams::ShippingMethod::OrSymbol + ).void + end + attr_writer :shipping_method + + # Amount (in cents) to limit approved authorizations (e.g. 100000 would be a + # $1,000 limit). Transaction requests above the spend limit will be declined. Note + # that a spend limit of 0 is effectively no limit, and should only be used to + # reset or remove a prior limit. Only a limit of 1 or above will result in + # declined transactions due to checks against the card limit. + sig { returns(T.nilable(Integer)) } + attr_reader :spend_limit + + sig { params(spend_limit: Integer).void } + attr_writer :spend_limit + + # Spend limit duration values: + # + # - `ANNUALLY` - Card will authorize transactions up to spend limit for the + # trailing year. + # - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime + # of the card. + # - `MONTHLY` - Card will authorize transactions up to spend limit for the + # trailing month. To support recurring monthly payments, which can occur on + # different day every month, the time window we consider for monthly velocity + # starts 6 days after the current calendar date one month prior. + # - `TRANSACTION` - Card will authorize multiple transactions if each individual + # transaction is under the spend limit. + sig { returns(T.nilable(Lithic::SpendLimitDuration::OrSymbol)) } + attr_reader :spend_limit_duration + + sig do + params(spend_limit_duration: Lithic::SpendLimitDuration::OrSymbol).void + end + attr_writer :spend_limit_duration + + # Card state values: + # + # - `OPEN` - Card will approve authorizations (if they match card and account + # parameters). + # - `PAUSED` - Card will decline authorizations, but can be resumed at a later + # time. + sig { returns(T.nilable(Lithic::CardCreateParams::State::OrSymbol)) } + attr_reader :state + + sig { params(state: Lithic::CardCreateParams::State::OrSymbol).void } + attr_writer :state + + sig { returns(T.nilable(String)) } + attr_reader :idempotency_key + + sig { params(idempotency_key: String).void } + attr_writer :idempotency_key + + sig do + params( + type: Lithic::CardCreateParams::Type::OrSymbol, + account_token: String, + bulk_order_token: String, + card_program_token: String, + carrier: Lithic::Carrier::OrHash, + digital_card_art_token: String, + exp_month: String, + exp_year: String, + memo: String, + pin: String, + product_id: String, + replacement_account_token: String, + replacement_comment: String, + replacement_for: String, + replacement_substatus: + Lithic::CardCreateParams::ReplacementSubstatus::OrSymbol, + shipping_address: Lithic::ShippingAddress::OrHash, + shipping_method: Lithic::CardCreateParams::ShippingMethod::OrSymbol, + spend_limit: Integer, + spend_limit_duration: Lithic::SpendLimitDuration::OrSymbol, + state: Lithic::CardCreateParams::State::OrSymbol, + idempotency_key: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Card types: + # + # - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital + # wallet like Apple Pay or Google Pay (if the card program is digital + # wallet-enabled). + # - `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label + # branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality. + # Reach out at [lithic.com/contact](https://lithic.com/contact) for more + # information. + # - `SINGLE_USE` - Card is closed upon first successful authorization. + # - `MERCHANT_LOCKED` - Card is locked to the first merchant that successfully + # authorizes the card. + # - `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use + # VIRTUAL instead. + # - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please + # use VIRTUAL instead. + type:, + # Globally unique identifier for the account that the card will be associated + # with. Required for programs enrolling users using the + # [/account_holders endpoint](https://docs.lithic.com/docs/account-holders-kyc). + # See [Managing Your Program](doc:managing-your-program) for more information. + account_token: nil, + # Globally unique identifier for an existing bulk order to associate this card + # with. When specified, the card will be added to the bulk order for batch + # shipment. Only applicable to cards of type PHYSICAL + bulk_order_token: nil, + # For card programs with more than one BIN range. This must be configured with + # Lithic before use. Identifies the card program/BIN range under which to create + # the card. If omitted, will utilize the program's default `card_program_token`. + # In Sandbox, use 00000000-0000-0000-1000-000000000000 and + # 00000000-0000-0000-2000-000000000000 to test creating cards on specific card + # programs. + card_program_token: nil, + carrier: nil, + # Specifies the digital card art to be displayed in the user’s digital wallet + # after tokenization. This artwork must be approved by Mastercard and configured + # by Lithic to use. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + digital_card_art_token: nil, + # Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, + # an expiration date five years in the future will be generated. Five years is the + # maximum expiration date. + exp_month: nil, + # Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is + # provided, an expiration date five years in the future will be generated. Five + # years is the maximum expiration date. + exp_year: nil, + # Friendly name to identify the card. + memo: nil, + # Encrypted PIN block (in base64). Applies to cards of type `PHYSICAL` and + # `VIRTUAL`. See + # [Encrypted PIN Block](https://docs.lithic.com/docs/cards#encrypted-pin-block). + pin: nil, + # Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic + # before use. Specifies the configuration (i.e., physical card art) that the card + # should be manufactured with. + product_id: nil, + # Restricted field limited to select use cases. Lithic will reach out directly if + # this field should be used. Globally unique identifier for the replacement card's + # account. If this field is specified, `replacement_for` must also be specified. + # If `replacement_for` is specified and this field is omitted, the replacement + # card's account will be inferred from the card being replaced. + replacement_account_token: nil, + # Additional context or information related to the card that this card will + # replace. + replacement_comment: nil, + # Globally unique identifier for the card that this card will replace. If the card + # type is `PHYSICAL` it will be replaced by a `PHYSICAL` card. If the card type is + # `VIRTUAL` it will be replaced by a `VIRTUAL` card. + replacement_for: nil, + # Card state substatus values for the card that this card will replace: + # + # - `LOST` - The physical card is no longer in the cardholder's possession due to + # being lost or never received by the cardholder. + # - `COMPROMISED` - Card information has been exposed, potentially leading to + # unauthorized access. This may involve physical card theft, cloning, or online + # data breaches. + # - `DAMAGED` - The physical card is not functioning properly, such as having chip + # failures or a demagnetized magnetic stripe. + # - `END_USER_REQUEST` - The cardholder requested the closure of the card for + # reasons unrelated to fraud or damage, such as switching to a different product + # or closing the account. + # - `ISSUER_REQUEST` - The issuer closed the card for reasons unrelated to fraud + # or damage, such as account inactivity, product or policy changes, or + # technology upgrades. + # - `NOT_ACTIVE` - The card hasn’t had any transaction activity for a specified + # period, applicable to statuses like `PAUSED` or `CLOSED`. + # - `SUSPICIOUS_ACTIVITY` - The card has one or more suspicious transactions or + # activities that require review. This can involve prompting the cardholder to + # confirm legitimate use or report confirmed fraud. + # - `INTERNAL_REVIEW` - The card is temporarily paused pending further internal + # review. + # - `EXPIRED` - The card has expired and has been closed without being reissued. + # - `UNDELIVERABLE` - The card cannot be delivered to the cardholder and has been + # returned. + # - `OTHER` - The reason for the status does not fall into any of the above + # categories. A comment should be provided to specify the reason. + replacement_substatus: nil, + shipping_address: nil, + # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of + # options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx or UPS depending on card manufacturer, Express, 3-day + # shipping, with tracking + # - `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with + # tracking + # - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight + # or similar international option, with tracking + # - `BULK` - Card will be shipped as part of a bulk fulfillment order. The + # shipping method and timeline are inherited from the parent bulk order. + shipping_method: nil, + # Amount (in cents) to limit approved authorizations (e.g. 100000 would be a + # $1,000 limit). Transaction requests above the spend limit will be declined. Note + # that a spend limit of 0 is effectively no limit, and should only be used to + # reset or remove a prior limit. Only a limit of 1 or above will result in + # declined transactions due to checks against the card limit. + spend_limit: nil, + # Spend limit duration values: + # + # - `ANNUALLY` - Card will authorize transactions up to spend limit for the + # trailing year. + # - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime + # of the card. + # - `MONTHLY` - Card will authorize transactions up to spend limit for the + # trailing month. To support recurring monthly payments, which can occur on + # different day every month, the time window we consider for monthly velocity + # starts 6 days after the current calendar date one month prior. + # - `TRANSACTION` - Card will authorize multiple transactions if each individual + # transaction is under the spend limit. + spend_limit_duration: nil, + # Card state values: + # + # - `OPEN` - Card will approve authorizations (if they match card and account + # parameters). + # - `PAUSED` - Card will decline authorizations, but can be resumed at a later + # time. + state: nil, + idempotency_key: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + type: Lithic::CardCreateParams::Type::OrSymbol, + account_token: String, + bulk_order_token: String, + card_program_token: String, + carrier: Lithic::Carrier, + digital_card_art_token: String, + exp_month: String, + exp_year: String, + memo: String, + pin: String, + product_id: String, + replacement_account_token: String, + replacement_comment: String, + replacement_for: String, + replacement_substatus: + Lithic::CardCreateParams::ReplacementSubstatus::OrSymbol, + shipping_address: Lithic::ShippingAddress, + shipping_method: Lithic::CardCreateParams::ShippingMethod::OrSymbol, + spend_limit: Integer, + spend_limit_duration: Lithic::SpendLimitDuration::OrSymbol, + state: Lithic::CardCreateParams::State::OrSymbol, + idempotency_key: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Card types: + # + # - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital + # wallet like Apple Pay or Google Pay (if the card program is digital + # wallet-enabled). + # - `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label + # branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality. + # Reach out at [lithic.com/contact](https://lithic.com/contact) for more + # information. + # - `SINGLE_USE` - Card is closed upon first successful authorization. + # - `MERCHANT_LOCKED` - Card is locked to the first merchant that successfully + # authorizes the card. + # - `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use + # VIRTUAL instead. + # - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please + # use VIRTUAL instead. + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::CardCreateParams::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MERCHANT_LOCKED = + T.let(:MERCHANT_LOCKED, Lithic::CardCreateParams::Type::TaggedSymbol) + PHYSICAL = + T.let(:PHYSICAL, Lithic::CardCreateParams::Type::TaggedSymbol) + SINGLE_USE = + T.let(:SINGLE_USE, Lithic::CardCreateParams::Type::TaggedSymbol) + VIRTUAL = T.let(:VIRTUAL, Lithic::CardCreateParams::Type::TaggedSymbol) + UNLOCKED = + T.let(:UNLOCKED, Lithic::CardCreateParams::Type::TaggedSymbol) + DIGITAL_WALLET = + T.let(:DIGITAL_WALLET, Lithic::CardCreateParams::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::CardCreateParams::Type::TaggedSymbol] + ) + end + def self.values + end + end + + # Card state substatus values for the card that this card will replace: + # + # - `LOST` - The physical card is no longer in the cardholder's possession due to + # being lost or never received by the cardholder. + # - `COMPROMISED` - Card information has been exposed, potentially leading to + # unauthorized access. This may involve physical card theft, cloning, or online + # data breaches. + # - `DAMAGED` - The physical card is not functioning properly, such as having chip + # failures or a demagnetized magnetic stripe. + # - `END_USER_REQUEST` - The cardholder requested the closure of the card for + # reasons unrelated to fraud or damage, such as switching to a different product + # or closing the account. + # - `ISSUER_REQUEST` - The issuer closed the card for reasons unrelated to fraud + # or damage, such as account inactivity, product or policy changes, or + # technology upgrades. + # - `NOT_ACTIVE` - The card hasn’t had any transaction activity for a specified + # period, applicable to statuses like `PAUSED` or `CLOSED`. + # - `SUSPICIOUS_ACTIVITY` - The card has one or more suspicious transactions or + # activities that require review. This can involve prompting the cardholder to + # confirm legitimate use or report confirmed fraud. + # - `INTERNAL_REVIEW` - The card is temporarily paused pending further internal + # review. + # - `EXPIRED` - The card has expired and has been closed without being reissued. + # - `UNDELIVERABLE` - The card cannot be delivered to the cardholder and has been + # returned. + # - `OTHER` - The reason for the status does not fall into any of the above + # categories. A comment should be provided to specify the reason. + module ReplacementSubstatus + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::CardCreateParams::ReplacementSubstatus) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LOST = + T.let( + :LOST, + Lithic::CardCreateParams::ReplacementSubstatus::TaggedSymbol + ) + COMPROMISED = + T.let( + :COMPROMISED, + Lithic::CardCreateParams::ReplacementSubstatus::TaggedSymbol + ) + DAMAGED = + T.let( + :DAMAGED, + Lithic::CardCreateParams::ReplacementSubstatus::TaggedSymbol + ) + END_USER_REQUEST = + T.let( + :END_USER_REQUEST, + Lithic::CardCreateParams::ReplacementSubstatus::TaggedSymbol + ) + ISSUER_REQUEST = + T.let( + :ISSUER_REQUEST, + Lithic::CardCreateParams::ReplacementSubstatus::TaggedSymbol + ) + NOT_ACTIVE = + T.let( + :NOT_ACTIVE, + Lithic::CardCreateParams::ReplacementSubstatus::TaggedSymbol + ) + SUSPICIOUS_ACTIVITY = + T.let( + :SUSPICIOUS_ACTIVITY, + Lithic::CardCreateParams::ReplacementSubstatus::TaggedSymbol + ) + INTERNAL_REVIEW = + T.let( + :INTERNAL_REVIEW, + Lithic::CardCreateParams::ReplacementSubstatus::TaggedSymbol + ) + EXPIRED = + T.let( + :EXPIRED, + Lithic::CardCreateParams::ReplacementSubstatus::TaggedSymbol + ) + UNDELIVERABLE = + T.let( + :UNDELIVERABLE, + Lithic::CardCreateParams::ReplacementSubstatus::TaggedSymbol + ) + OTHER = + T.let( + :OTHER, + Lithic::CardCreateParams::ReplacementSubstatus::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::CardCreateParams::ReplacementSubstatus::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of + # options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx or UPS depending on card manufacturer, Express, 3-day + # shipping, with tracking + # - `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with + # tracking + # - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight + # or similar international option, with tracking + # - `BULK` - Card will be shipped as part of a bulk fulfillment order. The + # shipping method and timeline are inherited from the parent bulk order. + module ShippingMethod + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::CardCreateParams::ShippingMethod) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SHIPPING_METHOD_2_DAY = + T.let( + :"2_DAY", + Lithic::CardCreateParams::ShippingMethod::TaggedSymbol + ) + BULK = + T.let(:BULK, Lithic::CardCreateParams::ShippingMethod::TaggedSymbol) + EXPEDITED = + T.let( + :EXPEDITED, + Lithic::CardCreateParams::ShippingMethod::TaggedSymbol + ) + EXPRESS = + T.let( + :EXPRESS, + Lithic::CardCreateParams::ShippingMethod::TaggedSymbol + ) + PRIORITY = + T.let( + :PRIORITY, + Lithic::CardCreateParams::ShippingMethod::TaggedSymbol + ) + STANDARD = + T.let( + :STANDARD, + Lithic::CardCreateParams::ShippingMethod::TaggedSymbol + ) + STANDARD_WITH_TRACKING = + T.let( + :STANDARD_WITH_TRACKING, + Lithic::CardCreateParams::ShippingMethod::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::CardCreateParams::ShippingMethod::TaggedSymbol] + ) + end + def self.values + end + end + + # Card state values: + # + # - `OPEN` - Card will approve authorizations (if they match card and account + # parameters). + # - `PAUSED` - Card will decline authorizations, but can be resumed at a later + # time. + module State + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::CardCreateParams::State) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + OPEN = T.let(:OPEN, Lithic::CardCreateParams::State::TaggedSymbol) + PAUSED = T.let(:PAUSED, Lithic::CardCreateParams::State::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::CardCreateParams::State::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/card_created_webhook_event.rbi b/rbi/lithic/models/card_created_webhook_event.rbi new file mode 100644 index 00000000..5e70e353 --- /dev/null +++ b/rbi/lithic/models/card_created_webhook_event.rbi @@ -0,0 +1,53 @@ +# typed: strong + +module Lithic + module Models + class CardCreatedWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::CardCreatedWebhookEvent, Lithic::Internal::AnyHash) + end + + # The token of the card that was created. + sig { returns(String) } + attr_accessor :card_token + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # The token of the card that was replaced, if the new card is a replacement card. + sig { returns(T.nilable(String)) } + attr_accessor :replacement_for + + sig do + params( + card_token: String, + replacement_for: T.nilable(String), + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The token of the card that was created. + card_token:, + # The token of the card that was replaced, if the new card is a replacement card. + replacement_for: nil, + # The type of event that occurred. + event_type: :"card.created" + ) + end + + sig do + override.returns( + { + card_token: String, + event_type: Symbol, + replacement_for: T.nilable(String) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/card_embed_params.rbi b/rbi/lithic/models/card_embed_params.rbi new file mode 100644 index 00000000..b02ea881 --- /dev/null +++ b/rbi/lithic/models/card_embed_params.rbi @@ -0,0 +1,51 @@ +# typed: strong + +module Lithic + module Models + class CardEmbedParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::CardEmbedParams, Lithic::Internal::AnyHash) + end + + # A base64 encoded JSON string of an EmbedRequest to specify which card to load. + sig { returns(String) } + attr_accessor :embed_request + + # SHA256 HMAC of the embed_request JSON string with base64 digest. + sig { returns(String) } + attr_accessor :hmac + + sig do + params( + embed_request: String, + hmac: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # A base64 encoded JSON string of an EmbedRequest to specify which card to load. + embed_request:, + # SHA256 HMAC of the embed_request JSON string with base64 digest. + hmac:, + request_options: {} + ) + end + + sig do + override.returns( + { + embed_request: String, + hmac: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/card_embed_response.rbi b/rbi/lithic/models/card_embed_response.rbi new file mode 100644 index 00000000..32a29a97 --- /dev/null +++ b/rbi/lithic/models/card_embed_response.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module Lithic + module Models + CardEmbedResponse = String + end +end diff --git a/rbi/lithic/models/card_list_params.rbi b/rbi/lithic/models/card_list_params.rbi new file mode 100644 index 00000000..d60154a3 --- /dev/null +++ b/rbi/lithic/models/card_list_params.rbi @@ -0,0 +1,162 @@ +# typed: strong + +module Lithic + module Models + class CardListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::CardListParams, Lithic::Internal::AnyHash) + end + + # Returns cards associated with the specified account. + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Returns cards containing the specified partial or full memo text. + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + # Returns cards with the specified state. + sig { returns(T.nilable(Lithic::CardListParams::State::OrSymbol)) } + attr_reader :state + + sig { params(state: Lithic::CardListParams::State::OrSymbol).void } + attr_writer :state + + sig do + params( + account_token: String, + begin_: Time, + end_: Time, + ending_before: String, + memo: String, + page_size: Integer, + starting_after: String, + state: Lithic::CardListParams::State::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Returns cards associated with the specified account. + account_token: nil, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Returns cards containing the specified partial or full memo text. + memo: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Returns cards with the specified state. + state: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + account_token: String, + begin_: Time, + end_: Time, + ending_before: String, + memo: String, + page_size: Integer, + starting_after: String, + state: Lithic::CardListParams::State::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Returns cards with the specified state. + module State + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::CardListParams::State) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CLOSED = T.let(:CLOSED, Lithic::CardListParams::State::TaggedSymbol) + OPEN = T.let(:OPEN, Lithic::CardListParams::State::TaggedSymbol) + PAUSED = T.let(:PAUSED, Lithic::CardListParams::State::TaggedSymbol) + PENDING_ACTIVATION = + T.let( + :PENDING_ACTIVATION, + Lithic::CardListParams::State::TaggedSymbol + ) + PENDING_FULFILLMENT = + T.let( + :PENDING_FULFILLMENT, + Lithic::CardListParams::State::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::CardListParams::State::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/card_program.rbi b/rbi/lithic/models/card_program.rbi new file mode 100644 index 00000000..32800d73 --- /dev/null +++ b/rbi/lithic/models/card_program.rbi @@ -0,0 +1,98 @@ +# typed: strong + +module Lithic + module Models + class CardProgram < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Lithic::CardProgram, Lithic::Internal::AnyHash) } + + # Globally unique identifier. + sig { returns(String) } + attr_accessor :token + + # Whether the card program is participating in Account Level Management. Currently + # applicable to Visa card programs only. + sig { returns(T::Boolean) } + attr_accessor :account_level_management_enabled + + # Timestamp of when the card program was created. + sig { returns(Time) } + attr_accessor :created + + # The name of the card program. + sig { returns(String) } + attr_accessor :name + + # The first digits of the card number that this card program ends with. + sig { returns(String) } + attr_accessor :pan_range_end + + # The first digits of the card number that this card program starts with. + sig { returns(String) } + attr_accessor :pan_range_start + + # 3-character alphabetic ISO 4217 code for the currency of the cardholder. + sig { returns(T.nilable(String)) } + attr_accessor :cardholder_currency + + # List of 3-character alphabetic ISO 4217 codes for the currencies that the card + # program supports for settlement. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :settlement_currencies + + sig { params(settlement_currencies: T::Array[String]).void } + attr_writer :settlement_currencies + + sig do + params( + token: String, + account_level_management_enabled: T::Boolean, + created: Time, + name: String, + pan_range_end: String, + pan_range_start: String, + cardholder_currency: T.nilable(String), + settlement_currencies: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier. + token:, + # Whether the card program is participating in Account Level Management. Currently + # applicable to Visa card programs only. + account_level_management_enabled:, + # Timestamp of when the card program was created. + created:, + # The name of the card program. + name:, + # The first digits of the card number that this card program ends with. + pan_range_end:, + # The first digits of the card number that this card program starts with. + pan_range_start:, + # 3-character alphabetic ISO 4217 code for the currency of the cardholder. + cardholder_currency: nil, + # List of 3-character alphabetic ISO 4217 codes for the currencies that the card + # program supports for settlement. + settlement_currencies: nil + ) + end + + sig do + override.returns( + { + token: String, + account_level_management_enabled: T::Boolean, + created: Time, + name: String, + pan_range_end: String, + pan_range_start: String, + cardholder_currency: T.nilable(String), + settlement_currencies: T::Array[String] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/card_program_list_params.rbi b/rbi/lithic/models/card_program_list_params.rbi new file mode 100644 index 00000000..861707d1 --- /dev/null +++ b/rbi/lithic/models/card_program_list_params.rbi @@ -0,0 +1,72 @@ +# typed: strong + +module Lithic + module Models + class CardProgramListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::CardProgramListParams, Lithic::Internal::AnyHash) + end + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/card_program_retrieve_params.rbi b/rbi/lithic/models/card_program_retrieve_params.rbi new file mode 100644 index 00000000..e5933487 --- /dev/null +++ b/rbi/lithic/models/card_program_retrieve_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Lithic + module Models + class CardProgramRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::CardProgramRetrieveParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :card_program_token + + sig do + params( + card_program_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(card_program_token:, request_options: {}) + end + + sig do + override.returns( + { + card_program_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/card_provision_params.rbi b/rbi/lithic/models/card_provision_params.rbi new file mode 100644 index 00000000..b941391a --- /dev/null +++ b/rbi/lithic/models/card_provision_params.rbi @@ -0,0 +1,171 @@ +# typed: strong + +module Lithic + module Models + class CardProvisionParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::CardProvisionParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :card_token + + # Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only + # `activationData` in the response. Apple's public leaf certificate. Base64 + # encoded in PEM format with headers `(-----BEGIN CERTIFICATE-----)` and trailers + # omitted. Provided by the device's wallet. + sig { returns(T.nilable(String)) } + attr_reader :certificate + + sig { params(certificate: String).void } + attr_writer :certificate + + # Only applicable if `digital_wallet` is `GOOGLE_PAY` or `SAMSUNG_PAY` and the + # card is on the Visa network. Stable device identification set by the wallet + # provider. + sig { returns(T.nilable(String)) } + attr_reader :client_device_id + + sig { params(client_device_id: String).void } + attr_writer :client_device_id + + # Only applicable if `digital_wallet` is `GOOGLE_PAY` or `SAMSUNG_PAY` and the + # card is on the Visa network. Consumer ID that identifies the wallet account + # holder entity. + sig { returns(T.nilable(String)) } + attr_reader :client_wallet_account_id + + sig { params(client_wallet_account_id: String).void } + attr_writer :client_wallet_account_id + + # Name of digital wallet provider. + sig do + returns(T.nilable(Lithic::CardProvisionParams::DigitalWallet::OrSymbol)) + end + attr_reader :digital_wallet + + sig do + params( + digital_wallet: Lithic::CardProvisionParams::DigitalWallet::OrSymbol + ).void + end + attr_writer :digital_wallet + + # Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only + # `activationData` in the response. Base64 cryptographic nonce provided by the + # device's wallet. + sig { returns(T.nilable(String)) } + attr_reader :nonce + + sig { params(nonce: String).void } + attr_writer :nonce + + # Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only + # `activationData` in the response. Base64 cryptographic nonce provided by the + # device's wallet. + sig { returns(T.nilable(String)) } + attr_reader :nonce_signature + + sig { params(nonce_signature: String).void } + attr_writer :nonce_signature + + sig do + params( + card_token: String, + certificate: String, + client_device_id: String, + client_wallet_account_id: String, + digital_wallet: Lithic::CardProvisionParams::DigitalWallet::OrSymbol, + nonce: String, + nonce_signature: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + card_token:, + # Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only + # `activationData` in the response. Apple's public leaf certificate. Base64 + # encoded in PEM format with headers `(-----BEGIN CERTIFICATE-----)` and trailers + # omitted. Provided by the device's wallet. + certificate: nil, + # Only applicable if `digital_wallet` is `GOOGLE_PAY` or `SAMSUNG_PAY` and the + # card is on the Visa network. Stable device identification set by the wallet + # provider. + client_device_id: nil, + # Only applicable if `digital_wallet` is `GOOGLE_PAY` or `SAMSUNG_PAY` and the + # card is on the Visa network. Consumer ID that identifies the wallet account + # holder entity. + client_wallet_account_id: nil, + # Name of digital wallet provider. + digital_wallet: nil, + # Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only + # `activationData` in the response. Base64 cryptographic nonce provided by the + # device's wallet. + nonce: nil, + # Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only + # `activationData` in the response. Base64 cryptographic nonce provided by the + # device's wallet. + nonce_signature: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + card_token: String, + certificate: String, + client_device_id: String, + client_wallet_account_id: String, + digital_wallet: + Lithic::CardProvisionParams::DigitalWallet::OrSymbol, + nonce: String, + nonce_signature: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Name of digital wallet provider. + module DigitalWallet + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::CardProvisionParams::DigitalWallet) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPLE_PAY = + T.let( + :APPLE_PAY, + Lithic::CardProvisionParams::DigitalWallet::TaggedSymbol + ) + GOOGLE_PAY = + T.let( + :GOOGLE_PAY, + Lithic::CardProvisionParams::DigitalWallet::TaggedSymbol + ) + SAMSUNG_PAY = + T.let( + :SAMSUNG_PAY, + Lithic::CardProvisionParams::DigitalWallet::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::CardProvisionParams::DigitalWallet::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/card_provision_response.rbi b/rbi/lithic/models/card_provision_response.rbi new file mode 100644 index 00000000..13a38d4b --- /dev/null +++ b/rbi/lithic/models/card_provision_response.rbi @@ -0,0 +1,74 @@ +# typed: strong + +module Lithic + module Models + class CardProvisionResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::CardProvisionResponse, + Lithic::Internal::AnyHash + ) + end + + # Base64 encoded JSON payload representing a payment card that can be passed to a + # device's digital wallet. Applies to Google and Samsung Pay wallets. + sig do + returns( + T.nilable( + Lithic::Models::CardProvisionResponse::ProvisioningPayload::Variants + ) + ) + end + attr_reader :provisioning_payload + + sig do + params( + provisioning_payload: T.any(String, Lithic::ProvisionResponse::OrHash) + ).void + end + attr_writer :provisioning_payload + + sig do + params( + provisioning_payload: T.any(String, Lithic::ProvisionResponse::OrHash) + ).returns(T.attached_class) + end + def self.new( + # Base64 encoded JSON payload representing a payment card that can be passed to a + # device's digital wallet. Applies to Google and Samsung Pay wallets. + provisioning_payload: nil + ) + end + + sig do + override.returns( + { + provisioning_payload: + Lithic::Models::CardProvisionResponse::ProvisioningPayload::Variants + } + ) + end + def to_hash + end + + # Base64 encoded JSON payload representing a payment card that can be passed to a + # device's digital wallet. Applies to Google and Samsung Pay wallets. + module ProvisioningPayload + extend Lithic::Internal::Type::Union + + Variants = T.type_alias { T.any(String, Lithic::ProvisionResponse) } + + sig do + override.returns( + T::Array[ + Lithic::Models::CardProvisionResponse::ProvisioningPayload::Variants + ] + ) + end + def self.variants + end + end + end + end +end diff --git a/rbi/lithic/models/card_reissue_params.rbi b/rbi/lithic/models/card_reissue_params.rbi new file mode 100644 index 00000000..18fd8c10 --- /dev/null +++ b/rbi/lithic/models/card_reissue_params.rbi @@ -0,0 +1,193 @@ +# typed: strong + +module Lithic + module Models + class CardReissueParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::CardReissueParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :card_token + + # If omitted, the previous carrier will be used. + sig { returns(T.nilable(Lithic::Carrier)) } + attr_reader :carrier + + sig { params(carrier: Lithic::Carrier::OrHash).void } + attr_writer :carrier + + # Specifies the configuration (e.g. physical card art) that the card should be + # manufactured with, and only applies to cards of type `PHYSICAL`. This must be + # configured with Lithic before use. + sig { returns(T.nilable(String)) } + attr_reader :product_id + + sig { params(product_id: String).void } + attr_writer :product_id + + # If omitted, the previous shipping address will be used. + sig { returns(T.nilable(Lithic::ShippingAddress)) } + attr_reader :shipping_address + + sig { params(shipping_address: Lithic::ShippingAddress::OrHash).void } + attr_writer :shipping_address + + # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of + # options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx or UPS depending on card manufacturer, Express, 3-day + # shipping, with tracking + # - `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with + # tracking + # - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight + # or similar international option, with tracking + # - `BULK` - Card will be shipped as part of a bulk fulfillment order. The + # shipping method and timeline are inherited from the parent bulk order. + sig do + returns(T.nilable(Lithic::CardReissueParams::ShippingMethod::OrSymbol)) + end + attr_reader :shipping_method + + sig do + params( + shipping_method: Lithic::CardReissueParams::ShippingMethod::OrSymbol + ).void + end + attr_writer :shipping_method + + sig do + params( + card_token: String, + carrier: Lithic::Carrier::OrHash, + product_id: String, + shipping_address: Lithic::ShippingAddress::OrHash, + shipping_method: Lithic::CardReissueParams::ShippingMethod::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + card_token:, + # If omitted, the previous carrier will be used. + carrier: nil, + # Specifies the configuration (e.g. physical card art) that the card should be + # manufactured with, and only applies to cards of type `PHYSICAL`. This must be + # configured with Lithic before use. + product_id: nil, + # If omitted, the previous shipping address will be used. + shipping_address: nil, + # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of + # options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx or UPS depending on card manufacturer, Express, 3-day + # shipping, with tracking + # - `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with + # tracking + # - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight + # or similar international option, with tracking + # - `BULK` - Card will be shipped as part of a bulk fulfillment order. The + # shipping method and timeline are inherited from the parent bulk order. + shipping_method: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + card_token: String, + carrier: Lithic::Carrier, + product_id: String, + shipping_address: Lithic::ShippingAddress, + shipping_method: + Lithic::CardReissueParams::ShippingMethod::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of + # options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx or UPS depending on card manufacturer, Express, 3-day + # shipping, with tracking + # - `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with + # tracking + # - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight + # or similar international option, with tracking + # - `BULK` - Card will be shipped as part of a bulk fulfillment order. The + # shipping method and timeline are inherited from the parent bulk order. + module ShippingMethod + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::CardReissueParams::ShippingMethod) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SHIPPING_METHOD_2_DAY = + T.let( + :"2_DAY", + Lithic::CardReissueParams::ShippingMethod::TaggedSymbol + ) + BULK = + T.let(:BULK, Lithic::CardReissueParams::ShippingMethod::TaggedSymbol) + EXPEDITED = + T.let( + :EXPEDITED, + Lithic::CardReissueParams::ShippingMethod::TaggedSymbol + ) + EXPRESS = + T.let( + :EXPRESS, + Lithic::CardReissueParams::ShippingMethod::TaggedSymbol + ) + PRIORITY = + T.let( + :PRIORITY, + Lithic::CardReissueParams::ShippingMethod::TaggedSymbol + ) + STANDARD = + T.let( + :STANDARD, + Lithic::CardReissueParams::ShippingMethod::TaggedSymbol + ) + STANDARD_WITH_TRACKING = + T.let( + :STANDARD_WITH_TRACKING, + Lithic::CardReissueParams::ShippingMethod::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::CardReissueParams::ShippingMethod::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/card_reissued_webhook_event.rbi b/rbi/lithic/models/card_reissued_webhook_event.rbi new file mode 100644 index 00000000..7ce6bf66 --- /dev/null +++ b/rbi/lithic/models/card_reissued_webhook_event.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Lithic + module Models + class CardReissuedWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::CardReissuedWebhookEvent, Lithic::Internal::AnyHash) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # The token of the card that was reissued. + sig { returns(T.nilable(String)) } + attr_reader :card_token + + sig { params(card_token: String).void } + attr_writer :card_token + + sig do + params(card_token: String, event_type: Symbol).returns(T.attached_class) + end + def self.new( + # The token of the card that was reissued. + card_token: nil, + # The type of event that occurred. + event_type: :"card.reissued" + ) + end + + sig { override.returns({ event_type: Symbol, card_token: String }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/card_renew_params.rbi b/rbi/lithic/models/card_renew_params.rbi new file mode 100644 index 00000000..ae1336b9 --- /dev/null +++ b/rbi/lithic/models/card_renew_params.rbi @@ -0,0 +1,216 @@ +# typed: strong + +module Lithic + module Models + class CardRenewParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::CardRenewParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :card_token + + # The shipping address this card will be sent to. + sig { returns(Lithic::ShippingAddress) } + attr_reader :shipping_address + + sig { params(shipping_address: Lithic::ShippingAddress::OrHash).void } + attr_writer :shipping_address + + # If omitted, the previous carrier will be used. + sig { returns(T.nilable(Lithic::Carrier)) } + attr_reader :carrier + + sig { params(carrier: Lithic::Carrier::OrHash).void } + attr_writer :carrier + + # Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, + # an expiration date five years in the future will be generated. Five years is the + # maximum expiration date. + sig { returns(T.nilable(String)) } + attr_reader :exp_month + + sig { params(exp_month: String).void } + attr_writer :exp_month + + # Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is + # provided, an expiration date five years in the future will be generated. Five + # years is the maximum expiration date. + sig { returns(T.nilable(String)) } + attr_reader :exp_year + + sig { params(exp_year: String).void } + attr_writer :exp_year + + # Specifies the configuration (e.g. physical card art) that the card should be + # manufactured with, and only applies to cards of type `PHYSICAL`. This must be + # configured with Lithic before use. + sig { returns(T.nilable(String)) } + attr_reader :product_id + + sig { params(product_id: String).void } + attr_writer :product_id + + # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of + # options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx or UPS depending on card manufacturer, Express, 3-day + # shipping, with tracking + # - `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with + # tracking + # - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight + # or similar international option, with tracking + # - `BULK` - Card will be shipped as part of a bulk fulfillment order. The + # shipping method and timeline are inherited from the parent bulk order. + sig do + returns(T.nilable(Lithic::CardRenewParams::ShippingMethod::OrSymbol)) + end + attr_reader :shipping_method + + sig do + params( + shipping_method: Lithic::CardRenewParams::ShippingMethod::OrSymbol + ).void + end + attr_writer :shipping_method + + sig do + params( + card_token: String, + shipping_address: Lithic::ShippingAddress::OrHash, + carrier: Lithic::Carrier::OrHash, + exp_month: String, + exp_year: String, + product_id: String, + shipping_method: Lithic::CardRenewParams::ShippingMethod::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + card_token:, + # The shipping address this card will be sent to. + shipping_address:, + # If omitted, the previous carrier will be used. + carrier: nil, + # Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, + # an expiration date five years in the future will be generated. Five years is the + # maximum expiration date. + exp_month: nil, + # Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is + # provided, an expiration date five years in the future will be generated. Five + # years is the maximum expiration date. + exp_year: nil, + # Specifies the configuration (e.g. physical card art) that the card should be + # manufactured with, and only applies to cards of type `PHYSICAL`. This must be + # configured with Lithic before use. + product_id: nil, + # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of + # options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx or UPS depending on card manufacturer, Express, 3-day + # shipping, with tracking + # - `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with + # tracking + # - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight + # or similar international option, with tracking + # - `BULK` - Card will be shipped as part of a bulk fulfillment order. The + # shipping method and timeline are inherited from the parent bulk order. + shipping_method: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + card_token: String, + shipping_address: Lithic::ShippingAddress, + carrier: Lithic::Carrier, + exp_month: String, + exp_year: String, + product_id: String, + shipping_method: Lithic::CardRenewParams::ShippingMethod::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of + # options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx or UPS depending on card manufacturer, Express, 3-day + # shipping, with tracking + # - `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with + # tracking + # - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight + # or similar international option, with tracking + # - `BULK` - Card will be shipped as part of a bulk fulfillment order. The + # shipping method and timeline are inherited from the parent bulk order. + module ShippingMethod + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::CardRenewParams::ShippingMethod) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SHIPPING_METHOD_2_DAY = + T.let(:"2_DAY", Lithic::CardRenewParams::ShippingMethod::TaggedSymbol) + BULK = + T.let(:BULK, Lithic::CardRenewParams::ShippingMethod::TaggedSymbol) + EXPEDITED = + T.let( + :EXPEDITED, + Lithic::CardRenewParams::ShippingMethod::TaggedSymbol + ) + EXPRESS = + T.let(:EXPRESS, Lithic::CardRenewParams::ShippingMethod::TaggedSymbol) + PRIORITY = + T.let( + :PRIORITY, + Lithic::CardRenewParams::ShippingMethod::TaggedSymbol + ) + STANDARD = + T.let( + :STANDARD, + Lithic::CardRenewParams::ShippingMethod::TaggedSymbol + ) + STANDARD_WITH_TRACKING = + T.let( + :STANDARD_WITH_TRACKING, + Lithic::CardRenewParams::ShippingMethod::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::CardRenewParams::ShippingMethod::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/card_renewed_webhook_event.rbi b/rbi/lithic/models/card_renewed_webhook_event.rbi new file mode 100644 index 00000000..22320f32 --- /dev/null +++ b/rbi/lithic/models/card_renewed_webhook_event.rbi @@ -0,0 +1,92 @@ +# typed: strong + +module Lithic + module Models + class CardRenewedWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::CardRenewedWebhookEvent, Lithic::Internal::AnyHash) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # The token of the card that was renewed. + sig { returns(T.nilable(String)) } + attr_reader :card_token + + sig { params(card_token: String).void } + attr_writer :card_token + + # The new expiration month of the card. + sig { returns(T.nilable(String)) } + attr_reader :exp_month + + sig { params(exp_month: String).void } + attr_writer :exp_month + + # The new expiration year of the card. + sig { returns(T.nilable(String)) } + attr_reader :exp_year + + sig { params(exp_year: String).void } + attr_writer :exp_year + + # The previous expiration month of the card. + sig { returns(T.nilable(String)) } + attr_reader :previous_exp_month + + sig { params(previous_exp_month: String).void } + attr_writer :previous_exp_month + + # The previous expiration year of the card. + sig { returns(T.nilable(String)) } + attr_reader :previous_exp_year + + sig { params(previous_exp_year: String).void } + attr_writer :previous_exp_year + + sig do + params( + card_token: String, + exp_month: String, + exp_year: String, + previous_exp_month: String, + previous_exp_year: String, + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The token of the card that was renewed. + card_token: nil, + # The new expiration month of the card. + exp_month: nil, + # The new expiration year of the card. + exp_year: nil, + # The previous expiration month of the card. + previous_exp_month: nil, + # The previous expiration year of the card. + previous_exp_year: nil, + # The type of event that occurred. + event_type: :"card.renewed" + ) + end + + sig do + override.returns( + { + event_type: Symbol, + card_token: String, + exp_month: String, + exp_year: String, + previous_exp_month: String, + previous_exp_year: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/card_retrieve_params.rbi b/rbi/lithic/models/card_retrieve_params.rbi new file mode 100644 index 00000000..9264bbc2 --- /dev/null +++ b/rbi/lithic/models/card_retrieve_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Lithic + module Models + class CardRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::CardRetrieveParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :card_token + + sig do + params( + card_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(card_token:, request_options: {}) + end + + sig do + override.returns( + { card_token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/card_retrieve_signals_params.rbi b/rbi/lithic/models/card_retrieve_signals_params.rbi new file mode 100644 index 00000000..223da171 --- /dev/null +++ b/rbi/lithic/models/card_retrieve_signals_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Lithic + module Models + class CardRetrieveSignalsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::CardRetrieveSignalsParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :card_token + + sig do + params( + card_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(card_token:, request_options: {}) + end + + sig do + override.returns( + { card_token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/card_retrieve_spend_limits_params.rbi b/rbi/lithic/models/card_retrieve_spend_limits_params.rbi new file mode 100644 index 00000000..a9730cee --- /dev/null +++ b/rbi/lithic/models/card_retrieve_spend_limits_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Lithic + module Models + class CardRetrieveSpendLimitsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::CardRetrieveSpendLimitsParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :card_token + + sig do + params( + card_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(card_token:, request_options: {}) + end + + sig do + override.returns( + { card_token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/card_search_by_pan_params.rbi b/rbi/lithic/models/card_search_by_pan_params.rbi new file mode 100644 index 00000000..c3c2cb35 --- /dev/null +++ b/rbi/lithic/models/card_search_by_pan_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module Lithic + module Models + class CardSearchByPanParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::CardSearchByPanParams, Lithic::Internal::AnyHash) + end + + # The PAN for the card being retrieved. + sig { returns(String) } + attr_accessor :pan + + sig do + params( + pan: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The PAN for the card being retrieved. + pan:, + request_options: {} + ) + end + + sig do + override.returns( + { pan: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/card_shipped_webhook_event.rbi b/rbi/lithic/models/card_shipped_webhook_event.rbi new file mode 100644 index 00000000..41bbbe53 --- /dev/null +++ b/rbi/lithic/models/card_shipped_webhook_event.rbi @@ -0,0 +1,150 @@ +# typed: strong + +module Lithic + module Models + class CardShippedWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::CardShippedWebhookEvent, Lithic::Internal::AnyHash) + end + + # The token of the bulk order associated with this card shipment, if applicable. + sig { returns(T.nilable(String)) } + attr_accessor :bulk_order_token + + # The token of the card that was shipped. + sig { returns(String) } + attr_accessor :card_token + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # The specific shipping method used to ship the card. + sig do + returns(Lithic::CardShippedWebhookEvent::ShippingMethod::TaggedSymbol) + end + attr_accessor :shipping_method + + # The tracking number of the shipment. + sig { returns(T.nilable(String)) } + attr_accessor :tracking_number + + sig do + params( + bulk_order_token: T.nilable(String), + card_token: String, + shipping_method: + Lithic::CardShippedWebhookEvent::ShippingMethod::OrSymbol, + tracking_number: T.nilable(String), + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The token of the bulk order associated with this card shipment, if applicable. + bulk_order_token:, + # The token of the card that was shipped. + card_token:, + # The specific shipping method used to ship the card. + shipping_method:, + # The tracking number of the shipment. + tracking_number:, + # The type of event that occurred. + event_type: :"card.shipped" + ) + end + + sig do + override.returns( + { + bulk_order_token: T.nilable(String), + card_token: String, + event_type: Symbol, + shipping_method: + Lithic::CardShippedWebhookEvent::ShippingMethod::TaggedSymbol, + tracking_number: T.nilable(String) + } + ) + end + def to_hash + end + + # The specific shipping method used to ship the card. + module ShippingMethod + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::CardShippedWebhookEvent::ShippingMethod) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EX_US_EXPEDITED_WITH_TRACKING = + T.let( + :"Ex-US expedited with tracking", + Lithic::CardShippedWebhookEvent::ShippingMethod::TaggedSymbol + ) + EX_US_STANDARD_WITH_TRACKING = + T.let( + :"Ex-US standard with tracking", + Lithic::CardShippedWebhookEvent::ShippingMethod::TaggedSymbol + ) + EX_US_STANDARD_WITHOUT_TRACKING = + T.let( + :"Ex-US standard without tracking", + Lithic::CardShippedWebhookEvent::ShippingMethod::TaggedSymbol + ) + FED_EX_2_DAYS = + T.let( + :"FedEx 2 days", + Lithic::CardShippedWebhookEvent::ShippingMethod::TaggedSymbol + ) + FED_EX_EXPRESS = + T.let( + :"FedEx express", + Lithic::CardShippedWebhookEvent::ShippingMethod::TaggedSymbol + ) + FED_EX_OVERNIGHT = + T.let( + :"FedEx overnight", + Lithic::CardShippedWebhookEvent::ShippingMethod::TaggedSymbol + ) + USPS_PRIORITY = + T.let( + :"USPS priority", + Lithic::CardShippedWebhookEvent::ShippingMethod::TaggedSymbol + ) + USPS_WITH_TRACKING = + T.let( + :"USPS with tracking", + Lithic::CardShippedWebhookEvent::ShippingMethod::TaggedSymbol + ) + USPS_WITHOUT_TRACKING_ENVELOPE = + T.let( + :"USPS without tracking envelope", + Lithic::CardShippedWebhookEvent::ShippingMethod::TaggedSymbol + ) + USPS_WITHOUT_TRACKING_ENVELOPE_NON_MACHINE = + T.let( + :"USPS without tracking envelope non-machine", + Lithic::CardShippedWebhookEvent::ShippingMethod::TaggedSymbol + ) + USPS_WITHOUT_TRACKING_FLAT = + T.let( + :"USPS without tracking flat", + Lithic::CardShippedWebhookEvent::ShippingMethod::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::CardShippedWebhookEvent::ShippingMethod::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/card_spend_limits.rbi b/rbi/lithic/models/card_spend_limits.rbi new file mode 100644 index 00000000..ad27ae70 --- /dev/null +++ b/rbi/lithic/models/card_spend_limits.rbi @@ -0,0 +1,242 @@ +# typed: strong + +module Lithic + module Models + class CardSpendLimits < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::CardSpendLimits, Lithic::Internal::AnyHash) + end + + sig { returns(Lithic::CardSpendLimits::AvailableSpendLimit) } + attr_reader :available_spend_limit + + sig do + params( + available_spend_limit: + Lithic::CardSpendLimits::AvailableSpendLimit::OrHash + ).void + end + attr_writer :available_spend_limit + + sig { returns(T.nilable(Lithic::CardSpendLimits::SpendLimit)) } + attr_reader :spend_limit + + sig do + params(spend_limit: Lithic::CardSpendLimits::SpendLimit::OrHash).void + end + attr_writer :spend_limit + + sig { returns(T.nilable(Lithic::CardSpendLimits::SpendVelocity)) } + attr_reader :spend_velocity + + sig do + params( + spend_velocity: Lithic::CardSpendLimits::SpendVelocity::OrHash + ).void + end + attr_writer :spend_velocity + + sig do + params( + available_spend_limit: + Lithic::CardSpendLimits::AvailableSpendLimit::OrHash, + spend_limit: Lithic::CardSpendLimits::SpendLimit::OrHash, + spend_velocity: Lithic::CardSpendLimits::SpendVelocity::OrHash + ).returns(T.attached_class) + end + def self.new( + available_spend_limit:, + spend_limit: nil, + spend_velocity: nil + ) + end + + sig do + override.returns( + { + available_spend_limit: Lithic::CardSpendLimits::AvailableSpendLimit, + spend_limit: Lithic::CardSpendLimits::SpendLimit, + spend_velocity: Lithic::CardSpendLimits::SpendVelocity + } + ) + end + def to_hash + end + + class AvailableSpendLimit < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::CardSpendLimits::AvailableSpendLimit, + Lithic::Internal::AnyHash + ) + end + + # The available spend limit (in cents) relative to the annual limit configured on + # the Card (e.g. 100000 would be a $1,000 limit). + sig { returns(T.nilable(Integer)) } + attr_reader :annually + + sig { params(annually: Integer).void } + attr_writer :annually + + # The available spend limit (in cents) relative to the forever limit configured on + # the Card. + sig { returns(T.nilable(Integer)) } + attr_reader :forever + + sig { params(forever: Integer).void } + attr_writer :forever + + # The available spend limit (in cents) relative to the monthly limit configured on + # the Card. + sig { returns(T.nilable(Integer)) } + attr_reader :monthly + + sig { params(monthly: Integer).void } + attr_writer :monthly + + sig do + params(annually: Integer, forever: Integer, monthly: Integer).returns( + T.attached_class + ) + end + def self.new( + # The available spend limit (in cents) relative to the annual limit configured on + # the Card (e.g. 100000 would be a $1,000 limit). + annually: nil, + # The available spend limit (in cents) relative to the forever limit configured on + # the Card. + forever: nil, + # The available spend limit (in cents) relative to the monthly limit configured on + # the Card. + monthly: nil + ) + end + + sig do + override.returns( + { annually: Integer, forever: Integer, monthly: Integer } + ) + end + def to_hash + end + end + + class SpendLimit < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::CardSpendLimits::SpendLimit, + Lithic::Internal::AnyHash + ) + end + + # The configured annual spend limit (in cents) on the Card. + sig { returns(T.nilable(Integer)) } + attr_reader :annually + + sig { params(annually: Integer).void } + attr_writer :annually + + # The configured forever spend limit (in cents) on the Card. + sig { returns(T.nilable(Integer)) } + attr_reader :forever + + sig { params(forever: Integer).void } + attr_writer :forever + + # The configured monthly spend limit (in cents) on the Card. + sig { returns(T.nilable(Integer)) } + attr_reader :monthly + + sig { params(monthly: Integer).void } + attr_writer :monthly + + sig do + params(annually: Integer, forever: Integer, monthly: Integer).returns( + T.attached_class + ) + end + def self.new( + # The configured annual spend limit (in cents) on the Card. + annually: nil, + # The configured forever spend limit (in cents) on the Card. + forever: nil, + # The configured monthly spend limit (in cents) on the Card. + monthly: nil + ) + end + + sig do + override.returns( + { annually: Integer, forever: Integer, monthly: Integer } + ) + end + def to_hash + end + end + + class SpendVelocity < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::CardSpendLimits::SpendVelocity, + Lithic::Internal::AnyHash + ) + end + + # Current annual spend velocity (in cents) on the Card. Present if annual spend + # limit is set. + sig { returns(T.nilable(Integer)) } + attr_reader :annually + + sig { params(annually: Integer).void } + attr_writer :annually + + # Current forever spend velocity (in cents) on the Card. Present if forever spend + # limit is set. + sig { returns(T.nilable(Integer)) } + attr_reader :forever + + sig { params(forever: Integer).void } + attr_writer :forever + + # Current monthly spend velocity (in cents) on the Card. Present if monthly spend + # limit is set. + sig { returns(T.nilable(Integer)) } + attr_reader :monthly + + sig { params(monthly: Integer).void } + attr_writer :monthly + + sig do + params(annually: Integer, forever: Integer, monthly: Integer).returns( + T.attached_class + ) + end + def self.new( + # Current annual spend velocity (in cents) on the Card. Present if annual spend + # limit is set. + annually: nil, + # Current forever spend velocity (in cents) on the Card. Present if forever spend + # limit is set. + forever: nil, + # Current monthly spend velocity (in cents) on the Card. Present if monthly spend + # limit is set. + monthly: nil + ) + end + + sig do + override.returns( + { annually: Integer, forever: Integer, monthly: Integer } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/card_transaction_enhanced_data_created_webhook_event.rbi b/rbi/lithic/models/card_transaction_enhanced_data_created_webhook_event.rbi new file mode 100644 index 00000000..386a934b --- /dev/null +++ b/rbi/lithic/models/card_transaction_enhanced_data_created_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class CardTransactionEnhancedDataCreatedWebhookEvent < Lithic::Models::Transactions::Events::EnhancedData + OrHash = + T.type_alias do + T.any( + Lithic::CardTransactionEnhancedDataCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"card_transaction.enhanced_data.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/card_transaction_enhanced_data_updated_webhook_event.rbi b/rbi/lithic/models/card_transaction_enhanced_data_updated_webhook_event.rbi new file mode 100644 index 00000000..db3945ed --- /dev/null +++ b/rbi/lithic/models/card_transaction_enhanced_data_updated_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class CardTransactionEnhancedDataUpdatedWebhookEvent < Lithic::Models::Transactions::Events::EnhancedData + OrHash = + T.type_alias do + T.any( + Lithic::CardTransactionEnhancedDataUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"card_transaction.enhanced_data.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/card_transaction_updated_webhook_event.rbi b/rbi/lithic/models/card_transaction_updated_webhook_event.rbi new file mode 100644 index 00000000..f407237c --- /dev/null +++ b/rbi/lithic/models/card_transaction_updated_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class CardTransactionUpdatedWebhookEvent < Lithic::Models::Transaction + OrHash = + T.type_alias do + T.any( + Lithic::CardTransactionUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"card_transaction.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/card_update_params.rbi b/rbi/lithic/models/card_update_params.rbi new file mode 100644 index 00000000..9e78807b --- /dev/null +++ b/rbi/lithic/models/card_update_params.rbi @@ -0,0 +1,394 @@ +# typed: strong + +module Lithic + module Models + class CardUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::CardUpdateParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :card_token + + # Additional context or information related to the card. + sig { returns(T.nilable(String)) } + attr_reader :comment + + sig { params(comment: String).void } + attr_writer :comment + + # Specifies the digital card art to be displayed in the user’s digital wallet + # after tokenization. This artwork must be approved by Mastercard and configured + # by Lithic to use. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + sig { returns(T.nilable(String)) } + attr_reader :digital_card_art_token + + sig { params(digital_card_art_token: String).void } + attr_writer :digital_card_art_token + + # Friendly name to identify the card. + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + # Globally unique identifier for the card's network program. Currently applicable + # to Visa cards participating in Account Level Management only. + sig { returns(T.nilable(String)) } + attr_reader :network_program_token + + sig { params(network_program_token: String).void } + attr_writer :network_program_token + + # Encrypted PIN block (in base64). Only applies to cards of type `PHYSICAL` and + # `VIRTUAL`. Changing PIN also resets PIN status to `OK`. See + # [Encrypted PIN Block](https://docs.lithic.com/docs/cards#encrypted-pin-block). + sig { returns(T.nilable(String)) } + attr_reader :pin + + sig { params(pin: String).void } + attr_writer :pin + + # Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect + # attempts). Can only be set to `OK` to unblock a card. + sig { returns(T.nilable(Lithic::CardUpdateParams::PinStatus::OrSymbol)) } + attr_reader :pin_status + + sig do + params(pin_status: Lithic::CardUpdateParams::PinStatus::OrSymbol).void + end + attr_writer :pin_status + + # Amount (in cents) to limit approved authorizations (e.g. 100000 would be a + # $1,000 limit). Transaction requests above the spend limit will be declined. Note + # that a spend limit of 0 is effectively no limit, and should only be used to + # reset or remove a prior limit. Only a limit of 1 or above will result in + # declined transactions due to checks against the card limit. + sig { returns(T.nilable(Integer)) } + attr_reader :spend_limit + + sig { params(spend_limit: Integer).void } + attr_writer :spend_limit + + # Spend limit duration values: + # + # - `ANNUALLY` - Card will authorize transactions up to spend limit for the + # trailing year. + # - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime + # of the card. + # - `MONTHLY` - Card will authorize transactions up to spend limit for the + # trailing month. To support recurring monthly payments, which can occur on + # different day every month, the time window we consider for monthly velocity + # starts 6 days after the current calendar date one month prior. + # - `TRANSACTION` - Card will authorize multiple transactions if each individual + # transaction is under the spend limit. + sig { returns(T.nilable(Lithic::SpendLimitDuration::OrSymbol)) } + attr_reader :spend_limit_duration + + sig do + params(spend_limit_duration: Lithic::SpendLimitDuration::OrSymbol).void + end + attr_writer :spend_limit_duration + + # Card state values: + # + # - `CLOSED` - Card will no longer approve authorizations. Closing a card cannot + # be undone. + # - `OPEN` - Card will approve authorizations (if they match card and account + # parameters). + # - `PAUSED` - Card will decline authorizations, but can be resumed at a later + # time. + sig { returns(T.nilable(Lithic::CardUpdateParams::State::OrSymbol)) } + attr_reader :state + + sig { params(state: Lithic::CardUpdateParams::State::OrSymbol).void } + attr_writer :state + + # Card state substatus values: + # + # - `LOST` - The physical card is no longer in the cardholder's possession due to + # being lost or never received by the cardholder. + # - `COMPROMISED` - Card information has been exposed, potentially leading to + # unauthorized access. This may involve physical card theft, cloning, or online + # data breaches. + # - `DAMAGED` - The physical card is not functioning properly, such as having chip + # failures or a demagnetized magnetic stripe. + # - `END_USER_REQUEST` - The cardholder requested the closure of the card for + # reasons unrelated to fraud or damage, such as switching to a different product + # or closing the account. + # - `ISSUER_REQUEST` - The issuer closed the card for reasons unrelated to fraud + # or damage, such as account inactivity, product or policy changes, or + # technology upgrades. + # - `NOT_ACTIVE` - The card hasn’t had any transaction activity for a specified + # period, applicable to statuses like `PAUSED` or `CLOSED`. + # - `SUSPICIOUS_ACTIVITY` - The card has one or more suspicious transactions or + # activities that require review. This can involve prompting the cardholder to + # confirm legitimate use or report confirmed fraud. + # - `INTERNAL_REVIEW` - The card is temporarily paused pending further internal + # review. + # - `EXPIRED` - The card has expired and has been closed without being reissued. + # - `UNDELIVERABLE` - The card cannot be delivered to the cardholder and has been + # returned. + # - `OTHER` - The reason for the status does not fall into any of the above + # categories. A comment should be provided to specify the reason. + sig { returns(T.nilable(Lithic::CardUpdateParams::Substatus::OrSymbol)) } + attr_reader :substatus + + sig do + params(substatus: Lithic::CardUpdateParams::Substatus::OrSymbol).void + end + attr_writer :substatus + + sig do + params( + card_token: String, + comment: String, + digital_card_art_token: String, + memo: String, + network_program_token: String, + pin: String, + pin_status: Lithic::CardUpdateParams::PinStatus::OrSymbol, + spend_limit: Integer, + spend_limit_duration: Lithic::SpendLimitDuration::OrSymbol, + state: Lithic::CardUpdateParams::State::OrSymbol, + substatus: Lithic::CardUpdateParams::Substatus::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + card_token:, + # Additional context or information related to the card. + comment: nil, + # Specifies the digital card art to be displayed in the user’s digital wallet + # after tokenization. This artwork must be approved by Mastercard and configured + # by Lithic to use. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + digital_card_art_token: nil, + # Friendly name to identify the card. + memo: nil, + # Globally unique identifier for the card's network program. Currently applicable + # to Visa cards participating in Account Level Management only. + network_program_token: nil, + # Encrypted PIN block (in base64). Only applies to cards of type `PHYSICAL` and + # `VIRTUAL`. Changing PIN also resets PIN status to `OK`. See + # [Encrypted PIN Block](https://docs.lithic.com/docs/cards#encrypted-pin-block). + pin: nil, + # Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect + # attempts). Can only be set to `OK` to unblock a card. + pin_status: nil, + # Amount (in cents) to limit approved authorizations (e.g. 100000 would be a + # $1,000 limit). Transaction requests above the spend limit will be declined. Note + # that a spend limit of 0 is effectively no limit, and should only be used to + # reset or remove a prior limit. Only a limit of 1 or above will result in + # declined transactions due to checks against the card limit. + spend_limit: nil, + # Spend limit duration values: + # + # - `ANNUALLY` - Card will authorize transactions up to spend limit for the + # trailing year. + # - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime + # of the card. + # - `MONTHLY` - Card will authorize transactions up to spend limit for the + # trailing month. To support recurring monthly payments, which can occur on + # different day every month, the time window we consider for monthly velocity + # starts 6 days after the current calendar date one month prior. + # - `TRANSACTION` - Card will authorize multiple transactions if each individual + # transaction is under the spend limit. + spend_limit_duration: nil, + # Card state values: + # + # - `CLOSED` - Card will no longer approve authorizations. Closing a card cannot + # be undone. + # - `OPEN` - Card will approve authorizations (if they match card and account + # parameters). + # - `PAUSED` - Card will decline authorizations, but can be resumed at a later + # time. + state: nil, + # Card state substatus values: + # + # - `LOST` - The physical card is no longer in the cardholder's possession due to + # being lost or never received by the cardholder. + # - `COMPROMISED` - Card information has been exposed, potentially leading to + # unauthorized access. This may involve physical card theft, cloning, or online + # data breaches. + # - `DAMAGED` - The physical card is not functioning properly, such as having chip + # failures or a demagnetized magnetic stripe. + # - `END_USER_REQUEST` - The cardholder requested the closure of the card for + # reasons unrelated to fraud or damage, such as switching to a different product + # or closing the account. + # - `ISSUER_REQUEST` - The issuer closed the card for reasons unrelated to fraud + # or damage, such as account inactivity, product or policy changes, or + # technology upgrades. + # - `NOT_ACTIVE` - The card hasn’t had any transaction activity for a specified + # period, applicable to statuses like `PAUSED` or `CLOSED`. + # - `SUSPICIOUS_ACTIVITY` - The card has one or more suspicious transactions or + # activities that require review. This can involve prompting the cardholder to + # confirm legitimate use or report confirmed fraud. + # - `INTERNAL_REVIEW` - The card is temporarily paused pending further internal + # review. + # - `EXPIRED` - The card has expired and has been closed without being reissued. + # - `UNDELIVERABLE` - The card cannot be delivered to the cardholder and has been + # returned. + # - `OTHER` - The reason for the status does not fall into any of the above + # categories. A comment should be provided to specify the reason. + substatus: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + card_token: String, + comment: String, + digital_card_art_token: String, + memo: String, + network_program_token: String, + pin: String, + pin_status: Lithic::CardUpdateParams::PinStatus::OrSymbol, + spend_limit: Integer, + spend_limit_duration: Lithic::SpendLimitDuration::OrSymbol, + state: Lithic::CardUpdateParams::State::OrSymbol, + substatus: Lithic::CardUpdateParams::Substatus::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect + # attempts). Can only be set to `OK` to unblock a card. + module PinStatus + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::CardUpdateParams::PinStatus) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + OK = T.let(:OK, Lithic::CardUpdateParams::PinStatus::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::CardUpdateParams::PinStatus::TaggedSymbol] + ) + end + def self.values + end + end + + # Card state values: + # + # - `CLOSED` - Card will no longer approve authorizations. Closing a card cannot + # be undone. + # - `OPEN` - Card will approve authorizations (if they match card and account + # parameters). + # - `PAUSED` - Card will decline authorizations, but can be resumed at a later + # time. + module State + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::CardUpdateParams::State) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CLOSED = T.let(:CLOSED, Lithic::CardUpdateParams::State::TaggedSymbol) + OPEN = T.let(:OPEN, Lithic::CardUpdateParams::State::TaggedSymbol) + PAUSED = T.let(:PAUSED, Lithic::CardUpdateParams::State::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::CardUpdateParams::State::TaggedSymbol] + ) + end + def self.values + end + end + + # Card state substatus values: + # + # - `LOST` - The physical card is no longer in the cardholder's possession due to + # being lost or never received by the cardholder. + # - `COMPROMISED` - Card information has been exposed, potentially leading to + # unauthorized access. This may involve physical card theft, cloning, or online + # data breaches. + # - `DAMAGED` - The physical card is not functioning properly, such as having chip + # failures or a demagnetized magnetic stripe. + # - `END_USER_REQUEST` - The cardholder requested the closure of the card for + # reasons unrelated to fraud or damage, such as switching to a different product + # or closing the account. + # - `ISSUER_REQUEST` - The issuer closed the card for reasons unrelated to fraud + # or damage, such as account inactivity, product or policy changes, or + # technology upgrades. + # - `NOT_ACTIVE` - The card hasn’t had any transaction activity for a specified + # period, applicable to statuses like `PAUSED` or `CLOSED`. + # - `SUSPICIOUS_ACTIVITY` - The card has one or more suspicious transactions or + # activities that require review. This can involve prompting the cardholder to + # confirm legitimate use or report confirmed fraud. + # - `INTERNAL_REVIEW` - The card is temporarily paused pending further internal + # review. + # - `EXPIRED` - The card has expired and has been closed without being reissued. + # - `UNDELIVERABLE` - The card cannot be delivered to the cardholder and has been + # returned. + # - `OTHER` - The reason for the status does not fall into any of the above + # categories. A comment should be provided to specify the reason. + module Substatus + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::CardUpdateParams::Substatus) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LOST = T.let(:LOST, Lithic::CardUpdateParams::Substatus::TaggedSymbol) + COMPROMISED = + T.let(:COMPROMISED, Lithic::CardUpdateParams::Substatus::TaggedSymbol) + DAMAGED = + T.let(:DAMAGED, Lithic::CardUpdateParams::Substatus::TaggedSymbol) + END_USER_REQUEST = + T.let( + :END_USER_REQUEST, + Lithic::CardUpdateParams::Substatus::TaggedSymbol + ) + ISSUER_REQUEST = + T.let( + :ISSUER_REQUEST, + Lithic::CardUpdateParams::Substatus::TaggedSymbol + ) + NOT_ACTIVE = + T.let(:NOT_ACTIVE, Lithic::CardUpdateParams::Substatus::TaggedSymbol) + SUSPICIOUS_ACTIVITY = + T.let( + :SUSPICIOUS_ACTIVITY, + Lithic::CardUpdateParams::Substatus::TaggedSymbol + ) + INTERNAL_REVIEW = + T.let( + :INTERNAL_REVIEW, + Lithic::CardUpdateParams::Substatus::TaggedSymbol + ) + EXPIRED = + T.let(:EXPIRED, Lithic::CardUpdateParams::Substatus::TaggedSymbol) + UNDELIVERABLE = + T.let( + :UNDELIVERABLE, + Lithic::CardUpdateParams::Substatus::TaggedSymbol + ) + OTHER = T.let(:OTHER, Lithic::CardUpdateParams::Substatus::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::CardUpdateParams::Substatus::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/card_updated_webhook_event.rbi b/rbi/lithic/models/card_updated_webhook_event.rbi new file mode 100644 index 00000000..70172f3c --- /dev/null +++ b/rbi/lithic/models/card_updated_webhook_event.rbi @@ -0,0 +1,61 @@ +# typed: strong + +module Lithic + module Models + class CardUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::CardUpdatedWebhookEvent, Lithic::Internal::AnyHash) + end + + # The token of the card that was updated. + sig { returns(String) } + attr_accessor :card_token + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # The previous values of the fields that were updated. + sig { returns(T.anything) } + attr_accessor :previous_fields + + # The current state of the card. + sig { returns(String) } + attr_accessor :state + + sig do + params( + card_token: String, + previous_fields: T.anything, + state: String, + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # The token of the card that was updated. + card_token:, + # The previous values of the fields that were updated. + previous_fields:, + # The current state of the card. + state:, + # The type of event that occurred. + event_type: :"card.updated" + ) + end + + sig do + override.returns( + { + card_token: String, + event_type: Symbol, + previous_fields: T.anything, + state: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/card_web_provision_params.rbi b/rbi/lithic/models/card_web_provision_params.rbi new file mode 100644 index 00000000..607098cb --- /dev/null +++ b/rbi/lithic/models/card_web_provision_params.rbi @@ -0,0 +1,134 @@ +# typed: strong + +module Lithic + module Models + class CardWebProvisionParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::CardWebProvisionParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :card_token + + # Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push + # Provisioning device identifier required for the tokenization flow + sig { returns(T.nilable(String)) } + attr_reader :client_device_id + + sig { params(client_device_id: String).void } + attr_writer :client_device_id + + # Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push + # Provisioning wallet account identifier required for the tokenization flow + sig { returns(T.nilable(String)) } + attr_reader :client_wallet_account_id + + sig { params(client_wallet_account_id: String).void } + attr_writer :client_wallet_account_id + + # Name of digital wallet provider. + sig do + returns( + T.nilable(Lithic::CardWebProvisionParams::DigitalWallet::OrSymbol) + ) + end + attr_reader :digital_wallet + + sig do + params( + digital_wallet: + Lithic::CardWebProvisionParams::DigitalWallet::OrSymbol + ).void + end + attr_writer :digital_wallet + + # Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push + # Provisioning session identifier required for the FPAN flow. + sig { returns(T.nilable(String)) } + attr_reader :server_session_id + + sig { params(server_session_id: String).void } + attr_writer :server_session_id + + sig do + params( + card_token: String, + client_device_id: String, + client_wallet_account_id: String, + digital_wallet: + Lithic::CardWebProvisionParams::DigitalWallet::OrSymbol, + server_session_id: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + card_token:, + # Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push + # Provisioning device identifier required for the tokenization flow + client_device_id: nil, + # Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push + # Provisioning wallet account identifier required for the tokenization flow + client_wallet_account_id: nil, + # Name of digital wallet provider. + digital_wallet: nil, + # Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push + # Provisioning session identifier required for the FPAN flow. + server_session_id: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + card_token: String, + client_device_id: String, + client_wallet_account_id: String, + digital_wallet: + Lithic::CardWebProvisionParams::DigitalWallet::OrSymbol, + server_session_id: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Name of digital wallet provider. + module DigitalWallet + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::CardWebProvisionParams::DigitalWallet) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPLE_PAY = + T.let( + :APPLE_PAY, + Lithic::CardWebProvisionParams::DigitalWallet::TaggedSymbol + ) + GOOGLE_PAY = + T.let( + :GOOGLE_PAY, + Lithic::CardWebProvisionParams::DigitalWallet::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::CardWebProvisionParams::DigitalWallet::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/card_web_provision_response.rbi b/rbi/lithic/models/card_web_provision_response.rbi new file mode 100644 index 00000000..ad66b2d1 --- /dev/null +++ b/rbi/lithic/models/card_web_provision_response.rbi @@ -0,0 +1,244 @@ +# typed: strong + +module Lithic + module Models + module CardWebProvisionResponse + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse, + Lithic::Models::CardWebProvisionResponse::GoogleWebPushProvisioningResponse + ) + end + + class AppleWebPushProvisioningResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse, + Lithic::Internal::AnyHash + ) + end + + # JWS object required for handoff to Apple's script. + sig do + returns( + Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws + ) + end + attr_reader :jws + + sig do + params( + jws: + Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws::OrHash + ).void + end + attr_writer :jws + + # A unique identifier for the JWS object. + sig { returns(String) } + attr_accessor :state + + sig do + params( + jws: + Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws::OrHash, + state: String + ).returns(T.attached_class) + end + def self.new( + # JWS object required for handoff to Apple's script. + jws:, + # A unique identifier for the JWS object. + state: + ) + end + + sig do + override.returns( + { + jws: + Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws, + state: String + } + ) + end + def to_hash + end + + class Jws < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws, + Lithic::Internal::AnyHash + ) + end + + # JWS unprotected headers containing header parameters that aren't + # integrity-protected by the JWS signature. + sig do + returns( + T.nilable( + Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws::Header + ) + ) + end + attr_reader :header + + sig do + params( + header: + Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws::Header::OrHash + ).void + end + attr_writer :header + + # Base64url encoded JSON object containing the provisioning payload. + sig { returns(T.nilable(String)) } + attr_reader :payload + + sig { params(payload: String).void } + attr_writer :payload + + # Base64url encoded JWS protected headers containing the header parameters that + # are integrity-protected by the JWS signature. + sig { returns(T.nilable(String)) } + attr_reader :protected + + sig { params(protected: String).void } + attr_writer :protected + + # Base64url encoded signature of the JWS object. + sig { returns(T.nilable(String)) } + attr_reader :signature + + sig { params(signature: String).void } + attr_writer :signature + + # JWS object required for handoff to Apple's script. + sig do + params( + header: + Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws::Header::OrHash, + payload: String, + protected: String, + signature: String + ).returns(T.attached_class) + end + def self.new( + # JWS unprotected headers containing header parameters that aren't + # integrity-protected by the JWS signature. + header: nil, + # Base64url encoded JSON object containing the provisioning payload. + payload: nil, + # Base64url encoded JWS protected headers containing the header parameters that + # are integrity-protected by the JWS signature. + protected: nil, + # Base64url encoded signature of the JWS object. + signature: nil + ) + end + + sig do + override.returns( + { + header: + Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws::Header, + payload: String, + protected: String, + signature: String + } + ) + end + def to_hash + end + + class Header < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws::Header, + Lithic::Internal::AnyHash + ) + end + + # The ID for the JWS Public Key of the key pair used to generate the signature. + sig { returns(T.nilable(String)) } + attr_reader :kid + + sig { params(kid: String).void } + attr_writer :kid + + # JWS unprotected headers containing header parameters that aren't + # integrity-protected by the JWS signature. + sig { params(kid: String).returns(T.attached_class) } + def self.new( + # The ID for the JWS Public Key of the key pair used to generate the signature. + kid: nil + ) + end + + sig { override.returns({ kid: String }) } + def to_hash + end + end + end + end + + class GoogleWebPushProvisioningResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::CardWebProvisionResponse::GoogleWebPushProvisioningResponse, + Lithic::Internal::AnyHash + ) + end + + # A base64 encoded and encrypted payload representing card data for the Google Pay + # UWPP FPAN flow. + sig { returns(T.nilable(String)) } + attr_reader :google_opc + + sig { params(google_opc: String).void } + attr_writer :google_opc + + # A base64 encoded and encrypted payload representing card data for the Google Pay + # UWPP tokenization flow. + sig { returns(T.nilable(String)) } + attr_reader :tsp_opc + + sig { params(tsp_opc: String).void } + attr_writer :tsp_opc + + sig do + params(google_opc: String, tsp_opc: String).returns(T.attached_class) + end + def self.new( + # A base64 encoded and encrypted payload representing card data for the Google Pay + # UWPP FPAN flow. + google_opc: nil, + # A base64 encoded and encrypted payload representing card data for the Google Pay + # UWPP tokenization flow. + tsp_opc: nil + ) + end + + sig { override.returns({ google_opc: String, tsp_opc: String }) } + def to_hash + end + end + + sig do + override.returns( + T::Array[Lithic::Models::CardWebProvisionResponse::Variants] + ) + end + def self.variants + end + end + end +end diff --git a/rbi/lithic/models/cardholder_authentication.rbi b/rbi/lithic/models/cardholder_authentication.rbi new file mode 100644 index 00000000..49bb6fa8 --- /dev/null +++ b/rbi/lithic/models/cardholder_authentication.rbi @@ -0,0 +1,296 @@ +# typed: strong + +module Lithic + module Models + class CardholderAuthentication < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::CardholderAuthentication, Lithic::Internal::AnyHash) + end + + # Indicates the method used to authenticate the cardholder. + sig do + returns( + Lithic::CardholderAuthentication::AuthenticationMethod::TaggedSymbol + ) + end + attr_accessor :authentication_method + + # Indicates the outcome of the 3DS authentication process. + sig do + returns( + Lithic::CardholderAuthentication::AuthenticationResult::TaggedSymbol + ) + end + attr_accessor :authentication_result + + # Indicates which party made the 3DS authentication decision. + sig do + returns(Lithic::CardholderAuthentication::DecisionMadeBy::TaggedSymbol) + end + attr_accessor :decision_made_by + + # Indicates whether chargeback liability shift applies to the transaction. + # Possible enum values: + # + # - `3DS_AUTHENTICATED`: The transaction was fully authenticated through a 3-D + # Secure flow, chargeback liability shift applies. + # - `NONE`: Chargeback liability shift has not shifted to the issuer, i.e. the + # merchant is liable. + # - `TOKEN_AUTHENTICATED`: The transaction was a tokenized payment with validated + # cryptography, possibly recurring. Chargeback liability shift to the issuer + # applies. + sig do + returns(Lithic::CardholderAuthentication::LiabilityShift::TaggedSymbol) + end + attr_accessor :liability_shift + + # Unique identifier you can use to match a given 3DS authentication (available via + # the three_ds_authentication.created event webhook) and the transaction. Note + # that in cases where liability shift does not occur, this token is matched to the + # transaction on a best-effort basis. + sig { returns(T.nilable(String)) } + attr_accessor :three_ds_authentication_token + + sig do + params( + authentication_method: + Lithic::CardholderAuthentication::AuthenticationMethod::OrSymbol, + authentication_result: + Lithic::CardholderAuthentication::AuthenticationResult::OrSymbol, + decision_made_by: + Lithic::CardholderAuthentication::DecisionMadeBy::OrSymbol, + liability_shift: + Lithic::CardholderAuthentication::LiabilityShift::OrSymbol, + three_ds_authentication_token: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Indicates the method used to authenticate the cardholder. + authentication_method:, + # Indicates the outcome of the 3DS authentication process. + authentication_result:, + # Indicates which party made the 3DS authentication decision. + decision_made_by:, + # Indicates whether chargeback liability shift applies to the transaction. + # Possible enum values: + # + # - `3DS_AUTHENTICATED`: The transaction was fully authenticated through a 3-D + # Secure flow, chargeback liability shift applies. + # - `NONE`: Chargeback liability shift has not shifted to the issuer, i.e. the + # merchant is liable. + # - `TOKEN_AUTHENTICATED`: The transaction was a tokenized payment with validated + # cryptography, possibly recurring. Chargeback liability shift to the issuer + # applies. + liability_shift:, + # Unique identifier you can use to match a given 3DS authentication (available via + # the three_ds_authentication.created event webhook) and the transaction. Note + # that in cases where liability shift does not occur, this token is matched to the + # transaction on a best-effort basis. + three_ds_authentication_token: + ) + end + + sig do + override.returns( + { + authentication_method: + Lithic::CardholderAuthentication::AuthenticationMethod::TaggedSymbol, + authentication_result: + Lithic::CardholderAuthentication::AuthenticationResult::TaggedSymbol, + decision_made_by: + Lithic::CardholderAuthentication::DecisionMadeBy::TaggedSymbol, + liability_shift: + Lithic::CardholderAuthentication::LiabilityShift::TaggedSymbol, + three_ds_authentication_token: T.nilable(String) + } + ) + end + def to_hash + end + + # Indicates the method used to authenticate the cardholder. + module AuthenticationMethod + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::CardholderAuthentication::AuthenticationMethod + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FRICTIONLESS = + T.let( + :FRICTIONLESS, + Lithic::CardholderAuthentication::AuthenticationMethod::TaggedSymbol + ) + CHALLENGE = + T.let( + :CHALLENGE, + Lithic::CardholderAuthentication::AuthenticationMethod::TaggedSymbol + ) + NONE = + T.let( + :NONE, + Lithic::CardholderAuthentication::AuthenticationMethod::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::CardholderAuthentication::AuthenticationMethod::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Indicates the outcome of the 3DS authentication process. + module AuthenticationResult + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::CardholderAuthentication::AuthenticationResult + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ATTEMPTS = + T.let( + :ATTEMPTS, + Lithic::CardholderAuthentication::AuthenticationResult::TaggedSymbol + ) + DECLINE = + T.let( + :DECLINE, + Lithic::CardholderAuthentication::AuthenticationResult::TaggedSymbol + ) + NONE = + T.let( + :NONE, + Lithic::CardholderAuthentication::AuthenticationResult::TaggedSymbol + ) + SUCCESS = + T.let( + :SUCCESS, + Lithic::CardholderAuthentication::AuthenticationResult::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::CardholderAuthentication::AuthenticationResult::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Indicates which party made the 3DS authentication decision. + module DecisionMadeBy + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::CardholderAuthentication::DecisionMadeBy) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CUSTOMER_RULES = + T.let( + :CUSTOMER_RULES, + Lithic::CardholderAuthentication::DecisionMadeBy::TaggedSymbol + ) + CUSTOMER_ENDPOINT = + T.let( + :CUSTOMER_ENDPOINT, + Lithic::CardholderAuthentication::DecisionMadeBy::TaggedSymbol + ) + LITHIC_DEFAULT = + T.let( + :LITHIC_DEFAULT, + Lithic::CardholderAuthentication::DecisionMadeBy::TaggedSymbol + ) + LITHIC_RULES = + T.let( + :LITHIC_RULES, + Lithic::CardholderAuthentication::DecisionMadeBy::TaggedSymbol + ) + NETWORK = + T.let( + :NETWORK, + Lithic::CardholderAuthentication::DecisionMadeBy::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::CardholderAuthentication::DecisionMadeBy::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::CardholderAuthentication::DecisionMadeBy::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Indicates whether chargeback liability shift applies to the transaction. + # Possible enum values: + # + # - `3DS_AUTHENTICATED`: The transaction was fully authenticated through a 3-D + # Secure flow, chargeback liability shift applies. + # - `NONE`: Chargeback liability shift has not shifted to the issuer, i.e. the + # merchant is liable. + # - `TOKEN_AUTHENTICATED`: The transaction was a tokenized payment with validated + # cryptography, possibly recurring. Chargeback liability shift to the issuer + # applies. + module LiabilityShift + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::CardholderAuthentication::LiabilityShift) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LIABILITY_SHIFT_3DS_AUTHENTICATED = + T.let( + :"3DS_AUTHENTICATED", + Lithic::CardholderAuthentication::LiabilityShift::TaggedSymbol + ) + TOKEN_AUTHENTICATED = + T.let( + :TOKEN_AUTHENTICATED, + Lithic::CardholderAuthentication::LiabilityShift::TaggedSymbol + ) + NONE = + T.let( + :NONE, + Lithic::CardholderAuthentication::LiabilityShift::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::CardholderAuthentication::LiabilityShift::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/cards/balance_list_params.rbi b/rbi/lithic/models/cards/balance_list_params.rbi new file mode 100644 index 00000000..26bff410 --- /dev/null +++ b/rbi/lithic/models/cards/balance_list_params.rbi @@ -0,0 +1,69 @@ +# typed: strong + +module Lithic + module Models + module Cards + class BalanceListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::Cards::BalanceListParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :card_token + + # UTC date of the balance to retrieve. Defaults to latest available balance + sig { returns(T.nilable(Time)) } + attr_reader :balance_date + + sig { params(balance_date: Time).void } + attr_writer :balance_date + + # Balance after a given financial event occured. For example, passing the + # event_token of a $5 CARD_CLEARING financial event will return a balance + # decreased by $5 + sig { returns(T.nilable(String)) } + attr_reader :last_transaction_event_token + + sig { params(last_transaction_event_token: String).void } + attr_writer :last_transaction_event_token + + sig do + params( + card_token: String, + balance_date: Time, + last_transaction_event_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + card_token:, + # UTC date of the balance to retrieve. Defaults to latest available balance + balance_date: nil, + # Balance after a given financial event occured. For example, passing the + # event_token of a $5 CARD_CLEARING financial event will return a balance + # decreased by $5 + last_transaction_event_token: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + card_token: String, + balance_date: Time, + last_transaction_event_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/cards/financial_transaction_list_params.rbi b/rbi/lithic/models/cards/financial_transaction_list_params.rbi new file mode 100644 index 00000000..400a3e43 --- /dev/null +++ b/rbi/lithic/models/cards/financial_transaction_list_params.rbi @@ -0,0 +1,295 @@ +# typed: strong + +module Lithic + module Models + module Cards + class FinancialTransactionListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::Cards::FinancialTransactionListParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :card_token + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Financial Transaction category to be returned. + sig do + returns( + T.nilable( + Lithic::Cards::FinancialTransactionListParams::Category::OrSymbol + ) + ) + end + attr_reader :category + + sig do + params( + category: + Lithic::Cards::FinancialTransactionListParams::Category::OrSymbol + ).void + end + attr_writer :category + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Financial Transaction result to be returned. + sig do + returns( + T.nilable( + Lithic::Cards::FinancialTransactionListParams::Result::OrSymbol + ) + ) + end + attr_reader :result + + sig do + params( + result: + Lithic::Cards::FinancialTransactionListParams::Result::OrSymbol + ).void + end + attr_writer :result + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + # Financial Transaction status to be returned. + sig do + returns( + T.nilable( + Lithic::Cards::FinancialTransactionListParams::Status::OrSymbol + ) + ) + end + attr_reader :status + + sig do + params( + status: + Lithic::Cards::FinancialTransactionListParams::Status::OrSymbol + ).void + end + attr_writer :status + + sig do + params( + card_token: String, + begin_: Time, + category: + Lithic::Cards::FinancialTransactionListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + result: + Lithic::Cards::FinancialTransactionListParams::Result::OrSymbol, + starting_after: String, + status: + Lithic::Cards::FinancialTransactionListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + card_token:, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Financial Transaction category to be returned. + category: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Financial Transaction result to be returned. + result: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Financial Transaction status to be returned. + status: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + card_token: String, + begin_: Time, + category: + Lithic::Cards::FinancialTransactionListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + result: + Lithic::Cards::FinancialTransactionListParams::Result::OrSymbol, + starting_after: String, + status: + Lithic::Cards::FinancialTransactionListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Financial Transaction category to be returned. + module Category + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Cards::FinancialTransactionListParams::Category + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CARD = + T.let( + :CARD, + Lithic::Cards::FinancialTransactionListParams::Category::TaggedSymbol + ) + TRANSFER = + T.let( + :TRANSFER, + Lithic::Cards::FinancialTransactionListParams::Category::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Cards::FinancialTransactionListParams::Category::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Financial Transaction result to be returned. + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Cards::FinancialTransactionListParams::Result + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::Cards::FinancialTransactionListParams::Result::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::Cards::FinancialTransactionListParams::Result::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Cards::FinancialTransactionListParams::Result::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Financial Transaction status to be returned. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Cards::FinancialTransactionListParams::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DECLINED = + T.let( + :DECLINED, + Lithic::Cards::FinancialTransactionListParams::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :EXPIRED, + Lithic::Cards::FinancialTransactionListParams::Status::TaggedSymbol + ) + PENDING = + T.let( + :PENDING, + Lithic::Cards::FinancialTransactionListParams::Status::TaggedSymbol + ) + RETURNED = + T.let( + :RETURNED, + Lithic::Cards::FinancialTransactionListParams::Status::TaggedSymbol + ) + SETTLED = + T.let( + :SETTLED, + Lithic::Cards::FinancialTransactionListParams::Status::TaggedSymbol + ) + VOIDED = + T.let( + :VOIDED, + Lithic::Cards::FinancialTransactionListParams::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Cards::FinancialTransactionListParams::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/cards/financial_transaction_retrieve_params.rbi b/rbi/lithic/models/cards/financial_transaction_retrieve_params.rbi new file mode 100644 index 00000000..42bab820 --- /dev/null +++ b/rbi/lithic/models/cards/financial_transaction_retrieve_params.rbi @@ -0,0 +1,52 @@ +# typed: strong + +module Lithic + module Models + module Cards + class FinancialTransactionRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::Cards::FinancialTransactionRetrieveParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :card_token + + sig { returns(String) } + attr_accessor :financial_transaction_token + + sig do + params( + card_token: String, + financial_transaction_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + card_token:, + financial_transaction_token:, + request_options: {} + ) + end + + sig do + override.returns( + { + card_token: String, + financial_transaction_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/carrier.rbi b/rbi/lithic/models/carrier.rbi new file mode 100644 index 00000000..55acb91b --- /dev/null +++ b/rbi/lithic/models/carrier.rbi @@ -0,0 +1,32 @@ +# typed: strong + +module Lithic + module Models + class Carrier < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Lithic::Carrier, Lithic::Internal::AnyHash) } + + # QR code URL to display on the card carrier. The `qr_code_url` field requires + # your domain to be allowlisted by Lithic before use. Contact Support to configure + # your QR code domain + sig { returns(T.nilable(String)) } + attr_reader :qr_code_url + + sig { params(qr_code_url: String).void } + attr_writer :qr_code_url + + sig { params(qr_code_url: String).returns(T.attached_class) } + def self.new( + # QR code URL to display on the card carrier. The `qr_code_url` field requires + # your domain to be allowlisted by Lithic before use. Contact Support to configure + # your QR code domain + qr_code_url: nil + ) + end + + sig { override.returns({ qr_code_url: String }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/category_details.rbi b/rbi/lithic/models/category_details.rbi new file mode 100644 index 00000000..599317f4 --- /dev/null +++ b/rbi/lithic/models/category_details.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Lithic + module Models + class CategoryDetails < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::CategoryDetails, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :balance_transfers + + sig { returns(String) } + attr_accessor :cash_advances + + sig { returns(String) } + attr_accessor :purchases + + sig do + params( + balance_transfers: String, + cash_advances: String, + purchases: String + ).returns(T.attached_class) + end + def self.new(balance_transfers:, cash_advances:, purchases:) + end + + sig do + override.returns( + { + balance_transfers: String, + cash_advances: String, + purchases: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/client_api_status_params.rbi b/rbi/lithic/models/client_api_status_params.rbi new file mode 100644 index 00000000..e0dc98be --- /dev/null +++ b/rbi/lithic/models/client_api_status_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Lithic + module Models + class ClientAPIStatusParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::ClientAPIStatusParams, Lithic::Internal::AnyHash) + end + + sig do + params(request_options: Lithic::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: Lithic::RequestOptions }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/credit_products/extended_credit.rbi b/rbi/lithic/models/credit_products/extended_credit.rbi new file mode 100644 index 00000000..e2df7aaa --- /dev/null +++ b/rbi/lithic/models/credit_products/extended_credit.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Lithic + module Models + module CreditProducts + class CreditProductsExtendedCredit < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::CreditProducts::CreditProductsExtendedCredit, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Integer) } + attr_accessor :credit_extended + + sig { params(credit_extended: Integer).returns(T.attached_class) } + def self.new(credit_extended:) + end + + sig { override.returns({ credit_extended: Integer }) } + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/credit_products/extended_credit_retrieve_params.rbi b/rbi/lithic/models/credit_products/extended_credit_retrieve_params.rbi new file mode 100644 index 00000000..a9affc43 --- /dev/null +++ b/rbi/lithic/models/credit_products/extended_credit_retrieve_params.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Lithic + module Models + module CreditProducts + class ExtendedCreditRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::CreditProducts::ExtendedCreditRetrieveParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :credit_product_token + + sig do + params( + credit_product_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(credit_product_token:, request_options: {}) + end + + sig do + override.returns( + { + credit_product_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/credit_products/prime_rate_create_params.rbi b/rbi/lithic/models/credit_products/prime_rate_create_params.rbi new file mode 100644 index 00000000..d72ef183 --- /dev/null +++ b/rbi/lithic/models/credit_products/prime_rate_create_params.rbi @@ -0,0 +1,64 @@ +# typed: strong + +module Lithic + module Models + module CreditProducts + class PrimeRateCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::CreditProducts::PrimeRateCreateParams, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for credit products. + sig { returns(String) } + attr_accessor :credit_product_token + + # Date the rate goes into effect + sig { returns(Date) } + attr_accessor :effective_date + + # The rate in decimal format + sig { returns(String) } + attr_accessor :rate + + sig do + params( + credit_product_token: String, + effective_date: Date, + rate: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for credit products. + credit_product_token:, + # Date the rate goes into effect + effective_date:, + # The rate in decimal format + rate:, + request_options: {} + ) + end + + sig do + override.returns( + { + credit_product_token: String, + effective_date: Date, + rate: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/credit_products/prime_rate_retrieve_params.rbi b/rbi/lithic/models/credit_products/prime_rate_retrieve_params.rbi new file mode 100644 index 00000000..1faf7796 --- /dev/null +++ b/rbi/lithic/models/credit_products/prime_rate_retrieve_params.rbi @@ -0,0 +1,70 @@ +# typed: strong + +module Lithic + module Models + module CreditProducts + class PrimeRateRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::CreditProducts::PrimeRateRetrieveParams, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for credit products. + sig { returns(String) } + attr_accessor :credit_product_token + + # The effective date that the prime rates ends before + sig { returns(T.nilable(Date)) } + attr_reader :ending_before + + sig { params(ending_before: Date).void } + attr_writer :ending_before + + # The effective date that the prime rate starts after + sig { returns(T.nilable(Date)) } + attr_reader :starting_after + + sig { params(starting_after: Date).void } + attr_writer :starting_after + + sig do + params( + credit_product_token: String, + ending_before: Date, + starting_after: Date, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for credit products. + credit_product_token:, + # The effective date that the prime rates ends before + ending_before: nil, + # The effective date that the prime rate starts after + starting_after: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + credit_product_token: String, + ending_before: Date, + starting_after: Date, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/credit_products/prime_rate_retrieve_response.rbi b/rbi/lithic/models/credit_products/prime_rate_retrieve_response.rbi new file mode 100644 index 00000000..0992b6f7 --- /dev/null +++ b/rbi/lithic/models/credit_products/prime_rate_retrieve_response.rbi @@ -0,0 +1,95 @@ +# typed: strong + +module Lithic + module Models + module CreditProducts + class PrimeRateRetrieveResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::CreditProducts::PrimeRateRetrieveResponse, + Lithic::Internal::AnyHash + ) + end + + # List of prime rates + sig do + returns( + T::Array[ + Lithic::Models::CreditProducts::PrimeRateRetrieveResponse::Data + ] + ) + end + attr_accessor :data + + # Whether there are more prime rates + sig { returns(T::Boolean) } + attr_accessor :has_more + + sig do + params( + data: + T::Array[ + Lithic::Models::CreditProducts::PrimeRateRetrieveResponse::Data::OrHash + ], + has_more: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # List of prime rates + data:, + # Whether there are more prime rates + has_more: + ) + end + + sig do + override.returns( + { + data: + T::Array[ + Lithic::Models::CreditProducts::PrimeRateRetrieveResponse::Data + ], + has_more: T::Boolean + } + ) + end + def to_hash + end + + class Data < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::CreditProducts::PrimeRateRetrieveResponse::Data, + Lithic::Internal::AnyHash + ) + end + + # Date the rate goes into effect + sig { returns(Date) } + attr_accessor :effective_date + + # The rate in decimal format + sig { returns(String) } + attr_accessor :rate + + sig do + params(effective_date: Date, rate: String).returns(T.attached_class) + end + def self.new( + # Date the rate goes into effect + effective_date:, + # The rate in decimal format + rate: + ) + end + + sig { override.returns({ effective_date: Date, rate: String }) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/lithic/models/currency.rbi b/rbi/lithic/models/currency.rbi new file mode 100644 index 00000000..503817fc --- /dev/null +++ b/rbi/lithic/models/currency.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module Lithic + module Models + Currency = String + end +end diff --git a/rbi/lithic/models/device.rbi b/rbi/lithic/models/device.rbi new file mode 100644 index 00000000..87385c39 --- /dev/null +++ b/rbi/lithic/models/device.rbi @@ -0,0 +1,54 @@ +# typed: strong + +module Lithic + module Models + class Device < Lithic::Internal::Type::BaseModel + OrHash = T.type_alias { T.any(Lithic::Device, Lithic::Internal::AnyHash) } + + # The IMEI number of the device being provisioned. For Amex, this field contains + # device ID instead as IMEI is not provided + sig { returns(T.nilable(String)) } + attr_accessor :imei + + # The IP address of the device initiating the request + sig { returns(T.nilable(String)) } + attr_accessor :ip_address + + # Latitude and longitude where the device is located during the authorization + # attempt + sig { returns(T.nilable(String)) } + attr_accessor :location + + sig do + params( + imei: T.nilable(String), + ip_address: T.nilable(String), + location: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The IMEI number of the device being provisioned. For Amex, this field contains + # device ID instead as IMEI is not provided + imei:, + # The IP address of the device initiating the request + ip_address:, + # Latitude and longitude where the device is located during the authorization + # attempt + location: + ) + end + + sig do + override.returns( + { + imei: T.nilable(String), + ip_address: T.nilable(String), + location: T.nilable(String) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/digital_card_art.rbi b/rbi/lithic/models/digital_card_art.rbi new file mode 100644 index 00000000..150b7142 --- /dev/null +++ b/rbi/lithic/models/digital_card_art.rbi @@ -0,0 +1,109 @@ +# typed: strong + +module Lithic + module Models + class DigitalCardArtAPI < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::DigitalCardArtAPI, Lithic::Internal::AnyHash) + end + + # Globally unique identifier for the card art. + sig { returns(String) } + attr_accessor :token + + # Globally unique identifier for the card program. + sig { returns(String) } + attr_accessor :card_program_token + + # Timestamp of when card art was created. + sig { returns(Time) } + attr_accessor :created + + # Description of the card art. + sig { returns(String) } + attr_accessor :description + + # Whether the card art is enabled. + sig { returns(T::Boolean) } + attr_accessor :is_enabled + + # Card network. + sig { returns(Lithic::DigitalCardArtAPI::Network::TaggedSymbol) } + attr_accessor :network + + # Whether the card art is the default card art to be added upon tokenization. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_card_program_default + + sig { params(is_card_program_default: T::Boolean).void } + attr_writer :is_card_program_default + + sig do + params( + token: String, + card_program_token: String, + created: Time, + description: String, + is_enabled: T::Boolean, + network: Lithic::DigitalCardArtAPI::Network::OrSymbol, + is_card_program_default: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the card art. + token:, + # Globally unique identifier for the card program. + card_program_token:, + # Timestamp of when card art was created. + created:, + # Description of the card art. + description:, + # Whether the card art is enabled. + is_enabled:, + # Card network. + network:, + # Whether the card art is the default card art to be added upon tokenization. + is_card_program_default: nil + ) + end + + sig do + override.returns( + { + token: String, + card_program_token: String, + created: Time, + description: String, + is_enabled: T::Boolean, + network: Lithic::DigitalCardArtAPI::Network::TaggedSymbol, + is_card_program_default: T::Boolean + } + ) + end + def to_hash + end + + # Card network. + module Network + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::DigitalCardArtAPI::Network) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MASTERCARD = + T.let(:MASTERCARD, Lithic::DigitalCardArtAPI::Network::TaggedSymbol) + VISA = T.let(:VISA, Lithic::DigitalCardArtAPI::Network::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::DigitalCardArtAPI::Network::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/digital_card_art_list_params.rbi b/rbi/lithic/models/digital_card_art_list_params.rbi new file mode 100644 index 00000000..833ba060 --- /dev/null +++ b/rbi/lithic/models/digital_card_art_list_params.rbi @@ -0,0 +1,72 @@ +# typed: strong + +module Lithic + module Models + class DigitalCardArtListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::DigitalCardArtListParams, Lithic::Internal::AnyHash) + end + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/digital_card_art_retrieve_params.rbi b/rbi/lithic/models/digital_card_art_retrieve_params.rbi new file mode 100644 index 00000000..bf522ad5 --- /dev/null +++ b/rbi/lithic/models/digital_card_art_retrieve_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Lithic + module Models + class DigitalCardArtRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::DigitalCardArtRetrieveParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :digital_card_art_token + + sig do + params( + digital_card_art_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(digital_card_art_token:, request_options: {}) + end + + sig do + override.returns( + { + digital_card_art_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/digital_wallet_tokenization_approval_request_webhook_event.rbi b/rbi/lithic/models/digital_wallet_tokenization_approval_request_webhook_event.rbi new file mode 100644 index 00000000..476f2037 --- /dev/null +++ b/rbi/lithic/models/digital_wallet_tokenization_approval_request_webhook_event.rbi @@ -0,0 +1,558 @@ +# typed: strong + +module Lithic + module Models + class DigitalWalletTokenizationApprovalRequestWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # Unique identifier for the user tokenizing a card + sig { returns(String) } + attr_accessor :account_token + + # Unique identifier for the card being tokenized + sig { returns(String) } + attr_accessor :card_token + + # Indicate when the request was received from Mastercard or Visa + sig { returns(Time) } + attr_accessor :created + + # Contains the metadata for the digital wallet being tokenized. + sig { returns(Lithic::TokenMetadata) } + attr_reader :digital_wallet_token_metadata + + sig do + params( + digital_wallet_token_metadata: Lithic::TokenMetadata::OrHash + ).void + end + attr_writer :digital_wallet_token_metadata + + # The name of this event + sig do + returns( + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::EventType::TaggedSymbol + ) + end + attr_accessor :event_type + + # Whether Lithic decisioned on the token, and if so, what the decision was. + # APPROVED/VERIFICATION_REQUIRED/DENIED. + sig do + returns( + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::IssuerDecision::TaggedSymbol + ) + end + attr_accessor :issuer_decision + + # The channel through which the tokenization was made. + sig do + returns( + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationChannel::TaggedSymbol + ) + end + attr_accessor :tokenization_channel + + # Unique identifier for the digital wallet token attempt + sig { returns(String) } + attr_accessor :tokenization_token + + sig { returns(Lithic::WalletDecisioningInfo) } + attr_reader :wallet_decisioning_info + + sig do + params( + wallet_decisioning_info: Lithic::WalletDecisioningInfo::OrHash + ).void + end + attr_writer :wallet_decisioning_info + + # Contains the metadata for the customer tokenization decision. + sig do + returns( + T.nilable( + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision + ) + ) + end + attr_reader :customer_tokenization_decision + + sig do + params( + customer_tokenization_decision: + T.nilable( + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::OrHash + ) + ).void + end + attr_writer :customer_tokenization_decision + + sig { returns(T.nilable(Lithic::Device)) } + attr_reader :device + + sig { params(device: Lithic::Device::OrHash).void } + attr_writer :device + + # Results from rules that were evaluated for this tokenization. Only populated in + # webhook events, not in the initial decisioning request + sig { returns(T.nilable(T::Array[Lithic::TokenizationRuleResult])) } + attr_reader :rule_results + + sig do + params( + rule_results: T::Array[Lithic::TokenizationRuleResult::OrHash] + ).void + end + attr_writer :rule_results + + # List of reasons why the tokenization was declined. Only populated in webhook + # events, not in the initial decisioning request + sig do + returns( + T.nilable(T::Array[Lithic::TokenizationDeclineReason::TaggedSymbol]) + ) + end + attr_reader :tokenization_decline_reasons + + sig do + params( + tokenization_decline_reasons: + T::Array[Lithic::TokenizationDeclineReason::OrSymbol] + ).void + end + attr_writer :tokenization_decline_reasons + + # The source of the tokenization. + sig do + returns( + T.nilable( + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + ) + end + attr_reader :tokenization_source + + sig do + params( + tokenization_source: + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource::OrSymbol + ).void + end + attr_writer :tokenization_source + + # List of reasons why two-factor authentication was required. Only populated in + # webhook events, not in the initial decisioning request + sig do + returns( + T.nilable(T::Array[Lithic::TokenizationTfaReason::TaggedSymbol]) + ) + end + attr_reader :tokenization_tfa_reasons + + sig do + params( + tokenization_tfa_reasons: + T::Array[Lithic::TokenizationTfaReason::OrSymbol] + ).void + end + attr_writer :tokenization_tfa_reasons + + # Payload for digital wallet tokenization approval requests. Used for both the + # decisioning responder request (sent to the customer's endpoint for a real-time + # decision) and the subsequent webhook event (sent after the decision is made). + # Fields like customer_tokenization_decision, tokenization_decline_reasons, + # tokenization_tfa_reasons, and rule_results are only populated in the webhook + # event, not in the initial decisioning request. + sig do + params( + account_token: String, + card_token: String, + created: Time, + digital_wallet_token_metadata: Lithic::TokenMetadata::OrHash, + event_type: + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::EventType::OrSymbol, + issuer_decision: + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::IssuerDecision::OrSymbol, + tokenization_channel: + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationChannel::OrSymbol, + tokenization_token: String, + wallet_decisioning_info: Lithic::WalletDecisioningInfo::OrHash, + customer_tokenization_decision: + T.nilable( + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::OrHash + ), + device: Lithic::Device::OrHash, + rule_results: T::Array[Lithic::TokenizationRuleResult::OrHash], + tokenization_decline_reasons: + T::Array[Lithic::TokenizationDeclineReason::OrSymbol], + tokenization_source: + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource::OrSymbol, + tokenization_tfa_reasons: + T::Array[Lithic::TokenizationTfaReason::OrSymbol] + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the user tokenizing a card + account_token:, + # Unique identifier for the card being tokenized + card_token:, + # Indicate when the request was received from Mastercard or Visa + created:, + # Contains the metadata for the digital wallet being tokenized. + digital_wallet_token_metadata:, + # The name of this event + event_type:, + # Whether Lithic decisioned on the token, and if so, what the decision was. + # APPROVED/VERIFICATION_REQUIRED/DENIED. + issuer_decision:, + # The channel through which the tokenization was made. + tokenization_channel:, + # Unique identifier for the digital wallet token attempt + tokenization_token:, + wallet_decisioning_info:, + # Contains the metadata for the customer tokenization decision. + customer_tokenization_decision: nil, + device: nil, + # Results from rules that were evaluated for this tokenization. Only populated in + # webhook events, not in the initial decisioning request + rule_results: nil, + # List of reasons why the tokenization was declined. Only populated in webhook + # events, not in the initial decisioning request + tokenization_decline_reasons: nil, + # The source of the tokenization. + tokenization_source: nil, + # List of reasons why two-factor authentication was required. Only populated in + # webhook events, not in the initial decisioning request + tokenization_tfa_reasons: nil + ) + end + + sig do + override.returns( + { + account_token: String, + card_token: String, + created: Time, + digital_wallet_token_metadata: Lithic::TokenMetadata, + event_type: + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::EventType::TaggedSymbol, + issuer_decision: + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::IssuerDecision::TaggedSymbol, + tokenization_channel: + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationChannel::TaggedSymbol, + tokenization_token: String, + wallet_decisioning_info: Lithic::WalletDecisioningInfo, + customer_tokenization_decision: + T.nilable( + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision + ), + device: Lithic::Device, + rule_results: T::Array[Lithic::TokenizationRuleResult], + tokenization_decline_reasons: + T::Array[Lithic::TokenizationDeclineReason::TaggedSymbol], + tokenization_source: + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol, + tokenization_tfa_reasons: + T::Array[Lithic::TokenizationTfaReason::TaggedSymbol] + } + ) + end + def to_hash + end + + # The name of this event + module EventType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::EventType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST = + T.let( + :"digital_wallet.tokenization_approval_request", + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::EventType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::EventType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Whether Lithic decisioned on the token, and if so, what the decision was. + # APPROVED/VERIFICATION_REQUIRED/DENIED. + module IssuerDecision + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::IssuerDecision + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::IssuerDecision::TaggedSymbol + ) + DENIED = + T.let( + :DENIED, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::IssuerDecision::TaggedSymbol + ) + VERIFICATION_REQUIRED = + T.let( + :VERIFICATION_REQUIRED, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::IssuerDecision::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::IssuerDecision::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The channel through which the tokenization was made. + module TokenizationChannel + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationChannel + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DIGITAL_WALLET = + T.let( + :DIGITAL_WALLET, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationChannel::TaggedSymbol + ) + MERCHANT = + T.let( + :MERCHANT, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationChannel::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationChannel::TaggedSymbol + ] + ) + end + def self.values + end + end + + class CustomerTokenizationDecision < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision, + Lithic::Internal::AnyHash + ) + end + + # The outcome of the customer's decision + sig do + returns( + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ) + end + attr_accessor :outcome + + # The customer's subscribed URL + sig { returns(String) } + attr_accessor :responder_url + + # Time in ms it took for the customer's URL to respond + sig { returns(T.nilable(String)) } + attr_reader :latency + + sig { params(latency: String).void } + attr_writer :latency + + # The response code that the customer provided + sig { returns(T.nilable(String)) } + attr_reader :response_code + + sig { params(response_code: String).void } + attr_writer :response_code + + # Contains the metadata for the customer tokenization decision. + sig do + params( + outcome: + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::OrSymbol, + responder_url: String, + latency: String, + response_code: String + ).returns(T.attached_class) + end + def self.new( + # The outcome of the customer's decision + outcome:, + # The customer's subscribed URL + responder_url:, + # Time in ms it took for the customer's URL to respond + latency: nil, + # The response code that the customer provided + response_code: nil + ) + end + + sig do + override.returns( + { + outcome: + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol, + responder_url: String, + latency: String, + response_code: String + } + ) + end + def to_hash + end + + # The outcome of the customer's decision + module Outcome + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ) + ERROR = + T.let( + :ERROR, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ) + INVALID_RESPONSE = + T.let( + :INVALID_RESPONSE, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ) + REQUIRE_ADDITIONAL_AUTHENTICATION = + T.let( + :REQUIRE_ADDITIONAL_AUTHENTICATION, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ) + TIMEOUT = + T.let( + :TIMEOUT, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + # The source of the tokenization. + module TokenizationSource + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_ON_FILE = + T.let( + :ACCOUNT_ON_FILE, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + CONTACTLESS_TAP = + T.let( + :CONTACTLESS_TAP, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + MANUAL_PROVISION = + T.let( + :MANUAL_PROVISION, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + PUSH_PROVISION = + T.let( + :PUSH_PROVISION, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + TOKEN = + T.let( + :TOKEN, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/digital_wallet_tokenization_result_webhook_event.rbi b/rbi/lithic/models/digital_wallet_tokenization_result_webhook_event.rbi new file mode 100644 index 00000000..a76e6dcd --- /dev/null +++ b/rbi/lithic/models/digital_wallet_tokenization_result_webhook_event.rbi @@ -0,0 +1,295 @@ +# typed: strong + +module Lithic + module Models + class DigitalWalletTokenizationResultWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::DigitalWalletTokenizationResultWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # Account token + sig { returns(String) } + attr_accessor :account_token + + # Card token + sig { returns(String) } + attr_accessor :card_token + + # Created date + sig { returns(Time) } + attr_accessor :created + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # The result of the tokenization request. + sig do + returns( + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails + ) + end + attr_reader :tokenization_result_details + + sig do + params( + tokenization_result_details: + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::OrHash + ).void + end + attr_writer :tokenization_result_details + + # Tokenization token + sig { returns(String) } + attr_accessor :tokenization_token + + sig do + params( + account_token: String, + card_token: String, + created: Time, + tokenization_result_details: + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::OrHash, + tokenization_token: String, + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Account token + account_token:, + # Card token + card_token:, + # Created date + created:, + # The result of the tokenization request. + tokenization_result_details:, + # Tokenization token + tokenization_token:, + # The type of event that occurred. + event_type: :"digital_wallet.tokenization_result" + ) + end + + sig do + override.returns( + { + account_token: String, + card_token: String, + created: Time, + event_type: Symbol, + tokenization_result_details: + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails, + tokenization_token: String + } + ) + end + def to_hash + end + + class TokenizationResultDetails < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails, + Lithic::Internal::AnyHash + ) + end + + # Lithic's tokenization decision. + sig { returns(String) } + attr_accessor :issuer_decision + + # List of reasons why the tokenization was declined + sig do + returns( + T::Array[ + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ] + ) + end + attr_accessor :tokenization_decline_reasons + + # The customer's tokenization decision if applicable. + sig { returns(T.nilable(String)) } + attr_accessor :customer_decision + + # Results from rules that were evaluated for this tokenization + sig { returns(T.nilable(T::Array[Lithic::TokenizationRuleResult])) } + attr_reader :rule_results + + sig do + params( + rule_results: T::Array[Lithic::TokenizationRuleResult::OrHash] + ).void + end + attr_writer :rule_results + + # An RFC 3339 timestamp indicating when the tokenization succeeded. + sig { returns(T.nilable(Time)) } + attr_accessor :token_activated_date_time + + # List of reasons why two-factor authentication was required + sig do + returns( + T.nilable(T::Array[Lithic::TokenizationTfaReason::TaggedSymbol]) + ) + end + attr_reader :tokenization_tfa_reasons + + sig do + params( + tokenization_tfa_reasons: + T::Array[Lithic::TokenizationTfaReason::OrSymbol] + ).void + end + attr_writer :tokenization_tfa_reasons + + # The wallet's recommended decision. + sig { returns(T.nilable(String)) } + attr_accessor :wallet_decision + + # The result of the tokenization request. + sig do + params( + issuer_decision: String, + tokenization_decline_reasons: + T::Array[ + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::OrSymbol + ], + customer_decision: T.nilable(String), + rule_results: T::Array[Lithic::TokenizationRuleResult::OrHash], + token_activated_date_time: T.nilable(Time), + tokenization_tfa_reasons: + T::Array[Lithic::TokenizationTfaReason::OrSymbol], + wallet_decision: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Lithic's tokenization decision. + issuer_decision:, + # List of reasons why the tokenization was declined + tokenization_decline_reasons:, + # The customer's tokenization decision if applicable. + customer_decision: nil, + # Results from rules that were evaluated for this tokenization + rule_results: nil, + # An RFC 3339 timestamp indicating when the tokenization succeeded. + token_activated_date_time: nil, + # List of reasons why two-factor authentication was required + tokenization_tfa_reasons: nil, + # The wallet's recommended decision. + wallet_decision: nil + ) + end + + sig do + override.returns( + { + issuer_decision: String, + tokenization_decline_reasons: + T::Array[ + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ], + customer_decision: T.nilable(String), + rule_results: T::Array[Lithic::TokenizationRuleResult], + token_activated_date_time: T.nilable(Time), + tokenization_tfa_reasons: + T::Array[Lithic::TokenizationTfaReason::TaggedSymbol], + wallet_decision: T.nilable(String) + } + ) + end + def to_hash + end + + module TokenizationDeclineReason + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_SCORE_1 = + T.let( + :ACCOUNT_SCORE_1, + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + ALL_WALLET_DECLINE_REASONS_PRESENT = + T.let( + :ALL_WALLET_DECLINE_REASONS_PRESENT, + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + CARD_EXPIRY_MONTH_MISMATCH = + T.let( + :CARD_EXPIRY_MONTH_MISMATCH, + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + CARD_EXPIRY_YEAR_MISMATCH = + T.let( + :CARD_EXPIRY_YEAR_MISMATCH, + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + CARD_INVALID_STATE = + T.let( + :CARD_INVALID_STATE, + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + CUSTOMER_RED_PATH = + T.let( + :CUSTOMER_RED_PATH, + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + CVC_MISMATCH = + T.let( + :CVC_MISMATCH, + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + DEVICE_SCORE_1 = + T.let( + :DEVICE_SCORE_1, + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + GENERIC_DECLINE = + T.let( + :GENERIC_DECLINE, + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + INVALID_CUSTOMER_RESPONSE = + T.let( + :INVALID_CUSTOMER_RESPONSE, + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + NETWORK_FAILURE = + T.let( + :NETWORK_FAILURE, + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + WALLET_RECOMMENDED_DECISION_RED = + T.let( + :WALLET_RECOMMENDED_DECISION_RED, + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_sent_webhook_event.rbi b/rbi/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_sent_webhook_event.rbi new file mode 100644 index 00000000..8a956c05 --- /dev/null +++ b/rbi/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_sent_webhook_event.rbi @@ -0,0 +1,186 @@ +# typed: strong + +module Lithic + module Models + class DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # Unique identifier for the user tokenizing a card + sig { returns(String) } + attr_accessor :account_token + + sig do + returns( + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod + ) + end + attr_reader :activation_method + + sig do + params( + activation_method: + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::OrHash + ).void + end + attr_writer :activation_method + + # Unique identifier for the card being tokenized + sig { returns(String) } + attr_accessor :card_token + + # Indicate when the request was received from Mastercard or Visa + sig { returns(Time) } + attr_accessor :created + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # Unique identifier for the tokenization + sig { returns(String) } + attr_accessor :tokenization_token + + sig do + params( + account_token: String, + activation_method: + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::OrHash, + card_token: String, + created: Time, + tokenization_token: String, + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the user tokenizing a card + account_token:, + activation_method:, + # Unique identifier for the card being tokenized + card_token:, + # Indicate when the request was received from Mastercard or Visa + created:, + # Unique identifier for the tokenization + tokenization_token:, + # The type of event that occurred. + event_type: :"digital_wallet.tokenization_two_factor_authentication_code_sent" + ) + end + + sig do + override.returns( + { + account_token: String, + activation_method: + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod, + card_token: String, + created: Time, + event_type: Symbol, + tokenization_token: String + } + ) + end + def to_hash + end + + class ActivationMethod < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod, + Lithic::Internal::AnyHash + ) + end + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + sig do + returns( + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type::TaggedSymbol + ) + end + attr_accessor :type + + # The location to which the authentication code was sent. The format depends on + # the ActivationMethod.Type field. If Type is Email, the Value will be the email + # address. If the Type is Sms, the Value will be the phone number. + sig { returns(String) } + attr_accessor :value + + sig do + params( + type: + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type::OrSymbol, + value: String + ).returns(T.attached_class) + end + def self.new( + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + type:, + # The location to which the authentication code was sent. The format depends on + # the ActivationMethod.Type field. If Type is Email, the Value will be the email + # address. If the Type is Sms, the Value will be the phone number. + value: + ) + end + + sig do + override.returns( + { + type: + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type::TaggedSymbol, + value: String + } + ) + end + def to_hash + end + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EMAIL_TO_CARDHOLDER_ADDRESS = + T.let( + :EMAIL_TO_CARDHOLDER_ADDRESS, + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type::TaggedSymbol + ) + TEXT_TO_CARDHOLDER_NUMBER = + T.let( + :TEXT_TO_CARDHOLDER_NUMBER, + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_webhook_event.rbi b/rbi/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_webhook_event.rbi new file mode 100644 index 00000000..1604bad6 --- /dev/null +++ b/rbi/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_webhook_event.rbi @@ -0,0 +1,194 @@ +# typed: strong + +module Lithic + module Models + class DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # Unique identifier for the user tokenizing a card + sig { returns(String) } + attr_accessor :account_token + + sig do + returns( + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod + ) + end + attr_reader :activation_method + + sig do + params( + activation_method: + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::OrHash + ).void + end + attr_writer :activation_method + + # Authentication code to provide to the user tokenizing a card. + sig { returns(String) } + attr_accessor :authentication_code + + # Unique identifier for the card being tokenized + sig { returns(String) } + attr_accessor :card_token + + # Indicate when the request was received from Mastercard or Visa + sig { returns(Time) } + attr_accessor :created + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # Unique identifier for the tokenization + sig { returns(String) } + attr_accessor :tokenization_token + + sig do + params( + account_token: String, + activation_method: + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::OrHash, + authentication_code: String, + card_token: String, + created: Time, + tokenization_token: String, + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the user tokenizing a card + account_token:, + activation_method:, + # Authentication code to provide to the user tokenizing a card. + authentication_code:, + # Unique identifier for the card being tokenized + card_token:, + # Indicate when the request was received from Mastercard or Visa + created:, + # Unique identifier for the tokenization + tokenization_token:, + # The type of event that occurred. + event_type: :"digital_wallet.tokenization_two_factor_authentication_code" + ) + end + + sig do + override.returns( + { + account_token: String, + activation_method: + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod, + authentication_code: String, + card_token: String, + created: Time, + event_type: Symbol, + tokenization_token: String + } + ) + end + def to_hash + end + + class ActivationMethod < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod, + Lithic::Internal::AnyHash + ) + end + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + sig do + returns( + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type::TaggedSymbol + ) + end + attr_accessor :type + + # The location where the user wants to receive the authentication code. The format + # depends on the ActivationMethod.Type field. If Type is Email, the Value will be + # the email address. If the Type is Sms, the Value will be the phone number. + sig { returns(String) } + attr_accessor :value + + sig do + params( + type: + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type::OrSymbol, + value: String + ).returns(T.attached_class) + end + def self.new( + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + type:, + # The location where the user wants to receive the authentication code. The format + # depends on the ActivationMethod.Type field. If Type is Email, the Value will be + # the email address. If the Type is Sms, the Value will be the phone number. + value: + ) + end + + sig do + override.returns( + { + type: + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type::TaggedSymbol, + value: String + } + ) + end + def to_hash + end + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EMAIL_TO_CARDHOLDER_ADDRESS = + T.let( + :EMAIL_TO_CARDHOLDER_ADDRESS, + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type::TaggedSymbol + ) + TEXT_TO_CARDHOLDER_NUMBER = + T.let( + :TEXT_TO_CARDHOLDER_NUMBER, + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/digital_wallet_tokenization_updated_webhook_event.rbi b/rbi/lithic/models/digital_wallet_tokenization_updated_webhook_event.rbi new file mode 100644 index 00000000..db29e929 --- /dev/null +++ b/rbi/lithic/models/digital_wallet_tokenization_updated_webhook_event.rbi @@ -0,0 +1,73 @@ +# typed: strong + +module Lithic + module Models + class DigitalWalletTokenizationUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::DigitalWalletTokenizationUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # Account token + sig { returns(String) } + attr_accessor :account_token + + # Card token + sig { returns(String) } + attr_accessor :card_token + + # Created date + sig { returns(Time) } + attr_accessor :created + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { returns(Lithic::Tokenization) } + attr_reader :tokenization + + sig { params(tokenization: Lithic::Tokenization::OrHash).void } + attr_writer :tokenization + + sig do + params( + account_token: String, + card_token: String, + created: Time, + tokenization: Lithic::Tokenization::OrHash, + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Account token + account_token:, + # Card token + card_token:, + # Created date + created:, + tokenization:, + # The type of event that occurred. + event_type: :"digital_wallet.tokenization_updated" + ) + end + + sig do + override.returns( + { + account_token: String, + card_token: String, + created: Time, + event_type: Symbol, + tokenization: Lithic::Tokenization + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/dispute.rbi b/rbi/lithic/models/dispute.rbi new file mode 100644 index 00000000..dc0265fb --- /dev/null +++ b/rbi/lithic/models/dispute.rbi @@ -0,0 +1,486 @@ +# typed: strong + +module Lithic + module Models + class Dispute < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Lithic::Dispute, Lithic::Internal::AnyHash) } + + # Globally unique identifier. + sig { returns(String) } + attr_accessor :token + + # Amount under dispute. May be different from the original transaction amount. + sig { returns(Integer) } + attr_accessor :amount + + # Date dispute entered arbitration. + sig { returns(T.nilable(Time)) } + attr_accessor :arbitration_date + + # Timestamp of when first Dispute was reported. + sig { returns(Time) } + attr_accessor :created + + # Date that the dispute was filed by the customer making the dispute. + sig { returns(T.nilable(Time)) } + attr_accessor :customer_filed_date + + # End customer description of the reason for the dispute. + sig { returns(T.nilable(String)) } + attr_accessor :customer_note + + # Unique identifiers for the dispute from the network. + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :network_claim_ids + + # Date that the dispute was submitted to the network. + sig { returns(T.nilable(Time)) } + attr_accessor :network_filed_date + + # Network reason code used to file the dispute. + sig { returns(T.nilable(String)) } + attr_accessor :network_reason_code + + # Date dispute entered pre-arbitration. + sig { returns(T.nilable(Time)) } + attr_accessor :prearbitration_date + + # Unique identifier for the dispute from the network. If there are multiple, this + # will be the first claim id set by the network + sig { returns(T.nilable(String)) } + attr_accessor :primary_claim_id + + # Dispute reason: + # + # - `ATM_CASH_MISDISPENSE`: ATM cash misdispense. + # - `CANCELLED`: Transaction was cancelled by the customer. + # - `DUPLICATED`: The transaction was a duplicate. + # - `FRAUD_CARD_NOT_PRESENT`: Fraudulent transaction, card not present. + # - `FRAUD_CARD_PRESENT`: Fraudulent transaction, card present. + # - `FRAUD_OTHER`: Fraudulent transaction, other types such as questionable + # merchant activity. + # - `GOODS_SERVICES_NOT_AS_DESCRIBED`: The goods or services were not as + # described. + # - `GOODS_SERVICES_NOT_RECEIVED`: The goods or services were not received. + # - `INCORRECT_AMOUNT`: The transaction amount was incorrect. + # - `MISSING_AUTH`: The transaction was missing authorization. + # - `OTHER`: Other reason. + # - `PROCESSING_ERROR`: Processing error. + # - `REFUND_NOT_PROCESSED`: The refund was not processed. + # - `RECURRING_TRANSACTION_NOT_CANCELLED`: The recurring transaction was not + # cancelled. + sig { returns(Lithic::Dispute::Reason::TaggedSymbol) } + attr_accessor :reason + + # Date the representment was received. + sig { returns(T.nilable(Time)) } + attr_accessor :representment_date + + # Date that the dispute was resolved. + sig { returns(T.nilable(Time)) } + attr_accessor :resolution_date + + # Note by Dispute team on the case resolution. + sig { returns(T.nilable(String)) } + attr_accessor :resolution_note + + # Reason for the dispute resolution: + # + # - `CASE_LOST`: This case was lost at final arbitration. + # - `NETWORK_REJECTED`: Network rejected. + # - `NO_DISPUTE_RIGHTS_3DS`: No dispute rights, 3DS. + # - `NO_DISPUTE_RIGHTS_BELOW_THRESHOLD`: No dispute rights, below threshold. + # - `NO_DISPUTE_RIGHTS_CONTACTLESS`: No dispute rights, contactless. + # - `NO_DISPUTE_RIGHTS_HYBRID`: No dispute rights, hybrid. + # - `NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS`: No dispute rights, max chargebacks. + # - `NO_DISPUTE_RIGHTS_OTHER`: No dispute rights, other. + # - `PAST_FILING_DATE`: Past filing date. + # - `PREARBITRATION_REJECTED`: Prearbitration rejected. + # - `PROCESSOR_REJECTED_OTHER`: Processor rejected, other. + # - `REFUNDED`: Refunded. + # - `REFUNDED_AFTER_CHARGEBACK`: Refunded after chargeback. + # - `WITHDRAWN`: Withdrawn. + # - `WON_ARBITRATION`: Won arbitration. + # - `WON_FIRST_CHARGEBACK`: Won first chargeback. + # - `WON_PREARBITRATION`: Won prearbitration. + sig do + returns(T.nilable(Lithic::Dispute::ResolutionReason::TaggedSymbol)) + end + attr_accessor :resolution_reason + + # Status types: + # + # - `NEW` - New dispute case is opened. + # - `PENDING_CUSTOMER` - Lithic is waiting for customer to provide more + # information. + # - `SUBMITTED` - Dispute is submitted to the card network. + # - `REPRESENTMENT` - Case has entered second presentment. + # - `PREARBITRATION` - Case has entered prearbitration. + # - `ARBITRATION` - Case has entered arbitration. + # - `CASE_WON` - Case was won and credit will be issued. + # - `CASE_CLOSED` - Case was lost or withdrawn. + sig { returns(Lithic::Dispute::Status::TaggedSymbol) } + attr_accessor :status + + # The transaction that is being disputed. A transaction can only be disputed once + # but may have multiple dispute cases. + sig { returns(String) } + attr_accessor :transaction_token + + # Dispute. + sig do + params( + token: String, + amount: Integer, + arbitration_date: T.nilable(Time), + created: Time, + customer_filed_date: T.nilable(Time), + customer_note: T.nilable(String), + network_claim_ids: T.nilable(T::Array[String]), + network_filed_date: T.nilable(Time), + network_reason_code: T.nilable(String), + prearbitration_date: T.nilable(Time), + primary_claim_id: T.nilable(String), + reason: Lithic::Dispute::Reason::OrSymbol, + representment_date: T.nilable(Time), + resolution_date: T.nilable(Time), + resolution_note: T.nilable(String), + resolution_reason: + T.nilable(Lithic::Dispute::ResolutionReason::OrSymbol), + status: Lithic::Dispute::Status::OrSymbol, + transaction_token: String + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier. + token:, + # Amount under dispute. May be different from the original transaction amount. + amount:, + # Date dispute entered arbitration. + arbitration_date:, + # Timestamp of when first Dispute was reported. + created:, + # Date that the dispute was filed by the customer making the dispute. + customer_filed_date:, + # End customer description of the reason for the dispute. + customer_note:, + # Unique identifiers for the dispute from the network. + network_claim_ids:, + # Date that the dispute was submitted to the network. + network_filed_date:, + # Network reason code used to file the dispute. + network_reason_code:, + # Date dispute entered pre-arbitration. + prearbitration_date:, + # Unique identifier for the dispute from the network. If there are multiple, this + # will be the first claim id set by the network + primary_claim_id:, + # Dispute reason: + # + # - `ATM_CASH_MISDISPENSE`: ATM cash misdispense. + # - `CANCELLED`: Transaction was cancelled by the customer. + # - `DUPLICATED`: The transaction was a duplicate. + # - `FRAUD_CARD_NOT_PRESENT`: Fraudulent transaction, card not present. + # - `FRAUD_CARD_PRESENT`: Fraudulent transaction, card present. + # - `FRAUD_OTHER`: Fraudulent transaction, other types such as questionable + # merchant activity. + # - `GOODS_SERVICES_NOT_AS_DESCRIBED`: The goods or services were not as + # described. + # - `GOODS_SERVICES_NOT_RECEIVED`: The goods or services were not received. + # - `INCORRECT_AMOUNT`: The transaction amount was incorrect. + # - `MISSING_AUTH`: The transaction was missing authorization. + # - `OTHER`: Other reason. + # - `PROCESSING_ERROR`: Processing error. + # - `REFUND_NOT_PROCESSED`: The refund was not processed. + # - `RECURRING_TRANSACTION_NOT_CANCELLED`: The recurring transaction was not + # cancelled. + reason:, + # Date the representment was received. + representment_date:, + # Date that the dispute was resolved. + resolution_date:, + # Note by Dispute team on the case resolution. + resolution_note:, + # Reason for the dispute resolution: + # + # - `CASE_LOST`: This case was lost at final arbitration. + # - `NETWORK_REJECTED`: Network rejected. + # - `NO_DISPUTE_RIGHTS_3DS`: No dispute rights, 3DS. + # - `NO_DISPUTE_RIGHTS_BELOW_THRESHOLD`: No dispute rights, below threshold. + # - `NO_DISPUTE_RIGHTS_CONTACTLESS`: No dispute rights, contactless. + # - `NO_DISPUTE_RIGHTS_HYBRID`: No dispute rights, hybrid. + # - `NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS`: No dispute rights, max chargebacks. + # - `NO_DISPUTE_RIGHTS_OTHER`: No dispute rights, other. + # - `PAST_FILING_DATE`: Past filing date. + # - `PREARBITRATION_REJECTED`: Prearbitration rejected. + # - `PROCESSOR_REJECTED_OTHER`: Processor rejected, other. + # - `REFUNDED`: Refunded. + # - `REFUNDED_AFTER_CHARGEBACK`: Refunded after chargeback. + # - `WITHDRAWN`: Withdrawn. + # - `WON_ARBITRATION`: Won arbitration. + # - `WON_FIRST_CHARGEBACK`: Won first chargeback. + # - `WON_PREARBITRATION`: Won prearbitration. + resolution_reason:, + # Status types: + # + # - `NEW` - New dispute case is opened. + # - `PENDING_CUSTOMER` - Lithic is waiting for customer to provide more + # information. + # - `SUBMITTED` - Dispute is submitted to the card network. + # - `REPRESENTMENT` - Case has entered second presentment. + # - `PREARBITRATION` - Case has entered prearbitration. + # - `ARBITRATION` - Case has entered arbitration. + # - `CASE_WON` - Case was won and credit will be issued. + # - `CASE_CLOSED` - Case was lost or withdrawn. + status:, + # The transaction that is being disputed. A transaction can only be disputed once + # but may have multiple dispute cases. + transaction_token: + ) + end + + sig do + override.returns( + { + token: String, + amount: Integer, + arbitration_date: T.nilable(Time), + created: Time, + customer_filed_date: T.nilable(Time), + customer_note: T.nilable(String), + network_claim_ids: T.nilable(T::Array[String]), + network_filed_date: T.nilable(Time), + network_reason_code: T.nilable(String), + prearbitration_date: T.nilable(Time), + primary_claim_id: T.nilable(String), + reason: Lithic::Dispute::Reason::TaggedSymbol, + representment_date: T.nilable(Time), + resolution_date: T.nilable(Time), + resolution_note: T.nilable(String), + resolution_reason: + T.nilable(Lithic::Dispute::ResolutionReason::TaggedSymbol), + status: Lithic::Dispute::Status::TaggedSymbol, + transaction_token: String + } + ) + end + def to_hash + end + + # Dispute reason: + # + # - `ATM_CASH_MISDISPENSE`: ATM cash misdispense. + # - `CANCELLED`: Transaction was cancelled by the customer. + # - `DUPLICATED`: The transaction was a duplicate. + # - `FRAUD_CARD_NOT_PRESENT`: Fraudulent transaction, card not present. + # - `FRAUD_CARD_PRESENT`: Fraudulent transaction, card present. + # - `FRAUD_OTHER`: Fraudulent transaction, other types such as questionable + # merchant activity. + # - `GOODS_SERVICES_NOT_AS_DESCRIBED`: The goods or services were not as + # described. + # - `GOODS_SERVICES_NOT_RECEIVED`: The goods or services were not received. + # - `INCORRECT_AMOUNT`: The transaction amount was incorrect. + # - `MISSING_AUTH`: The transaction was missing authorization. + # - `OTHER`: Other reason. + # - `PROCESSING_ERROR`: Processing error. + # - `REFUND_NOT_PROCESSED`: The refund was not processed. + # - `RECURRING_TRANSACTION_NOT_CANCELLED`: The recurring transaction was not + # cancelled. + module Reason + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Dispute::Reason) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ATM_CASH_MISDISPENSE = + T.let(:ATM_CASH_MISDISPENSE, Lithic::Dispute::Reason::TaggedSymbol) + CANCELLED = T.let(:CANCELLED, Lithic::Dispute::Reason::TaggedSymbol) + DUPLICATED = T.let(:DUPLICATED, Lithic::Dispute::Reason::TaggedSymbol) + FRAUD_CARD_NOT_PRESENT = + T.let(:FRAUD_CARD_NOT_PRESENT, Lithic::Dispute::Reason::TaggedSymbol) + FRAUD_CARD_PRESENT = + T.let(:FRAUD_CARD_PRESENT, Lithic::Dispute::Reason::TaggedSymbol) + FRAUD_OTHER = T.let(:FRAUD_OTHER, Lithic::Dispute::Reason::TaggedSymbol) + GOODS_SERVICES_NOT_AS_DESCRIBED = + T.let( + :GOODS_SERVICES_NOT_AS_DESCRIBED, + Lithic::Dispute::Reason::TaggedSymbol + ) + GOODS_SERVICES_NOT_RECEIVED = + T.let( + :GOODS_SERVICES_NOT_RECEIVED, + Lithic::Dispute::Reason::TaggedSymbol + ) + INCORRECT_AMOUNT = + T.let(:INCORRECT_AMOUNT, Lithic::Dispute::Reason::TaggedSymbol) + MISSING_AUTH = + T.let(:MISSING_AUTH, Lithic::Dispute::Reason::TaggedSymbol) + OTHER = T.let(:OTHER, Lithic::Dispute::Reason::TaggedSymbol) + PROCESSING_ERROR = + T.let(:PROCESSING_ERROR, Lithic::Dispute::Reason::TaggedSymbol) + RECURRING_TRANSACTION_NOT_CANCELLED = + T.let( + :RECURRING_TRANSACTION_NOT_CANCELLED, + Lithic::Dispute::Reason::TaggedSymbol + ) + REFUND_NOT_PROCESSED = + T.let(:REFUND_NOT_PROCESSED, Lithic::Dispute::Reason::TaggedSymbol) + + sig do + override.returns(T::Array[Lithic::Dispute::Reason::TaggedSymbol]) + end + def self.values + end + end + + # Reason for the dispute resolution: + # + # - `CASE_LOST`: This case was lost at final arbitration. + # - `NETWORK_REJECTED`: Network rejected. + # - `NO_DISPUTE_RIGHTS_3DS`: No dispute rights, 3DS. + # - `NO_DISPUTE_RIGHTS_BELOW_THRESHOLD`: No dispute rights, below threshold. + # - `NO_DISPUTE_RIGHTS_CONTACTLESS`: No dispute rights, contactless. + # - `NO_DISPUTE_RIGHTS_HYBRID`: No dispute rights, hybrid. + # - `NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS`: No dispute rights, max chargebacks. + # - `NO_DISPUTE_RIGHTS_OTHER`: No dispute rights, other. + # - `PAST_FILING_DATE`: Past filing date. + # - `PREARBITRATION_REJECTED`: Prearbitration rejected. + # - `PROCESSOR_REJECTED_OTHER`: Processor rejected, other. + # - `REFUNDED`: Refunded. + # - `REFUNDED_AFTER_CHARGEBACK`: Refunded after chargeback. + # - `WITHDRAWN`: Withdrawn. + # - `WON_ARBITRATION`: Won arbitration. + # - `WON_FIRST_CHARGEBACK`: Won first chargeback. + # - `WON_PREARBITRATION`: Won prearbitration. + module ResolutionReason + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Dispute::ResolutionReason) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CASE_LOST = + T.let(:CASE_LOST, Lithic::Dispute::ResolutionReason::TaggedSymbol) + NETWORK_REJECTED = + T.let( + :NETWORK_REJECTED, + Lithic::Dispute::ResolutionReason::TaggedSymbol + ) + NO_DISPUTE_RIGHTS_3DS = + T.let( + :NO_DISPUTE_RIGHTS_3DS, + Lithic::Dispute::ResolutionReason::TaggedSymbol + ) + NO_DISPUTE_RIGHTS_BELOW_THRESHOLD = + T.let( + :NO_DISPUTE_RIGHTS_BELOW_THRESHOLD, + Lithic::Dispute::ResolutionReason::TaggedSymbol + ) + NO_DISPUTE_RIGHTS_CONTACTLESS = + T.let( + :NO_DISPUTE_RIGHTS_CONTACTLESS, + Lithic::Dispute::ResolutionReason::TaggedSymbol + ) + NO_DISPUTE_RIGHTS_HYBRID = + T.let( + :NO_DISPUTE_RIGHTS_HYBRID, + Lithic::Dispute::ResolutionReason::TaggedSymbol + ) + NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS = + T.let( + :NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS, + Lithic::Dispute::ResolutionReason::TaggedSymbol + ) + NO_DISPUTE_RIGHTS_OTHER = + T.let( + :NO_DISPUTE_RIGHTS_OTHER, + Lithic::Dispute::ResolutionReason::TaggedSymbol + ) + PAST_FILING_DATE = + T.let( + :PAST_FILING_DATE, + Lithic::Dispute::ResolutionReason::TaggedSymbol + ) + PREARBITRATION_REJECTED = + T.let( + :PREARBITRATION_REJECTED, + Lithic::Dispute::ResolutionReason::TaggedSymbol + ) + PROCESSOR_REJECTED_OTHER = + T.let( + :PROCESSOR_REJECTED_OTHER, + Lithic::Dispute::ResolutionReason::TaggedSymbol + ) + REFUNDED = + T.let(:REFUNDED, Lithic::Dispute::ResolutionReason::TaggedSymbol) + REFUNDED_AFTER_CHARGEBACK = + T.let( + :REFUNDED_AFTER_CHARGEBACK, + Lithic::Dispute::ResolutionReason::TaggedSymbol + ) + WITHDRAWN = + T.let(:WITHDRAWN, Lithic::Dispute::ResolutionReason::TaggedSymbol) + WON_ARBITRATION = + T.let( + :WON_ARBITRATION, + Lithic::Dispute::ResolutionReason::TaggedSymbol + ) + WON_FIRST_CHARGEBACK = + T.let( + :WON_FIRST_CHARGEBACK, + Lithic::Dispute::ResolutionReason::TaggedSymbol + ) + WON_PREARBITRATION = + T.let( + :WON_PREARBITRATION, + Lithic::Dispute::ResolutionReason::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::Dispute::ResolutionReason::TaggedSymbol] + ) + end + def self.values + end + end + + # Status types: + # + # - `NEW` - New dispute case is opened. + # - `PENDING_CUSTOMER` - Lithic is waiting for customer to provide more + # information. + # - `SUBMITTED` - Dispute is submitted to the card network. + # - `REPRESENTMENT` - Case has entered second presentment. + # - `PREARBITRATION` - Case has entered prearbitration. + # - `ARBITRATION` - Case has entered arbitration. + # - `CASE_WON` - Case was won and credit will be issued. + # - `CASE_CLOSED` - Case was lost or withdrawn. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Dispute::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ARBITRATION = T.let(:ARBITRATION, Lithic::Dispute::Status::TaggedSymbol) + CASE_CLOSED = T.let(:CASE_CLOSED, Lithic::Dispute::Status::TaggedSymbol) + CASE_WON = T.let(:CASE_WON, Lithic::Dispute::Status::TaggedSymbol) + NEW = T.let(:NEW, Lithic::Dispute::Status::TaggedSymbol) + PENDING_CUSTOMER = + T.let(:PENDING_CUSTOMER, Lithic::Dispute::Status::TaggedSymbol) + PREARBITRATION = + T.let(:PREARBITRATION, Lithic::Dispute::Status::TaggedSymbol) + REPRESENTMENT = + T.let(:REPRESENTMENT, Lithic::Dispute::Status::TaggedSymbol) + SUBMITTED = T.let(:SUBMITTED, Lithic::Dispute::Status::TaggedSymbol) + + sig do + override.returns(T::Array[Lithic::Dispute::Status::TaggedSymbol]) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/dispute_create_params.rbi b/rbi/lithic/models/dispute_create_params.rbi new file mode 100644 index 00000000..24a4a0e8 --- /dev/null +++ b/rbi/lithic/models/dispute_create_params.rbi @@ -0,0 +1,156 @@ +# typed: strong + +module Lithic + module Models + class DisputeCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::DisputeCreateParams, Lithic::Internal::AnyHash) + end + + # Amount for chargeback + sig { returns(Integer) } + attr_accessor :amount + + # Reason for chargeback + sig { returns(Lithic::DisputeCreateParams::Reason::OrSymbol) } + attr_accessor :reason + + # Transaction for chargeback + sig { returns(String) } + attr_accessor :transaction_token + + # Date the customer filed the chargeback request + sig { returns(T.nilable(Time)) } + attr_reader :customer_filed_date + + sig { params(customer_filed_date: Time).void } + attr_writer :customer_filed_date + + # Customer description + sig { returns(T.nilable(String)) } + attr_reader :customer_note + + sig { params(customer_note: String).void } + attr_writer :customer_note + + sig do + params( + amount: Integer, + reason: Lithic::DisputeCreateParams::Reason::OrSymbol, + transaction_token: String, + customer_filed_date: Time, + customer_note: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Amount for chargeback + amount:, + # Reason for chargeback + reason:, + # Transaction for chargeback + transaction_token:, + # Date the customer filed the chargeback request + customer_filed_date: nil, + # Customer description + customer_note: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + amount: Integer, + reason: Lithic::DisputeCreateParams::Reason::OrSymbol, + transaction_token: String, + customer_filed_date: Time, + customer_note: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Reason for chargeback + module Reason + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::DisputeCreateParams::Reason) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ATM_CASH_MISDISPENSE = + T.let( + :ATM_CASH_MISDISPENSE, + Lithic::DisputeCreateParams::Reason::TaggedSymbol + ) + CANCELLED = + T.let(:CANCELLED, Lithic::DisputeCreateParams::Reason::TaggedSymbol) + DUPLICATED = + T.let(:DUPLICATED, Lithic::DisputeCreateParams::Reason::TaggedSymbol) + FRAUD_CARD_NOT_PRESENT = + T.let( + :FRAUD_CARD_NOT_PRESENT, + Lithic::DisputeCreateParams::Reason::TaggedSymbol + ) + FRAUD_CARD_PRESENT = + T.let( + :FRAUD_CARD_PRESENT, + Lithic::DisputeCreateParams::Reason::TaggedSymbol + ) + FRAUD_OTHER = + T.let(:FRAUD_OTHER, Lithic::DisputeCreateParams::Reason::TaggedSymbol) + GOODS_SERVICES_NOT_AS_DESCRIBED = + T.let( + :GOODS_SERVICES_NOT_AS_DESCRIBED, + Lithic::DisputeCreateParams::Reason::TaggedSymbol + ) + GOODS_SERVICES_NOT_RECEIVED = + T.let( + :GOODS_SERVICES_NOT_RECEIVED, + Lithic::DisputeCreateParams::Reason::TaggedSymbol + ) + INCORRECT_AMOUNT = + T.let( + :INCORRECT_AMOUNT, + Lithic::DisputeCreateParams::Reason::TaggedSymbol + ) + MISSING_AUTH = + T.let( + :MISSING_AUTH, + Lithic::DisputeCreateParams::Reason::TaggedSymbol + ) + OTHER = T.let(:OTHER, Lithic::DisputeCreateParams::Reason::TaggedSymbol) + PROCESSING_ERROR = + T.let( + :PROCESSING_ERROR, + Lithic::DisputeCreateParams::Reason::TaggedSymbol + ) + RECURRING_TRANSACTION_NOT_CANCELLED = + T.let( + :RECURRING_TRANSACTION_NOT_CANCELLED, + Lithic::DisputeCreateParams::Reason::TaggedSymbol + ) + REFUND_NOT_PROCESSED = + T.let( + :REFUND_NOT_PROCESSED, + Lithic::DisputeCreateParams::Reason::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::DisputeCreateParams::Reason::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/dispute_delete_evidence_params.rbi b/rbi/lithic/models/dispute_delete_evidence_params.rbi new file mode 100644 index 00000000..2246ff1a --- /dev/null +++ b/rbi/lithic/models/dispute_delete_evidence_params.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Lithic + module Models + class DisputeDeleteEvidenceParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::DisputeDeleteEvidenceParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :dispute_token + + sig { returns(String) } + attr_accessor :evidence_token + + sig do + params( + dispute_token: String, + evidence_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(dispute_token:, evidence_token:, request_options: {}) + end + + sig do + override.returns( + { + dispute_token: String, + evidence_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/dispute_delete_params.rbi b/rbi/lithic/models/dispute_delete_params.rbi new file mode 100644 index 00000000..89017126 --- /dev/null +++ b/rbi/lithic/models/dispute_delete_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Lithic + module Models + class DisputeDeleteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::DisputeDeleteParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :dispute_token + + sig do + params( + dispute_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(dispute_token:, request_options: {}) + end + + sig do + override.returns( + { dispute_token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/dispute_evidence.rbi b/rbi/lithic/models/dispute_evidence.rbi new file mode 100644 index 00000000..d710062d --- /dev/null +++ b/rbi/lithic/models/dispute_evidence.rbi @@ -0,0 +1,143 @@ +# typed: strong + +module Lithic + module Models + class DisputeEvidence < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::DisputeEvidence, Lithic::Internal::AnyHash) + end + + # Globally unique identifier. + sig { returns(String) } + attr_accessor :token + + # Timestamp of when dispute evidence was created. + sig { returns(Time) } + attr_accessor :created + + # Dispute token evidence is attached to. + sig { returns(String) } + attr_accessor :dispute_token + + # Upload status types: + # + # - `DELETED` - Evidence was deleted. + # - `ERROR` - Evidence upload failed. + # - `PENDING` - Evidence is pending upload. + # - `REJECTED` - Evidence was rejected. + # - `UPLOADED` - Evidence was uploaded. + sig { returns(Lithic::DisputeEvidence::UploadStatus::TaggedSymbol) } + attr_accessor :upload_status + + # URL to download evidence. Only shown when `upload_status` is `UPLOADED`. + sig { returns(T.nilable(String)) } + attr_reader :download_url + + sig { params(download_url: String).void } + attr_writer :download_url + + # File name of evidence. Recommended to give the dispute evidence a human-readable + # identifier. + sig { returns(T.nilable(String)) } + attr_reader :filename + + sig { params(filename: String).void } + attr_writer :filename + + # URL to upload evidence. Only shown when `upload_status` is `PENDING`. + sig { returns(T.nilable(String)) } + attr_reader :upload_url + + sig { params(upload_url: String).void } + attr_writer :upload_url + + # Dispute evidence. + sig do + params( + token: String, + created: Time, + dispute_token: String, + upload_status: Lithic::DisputeEvidence::UploadStatus::OrSymbol, + download_url: String, + filename: String, + upload_url: String + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier. + token:, + # Timestamp of when dispute evidence was created. + created:, + # Dispute token evidence is attached to. + dispute_token:, + # Upload status types: + # + # - `DELETED` - Evidence was deleted. + # - `ERROR` - Evidence upload failed. + # - `PENDING` - Evidence is pending upload. + # - `REJECTED` - Evidence was rejected. + # - `UPLOADED` - Evidence was uploaded. + upload_status:, + # URL to download evidence. Only shown when `upload_status` is `UPLOADED`. + download_url: nil, + # File name of evidence. Recommended to give the dispute evidence a human-readable + # identifier. + filename: nil, + # URL to upload evidence. Only shown when `upload_status` is `PENDING`. + upload_url: nil + ) + end + + sig do + override.returns( + { + token: String, + created: Time, + dispute_token: String, + upload_status: Lithic::DisputeEvidence::UploadStatus::TaggedSymbol, + download_url: String, + filename: String, + upload_url: String + } + ) + end + def to_hash + end + + # Upload status types: + # + # - `DELETED` - Evidence was deleted. + # - `ERROR` - Evidence upload failed. + # - `PENDING` - Evidence is pending upload. + # - `REJECTED` - Evidence was rejected. + # - `UPLOADED` - Evidence was uploaded. + module UploadStatus + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::DisputeEvidence::UploadStatus) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DELETED = + T.let(:DELETED, Lithic::DisputeEvidence::UploadStatus::TaggedSymbol) + ERROR = + T.let(:ERROR, Lithic::DisputeEvidence::UploadStatus::TaggedSymbol) + PENDING = + T.let(:PENDING, Lithic::DisputeEvidence::UploadStatus::TaggedSymbol) + REJECTED = + T.let(:REJECTED, Lithic::DisputeEvidence::UploadStatus::TaggedSymbol) + UPLOADED = + T.let(:UPLOADED, Lithic::DisputeEvidence::UploadStatus::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::DisputeEvidence::UploadStatus::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/dispute_evidence_upload_failed_webhook_event.rbi b/rbi/lithic/models/dispute_evidence_upload_failed_webhook_event.rbi new file mode 100644 index 00000000..9d5a9cee --- /dev/null +++ b/rbi/lithic/models/dispute_evidence_upload_failed_webhook_event.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Lithic + module Models + class DisputeEvidenceUploadFailedWebhookEvent < Lithic::Models::DisputeEvidence + OrHash = + T.type_alias do + T.any( + Lithic::DisputeEvidenceUploadFailedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # Dispute evidence. + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"dispute_evidence.upload_failed" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/dispute_initiate_evidence_upload_params.rbi b/rbi/lithic/models/dispute_initiate_evidence_upload_params.rbi new file mode 100644 index 00000000..237bff94 --- /dev/null +++ b/rbi/lithic/models/dispute_initiate_evidence_upload_params.rbi @@ -0,0 +1,55 @@ +# typed: strong + +module Lithic + module Models + class DisputeInitiateEvidenceUploadParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::DisputeInitiateEvidenceUploadParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :dispute_token + + # Filename of the evidence. + sig { returns(T.nilable(String)) } + attr_reader :filename + + sig { params(filename: String).void } + attr_writer :filename + + sig do + params( + dispute_token: String, + filename: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + dispute_token:, + # Filename of the evidence. + filename: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + dispute_token: String, + filename: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/dispute_list_evidences_params.rbi b/rbi/lithic/models/dispute_list_evidences_params.rbi new file mode 100644 index 00000000..49f9150e --- /dev/null +++ b/rbi/lithic/models/dispute_list_evidences_params.rbi @@ -0,0 +1,104 @@ +# typed: strong + +module Lithic + module Models + class DisputeListEvidencesParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::DisputeListEvidencesParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :dispute_token + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + dispute_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + dispute_token:, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + dispute_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/dispute_list_params.rbi b/rbi/lithic/models/dispute_list_params.rbi new file mode 100644 index 00000000..eb26ccdb --- /dev/null +++ b/rbi/lithic/models/dispute_list_params.rbi @@ -0,0 +1,159 @@ +# typed: strong + +module Lithic + module Models + class DisputeListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::DisputeListParams, Lithic::Internal::AnyHash) + end + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + # Filter by status. + sig { returns(T.nilable(Lithic::DisputeListParams::Status::OrSymbol)) } + attr_reader :status + + sig { params(status: Lithic::DisputeListParams::Status::OrSymbol).void } + attr_writer :status + + # Transaction tokens to filter by. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :transaction_tokens + + sig { params(transaction_tokens: T::Array[String]).void } + attr_writer :transaction_tokens + + sig do + params( + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::DisputeListParams::Status::OrSymbol, + transaction_tokens: T::Array[String], + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Filter by status. + status: nil, + # Transaction tokens to filter by. + transaction_tokens: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::DisputeListParams::Status::OrSymbol, + transaction_tokens: T::Array[String], + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Filter by status. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::DisputeListParams::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ARBITRATION = + T.let(:ARBITRATION, Lithic::DisputeListParams::Status::TaggedSymbol) + CASE_CLOSED = + T.let(:CASE_CLOSED, Lithic::DisputeListParams::Status::TaggedSymbol) + CASE_WON = + T.let(:CASE_WON, Lithic::DisputeListParams::Status::TaggedSymbol) + NEW = T.let(:NEW, Lithic::DisputeListParams::Status::TaggedSymbol) + PENDING_CUSTOMER = + T.let( + :PENDING_CUSTOMER, + Lithic::DisputeListParams::Status::TaggedSymbol + ) + PREARBITRATION = + T.let( + :PREARBITRATION, + Lithic::DisputeListParams::Status::TaggedSymbol + ) + REPRESENTMENT = + T.let(:REPRESENTMENT, Lithic::DisputeListParams::Status::TaggedSymbol) + SUBMITTED = + T.let(:SUBMITTED, Lithic::DisputeListParams::Status::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::DisputeListParams::Status::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/dispute_retrieve_evidence_params.rbi b/rbi/lithic/models/dispute_retrieve_evidence_params.rbi new file mode 100644 index 00000000..82eae6d3 --- /dev/null +++ b/rbi/lithic/models/dispute_retrieve_evidence_params.rbi @@ -0,0 +1,46 @@ +# typed: strong + +module Lithic + module Models + class DisputeRetrieveEvidenceParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::DisputeRetrieveEvidenceParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :dispute_token + + sig { returns(String) } + attr_accessor :evidence_token + + sig do + params( + dispute_token: String, + evidence_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(dispute_token:, evidence_token:, request_options: {}) + end + + sig do + override.returns( + { + dispute_token: String, + evidence_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/dispute_retrieve_params.rbi b/rbi/lithic/models/dispute_retrieve_params.rbi new file mode 100644 index 00000000..3b62c519 --- /dev/null +++ b/rbi/lithic/models/dispute_retrieve_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Lithic + module Models + class DisputeRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::DisputeRetrieveParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :dispute_token + + sig do + params( + dispute_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(dispute_token:, request_options: {}) + end + + sig do + override.returns( + { dispute_token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/dispute_transaction_created_webhook_event.rbi b/rbi/lithic/models/dispute_transaction_created_webhook_event.rbi new file mode 100644 index 00000000..f400b372 --- /dev/null +++ b/rbi/lithic/models/dispute_transaction_created_webhook_event.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Lithic + module Models + class DisputeTransactionCreatedWebhookEvent < Lithic::Models::DisputeV2 + OrHash = + T.type_alias do + T.any( + Lithic::DisputeTransactionCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # The Dispute object tracks the progression of a dispute throughout its lifecycle. + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"dispute_transaction.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/dispute_transaction_updated_webhook_event.rbi b/rbi/lithic/models/dispute_transaction_updated_webhook_event.rbi new file mode 100644 index 00000000..124ee2c6 --- /dev/null +++ b/rbi/lithic/models/dispute_transaction_updated_webhook_event.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Lithic + module Models + class DisputeTransactionUpdatedWebhookEvent < Lithic::Models::DisputeV2 + OrHash = + T.type_alias do + T.any( + Lithic::DisputeTransactionUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # The Dispute object tracks the progression of a dispute throughout its lifecycle. + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"dispute_transaction.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/dispute_update_params.rbi b/rbi/lithic/models/dispute_update_params.rbi new file mode 100644 index 00000000..680474fe --- /dev/null +++ b/rbi/lithic/models/dispute_update_params.rbi @@ -0,0 +1,160 @@ +# typed: strong + +module Lithic + module Models + class DisputeUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::DisputeUpdateParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :dispute_token + + # Amount for chargeback + sig { returns(T.nilable(Integer)) } + attr_reader :amount + + sig { params(amount: Integer).void } + attr_writer :amount + + # Date the customer filed the chargeback request + sig { returns(T.nilable(Time)) } + attr_reader :customer_filed_date + + sig { params(customer_filed_date: Time).void } + attr_writer :customer_filed_date + + # Customer description + sig { returns(T.nilable(String)) } + attr_reader :customer_note + + sig { params(customer_note: String).void } + attr_writer :customer_note + + # Reason for chargeback + sig { returns(T.nilable(Lithic::DisputeUpdateParams::Reason::OrSymbol)) } + attr_reader :reason + + sig { params(reason: Lithic::DisputeUpdateParams::Reason::OrSymbol).void } + attr_writer :reason + + sig do + params( + dispute_token: String, + amount: Integer, + customer_filed_date: Time, + customer_note: String, + reason: Lithic::DisputeUpdateParams::Reason::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + dispute_token:, + # Amount for chargeback + amount: nil, + # Date the customer filed the chargeback request + customer_filed_date: nil, + # Customer description + customer_note: nil, + # Reason for chargeback + reason: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + dispute_token: String, + amount: Integer, + customer_filed_date: Time, + customer_note: String, + reason: Lithic::DisputeUpdateParams::Reason::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Reason for chargeback + module Reason + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::DisputeUpdateParams::Reason) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ATM_CASH_MISDISPENSE = + T.let( + :ATM_CASH_MISDISPENSE, + Lithic::DisputeUpdateParams::Reason::TaggedSymbol + ) + CANCELLED = + T.let(:CANCELLED, Lithic::DisputeUpdateParams::Reason::TaggedSymbol) + DUPLICATED = + T.let(:DUPLICATED, Lithic::DisputeUpdateParams::Reason::TaggedSymbol) + FRAUD_CARD_NOT_PRESENT = + T.let( + :FRAUD_CARD_NOT_PRESENT, + Lithic::DisputeUpdateParams::Reason::TaggedSymbol + ) + FRAUD_CARD_PRESENT = + T.let( + :FRAUD_CARD_PRESENT, + Lithic::DisputeUpdateParams::Reason::TaggedSymbol + ) + FRAUD_OTHER = + T.let(:FRAUD_OTHER, Lithic::DisputeUpdateParams::Reason::TaggedSymbol) + GOODS_SERVICES_NOT_AS_DESCRIBED = + T.let( + :GOODS_SERVICES_NOT_AS_DESCRIBED, + Lithic::DisputeUpdateParams::Reason::TaggedSymbol + ) + GOODS_SERVICES_NOT_RECEIVED = + T.let( + :GOODS_SERVICES_NOT_RECEIVED, + Lithic::DisputeUpdateParams::Reason::TaggedSymbol + ) + INCORRECT_AMOUNT = + T.let( + :INCORRECT_AMOUNT, + Lithic::DisputeUpdateParams::Reason::TaggedSymbol + ) + MISSING_AUTH = + T.let( + :MISSING_AUTH, + Lithic::DisputeUpdateParams::Reason::TaggedSymbol + ) + OTHER = T.let(:OTHER, Lithic::DisputeUpdateParams::Reason::TaggedSymbol) + PROCESSING_ERROR = + T.let( + :PROCESSING_ERROR, + Lithic::DisputeUpdateParams::Reason::TaggedSymbol + ) + RECURRING_TRANSACTION_NOT_CANCELLED = + T.let( + :RECURRING_TRANSACTION_NOT_CANCELLED, + Lithic::DisputeUpdateParams::Reason::TaggedSymbol + ) + REFUND_NOT_PROCESSED = + T.let( + :REFUND_NOT_PROCESSED, + Lithic::DisputeUpdateParams::Reason::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::DisputeUpdateParams::Reason::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/dispute_updated_webhook_event.rbi b/rbi/lithic/models/dispute_updated_webhook_event.rbi new file mode 100644 index 00000000..5227b6b2 --- /dev/null +++ b/rbi/lithic/models/dispute_updated_webhook_event.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Lithic + module Models + class DisputeUpdatedWebhookEvent < Lithic::Models::Dispute + OrHash = + T.type_alias do + T.any(Lithic::DisputeUpdatedWebhookEvent, Lithic::Internal::AnyHash) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # Dispute. + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"dispute.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/dispute_v2.rbi b/rbi/lithic/models/dispute_v2.rbi new file mode 100644 index 00000000..f7a8f41b --- /dev/null +++ b/rbi/lithic/models/dispute_v2.rbi @@ -0,0 +1,965 @@ +# typed: strong + +module Lithic + module Models + class DisputeV2 < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Lithic::DisputeV2, Lithic::Internal::AnyHash) } + + # Token assigned by Lithic for the dispute, in UUID format. + sig { returns(String) } + attr_accessor :token + + # Token for the account associated with the dispute, in UUID format. + sig { returns(String) } + attr_accessor :account_token + + # Token for the card used in the dispute, in UUID format. + sig { returns(String) } + attr_accessor :card_token + + # Identifier assigned by the network for this dispute. + sig { returns(T.nilable(String)) } + attr_accessor :case_id + + # When the dispute was created. + sig { returns(Time) } + attr_accessor :created + + # Three-letter ISO 4217 currency code. + sig { returns(String) } + attr_accessor :currency + + # Dispute resolution outcome + sig { returns(T.nilable(Lithic::DisputeV2::Disposition::TaggedSymbol)) } + attr_accessor :disposition + + # Chronological list of events that have occurred in the dispute lifecycle + sig { returns(T::Array[Lithic::DisputeV2::Event]) } + attr_accessor :events + + # Current breakdown of how liability is allocated for the disputed amount + sig { returns(Lithic::DisputeV2::LiabilityAllocation) } + attr_reader :liability_allocation + + sig do + params( + liability_allocation: Lithic::DisputeV2::LiabilityAllocation::OrHash + ).void + end + attr_writer :liability_allocation + + sig { returns(Lithic::Merchant) } + attr_reader :merchant + + sig { params(merchant: Lithic::Merchant::OrHash).void } + attr_writer :merchant + + # Card network handling the dispute. + sig { returns(Lithic::DisputeV2::Network::TaggedSymbol) } + attr_accessor :network + + # Current status of the dispute. + sig { returns(T.nilable(Lithic::DisputeV2::Status::TaggedSymbol)) } + attr_accessor :status + + # Contains identifiers for the transaction and specific event within being + # disputed; null if no transaction can be identified + sig { returns(T.nilable(Lithic::DisputeV2::TransactionSeries)) } + attr_reader :transaction_series + + sig do + params( + transaction_series: + T.nilable(Lithic::DisputeV2::TransactionSeries::OrHash) + ).void + end + attr_writer :transaction_series + + # When the dispute was last updated. + sig { returns(Time) } + attr_accessor :updated + + # The Dispute object tracks the progression of a dispute throughout its lifecycle. + sig do + params( + token: String, + account_token: String, + card_token: String, + case_id: T.nilable(String), + created: Time, + currency: String, + disposition: T.nilable(Lithic::DisputeV2::Disposition::OrSymbol), + events: T::Array[Lithic::DisputeV2::Event::OrHash], + liability_allocation: Lithic::DisputeV2::LiabilityAllocation::OrHash, + merchant: Lithic::Merchant::OrHash, + network: Lithic::DisputeV2::Network::OrSymbol, + status: T.nilable(Lithic::DisputeV2::Status::OrSymbol), + transaction_series: + T.nilable(Lithic::DisputeV2::TransactionSeries::OrHash), + updated: Time + ).returns(T.attached_class) + end + def self.new( + # Token assigned by Lithic for the dispute, in UUID format. + token:, + # Token for the account associated with the dispute, in UUID format. + account_token:, + # Token for the card used in the dispute, in UUID format. + card_token:, + # Identifier assigned by the network for this dispute. + case_id:, + # When the dispute was created. + created:, + # Three-letter ISO 4217 currency code. + currency:, + # Dispute resolution outcome + disposition:, + # Chronological list of events that have occurred in the dispute lifecycle + events:, + # Current breakdown of how liability is allocated for the disputed amount + liability_allocation:, + merchant:, + # Card network handling the dispute. + network:, + # Current status of the dispute. + status:, + # Contains identifiers for the transaction and specific event within being + # disputed; null if no transaction can be identified + transaction_series:, + # When the dispute was last updated. + updated: + ) + end + + sig do + override.returns( + { + token: String, + account_token: String, + card_token: String, + case_id: T.nilable(String), + created: Time, + currency: String, + disposition: + T.nilable(Lithic::DisputeV2::Disposition::TaggedSymbol), + events: T::Array[Lithic::DisputeV2::Event], + liability_allocation: Lithic::DisputeV2::LiabilityAllocation, + merchant: Lithic::Merchant, + network: Lithic::DisputeV2::Network::TaggedSymbol, + status: T.nilable(Lithic::DisputeV2::Status::TaggedSymbol), + transaction_series: T.nilable(Lithic::DisputeV2::TransactionSeries), + updated: Time + } + ) + end + def to_hash + end + + # Dispute resolution outcome + module Disposition + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::DisputeV2::Disposition) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WON = T.let(:WON, Lithic::DisputeV2::Disposition::TaggedSymbol) + LOST = T.let(:LOST, Lithic::DisputeV2::Disposition::TaggedSymbol) + PARTIALLY_WON = + T.let(:PARTIALLY_WON, Lithic::DisputeV2::Disposition::TaggedSymbol) + WITHDRAWN = + T.let(:WITHDRAWN, Lithic::DisputeV2::Disposition::TaggedSymbol) + DENIED = T.let(:DENIED, Lithic::DisputeV2::Disposition::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::DisputeV2::Disposition::TaggedSymbol] + ) + end + def self.values + end + end + + class Event < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::DisputeV2::Event, Lithic::Internal::AnyHash) + end + + # Unique identifier for the event, in UUID format + sig { returns(String) } + attr_accessor :token + + # When the event occurred + sig { returns(Time) } + attr_accessor :created + + # Details specific to the event type + sig { returns(Lithic::DisputeV2::Event::Data::Variants) } + attr_accessor :data + + # Type of event + sig { returns(Lithic::DisputeV2::Event::Type::TaggedSymbol) } + attr_accessor :type + + # Event that occurred in the dispute lifecycle + sig do + params( + token: String, + created: Time, + data: + T.any( + Lithic::DisputeV2::Event::Data::Workflow::OrHash, + Lithic::DisputeV2::Event::Data::Financial::OrHash, + Lithic::DisputeV2::Event::Data::CardholderLiability::OrHash + ), + type: Lithic::DisputeV2::Event::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the event, in UUID format + token:, + # When the event occurred + created:, + # Details specific to the event type + data:, + # Type of event + type: + ) + end + + sig do + override.returns( + { + token: String, + created: Time, + data: Lithic::DisputeV2::Event::Data::Variants, + type: Lithic::DisputeV2::Event::Type::TaggedSymbol + } + ) + end + def to_hash + end + + # Details specific to the event type + module Data + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::DisputeV2::Event::Data::Workflow, + Lithic::DisputeV2::Event::Data::Financial, + Lithic::DisputeV2::Event::Data::CardholderLiability + ) + end + + class Workflow < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::DisputeV2::Event::Data::Workflow, + Lithic::Internal::AnyHash + ) + end + + # Action taken in this stage + sig do + returns( + Lithic::DisputeV2::Event::Data::Workflow::Action::TaggedSymbol + ) + end + attr_accessor :action + + # Amount in minor units + sig { returns(T.nilable(Integer)) } + attr_accessor :amount + + # Dispute resolution outcome + sig do + returns( + T.nilable( + Lithic::DisputeV2::Event::Data::Workflow::Disposition::TaggedSymbol + ) + ) + end + attr_accessor :disposition + + # Reason for the action + sig { returns(T.nilable(String)) } + attr_accessor :reason + + # Current stage of the dispute workflow + sig do + returns( + Lithic::DisputeV2::Event::Data::Workflow::Stage::TaggedSymbol + ) + end + attr_accessor :stage + + # Event type discriminator + sig { returns(Symbol) } + attr_accessor :type + + # Details specific to workflow events + sig do + params( + action: + Lithic::DisputeV2::Event::Data::Workflow::Action::OrSymbol, + amount: T.nilable(Integer), + disposition: + T.nilable( + Lithic::DisputeV2::Event::Data::Workflow::Disposition::OrSymbol + ), + reason: T.nilable(String), + stage: + Lithic::DisputeV2::Event::Data::Workflow::Stage::OrSymbol, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Action taken in this stage + action:, + # Amount in minor units + amount:, + # Dispute resolution outcome + disposition:, + # Reason for the action + reason:, + # Current stage of the dispute workflow + stage:, + # Event type discriminator + type: :WORKFLOW + ) + end + + sig do + override.returns( + { + action: + Lithic::DisputeV2::Event::Data::Workflow::Action::TaggedSymbol, + amount: T.nilable(Integer), + disposition: + T.nilable( + Lithic::DisputeV2::Event::Data::Workflow::Disposition::TaggedSymbol + ), + reason: T.nilable(String), + stage: + Lithic::DisputeV2::Event::Data::Workflow::Stage::TaggedSymbol, + type: Symbol + } + ) + end + def to_hash + end + + # Action taken in this stage + module Action + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::DisputeV2::Event::Data::Workflow::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + OPENED = + T.let( + :OPENED, + Lithic::DisputeV2::Event::Data::Workflow::Action::TaggedSymbol + ) + CLOSED = + T.let( + :CLOSED, + Lithic::DisputeV2::Event::Data::Workflow::Action::TaggedSymbol + ) + REOPENED = + T.let( + :REOPENED, + Lithic::DisputeV2::Event::Data::Workflow::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::DisputeV2::Event::Data::Workflow::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Dispute resolution outcome + module Disposition + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::DisputeV2::Event::Data::Workflow::Disposition + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WON = + T.let( + :WON, + Lithic::DisputeV2::Event::Data::Workflow::Disposition::TaggedSymbol + ) + LOST = + T.let( + :LOST, + Lithic::DisputeV2::Event::Data::Workflow::Disposition::TaggedSymbol + ) + PARTIALLY_WON = + T.let( + :PARTIALLY_WON, + Lithic::DisputeV2::Event::Data::Workflow::Disposition::TaggedSymbol + ) + WITHDRAWN = + T.let( + :WITHDRAWN, + Lithic::DisputeV2::Event::Data::Workflow::Disposition::TaggedSymbol + ) + DENIED = + T.let( + :DENIED, + Lithic::DisputeV2::Event::Data::Workflow::Disposition::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::DisputeV2::Event::Data::Workflow::Disposition::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Current stage of the dispute workflow + module Stage + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::DisputeV2::Event::Data::Workflow::Stage) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CLAIM = + T.let( + :CLAIM, + Lithic::DisputeV2::Event::Data::Workflow::Stage::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::DisputeV2::Event::Data::Workflow::Stage::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Financial < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::DisputeV2::Event::Data::Financial, + Lithic::Internal::AnyHash + ) + end + + # Amount in minor units + sig { returns(Integer) } + attr_accessor :amount + + # Direction of funds flow + sig do + returns( + Lithic::DisputeV2::Event::Data::Financial::Polarity::TaggedSymbol + ) + end + attr_accessor :polarity + + # Stage at which the financial event occurred + sig do + returns( + Lithic::DisputeV2::Event::Data::Financial::Stage::TaggedSymbol + ) + end + attr_accessor :stage + + # Event type discriminator + sig { returns(Symbol) } + attr_accessor :type + + # Details specific to financial events + sig do + params( + amount: Integer, + polarity: + Lithic::DisputeV2::Event::Data::Financial::Polarity::OrSymbol, + stage: + Lithic::DisputeV2::Event::Data::Financial::Stage::OrSymbol, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Amount in minor units + amount:, + # Direction of funds flow + polarity:, + # Stage at which the financial event occurred + stage:, + # Event type discriminator + type: :FINANCIAL + ) + end + + sig do + override.returns( + { + amount: Integer, + polarity: + Lithic::DisputeV2::Event::Data::Financial::Polarity::TaggedSymbol, + stage: + Lithic::DisputeV2::Event::Data::Financial::Stage::TaggedSymbol, + type: Symbol + } + ) + end + def to_hash + end + + # Direction of funds flow + module Polarity + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::DisputeV2::Event::Data::Financial::Polarity + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREDIT = + T.let( + :CREDIT, + Lithic::DisputeV2::Event::Data::Financial::Polarity::TaggedSymbol + ) + DEBIT = + T.let( + :DEBIT, + Lithic::DisputeV2::Event::Data::Financial::Polarity::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::DisputeV2::Event::Data::Financial::Polarity::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Stage at which the financial event occurred + module Stage + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::DisputeV2::Event::Data::Financial::Stage + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHARGEBACK = + T.let( + :CHARGEBACK, + Lithic::DisputeV2::Event::Data::Financial::Stage::TaggedSymbol + ) + REPRESENTMENT = + T.let( + :REPRESENTMENT, + Lithic::DisputeV2::Event::Data::Financial::Stage::TaggedSymbol + ) + PREARBITRATION = + T.let( + :PREARBITRATION, + Lithic::DisputeV2::Event::Data::Financial::Stage::TaggedSymbol + ) + ARBITRATION = + T.let( + :ARBITRATION, + Lithic::DisputeV2::Event::Data::Financial::Stage::TaggedSymbol + ) + COLLABORATION = + T.let( + :COLLABORATION, + Lithic::DisputeV2::Event::Data::Financial::Stage::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::DisputeV2::Event::Data::Financial::Stage::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class CardholderLiability < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::DisputeV2::Event::Data::CardholderLiability, + Lithic::Internal::AnyHash + ) + end + + # Action taken regarding cardholder liability + sig do + returns( + Lithic::DisputeV2::Event::Data::CardholderLiability::Action::TaggedSymbol + ) + end + attr_accessor :action + + # Amount in minor units + sig { returns(Integer) } + attr_accessor :amount + + # Reason for the action + sig { returns(String) } + attr_accessor :reason + + # Event type discriminator + sig { returns(Symbol) } + attr_accessor :type + + # Details specific to cardholder liability events + sig do + params( + action: + Lithic::DisputeV2::Event::Data::CardholderLiability::Action::OrSymbol, + amount: Integer, + reason: String, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Action taken regarding cardholder liability + action:, + # Amount in minor units + amount:, + # Reason for the action + reason:, + # Event type discriminator + type: :CARDHOLDER_LIABILITY + ) + end + + sig do + override.returns( + { + action: + Lithic::DisputeV2::Event::Data::CardholderLiability::Action::TaggedSymbol, + amount: Integer, + reason: String, + type: Symbol + } + ) + end + def to_hash + end + + # Action taken regarding cardholder liability + module Action + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::DisputeV2::Event::Data::CardholderLiability::Action + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PROVISIONAL_CREDIT_GRANTED = + T.let( + :PROVISIONAL_CREDIT_GRANTED, + Lithic::DisputeV2::Event::Data::CardholderLiability::Action::TaggedSymbol + ) + PROVISIONAL_CREDIT_REVERSED = + T.let( + :PROVISIONAL_CREDIT_REVERSED, + Lithic::DisputeV2::Event::Data::CardholderLiability::Action::TaggedSymbol + ) + WRITTEN_OFF = + T.let( + :WRITTEN_OFF, + Lithic::DisputeV2::Event::Data::CardholderLiability::Action::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::DisputeV2::Event::Data::CardholderLiability::Action::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig do + override.returns(T::Array[Lithic::DisputeV2::Event::Data::Variants]) + end + def self.variants + end + end + + # Type of event + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::DisputeV2::Event::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WORKFLOW = + T.let(:WORKFLOW, Lithic::DisputeV2::Event::Type::TaggedSymbol) + FINANCIAL = + T.let(:FINANCIAL, Lithic::DisputeV2::Event::Type::TaggedSymbol) + CARDHOLDER_LIABILITY = + T.let( + :CARDHOLDER_LIABILITY, + Lithic::DisputeV2::Event::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::DisputeV2::Event::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + + class LiabilityAllocation < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::DisputeV2::LiabilityAllocation, + Lithic::Internal::AnyHash + ) + end + + # The amount that has been denied to the cardholder + sig { returns(Integer) } + attr_accessor :denied_amount + + # The initial amount disputed + sig { returns(Integer) } + attr_accessor :original_amount + + # The amount that has been recovered from the merchant through the dispute process + sig { returns(Integer) } + attr_accessor :recovered_amount + + # Any disputed amount that is still outstanding, i.e. has not been recovered, + # written off, or denied + sig { returns(Integer) } + attr_accessor :remaining_amount + + # The amount the issuer has chosen to write off + sig { returns(Integer) } + attr_accessor :written_off_amount + + # Current breakdown of how liability is allocated for the disputed amount + sig do + params( + denied_amount: Integer, + original_amount: Integer, + recovered_amount: Integer, + remaining_amount: Integer, + written_off_amount: Integer + ).returns(T.attached_class) + end + def self.new( + # The amount that has been denied to the cardholder + denied_amount:, + # The initial amount disputed + original_amount:, + # The amount that has been recovered from the merchant through the dispute process + recovered_amount:, + # Any disputed amount that is still outstanding, i.e. has not been recovered, + # written off, or denied + remaining_amount:, + # The amount the issuer has chosen to write off + written_off_amount: + ) + end + + sig do + override.returns( + { + denied_amount: Integer, + original_amount: Integer, + recovered_amount: Integer, + remaining_amount: Integer, + written_off_amount: Integer + } + ) + end + def to_hash + end + end + + # Card network handling the dispute. + module Network + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::DisputeV2::Network) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + VISA = T.let(:VISA, Lithic::DisputeV2::Network::TaggedSymbol) + MASTERCARD = + T.let(:MASTERCARD, Lithic::DisputeV2::Network::TaggedSymbol) + + sig do + override.returns(T::Array[Lithic::DisputeV2::Network::TaggedSymbol]) + end + def self.values + end + end + + # Current status of the dispute. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::DisputeV2::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + OPEN = T.let(:OPEN, Lithic::DisputeV2::Status::TaggedSymbol) + CLOSED = T.let(:CLOSED, Lithic::DisputeV2::Status::TaggedSymbol) + + sig do + override.returns(T::Array[Lithic::DisputeV2::Status::TaggedSymbol]) + end + def self.values + end + end + + class TransactionSeries < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::DisputeV2::TransactionSeries, + Lithic::Internal::AnyHash + ) + end + + # Token of the specific event in the original transaction being disputed, in UUID + # format; null if no event can be identified + sig { returns(T.nilable(String)) } + attr_accessor :related_transaction_event_token + + # Token of the original transaction being disputed, in UUID format + sig { returns(String) } + attr_accessor :related_transaction_token + + # The type of transaction series associating the dispute and the original + # transaction. Always set to DISPUTE + sig do + returns(Lithic::DisputeV2::TransactionSeries::Type::TaggedSymbol) + end + attr_accessor :type + + # Contains identifiers for the transaction and specific event within being + # disputed; null if no transaction can be identified + sig do + params( + related_transaction_event_token: T.nilable(String), + related_transaction_token: String, + type: Lithic::DisputeV2::TransactionSeries::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Token of the specific event in the original transaction being disputed, in UUID + # format; null if no event can be identified + related_transaction_event_token:, + # Token of the original transaction being disputed, in UUID format + related_transaction_token:, + # The type of transaction series associating the dispute and the original + # transaction. Always set to DISPUTE + type: + ) + end + + sig do + override.returns( + { + related_transaction_event_token: T.nilable(String), + related_transaction_token: String, + type: Lithic::DisputeV2::TransactionSeries::Type::TaggedSymbol + } + ) + end + def to_hash + end + + # The type of transaction series associating the dispute and the original + # transaction. Always set to DISPUTE + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::DisputeV2::TransactionSeries::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DISPUTE = + T.let( + :DISPUTE, + Lithic::DisputeV2::TransactionSeries::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::DisputeV2::TransactionSeries::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/disputes_v2_list_params.rbi b/rbi/lithic/models/disputes_v2_list_params.rbi new file mode 100644 index 00000000..4dd93783 --- /dev/null +++ b/rbi/lithic/models/disputes_v2_list_params.rbi @@ -0,0 +1,129 @@ +# typed: strong + +module Lithic + module Models + class DisputesV2ListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::DisputesV2ListParams, Lithic::Internal::AnyHash) + end + + # Filter by account token. + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # RFC 3339 timestamp for filtering by created date, inclusive. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Filter by card token. + sig { returns(T.nilable(String)) } + attr_reader :card_token + + sig { params(card_token: String).void } + attr_writer :card_token + + # Filter by the token of the transaction being disputed. Corresponds with + # transaction_series.related_transaction_token in the Dispute. + sig { returns(T.nilable(String)) } + attr_reader :disputed_transaction_token + + sig { params(disputed_transaction_token: String).void } + attr_writer :disputed_transaction_token + + # RFC 3339 timestamp for filtering by created date, inclusive. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Number of items to return. + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + account_token: String, + begin_: Time, + card_token: String, + disputed_transaction_token: String, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Filter by account token. + account_token: nil, + # RFC 3339 timestamp for filtering by created date, inclusive. + begin_: nil, + # Filter by card token. + card_token: nil, + # Filter by the token of the transaction being disputed. Corresponds with + # transaction_series.related_transaction_token in the Dispute. + disputed_transaction_token: nil, + # RFC 3339 timestamp for filtering by created date, inclusive. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Number of items to return. + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + account_token: String, + begin_: Time, + card_token: String, + disputed_transaction_token: String, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/disputes_v2_retrieve_params.rbi b/rbi/lithic/models/disputes_v2_retrieve_params.rbi new file mode 100644 index 00000000..863a0419 --- /dev/null +++ b/rbi/lithic/models/disputes_v2_retrieve_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Lithic + module Models + class DisputesV2RetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::DisputesV2RetrieveParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :dispute_token + + sig do + params( + dispute_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(dispute_token:, request_options: {}) + end + + sig do + override.returns( + { dispute_token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/document.rbi b/rbi/lithic/models/document.rbi new file mode 100644 index 00000000..ded234ca --- /dev/null +++ b/rbi/lithic/models/document.rbi @@ -0,0 +1,447 @@ +# typed: strong + +module Lithic + module Models + class Document < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Lithic::Document, Lithic::Internal::AnyHash) } + + # Globally unique identifier for the document. + sig { returns(String) } + attr_accessor :token + + # Globally unique identifier for the account holder. + sig { returns(String) } + attr_accessor :account_holder_token + + # Type of documentation to be submitted for verification of an account holder + sig { returns(Lithic::Document::DocumentType::TaggedSymbol) } + attr_accessor :document_type + + # Globally unique identifier for an entity. + sig { returns(String) } + attr_accessor :entity_token + + # Represents a single image of the document to upload. + sig { returns(T::Array[Lithic::Document::RequiredDocumentUpload]) } + attr_accessor :required_document_uploads + + # Describes the document and the required document image uploads required to + # re-run KYC + sig do + params( + token: String, + account_holder_token: String, + document_type: Lithic::Document::DocumentType::OrSymbol, + entity_token: String, + required_document_uploads: + T::Array[Lithic::Document::RequiredDocumentUpload::OrHash] + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the document. + token:, + # Globally unique identifier for the account holder. + account_holder_token:, + # Type of documentation to be submitted for verification of an account holder + document_type:, + # Globally unique identifier for an entity. + entity_token:, + # Represents a single image of the document to upload. + required_document_uploads: + ) + end + + sig do + override.returns( + { + token: String, + account_holder_token: String, + document_type: Lithic::Document::DocumentType::TaggedSymbol, + entity_token: String, + required_document_uploads: + T::Array[Lithic::Document::RequiredDocumentUpload] + } + ) + end + def to_hash + end + + # Type of documentation to be submitted for verification of an account holder + module DocumentType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Document::DocumentType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DRIVERS_LICENSE = + T.let(:DRIVERS_LICENSE, Lithic::Document::DocumentType::TaggedSymbol) + PASSPORT = + T.let(:PASSPORT, Lithic::Document::DocumentType::TaggedSymbol) + PASSPORT_CARD = + T.let(:PASSPORT_CARD, Lithic::Document::DocumentType::TaggedSymbol) + EIN_LETTER = + T.let(:EIN_LETTER, Lithic::Document::DocumentType::TaggedSymbol) + TAX_RETURN = + T.let(:TAX_RETURN, Lithic::Document::DocumentType::TaggedSymbol) + OPERATING_AGREEMENT = + T.let( + :OPERATING_AGREEMENT, + Lithic::Document::DocumentType::TaggedSymbol + ) + CERTIFICATE_OF_FORMATION = + T.let( + :CERTIFICATE_OF_FORMATION, + Lithic::Document::DocumentType::TaggedSymbol + ) + CERTIFICATE_OF_GOOD_STANDING = + T.let( + :CERTIFICATE_OF_GOOD_STANDING, + Lithic::Document::DocumentType::TaggedSymbol + ) + ARTICLES_OF_INCORPORATION = + T.let( + :ARTICLES_OF_INCORPORATION, + Lithic::Document::DocumentType::TaggedSymbol + ) + ARTICLES_OF_ORGANIZATION = + T.let( + :ARTICLES_OF_ORGANIZATION, + Lithic::Document::DocumentType::TaggedSymbol + ) + BYLAWS = T.let(:BYLAWS, Lithic::Document::DocumentType::TaggedSymbol) + GOVERNMENT_BUSINESS_LICENSE = + T.let( + :GOVERNMENT_BUSINESS_LICENSE, + Lithic::Document::DocumentType::TaggedSymbol + ) + PARTNERSHIP_AGREEMENT = + T.let( + :PARTNERSHIP_AGREEMENT, + Lithic::Document::DocumentType::TaggedSymbol + ) + SS4_FORM = + T.let(:SS4_FORM, Lithic::Document::DocumentType::TaggedSymbol) + BANK_STATEMENT = + T.let(:BANK_STATEMENT, Lithic::Document::DocumentType::TaggedSymbol) + UTILITY_BILL_STATEMENT = + T.let( + :UTILITY_BILL_STATEMENT, + Lithic::Document::DocumentType::TaggedSymbol + ) + SSN_CARD = + T.let(:SSN_CARD, Lithic::Document::DocumentType::TaggedSymbol) + ITIN_LETTER = + T.let(:ITIN_LETTER, Lithic::Document::DocumentType::TaggedSymbol) + FINCEN_BOI_REPORT = + T.let( + :FINCEN_BOI_REPORT, + Lithic::Document::DocumentType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::Document::DocumentType::TaggedSymbol] + ) + end + def self.values + end + end + + class RequiredDocumentUpload < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Document::RequiredDocumentUpload, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for the document upload. + sig { returns(String) } + attr_accessor :token + + # A list of status reasons associated with a KYB account holder that have been + # satisfied by the document upload + sig { returns(T::Array[String]) } + attr_accessor :accepted_entity_status_reasons + + # When the document upload was created + sig { returns(Time) } + attr_accessor :created + + # Type of image to upload. + sig do + returns( + Lithic::Document::RequiredDocumentUpload::ImageType::TaggedSymbol + ) + end + attr_accessor :image_type + + # A list of status reasons associated with a KYB account holder that have not been + # satisfied by the document upload + sig { returns(T::Array[String]) } + attr_accessor :rejected_entity_status_reasons + + # Status of an account holder's document upload. + sig do + returns( + Lithic::Document::RequiredDocumentUpload::Status::TaggedSymbol + ) + end + attr_accessor :status + + # Reasons for document image upload status. + sig do + returns( + T::Array[ + Lithic::Document::RequiredDocumentUpload::StatusReason::TaggedSymbol + ] + ) + end + attr_accessor :status_reasons + + # When the document upload was last updated + sig { returns(Time) } + attr_accessor :updated + + # URL to upload document image to. + # + # Note that the upload URLs expire after 7 days. If an upload URL expires, you can + # refresh the URLs by retrieving the document upload from + # `GET /account_holders/{account_holder_token}/documents`. + sig { returns(String) } + attr_accessor :upload_url + + # Represents a single image of the document to upload. + sig do + params( + token: String, + accepted_entity_status_reasons: T::Array[String], + created: Time, + image_type: + Lithic::Document::RequiredDocumentUpload::ImageType::OrSymbol, + rejected_entity_status_reasons: T::Array[String], + status: Lithic::Document::RequiredDocumentUpload::Status::OrSymbol, + status_reasons: + T::Array[ + Lithic::Document::RequiredDocumentUpload::StatusReason::OrSymbol + ], + updated: Time, + upload_url: String + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the document upload. + token:, + # A list of status reasons associated with a KYB account holder that have been + # satisfied by the document upload + accepted_entity_status_reasons:, + # When the document upload was created + created:, + # Type of image to upload. + image_type:, + # A list of status reasons associated with a KYB account holder that have not been + # satisfied by the document upload + rejected_entity_status_reasons:, + # Status of an account holder's document upload. + status:, + # Reasons for document image upload status. + status_reasons:, + # When the document upload was last updated + updated:, + # URL to upload document image to. + # + # Note that the upload URLs expire after 7 days. If an upload URL expires, you can + # refresh the URLs by retrieving the document upload from + # `GET /account_holders/{account_holder_token}/documents`. + upload_url: + ) + end + + sig do + override.returns( + { + token: String, + accepted_entity_status_reasons: T::Array[String], + created: Time, + image_type: + Lithic::Document::RequiredDocumentUpload::ImageType::TaggedSymbol, + rejected_entity_status_reasons: T::Array[String], + status: + Lithic::Document::RequiredDocumentUpload::Status::TaggedSymbol, + status_reasons: + T::Array[ + Lithic::Document::RequiredDocumentUpload::StatusReason::TaggedSymbol + ], + updated: Time, + upload_url: String + } + ) + end + def to_hash + end + + # Type of image to upload. + module ImageType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Document::RequiredDocumentUpload::ImageType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FRONT = + T.let( + :FRONT, + Lithic::Document::RequiredDocumentUpload::ImageType::TaggedSymbol + ) + BACK = + T.let( + :BACK, + Lithic::Document::RequiredDocumentUpload::ImageType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Document::RequiredDocumentUpload::ImageType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Status of an account holder's document upload. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Document::RequiredDocumentUpload::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCEPTED = + T.let( + :ACCEPTED, + Lithic::Document::RequiredDocumentUpload::Status::TaggedSymbol + ) + REJECTED = + T.let( + :REJECTED, + Lithic::Document::RequiredDocumentUpload::Status::TaggedSymbol + ) + PENDING_UPLOAD = + T.let( + :PENDING_UPLOAD, + Lithic::Document::RequiredDocumentUpload::Status::TaggedSymbol + ) + UPLOADED = + T.let( + :UPLOADED, + Lithic::Document::RequiredDocumentUpload::Status::TaggedSymbol + ) + PARTIAL_APPROVAL = + T.let( + :PARTIAL_APPROVAL, + Lithic::Document::RequiredDocumentUpload::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Document::RequiredDocumentUpload::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The status reasons for an account holder document upload that is not ACCEPTED + module StatusReason + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Document::RequiredDocumentUpload::StatusReason + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DOCUMENT_MISSING_REQUIRED_DATA = + T.let( + :DOCUMENT_MISSING_REQUIRED_DATA, + Lithic::Document::RequiredDocumentUpload::StatusReason::TaggedSymbol + ) + DOCUMENT_UPLOAD_TOO_BLURRY = + T.let( + :DOCUMENT_UPLOAD_TOO_BLURRY, + Lithic::Document::RequiredDocumentUpload::StatusReason::TaggedSymbol + ) + FILE_SIZE_TOO_LARGE = + T.let( + :FILE_SIZE_TOO_LARGE, + Lithic::Document::RequiredDocumentUpload::StatusReason::TaggedSymbol + ) + INVALID_DOCUMENT_TYPE = + T.let( + :INVALID_DOCUMENT_TYPE, + Lithic::Document::RequiredDocumentUpload::StatusReason::TaggedSymbol + ) + INVALID_DOCUMENT_UPLOAD = + T.let( + :INVALID_DOCUMENT_UPLOAD, + Lithic::Document::RequiredDocumentUpload::StatusReason::TaggedSymbol + ) + INVALID_ENTITY = + T.let( + :INVALID_ENTITY, + Lithic::Document::RequiredDocumentUpload::StatusReason::TaggedSymbol + ) + DOCUMENT_EXPIRED = + T.let( + :DOCUMENT_EXPIRED, + Lithic::Document::RequiredDocumentUpload::StatusReason::TaggedSymbol + ) + DOCUMENT_ISSUED_GREATER_THAN_30_DAYS = + T.let( + :DOCUMENT_ISSUED_GREATER_THAN_30_DAYS, + Lithic::Document::RequiredDocumentUpload::StatusReason::TaggedSymbol + ) + DOCUMENT_TYPE_NOT_SUPPORTED = + T.let( + :DOCUMENT_TYPE_NOT_SUPPORTED, + Lithic::Document::RequiredDocumentUpload::StatusReason::TaggedSymbol + ) + UNKNOWN_FAILURE_REASON = + T.let( + :UNKNOWN_FAILURE_REASON, + Lithic::Document::RequiredDocumentUpload::StatusReason::TaggedSymbol + ) + UNKNOWN_ERROR = + T.let( + :UNKNOWN_ERROR, + Lithic::Document::RequiredDocumentUpload::StatusReason::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Document::RequiredDocumentUpload::StatusReason::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/event.rbi b/rbi/lithic/models/event.rbi new file mode 100644 index 00000000..c203e23a --- /dev/null +++ b/rbi/lithic/models/event.rbi @@ -0,0 +1,616 @@ +# typed: strong + +module Lithic + module Models + class Event < Lithic::Internal::Type::BaseModel + OrHash = T.type_alias { T.any(Lithic::Event, Lithic::Internal::AnyHash) } + + # Globally unique identifier. + sig { returns(String) } + attr_accessor :token + + # An RFC 3339 timestamp for when the event was created. UTC time zone. + # + # If no timezone is specified, UTC will be used. + sig { returns(Time) } + attr_accessor :created + + # The type of event that occurred. Possible values: + # + # - account_holder_document.updated: Occurs when an account holder's document + # upload status has been updated + # - account_holder.created: Occurs when a new account_holder is created. + # - account_holder.updated: Occurs when an account_holder is updated. + # - account_holder.verification: Occurs when an asynchronous account_holder's + # verification is completed. + # - auth_rules.backtest_report.created: Auth Rules backtest report created. + # - balance.updated: Financial Account Balance Update + # - book_transfer_transaction.created: Occurs when a book transfer transaction is + # created. + # - book_transfer_transaction.updated: Occurs when a book transfer transaction is + # updated. + # - card_authorization.challenge: Occurs when an Out of Band challenge is issued + # during card authorization. The card program should issue its own challenge to + # the cardholder and then respond via + # [/v1/card_authorizations/{event_token}/challenge_response](https://docs.lithic.com/reference/respondtoauthorizationchallenge). + # - card_authorization.challenge_response: Occurs when a cardholder responds to a + # challenge during card authorization. + # - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial + # data is processed for a transaction event. + # - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial + # data is reprocessed for a transaction event. + # - card_transaction.updated: Occurs when a card transaction happens. + # - card.converted: Occurs when a card is converted from virtual to physical + # cards. + # - card.created: Occurs when a new card is created. + # - card.reissued: Occurs when a card is reissued. + # - card.renewed: Occurs when a card is renewed. + # - card.shipped: Occurs when a card is shipped. + # - card.updated: Occurs when a card is updated. + # - digital_wallet.tokenization_result: Occurs when a tokenization request + # succeeded or failed. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.result` instead. + # + # - digital_wallet.tokenization_two_factor_authentication_code: Occurs when a + # tokenization request 2FA code is sent to the Lithic customer for self serve + # delivery. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.two_factor_authentication_code` instead. + # + # - digital_wallet.tokenization_two_factor_authentication_code_sent: Occurs when a + # tokenization request 2FA code is sent to our downstream messaging providers + # for delivery. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.two_factor_authentication_code_sent` instead. + # + # - digital_wallet.tokenization_updated: Occurs when a tokenization's status has + # changed. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.updated` instead. + # + # - dispute_evidence.upload_failed: Occurs when a dispute evidence upload fails. + # - dispute_transaction.created: Occurs when a new dispute transaction is created + # - dispute_transaction.updated: Occurs when a dispute transaction is updated + # - dispute.updated: Occurs when a dispute is updated. + # - external_bank_account.created: Occurs when an external bank account is + # created. + # - external_bank_account.updated: Occurs when an external bank account is + # updated. + # - external_payment.created: Occurs when an external payment is created. + # - external_payment.updated: Occurs when an external payment is updated. + # - financial_account.created: Occurs when a financial account is created. + # - financial_account.updated: Occurs when a financial account is updated. + # - funding_event.created: Occurs when a funding event is created. + # - internal_transaction.created: Occurs when an internal adjustment is created. + # - internal_transaction.updated: Occurs when an internal adjustment is updated. + # - loan_tape.created: Occurs when a loan tape is created. + # - loan_tape.updated: Occurs when a loan tape is updated. + # - management_operation.created: Occurs when an management operation is created. + # - management_operation.updated: Occurs when an management operation is updated. + # - network_total.created: Occurs when a network total is created. + # - network_total.updated: Occurs when a network total is updated. + # - payment_transaction.created: Occurs when a payment transaction is created. + # - payment_transaction.updated: Occurs when a payment transaction is updated. + # - settlement_report.updated: Occurs when a settlement report is created or + # updated. + # - statements.created: Occurs when a statement has been created + # - three_ds_authentication.challenge: The `three_ds_authentication.challenge` + # event. Upon receiving this request, the Card Program should issue its own + # challenge to the cardholder. After a cardholder challenge is successfully + # completed, the Card Program needs to respond back to Lithic by call to + # [/v1/three_ds_decisioning/challenge_response](https://docs.lithic.com/reference/post_v1-three-ds-decisioning-challenge-response). + # Then the cardholder must navigate back to the merchant checkout flow to + # complete the transaction. Some merchants will include an `app_requestor_url` + # for app-based purchases; Lithic recommends triggering a redirect to that URL + # after the cardholder completes an app-based challenge. + # - three_ds_authentication.created: Occurs when a 3DS authentication is created. + # - three_ds_authentication.updated: Occurs when a 3DS authentication is updated + # (eg. challenge is completed). + # - tokenization.approval_request: Occurs when a tokenization approval request is + # made. + # - tokenization.result: Occurs when a tokenization request succeeded or failed. + # - tokenization.two_factor_authentication_code: Occurs when a tokenization + # request 2FA code is sent to the Lithic customer for self serve delivery. + # - tokenization.two_factor_authentication_code_sent: Occurs when a tokenization + # request 2FA code is sent to our downstream messaging providers for delivery. + # - tokenization.updated: Occurs when a tokenization's status has changed. + sig { returns(Lithic::Event::EventType::TaggedSymbol) } + attr_accessor :event_type + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :payload + + # A single event that affects the transaction state and lifecycle. + sig do + params( + token: String, + created: Time, + event_type: Lithic::Event::EventType::OrSymbol, + payload: T::Hash[Symbol, T.anything] + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier. + token:, + # An RFC 3339 timestamp for when the event was created. UTC time zone. + # + # If no timezone is specified, UTC will be used. + created:, + # The type of event that occurred. Possible values: + # + # - account_holder_document.updated: Occurs when an account holder's document + # upload status has been updated + # - account_holder.created: Occurs when a new account_holder is created. + # - account_holder.updated: Occurs when an account_holder is updated. + # - account_holder.verification: Occurs when an asynchronous account_holder's + # verification is completed. + # - auth_rules.backtest_report.created: Auth Rules backtest report created. + # - balance.updated: Financial Account Balance Update + # - book_transfer_transaction.created: Occurs when a book transfer transaction is + # created. + # - book_transfer_transaction.updated: Occurs when a book transfer transaction is + # updated. + # - card_authorization.challenge: Occurs when an Out of Band challenge is issued + # during card authorization. The card program should issue its own challenge to + # the cardholder and then respond via + # [/v1/card_authorizations/{event_token}/challenge_response](https://docs.lithic.com/reference/respondtoauthorizationchallenge). + # - card_authorization.challenge_response: Occurs when a cardholder responds to a + # challenge during card authorization. + # - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial + # data is processed for a transaction event. + # - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial + # data is reprocessed for a transaction event. + # - card_transaction.updated: Occurs when a card transaction happens. + # - card.converted: Occurs when a card is converted from virtual to physical + # cards. + # - card.created: Occurs when a new card is created. + # - card.reissued: Occurs when a card is reissued. + # - card.renewed: Occurs when a card is renewed. + # - card.shipped: Occurs when a card is shipped. + # - card.updated: Occurs when a card is updated. + # - digital_wallet.tokenization_result: Occurs when a tokenization request + # succeeded or failed. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.result` instead. + # + # - digital_wallet.tokenization_two_factor_authentication_code: Occurs when a + # tokenization request 2FA code is sent to the Lithic customer for self serve + # delivery. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.two_factor_authentication_code` instead. + # + # - digital_wallet.tokenization_two_factor_authentication_code_sent: Occurs when a + # tokenization request 2FA code is sent to our downstream messaging providers + # for delivery. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.two_factor_authentication_code_sent` instead. + # + # - digital_wallet.tokenization_updated: Occurs when a tokenization's status has + # changed. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.updated` instead. + # + # - dispute_evidence.upload_failed: Occurs when a dispute evidence upload fails. + # - dispute_transaction.created: Occurs when a new dispute transaction is created + # - dispute_transaction.updated: Occurs when a dispute transaction is updated + # - dispute.updated: Occurs when a dispute is updated. + # - external_bank_account.created: Occurs when an external bank account is + # created. + # - external_bank_account.updated: Occurs when an external bank account is + # updated. + # - external_payment.created: Occurs when an external payment is created. + # - external_payment.updated: Occurs when an external payment is updated. + # - financial_account.created: Occurs when a financial account is created. + # - financial_account.updated: Occurs when a financial account is updated. + # - funding_event.created: Occurs when a funding event is created. + # - internal_transaction.created: Occurs when an internal adjustment is created. + # - internal_transaction.updated: Occurs when an internal adjustment is updated. + # - loan_tape.created: Occurs when a loan tape is created. + # - loan_tape.updated: Occurs when a loan tape is updated. + # - management_operation.created: Occurs when an management operation is created. + # - management_operation.updated: Occurs when an management operation is updated. + # - network_total.created: Occurs when a network total is created. + # - network_total.updated: Occurs when a network total is updated. + # - payment_transaction.created: Occurs when a payment transaction is created. + # - payment_transaction.updated: Occurs when a payment transaction is updated. + # - settlement_report.updated: Occurs when a settlement report is created or + # updated. + # - statements.created: Occurs when a statement has been created + # - three_ds_authentication.challenge: The `three_ds_authentication.challenge` + # event. Upon receiving this request, the Card Program should issue its own + # challenge to the cardholder. After a cardholder challenge is successfully + # completed, the Card Program needs to respond back to Lithic by call to + # [/v1/three_ds_decisioning/challenge_response](https://docs.lithic.com/reference/post_v1-three-ds-decisioning-challenge-response). + # Then the cardholder must navigate back to the merchant checkout flow to + # complete the transaction. Some merchants will include an `app_requestor_url` + # for app-based purchases; Lithic recommends triggering a redirect to that URL + # after the cardholder completes an app-based challenge. + # - three_ds_authentication.created: Occurs when a 3DS authentication is created. + # - three_ds_authentication.updated: Occurs when a 3DS authentication is updated + # (eg. challenge is completed). + # - tokenization.approval_request: Occurs when a tokenization approval request is + # made. + # - tokenization.result: Occurs when a tokenization request succeeded or failed. + # - tokenization.two_factor_authentication_code: Occurs when a tokenization + # request 2FA code is sent to the Lithic customer for self serve delivery. + # - tokenization.two_factor_authentication_code_sent: Occurs when a tokenization + # request 2FA code is sent to our downstream messaging providers for delivery. + # - tokenization.updated: Occurs when a tokenization's status has changed. + event_type:, + payload: + ) + end + + sig do + override.returns( + { + token: String, + created: Time, + event_type: Lithic::Event::EventType::TaggedSymbol, + payload: T::Hash[Symbol, T.anything] + } + ) + end + def to_hash + end + + # The type of event that occurred. Possible values: + # + # - account_holder_document.updated: Occurs when an account holder's document + # upload status has been updated + # - account_holder.created: Occurs when a new account_holder is created. + # - account_holder.updated: Occurs when an account_holder is updated. + # - account_holder.verification: Occurs when an asynchronous account_holder's + # verification is completed. + # - auth_rules.backtest_report.created: Auth Rules backtest report created. + # - balance.updated: Financial Account Balance Update + # - book_transfer_transaction.created: Occurs when a book transfer transaction is + # created. + # - book_transfer_transaction.updated: Occurs when a book transfer transaction is + # updated. + # - card_authorization.challenge: Occurs when an Out of Band challenge is issued + # during card authorization. The card program should issue its own challenge to + # the cardholder and then respond via + # [/v1/card_authorizations/{event_token}/challenge_response](https://docs.lithic.com/reference/respondtoauthorizationchallenge). + # - card_authorization.challenge_response: Occurs when a cardholder responds to a + # challenge during card authorization. + # - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial + # data is processed for a transaction event. + # - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial + # data is reprocessed for a transaction event. + # - card_transaction.updated: Occurs when a card transaction happens. + # - card.converted: Occurs when a card is converted from virtual to physical + # cards. + # - card.created: Occurs when a new card is created. + # - card.reissued: Occurs when a card is reissued. + # - card.renewed: Occurs when a card is renewed. + # - card.shipped: Occurs when a card is shipped. + # - card.updated: Occurs when a card is updated. + # - digital_wallet.tokenization_result: Occurs when a tokenization request + # succeeded or failed. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.result` instead. + # + # - digital_wallet.tokenization_two_factor_authentication_code: Occurs when a + # tokenization request 2FA code is sent to the Lithic customer for self serve + # delivery. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.two_factor_authentication_code` instead. + # + # - digital_wallet.tokenization_two_factor_authentication_code_sent: Occurs when a + # tokenization request 2FA code is sent to our downstream messaging providers + # for delivery. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.two_factor_authentication_code_sent` instead. + # + # - digital_wallet.tokenization_updated: Occurs when a tokenization's status has + # changed. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.updated` instead. + # + # - dispute_evidence.upload_failed: Occurs when a dispute evidence upload fails. + # - dispute_transaction.created: Occurs when a new dispute transaction is created + # - dispute_transaction.updated: Occurs when a dispute transaction is updated + # - dispute.updated: Occurs when a dispute is updated. + # - external_bank_account.created: Occurs when an external bank account is + # created. + # - external_bank_account.updated: Occurs when an external bank account is + # updated. + # - external_payment.created: Occurs when an external payment is created. + # - external_payment.updated: Occurs when an external payment is updated. + # - financial_account.created: Occurs when a financial account is created. + # - financial_account.updated: Occurs when a financial account is updated. + # - funding_event.created: Occurs when a funding event is created. + # - internal_transaction.created: Occurs when an internal adjustment is created. + # - internal_transaction.updated: Occurs when an internal adjustment is updated. + # - loan_tape.created: Occurs when a loan tape is created. + # - loan_tape.updated: Occurs when a loan tape is updated. + # - management_operation.created: Occurs when an management operation is created. + # - management_operation.updated: Occurs when an management operation is updated. + # - network_total.created: Occurs when a network total is created. + # - network_total.updated: Occurs when a network total is updated. + # - payment_transaction.created: Occurs when a payment transaction is created. + # - payment_transaction.updated: Occurs when a payment transaction is updated. + # - settlement_report.updated: Occurs when a settlement report is created or + # updated. + # - statements.created: Occurs when a statement has been created + # - three_ds_authentication.challenge: The `three_ds_authentication.challenge` + # event. Upon receiving this request, the Card Program should issue its own + # challenge to the cardholder. After a cardholder challenge is successfully + # completed, the Card Program needs to respond back to Lithic by call to + # [/v1/three_ds_decisioning/challenge_response](https://docs.lithic.com/reference/post_v1-three-ds-decisioning-challenge-response). + # Then the cardholder must navigate back to the merchant checkout flow to + # complete the transaction. Some merchants will include an `app_requestor_url` + # for app-based purchases; Lithic recommends triggering a redirect to that URL + # after the cardholder completes an app-based challenge. + # - three_ds_authentication.created: Occurs when a 3DS authentication is created. + # - three_ds_authentication.updated: Occurs when a 3DS authentication is updated + # (eg. challenge is completed). + # - tokenization.approval_request: Occurs when a tokenization approval request is + # made. + # - tokenization.result: Occurs when a tokenization request succeeded or failed. + # - tokenization.two_factor_authentication_code: Occurs when a tokenization + # request 2FA code is sent to the Lithic customer for self serve delivery. + # - tokenization.two_factor_authentication_code_sent: Occurs when a tokenization + # request 2FA code is sent to our downstream messaging providers for delivery. + # - tokenization.updated: Occurs when a tokenization's status has changed. + module EventType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Event::EventType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_HOLDER_DOCUMENT_UPDATED = + T.let( + :"account_holder_document.updated", + Lithic::Event::EventType::TaggedSymbol + ) + ACCOUNT_HOLDER_CREATED = + T.let( + :"account_holder.created", + Lithic::Event::EventType::TaggedSymbol + ) + ACCOUNT_HOLDER_UPDATED = + T.let( + :"account_holder.updated", + Lithic::Event::EventType::TaggedSymbol + ) + ACCOUNT_HOLDER_VERIFICATION = + T.let( + :"account_holder.verification", + Lithic::Event::EventType::TaggedSymbol + ) + AUTH_RULES_BACKTEST_REPORT_CREATED = + T.let( + :"auth_rules.backtest_report.created", + Lithic::Event::EventType::TaggedSymbol + ) + BALANCE_UPDATED = + T.let(:"balance.updated", Lithic::Event::EventType::TaggedSymbol) + BOOK_TRANSFER_TRANSACTION_CREATED = + T.let( + :"book_transfer_transaction.created", + Lithic::Event::EventType::TaggedSymbol + ) + BOOK_TRANSFER_TRANSACTION_UPDATED = + T.let( + :"book_transfer_transaction.updated", + Lithic::Event::EventType::TaggedSymbol + ) + CARD_AUTHORIZATION_CHALLENGE = + T.let( + :"card_authorization.challenge", + Lithic::Event::EventType::TaggedSymbol + ) + CARD_AUTHORIZATION_CHALLENGE_RESPONSE = + T.let( + :"card_authorization.challenge_response", + Lithic::Event::EventType::TaggedSymbol + ) + CARD_TRANSACTION_ENHANCED_DATA_CREATED = + T.let( + :"card_transaction.enhanced_data.created", + Lithic::Event::EventType::TaggedSymbol + ) + CARD_TRANSACTION_ENHANCED_DATA_UPDATED = + T.let( + :"card_transaction.enhanced_data.updated", + Lithic::Event::EventType::TaggedSymbol + ) + CARD_TRANSACTION_UPDATED = + T.let( + :"card_transaction.updated", + Lithic::Event::EventType::TaggedSymbol + ) + CARD_CONVERTED = + T.let(:"card.converted", Lithic::Event::EventType::TaggedSymbol) + CARD_CREATED = + T.let(:"card.created", Lithic::Event::EventType::TaggedSymbol) + CARD_REISSUED = + T.let(:"card.reissued", Lithic::Event::EventType::TaggedSymbol) + CARD_RENEWED = + T.let(:"card.renewed", Lithic::Event::EventType::TaggedSymbol) + CARD_SHIPPED = + T.let(:"card.shipped", Lithic::Event::EventType::TaggedSymbol) + CARD_UPDATED = + T.let(:"card.updated", Lithic::Event::EventType::TaggedSymbol) + DIGITAL_WALLET_TOKENIZATION_RESULT = + T.let( + :"digital_wallet.tokenization_result", + Lithic::Event::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + T.let( + :"digital_wallet.tokenization_two_factor_authentication_code", + Lithic::Event::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + T.let( + :"digital_wallet.tokenization_two_factor_authentication_code_sent", + Lithic::Event::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_UPDATED = + T.let( + :"digital_wallet.tokenization_updated", + Lithic::Event::EventType::TaggedSymbol + ) + DISPUTE_EVIDENCE_UPLOAD_FAILED = + T.let( + :"dispute_evidence.upload_failed", + Lithic::Event::EventType::TaggedSymbol + ) + DISPUTE_TRANSACTION_CREATED = + T.let( + :"dispute_transaction.created", + Lithic::Event::EventType::TaggedSymbol + ) + DISPUTE_TRANSACTION_UPDATED = + T.let( + :"dispute_transaction.updated", + Lithic::Event::EventType::TaggedSymbol + ) + DISPUTE_UPDATED = + T.let(:"dispute.updated", Lithic::Event::EventType::TaggedSymbol) + EXTERNAL_BANK_ACCOUNT_CREATED = + T.let( + :"external_bank_account.created", + Lithic::Event::EventType::TaggedSymbol + ) + EXTERNAL_BANK_ACCOUNT_UPDATED = + T.let( + :"external_bank_account.updated", + Lithic::Event::EventType::TaggedSymbol + ) + EXTERNAL_PAYMENT_CREATED = + T.let( + :"external_payment.created", + Lithic::Event::EventType::TaggedSymbol + ) + EXTERNAL_PAYMENT_UPDATED = + T.let( + :"external_payment.updated", + Lithic::Event::EventType::TaggedSymbol + ) + FINANCIAL_ACCOUNT_CREATED = + T.let( + :"financial_account.created", + Lithic::Event::EventType::TaggedSymbol + ) + FINANCIAL_ACCOUNT_UPDATED = + T.let( + :"financial_account.updated", + Lithic::Event::EventType::TaggedSymbol + ) + FUNDING_EVENT_CREATED = + T.let( + :"funding_event.created", + Lithic::Event::EventType::TaggedSymbol + ) + INTERNAL_TRANSACTION_CREATED = + T.let( + :"internal_transaction.created", + Lithic::Event::EventType::TaggedSymbol + ) + INTERNAL_TRANSACTION_UPDATED = + T.let( + :"internal_transaction.updated", + Lithic::Event::EventType::TaggedSymbol + ) + LOAN_TAPE_CREATED = + T.let(:"loan_tape.created", Lithic::Event::EventType::TaggedSymbol) + LOAN_TAPE_UPDATED = + T.let(:"loan_tape.updated", Lithic::Event::EventType::TaggedSymbol) + MANAGEMENT_OPERATION_CREATED = + T.let( + :"management_operation.created", + Lithic::Event::EventType::TaggedSymbol + ) + MANAGEMENT_OPERATION_UPDATED = + T.let( + :"management_operation.updated", + Lithic::Event::EventType::TaggedSymbol + ) + NETWORK_TOTAL_CREATED = + T.let( + :"network_total.created", + Lithic::Event::EventType::TaggedSymbol + ) + NETWORK_TOTAL_UPDATED = + T.let( + :"network_total.updated", + Lithic::Event::EventType::TaggedSymbol + ) + PAYMENT_TRANSACTION_CREATED = + T.let( + :"payment_transaction.created", + Lithic::Event::EventType::TaggedSymbol + ) + PAYMENT_TRANSACTION_UPDATED = + T.let( + :"payment_transaction.updated", + Lithic::Event::EventType::TaggedSymbol + ) + SETTLEMENT_REPORT_UPDATED = + T.let( + :"settlement_report.updated", + Lithic::Event::EventType::TaggedSymbol + ) + STATEMENTS_CREATED = + T.let(:"statements.created", Lithic::Event::EventType::TaggedSymbol) + THREE_DS_AUTHENTICATION_CHALLENGE = + T.let( + :"three_ds_authentication.challenge", + Lithic::Event::EventType::TaggedSymbol + ) + THREE_DS_AUTHENTICATION_CREATED = + T.let( + :"three_ds_authentication.created", + Lithic::Event::EventType::TaggedSymbol + ) + THREE_DS_AUTHENTICATION_UPDATED = + T.let( + :"three_ds_authentication.updated", + Lithic::Event::EventType::TaggedSymbol + ) + TOKENIZATION_APPROVAL_REQUEST = + T.let( + :"tokenization.approval_request", + Lithic::Event::EventType::TaggedSymbol + ) + TOKENIZATION_RESULT = + T.let(:"tokenization.result", Lithic::Event::EventType::TaggedSymbol) + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + T.let( + :"tokenization.two_factor_authentication_code", + Lithic::Event::EventType::TaggedSymbol + ) + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + T.let( + :"tokenization.two_factor_authentication_code_sent", + Lithic::Event::EventType::TaggedSymbol + ) + TOKENIZATION_UPDATED = + T.let(:"tokenization.updated", Lithic::Event::EventType::TaggedSymbol) + + sig do + override.returns(T::Array[Lithic::Event::EventType::TaggedSymbol]) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/event_list_attempts_params.rbi b/rbi/lithic/models/event_list_attempts_params.rbi new file mode 100644 index 00000000..8327268b --- /dev/null +++ b/rbi/lithic/models/event_list_attempts_params.rbi @@ -0,0 +1,144 @@ +# typed: strong + +module Lithic + module Models + class EventListAttemptsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::EventListAttemptsParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :event_token + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + returns(T.nilable(Lithic::EventListAttemptsParams::Status::OrSymbol)) + end + attr_reader :status + + sig do + params(status: Lithic::EventListAttemptsParams::Status::OrSymbol).void + end + attr_writer :status + + sig do + params( + event_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::EventListAttemptsParams::Status::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + event_token:, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + status: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + event_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::EventListAttemptsParams::Status::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::EventListAttemptsParams::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FAILED = + T.let(:FAILED, Lithic::EventListAttemptsParams::Status::TaggedSymbol) + PENDING = + T.let(:PENDING, Lithic::EventListAttemptsParams::Status::TaggedSymbol) + SENDING = + T.let(:SENDING, Lithic::EventListAttemptsParams::Status::TaggedSymbol) + SUCCESS = + T.let(:SUCCESS, Lithic::EventListAttemptsParams::Status::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::EventListAttemptsParams::Status::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/event_list_params.rbi b/rbi/lithic/models/event_list_params.rbi new file mode 100644 index 00000000..17c89e05 --- /dev/null +++ b/rbi/lithic/models/event_list_params.rbi @@ -0,0 +1,519 @@ +# typed: strong + +module Lithic + module Models + class EventListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::EventListParams, Lithic::Internal::AnyHash) + end + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Event types to filter events by. + sig do + returns( + T.nilable(T::Array[Lithic::EventListParams::EventType::OrSymbol]) + ) + end + attr_reader :event_types + + sig do + params( + event_types: T::Array[Lithic::EventListParams::EventType::OrSymbol] + ).void + end + attr_writer :event_types + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + # Whether to include the event payload content in the response. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :with_content + + sig { params(with_content: T::Boolean).void } + attr_writer :with_content + + sig do + params( + begin_: Time, + end_: Time, + ending_before: String, + event_types: T::Array[Lithic::EventListParams::EventType::OrSymbol], + page_size: Integer, + starting_after: String, + with_content: T::Boolean, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Event types to filter events by. + event_types: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Whether to include the event payload content in the response. + with_content: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + begin_: Time, + end_: Time, + ending_before: String, + event_types: T::Array[Lithic::EventListParams::EventType::OrSymbol], + page_size: Integer, + starting_after: String, + with_content: T::Boolean, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # The type of event that occurred. Possible values: + # + # - account_holder_document.updated: Occurs when an account holder's document + # upload status has been updated + # - account_holder.created: Occurs when a new account_holder is created. + # - account_holder.updated: Occurs when an account_holder is updated. + # - account_holder.verification: Occurs when an asynchronous account_holder's + # verification is completed. + # - auth_rules.backtest_report.created: Auth Rules backtest report created. + # - balance.updated: Financial Account Balance Update + # - book_transfer_transaction.created: Occurs when a book transfer transaction is + # created. + # - book_transfer_transaction.updated: Occurs when a book transfer transaction is + # updated. + # - card_authorization.challenge: Occurs when an Out of Band challenge is issued + # during card authorization. The card program should issue its own challenge to + # the cardholder and then respond via + # [/v1/card_authorizations/{event_token}/challenge_response](https://docs.lithic.com/reference/respondtoauthorizationchallenge). + # - card_authorization.challenge_response: Occurs when a cardholder responds to a + # challenge during card authorization. + # - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial + # data is processed for a transaction event. + # - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial + # data is reprocessed for a transaction event. + # - card_transaction.updated: Occurs when a card transaction happens. + # - card.converted: Occurs when a card is converted from virtual to physical + # cards. + # - card.created: Occurs when a new card is created. + # - card.reissued: Occurs when a card is reissued. + # - card.renewed: Occurs when a card is renewed. + # - card.shipped: Occurs when a card is shipped. + # - card.updated: Occurs when a card is updated. + # - digital_wallet.tokenization_result: Occurs when a tokenization request + # succeeded or failed. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.result` instead. + # + # - digital_wallet.tokenization_two_factor_authentication_code: Occurs when a + # tokenization request 2FA code is sent to the Lithic customer for self serve + # delivery. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.two_factor_authentication_code` instead. + # + # - digital_wallet.tokenization_two_factor_authentication_code_sent: Occurs when a + # tokenization request 2FA code is sent to our downstream messaging providers + # for delivery. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.two_factor_authentication_code_sent` instead. + # + # - digital_wallet.tokenization_updated: Occurs when a tokenization's status has + # changed. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.updated` instead. + # + # - dispute_evidence.upload_failed: Occurs when a dispute evidence upload fails. + # - dispute_transaction.created: Occurs when a new dispute transaction is created + # - dispute_transaction.updated: Occurs when a dispute transaction is updated + # - dispute.updated: Occurs when a dispute is updated. + # - external_bank_account.created: Occurs when an external bank account is + # created. + # - external_bank_account.updated: Occurs when an external bank account is + # updated. + # - external_payment.created: Occurs when an external payment is created. + # - external_payment.updated: Occurs when an external payment is updated. + # - financial_account.created: Occurs when a financial account is created. + # - financial_account.updated: Occurs when a financial account is updated. + # - funding_event.created: Occurs when a funding event is created. + # - internal_transaction.created: Occurs when an internal adjustment is created. + # - internal_transaction.updated: Occurs when an internal adjustment is updated. + # - loan_tape.created: Occurs when a loan tape is created. + # - loan_tape.updated: Occurs when a loan tape is updated. + # - management_operation.created: Occurs when an management operation is created. + # - management_operation.updated: Occurs when an management operation is updated. + # - network_total.created: Occurs when a network total is created. + # - network_total.updated: Occurs when a network total is updated. + # - payment_transaction.created: Occurs when a payment transaction is created. + # - payment_transaction.updated: Occurs when a payment transaction is updated. + # - settlement_report.updated: Occurs when a settlement report is created or + # updated. + # - statements.created: Occurs when a statement has been created + # - three_ds_authentication.challenge: The `three_ds_authentication.challenge` + # event. Upon receiving this request, the Card Program should issue its own + # challenge to the cardholder. After a cardholder challenge is successfully + # completed, the Card Program needs to respond back to Lithic by call to + # [/v1/three_ds_decisioning/challenge_response](https://docs.lithic.com/reference/post_v1-three-ds-decisioning-challenge-response). + # Then the cardholder must navigate back to the merchant checkout flow to + # complete the transaction. Some merchants will include an `app_requestor_url` + # for app-based purchases; Lithic recommends triggering a redirect to that URL + # after the cardholder completes an app-based challenge. + # - three_ds_authentication.created: Occurs when a 3DS authentication is created. + # - three_ds_authentication.updated: Occurs when a 3DS authentication is updated + # (eg. challenge is completed). + # - tokenization.approval_request: Occurs when a tokenization approval request is + # made. + # - tokenization.result: Occurs when a tokenization request succeeded or failed. + # - tokenization.two_factor_authentication_code: Occurs when a tokenization + # request 2FA code is sent to the Lithic customer for self serve delivery. + # - tokenization.two_factor_authentication_code_sent: Occurs when a tokenization + # request 2FA code is sent to our downstream messaging providers for delivery. + # - tokenization.updated: Occurs when a tokenization's status has changed. + module EventType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::EventListParams::EventType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_HOLDER_DOCUMENT_UPDATED = + T.let( + :"account_holder_document.updated", + Lithic::EventListParams::EventType::TaggedSymbol + ) + ACCOUNT_HOLDER_CREATED = + T.let( + :"account_holder.created", + Lithic::EventListParams::EventType::TaggedSymbol + ) + ACCOUNT_HOLDER_UPDATED = + T.let( + :"account_holder.updated", + Lithic::EventListParams::EventType::TaggedSymbol + ) + ACCOUNT_HOLDER_VERIFICATION = + T.let( + :"account_holder.verification", + Lithic::EventListParams::EventType::TaggedSymbol + ) + AUTH_RULES_BACKTEST_REPORT_CREATED = + T.let( + :"auth_rules.backtest_report.created", + Lithic::EventListParams::EventType::TaggedSymbol + ) + BALANCE_UPDATED = + T.let( + :"balance.updated", + Lithic::EventListParams::EventType::TaggedSymbol + ) + BOOK_TRANSFER_TRANSACTION_CREATED = + T.let( + :"book_transfer_transaction.created", + Lithic::EventListParams::EventType::TaggedSymbol + ) + BOOK_TRANSFER_TRANSACTION_UPDATED = + T.let( + :"book_transfer_transaction.updated", + Lithic::EventListParams::EventType::TaggedSymbol + ) + CARD_AUTHORIZATION_CHALLENGE = + T.let( + :"card_authorization.challenge", + Lithic::EventListParams::EventType::TaggedSymbol + ) + CARD_AUTHORIZATION_CHALLENGE_RESPONSE = + T.let( + :"card_authorization.challenge_response", + Lithic::EventListParams::EventType::TaggedSymbol + ) + CARD_TRANSACTION_ENHANCED_DATA_CREATED = + T.let( + :"card_transaction.enhanced_data.created", + Lithic::EventListParams::EventType::TaggedSymbol + ) + CARD_TRANSACTION_ENHANCED_DATA_UPDATED = + T.let( + :"card_transaction.enhanced_data.updated", + Lithic::EventListParams::EventType::TaggedSymbol + ) + CARD_TRANSACTION_UPDATED = + T.let( + :"card_transaction.updated", + Lithic::EventListParams::EventType::TaggedSymbol + ) + CARD_CONVERTED = + T.let( + :"card.converted", + Lithic::EventListParams::EventType::TaggedSymbol + ) + CARD_CREATED = + T.let( + :"card.created", + Lithic::EventListParams::EventType::TaggedSymbol + ) + CARD_REISSUED = + T.let( + :"card.reissued", + Lithic::EventListParams::EventType::TaggedSymbol + ) + CARD_RENEWED = + T.let( + :"card.renewed", + Lithic::EventListParams::EventType::TaggedSymbol + ) + CARD_SHIPPED = + T.let( + :"card.shipped", + Lithic::EventListParams::EventType::TaggedSymbol + ) + CARD_UPDATED = + T.let( + :"card.updated", + Lithic::EventListParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_RESULT = + T.let( + :"digital_wallet.tokenization_result", + Lithic::EventListParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + T.let( + :"digital_wallet.tokenization_two_factor_authentication_code", + Lithic::EventListParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + T.let( + :"digital_wallet.tokenization_two_factor_authentication_code_sent", + Lithic::EventListParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_UPDATED = + T.let( + :"digital_wallet.tokenization_updated", + Lithic::EventListParams::EventType::TaggedSymbol + ) + DISPUTE_EVIDENCE_UPLOAD_FAILED = + T.let( + :"dispute_evidence.upload_failed", + Lithic::EventListParams::EventType::TaggedSymbol + ) + DISPUTE_TRANSACTION_CREATED = + T.let( + :"dispute_transaction.created", + Lithic::EventListParams::EventType::TaggedSymbol + ) + DISPUTE_TRANSACTION_UPDATED = + T.let( + :"dispute_transaction.updated", + Lithic::EventListParams::EventType::TaggedSymbol + ) + DISPUTE_UPDATED = + T.let( + :"dispute.updated", + Lithic::EventListParams::EventType::TaggedSymbol + ) + EXTERNAL_BANK_ACCOUNT_CREATED = + T.let( + :"external_bank_account.created", + Lithic::EventListParams::EventType::TaggedSymbol + ) + EXTERNAL_BANK_ACCOUNT_UPDATED = + T.let( + :"external_bank_account.updated", + Lithic::EventListParams::EventType::TaggedSymbol + ) + EXTERNAL_PAYMENT_CREATED = + T.let( + :"external_payment.created", + Lithic::EventListParams::EventType::TaggedSymbol + ) + EXTERNAL_PAYMENT_UPDATED = + T.let( + :"external_payment.updated", + Lithic::EventListParams::EventType::TaggedSymbol + ) + FINANCIAL_ACCOUNT_CREATED = + T.let( + :"financial_account.created", + Lithic::EventListParams::EventType::TaggedSymbol + ) + FINANCIAL_ACCOUNT_UPDATED = + T.let( + :"financial_account.updated", + Lithic::EventListParams::EventType::TaggedSymbol + ) + FUNDING_EVENT_CREATED = + T.let( + :"funding_event.created", + Lithic::EventListParams::EventType::TaggedSymbol + ) + INTERNAL_TRANSACTION_CREATED = + T.let( + :"internal_transaction.created", + Lithic::EventListParams::EventType::TaggedSymbol + ) + INTERNAL_TRANSACTION_UPDATED = + T.let( + :"internal_transaction.updated", + Lithic::EventListParams::EventType::TaggedSymbol + ) + LOAN_TAPE_CREATED = + T.let( + :"loan_tape.created", + Lithic::EventListParams::EventType::TaggedSymbol + ) + LOAN_TAPE_UPDATED = + T.let( + :"loan_tape.updated", + Lithic::EventListParams::EventType::TaggedSymbol + ) + MANAGEMENT_OPERATION_CREATED = + T.let( + :"management_operation.created", + Lithic::EventListParams::EventType::TaggedSymbol + ) + MANAGEMENT_OPERATION_UPDATED = + T.let( + :"management_operation.updated", + Lithic::EventListParams::EventType::TaggedSymbol + ) + NETWORK_TOTAL_CREATED = + T.let( + :"network_total.created", + Lithic::EventListParams::EventType::TaggedSymbol + ) + NETWORK_TOTAL_UPDATED = + T.let( + :"network_total.updated", + Lithic::EventListParams::EventType::TaggedSymbol + ) + PAYMENT_TRANSACTION_CREATED = + T.let( + :"payment_transaction.created", + Lithic::EventListParams::EventType::TaggedSymbol + ) + PAYMENT_TRANSACTION_UPDATED = + T.let( + :"payment_transaction.updated", + Lithic::EventListParams::EventType::TaggedSymbol + ) + SETTLEMENT_REPORT_UPDATED = + T.let( + :"settlement_report.updated", + Lithic::EventListParams::EventType::TaggedSymbol + ) + STATEMENTS_CREATED = + T.let( + :"statements.created", + Lithic::EventListParams::EventType::TaggedSymbol + ) + THREE_DS_AUTHENTICATION_CHALLENGE = + T.let( + :"three_ds_authentication.challenge", + Lithic::EventListParams::EventType::TaggedSymbol + ) + THREE_DS_AUTHENTICATION_CREATED = + T.let( + :"three_ds_authentication.created", + Lithic::EventListParams::EventType::TaggedSymbol + ) + THREE_DS_AUTHENTICATION_UPDATED = + T.let( + :"three_ds_authentication.updated", + Lithic::EventListParams::EventType::TaggedSymbol + ) + TOKENIZATION_APPROVAL_REQUEST = + T.let( + :"tokenization.approval_request", + Lithic::EventListParams::EventType::TaggedSymbol + ) + TOKENIZATION_RESULT = + T.let( + :"tokenization.result", + Lithic::EventListParams::EventType::TaggedSymbol + ) + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + T.let( + :"tokenization.two_factor_authentication_code", + Lithic::EventListParams::EventType::TaggedSymbol + ) + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + T.let( + :"tokenization.two_factor_authentication_code_sent", + Lithic::EventListParams::EventType::TaggedSymbol + ) + TOKENIZATION_UPDATED = + T.let( + :"tokenization.updated", + Lithic::EventListParams::EventType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::EventListParams::EventType::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/event_retrieve_params.rbi b/rbi/lithic/models/event_retrieve_params.rbi new file mode 100644 index 00000000..93cf5228 --- /dev/null +++ b/rbi/lithic/models/event_retrieve_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Lithic + module Models + class EventRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::EventRetrieveParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :event_token + + sig do + params( + event_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(event_token:, request_options: {}) + end + + sig do + override.returns( + { event_token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/event_subscription.rbi b/rbi/lithic/models/event_subscription.rbi new file mode 100644 index 00000000..dd729079 --- /dev/null +++ b/rbi/lithic/models/event_subscription.rbi @@ -0,0 +1,467 @@ +# typed: strong + +module Lithic + module Models + class EventSubscription < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::EventSubscription, Lithic::Internal::AnyHash) + end + + # Globally unique identifier. + sig { returns(String) } + attr_accessor :token + + # A description of the subscription. + sig { returns(String) } + attr_accessor :description + + # Whether the subscription is disabled. + sig { returns(T::Boolean) } + attr_accessor :disabled + + sig { returns(String) } + attr_accessor :url + + sig do + returns( + T.nilable( + T::Array[Lithic::EventSubscription::EventType::TaggedSymbol] + ) + ) + end + attr_accessor :event_types + + # A subscription to specific event types. + sig do + params( + token: String, + description: String, + disabled: T::Boolean, + url: String, + event_types: + T.nilable(T::Array[Lithic::EventSubscription::EventType::OrSymbol]) + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier. + token:, + # A description of the subscription. + description:, + # Whether the subscription is disabled. + disabled:, + url:, + event_types: nil + ) + end + + sig do + override.returns( + { + token: String, + description: String, + disabled: T::Boolean, + url: String, + event_types: + T.nilable( + T::Array[Lithic::EventSubscription::EventType::TaggedSymbol] + ) + } + ) + end + def to_hash + end + + # The type of event that occurred. Possible values: + # + # - account_holder_document.updated: Occurs when an account holder's document + # upload status has been updated + # - account_holder.created: Occurs when a new account_holder is created. + # - account_holder.updated: Occurs when an account_holder is updated. + # - account_holder.verification: Occurs when an asynchronous account_holder's + # verification is completed. + # - auth_rules.backtest_report.created: Auth Rules backtest report created. + # - balance.updated: Financial Account Balance Update + # - book_transfer_transaction.created: Occurs when a book transfer transaction is + # created. + # - book_transfer_transaction.updated: Occurs when a book transfer transaction is + # updated. + # - card_authorization.challenge: Occurs when an Out of Band challenge is issued + # during card authorization. The card program should issue its own challenge to + # the cardholder and then respond via + # [/v1/card_authorizations/{event_token}/challenge_response](https://docs.lithic.com/reference/respondtoauthorizationchallenge). + # - card_authorization.challenge_response: Occurs when a cardholder responds to a + # challenge during card authorization. + # - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial + # data is processed for a transaction event. + # - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial + # data is reprocessed for a transaction event. + # - card_transaction.updated: Occurs when a card transaction happens. + # - card.converted: Occurs when a card is converted from virtual to physical + # cards. + # - card.created: Occurs when a new card is created. + # - card.reissued: Occurs when a card is reissued. + # - card.renewed: Occurs when a card is renewed. + # - card.shipped: Occurs when a card is shipped. + # - card.updated: Occurs when a card is updated. + # - digital_wallet.tokenization_result: Occurs when a tokenization request + # succeeded or failed. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.result` instead. + # + # - digital_wallet.tokenization_two_factor_authentication_code: Occurs when a + # tokenization request 2FA code is sent to the Lithic customer for self serve + # delivery. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.two_factor_authentication_code` instead. + # + # - digital_wallet.tokenization_two_factor_authentication_code_sent: Occurs when a + # tokenization request 2FA code is sent to our downstream messaging providers + # for delivery. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.two_factor_authentication_code_sent` instead. + # + # - digital_wallet.tokenization_updated: Occurs when a tokenization's status has + # changed. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.updated` instead. + # + # - dispute_evidence.upload_failed: Occurs when a dispute evidence upload fails. + # - dispute_transaction.created: Occurs when a new dispute transaction is created + # - dispute_transaction.updated: Occurs when a dispute transaction is updated + # - dispute.updated: Occurs when a dispute is updated. + # - external_bank_account.created: Occurs when an external bank account is + # created. + # - external_bank_account.updated: Occurs when an external bank account is + # updated. + # - external_payment.created: Occurs when an external payment is created. + # - external_payment.updated: Occurs when an external payment is updated. + # - financial_account.created: Occurs when a financial account is created. + # - financial_account.updated: Occurs when a financial account is updated. + # - funding_event.created: Occurs when a funding event is created. + # - internal_transaction.created: Occurs when an internal adjustment is created. + # - internal_transaction.updated: Occurs when an internal adjustment is updated. + # - loan_tape.created: Occurs when a loan tape is created. + # - loan_tape.updated: Occurs when a loan tape is updated. + # - management_operation.created: Occurs when an management operation is created. + # - management_operation.updated: Occurs when an management operation is updated. + # - network_total.created: Occurs when a network total is created. + # - network_total.updated: Occurs when a network total is updated. + # - payment_transaction.created: Occurs when a payment transaction is created. + # - payment_transaction.updated: Occurs when a payment transaction is updated. + # - settlement_report.updated: Occurs when a settlement report is created or + # updated. + # - statements.created: Occurs when a statement has been created + # - three_ds_authentication.challenge: The `three_ds_authentication.challenge` + # event. Upon receiving this request, the Card Program should issue its own + # challenge to the cardholder. After a cardholder challenge is successfully + # completed, the Card Program needs to respond back to Lithic by call to + # [/v1/three_ds_decisioning/challenge_response](https://docs.lithic.com/reference/post_v1-three-ds-decisioning-challenge-response). + # Then the cardholder must navigate back to the merchant checkout flow to + # complete the transaction. Some merchants will include an `app_requestor_url` + # for app-based purchases; Lithic recommends triggering a redirect to that URL + # after the cardholder completes an app-based challenge. + # - three_ds_authentication.created: Occurs when a 3DS authentication is created. + # - three_ds_authentication.updated: Occurs when a 3DS authentication is updated + # (eg. challenge is completed). + # - tokenization.approval_request: Occurs when a tokenization approval request is + # made. + # - tokenization.result: Occurs when a tokenization request succeeded or failed. + # - tokenization.two_factor_authentication_code: Occurs when a tokenization + # request 2FA code is sent to the Lithic customer for self serve delivery. + # - tokenization.two_factor_authentication_code_sent: Occurs when a tokenization + # request 2FA code is sent to our downstream messaging providers for delivery. + # - tokenization.updated: Occurs when a tokenization's status has changed. + module EventType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::EventSubscription::EventType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_HOLDER_DOCUMENT_UPDATED = + T.let( + :"account_holder_document.updated", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + ACCOUNT_HOLDER_CREATED = + T.let( + :"account_holder.created", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + ACCOUNT_HOLDER_UPDATED = + T.let( + :"account_holder.updated", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + ACCOUNT_HOLDER_VERIFICATION = + T.let( + :"account_holder.verification", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + AUTH_RULES_BACKTEST_REPORT_CREATED = + T.let( + :"auth_rules.backtest_report.created", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + BALANCE_UPDATED = + T.let( + :"balance.updated", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + BOOK_TRANSFER_TRANSACTION_CREATED = + T.let( + :"book_transfer_transaction.created", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + BOOK_TRANSFER_TRANSACTION_UPDATED = + T.let( + :"book_transfer_transaction.updated", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + CARD_AUTHORIZATION_CHALLENGE = + T.let( + :"card_authorization.challenge", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + CARD_AUTHORIZATION_CHALLENGE_RESPONSE = + T.let( + :"card_authorization.challenge_response", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + CARD_TRANSACTION_ENHANCED_DATA_CREATED = + T.let( + :"card_transaction.enhanced_data.created", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + CARD_TRANSACTION_ENHANCED_DATA_UPDATED = + T.let( + :"card_transaction.enhanced_data.updated", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + CARD_TRANSACTION_UPDATED = + T.let( + :"card_transaction.updated", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + CARD_CONVERTED = + T.let( + :"card.converted", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + CARD_CREATED = + T.let( + :"card.created", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + CARD_REISSUED = + T.let( + :"card.reissued", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + CARD_RENEWED = + T.let( + :"card.renewed", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + CARD_SHIPPED = + T.let( + :"card.shipped", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + CARD_UPDATED = + T.let( + :"card.updated", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_RESULT = + T.let( + :"digital_wallet.tokenization_result", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + T.let( + :"digital_wallet.tokenization_two_factor_authentication_code", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + T.let( + :"digital_wallet.tokenization_two_factor_authentication_code_sent", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_UPDATED = + T.let( + :"digital_wallet.tokenization_updated", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + DISPUTE_EVIDENCE_UPLOAD_FAILED = + T.let( + :"dispute_evidence.upload_failed", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + DISPUTE_TRANSACTION_CREATED = + T.let( + :"dispute_transaction.created", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + DISPUTE_TRANSACTION_UPDATED = + T.let( + :"dispute_transaction.updated", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + DISPUTE_UPDATED = + T.let( + :"dispute.updated", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + EXTERNAL_BANK_ACCOUNT_CREATED = + T.let( + :"external_bank_account.created", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + EXTERNAL_BANK_ACCOUNT_UPDATED = + T.let( + :"external_bank_account.updated", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + EXTERNAL_PAYMENT_CREATED = + T.let( + :"external_payment.created", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + EXTERNAL_PAYMENT_UPDATED = + T.let( + :"external_payment.updated", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + FINANCIAL_ACCOUNT_CREATED = + T.let( + :"financial_account.created", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + FINANCIAL_ACCOUNT_UPDATED = + T.let( + :"financial_account.updated", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + FUNDING_EVENT_CREATED = + T.let( + :"funding_event.created", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + INTERNAL_TRANSACTION_CREATED = + T.let( + :"internal_transaction.created", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + INTERNAL_TRANSACTION_UPDATED = + T.let( + :"internal_transaction.updated", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + LOAN_TAPE_CREATED = + T.let( + :"loan_tape.created", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + LOAN_TAPE_UPDATED = + T.let( + :"loan_tape.updated", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + MANAGEMENT_OPERATION_CREATED = + T.let( + :"management_operation.created", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + MANAGEMENT_OPERATION_UPDATED = + T.let( + :"management_operation.updated", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + NETWORK_TOTAL_CREATED = + T.let( + :"network_total.created", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + NETWORK_TOTAL_UPDATED = + T.let( + :"network_total.updated", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + PAYMENT_TRANSACTION_CREATED = + T.let( + :"payment_transaction.created", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + PAYMENT_TRANSACTION_UPDATED = + T.let( + :"payment_transaction.updated", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + SETTLEMENT_REPORT_UPDATED = + T.let( + :"settlement_report.updated", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + STATEMENTS_CREATED = + T.let( + :"statements.created", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + THREE_DS_AUTHENTICATION_CHALLENGE = + T.let( + :"three_ds_authentication.challenge", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + THREE_DS_AUTHENTICATION_CREATED = + T.let( + :"three_ds_authentication.created", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + THREE_DS_AUTHENTICATION_UPDATED = + T.let( + :"three_ds_authentication.updated", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + TOKENIZATION_APPROVAL_REQUEST = + T.let( + :"tokenization.approval_request", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + TOKENIZATION_RESULT = + T.let( + :"tokenization.result", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + T.let( + :"tokenization.two_factor_authentication_code", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + T.let( + :"tokenization.two_factor_authentication_code_sent", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + TOKENIZATION_UPDATED = + T.let( + :"tokenization.updated", + Lithic::EventSubscription::EventType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::EventSubscription::EventType::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/events/event_subscription_resend_params.rbi b/rbi/lithic/models/events/event_subscription_resend_params.rbi new file mode 100644 index 00000000..42c906b2 --- /dev/null +++ b/rbi/lithic/models/events/event_subscription_resend_params.rbi @@ -0,0 +1,52 @@ +# typed: strong + +module Lithic + module Models + module Events + class EventSubscriptionResendParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::Events::EventSubscriptionResendParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :event_token + + sig { returns(String) } + attr_accessor :event_subscription_token + + sig do + params( + event_token: String, + event_subscription_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + event_token:, + event_subscription_token:, + request_options: {} + ) + end + + sig do + override.returns( + { + event_token: String, + event_subscription_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/events/subscription_create_params.rbi b/rbi/lithic/models/events/subscription_create_params.rbi new file mode 100644 index 00000000..c5c4510b --- /dev/null +++ b/rbi/lithic/models/events/subscription_create_params.rbi @@ -0,0 +1,499 @@ +# typed: strong + +module Lithic + module Models + module Events + class SubscriptionCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::Events::SubscriptionCreateParams, + Lithic::Internal::AnyHash + ) + end + + # URL to which event webhooks will be sent. URL must be a valid HTTPS address. + sig { returns(String) } + attr_accessor :url + + # Event subscription description. + sig { returns(T.nilable(String)) } + attr_reader :description + + sig { params(description: String).void } + attr_writer :description + + # Whether the event subscription is active (false) or inactive (true). + sig { returns(T.nilable(T::Boolean)) } + attr_reader :disabled + + sig { params(disabled: T::Boolean).void } + attr_writer :disabled + + # Indicates types of events that will be sent to this subscription. If left blank, + # all types will be sent. + sig do + returns( + T.nilable( + T::Array[ + Lithic::Events::SubscriptionCreateParams::EventType::OrSymbol + ] + ) + ) + end + attr_reader :event_types + + sig do + params( + event_types: + T::Array[ + Lithic::Events::SubscriptionCreateParams::EventType::OrSymbol + ] + ).void + end + attr_writer :event_types + + sig do + params( + url: String, + description: String, + disabled: T::Boolean, + event_types: + T::Array[ + Lithic::Events::SubscriptionCreateParams::EventType::OrSymbol + ], + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # URL to which event webhooks will be sent. URL must be a valid HTTPS address. + url:, + # Event subscription description. + description: nil, + # Whether the event subscription is active (false) or inactive (true). + disabled: nil, + # Indicates types of events that will be sent to this subscription. If left blank, + # all types will be sent. + event_types: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + url: String, + description: String, + disabled: T::Boolean, + event_types: + T::Array[ + Lithic::Events::SubscriptionCreateParams::EventType::OrSymbol + ], + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # The type of event that occurred. Possible values: + # + # - account_holder_document.updated: Occurs when an account holder's document + # upload status has been updated + # - account_holder.created: Occurs when a new account_holder is created. + # - account_holder.updated: Occurs when an account_holder is updated. + # - account_holder.verification: Occurs when an asynchronous account_holder's + # verification is completed. + # - auth_rules.backtest_report.created: Auth Rules backtest report created. + # - balance.updated: Financial Account Balance Update + # - book_transfer_transaction.created: Occurs when a book transfer transaction is + # created. + # - book_transfer_transaction.updated: Occurs when a book transfer transaction is + # updated. + # - card_authorization.challenge: Occurs when an Out of Band challenge is issued + # during card authorization. The card program should issue its own challenge to + # the cardholder and then respond via + # [/v1/card_authorizations/{event_token}/challenge_response](https://docs.lithic.com/reference/respondtoauthorizationchallenge). + # - card_authorization.challenge_response: Occurs when a cardholder responds to a + # challenge during card authorization. + # - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial + # data is processed for a transaction event. + # - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial + # data is reprocessed for a transaction event. + # - card_transaction.updated: Occurs when a card transaction happens. + # - card.converted: Occurs when a card is converted from virtual to physical + # cards. + # - card.created: Occurs when a new card is created. + # - card.reissued: Occurs when a card is reissued. + # - card.renewed: Occurs when a card is renewed. + # - card.shipped: Occurs when a card is shipped. + # - card.updated: Occurs when a card is updated. + # - digital_wallet.tokenization_result: Occurs when a tokenization request + # succeeded or failed. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.result` instead. + # + # - digital_wallet.tokenization_two_factor_authentication_code: Occurs when a + # tokenization request 2FA code is sent to the Lithic customer for self serve + # delivery. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.two_factor_authentication_code` instead. + # + # - digital_wallet.tokenization_two_factor_authentication_code_sent: Occurs when a + # tokenization request 2FA code is sent to our downstream messaging providers + # for delivery. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.two_factor_authentication_code_sent` instead. + # + # - digital_wallet.tokenization_updated: Occurs when a tokenization's status has + # changed. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.updated` instead. + # + # - dispute_evidence.upload_failed: Occurs when a dispute evidence upload fails. + # - dispute_transaction.created: Occurs when a new dispute transaction is created + # - dispute_transaction.updated: Occurs when a dispute transaction is updated + # - dispute.updated: Occurs when a dispute is updated. + # - external_bank_account.created: Occurs when an external bank account is + # created. + # - external_bank_account.updated: Occurs when an external bank account is + # updated. + # - external_payment.created: Occurs when an external payment is created. + # - external_payment.updated: Occurs when an external payment is updated. + # - financial_account.created: Occurs when a financial account is created. + # - financial_account.updated: Occurs when a financial account is updated. + # - funding_event.created: Occurs when a funding event is created. + # - internal_transaction.created: Occurs when an internal adjustment is created. + # - internal_transaction.updated: Occurs when an internal adjustment is updated. + # - loan_tape.created: Occurs when a loan tape is created. + # - loan_tape.updated: Occurs when a loan tape is updated. + # - management_operation.created: Occurs when an management operation is created. + # - management_operation.updated: Occurs when an management operation is updated. + # - network_total.created: Occurs when a network total is created. + # - network_total.updated: Occurs when a network total is updated. + # - payment_transaction.created: Occurs when a payment transaction is created. + # - payment_transaction.updated: Occurs when a payment transaction is updated. + # - settlement_report.updated: Occurs when a settlement report is created or + # updated. + # - statements.created: Occurs when a statement has been created + # - three_ds_authentication.challenge: The `three_ds_authentication.challenge` + # event. Upon receiving this request, the Card Program should issue its own + # challenge to the cardholder. After a cardholder challenge is successfully + # completed, the Card Program needs to respond back to Lithic by call to + # [/v1/three_ds_decisioning/challenge_response](https://docs.lithic.com/reference/post_v1-three-ds-decisioning-challenge-response). + # Then the cardholder must navigate back to the merchant checkout flow to + # complete the transaction. Some merchants will include an `app_requestor_url` + # for app-based purchases; Lithic recommends triggering a redirect to that URL + # after the cardholder completes an app-based challenge. + # - three_ds_authentication.created: Occurs when a 3DS authentication is created. + # - three_ds_authentication.updated: Occurs when a 3DS authentication is updated + # (eg. challenge is completed). + # - tokenization.approval_request: Occurs when a tokenization approval request is + # made. + # - tokenization.result: Occurs when a tokenization request succeeded or failed. + # - tokenization.two_factor_authentication_code: Occurs when a tokenization + # request 2FA code is sent to the Lithic customer for self serve delivery. + # - tokenization.two_factor_authentication_code_sent: Occurs when a tokenization + # request 2FA code is sent to our downstream messaging providers for delivery. + # - tokenization.updated: Occurs when a tokenization's status has changed. + module EventType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Events::SubscriptionCreateParams::EventType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_HOLDER_DOCUMENT_UPDATED = + T.let( + :"account_holder_document.updated", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + ACCOUNT_HOLDER_CREATED = + T.let( + :"account_holder.created", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + ACCOUNT_HOLDER_UPDATED = + T.let( + :"account_holder.updated", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + ACCOUNT_HOLDER_VERIFICATION = + T.let( + :"account_holder.verification", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + AUTH_RULES_BACKTEST_REPORT_CREATED = + T.let( + :"auth_rules.backtest_report.created", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + BALANCE_UPDATED = + T.let( + :"balance.updated", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + BOOK_TRANSFER_TRANSACTION_CREATED = + T.let( + :"book_transfer_transaction.created", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + BOOK_TRANSFER_TRANSACTION_UPDATED = + T.let( + :"book_transfer_transaction.updated", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + CARD_AUTHORIZATION_CHALLENGE = + T.let( + :"card_authorization.challenge", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + CARD_AUTHORIZATION_CHALLENGE_RESPONSE = + T.let( + :"card_authorization.challenge_response", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + CARD_TRANSACTION_ENHANCED_DATA_CREATED = + T.let( + :"card_transaction.enhanced_data.created", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + CARD_TRANSACTION_ENHANCED_DATA_UPDATED = + T.let( + :"card_transaction.enhanced_data.updated", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + CARD_TRANSACTION_UPDATED = + T.let( + :"card_transaction.updated", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + CARD_CONVERTED = + T.let( + :"card.converted", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + CARD_CREATED = + T.let( + :"card.created", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + CARD_REISSUED = + T.let( + :"card.reissued", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + CARD_RENEWED = + T.let( + :"card.renewed", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + CARD_SHIPPED = + T.let( + :"card.shipped", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + CARD_UPDATED = + T.let( + :"card.updated", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_RESULT = + T.let( + :"digital_wallet.tokenization_result", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + T.let( + :"digital_wallet.tokenization_two_factor_authentication_code", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + T.let( + :"digital_wallet.tokenization_two_factor_authentication_code_sent", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_UPDATED = + T.let( + :"digital_wallet.tokenization_updated", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + DISPUTE_EVIDENCE_UPLOAD_FAILED = + T.let( + :"dispute_evidence.upload_failed", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + DISPUTE_TRANSACTION_CREATED = + T.let( + :"dispute_transaction.created", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + DISPUTE_TRANSACTION_UPDATED = + T.let( + :"dispute_transaction.updated", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + DISPUTE_UPDATED = + T.let( + :"dispute.updated", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + EXTERNAL_BANK_ACCOUNT_CREATED = + T.let( + :"external_bank_account.created", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + EXTERNAL_BANK_ACCOUNT_UPDATED = + T.let( + :"external_bank_account.updated", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + EXTERNAL_PAYMENT_CREATED = + T.let( + :"external_payment.created", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + EXTERNAL_PAYMENT_UPDATED = + T.let( + :"external_payment.updated", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + FINANCIAL_ACCOUNT_CREATED = + T.let( + :"financial_account.created", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + FINANCIAL_ACCOUNT_UPDATED = + T.let( + :"financial_account.updated", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + FUNDING_EVENT_CREATED = + T.let( + :"funding_event.created", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + INTERNAL_TRANSACTION_CREATED = + T.let( + :"internal_transaction.created", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + INTERNAL_TRANSACTION_UPDATED = + T.let( + :"internal_transaction.updated", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + LOAN_TAPE_CREATED = + T.let( + :"loan_tape.created", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + LOAN_TAPE_UPDATED = + T.let( + :"loan_tape.updated", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + MANAGEMENT_OPERATION_CREATED = + T.let( + :"management_operation.created", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + MANAGEMENT_OPERATION_UPDATED = + T.let( + :"management_operation.updated", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + NETWORK_TOTAL_CREATED = + T.let( + :"network_total.created", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + NETWORK_TOTAL_UPDATED = + T.let( + :"network_total.updated", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + PAYMENT_TRANSACTION_CREATED = + T.let( + :"payment_transaction.created", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + PAYMENT_TRANSACTION_UPDATED = + T.let( + :"payment_transaction.updated", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + SETTLEMENT_REPORT_UPDATED = + T.let( + :"settlement_report.updated", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + STATEMENTS_CREATED = + T.let( + :"statements.created", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + THREE_DS_AUTHENTICATION_CHALLENGE = + T.let( + :"three_ds_authentication.challenge", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + THREE_DS_AUTHENTICATION_CREATED = + T.let( + :"three_ds_authentication.created", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + THREE_DS_AUTHENTICATION_UPDATED = + T.let( + :"three_ds_authentication.updated", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + TOKENIZATION_APPROVAL_REQUEST = + T.let( + :"tokenization.approval_request", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + TOKENIZATION_RESULT = + T.let( + :"tokenization.result", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + T.let( + :"tokenization.two_factor_authentication_code", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + T.let( + :"tokenization.two_factor_authentication_code_sent", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + TOKENIZATION_UPDATED = + T.let( + :"tokenization.updated", + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Events::SubscriptionCreateParams::EventType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/events/subscription_delete_params.rbi b/rbi/lithic/models/events/subscription_delete_params.rbi new file mode 100644 index 00000000..bbcf4fd0 --- /dev/null +++ b/rbi/lithic/models/events/subscription_delete_params.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Lithic + module Models + module Events + class SubscriptionDeleteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::Events::SubscriptionDeleteParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :event_subscription_token + + sig do + params( + event_subscription_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(event_subscription_token:, request_options: {}) + end + + sig do + override.returns( + { + event_subscription_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/events/subscription_list_attempts_params.rbi b/rbi/lithic/models/events/subscription_list_attempts_params.rbi new file mode 100644 index 00000000..f1ada434 --- /dev/null +++ b/rbi/lithic/models/events/subscription_list_attempts_params.rbi @@ -0,0 +1,175 @@ +# typed: strong + +module Lithic + module Models + module Events + class SubscriptionListAttemptsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::Events::SubscriptionListAttemptsParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :event_subscription_token + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + returns( + T.nilable( + Lithic::Events::SubscriptionListAttemptsParams::Status::OrSymbol + ) + ) + end + attr_reader :status + + sig do + params( + status: + Lithic::Events::SubscriptionListAttemptsParams::Status::OrSymbol + ).void + end + attr_writer :status + + sig do + params( + event_subscription_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: + Lithic::Events::SubscriptionListAttemptsParams::Status::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + event_subscription_token:, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + status: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + event_subscription_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: + Lithic::Events::SubscriptionListAttemptsParams::Status::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Events::SubscriptionListAttemptsParams::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FAILED = + T.let( + :FAILED, + Lithic::Events::SubscriptionListAttemptsParams::Status::TaggedSymbol + ) + PENDING = + T.let( + :PENDING, + Lithic::Events::SubscriptionListAttemptsParams::Status::TaggedSymbol + ) + SENDING = + T.let( + :SENDING, + Lithic::Events::SubscriptionListAttemptsParams::Status::TaggedSymbol + ) + SUCCESS = + T.let( + :SUCCESS, + Lithic::Events::SubscriptionListAttemptsParams::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Events::SubscriptionListAttemptsParams::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/events/subscription_list_params.rbi b/rbi/lithic/models/events/subscription_list_params.rbi new file mode 100644 index 00000000..2b343da9 --- /dev/null +++ b/rbi/lithic/models/events/subscription_list_params.rbi @@ -0,0 +1,77 @@ +# typed: strong + +module Lithic + module Models + module Events + class SubscriptionListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::Events::SubscriptionListParams, + Lithic::Internal::AnyHash + ) + end + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/events/subscription_recover_params.rbi b/rbi/lithic/models/events/subscription_recover_params.rbi new file mode 100644 index 00000000..8302ef36 --- /dev/null +++ b/rbi/lithic/models/events/subscription_recover_params.rbi @@ -0,0 +1,72 @@ +# typed: strong + +module Lithic + module Models + module Events + class SubscriptionRecoverParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::Events::SubscriptionRecoverParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :event_subscription_token + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + sig do + params( + event_subscription_token: String, + begin_: Time, + end_: Time, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + event_subscription_token:, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + event_subscription_token: String, + begin_: Time, + end_: Time, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/events/subscription_replay_missing_params.rbi b/rbi/lithic/models/events/subscription_replay_missing_params.rbi new file mode 100644 index 00000000..957d90c0 --- /dev/null +++ b/rbi/lithic/models/events/subscription_replay_missing_params.rbi @@ -0,0 +1,72 @@ +# typed: strong + +module Lithic + module Models + module Events + class SubscriptionReplayMissingParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::Events::SubscriptionReplayMissingParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :event_subscription_token + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + sig do + params( + event_subscription_token: String, + begin_: Time, + end_: Time, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + event_subscription_token:, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + event_subscription_token: String, + begin_: Time, + end_: Time, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/events/subscription_retrieve_params.rbi b/rbi/lithic/models/events/subscription_retrieve_params.rbi new file mode 100644 index 00000000..4ca492f1 --- /dev/null +++ b/rbi/lithic/models/events/subscription_retrieve_params.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Lithic + module Models + module Events + class SubscriptionRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::Events::SubscriptionRetrieveParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :event_subscription_token + + sig do + params( + event_subscription_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(event_subscription_token:, request_options: {}) + end + + sig do + override.returns( + { + event_subscription_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/events/subscription_retrieve_secret_params.rbi b/rbi/lithic/models/events/subscription_retrieve_secret_params.rbi new file mode 100644 index 00000000..9c9706e0 --- /dev/null +++ b/rbi/lithic/models/events/subscription_retrieve_secret_params.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Lithic + module Models + module Events + class SubscriptionRetrieveSecretParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::Events::SubscriptionRetrieveSecretParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :event_subscription_token + + sig do + params( + event_subscription_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(event_subscription_token:, request_options: {}) + end + + sig do + override.returns( + { + event_subscription_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/events/subscription_retrieve_secret_response.rbi b/rbi/lithic/models/events/subscription_retrieve_secret_response.rbi new file mode 100644 index 00000000..24e880b9 --- /dev/null +++ b/rbi/lithic/models/events/subscription_retrieve_secret_response.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Lithic + module Models + module Events + class SubscriptionRetrieveSecretResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::Events::SubscriptionRetrieveSecretResponse, + Lithic::Internal::AnyHash + ) + end + + # The secret for the event subscription. + sig { returns(T.nilable(String)) } + attr_reader :secret + + sig { params(secret: String).void } + attr_writer :secret + + sig { params(secret: String).returns(T.attached_class) } + def self.new( + # The secret for the event subscription. + secret: nil + ) + end + + sig { override.returns({ secret: String }) } + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/events/subscription_rotate_secret_params.rbi b/rbi/lithic/models/events/subscription_rotate_secret_params.rbi new file mode 100644 index 00000000..b5e79a4a --- /dev/null +++ b/rbi/lithic/models/events/subscription_rotate_secret_params.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Lithic + module Models + module Events + class SubscriptionRotateSecretParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::Events::SubscriptionRotateSecretParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :event_subscription_token + + sig do + params( + event_subscription_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(event_subscription_token:, request_options: {}) + end + + sig do + override.returns( + { + event_subscription_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/events/subscription_send_simulated_example_params.rbi b/rbi/lithic/models/events/subscription_send_simulated_example_params.rbi new file mode 100644 index 00000000..d7968cfa --- /dev/null +++ b/rbi/lithic/models/events/subscription_send_simulated_example_params.rbi @@ -0,0 +1,365 @@ +# typed: strong + +module Lithic + module Models + module Events + class SubscriptionSendSimulatedExampleParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::Events::SubscriptionSendSimulatedExampleParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :event_subscription_token + + # Event type to send example message for. + sig do + returns( + T.nilable( + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::OrSymbol + ) + ) + end + attr_reader :event_type + + sig do + params( + event_type: + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::OrSymbol + ).void + end + attr_writer :event_type + + sig do + params( + event_subscription_token: String, + event_type: + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + event_subscription_token:, + # Event type to send example message for. + event_type: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + event_subscription_token: String, + event_type: + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Event type to send example message for. + module EventType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_HOLDER_DOCUMENT_UPDATED = + T.let( + :"account_holder_document.updated", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + ACCOUNT_HOLDER_CREATED = + T.let( + :"account_holder.created", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + ACCOUNT_HOLDER_UPDATED = + T.let( + :"account_holder.updated", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + ACCOUNT_HOLDER_VERIFICATION = + T.let( + :"account_holder.verification", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + AUTH_RULES_BACKTEST_REPORT_CREATED = + T.let( + :"auth_rules.backtest_report.created", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + BALANCE_UPDATED = + T.let( + :"balance.updated", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + BOOK_TRANSFER_TRANSACTION_CREATED = + T.let( + :"book_transfer_transaction.created", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + BOOK_TRANSFER_TRANSACTION_UPDATED = + T.let( + :"book_transfer_transaction.updated", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + CARD_AUTHORIZATION_CHALLENGE = + T.let( + :"card_authorization.challenge", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + CARD_AUTHORIZATION_CHALLENGE_RESPONSE = + T.let( + :"card_authorization.challenge_response", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + CARD_TRANSACTION_ENHANCED_DATA_CREATED = + T.let( + :"card_transaction.enhanced_data.created", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + CARD_TRANSACTION_ENHANCED_DATA_UPDATED = + T.let( + :"card_transaction.enhanced_data.updated", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + CARD_TRANSACTION_UPDATED = + T.let( + :"card_transaction.updated", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + CARD_CONVERTED = + T.let( + :"card.converted", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + CARD_CREATED = + T.let( + :"card.created", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + CARD_REISSUED = + T.let( + :"card.reissued", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + CARD_RENEWED = + T.let( + :"card.renewed", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + CARD_SHIPPED = + T.let( + :"card.shipped", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + CARD_UPDATED = + T.let( + :"card.updated", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_RESULT = + T.let( + :"digital_wallet.tokenization_result", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + T.let( + :"digital_wallet.tokenization_two_factor_authentication_code", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + T.let( + :"digital_wallet.tokenization_two_factor_authentication_code_sent", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_UPDATED = + T.let( + :"digital_wallet.tokenization_updated", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + DISPUTE_EVIDENCE_UPLOAD_FAILED = + T.let( + :"dispute_evidence.upload_failed", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + DISPUTE_TRANSACTION_CREATED = + T.let( + :"dispute_transaction.created", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + DISPUTE_TRANSACTION_UPDATED = + T.let( + :"dispute_transaction.updated", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + DISPUTE_UPDATED = + T.let( + :"dispute.updated", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + EXTERNAL_BANK_ACCOUNT_CREATED = + T.let( + :"external_bank_account.created", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + EXTERNAL_BANK_ACCOUNT_UPDATED = + T.let( + :"external_bank_account.updated", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + EXTERNAL_PAYMENT_CREATED = + T.let( + :"external_payment.created", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + EXTERNAL_PAYMENT_UPDATED = + T.let( + :"external_payment.updated", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + FINANCIAL_ACCOUNT_CREATED = + T.let( + :"financial_account.created", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + FINANCIAL_ACCOUNT_UPDATED = + T.let( + :"financial_account.updated", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + FUNDING_EVENT_CREATED = + T.let( + :"funding_event.created", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + INTERNAL_TRANSACTION_CREATED = + T.let( + :"internal_transaction.created", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + INTERNAL_TRANSACTION_UPDATED = + T.let( + :"internal_transaction.updated", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + LOAN_TAPE_CREATED = + T.let( + :"loan_tape.created", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + LOAN_TAPE_UPDATED = + T.let( + :"loan_tape.updated", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + MANAGEMENT_OPERATION_CREATED = + T.let( + :"management_operation.created", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + MANAGEMENT_OPERATION_UPDATED = + T.let( + :"management_operation.updated", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + NETWORK_TOTAL_CREATED = + T.let( + :"network_total.created", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + NETWORK_TOTAL_UPDATED = + T.let( + :"network_total.updated", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + PAYMENT_TRANSACTION_CREATED = + T.let( + :"payment_transaction.created", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + PAYMENT_TRANSACTION_UPDATED = + T.let( + :"payment_transaction.updated", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + SETTLEMENT_REPORT_UPDATED = + T.let( + :"settlement_report.updated", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + STATEMENTS_CREATED = + T.let( + :"statements.created", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + THREE_DS_AUTHENTICATION_CHALLENGE = + T.let( + :"three_ds_authentication.challenge", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + THREE_DS_AUTHENTICATION_CREATED = + T.let( + :"three_ds_authentication.created", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + THREE_DS_AUTHENTICATION_UPDATED = + T.let( + :"three_ds_authentication.updated", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + TOKENIZATION_APPROVAL_REQUEST = + T.let( + :"tokenization.approval_request", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + TOKENIZATION_RESULT = + T.let( + :"tokenization.result", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + T.let( + :"tokenization.two_factor_authentication_code", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + T.let( + :"tokenization.two_factor_authentication_code_sent", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + TOKENIZATION_UPDATED = + T.let( + :"tokenization.updated", + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/events/subscription_update_params.rbi b/rbi/lithic/models/events/subscription_update_params.rbi new file mode 100644 index 00000000..f978ae67 --- /dev/null +++ b/rbi/lithic/models/events/subscription_update_params.rbi @@ -0,0 +1,505 @@ +# typed: strong + +module Lithic + module Models + module Events + class SubscriptionUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::Events::SubscriptionUpdateParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :event_subscription_token + + # URL to which event webhooks will be sent. URL must be a valid HTTPS address. + sig { returns(String) } + attr_accessor :url + + # Event subscription description. + sig { returns(T.nilable(String)) } + attr_reader :description + + sig { params(description: String).void } + attr_writer :description + + # Whether the event subscription is active (false) or inactive (true). + sig { returns(T.nilable(T::Boolean)) } + attr_reader :disabled + + sig { params(disabled: T::Boolean).void } + attr_writer :disabled + + # Indicates types of events that will be sent to this subscription. If left blank, + # all types will be sent. + sig do + returns( + T.nilable( + T::Array[ + Lithic::Events::SubscriptionUpdateParams::EventType::OrSymbol + ] + ) + ) + end + attr_reader :event_types + + sig do + params( + event_types: + T::Array[ + Lithic::Events::SubscriptionUpdateParams::EventType::OrSymbol + ] + ).void + end + attr_writer :event_types + + sig do + params( + event_subscription_token: String, + url: String, + description: String, + disabled: T::Boolean, + event_types: + T::Array[ + Lithic::Events::SubscriptionUpdateParams::EventType::OrSymbol + ], + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + event_subscription_token:, + # URL to which event webhooks will be sent. URL must be a valid HTTPS address. + url:, + # Event subscription description. + description: nil, + # Whether the event subscription is active (false) or inactive (true). + disabled: nil, + # Indicates types of events that will be sent to this subscription. If left blank, + # all types will be sent. + event_types: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + event_subscription_token: String, + url: String, + description: String, + disabled: T::Boolean, + event_types: + T::Array[ + Lithic::Events::SubscriptionUpdateParams::EventType::OrSymbol + ], + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # The type of event that occurred. Possible values: + # + # - account_holder_document.updated: Occurs when an account holder's document + # upload status has been updated + # - account_holder.created: Occurs when a new account_holder is created. + # - account_holder.updated: Occurs when an account_holder is updated. + # - account_holder.verification: Occurs when an asynchronous account_holder's + # verification is completed. + # - auth_rules.backtest_report.created: Auth Rules backtest report created. + # - balance.updated: Financial Account Balance Update + # - book_transfer_transaction.created: Occurs when a book transfer transaction is + # created. + # - book_transfer_transaction.updated: Occurs when a book transfer transaction is + # updated. + # - card_authorization.challenge: Occurs when an Out of Band challenge is issued + # during card authorization. The card program should issue its own challenge to + # the cardholder and then respond via + # [/v1/card_authorizations/{event_token}/challenge_response](https://docs.lithic.com/reference/respondtoauthorizationchallenge). + # - card_authorization.challenge_response: Occurs when a cardholder responds to a + # challenge during card authorization. + # - card_transaction.enhanced_data.created: Occurs when L2/L3 enhanced commercial + # data is processed for a transaction event. + # - card_transaction.enhanced_data.updated: Occurs when L2/L3 enhanced commercial + # data is reprocessed for a transaction event. + # - card_transaction.updated: Occurs when a card transaction happens. + # - card.converted: Occurs when a card is converted from virtual to physical + # cards. + # - card.created: Occurs when a new card is created. + # - card.reissued: Occurs when a card is reissued. + # - card.renewed: Occurs when a card is renewed. + # - card.shipped: Occurs when a card is shipped. + # - card.updated: Occurs when a card is updated. + # - digital_wallet.tokenization_result: Occurs when a tokenization request + # succeeded or failed. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.result` instead. + # + # - digital_wallet.tokenization_two_factor_authentication_code: Occurs when a + # tokenization request 2FA code is sent to the Lithic customer for self serve + # delivery. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.two_factor_authentication_code` instead. + # + # - digital_wallet.tokenization_two_factor_authentication_code_sent: Occurs when a + # tokenization request 2FA code is sent to our downstream messaging providers + # for delivery. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.two_factor_authentication_code_sent` instead. + # + # - digital_wallet.tokenization_updated: Occurs when a tokenization's status has + # changed. + # + # This event will be deprecated in the future. We recommend using + # `tokenization.updated` instead. + # + # - dispute_evidence.upload_failed: Occurs when a dispute evidence upload fails. + # - dispute_transaction.created: Occurs when a new dispute transaction is created + # - dispute_transaction.updated: Occurs when a dispute transaction is updated + # - dispute.updated: Occurs when a dispute is updated. + # - external_bank_account.created: Occurs when an external bank account is + # created. + # - external_bank_account.updated: Occurs when an external bank account is + # updated. + # - external_payment.created: Occurs when an external payment is created. + # - external_payment.updated: Occurs when an external payment is updated. + # - financial_account.created: Occurs when a financial account is created. + # - financial_account.updated: Occurs when a financial account is updated. + # - funding_event.created: Occurs when a funding event is created. + # - internal_transaction.created: Occurs when an internal adjustment is created. + # - internal_transaction.updated: Occurs when an internal adjustment is updated. + # - loan_tape.created: Occurs when a loan tape is created. + # - loan_tape.updated: Occurs when a loan tape is updated. + # - management_operation.created: Occurs when an management operation is created. + # - management_operation.updated: Occurs when an management operation is updated. + # - network_total.created: Occurs when a network total is created. + # - network_total.updated: Occurs when a network total is updated. + # - payment_transaction.created: Occurs when a payment transaction is created. + # - payment_transaction.updated: Occurs when a payment transaction is updated. + # - settlement_report.updated: Occurs when a settlement report is created or + # updated. + # - statements.created: Occurs when a statement has been created + # - three_ds_authentication.challenge: The `three_ds_authentication.challenge` + # event. Upon receiving this request, the Card Program should issue its own + # challenge to the cardholder. After a cardholder challenge is successfully + # completed, the Card Program needs to respond back to Lithic by call to + # [/v1/three_ds_decisioning/challenge_response](https://docs.lithic.com/reference/post_v1-three-ds-decisioning-challenge-response). + # Then the cardholder must navigate back to the merchant checkout flow to + # complete the transaction. Some merchants will include an `app_requestor_url` + # for app-based purchases; Lithic recommends triggering a redirect to that URL + # after the cardholder completes an app-based challenge. + # - three_ds_authentication.created: Occurs when a 3DS authentication is created. + # - three_ds_authentication.updated: Occurs when a 3DS authentication is updated + # (eg. challenge is completed). + # - tokenization.approval_request: Occurs when a tokenization approval request is + # made. + # - tokenization.result: Occurs when a tokenization request succeeded or failed. + # - tokenization.two_factor_authentication_code: Occurs when a tokenization + # request 2FA code is sent to the Lithic customer for self serve delivery. + # - tokenization.two_factor_authentication_code_sent: Occurs when a tokenization + # request 2FA code is sent to our downstream messaging providers for delivery. + # - tokenization.updated: Occurs when a tokenization's status has changed. + module EventType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Events::SubscriptionUpdateParams::EventType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_HOLDER_DOCUMENT_UPDATED = + T.let( + :"account_holder_document.updated", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + ACCOUNT_HOLDER_CREATED = + T.let( + :"account_holder.created", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + ACCOUNT_HOLDER_UPDATED = + T.let( + :"account_holder.updated", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + ACCOUNT_HOLDER_VERIFICATION = + T.let( + :"account_holder.verification", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + AUTH_RULES_BACKTEST_REPORT_CREATED = + T.let( + :"auth_rules.backtest_report.created", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + BALANCE_UPDATED = + T.let( + :"balance.updated", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + BOOK_TRANSFER_TRANSACTION_CREATED = + T.let( + :"book_transfer_transaction.created", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + BOOK_TRANSFER_TRANSACTION_UPDATED = + T.let( + :"book_transfer_transaction.updated", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + CARD_AUTHORIZATION_CHALLENGE = + T.let( + :"card_authorization.challenge", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + CARD_AUTHORIZATION_CHALLENGE_RESPONSE = + T.let( + :"card_authorization.challenge_response", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + CARD_TRANSACTION_ENHANCED_DATA_CREATED = + T.let( + :"card_transaction.enhanced_data.created", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + CARD_TRANSACTION_ENHANCED_DATA_UPDATED = + T.let( + :"card_transaction.enhanced_data.updated", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + CARD_TRANSACTION_UPDATED = + T.let( + :"card_transaction.updated", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + CARD_CONVERTED = + T.let( + :"card.converted", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + CARD_CREATED = + T.let( + :"card.created", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + CARD_REISSUED = + T.let( + :"card.reissued", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + CARD_RENEWED = + T.let( + :"card.renewed", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + CARD_SHIPPED = + T.let( + :"card.shipped", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + CARD_UPDATED = + T.let( + :"card.updated", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_RESULT = + T.let( + :"digital_wallet.tokenization_result", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + T.let( + :"digital_wallet.tokenization_two_factor_authentication_code", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + T.let( + :"digital_wallet.tokenization_two_factor_authentication_code_sent", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + DIGITAL_WALLET_TOKENIZATION_UPDATED = + T.let( + :"digital_wallet.tokenization_updated", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + DISPUTE_EVIDENCE_UPLOAD_FAILED = + T.let( + :"dispute_evidence.upload_failed", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + DISPUTE_TRANSACTION_CREATED = + T.let( + :"dispute_transaction.created", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + DISPUTE_TRANSACTION_UPDATED = + T.let( + :"dispute_transaction.updated", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + DISPUTE_UPDATED = + T.let( + :"dispute.updated", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + EXTERNAL_BANK_ACCOUNT_CREATED = + T.let( + :"external_bank_account.created", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + EXTERNAL_BANK_ACCOUNT_UPDATED = + T.let( + :"external_bank_account.updated", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + EXTERNAL_PAYMENT_CREATED = + T.let( + :"external_payment.created", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + EXTERNAL_PAYMENT_UPDATED = + T.let( + :"external_payment.updated", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + FINANCIAL_ACCOUNT_CREATED = + T.let( + :"financial_account.created", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + FINANCIAL_ACCOUNT_UPDATED = + T.let( + :"financial_account.updated", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + FUNDING_EVENT_CREATED = + T.let( + :"funding_event.created", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + INTERNAL_TRANSACTION_CREATED = + T.let( + :"internal_transaction.created", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + INTERNAL_TRANSACTION_UPDATED = + T.let( + :"internal_transaction.updated", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + LOAN_TAPE_CREATED = + T.let( + :"loan_tape.created", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + LOAN_TAPE_UPDATED = + T.let( + :"loan_tape.updated", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + MANAGEMENT_OPERATION_CREATED = + T.let( + :"management_operation.created", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + MANAGEMENT_OPERATION_UPDATED = + T.let( + :"management_operation.updated", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + NETWORK_TOTAL_CREATED = + T.let( + :"network_total.created", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + NETWORK_TOTAL_UPDATED = + T.let( + :"network_total.updated", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + PAYMENT_TRANSACTION_CREATED = + T.let( + :"payment_transaction.created", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + PAYMENT_TRANSACTION_UPDATED = + T.let( + :"payment_transaction.updated", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + SETTLEMENT_REPORT_UPDATED = + T.let( + :"settlement_report.updated", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + STATEMENTS_CREATED = + T.let( + :"statements.created", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + THREE_DS_AUTHENTICATION_CHALLENGE = + T.let( + :"three_ds_authentication.challenge", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + THREE_DS_AUTHENTICATION_CREATED = + T.let( + :"three_ds_authentication.created", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + THREE_DS_AUTHENTICATION_UPDATED = + T.let( + :"three_ds_authentication.updated", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + TOKENIZATION_APPROVAL_REQUEST = + T.let( + :"tokenization.approval_request", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + TOKENIZATION_RESULT = + T.let( + :"tokenization.result", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE = + T.let( + :"tokenization.two_factor_authentication_code", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT = + T.let( + :"tokenization.two_factor_authentication_code_sent", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + TOKENIZATION_UPDATED = + T.let( + :"tokenization.updated", + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Events::SubscriptionUpdateParams::EventType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/external_bank_account.rbi b/rbi/lithic/models/external_bank_account.rbi new file mode 100644 index 00000000..2722ff8c --- /dev/null +++ b/rbi/lithic/models/external_bank_account.rbi @@ -0,0 +1,326 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccount < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::ExternalBankAccount, Lithic::Internal::AnyHash) + end + + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + sig { returns(String) } + attr_accessor :token + + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + sig { returns(String) } + attr_accessor :country + + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + sig { returns(Time) } + attr_accessor :created + + # currency of the external account 3-character alphabetic ISO 4217 code + sig { returns(String) } + attr_accessor :currency + + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + sig { returns(String) } + attr_accessor :last_four + + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + sig { returns(String) } + attr_accessor :owner + + # Owner Type + sig { returns(Lithic::OwnerType::TaggedSymbol) } + attr_accessor :owner_type + + # Routing Number + sig { returns(String) } + attr_accessor :routing_number + + # Account State + sig { returns(Lithic::ExternalBankAccount::State::TaggedSymbol) } + attr_accessor :state + + # Account Type + sig { returns(Lithic::ExternalBankAccount::Type::TaggedSymbol) } + attr_accessor :type + + # The number of attempts at verification + sig { returns(Integer) } + attr_accessor :verification_attempts + + # Verification Method + sig { returns(Lithic::VerificationMethod::TaggedSymbol) } + attr_accessor :verification_method + + # Verification State + sig do + returns(Lithic::ExternalBankAccount::VerificationState::TaggedSymbol) + end + attr_accessor :verification_state + + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + sig { returns(T.nilable(String)) } + attr_accessor :account_token + + # Address + sig { returns(T.nilable(Lithic::ExternalBankAccountAddress)) } + attr_reader :address + + sig do + params( + address: T.nilable(Lithic::ExternalBankAccountAddress::OrHash) + ).void + end + attr_writer :address + + # Optional field that helps identify bank accounts in receipts + sig { returns(T.nilable(String)) } + attr_accessor :company_id + + # Date of Birth of the Individual that owns the external bank account + sig { returns(T.nilable(Date)) } + attr_accessor :dob + + # Doing Business As + sig { returns(T.nilable(String)) } + attr_accessor :doing_business_as + + # The financial account token of the operating account to fund the micro deposits + sig { returns(T.nilable(String)) } + attr_accessor :financial_account_token + + # The nickname for this External Bank Account + sig { returns(T.nilable(String)) } + attr_accessor :name + + # User Defined ID + sig { returns(T.nilable(String)) } + attr_accessor :user_defined_id + + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + sig { returns(T.nilable(String)) } + attr_accessor :verification_failed_reason + + sig do + params( + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::OwnerType::OrSymbol, + routing_number: String, + state: Lithic::ExternalBankAccount::State::OrSymbol, + type: Lithic::ExternalBankAccount::Type::OrSymbol, + verification_attempts: Integer, + verification_method: Lithic::VerificationMethod::OrSymbol, + verification_state: + Lithic::ExternalBankAccount::VerificationState::OrSymbol, + account_token: T.nilable(String), + address: T.nilable(Lithic::ExternalBankAccountAddress::OrHash), + company_id: T.nilable(String), + dob: T.nilable(Date), + doing_business_as: T.nilable(String), + financial_account_token: T.nilable(String), + name: T.nilable(String), + user_defined_id: T.nilable(String), + verification_failed_reason: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + token:, + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + country:, + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + created:, + # currency of the external account 3-character alphabetic ISO 4217 code + currency:, + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + last_four:, + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + owner:, + # Owner Type + owner_type:, + # Routing Number + routing_number:, + # Account State + state:, + # Account Type + type:, + # The number of attempts at verification + verification_attempts:, + # Verification Method + verification_method:, + # Verification State + verification_state:, + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + account_token: nil, + # Address + address: nil, + # Optional field that helps identify bank accounts in receipts + company_id: nil, + # Date of Birth of the Individual that owns the external bank account + dob: nil, + # Doing Business As + doing_business_as: nil, + # The financial account token of the operating account to fund the micro deposits + financial_account_token: nil, + # The nickname for this External Bank Account + name: nil, + # User Defined ID + user_defined_id: nil, + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + verification_failed_reason: nil + ) + end + + sig do + override.returns( + { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::OwnerType::TaggedSymbol, + routing_number: String, + state: Lithic::ExternalBankAccount::State::TaggedSymbol, + type: Lithic::ExternalBankAccount::Type::TaggedSymbol, + verification_attempts: Integer, + verification_method: Lithic::VerificationMethod::TaggedSymbol, + verification_state: + Lithic::ExternalBankAccount::VerificationState::TaggedSymbol, + account_token: T.nilable(String), + address: T.nilable(Lithic::ExternalBankAccountAddress), + company_id: T.nilable(String), + dob: T.nilable(Date), + doing_business_as: T.nilable(String), + financial_account_token: T.nilable(String), + name: T.nilable(String), + user_defined_id: T.nilable(String), + verification_failed_reason: T.nilable(String) + } + ) + end + def to_hash + end + + # Account State + module State + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::ExternalBankAccount::State) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ENABLED = + T.let(:ENABLED, Lithic::ExternalBankAccount::State::TaggedSymbol) + CLOSED = + T.let(:CLOSED, Lithic::ExternalBankAccount::State::TaggedSymbol) + PAUSED = + T.let(:PAUSED, Lithic::ExternalBankAccount::State::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::ExternalBankAccount::State::TaggedSymbol] + ) + end + def self.values + end + end + + # Account Type + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::ExternalBankAccount::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHECKING = + T.let(:CHECKING, Lithic::ExternalBankAccount::Type::TaggedSymbol) + SAVINGS = + T.let(:SAVINGS, Lithic::ExternalBankAccount::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::ExternalBankAccount::Type::TaggedSymbol] + ) + end + def self.values + end + end + + # Verification State + module VerificationState + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ExternalBankAccount::VerificationState) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :PENDING, + Lithic::ExternalBankAccount::VerificationState::TaggedSymbol + ) + ENABLED = + T.let( + :ENABLED, + Lithic::ExternalBankAccount::VerificationState::TaggedSymbol + ) + FAILED_VERIFICATION = + T.let( + :FAILED_VERIFICATION, + Lithic::ExternalBankAccount::VerificationState::TaggedSymbol + ) + INSUFFICIENT_FUNDS = + T.let( + :INSUFFICIENT_FUNDS, + Lithic::ExternalBankAccount::VerificationState::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ExternalBankAccount::VerificationState::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/external_bank_account_address.rbi b/rbi/lithic/models/external_bank_account_address.rbi new file mode 100644 index 00000000..d75ff5c2 --- /dev/null +++ b/rbi/lithic/models/external_bank_account_address.rbi @@ -0,0 +1,65 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountAddress < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::ExternalBankAccountAddress, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address1 + + sig { returns(String) } + attr_accessor :city + + sig { returns(String) } + attr_accessor :country + + sig { returns(String) } + attr_accessor :postal_code + + sig { returns(String) } + attr_accessor :state + + sig { returns(T.nilable(String)) } + attr_accessor :address2 + + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + address1:, + city:, + country:, + postal_code:, + state:, + address2: nil + ) + end + + sig do + override.returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: T.nilable(String) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/external_bank_account_create_params.rbi b/rbi/lithic/models/external_bank_account_create_params.rbi new file mode 100644 index 00000000..255e90b1 --- /dev/null +++ b/rbi/lithic/models/external_bank_account_create_params.rbi @@ -0,0 +1,754 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::ExternalBankAccountCreateParams, + Lithic::Internal::AnyHash + ) + end + + sig do + returns( + T.any( + Lithic::ExternalBankAccountCreateParams::Body::ExternallyVerified, + Lithic::ExternalBankAccountCreateParams::Body::Unverified, + Lithic::ExternalBankAccountCreateParams::Body::BankVerifiedCreateBankAccountAPIRequest + ) + ) + end + attr_accessor :body + + sig do + params( + body: + T.any( + Lithic::ExternalBankAccountCreateParams::Body::ExternallyVerified::OrHash, + Lithic::ExternalBankAccountCreateParams::Body::Unverified::OrHash, + Lithic::ExternalBankAccountCreateParams::Body::BankVerifiedCreateBankAccountAPIRequest::OrHash + ), + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(body:, request_options: {}) + end + + sig do + override.returns( + { + body: + T.any( + Lithic::ExternalBankAccountCreateParams::Body::ExternallyVerified, + Lithic::ExternalBankAccountCreateParams::Body::Unverified, + Lithic::ExternalBankAccountCreateParams::Body::BankVerifiedCreateBankAccountAPIRequest + ), + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + module Body + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::ExternalBankAccountCreateParams::Body::ExternallyVerified, + Lithic::ExternalBankAccountCreateParams::Body::Unverified, + Lithic::ExternalBankAccountCreateParams::Body::BankVerifiedCreateBankAccountAPIRequest + ) + end + + class BankVerifiedCreateBankAccountAPIRequest < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ExternalBankAccountCreateParams::Body::BankVerifiedCreateBankAccountAPIRequest, + Lithic::Internal::AnyHash + ) + end + + # Account Number + sig { returns(String) } + attr_accessor :account_number + + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + sig { returns(String) } + attr_accessor :country + + # currency of the external account 3-character alphabetic ISO 4217 code + sig { returns(String) } + attr_accessor :currency + + # The financial account token of the operating account to fund the micro deposits + sig { returns(String) } + attr_accessor :financial_account_token + + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + sig { returns(String) } + attr_accessor :owner + + # Owner Type + sig { returns(Lithic::OwnerType::OrSymbol) } + attr_accessor :owner_type + + # Routing Number + sig { returns(String) } + attr_accessor :routing_number + + # Account Type + sig do + returns( + Lithic::ExternalBankAccountCreateParams::Body::BankVerifiedCreateBankAccountAPIRequest::Type::OrSymbol + ) + end + attr_accessor :type + + # Verification Method + sig { returns(Lithic::VerificationMethod::OrSymbol) } + attr_accessor :verification_method + + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Address + sig { returns(T.nilable(Lithic::ExternalBankAccountAddress)) } + attr_reader :address + + sig do + params(address: Lithic::ExternalBankAccountAddress::OrHash).void + end + attr_writer :address + + # Optional field that helps identify bank accounts in receipts + sig { returns(T.nilable(String)) } + attr_reader :company_id + + sig { params(company_id: String).void } + attr_writer :company_id + + # Date of Birth of the Individual that owns the external bank account + sig { returns(T.nilable(Date)) } + attr_reader :dob + + sig { params(dob: Date).void } + attr_writer :dob + + # Doing Business As + sig { returns(T.nilable(String)) } + attr_reader :doing_business_as + + sig { params(doing_business_as: String).void } + attr_writer :doing_business_as + + # The nickname for this External Bank Account + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + # User Defined ID + sig { returns(T.nilable(String)) } + attr_reader :user_defined_id + + sig { params(user_defined_id: String).void } + attr_writer :user_defined_id + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :verification_enforcement + + sig { params(verification_enforcement: T::Boolean).void } + attr_writer :verification_enforcement + + sig do + params( + account_number: String, + country: String, + currency: String, + financial_account_token: String, + owner: String, + owner_type: Lithic::OwnerType::OrSymbol, + routing_number: String, + type: + Lithic::ExternalBankAccountCreateParams::Body::BankVerifiedCreateBankAccountAPIRequest::Type::OrSymbol, + verification_method: Lithic::VerificationMethod::OrSymbol, + account_token: String, + address: Lithic::ExternalBankAccountAddress::OrHash, + company_id: String, + dob: Date, + doing_business_as: String, + name: String, + user_defined_id: String, + verification_enforcement: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # Account Number + account_number:, + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + country:, + # currency of the external account 3-character alphabetic ISO 4217 code + currency:, + # The financial account token of the operating account to fund the micro deposits + financial_account_token:, + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + owner:, + # Owner Type + owner_type:, + # Routing Number + routing_number:, + # Account Type + type:, + # Verification Method + verification_method:, + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + account_token: nil, + # Address + address: nil, + # Optional field that helps identify bank accounts in receipts + company_id: nil, + # Date of Birth of the Individual that owns the external bank account + dob: nil, + # Doing Business As + doing_business_as: nil, + # The nickname for this External Bank Account + name: nil, + # User Defined ID + user_defined_id: nil, + verification_enforcement: nil + ) + end + + sig do + override.returns( + { + account_number: String, + country: String, + currency: String, + financial_account_token: String, + owner: String, + owner_type: Lithic::OwnerType::OrSymbol, + routing_number: String, + type: + Lithic::ExternalBankAccountCreateParams::Body::BankVerifiedCreateBankAccountAPIRequest::Type::OrSymbol, + verification_method: Lithic::VerificationMethod::OrSymbol, + account_token: String, + address: Lithic::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + name: String, + user_defined_id: String, + verification_enforcement: T::Boolean + } + ) + end + def to_hash + end + + # Account Type + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::ExternalBankAccountCreateParams::Body::BankVerifiedCreateBankAccountAPIRequest::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHECKING = + T.let( + :CHECKING, + Lithic::ExternalBankAccountCreateParams::Body::BankVerifiedCreateBankAccountAPIRequest::Type::TaggedSymbol + ) + SAVINGS = + T.let( + :SAVINGS, + Lithic::ExternalBankAccountCreateParams::Body::BankVerifiedCreateBankAccountAPIRequest::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ExternalBankAccountCreateParams::Body::BankVerifiedCreateBankAccountAPIRequest::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class ExternallyVerified < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ExternalBankAccountCreateParams::Body::ExternallyVerified, + Lithic::Internal::AnyHash + ) + end + + # Account Number + sig { returns(String) } + attr_accessor :account_number + + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + sig { returns(String) } + attr_accessor :country + + # currency of the external account 3-character alphabetic ISO 4217 code + sig { returns(String) } + attr_accessor :currency + + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + sig { returns(String) } + attr_accessor :owner + + # Owner Type + sig { returns(Lithic::OwnerType::OrSymbol) } + attr_accessor :owner_type + + # Routing Number + sig { returns(String) } + attr_accessor :routing_number + + # Account Type + sig do + returns( + Lithic::ExternalBankAccountCreateParams::Body::ExternallyVerified::Type::OrSymbol + ) + end + attr_accessor :type + + # Verification Method + sig { returns(Symbol) } + attr_accessor :verification_method + + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Address + sig { returns(T.nilable(Lithic::ExternalBankAccountAddress)) } + attr_reader :address + + sig do + params(address: Lithic::ExternalBankAccountAddress::OrHash).void + end + attr_writer :address + + # Optional field that helps identify bank accounts in receipts + sig { returns(T.nilable(String)) } + attr_reader :company_id + + sig { params(company_id: String).void } + attr_writer :company_id + + # Date of Birth of the Individual that owns the external bank account + sig { returns(T.nilable(Date)) } + attr_reader :dob + + sig { params(dob: Date).void } + attr_writer :dob + + # Doing Business As + sig { returns(T.nilable(String)) } + attr_reader :doing_business_as + + sig { params(doing_business_as: String).void } + attr_writer :doing_business_as + + # The nickname for this External Bank Account + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + # User Defined ID + sig { returns(T.nilable(String)) } + attr_reader :user_defined_id + + sig { params(user_defined_id: String).void } + attr_writer :user_defined_id + + sig do + params( + account_number: String, + country: String, + currency: String, + owner: String, + owner_type: Lithic::OwnerType::OrSymbol, + routing_number: String, + type: + Lithic::ExternalBankAccountCreateParams::Body::ExternallyVerified::Type::OrSymbol, + account_token: String, + address: Lithic::ExternalBankAccountAddress::OrHash, + company_id: String, + dob: Date, + doing_business_as: String, + name: String, + user_defined_id: String, + verification_method: Symbol + ).returns(T.attached_class) + end + def self.new( + # Account Number + account_number:, + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + country:, + # currency of the external account 3-character alphabetic ISO 4217 code + currency:, + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + owner:, + # Owner Type + owner_type:, + # Routing Number + routing_number:, + # Account Type + type:, + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + account_token: nil, + # Address + address: nil, + # Optional field that helps identify bank accounts in receipts + company_id: nil, + # Date of Birth of the Individual that owns the external bank account + dob: nil, + # Doing Business As + doing_business_as: nil, + # The nickname for this External Bank Account + name: nil, + # User Defined ID + user_defined_id: nil, + # Verification Method + verification_method: :EXTERNALLY_VERIFIED + ) + end + + sig do + override.returns( + { + account_number: String, + country: String, + currency: String, + owner: String, + owner_type: Lithic::OwnerType::OrSymbol, + routing_number: String, + type: + Lithic::ExternalBankAccountCreateParams::Body::ExternallyVerified::Type::OrSymbol, + verification_method: Symbol, + account_token: String, + address: Lithic::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + name: String, + user_defined_id: String + } + ) + end + def to_hash + end + + # Account Type + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::ExternalBankAccountCreateParams::Body::ExternallyVerified::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHECKING = + T.let( + :CHECKING, + Lithic::ExternalBankAccountCreateParams::Body::ExternallyVerified::Type::TaggedSymbol + ) + SAVINGS = + T.let( + :SAVINGS, + Lithic::ExternalBankAccountCreateParams::Body::ExternallyVerified::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ExternalBankAccountCreateParams::Body::ExternallyVerified::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Unverified < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ExternalBankAccountCreateParams::Body::Unverified, + Lithic::Internal::AnyHash + ) + end + + # Account Number + sig { returns(String) } + attr_accessor :account_number + + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + sig { returns(String) } + attr_accessor :country + + # currency of the external account 3-character alphabetic ISO 4217 code + sig { returns(String) } + attr_accessor :currency + + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + sig { returns(String) } + attr_accessor :owner + + # Owner Type + sig { returns(Lithic::OwnerType::OrSymbol) } + attr_accessor :owner_type + + # Routing Number + sig { returns(String) } + attr_accessor :routing_number + + # Account Type + sig do + returns( + Lithic::ExternalBankAccountCreateParams::Body::Unverified::Type::OrSymbol + ) + end + attr_accessor :type + + # Verification Method + sig { returns(Symbol) } + attr_accessor :verification_method + + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Address + sig { returns(T.nilable(Lithic::ExternalBankAccountAddress)) } + attr_reader :address + + sig do + params(address: Lithic::ExternalBankAccountAddress::OrHash).void + end + attr_writer :address + + # Optional field that helps identify bank accounts in receipts + sig { returns(T.nilable(String)) } + attr_reader :company_id + + sig { params(company_id: String).void } + attr_writer :company_id + + # Date of Birth of the Individual that owns the external bank account + sig { returns(T.nilable(Date)) } + attr_reader :dob + + sig { params(dob: Date).void } + attr_writer :dob + + # Doing Business As + sig { returns(T.nilable(String)) } + attr_reader :doing_business_as + + sig { params(doing_business_as: String).void } + attr_writer :doing_business_as + + # The nickname for this External Bank Account + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + # User Defined ID + sig { returns(T.nilable(String)) } + attr_reader :user_defined_id + + sig { params(user_defined_id: String).void } + attr_writer :user_defined_id + + sig do + params( + account_number: String, + country: String, + currency: String, + owner: String, + owner_type: Lithic::OwnerType::OrSymbol, + routing_number: String, + type: + Lithic::ExternalBankAccountCreateParams::Body::Unverified::Type::OrSymbol, + account_token: String, + address: Lithic::ExternalBankAccountAddress::OrHash, + company_id: String, + dob: Date, + doing_business_as: String, + name: String, + user_defined_id: String, + verification_method: Symbol + ).returns(T.attached_class) + end + def self.new( + # Account Number + account_number:, + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + country:, + # currency of the external account 3-character alphabetic ISO 4217 code + currency:, + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + owner:, + # Owner Type + owner_type:, + # Routing Number + routing_number:, + # Account Type + type:, + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + account_token: nil, + # Address + address: nil, + # Optional field that helps identify bank accounts in receipts + company_id: nil, + # Date of Birth of the Individual that owns the external bank account + dob: nil, + # Doing Business As + doing_business_as: nil, + # The nickname for this External Bank Account + name: nil, + # User Defined ID + user_defined_id: nil, + # Verification Method + verification_method: :UNVERIFIED + ) + end + + sig do + override.returns( + { + account_number: String, + country: String, + currency: String, + owner: String, + owner_type: Lithic::OwnerType::OrSymbol, + routing_number: String, + type: + Lithic::ExternalBankAccountCreateParams::Body::Unverified::Type::OrSymbol, + verification_method: Symbol, + account_token: String, + address: Lithic::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + name: String, + user_defined_id: String + } + ) + end + def to_hash + end + + # Account Type + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::ExternalBankAccountCreateParams::Body::Unverified::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHECKING = + T.let( + :CHECKING, + Lithic::ExternalBankAccountCreateParams::Body::Unverified::Type::TaggedSymbol + ) + SAVINGS = + T.let( + :SAVINGS, + Lithic::ExternalBankAccountCreateParams::Body::Unverified::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ExternalBankAccountCreateParams::Body::Unverified::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig do + override.returns( + T::Array[Lithic::ExternalBankAccountCreateParams::Body::Variants] + ) + end + def self.variants + end + end + end + end +end diff --git a/rbi/lithic/models/external_bank_account_create_response.rbi b/rbi/lithic/models/external_bank_account_create_response.rbi new file mode 100644 index 00000000..27e0fde0 --- /dev/null +++ b/rbi/lithic/models/external_bank_account_create_response.rbi @@ -0,0 +1,467 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountCreateResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::ExternalBankAccountCreateResponse, + Lithic::Internal::AnyHash + ) + end + + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + sig { returns(String) } + attr_accessor :token + + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + sig { returns(String) } + attr_accessor :country + + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + sig { returns(Time) } + attr_accessor :created + + # currency of the external account 3-character alphabetic ISO 4217 code + sig { returns(String) } + attr_accessor :currency + + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + sig { returns(String) } + attr_accessor :last_four + + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + sig { returns(String) } + attr_accessor :owner + + # Owner Type + sig do + returns( + Lithic::Models::ExternalBankAccountCreateResponse::OwnerType::TaggedSymbol + ) + end + attr_accessor :owner_type + + # Routing Number + sig { returns(String) } + attr_accessor :routing_number + + # Account State + sig do + returns( + Lithic::Models::ExternalBankAccountCreateResponse::State::TaggedSymbol + ) + end + attr_accessor :state + + # Account Type + sig do + returns( + Lithic::Models::ExternalBankAccountCreateResponse::Type::TaggedSymbol + ) + end + attr_accessor :type + + # The number of attempts at verification + sig { returns(Integer) } + attr_accessor :verification_attempts + + # Verification Method + sig do + returns( + Lithic::Models::ExternalBankAccountCreateResponse::VerificationMethod::TaggedSymbol + ) + end + attr_accessor :verification_method + + # Verification State + sig do + returns( + Lithic::Models::ExternalBankAccountCreateResponse::VerificationState::TaggedSymbol + ) + end + attr_accessor :verification_state + + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + sig { returns(T.nilable(String)) } + attr_accessor :account_token + + # Address + sig { returns(T.nilable(Lithic::ExternalBankAccountAddress)) } + attr_reader :address + + sig do + params( + address: T.nilable(Lithic::ExternalBankAccountAddress::OrHash) + ).void + end + attr_writer :address + + # Optional field that helps identify bank accounts in receipts + sig { returns(T.nilable(String)) } + attr_accessor :company_id + + # Date of Birth of the Individual that owns the external bank account + sig { returns(T.nilable(Date)) } + attr_accessor :dob + + # Doing Business As + sig { returns(T.nilable(String)) } + attr_accessor :doing_business_as + + # The financial account token of the operating account to fund the micro deposits + sig { returns(T.nilable(String)) } + attr_accessor :financial_account_token + + # The nickname for this External Bank Account + sig { returns(T.nilable(String)) } + attr_accessor :name + + # User Defined ID + sig { returns(T.nilable(String)) } + attr_accessor :user_defined_id + + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + sig { returns(T.nilable(String)) } + attr_accessor :verification_failed_reason + + sig do + params( + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: + Lithic::Models::ExternalBankAccountCreateResponse::OwnerType::OrSymbol, + routing_number: String, + state: + Lithic::Models::ExternalBankAccountCreateResponse::State::OrSymbol, + type: + Lithic::Models::ExternalBankAccountCreateResponse::Type::OrSymbol, + verification_attempts: Integer, + verification_method: + Lithic::Models::ExternalBankAccountCreateResponse::VerificationMethod::OrSymbol, + verification_state: + Lithic::Models::ExternalBankAccountCreateResponse::VerificationState::OrSymbol, + account_token: T.nilable(String), + address: T.nilable(Lithic::ExternalBankAccountAddress::OrHash), + company_id: T.nilable(String), + dob: T.nilable(Date), + doing_business_as: T.nilable(String), + financial_account_token: T.nilable(String), + name: T.nilable(String), + user_defined_id: T.nilable(String), + verification_failed_reason: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + token:, + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + country:, + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + created:, + # currency of the external account 3-character alphabetic ISO 4217 code + currency:, + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + last_four:, + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + owner:, + # Owner Type + owner_type:, + # Routing Number + routing_number:, + # Account State + state:, + # Account Type + type:, + # The number of attempts at verification + verification_attempts:, + # Verification Method + verification_method:, + # Verification State + verification_state:, + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + account_token: nil, + # Address + address: nil, + # Optional field that helps identify bank accounts in receipts + company_id: nil, + # Date of Birth of the Individual that owns the external bank account + dob: nil, + # Doing Business As + doing_business_as: nil, + # The financial account token of the operating account to fund the micro deposits + financial_account_token: nil, + # The nickname for this External Bank Account + name: nil, + # User Defined ID + user_defined_id: nil, + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + verification_failed_reason: nil + ) + end + + sig do + override.returns( + { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: + Lithic::Models::ExternalBankAccountCreateResponse::OwnerType::TaggedSymbol, + routing_number: String, + state: + Lithic::Models::ExternalBankAccountCreateResponse::State::TaggedSymbol, + type: + Lithic::Models::ExternalBankAccountCreateResponse::Type::TaggedSymbol, + verification_attempts: Integer, + verification_method: + Lithic::Models::ExternalBankAccountCreateResponse::VerificationMethod::TaggedSymbol, + verification_state: + Lithic::Models::ExternalBankAccountCreateResponse::VerificationState::TaggedSymbol, + account_token: T.nilable(String), + address: T.nilable(Lithic::ExternalBankAccountAddress), + company_id: T.nilable(String), + dob: T.nilable(Date), + doing_business_as: T.nilable(String), + financial_account_token: T.nilable(String), + name: T.nilable(String), + user_defined_id: T.nilable(String), + verification_failed_reason: T.nilable(String) + } + ) + end + def to_hash + end + + # Owner Type + module OwnerType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::ExternalBankAccountCreateResponse::OwnerType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BUSINESS = + T.let( + :BUSINESS, + Lithic::Models::ExternalBankAccountCreateResponse::OwnerType::TaggedSymbol + ) + INDIVIDUAL = + T.let( + :INDIVIDUAL, + Lithic::Models::ExternalBankAccountCreateResponse::OwnerType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccountCreateResponse::OwnerType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Account State + module State + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::ExternalBankAccountCreateResponse::State + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ENABLED = + T.let( + :ENABLED, + Lithic::Models::ExternalBankAccountCreateResponse::State::TaggedSymbol + ) + CLOSED = + T.let( + :CLOSED, + Lithic::Models::ExternalBankAccountCreateResponse::State::TaggedSymbol + ) + PAUSED = + T.let( + :PAUSED, + Lithic::Models::ExternalBankAccountCreateResponse::State::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccountCreateResponse::State::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Account Type + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::ExternalBankAccountCreateResponse::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHECKING = + T.let( + :CHECKING, + Lithic::Models::ExternalBankAccountCreateResponse::Type::TaggedSymbol + ) + SAVINGS = + T.let( + :SAVINGS, + Lithic::Models::ExternalBankAccountCreateResponse::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccountCreateResponse::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Verification Method + module VerificationMethod + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::ExternalBankAccountCreateResponse::VerificationMethod + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MANUAL = + T.let( + :MANUAL, + Lithic::Models::ExternalBankAccountCreateResponse::VerificationMethod::TaggedSymbol + ) + MICRO_DEPOSIT = + T.let( + :MICRO_DEPOSIT, + Lithic::Models::ExternalBankAccountCreateResponse::VerificationMethod::TaggedSymbol + ) + PLAID = + T.let( + :PLAID, + Lithic::Models::ExternalBankAccountCreateResponse::VerificationMethod::TaggedSymbol + ) + PRENOTE = + T.let( + :PRENOTE, + Lithic::Models::ExternalBankAccountCreateResponse::VerificationMethod::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccountCreateResponse::VerificationMethod::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Verification State + module VerificationState + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::ExternalBankAccountCreateResponse::VerificationState + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :PENDING, + Lithic::Models::ExternalBankAccountCreateResponse::VerificationState::TaggedSymbol + ) + ENABLED = + T.let( + :ENABLED, + Lithic::Models::ExternalBankAccountCreateResponse::VerificationState::TaggedSymbol + ) + FAILED_VERIFICATION = + T.let( + :FAILED_VERIFICATION, + Lithic::Models::ExternalBankAccountCreateResponse::VerificationState::TaggedSymbol + ) + INSUFFICIENT_FUNDS = + T.let( + :INSUFFICIENT_FUNDS, + Lithic::Models::ExternalBankAccountCreateResponse::VerificationState::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccountCreateResponse::VerificationState::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/external_bank_account_created_webhook_event.rbi b/rbi/lithic/models/external_bank_account_created_webhook_event.rbi new file mode 100644 index 00000000..3c526c6f --- /dev/null +++ b/rbi/lithic/models/external_bank_account_created_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountCreatedWebhookEvent < Lithic::Models::ExternalBankAccount + OrHash = + T.type_alias do + T.any( + Lithic::ExternalBankAccountCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"external_bank_account.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/external_bank_account_list_params.rbi b/rbi/lithic/models/external_bank_account_list_params.rbi new file mode 100644 index 00000000..31e8367a --- /dev/null +++ b/rbi/lithic/models/external_bank_account_list_params.rbi @@ -0,0 +1,293 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::ExternalBankAccountListParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + sig do + returns( + T.nilable( + T::Array[ + Lithic::ExternalBankAccountListParams::AccountType::OrSymbol + ] + ) + ) + end + attr_reader :account_types + + sig do + params( + account_types: + T::Array[ + Lithic::ExternalBankAccountListParams::AccountType::OrSymbol + ] + ).void + end + attr_writer :account_types + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :countries + + sig { params(countries: T::Array[String]).void } + attr_writer :countries + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + sig { returns(T.nilable(T::Array[Lithic::OwnerType::OrSymbol])) } + attr_reader :owner_types + + sig { params(owner_types: T::Array[Lithic::OwnerType::OrSymbol]).void } + attr_writer :owner_types + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + returns( + T.nilable( + T::Array[Lithic::ExternalBankAccountListParams::State::OrSymbol] + ) + ) + end + attr_reader :states + + sig do + params( + states: + T::Array[Lithic::ExternalBankAccountListParams::State::OrSymbol] + ).void + end + attr_writer :states + + sig do + returns( + T.nilable( + T::Array[ + Lithic::ExternalBankAccountListParams::VerificationState::OrSymbol + ] + ) + ) + end + attr_reader :verification_states + + sig do + params( + verification_states: + T::Array[ + Lithic::ExternalBankAccountListParams::VerificationState::OrSymbol + ] + ).void + end + attr_writer :verification_states + + sig do + params( + account_token: String, + account_types: + T::Array[ + Lithic::ExternalBankAccountListParams::AccountType::OrSymbol + ], + countries: T::Array[String], + ending_before: String, + owner_types: T::Array[Lithic::OwnerType::OrSymbol], + page_size: Integer, + starting_after: String, + states: + T::Array[Lithic::ExternalBankAccountListParams::State::OrSymbol], + verification_states: + T::Array[ + Lithic::ExternalBankAccountListParams::VerificationState::OrSymbol + ], + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + account_token: nil, + account_types: nil, + countries: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + owner_types: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + states: nil, + verification_states: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + account_token: String, + account_types: + T::Array[ + Lithic::ExternalBankAccountListParams::AccountType::OrSymbol + ], + countries: T::Array[String], + ending_before: String, + owner_types: T::Array[Lithic::OwnerType::OrSymbol], + page_size: Integer, + starting_after: String, + states: + T::Array[Lithic::ExternalBankAccountListParams::State::OrSymbol], + verification_states: + T::Array[ + Lithic::ExternalBankAccountListParams::VerificationState::OrSymbol + ], + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + module AccountType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ExternalBankAccountListParams::AccountType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHECKING = + T.let( + :CHECKING, + Lithic::ExternalBankAccountListParams::AccountType::TaggedSymbol + ) + SAVINGS = + T.let( + :SAVINGS, + Lithic::ExternalBankAccountListParams::AccountType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ExternalBankAccountListParams::AccountType::TaggedSymbol + ] + ) + end + def self.values + end + end + + module State + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ExternalBankAccountListParams::State) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ENABLED = + T.let( + :ENABLED, + Lithic::ExternalBankAccountListParams::State::TaggedSymbol + ) + CLOSED = + T.let( + :CLOSED, + Lithic::ExternalBankAccountListParams::State::TaggedSymbol + ) + PAUSED = + T.let( + :PAUSED, + Lithic::ExternalBankAccountListParams::State::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::ExternalBankAccountListParams::State::TaggedSymbol] + ) + end + def self.values + end + end + + module VerificationState + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::ExternalBankAccountListParams::VerificationState + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :PENDING, + Lithic::ExternalBankAccountListParams::VerificationState::TaggedSymbol + ) + ENABLED = + T.let( + :ENABLED, + Lithic::ExternalBankAccountListParams::VerificationState::TaggedSymbol + ) + FAILED_VERIFICATION = + T.let( + :FAILED_VERIFICATION, + Lithic::ExternalBankAccountListParams::VerificationState::TaggedSymbol + ) + INSUFFICIENT_FUNDS = + T.let( + :INSUFFICIENT_FUNDS, + Lithic::ExternalBankAccountListParams::VerificationState::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ExternalBankAccountListParams::VerificationState::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/external_bank_account_list_response.rbi b/rbi/lithic/models/external_bank_account_list_response.rbi new file mode 100644 index 00000000..36acf69d --- /dev/null +++ b/rbi/lithic/models/external_bank_account_list_response.rbi @@ -0,0 +1,463 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountListResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::ExternalBankAccountListResponse, + Lithic::Internal::AnyHash + ) + end + + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + sig { returns(String) } + attr_accessor :token + + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + sig { returns(String) } + attr_accessor :country + + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + sig { returns(Time) } + attr_accessor :created + + # currency of the external account 3-character alphabetic ISO 4217 code + sig { returns(String) } + attr_accessor :currency + + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + sig { returns(String) } + attr_accessor :last_four + + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + sig { returns(String) } + attr_accessor :owner + + # Owner Type + sig do + returns( + Lithic::Models::ExternalBankAccountListResponse::OwnerType::TaggedSymbol + ) + end + attr_accessor :owner_type + + # Routing Number + sig { returns(String) } + attr_accessor :routing_number + + # Account State + sig do + returns( + Lithic::Models::ExternalBankAccountListResponse::State::TaggedSymbol + ) + end + attr_accessor :state + + # Account Type + sig do + returns( + Lithic::Models::ExternalBankAccountListResponse::Type::TaggedSymbol + ) + end + attr_accessor :type + + # The number of attempts at verification + sig { returns(Integer) } + attr_accessor :verification_attempts + + # Verification Method + sig do + returns( + Lithic::Models::ExternalBankAccountListResponse::VerificationMethod::TaggedSymbol + ) + end + attr_accessor :verification_method + + # Verification State + sig do + returns( + Lithic::Models::ExternalBankAccountListResponse::VerificationState::TaggedSymbol + ) + end + attr_accessor :verification_state + + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + sig { returns(T.nilable(String)) } + attr_accessor :account_token + + # Address + sig { returns(T.nilable(Lithic::ExternalBankAccountAddress)) } + attr_reader :address + + sig do + params( + address: T.nilable(Lithic::ExternalBankAccountAddress::OrHash) + ).void + end + attr_writer :address + + # Optional field that helps identify bank accounts in receipts + sig { returns(T.nilable(String)) } + attr_accessor :company_id + + # Date of Birth of the Individual that owns the external bank account + sig { returns(T.nilable(Date)) } + attr_accessor :dob + + # Doing Business As + sig { returns(T.nilable(String)) } + attr_accessor :doing_business_as + + # The financial account token of the operating account to fund the micro deposits + sig { returns(T.nilable(String)) } + attr_accessor :financial_account_token + + # The nickname for this External Bank Account + sig { returns(T.nilable(String)) } + attr_accessor :name + + # User Defined ID + sig { returns(T.nilable(String)) } + attr_accessor :user_defined_id + + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + sig { returns(T.nilable(String)) } + attr_accessor :verification_failed_reason + + sig do + params( + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: + Lithic::Models::ExternalBankAccountListResponse::OwnerType::OrSymbol, + routing_number: String, + state: + Lithic::Models::ExternalBankAccountListResponse::State::OrSymbol, + type: Lithic::Models::ExternalBankAccountListResponse::Type::OrSymbol, + verification_attempts: Integer, + verification_method: + Lithic::Models::ExternalBankAccountListResponse::VerificationMethod::OrSymbol, + verification_state: + Lithic::Models::ExternalBankAccountListResponse::VerificationState::OrSymbol, + account_token: T.nilable(String), + address: T.nilable(Lithic::ExternalBankAccountAddress::OrHash), + company_id: T.nilable(String), + dob: T.nilable(Date), + doing_business_as: T.nilable(String), + financial_account_token: T.nilable(String), + name: T.nilable(String), + user_defined_id: T.nilable(String), + verification_failed_reason: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + token:, + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + country:, + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + created:, + # currency of the external account 3-character alphabetic ISO 4217 code + currency:, + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + last_four:, + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + owner:, + # Owner Type + owner_type:, + # Routing Number + routing_number:, + # Account State + state:, + # Account Type + type:, + # The number of attempts at verification + verification_attempts:, + # Verification Method + verification_method:, + # Verification State + verification_state:, + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + account_token: nil, + # Address + address: nil, + # Optional field that helps identify bank accounts in receipts + company_id: nil, + # Date of Birth of the Individual that owns the external bank account + dob: nil, + # Doing Business As + doing_business_as: nil, + # The financial account token of the operating account to fund the micro deposits + financial_account_token: nil, + # The nickname for this External Bank Account + name: nil, + # User Defined ID + user_defined_id: nil, + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + verification_failed_reason: nil + ) + end + + sig do + override.returns( + { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: + Lithic::Models::ExternalBankAccountListResponse::OwnerType::TaggedSymbol, + routing_number: String, + state: + Lithic::Models::ExternalBankAccountListResponse::State::TaggedSymbol, + type: + Lithic::Models::ExternalBankAccountListResponse::Type::TaggedSymbol, + verification_attempts: Integer, + verification_method: + Lithic::Models::ExternalBankAccountListResponse::VerificationMethod::TaggedSymbol, + verification_state: + Lithic::Models::ExternalBankAccountListResponse::VerificationState::TaggedSymbol, + account_token: T.nilable(String), + address: T.nilable(Lithic::ExternalBankAccountAddress), + company_id: T.nilable(String), + dob: T.nilable(Date), + doing_business_as: T.nilable(String), + financial_account_token: T.nilable(String), + name: T.nilable(String), + user_defined_id: T.nilable(String), + verification_failed_reason: T.nilable(String) + } + ) + end + def to_hash + end + + # Owner Type + module OwnerType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::ExternalBankAccountListResponse::OwnerType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BUSINESS = + T.let( + :BUSINESS, + Lithic::Models::ExternalBankAccountListResponse::OwnerType::TaggedSymbol + ) + INDIVIDUAL = + T.let( + :INDIVIDUAL, + Lithic::Models::ExternalBankAccountListResponse::OwnerType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccountListResponse::OwnerType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Account State + module State + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::ExternalBankAccountListResponse::State + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ENABLED = + T.let( + :ENABLED, + Lithic::Models::ExternalBankAccountListResponse::State::TaggedSymbol + ) + CLOSED = + T.let( + :CLOSED, + Lithic::Models::ExternalBankAccountListResponse::State::TaggedSymbol + ) + PAUSED = + T.let( + :PAUSED, + Lithic::Models::ExternalBankAccountListResponse::State::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccountListResponse::State::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Account Type + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Models::ExternalBankAccountListResponse::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHECKING = + T.let( + :CHECKING, + Lithic::Models::ExternalBankAccountListResponse::Type::TaggedSymbol + ) + SAVINGS = + T.let( + :SAVINGS, + Lithic::Models::ExternalBankAccountListResponse::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccountListResponse::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Verification Method + module VerificationMethod + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::ExternalBankAccountListResponse::VerificationMethod + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MANUAL = + T.let( + :MANUAL, + Lithic::Models::ExternalBankAccountListResponse::VerificationMethod::TaggedSymbol + ) + MICRO_DEPOSIT = + T.let( + :MICRO_DEPOSIT, + Lithic::Models::ExternalBankAccountListResponse::VerificationMethod::TaggedSymbol + ) + PLAID = + T.let( + :PLAID, + Lithic::Models::ExternalBankAccountListResponse::VerificationMethod::TaggedSymbol + ) + PRENOTE = + T.let( + :PRENOTE, + Lithic::Models::ExternalBankAccountListResponse::VerificationMethod::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccountListResponse::VerificationMethod::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Verification State + module VerificationState + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::ExternalBankAccountListResponse::VerificationState + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :PENDING, + Lithic::Models::ExternalBankAccountListResponse::VerificationState::TaggedSymbol + ) + ENABLED = + T.let( + :ENABLED, + Lithic::Models::ExternalBankAccountListResponse::VerificationState::TaggedSymbol + ) + FAILED_VERIFICATION = + T.let( + :FAILED_VERIFICATION, + Lithic::Models::ExternalBankAccountListResponse::VerificationState::TaggedSymbol + ) + INSUFFICIENT_FUNDS = + T.let( + :INSUFFICIENT_FUNDS, + Lithic::Models::ExternalBankAccountListResponse::VerificationState::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccountListResponse::VerificationState::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/external_bank_account_pause_params.rbi b/rbi/lithic/models/external_bank_account_pause_params.rbi new file mode 100644 index 00000000..3a86e42f --- /dev/null +++ b/rbi/lithic/models/external_bank_account_pause_params.rbi @@ -0,0 +1,41 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountPauseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::ExternalBankAccountPauseParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :external_bank_account_token + + sig do + params( + external_bank_account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(external_bank_account_token:, request_options: {}) + end + + sig do + override.returns( + { + external_bank_account_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/external_bank_account_retrieve_params.rbi b/rbi/lithic/models/external_bank_account_retrieve_params.rbi new file mode 100644 index 00000000..2d70703a --- /dev/null +++ b/rbi/lithic/models/external_bank_account_retrieve_params.rbi @@ -0,0 +1,41 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::ExternalBankAccountRetrieveParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :external_bank_account_token + + sig do + params( + external_bank_account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(external_bank_account_token:, request_options: {}) + end + + sig do + override.returns( + { + external_bank_account_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/external_bank_account_retrieve_response.rbi b/rbi/lithic/models/external_bank_account_retrieve_response.rbi new file mode 100644 index 00000000..de65ad48 --- /dev/null +++ b/rbi/lithic/models/external_bank_account_retrieve_response.rbi @@ -0,0 +1,467 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountRetrieveResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::ExternalBankAccountRetrieveResponse, + Lithic::Internal::AnyHash + ) + end + + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + sig { returns(String) } + attr_accessor :token + + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + sig { returns(String) } + attr_accessor :country + + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + sig { returns(Time) } + attr_accessor :created + + # currency of the external account 3-character alphabetic ISO 4217 code + sig { returns(String) } + attr_accessor :currency + + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + sig { returns(String) } + attr_accessor :last_four + + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + sig { returns(String) } + attr_accessor :owner + + # Owner Type + sig do + returns( + Lithic::Models::ExternalBankAccountRetrieveResponse::OwnerType::TaggedSymbol + ) + end + attr_accessor :owner_type + + # Routing Number + sig { returns(String) } + attr_accessor :routing_number + + # Account State + sig do + returns( + Lithic::Models::ExternalBankAccountRetrieveResponse::State::TaggedSymbol + ) + end + attr_accessor :state + + # Account Type + sig do + returns( + Lithic::Models::ExternalBankAccountRetrieveResponse::Type::TaggedSymbol + ) + end + attr_accessor :type + + # The number of attempts at verification + sig { returns(Integer) } + attr_accessor :verification_attempts + + # Verification Method + sig do + returns( + Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationMethod::TaggedSymbol + ) + end + attr_accessor :verification_method + + # Verification State + sig do + returns( + Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationState::TaggedSymbol + ) + end + attr_accessor :verification_state + + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + sig { returns(T.nilable(String)) } + attr_accessor :account_token + + # Address + sig { returns(T.nilable(Lithic::ExternalBankAccountAddress)) } + attr_reader :address + + sig do + params( + address: T.nilable(Lithic::ExternalBankAccountAddress::OrHash) + ).void + end + attr_writer :address + + # Optional field that helps identify bank accounts in receipts + sig { returns(T.nilable(String)) } + attr_accessor :company_id + + # Date of Birth of the Individual that owns the external bank account + sig { returns(T.nilable(Date)) } + attr_accessor :dob + + # Doing Business As + sig { returns(T.nilable(String)) } + attr_accessor :doing_business_as + + # The financial account token of the operating account to fund the micro deposits + sig { returns(T.nilable(String)) } + attr_accessor :financial_account_token + + # The nickname for this External Bank Account + sig { returns(T.nilable(String)) } + attr_accessor :name + + # User Defined ID + sig { returns(T.nilable(String)) } + attr_accessor :user_defined_id + + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + sig { returns(T.nilable(String)) } + attr_accessor :verification_failed_reason + + sig do + params( + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: + Lithic::Models::ExternalBankAccountRetrieveResponse::OwnerType::OrSymbol, + routing_number: String, + state: + Lithic::Models::ExternalBankAccountRetrieveResponse::State::OrSymbol, + type: + Lithic::Models::ExternalBankAccountRetrieveResponse::Type::OrSymbol, + verification_attempts: Integer, + verification_method: + Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationMethod::OrSymbol, + verification_state: + Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationState::OrSymbol, + account_token: T.nilable(String), + address: T.nilable(Lithic::ExternalBankAccountAddress::OrHash), + company_id: T.nilable(String), + dob: T.nilable(Date), + doing_business_as: T.nilable(String), + financial_account_token: T.nilable(String), + name: T.nilable(String), + user_defined_id: T.nilable(String), + verification_failed_reason: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + token:, + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + country:, + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + created:, + # currency of the external account 3-character alphabetic ISO 4217 code + currency:, + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + last_four:, + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + owner:, + # Owner Type + owner_type:, + # Routing Number + routing_number:, + # Account State + state:, + # Account Type + type:, + # The number of attempts at verification + verification_attempts:, + # Verification Method + verification_method:, + # Verification State + verification_state:, + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + account_token: nil, + # Address + address: nil, + # Optional field that helps identify bank accounts in receipts + company_id: nil, + # Date of Birth of the Individual that owns the external bank account + dob: nil, + # Doing Business As + doing_business_as: nil, + # The financial account token of the operating account to fund the micro deposits + financial_account_token: nil, + # The nickname for this External Bank Account + name: nil, + # User Defined ID + user_defined_id: nil, + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + verification_failed_reason: nil + ) + end + + sig do + override.returns( + { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: + Lithic::Models::ExternalBankAccountRetrieveResponse::OwnerType::TaggedSymbol, + routing_number: String, + state: + Lithic::Models::ExternalBankAccountRetrieveResponse::State::TaggedSymbol, + type: + Lithic::Models::ExternalBankAccountRetrieveResponse::Type::TaggedSymbol, + verification_attempts: Integer, + verification_method: + Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationMethod::TaggedSymbol, + verification_state: + Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationState::TaggedSymbol, + account_token: T.nilable(String), + address: T.nilable(Lithic::ExternalBankAccountAddress), + company_id: T.nilable(String), + dob: T.nilable(Date), + doing_business_as: T.nilable(String), + financial_account_token: T.nilable(String), + name: T.nilable(String), + user_defined_id: T.nilable(String), + verification_failed_reason: T.nilable(String) + } + ) + end + def to_hash + end + + # Owner Type + module OwnerType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::ExternalBankAccountRetrieveResponse::OwnerType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BUSINESS = + T.let( + :BUSINESS, + Lithic::Models::ExternalBankAccountRetrieveResponse::OwnerType::TaggedSymbol + ) + INDIVIDUAL = + T.let( + :INDIVIDUAL, + Lithic::Models::ExternalBankAccountRetrieveResponse::OwnerType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccountRetrieveResponse::OwnerType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Account State + module State + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::ExternalBankAccountRetrieveResponse::State + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ENABLED = + T.let( + :ENABLED, + Lithic::Models::ExternalBankAccountRetrieveResponse::State::TaggedSymbol + ) + CLOSED = + T.let( + :CLOSED, + Lithic::Models::ExternalBankAccountRetrieveResponse::State::TaggedSymbol + ) + PAUSED = + T.let( + :PAUSED, + Lithic::Models::ExternalBankAccountRetrieveResponse::State::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccountRetrieveResponse::State::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Account Type + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::ExternalBankAccountRetrieveResponse::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHECKING = + T.let( + :CHECKING, + Lithic::Models::ExternalBankAccountRetrieveResponse::Type::TaggedSymbol + ) + SAVINGS = + T.let( + :SAVINGS, + Lithic::Models::ExternalBankAccountRetrieveResponse::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccountRetrieveResponse::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Verification Method + module VerificationMethod + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationMethod + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MANUAL = + T.let( + :MANUAL, + Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationMethod::TaggedSymbol + ) + MICRO_DEPOSIT = + T.let( + :MICRO_DEPOSIT, + Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationMethod::TaggedSymbol + ) + PLAID = + T.let( + :PLAID, + Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationMethod::TaggedSymbol + ) + PRENOTE = + T.let( + :PRENOTE, + Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationMethod::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationMethod::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Verification State + module VerificationState + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationState + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :PENDING, + Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationState::TaggedSymbol + ) + ENABLED = + T.let( + :ENABLED, + Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationState::TaggedSymbol + ) + FAILED_VERIFICATION = + T.let( + :FAILED_VERIFICATION, + Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationState::TaggedSymbol + ) + INSUFFICIENT_FUNDS = + T.let( + :INSUFFICIENT_FUNDS, + Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationState::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationState::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/external_bank_account_retry_micro_deposits_params.rbi b/rbi/lithic/models/external_bank_account_retry_micro_deposits_params.rbi new file mode 100644 index 00000000..39b9b53d --- /dev/null +++ b/rbi/lithic/models/external_bank_account_retry_micro_deposits_params.rbi @@ -0,0 +1,53 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountRetryMicroDepositsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::ExternalBankAccountRetryMicroDepositsParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :external_bank_account_token + + sig { returns(T.nilable(String)) } + attr_reader :financial_account_token + + sig { params(financial_account_token: String).void } + attr_writer :financial_account_token + + sig do + params( + external_bank_account_token: String, + financial_account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + external_bank_account_token:, + financial_account_token: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + external_bank_account_token: String, + financial_account_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/external_bank_account_retry_micro_deposits_response.rbi b/rbi/lithic/models/external_bank_account_retry_micro_deposits_response.rbi new file mode 100644 index 00000000..db729557 --- /dev/null +++ b/rbi/lithic/models/external_bank_account_retry_micro_deposits_response.rbi @@ -0,0 +1,467 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountRetryMicroDepositsResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse, + Lithic::Internal::AnyHash + ) + end + + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + sig { returns(String) } + attr_accessor :token + + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + sig { returns(String) } + attr_accessor :country + + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + sig { returns(Time) } + attr_accessor :created + + # currency of the external account 3-character alphabetic ISO 4217 code + sig { returns(String) } + attr_accessor :currency + + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + sig { returns(String) } + attr_accessor :last_four + + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + sig { returns(String) } + attr_accessor :owner + + # Owner Type + sig do + returns( + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::OwnerType::TaggedSymbol + ) + end + attr_accessor :owner_type + + # Routing Number + sig { returns(String) } + attr_accessor :routing_number + + # Account State + sig do + returns( + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::State::TaggedSymbol + ) + end + attr_accessor :state + + # Account Type + sig do + returns( + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::Type::TaggedSymbol + ) + end + attr_accessor :type + + # The number of attempts at verification + sig { returns(Integer) } + attr_accessor :verification_attempts + + # Verification Method + sig do + returns( + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationMethod::TaggedSymbol + ) + end + attr_accessor :verification_method + + # Verification State + sig do + returns( + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationState::TaggedSymbol + ) + end + attr_accessor :verification_state + + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + sig { returns(T.nilable(String)) } + attr_accessor :account_token + + # Address + sig { returns(T.nilable(Lithic::ExternalBankAccountAddress)) } + attr_reader :address + + sig do + params( + address: T.nilable(Lithic::ExternalBankAccountAddress::OrHash) + ).void + end + attr_writer :address + + # Optional field that helps identify bank accounts in receipts + sig { returns(T.nilable(String)) } + attr_accessor :company_id + + # Date of Birth of the Individual that owns the external bank account + sig { returns(T.nilable(Date)) } + attr_accessor :dob + + # Doing Business As + sig { returns(T.nilable(String)) } + attr_accessor :doing_business_as + + # The financial account token of the operating account to fund the micro deposits + sig { returns(T.nilable(String)) } + attr_accessor :financial_account_token + + # The nickname for this External Bank Account + sig { returns(T.nilable(String)) } + attr_accessor :name + + # User Defined ID + sig { returns(T.nilable(String)) } + attr_accessor :user_defined_id + + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + sig { returns(T.nilable(String)) } + attr_accessor :verification_failed_reason + + sig do + params( + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::OwnerType::OrSymbol, + routing_number: String, + state: + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::State::OrSymbol, + type: + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::Type::OrSymbol, + verification_attempts: Integer, + verification_method: + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationMethod::OrSymbol, + verification_state: + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationState::OrSymbol, + account_token: T.nilable(String), + address: T.nilable(Lithic::ExternalBankAccountAddress::OrHash), + company_id: T.nilable(String), + dob: T.nilable(Date), + doing_business_as: T.nilable(String), + financial_account_token: T.nilable(String), + name: T.nilable(String), + user_defined_id: T.nilable(String), + verification_failed_reason: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + token:, + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + country:, + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + created:, + # currency of the external account 3-character alphabetic ISO 4217 code + currency:, + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + last_four:, + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + owner:, + # Owner Type + owner_type:, + # Routing Number + routing_number:, + # Account State + state:, + # Account Type + type:, + # The number of attempts at verification + verification_attempts:, + # Verification Method + verification_method:, + # Verification State + verification_state:, + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + account_token: nil, + # Address + address: nil, + # Optional field that helps identify bank accounts in receipts + company_id: nil, + # Date of Birth of the Individual that owns the external bank account + dob: nil, + # Doing Business As + doing_business_as: nil, + # The financial account token of the operating account to fund the micro deposits + financial_account_token: nil, + # The nickname for this External Bank Account + name: nil, + # User Defined ID + user_defined_id: nil, + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + verification_failed_reason: nil + ) + end + + sig do + override.returns( + { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::OwnerType::TaggedSymbol, + routing_number: String, + state: + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::State::TaggedSymbol, + type: + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::Type::TaggedSymbol, + verification_attempts: Integer, + verification_method: + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationMethod::TaggedSymbol, + verification_state: + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationState::TaggedSymbol, + account_token: T.nilable(String), + address: T.nilable(Lithic::ExternalBankAccountAddress), + company_id: T.nilable(String), + dob: T.nilable(Date), + doing_business_as: T.nilable(String), + financial_account_token: T.nilable(String), + name: T.nilable(String), + user_defined_id: T.nilable(String), + verification_failed_reason: T.nilable(String) + } + ) + end + def to_hash + end + + # Owner Type + module OwnerType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::OwnerType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BUSINESS = + T.let( + :BUSINESS, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::OwnerType::TaggedSymbol + ) + INDIVIDUAL = + T.let( + :INDIVIDUAL, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::OwnerType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::OwnerType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Account State + module State + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::State + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ENABLED = + T.let( + :ENABLED, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::State::TaggedSymbol + ) + CLOSED = + T.let( + :CLOSED, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::State::TaggedSymbol + ) + PAUSED = + T.let( + :PAUSED, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::State::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::State::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Account Type + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHECKING = + T.let( + :CHECKING, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::Type::TaggedSymbol + ) + SAVINGS = + T.let( + :SAVINGS, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Verification Method + module VerificationMethod + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationMethod + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MANUAL = + T.let( + :MANUAL, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationMethod::TaggedSymbol + ) + MICRO_DEPOSIT = + T.let( + :MICRO_DEPOSIT, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationMethod::TaggedSymbol + ) + PLAID = + T.let( + :PLAID, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationMethod::TaggedSymbol + ) + PRENOTE = + T.let( + :PRENOTE, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationMethod::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationMethod::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Verification State + module VerificationState + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationState + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :PENDING, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationState::TaggedSymbol + ) + ENABLED = + T.let( + :ENABLED, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationState::TaggedSymbol + ) + FAILED_VERIFICATION = + T.let( + :FAILED_VERIFICATION, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationState::TaggedSymbol + ) + INSUFFICIENT_FUNDS = + T.let( + :INSUFFICIENT_FUNDS, + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationState::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationState::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/external_bank_account_retry_prenote_params.rbi b/rbi/lithic/models/external_bank_account_retry_prenote_params.rbi new file mode 100644 index 00000000..7f58f7b4 --- /dev/null +++ b/rbi/lithic/models/external_bank_account_retry_prenote_params.rbi @@ -0,0 +1,53 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountRetryPrenoteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::ExternalBankAccountRetryPrenoteParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :external_bank_account_token + + sig { returns(T.nilable(String)) } + attr_reader :financial_account_token + + sig { params(financial_account_token: String).void } + attr_writer :financial_account_token + + sig do + params( + external_bank_account_token: String, + financial_account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + external_bank_account_token:, + financial_account_token: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + external_bank_account_token: String, + financial_account_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/external_bank_account_set_verification_method_params.rbi b/rbi/lithic/models/external_bank_account_set_verification_method_params.rbi new file mode 100644 index 00000000..f185bbed --- /dev/null +++ b/rbi/lithic/models/external_bank_account_set_verification_method_params.rbi @@ -0,0 +1,111 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountSetVerificationMethodParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::ExternalBankAccountSetVerificationMethodParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :external_bank_account_token + + # The verification method to set for the external bank account + sig do + returns( + Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod::OrSymbol + ) + end + attr_accessor :verification_method + + # The financial account token of the operating account to fund the micro deposits. + # Required when verification_method is MICRO_DEPOSIT or PRENOTE. + sig { returns(T.nilable(String)) } + attr_reader :financial_account_token + + sig { params(financial_account_token: String).void } + attr_writer :financial_account_token + + sig do + params( + external_bank_account_token: String, + verification_method: + Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod::OrSymbol, + financial_account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + external_bank_account_token:, + # The verification method to set for the external bank account + verification_method:, + # The financial account token of the operating account to fund the micro deposits. + # Required when verification_method is MICRO_DEPOSIT or PRENOTE. + financial_account_token: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + external_bank_account_token: String, + verification_method: + Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod::OrSymbol, + financial_account_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # The verification method to set for the external bank account + module VerificationMethod + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MICRO_DEPOSIT = + T.let( + :MICRO_DEPOSIT, + Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod::TaggedSymbol + ) + PRENOTE = + T.let( + :PRENOTE, + Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod::TaggedSymbol + ) + EXTERNALLY_VERIFIED = + T.let( + :EXTERNALLY_VERIFIED, + Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/external_bank_account_unpause_params.rbi b/rbi/lithic/models/external_bank_account_unpause_params.rbi new file mode 100644 index 00000000..46874481 --- /dev/null +++ b/rbi/lithic/models/external_bank_account_unpause_params.rbi @@ -0,0 +1,41 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountUnpauseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::ExternalBankAccountUnpauseParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :external_bank_account_token + + sig do + params( + external_bank_account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(external_bank_account_token:, request_options: {}) + end + + sig do + override.returns( + { + external_bank_account_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/external_bank_account_update_params.rbi b/rbi/lithic/models/external_bank_account_update_params.rbi new file mode 100644 index 00000000..4604c16c --- /dev/null +++ b/rbi/lithic/models/external_bank_account_update_params.rbi @@ -0,0 +1,182 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::ExternalBankAccountUpdateParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :external_bank_account_token + + # Address + sig { returns(T.nilable(Lithic::ExternalBankAccountAddress)) } + attr_reader :address + + sig { params(address: Lithic::ExternalBankAccountAddress::OrHash).void } + attr_writer :address + + # Optional field that helps identify bank accounts in receipts + sig { returns(T.nilable(String)) } + attr_reader :company_id + + sig { params(company_id: String).void } + attr_writer :company_id + + # Date of Birth of the Individual that owns the external bank account + sig { returns(T.nilable(Date)) } + attr_reader :dob + + sig { params(dob: Date).void } + attr_writer :dob + + # Doing Business As + sig { returns(T.nilable(String)) } + attr_reader :doing_business_as + + sig { params(doing_business_as: String).void } + attr_writer :doing_business_as + + # The nickname for this External Bank Account + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + sig { returns(T.nilable(String)) } + attr_reader :owner + + sig { params(owner: String).void } + attr_writer :owner + + # Owner Type + sig { returns(T.nilable(Lithic::OwnerType::OrSymbol)) } + attr_reader :owner_type + + sig { params(owner_type: Lithic::OwnerType::OrSymbol).void } + attr_writer :owner_type + + sig do + returns( + T.nilable(Lithic::ExternalBankAccountUpdateParams::Type::OrSymbol) + ) + end + attr_reader :type + + sig do + params( + type: Lithic::ExternalBankAccountUpdateParams::Type::OrSymbol + ).void + end + attr_writer :type + + # User Defined ID + sig { returns(T.nilable(String)) } + attr_reader :user_defined_id + + sig { params(user_defined_id: String).void } + attr_writer :user_defined_id + + sig do + params( + external_bank_account_token: String, + address: Lithic::ExternalBankAccountAddress::OrHash, + company_id: String, + dob: Date, + doing_business_as: String, + name: String, + owner: String, + owner_type: Lithic::OwnerType::OrSymbol, + type: Lithic::ExternalBankAccountUpdateParams::Type::OrSymbol, + user_defined_id: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + external_bank_account_token:, + # Address + address: nil, + # Optional field that helps identify bank accounts in receipts + company_id: nil, + # Date of Birth of the Individual that owns the external bank account + dob: nil, + # Doing Business As + doing_business_as: nil, + # The nickname for this External Bank Account + name: nil, + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + owner: nil, + # Owner Type + owner_type: nil, + type: nil, + # User Defined ID + user_defined_id: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + external_bank_account_token: String, + address: Lithic::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + name: String, + owner: String, + owner_type: Lithic::OwnerType::OrSymbol, + type: Lithic::ExternalBankAccountUpdateParams::Type::OrSymbol, + user_defined_id: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ExternalBankAccountUpdateParams::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHECKING = + T.let( + :CHECKING, + Lithic::ExternalBankAccountUpdateParams::Type::TaggedSymbol + ) + SAVINGS = + T.let( + :SAVINGS, + Lithic::ExternalBankAccountUpdateParams::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ExternalBankAccountUpdateParams::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/external_bank_account_update_response.rbi b/rbi/lithic/models/external_bank_account_update_response.rbi new file mode 100644 index 00000000..f54376f5 --- /dev/null +++ b/rbi/lithic/models/external_bank_account_update_response.rbi @@ -0,0 +1,467 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountUpdateResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::ExternalBankAccountUpdateResponse, + Lithic::Internal::AnyHash + ) + end + + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + sig { returns(String) } + attr_accessor :token + + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + sig { returns(String) } + attr_accessor :country + + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + sig { returns(Time) } + attr_accessor :created + + # currency of the external account 3-character alphabetic ISO 4217 code + sig { returns(String) } + attr_accessor :currency + + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + sig { returns(String) } + attr_accessor :last_four + + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + sig { returns(String) } + attr_accessor :owner + + # Owner Type + sig do + returns( + Lithic::Models::ExternalBankAccountUpdateResponse::OwnerType::TaggedSymbol + ) + end + attr_accessor :owner_type + + # Routing Number + sig { returns(String) } + attr_accessor :routing_number + + # Account State + sig do + returns( + Lithic::Models::ExternalBankAccountUpdateResponse::State::TaggedSymbol + ) + end + attr_accessor :state + + # Account Type + sig do + returns( + Lithic::Models::ExternalBankAccountUpdateResponse::Type::TaggedSymbol + ) + end + attr_accessor :type + + # The number of attempts at verification + sig { returns(Integer) } + attr_accessor :verification_attempts + + # Verification Method + sig do + returns( + Lithic::Models::ExternalBankAccountUpdateResponse::VerificationMethod::TaggedSymbol + ) + end + attr_accessor :verification_method + + # Verification State + sig do + returns( + Lithic::Models::ExternalBankAccountUpdateResponse::VerificationState::TaggedSymbol + ) + end + attr_accessor :verification_state + + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + sig { returns(T.nilable(String)) } + attr_accessor :account_token + + # Address + sig { returns(T.nilable(Lithic::ExternalBankAccountAddress)) } + attr_reader :address + + sig do + params( + address: T.nilable(Lithic::ExternalBankAccountAddress::OrHash) + ).void + end + attr_writer :address + + # Optional field that helps identify bank accounts in receipts + sig { returns(T.nilable(String)) } + attr_accessor :company_id + + # Date of Birth of the Individual that owns the external bank account + sig { returns(T.nilable(Date)) } + attr_accessor :dob + + # Doing Business As + sig { returns(T.nilable(String)) } + attr_accessor :doing_business_as + + # The financial account token of the operating account to fund the micro deposits + sig { returns(T.nilable(String)) } + attr_accessor :financial_account_token + + # The nickname for this External Bank Account + sig { returns(T.nilable(String)) } + attr_accessor :name + + # User Defined ID + sig { returns(T.nilable(String)) } + attr_accessor :user_defined_id + + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + sig { returns(T.nilable(String)) } + attr_accessor :verification_failed_reason + + sig do + params( + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: + Lithic::Models::ExternalBankAccountUpdateResponse::OwnerType::OrSymbol, + routing_number: String, + state: + Lithic::Models::ExternalBankAccountUpdateResponse::State::OrSymbol, + type: + Lithic::Models::ExternalBankAccountUpdateResponse::Type::OrSymbol, + verification_attempts: Integer, + verification_method: + Lithic::Models::ExternalBankAccountUpdateResponse::VerificationMethod::OrSymbol, + verification_state: + Lithic::Models::ExternalBankAccountUpdateResponse::VerificationState::OrSymbol, + account_token: T.nilable(String), + address: T.nilable(Lithic::ExternalBankAccountAddress::OrHash), + company_id: T.nilable(String), + dob: T.nilable(Date), + doing_business_as: T.nilable(String), + financial_account_token: T.nilable(String), + name: T.nilable(String), + user_defined_id: T.nilable(String), + verification_failed_reason: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + token:, + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + country:, + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + created:, + # currency of the external account 3-character alphabetic ISO 4217 code + currency:, + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + last_four:, + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + owner:, + # Owner Type + owner_type:, + # Routing Number + routing_number:, + # Account State + state:, + # Account Type + type:, + # The number of attempts at verification + verification_attempts:, + # Verification Method + verification_method:, + # Verification State + verification_state:, + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + account_token: nil, + # Address + address: nil, + # Optional field that helps identify bank accounts in receipts + company_id: nil, + # Date of Birth of the Individual that owns the external bank account + dob: nil, + # Doing Business As + doing_business_as: nil, + # The financial account token of the operating account to fund the micro deposits + financial_account_token: nil, + # The nickname for this External Bank Account + name: nil, + # User Defined ID + user_defined_id: nil, + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + verification_failed_reason: nil + ) + end + + sig do + override.returns( + { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: + Lithic::Models::ExternalBankAccountUpdateResponse::OwnerType::TaggedSymbol, + routing_number: String, + state: + Lithic::Models::ExternalBankAccountUpdateResponse::State::TaggedSymbol, + type: + Lithic::Models::ExternalBankAccountUpdateResponse::Type::TaggedSymbol, + verification_attempts: Integer, + verification_method: + Lithic::Models::ExternalBankAccountUpdateResponse::VerificationMethod::TaggedSymbol, + verification_state: + Lithic::Models::ExternalBankAccountUpdateResponse::VerificationState::TaggedSymbol, + account_token: T.nilable(String), + address: T.nilable(Lithic::ExternalBankAccountAddress), + company_id: T.nilable(String), + dob: T.nilable(Date), + doing_business_as: T.nilable(String), + financial_account_token: T.nilable(String), + name: T.nilable(String), + user_defined_id: T.nilable(String), + verification_failed_reason: T.nilable(String) + } + ) + end + def to_hash + end + + # Owner Type + module OwnerType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::ExternalBankAccountUpdateResponse::OwnerType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BUSINESS = + T.let( + :BUSINESS, + Lithic::Models::ExternalBankAccountUpdateResponse::OwnerType::TaggedSymbol + ) + INDIVIDUAL = + T.let( + :INDIVIDUAL, + Lithic::Models::ExternalBankAccountUpdateResponse::OwnerType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccountUpdateResponse::OwnerType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Account State + module State + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::ExternalBankAccountUpdateResponse::State + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ENABLED = + T.let( + :ENABLED, + Lithic::Models::ExternalBankAccountUpdateResponse::State::TaggedSymbol + ) + CLOSED = + T.let( + :CLOSED, + Lithic::Models::ExternalBankAccountUpdateResponse::State::TaggedSymbol + ) + PAUSED = + T.let( + :PAUSED, + Lithic::Models::ExternalBankAccountUpdateResponse::State::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccountUpdateResponse::State::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Account Type + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::ExternalBankAccountUpdateResponse::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHECKING = + T.let( + :CHECKING, + Lithic::Models::ExternalBankAccountUpdateResponse::Type::TaggedSymbol + ) + SAVINGS = + T.let( + :SAVINGS, + Lithic::Models::ExternalBankAccountUpdateResponse::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccountUpdateResponse::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Verification Method + module VerificationMethod + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::ExternalBankAccountUpdateResponse::VerificationMethod + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MANUAL = + T.let( + :MANUAL, + Lithic::Models::ExternalBankAccountUpdateResponse::VerificationMethod::TaggedSymbol + ) + MICRO_DEPOSIT = + T.let( + :MICRO_DEPOSIT, + Lithic::Models::ExternalBankAccountUpdateResponse::VerificationMethod::TaggedSymbol + ) + PLAID = + T.let( + :PLAID, + Lithic::Models::ExternalBankAccountUpdateResponse::VerificationMethod::TaggedSymbol + ) + PRENOTE = + T.let( + :PRENOTE, + Lithic::Models::ExternalBankAccountUpdateResponse::VerificationMethod::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccountUpdateResponse::VerificationMethod::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Verification State + module VerificationState + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::ExternalBankAccountUpdateResponse::VerificationState + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :PENDING, + Lithic::Models::ExternalBankAccountUpdateResponse::VerificationState::TaggedSymbol + ) + ENABLED = + T.let( + :ENABLED, + Lithic::Models::ExternalBankAccountUpdateResponse::VerificationState::TaggedSymbol + ) + FAILED_VERIFICATION = + T.let( + :FAILED_VERIFICATION, + Lithic::Models::ExternalBankAccountUpdateResponse::VerificationState::TaggedSymbol + ) + INSUFFICIENT_FUNDS = + T.let( + :INSUFFICIENT_FUNDS, + Lithic::Models::ExternalBankAccountUpdateResponse::VerificationState::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccountUpdateResponse::VerificationState::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/external_bank_account_updated_webhook_event.rbi b/rbi/lithic/models/external_bank_account_updated_webhook_event.rbi new file mode 100644 index 00000000..ecb319bf --- /dev/null +++ b/rbi/lithic/models/external_bank_account_updated_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class ExternalBankAccountUpdatedWebhookEvent < Lithic::Models::ExternalBankAccount + OrHash = + T.type_alias do + T.any( + Lithic::ExternalBankAccountUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"external_bank_account.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/external_bank_accounts/micro_deposit_create_params.rbi b/rbi/lithic/models/external_bank_accounts/micro_deposit_create_params.rbi new file mode 100644 index 00000000..f3995598 --- /dev/null +++ b/rbi/lithic/models/external_bank_accounts/micro_deposit_create_params.rbi @@ -0,0 +1,52 @@ +# typed: strong + +module Lithic + module Models + module ExternalBankAccounts + class MicroDepositCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::ExternalBankAccounts::MicroDepositCreateParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :external_bank_account_token + + sig { returns(T::Array[Integer]) } + attr_accessor :micro_deposits + + sig do + params( + external_bank_account_token: String, + micro_deposits: T::Array[Integer], + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + external_bank_account_token:, + micro_deposits:, + request_options: {} + ) + end + + sig do + override.returns( + { + external_bank_account_token: String, + micro_deposits: T::Array[Integer], + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/external_bank_accounts/micro_deposit_create_response.rbi b/rbi/lithic/models/external_bank_accounts/micro_deposit_create_response.rbi new file mode 100644 index 00000000..7d10603b --- /dev/null +++ b/rbi/lithic/models/external_bank_accounts/micro_deposit_create_response.rbi @@ -0,0 +1,469 @@ +# typed: strong + +module Lithic + module Models + module ExternalBankAccounts + class MicroDepositCreateResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse, + Lithic::Internal::AnyHash + ) + end + + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + sig { returns(String) } + attr_accessor :token + + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + sig { returns(String) } + attr_accessor :country + + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + sig { returns(Time) } + attr_accessor :created + + # currency of the external account 3-character alphabetic ISO 4217 code + sig { returns(String) } + attr_accessor :currency + + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + sig { returns(String) } + attr_accessor :last_four + + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + sig { returns(String) } + attr_accessor :owner + + # Owner Type + sig do + returns( + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::OwnerType::TaggedSymbol + ) + end + attr_accessor :owner_type + + # Routing Number + sig { returns(String) } + attr_accessor :routing_number + + # Account State + sig do + returns( + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::State::TaggedSymbol + ) + end + attr_accessor :state + + # Account Type + sig do + returns( + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::Type::TaggedSymbol + ) + end + attr_accessor :type + + # The number of attempts at verification + sig { returns(Integer) } + attr_accessor :verification_attempts + + # Verification Method + sig do + returns( + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationMethod::TaggedSymbol + ) + end + attr_accessor :verification_method + + # Verification State + sig do + returns( + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationState::TaggedSymbol + ) + end + attr_accessor :verification_state + + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + sig { returns(T.nilable(String)) } + attr_accessor :account_token + + # Address + sig { returns(T.nilable(Lithic::ExternalBankAccountAddress)) } + attr_reader :address + + sig do + params( + address: T.nilable(Lithic::ExternalBankAccountAddress::OrHash) + ).void + end + attr_writer :address + + # Optional field that helps identify bank accounts in receipts + sig { returns(T.nilable(String)) } + attr_accessor :company_id + + # Date of Birth of the Individual that owns the external bank account + sig { returns(T.nilable(Date)) } + attr_accessor :dob + + # Doing Business As + sig { returns(T.nilable(String)) } + attr_accessor :doing_business_as + + # The financial account token of the operating account to fund the micro deposits + sig { returns(T.nilable(String)) } + attr_accessor :financial_account_token + + # The nickname for this External Bank Account + sig { returns(T.nilable(String)) } + attr_accessor :name + + # User Defined ID + sig { returns(T.nilable(String)) } + attr_accessor :user_defined_id + + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + sig { returns(T.nilable(String)) } + attr_accessor :verification_failed_reason + + sig do + params( + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::OwnerType::OrSymbol, + routing_number: String, + state: + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::State::OrSymbol, + type: + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::Type::OrSymbol, + verification_attempts: Integer, + verification_method: + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationMethod::OrSymbol, + verification_state: + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationState::OrSymbol, + account_token: T.nilable(String), + address: T.nilable(Lithic::ExternalBankAccountAddress::OrHash), + company_id: T.nilable(String), + dob: T.nilable(Date), + doing_business_as: T.nilable(String), + financial_account_token: T.nilable(String), + name: T.nilable(String), + user_defined_id: T.nilable(String), + verification_failed_reason: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # A globally unique identifier for this record of an external bank account + # association. If a program links an external bank account to more than one + # end-user or to both the program and the end-user, then Lithic will return each + # record of the association + token:, + # The country that the bank account is located in using ISO 3166-1. We will only + # accept USA bank accounts e.g., USA + country:, + # An ISO 8601 string representing when this funding source was added to the Lithic + # account. + created:, + # currency of the external account 3-character alphabetic ISO 4217 code + currency:, + # The last 4 digits of the bank account. Derived by Lithic from the account number + # passed + last_four:, + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + owner:, + # Owner Type + owner_type:, + # Routing Number + routing_number:, + # Account State + state:, + # Account Type + type:, + # The number of attempts at verification + verification_attempts:, + # Verification Method + verification_method:, + # Verification State + verification_state:, + # Indicates which Lithic account the external account is associated with. For + # external accounts that are associated with the program, account_token field + # returned will be null + account_token: nil, + # Address + address: nil, + # Optional field that helps identify bank accounts in receipts + company_id: nil, + # Date of Birth of the Individual that owns the external bank account + dob: nil, + # Doing Business As + doing_business_as: nil, + # The financial account token of the operating account to fund the micro deposits + financial_account_token: nil, + # The nickname for this External Bank Account + name: nil, + # User Defined ID + user_defined_id: nil, + # Optional free text description of the reason for the failed verification. For + # ACH micro-deposits returned, this field will display the reason return code sent + # by the ACH network + verification_failed_reason: nil + ) + end + + sig do + override.returns( + { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::OwnerType::TaggedSymbol, + routing_number: String, + state: + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::State::TaggedSymbol, + type: + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::Type::TaggedSymbol, + verification_attempts: Integer, + verification_method: + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationMethod::TaggedSymbol, + verification_state: + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationState::TaggedSymbol, + account_token: T.nilable(String), + address: T.nilable(Lithic::ExternalBankAccountAddress), + company_id: T.nilable(String), + dob: T.nilable(Date), + doing_business_as: T.nilable(String), + financial_account_token: T.nilable(String), + name: T.nilable(String), + user_defined_id: T.nilable(String), + verification_failed_reason: T.nilable(String) + } + ) + end + def to_hash + end + + # Owner Type + module OwnerType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::OwnerType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BUSINESS = + T.let( + :BUSINESS, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::OwnerType::TaggedSymbol + ) + INDIVIDUAL = + T.let( + :INDIVIDUAL, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::OwnerType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::OwnerType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Account State + module State + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::State + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ENABLED = + T.let( + :ENABLED, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::State::TaggedSymbol + ) + CLOSED = + T.let( + :CLOSED, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::State::TaggedSymbol + ) + PAUSED = + T.let( + :PAUSED, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::State::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::State::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Account Type + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHECKING = + T.let( + :CHECKING, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::Type::TaggedSymbol + ) + SAVINGS = + T.let( + :SAVINGS, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Verification Method + module VerificationMethod + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationMethod + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MANUAL = + T.let( + :MANUAL, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationMethod::TaggedSymbol + ) + MICRO_DEPOSIT = + T.let( + :MICRO_DEPOSIT, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationMethod::TaggedSymbol + ) + PLAID = + T.let( + :PLAID, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationMethod::TaggedSymbol + ) + PRENOTE = + T.let( + :PRENOTE, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationMethod::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationMethod::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Verification State + module VerificationState + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationState + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :PENDING, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationState::TaggedSymbol + ) + ENABLED = + T.let( + :ENABLED, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationState::TaggedSymbol + ) + FAILED_VERIFICATION = + T.let( + :FAILED_VERIFICATION, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationState::TaggedSymbol + ) + INSUFFICIENT_FUNDS = + T.let( + :INSUFFICIENT_FUNDS, + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationState::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationState::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/external_payment.rbi b/rbi/lithic/models/external_payment.rbi new file mode 100644 index 00000000..7714279a --- /dev/null +++ b/rbi/lithic/models/external_payment.rbi @@ -0,0 +1,602 @@ +# typed: strong + +module Lithic + module Models + class ExternalPayment < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::ExternalPayment, Lithic::Internal::AnyHash) + end + + # Unique identifier for the transaction + sig { returns(String) } + attr_accessor :token + + # ISO 8601 timestamp of when the transaction was created + sig { returns(Time) } + attr_accessor :created + + # The status of the transaction + sig { returns(Lithic::ExternalPayment::Status::TaggedSymbol) } + attr_accessor :status + + # ISO 8601 timestamp of when the transaction was last updated + sig { returns(Time) } + attr_accessor :updated + + sig do + returns(T.nilable(Lithic::ExternalPayment::Category::TaggedSymbol)) + end + attr_reader :category + + sig { params(category: Lithic::ExternalPayment::Category::OrSymbol).void } + attr_writer :category + + sig { returns(T.nilable(String)) } + attr_reader :currency + + sig { params(currency: String).void } + attr_writer :currency + + sig { returns(T.nilable(T::Array[Lithic::ExternalPayment::Event])) } + attr_reader :events + + sig do + params(events: T::Array[Lithic::ExternalPayment::Event::OrHash]).void + end + attr_writer :events + + # EXTERNAL_PAYMENT - External Payment Response + sig { returns(T.nilable(Lithic::ExternalPayment::Family::TaggedSymbol)) } + attr_reader :family + + sig { params(family: Lithic::ExternalPayment::Family::OrSymbol).void } + attr_writer :family + + sig { returns(T.nilable(String)) } + attr_reader :financial_account_token + + sig { params(financial_account_token: String).void } + attr_writer :financial_account_token + + sig do + returns(T.nilable(Lithic::ExternalPayment::PaymentType::TaggedSymbol)) + end + attr_reader :payment_type + + sig do + params( + payment_type: Lithic::ExternalPayment::PaymentType::OrSymbol + ).void + end + attr_writer :payment_type + + sig { returns(T.nilable(Integer)) } + attr_reader :pending_amount + + sig { params(pending_amount: Integer).void } + attr_writer :pending_amount + + sig { returns(T.nilable(Lithic::ExternalPayment::Result::TaggedSymbol)) } + attr_reader :result + + sig { params(result: Lithic::ExternalPayment::Result::OrSymbol).void } + attr_writer :result + + sig { returns(T.nilable(Integer)) } + attr_reader :settled_amount + + sig { params(settled_amount: Integer).void } + attr_writer :settled_amount + + sig { returns(T.nilable(String)) } + attr_accessor :user_defined_id + + sig do + params( + token: String, + created: Time, + status: Lithic::ExternalPayment::Status::OrSymbol, + updated: Time, + category: Lithic::ExternalPayment::Category::OrSymbol, + currency: String, + events: T::Array[Lithic::ExternalPayment::Event::OrHash], + family: Lithic::ExternalPayment::Family::OrSymbol, + financial_account_token: String, + payment_type: Lithic::ExternalPayment::PaymentType::OrSymbol, + pending_amount: Integer, + result: Lithic::ExternalPayment::Result::OrSymbol, + settled_amount: Integer, + user_defined_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the transaction + token:, + # ISO 8601 timestamp of when the transaction was created + created:, + # The status of the transaction + status:, + # ISO 8601 timestamp of when the transaction was last updated + updated:, + category: nil, + currency: nil, + events: nil, + # EXTERNAL_PAYMENT - External Payment Response + family: nil, + financial_account_token: nil, + payment_type: nil, + pending_amount: nil, + result: nil, + settled_amount: nil, + user_defined_id: nil + ) + end + + sig do + override.returns( + { + token: String, + created: Time, + status: Lithic::ExternalPayment::Status::TaggedSymbol, + updated: Time, + category: Lithic::ExternalPayment::Category::TaggedSymbol, + currency: String, + events: T::Array[Lithic::ExternalPayment::Event], + family: Lithic::ExternalPayment::Family::TaggedSymbol, + financial_account_token: String, + payment_type: Lithic::ExternalPayment::PaymentType::TaggedSymbol, + pending_amount: Integer, + result: Lithic::ExternalPayment::Result::TaggedSymbol, + settled_amount: Integer, + user_defined_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The status of the transaction + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::ExternalPayment::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = T.let(:PENDING, Lithic::ExternalPayment::Status::TaggedSymbol) + SETTLED = T.let(:SETTLED, Lithic::ExternalPayment::Status::TaggedSymbol) + DECLINED = + T.let(:DECLINED, Lithic::ExternalPayment::Status::TaggedSymbol) + REVERSED = + T.let(:REVERSED, Lithic::ExternalPayment::Status::TaggedSymbol) + CANCELED = + T.let(:CANCELED, Lithic::ExternalPayment::Status::TaggedSymbol) + RETURNED = + T.let(:RETURNED, Lithic::ExternalPayment::Status::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::ExternalPayment::Status::TaggedSymbol] + ) + end + def self.values + end + end + + module Category + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::ExternalPayment::Category) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EXTERNAL_WIRE = + T.let(:EXTERNAL_WIRE, Lithic::ExternalPayment::Category::TaggedSymbol) + EXTERNAL_ACH = + T.let(:EXTERNAL_ACH, Lithic::ExternalPayment::Category::TaggedSymbol) + EXTERNAL_CHECK = + T.let( + :EXTERNAL_CHECK, + Lithic::ExternalPayment::Category::TaggedSymbol + ) + EXTERNAL_FEDNOW = + T.let( + :EXTERNAL_FEDNOW, + Lithic::ExternalPayment::Category::TaggedSymbol + ) + EXTERNAL_RTP = + T.let(:EXTERNAL_RTP, Lithic::ExternalPayment::Category::TaggedSymbol) + EXTERNAL_TRANSFER = + T.let( + :EXTERNAL_TRANSFER, + Lithic::ExternalPayment::Category::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::ExternalPayment::Category::TaggedSymbol] + ) + end + def self.values + end + end + + class Event < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::ExternalPayment::Event, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :token + + sig { returns(Integer) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created + + sig do + returns( + T::Array[ + Lithic::ExternalPayment::Event::DetailedResult::TaggedSymbol + ] + ) + end + attr_accessor :detailed_results + + sig { returns(Date) } + attr_accessor :effective_date + + sig { returns(String) } + attr_accessor :memo + + sig { returns(Lithic::ExternalPayment::Event::Result::TaggedSymbol) } + attr_accessor :result + + sig { returns(Lithic::ExternalPayment::Event::Type::TaggedSymbol) } + attr_accessor :type + + sig do + params( + token: String, + amount: Integer, + created: Time, + detailed_results: + T::Array[ + Lithic::ExternalPayment::Event::DetailedResult::OrSymbol + ], + effective_date: Date, + memo: String, + result: Lithic::ExternalPayment::Event::Result::OrSymbol, + type: Lithic::ExternalPayment::Event::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + token:, + amount:, + created:, + detailed_results:, + effective_date:, + memo:, + result:, + type: + ) + end + + sig do + override.returns( + { + token: String, + amount: Integer, + created: Time, + detailed_results: + T::Array[ + Lithic::ExternalPayment::Event::DetailedResult::TaggedSymbol + ], + effective_date: Date, + memo: String, + result: Lithic::ExternalPayment::Event::Result::TaggedSymbol, + type: Lithic::ExternalPayment::Event::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module DetailedResult + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ExternalPayment::Event::DetailedResult) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::ExternalPayment::Event::DetailedResult::TaggedSymbol + ) + INSUFFICIENT_FUNDS = + T.let( + :INSUFFICIENT_FUNDS, + Lithic::ExternalPayment::Event::DetailedResult::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ExternalPayment::Event::DetailedResult::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ExternalPayment::Event::Result) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::ExternalPayment::Event::Result::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::ExternalPayment::Event::Result::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::ExternalPayment::Event::Result::TaggedSymbol] + ) + end + def self.values + end + end + + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::ExternalPayment::Event::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EXTERNAL_WIRE_INITIATED = + T.let( + :EXTERNAL_WIRE_INITIATED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + EXTERNAL_WIRE_CANCELED = + T.let( + :EXTERNAL_WIRE_CANCELED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + EXTERNAL_WIRE_SETTLED = + T.let( + :EXTERNAL_WIRE_SETTLED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + EXTERNAL_WIRE_REVERSED = + T.let( + :EXTERNAL_WIRE_REVERSED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + EXTERNAL_WIRE_RELEASED = + T.let( + :EXTERNAL_WIRE_RELEASED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + EXTERNAL_ACH_INITIATED = + T.let( + :EXTERNAL_ACH_INITIATED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + EXTERNAL_ACH_CANCELED = + T.let( + :EXTERNAL_ACH_CANCELED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + EXTERNAL_ACH_SETTLED = + T.let( + :EXTERNAL_ACH_SETTLED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + EXTERNAL_ACH_REVERSED = + T.let( + :EXTERNAL_ACH_REVERSED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + EXTERNAL_ACH_RELEASED = + T.let( + :EXTERNAL_ACH_RELEASED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + EXTERNAL_TRANSFER_INITIATED = + T.let( + :EXTERNAL_TRANSFER_INITIATED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + EXTERNAL_TRANSFER_CANCELED = + T.let( + :EXTERNAL_TRANSFER_CANCELED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + EXTERNAL_TRANSFER_SETTLED = + T.let( + :EXTERNAL_TRANSFER_SETTLED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + EXTERNAL_TRANSFER_REVERSED = + T.let( + :EXTERNAL_TRANSFER_REVERSED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + EXTERNAL_TRANSFER_RELEASED = + T.let( + :EXTERNAL_TRANSFER_RELEASED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + EXTERNAL_CHECK_INITIATED = + T.let( + :EXTERNAL_CHECK_INITIATED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + EXTERNAL_CHECK_CANCELED = + T.let( + :EXTERNAL_CHECK_CANCELED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + EXTERNAL_CHECK_SETTLED = + T.let( + :EXTERNAL_CHECK_SETTLED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + EXTERNAL_CHECK_REVERSED = + T.let( + :EXTERNAL_CHECK_REVERSED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + EXTERNAL_CHECK_RELEASED = + T.let( + :EXTERNAL_CHECK_RELEASED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + EXTERNAL_FEDNOW_INITIATED = + T.let( + :EXTERNAL_FEDNOW_INITIATED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + EXTERNAL_FEDNOW_CANCELED = + T.let( + :EXTERNAL_FEDNOW_CANCELED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + EXTERNAL_FEDNOW_SETTLED = + T.let( + :EXTERNAL_FEDNOW_SETTLED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + EXTERNAL_FEDNOW_REVERSED = + T.let( + :EXTERNAL_FEDNOW_REVERSED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + EXTERNAL_FEDNOW_RELEASED = + T.let( + :EXTERNAL_FEDNOW_RELEASED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + EXTERNAL_RTP_INITIATED = + T.let( + :EXTERNAL_RTP_INITIATED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + EXTERNAL_RTP_CANCELED = + T.let( + :EXTERNAL_RTP_CANCELED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + EXTERNAL_RTP_SETTLED = + T.let( + :EXTERNAL_RTP_SETTLED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + EXTERNAL_RTP_REVERSED = + T.let( + :EXTERNAL_RTP_REVERSED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + EXTERNAL_RTP_RELEASED = + T.let( + :EXTERNAL_RTP_RELEASED, + Lithic::ExternalPayment::Event::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::ExternalPayment::Event::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + + # EXTERNAL_PAYMENT - External Payment Response + module Family + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::ExternalPayment::Family) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EXTERNAL_PAYMENT = + T.let( + :EXTERNAL_PAYMENT, + Lithic::ExternalPayment::Family::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::ExternalPayment::Family::TaggedSymbol] + ) + end + def self.values + end + end + + module PaymentType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::ExternalPayment::PaymentType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DEPOSIT = + T.let(:DEPOSIT, Lithic::ExternalPayment::PaymentType::TaggedSymbol) + WITHDRAWAL = + T.let(:WITHDRAWAL, Lithic::ExternalPayment::PaymentType::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::ExternalPayment::PaymentType::TaggedSymbol] + ) + end + def self.values + end + end + + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::ExternalPayment::Result) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let(:APPROVED, Lithic::ExternalPayment::Result::TaggedSymbol) + DECLINED = + T.let(:DECLINED, Lithic::ExternalPayment::Result::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::ExternalPayment::Result::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/external_payment_cancel_params.rbi b/rbi/lithic/models/external_payment_cancel_params.rbi new file mode 100644 index 00000000..e1703af9 --- /dev/null +++ b/rbi/lithic/models/external_payment_cancel_params.rbi @@ -0,0 +1,56 @@ +# typed: strong + +module Lithic + module Models + class ExternalPaymentCancelParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::ExternalPaymentCancelParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :external_payment_token + + sig { returns(Date) } + attr_accessor :effective_date + + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + sig do + params( + external_payment_token: String, + effective_date: Date, + memo: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + external_payment_token:, + effective_date:, + memo: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + external_payment_token: String, + effective_date: Date, + memo: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/external_payment_create_params.rbi b/rbi/lithic/models/external_payment_create_params.rbi new file mode 100644 index 00000000..68333728 --- /dev/null +++ b/rbi/lithic/models/external_payment_create_params.rbi @@ -0,0 +1,232 @@ +# typed: strong + +module Lithic + module Models + class ExternalPaymentCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::ExternalPaymentCreateParams, Lithic::Internal::AnyHash) + end + + sig { returns(Integer) } + attr_accessor :amount + + sig { returns(Lithic::ExternalPaymentCreateParams::Category::OrSymbol) } + attr_accessor :category + + sig { returns(Date) } + attr_accessor :effective_date + + sig { returns(String) } + attr_accessor :financial_account_token + + sig do + returns(Lithic::ExternalPaymentCreateParams::PaymentType::OrSymbol) + end + attr_accessor :payment_type + + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + sig do + returns( + T.nilable(Lithic::ExternalPaymentCreateParams::ProgressTo::OrSymbol) + ) + end + attr_reader :progress_to + + sig do + params( + progress_to: Lithic::ExternalPaymentCreateParams::ProgressTo::OrSymbol + ).void + end + attr_writer :progress_to + + sig { returns(T.nilable(String)) } + attr_reader :user_defined_id + + sig { params(user_defined_id: String).void } + attr_writer :user_defined_id + + sig do + params( + amount: Integer, + category: Lithic::ExternalPaymentCreateParams::Category::OrSymbol, + effective_date: Date, + financial_account_token: String, + payment_type: + Lithic::ExternalPaymentCreateParams::PaymentType::OrSymbol, + token: String, + memo: String, + progress_to: + Lithic::ExternalPaymentCreateParams::ProgressTo::OrSymbol, + user_defined_id: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + amount:, + category:, + effective_date:, + financial_account_token:, + payment_type:, + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + token: nil, + memo: nil, + progress_to: nil, + user_defined_id: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + amount: Integer, + category: Lithic::ExternalPaymentCreateParams::Category::OrSymbol, + effective_date: Date, + financial_account_token: String, + payment_type: + Lithic::ExternalPaymentCreateParams::PaymentType::OrSymbol, + token: String, + memo: String, + progress_to: + Lithic::ExternalPaymentCreateParams::ProgressTo::OrSymbol, + user_defined_id: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + module Category + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ExternalPaymentCreateParams::Category) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EXTERNAL_WIRE = + T.let( + :EXTERNAL_WIRE, + Lithic::ExternalPaymentCreateParams::Category::TaggedSymbol + ) + EXTERNAL_ACH = + T.let( + :EXTERNAL_ACH, + Lithic::ExternalPaymentCreateParams::Category::TaggedSymbol + ) + EXTERNAL_CHECK = + T.let( + :EXTERNAL_CHECK, + Lithic::ExternalPaymentCreateParams::Category::TaggedSymbol + ) + EXTERNAL_FEDNOW = + T.let( + :EXTERNAL_FEDNOW, + Lithic::ExternalPaymentCreateParams::Category::TaggedSymbol + ) + EXTERNAL_RTP = + T.let( + :EXTERNAL_RTP, + Lithic::ExternalPaymentCreateParams::Category::TaggedSymbol + ) + EXTERNAL_TRANSFER = + T.let( + :EXTERNAL_TRANSFER, + Lithic::ExternalPaymentCreateParams::Category::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ExternalPaymentCreateParams::Category::TaggedSymbol + ] + ) + end + def self.values + end + end + + module PaymentType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ExternalPaymentCreateParams::PaymentType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DEPOSIT = + T.let( + :DEPOSIT, + Lithic::ExternalPaymentCreateParams::PaymentType::TaggedSymbol + ) + WITHDRAWAL = + T.let( + :WITHDRAWAL, + Lithic::ExternalPaymentCreateParams::PaymentType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ExternalPaymentCreateParams::PaymentType::TaggedSymbol + ] + ) + end + def self.values + end + end + + module ProgressTo + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ExternalPaymentCreateParams::ProgressTo) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SETTLED = + T.let( + :SETTLED, + Lithic::ExternalPaymentCreateParams::ProgressTo::TaggedSymbol + ) + RELEASED = + T.let( + :RELEASED, + Lithic::ExternalPaymentCreateParams::ProgressTo::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ExternalPaymentCreateParams::ProgressTo::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/external_payment_created_webhook_event.rbi b/rbi/lithic/models/external_payment_created_webhook_event.rbi new file mode 100644 index 00000000..7f5d3276 --- /dev/null +++ b/rbi/lithic/models/external_payment_created_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class ExternalPaymentCreatedWebhookEvent < Lithic::Models::ExternalPayment + OrHash = + T.type_alias do + T.any( + Lithic::ExternalPaymentCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"external_payment.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/external_payment_list_params.rbi b/rbi/lithic/models/external_payment_list_params.rbi new file mode 100644 index 00000000..31d99150 --- /dev/null +++ b/rbi/lithic/models/external_payment_list_params.rbi @@ -0,0 +1,299 @@ +# typed: strong + +module Lithic + module Models + class ExternalPaymentListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::ExternalPaymentListParams, Lithic::Internal::AnyHash) + end + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + sig { returns(T.nilable(String)) } + attr_reader :business_account_token + + sig { params(business_account_token: String).void } + attr_writer :business_account_token + + # External Payment category to be returned. + sig do + returns( + T.nilable(Lithic::ExternalPaymentListParams::Category::OrSymbol) + ) + end + attr_reader :category + + sig do + params( + category: Lithic::ExternalPaymentListParams::Category::OrSymbol + ).void + end + attr_writer :category + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + sig { returns(T.nilable(String)) } + attr_reader :financial_account_token + + sig { params(financial_account_token: String).void } + attr_writer :financial_account_token + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # External Payment result to be returned. + sig do + returns(T.nilable(Lithic::ExternalPaymentListParams::Result::OrSymbol)) + end + attr_reader :result + + sig do + params(result: Lithic::ExternalPaymentListParams::Result::OrSymbol).void + end + attr_writer :result + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + # Book transfer status to be returned. + sig do + returns(T.nilable(Lithic::ExternalPaymentListParams::Status::OrSymbol)) + end + attr_reader :status + + sig do + params(status: Lithic::ExternalPaymentListParams::Status::OrSymbol).void + end + attr_writer :status + + sig do + params( + begin_: Time, + business_account_token: String, + category: Lithic::ExternalPaymentListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::ExternalPaymentListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::ExternalPaymentListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + business_account_token: nil, + # External Payment category to be returned. + category: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + financial_account_token: nil, + # Page size (for pagination). + page_size: nil, + # External Payment result to be returned. + result: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Book transfer status to be returned. + status: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + begin_: Time, + business_account_token: String, + category: Lithic::ExternalPaymentListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::ExternalPaymentListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::ExternalPaymentListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # External Payment category to be returned. + module Category + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ExternalPaymentListParams::Category) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EXTERNAL_WIRE = + T.let( + :EXTERNAL_WIRE, + Lithic::ExternalPaymentListParams::Category::TaggedSymbol + ) + EXTERNAL_ACH = + T.let( + :EXTERNAL_ACH, + Lithic::ExternalPaymentListParams::Category::TaggedSymbol + ) + EXTERNAL_CHECK = + T.let( + :EXTERNAL_CHECK, + Lithic::ExternalPaymentListParams::Category::TaggedSymbol + ) + EXTERNAL_FEDNOW = + T.let( + :EXTERNAL_FEDNOW, + Lithic::ExternalPaymentListParams::Category::TaggedSymbol + ) + EXTERNAL_RTP = + T.let( + :EXTERNAL_RTP, + Lithic::ExternalPaymentListParams::Category::TaggedSymbol + ) + EXTERNAL_TRANSFER = + T.let( + :EXTERNAL_TRANSFER, + Lithic::ExternalPaymentListParams::Category::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::ExternalPaymentListParams::Category::TaggedSymbol] + ) + end + def self.values + end + end + + # External Payment result to be returned. + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ExternalPaymentListParams::Result) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::ExternalPaymentListParams::Result::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::ExternalPaymentListParams::Result::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::ExternalPaymentListParams::Result::TaggedSymbol] + ) + end + def self.values + end + end + + # Book transfer status to be returned. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ExternalPaymentListParams::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :PENDING, + Lithic::ExternalPaymentListParams::Status::TaggedSymbol + ) + SETTLED = + T.let( + :SETTLED, + Lithic::ExternalPaymentListParams::Status::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::ExternalPaymentListParams::Status::TaggedSymbol + ) + REVERSED = + T.let( + :REVERSED, + Lithic::ExternalPaymentListParams::Status::TaggedSymbol + ) + CANCELED = + T.let( + :CANCELED, + Lithic::ExternalPaymentListParams::Status::TaggedSymbol + ) + RETURNED = + T.let( + :RETURNED, + Lithic::ExternalPaymentListParams::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::ExternalPaymentListParams::Status::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/external_payment_release_params.rbi b/rbi/lithic/models/external_payment_release_params.rbi new file mode 100644 index 00000000..b73688a6 --- /dev/null +++ b/rbi/lithic/models/external_payment_release_params.rbi @@ -0,0 +1,56 @@ +# typed: strong + +module Lithic + module Models + class ExternalPaymentReleaseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::ExternalPaymentReleaseParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :external_payment_token + + sig { returns(Date) } + attr_accessor :effective_date + + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + sig do + params( + external_payment_token: String, + effective_date: Date, + memo: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + external_payment_token:, + effective_date:, + memo: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + external_payment_token: String, + effective_date: Date, + memo: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/external_payment_retrieve_params.rbi b/rbi/lithic/models/external_payment_retrieve_params.rbi new file mode 100644 index 00000000..925a0bae --- /dev/null +++ b/rbi/lithic/models/external_payment_retrieve_params.rbi @@ -0,0 +1,41 @@ +# typed: strong + +module Lithic + module Models + class ExternalPaymentRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::ExternalPaymentRetrieveParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :external_payment_token + + sig do + params( + external_payment_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(external_payment_token:, request_options: {}) + end + + sig do + override.returns( + { + external_payment_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/external_payment_reverse_params.rbi b/rbi/lithic/models/external_payment_reverse_params.rbi new file mode 100644 index 00000000..bf6ab9db --- /dev/null +++ b/rbi/lithic/models/external_payment_reverse_params.rbi @@ -0,0 +1,56 @@ +# typed: strong + +module Lithic + module Models + class ExternalPaymentReverseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::ExternalPaymentReverseParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :external_payment_token + + sig { returns(Date) } + attr_accessor :effective_date + + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + sig do + params( + external_payment_token: String, + effective_date: Date, + memo: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + external_payment_token:, + effective_date:, + memo: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + external_payment_token: String, + effective_date: Date, + memo: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/external_payment_settle_params.rbi b/rbi/lithic/models/external_payment_settle_params.rbi new file mode 100644 index 00000000..4aa7ba6b --- /dev/null +++ b/rbi/lithic/models/external_payment_settle_params.rbi @@ -0,0 +1,106 @@ +# typed: strong + +module Lithic + module Models + class ExternalPaymentSettleParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::ExternalPaymentSettleParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :external_payment_token + + sig { returns(Date) } + attr_accessor :effective_date + + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + sig do + returns( + T.nilable(Lithic::ExternalPaymentSettleParams::ProgressTo::OrSymbol) + ) + end + attr_reader :progress_to + + sig do + params( + progress_to: Lithic::ExternalPaymentSettleParams::ProgressTo::OrSymbol + ).void + end + attr_writer :progress_to + + sig do + params( + external_payment_token: String, + effective_date: Date, + memo: String, + progress_to: + Lithic::ExternalPaymentSettleParams::ProgressTo::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + external_payment_token:, + effective_date:, + memo: nil, + progress_to: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + external_payment_token: String, + effective_date: Date, + memo: String, + progress_to: + Lithic::ExternalPaymentSettleParams::ProgressTo::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + module ProgressTo + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ExternalPaymentSettleParams::ProgressTo) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SETTLED = + T.let( + :SETTLED, + Lithic::ExternalPaymentSettleParams::ProgressTo::TaggedSymbol + ) + RELEASED = + T.let( + :RELEASED, + Lithic::ExternalPaymentSettleParams::ProgressTo::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ExternalPaymentSettleParams::ProgressTo::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/external_payment_updated_webhook_event.rbi b/rbi/lithic/models/external_payment_updated_webhook_event.rbi new file mode 100644 index 00000000..5a8b1a53 --- /dev/null +++ b/rbi/lithic/models/external_payment_updated_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class ExternalPaymentUpdatedWebhookEvent < Lithic::Models::ExternalPayment + OrHash = + T.type_alias do + T.any( + Lithic::ExternalPaymentUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"external_payment.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/external_resource.rbi b/rbi/lithic/models/external_resource.rbi new file mode 100644 index 00000000..d0415fb8 --- /dev/null +++ b/rbi/lithic/models/external_resource.rbi @@ -0,0 +1,57 @@ +# typed: strong + +module Lithic + module Models + class ExternalResource < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::ExternalResource, Lithic::Internal::AnyHash) + end + + # Token identifying the external resource + sig { returns(String) } + attr_accessor :external_resource_token + + # Type of external resource associated with the management operation + sig { returns(Lithic::ExternalResourceType::TaggedSymbol) } + attr_accessor :external_resource_type + + # Token identifying the external resource sub-resource + sig { returns(T.nilable(String)) } + attr_reader :external_resource_sub_token + + sig { params(external_resource_sub_token: String).void } + attr_writer :external_resource_sub_token + + # External resource associated with the management operation + sig do + params( + external_resource_token: String, + external_resource_type: Lithic::ExternalResourceType::OrSymbol, + external_resource_sub_token: String + ).returns(T.attached_class) + end + def self.new( + # Token identifying the external resource + external_resource_token:, + # Type of external resource associated with the management operation + external_resource_type:, + # Token identifying the external resource sub-resource + external_resource_sub_token: nil + ) + end + + sig do + override.returns( + { + external_resource_token: String, + external_resource_type: Lithic::ExternalResourceType::TaggedSymbol, + external_resource_sub_token: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/external_resource_type.rbi b/rbi/lithic/models/external_resource_type.rbi new file mode 100644 index 00000000..bf51ea88 --- /dev/null +++ b/rbi/lithic/models/external_resource_type.rbi @@ -0,0 +1,26 @@ +# typed: strong + +module Lithic + module Models + # Type of external resource associated with the management operation + module ExternalResourceType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::ExternalResourceType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + STATEMENT = T.let(:STATEMENT, Lithic::ExternalResourceType::TaggedSymbol) + COLLECTION = + T.let(:COLLECTION, Lithic::ExternalResourceType::TaggedSymbol) + DISPUTE = T.let(:DISPUTE, Lithic::ExternalResourceType::TaggedSymbol) + UNKNOWN = T.let(:UNKNOWN, Lithic::ExternalResourceType::TaggedSymbol) + + sig do + override.returns(T::Array[Lithic::ExternalResourceType::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/lithic/models/financial_account.rbi b/rbi/lithic/models/financial_account.rbi new file mode 100644 index 00000000..c80f0ef0 --- /dev/null +++ b/rbi/lithic/models/financial_account.rbi @@ -0,0 +1,368 @@ +# typed: strong + +module Lithic + module Models + class FinancialAccount < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::FinancialAccount, Lithic::Internal::AnyHash) + end + + # Globally unique identifier for the account + sig { returns(String) } + attr_accessor :token + + sig { returns(T.nilable(String)) } + attr_accessor :account_token + + sig { returns(Time) } + attr_accessor :created + + sig { returns(T.nilable(Lithic::FinancialAccount::CreditConfiguration)) } + attr_reader :credit_configuration + + sig do + params( + credit_configuration: + T.nilable(Lithic::FinancialAccount::CreditConfiguration::OrHash) + ).void + end + attr_writer :credit_configuration + + # Whether financial account is for the benefit of another entity + sig { returns(T::Boolean) } + attr_accessor :is_for_benefit_of + + sig { returns(T.nilable(String)) } + attr_accessor :nickname + + # Status of the financial account + sig { returns(Lithic::FinancialAccount::Status::TaggedSymbol) } + attr_accessor :status + + # Substatus for the financial account + sig do + returns(T.nilable(Lithic::FinancialAccount::Substatus::TaggedSymbol)) + end + attr_accessor :substatus + + sig { returns(Lithic::FinancialAccount::Type::TaggedSymbol) } + attr_accessor :type + + sig { returns(Time) } + attr_accessor :updated + + # User-defined status for the financial account + sig { returns(T.nilable(String)) } + attr_accessor :user_defined_status + + sig { returns(T.nilable(String)) } + attr_accessor :account_number + + sig { returns(T.nilable(String)) } + attr_accessor :routing_number + + sig do + params( + token: String, + account_token: T.nilable(String), + created: Time, + credit_configuration: + T.nilable(Lithic::FinancialAccount::CreditConfiguration::OrHash), + is_for_benefit_of: T::Boolean, + nickname: T.nilable(String), + status: Lithic::FinancialAccount::Status::OrSymbol, + substatus: T.nilable(Lithic::FinancialAccount::Substatus::OrSymbol), + type: Lithic::FinancialAccount::Type::OrSymbol, + updated: Time, + user_defined_status: T.nilable(String), + account_number: T.nilable(String), + routing_number: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the account + token:, + account_token:, + created:, + credit_configuration:, + # Whether financial account is for the benefit of another entity + is_for_benefit_of:, + nickname:, + # Status of the financial account + status:, + # Substatus for the financial account + substatus:, + type:, + updated:, + # User-defined status for the financial account + user_defined_status:, + account_number: nil, + routing_number: nil + ) + end + + sig do + override.returns( + { + token: String, + account_token: T.nilable(String), + created: Time, + credit_configuration: + T.nilable(Lithic::FinancialAccount::CreditConfiguration), + is_for_benefit_of: T::Boolean, + nickname: T.nilable(String), + status: Lithic::FinancialAccount::Status::TaggedSymbol, + substatus: + T.nilable(Lithic::FinancialAccount::Substatus::TaggedSymbol), + type: Lithic::FinancialAccount::Type::TaggedSymbol, + updated: Time, + user_defined_status: T.nilable(String), + account_number: T.nilable(String), + routing_number: T.nilable(String) + } + ) + end + def to_hash + end + + class CreditConfiguration < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccount::CreditConfiguration, + Lithic::Internal::AnyHash + ) + end + + sig do + returns( + T.nilable( + Lithic::FinancialAccount::CreditConfiguration::AutoCollectionConfiguration + ) + ) + end + attr_reader :auto_collection_configuration + + sig do + params( + auto_collection_configuration: + T.nilable( + Lithic::FinancialAccount::CreditConfiguration::AutoCollectionConfiguration::OrHash + ) + ).void + end + attr_writer :auto_collection_configuration + + sig { returns(T.nilable(Integer)) } + attr_accessor :credit_limit + + # Globally unique identifier for the credit product + sig { returns(T.nilable(String)) } + attr_accessor :credit_product_token + + sig { returns(T.nilable(String)) } + attr_accessor :external_bank_account_token + + # Tier assigned to the financial account + sig { returns(T.nilable(String)) } + attr_accessor :tier + + sig do + params( + auto_collection_configuration: + T.nilable( + Lithic::FinancialAccount::CreditConfiguration::AutoCollectionConfiguration::OrHash + ), + credit_limit: T.nilable(Integer), + credit_product_token: T.nilable(String), + external_bank_account_token: T.nilable(String), + tier: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + auto_collection_configuration:, + credit_limit:, + # Globally unique identifier for the credit product + credit_product_token:, + external_bank_account_token:, + # Tier assigned to the financial account + tier: + ) + end + + sig do + override.returns( + { + auto_collection_configuration: + T.nilable( + Lithic::FinancialAccount::CreditConfiguration::AutoCollectionConfiguration + ), + credit_limit: T.nilable(Integer), + credit_product_token: T.nilable(String), + external_bank_account_token: T.nilable(String), + tier: T.nilable(String) + } + ) + end + def to_hash + end + + class AutoCollectionConfiguration < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccount::CreditConfiguration::AutoCollectionConfiguration, + Lithic::Internal::AnyHash + ) + end + + # If auto collection is enabled for this account + sig { returns(T::Boolean) } + attr_accessor :auto_collection_enabled + + sig do + params(auto_collection_enabled: T::Boolean).returns( + T.attached_class + ) + end + def self.new( + # If auto collection is enabled for this account + auto_collection_enabled: + ) + end + + sig { override.returns({ auto_collection_enabled: T::Boolean }) } + def to_hash + end + end + end + + # Status of the financial account + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::FinancialAccount::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + OPEN = T.let(:OPEN, Lithic::FinancialAccount::Status::TaggedSymbol) + CLOSED = T.let(:CLOSED, Lithic::FinancialAccount::Status::TaggedSymbol) + SUSPENDED = + T.let(:SUSPENDED, Lithic::FinancialAccount::Status::TaggedSymbol) + PENDING = + T.let(:PENDING, Lithic::FinancialAccount::Status::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::FinancialAccount::Status::TaggedSymbol] + ) + end + def self.values + end + end + + # Substatus for the financial account + module Substatus + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::FinancialAccount::Substatus) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHARGED_OFF_DELINQUENT = + T.let( + :CHARGED_OFF_DELINQUENT, + Lithic::FinancialAccount::Substatus::TaggedSymbol + ) + CHARGED_OFF_FRAUD = + T.let( + :CHARGED_OFF_FRAUD, + Lithic::FinancialAccount::Substatus::TaggedSymbol + ) + END_USER_REQUEST = + T.let( + :END_USER_REQUEST, + Lithic::FinancialAccount::Substatus::TaggedSymbol + ) + BANK_REQUEST = + T.let( + :BANK_REQUEST, + Lithic::FinancialAccount::Substatus::TaggedSymbol + ) + DELINQUENT = + T.let(:DELINQUENT, Lithic::FinancialAccount::Substatus::TaggedSymbol) + INTEREST_AND_FEES_PAUSED = + T.let( + :INTEREST_AND_FEES_PAUSED, + Lithic::FinancialAccount::Substatus::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::FinancialAccount::Substatus::TaggedSymbol] + ) + end + def self.values + end + end + + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::FinancialAccount::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ISSUING = T.let(:ISSUING, Lithic::FinancialAccount::Type::TaggedSymbol) + RESERVE = T.let(:RESERVE, Lithic::FinancialAccount::Type::TaggedSymbol) + OPERATING = + T.let(:OPERATING, Lithic::FinancialAccount::Type::TaggedSymbol) + CHARGED_OFF_FEES = + T.let(:CHARGED_OFF_FEES, Lithic::FinancialAccount::Type::TaggedSymbol) + CHARGED_OFF_INTEREST = + T.let( + :CHARGED_OFF_INTEREST, + Lithic::FinancialAccount::Type::TaggedSymbol + ) + CHARGED_OFF_PRINCIPAL = + T.let( + :CHARGED_OFF_PRINCIPAL, + Lithic::FinancialAccount::Type::TaggedSymbol + ) + SECURITY = + T.let(:SECURITY, Lithic::FinancialAccount::Type::TaggedSymbol) + PROGRAM_RECEIVABLES = + T.let( + :PROGRAM_RECEIVABLES, + Lithic::FinancialAccount::Type::TaggedSymbol + ) + COLLECTION = + T.let(:COLLECTION, Lithic::FinancialAccount::Type::TaggedSymbol) + PROGRAM_BANK_ACCOUNTS_PAYABLE = + T.let( + :PROGRAM_BANK_ACCOUNTS_PAYABLE, + Lithic::FinancialAccount::Type::TaggedSymbol + ) + EARLY_DIRECT_DEPOSIT_FLOAT = + T.let( + :EARLY_DIRECT_DEPOSIT_FLOAT, + Lithic::FinancialAccount::Type::TaggedSymbol + ) + PROVISIONAL_CREDIT_ACCOUNT = + T.let( + :PROVISIONAL_CREDIT_ACCOUNT, + Lithic::FinancialAccount::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::FinancialAccount::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/financial_account_balance.rbi b/rbi/lithic/models/financial_account_balance.rbi new file mode 100644 index 00000000..5af5c755 --- /dev/null +++ b/rbi/lithic/models/financial_account_balance.rbi @@ -0,0 +1,144 @@ +# typed: strong + +module Lithic + module Models + class FinancialAccountBalance < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::FinancialAccountBalance, Lithic::Internal::AnyHash) + end + + # Globally unique identifier for the financial account that holds this balance. + sig { returns(String) } + attr_accessor :token + + # Funds available for spend in the currency's smallest unit (e.g., cents for USD) + sig { returns(Integer) } + attr_accessor :available_amount + + # Date and time for when the balance was first created. + sig { returns(Time) } + attr_accessor :created + + # 3-character alphabetic ISO 4217 code for the local currency of the balance. + sig { returns(String) } + attr_accessor :currency + + # Globally unique identifier for the last financial transaction event that + # impacted this balance. + sig { returns(String) } + attr_accessor :last_transaction_event_token + + # Globally unique identifier for the last financial transaction that impacted this + # balance. + sig { returns(String) } + attr_accessor :last_transaction_token + + # Funds not available for spend due to card authorizations or pending ACH release. + # Shown in the currency's smallest unit (e.g., cents for USD). + sig { returns(Integer) } + attr_accessor :pending_amount + + # The sum of available and pending balance in the currency's smallest unit (e.g., + # cents for USD). + sig { returns(Integer) } + attr_accessor :total_amount + + # Type of financial account. + sig { returns(Lithic::FinancialAccountBalance::Type::TaggedSymbol) } + attr_accessor :type + + # Date and time for when the balance was last updated. + sig { returns(Time) } + attr_accessor :updated + + # Balance of a Financial Account + sig do + params( + token: String, + available_amount: Integer, + created: Time, + currency: String, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + type: Lithic::FinancialAccountBalance::Type::OrSymbol, + updated: Time + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the financial account that holds this balance. + token:, + # Funds available for spend in the currency's smallest unit (e.g., cents for USD) + available_amount:, + # Date and time for when the balance was first created. + created:, + # 3-character alphabetic ISO 4217 code for the local currency of the balance. + currency:, + # Globally unique identifier for the last financial transaction event that + # impacted this balance. + last_transaction_event_token:, + # Globally unique identifier for the last financial transaction that impacted this + # balance. + last_transaction_token:, + # Funds not available for spend due to card authorizations or pending ACH release. + # Shown in the currency's smallest unit (e.g., cents for USD). + pending_amount:, + # The sum of available and pending balance in the currency's smallest unit (e.g., + # cents for USD). + total_amount:, + # Type of financial account. + type:, + # Date and time for when the balance was last updated. + updated: + ) + end + + sig do + override.returns( + { + token: String, + available_amount: Integer, + created: Time, + currency: String, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + type: Lithic::FinancialAccountBalance::Type::TaggedSymbol, + updated: Time + } + ) + end + def to_hash + end + + # Type of financial account. + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::FinancialAccountBalance::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ISSUING = + T.let(:ISSUING, Lithic::FinancialAccountBalance::Type::TaggedSymbol) + OPERATING = + T.let(:OPERATING, Lithic::FinancialAccountBalance::Type::TaggedSymbol) + RESERVE = + T.let(:RESERVE, Lithic::FinancialAccountBalance::Type::TaggedSymbol) + SECURITY = + T.let(:SECURITY, Lithic::FinancialAccountBalance::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::FinancialAccountBalance::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/financial_account_create_params.rbi b/rbi/lithic/models/financial_account_create_params.rbi new file mode 100644 index 00000000..3c783c77 --- /dev/null +++ b/rbi/lithic/models/financial_account_create_params.rbi @@ -0,0 +1,98 @@ +# typed: strong + +module Lithic + module Models + class FinancialAccountCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::FinancialAccountCreateParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :nickname + + sig { returns(Lithic::FinancialAccountCreateParams::Type::OrSymbol) } + attr_accessor :type + + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_for_benefit_of + + sig { params(is_for_benefit_of: T::Boolean).void } + attr_writer :is_for_benefit_of + + sig { returns(T.nilable(String)) } + attr_reader :idempotency_key + + sig { params(idempotency_key: String).void } + attr_writer :idempotency_key + + sig do + params( + nickname: String, + type: Lithic::FinancialAccountCreateParams::Type::OrSymbol, + account_token: String, + is_for_benefit_of: T::Boolean, + idempotency_key: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + nickname:, + type:, + account_token: nil, + is_for_benefit_of: nil, + idempotency_key: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + nickname: String, + type: Lithic::FinancialAccountCreateParams::Type::OrSymbol, + account_token: String, + is_for_benefit_of: T::Boolean, + idempotency_key: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::FinancialAccountCreateParams::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + OPERATING = + T.let( + :OPERATING, + Lithic::FinancialAccountCreateParams::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::FinancialAccountCreateParams::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/financial_account_created_webhook_event.rbi b/rbi/lithic/models/financial_account_created_webhook_event.rbi new file mode 100644 index 00000000..1db1bf15 --- /dev/null +++ b/rbi/lithic/models/financial_account_created_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class FinancialAccountCreatedWebhookEvent < Lithic::Models::FinancialAccount + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccountCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"financial_account.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/financial_account_list_params.rbi b/rbi/lithic/models/financial_account_list_params.rbi new file mode 100644 index 00000000..cdd7b3af --- /dev/null +++ b/rbi/lithic/models/financial_account_list_params.rbi @@ -0,0 +1,117 @@ +# typed: strong + +module Lithic + module Models + class FinancialAccountListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::FinancialAccountListParams, Lithic::Internal::AnyHash) + end + + # List financial accounts for a given account_token or business_account_token + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # List financial accounts for a given business_account_token + sig { returns(T.nilable(String)) } + attr_reader :business_account_token + + sig { params(business_account_token: String).void } + attr_writer :business_account_token + + # List financial accounts of a given type + sig do + returns(T.nilable(Lithic::FinancialAccountListParams::Type::OrSymbol)) + end + attr_reader :type + + sig do + params(type: Lithic::FinancialAccountListParams::Type::OrSymbol).void + end + attr_writer :type + + sig do + params( + account_token: String, + business_account_token: String, + type: Lithic::FinancialAccountListParams::Type::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # List financial accounts for a given account_token or business_account_token + account_token: nil, + # List financial accounts for a given business_account_token + business_account_token: nil, + # List financial accounts of a given type + type: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + account_token: String, + business_account_token: String, + type: Lithic::FinancialAccountListParams::Type::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # List financial accounts of a given type + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::FinancialAccountListParams::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ISSUING = + T.let( + :ISSUING, + Lithic::FinancialAccountListParams::Type::TaggedSymbol + ) + OPERATING = + T.let( + :OPERATING, + Lithic::FinancialAccountListParams::Type::TaggedSymbol + ) + RESERVE = + T.let( + :RESERVE, + Lithic::FinancialAccountListParams::Type::TaggedSymbol + ) + SECURITY = + T.let( + :SECURITY, + Lithic::FinancialAccountListParams::Type::TaggedSymbol + ) + EARLY_DIRECT_DEPOSIT_FLOAT = + T.let( + :EARLY_DIRECT_DEPOSIT_FLOAT, + Lithic::FinancialAccountListParams::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::FinancialAccountListParams::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/financial_account_register_account_number_params.rbi b/rbi/lithic/models/financial_account_register_account_number_params.rbi new file mode 100644 index 00000000..ac81f778 --- /dev/null +++ b/rbi/lithic/models/financial_account_register_account_number_params.rbi @@ -0,0 +1,50 @@ +# typed: strong + +module Lithic + module Models + class FinancialAccountRegisterAccountNumberParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccountRegisterAccountNumberParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :financial_account_token + + sig { returns(String) } + attr_accessor :account_number + + sig do + params( + financial_account_token: String, + account_number: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + financial_account_token:, + account_number:, + request_options: {} + ) + end + + sig do + override.returns( + { + financial_account_token: String, + account_number: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/financial_account_retrieve_params.rbi b/rbi/lithic/models/financial_account_retrieve_params.rbi new file mode 100644 index 00000000..6c1c6f3e --- /dev/null +++ b/rbi/lithic/models/financial_account_retrieve_params.rbi @@ -0,0 +1,41 @@ +# typed: strong + +module Lithic + module Models + class FinancialAccountRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccountRetrieveParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :financial_account_token + + sig do + params( + financial_account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(financial_account_token:, request_options: {}) + end + + sig do + override.returns( + { + financial_account_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/financial_account_update_params.rbi b/rbi/lithic/models/financial_account_update_params.rbi new file mode 100644 index 00000000..34d105c8 --- /dev/null +++ b/rbi/lithic/models/financial_account_update_params.rbi @@ -0,0 +1,46 @@ +# typed: strong + +module Lithic + module Models + class FinancialAccountUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::FinancialAccountUpdateParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :financial_account_token + + sig { returns(T.nilable(String)) } + attr_reader :nickname + + sig { params(nickname: String).void } + attr_writer :nickname + + sig do + params( + financial_account_token: String, + nickname: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(financial_account_token:, nickname: nil, request_options: {}) + end + + sig do + override.returns( + { + financial_account_token: String, + nickname: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/financial_account_update_status_params.rbi b/rbi/lithic/models/financial_account_update_status_params.rbi new file mode 100644 index 00000000..18a7a19a --- /dev/null +++ b/rbi/lithic/models/financial_account_update_status_params.rbi @@ -0,0 +1,180 @@ +# typed: strong + +module Lithic + module Models + class FinancialAccountUpdateStatusParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccountUpdateStatusParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :financial_account_token + + # Status of the financial account + sig do + returns(Lithic::FinancialAccountUpdateStatusParams::Status::OrSymbol) + end + attr_accessor :status + + # Substatus for the financial account + sig do + returns( + T.nilable( + Lithic::FinancialAccountUpdateStatusParams::Substatus::OrSymbol + ) + ) + end + attr_accessor :substatus + + # User-defined status for the financial account + sig { returns(T.nilable(String)) } + attr_reader :user_defined_status + + sig { params(user_defined_status: String).void } + attr_writer :user_defined_status + + sig do + params( + financial_account_token: String, + status: Lithic::FinancialAccountUpdateStatusParams::Status::OrSymbol, + substatus: + T.nilable( + Lithic::FinancialAccountUpdateStatusParams::Substatus::OrSymbol + ), + user_defined_status: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + financial_account_token:, + # Status of the financial account + status:, + # Substatus for the financial account + substatus:, + # User-defined status for the financial account + user_defined_status: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + financial_account_token: String, + status: + Lithic::FinancialAccountUpdateStatusParams::Status::OrSymbol, + substatus: + T.nilable( + Lithic::FinancialAccountUpdateStatusParams::Substatus::OrSymbol + ), + user_defined_status: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Status of the financial account + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::FinancialAccountUpdateStatusParams::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + OPEN = + T.let( + :OPEN, + Lithic::FinancialAccountUpdateStatusParams::Status::TaggedSymbol + ) + CLOSED = + T.let( + :CLOSED, + Lithic::FinancialAccountUpdateStatusParams::Status::TaggedSymbol + ) + SUSPENDED = + T.let( + :SUSPENDED, + Lithic::FinancialAccountUpdateStatusParams::Status::TaggedSymbol + ) + PENDING = + T.let( + :PENDING, + Lithic::FinancialAccountUpdateStatusParams::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::FinancialAccountUpdateStatusParams::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Substatus for the financial account + module Substatus + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::FinancialAccountUpdateStatusParams::Substatus) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHARGED_OFF_FRAUD = + T.let( + :CHARGED_OFF_FRAUD, + Lithic::FinancialAccountUpdateStatusParams::Substatus::TaggedSymbol + ) + END_USER_REQUEST = + T.let( + :END_USER_REQUEST, + Lithic::FinancialAccountUpdateStatusParams::Substatus::TaggedSymbol + ) + BANK_REQUEST = + T.let( + :BANK_REQUEST, + Lithic::FinancialAccountUpdateStatusParams::Substatus::TaggedSymbol + ) + CHARGED_OFF_DELINQUENT = + T.let( + :CHARGED_OFF_DELINQUENT, + Lithic::FinancialAccountUpdateStatusParams::Substatus::TaggedSymbol + ) + INTEREST_AND_FEES_PAUSED = + T.let( + :INTEREST_AND_FEES_PAUSED, + Lithic::FinancialAccountUpdateStatusParams::Substatus::TaggedSymbol + ) + DELINQUENT = + T.let( + :DELINQUENT, + Lithic::FinancialAccountUpdateStatusParams::Substatus::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::FinancialAccountUpdateStatusParams::Substatus::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/financial_account_updated_webhook_event.rbi b/rbi/lithic/models/financial_account_updated_webhook_event.rbi new file mode 100644 index 00000000..e344e13b --- /dev/null +++ b/rbi/lithic/models/financial_account_updated_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class FinancialAccountUpdatedWebhookEvent < Lithic::Models::FinancialAccount + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccountUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"financial_account.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/financial_accounts/balance_list_params.rbi b/rbi/lithic/models/financial_accounts/balance_list_params.rbi new file mode 100644 index 00000000..c54929e9 --- /dev/null +++ b/rbi/lithic/models/financial_accounts/balance_list_params.rbi @@ -0,0 +1,72 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class BalanceListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::BalanceListParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :financial_account_token + + # UTC date of the balance to retrieve. Defaults to latest available balance + sig { returns(T.nilable(Time)) } + attr_reader :balance_date + + sig { params(balance_date: Time).void } + attr_writer :balance_date + + # Balance after a given financial event occured. For example, passing the + # event_token of a $5 CARD_CLEARING financial event will return a balance + # decreased by $5 + sig { returns(T.nilable(String)) } + attr_reader :last_transaction_event_token + + sig { params(last_transaction_event_token: String).void } + attr_writer :last_transaction_event_token + + sig do + params( + financial_account_token: String, + balance_date: Time, + last_transaction_event_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + financial_account_token:, + # UTC date of the balance to retrieve. Defaults to latest available balance + balance_date: nil, + # Balance after a given financial event occured. For example, passing the + # event_token of a $5 CARD_CLEARING financial event will return a balance + # decreased by $5 + last_transaction_event_token: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + financial_account_token: String, + balance_date: Time, + last_transaction_event_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/financial_accounts/category_balances.rbi b/rbi/lithic/models/financial_accounts/category_balances.rbi new file mode 100644 index 00000000..6fab8951 --- /dev/null +++ b/rbi/lithic/models/financial_accounts/category_balances.rbi @@ -0,0 +1,42 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class CategoryBalances < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::CategoryBalances, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Integer) } + attr_accessor :fees + + sig { returns(Integer) } + attr_accessor :interest + + sig { returns(Integer) } + attr_accessor :principal + + sig do + params(fees: Integer, interest: Integer, principal: Integer).returns( + T.attached_class + ) + end + def self.new(fees:, interest:, principal:) + end + + sig do + override.returns( + { fees: Integer, interest: Integer, principal: Integer } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/financial_accounts/category_tier.rbi b/rbi/lithic/models/financial_accounts/category_tier.rbi new file mode 100644 index 00000000..70c28381 --- /dev/null +++ b/rbi/lithic/models/financial_accounts/category_tier.rbi @@ -0,0 +1,45 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class CategoryTier < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::CategoryTier, + Lithic::Internal::AnyHash + ) + end + + # Maximum interest rate for this category, e.g. '0.0525' for 5.25% + sig { returns(T.nilable(String)) } + attr_reader :cap_rate + + sig { params(cap_rate: String).void } + attr_writer :cap_rate + + # Interest rate for this category, e.g. '0.0525' for 5.25% + sig { returns(T.nilable(String)) } + attr_reader :rate + + sig { params(rate: String).void } + attr_writer :rate + + # Rate and rate cap for interest on a category + sig { params(cap_rate: String, rate: String).returns(T.attached_class) } + def self.new( + # Maximum interest rate for this category, e.g. '0.0525' for 5.25% + cap_rate: nil, + # Interest rate for this category, e.g. '0.0525' for 5.25% + rate: nil + ) + end + + sig { override.returns({ cap_rate: String, rate: String }) } + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/financial_accounts/credit_configuration_retrieve_params.rbi b/rbi/lithic/models/financial_accounts/credit_configuration_retrieve_params.rbi new file mode 100644 index 00000000..6383bc42 --- /dev/null +++ b/rbi/lithic/models/financial_accounts/credit_configuration_retrieve_params.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class CreditConfigurationRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::CreditConfigurationRetrieveParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :financial_account_token + + sig do + params( + financial_account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(financial_account_token:, request_options: {}) + end + + sig do + override.returns( + { + financial_account_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/financial_accounts/credit_configuration_update_params.rbi b/rbi/lithic/models/financial_accounts/credit_configuration_update_params.rbi new file mode 100644 index 00000000..3e32f049 --- /dev/null +++ b/rbi/lithic/models/financial_accounts/credit_configuration_update_params.rbi @@ -0,0 +1,140 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class CreditConfigurationUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::CreditConfigurationUpdateParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :financial_account_token + + sig do + returns( + T.nilable( + Lithic::FinancialAccounts::CreditConfigurationUpdateParams::AutoCollectionConfiguration + ) + ) + end + attr_reader :auto_collection_configuration + + sig do + params( + auto_collection_configuration: + Lithic::FinancialAccounts::CreditConfigurationUpdateParams::AutoCollectionConfiguration::OrHash + ).void + end + attr_writer :auto_collection_configuration + + sig { returns(T.nilable(Integer)) } + attr_reader :credit_limit + + sig { params(credit_limit: Integer).void } + attr_writer :credit_limit + + # Globally unique identifier for the credit product + sig { returns(T.nilable(String)) } + attr_reader :credit_product_token + + sig { params(credit_product_token: String).void } + attr_writer :credit_product_token + + sig { returns(T.nilable(String)) } + attr_reader :external_bank_account_token + + sig { params(external_bank_account_token: String).void } + attr_writer :external_bank_account_token + + # Tier to assign to a financial account + sig { returns(T.nilable(String)) } + attr_reader :tier + + sig { params(tier: String).void } + attr_writer :tier + + sig do + params( + financial_account_token: String, + auto_collection_configuration: + Lithic::FinancialAccounts::CreditConfigurationUpdateParams::AutoCollectionConfiguration::OrHash, + credit_limit: Integer, + credit_product_token: String, + external_bank_account_token: String, + tier: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + financial_account_token:, + auto_collection_configuration: nil, + credit_limit: nil, + # Globally unique identifier for the credit product + credit_product_token: nil, + external_bank_account_token: nil, + # Tier to assign to a financial account + tier: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + financial_account_token: String, + auto_collection_configuration: + Lithic::FinancialAccounts::CreditConfigurationUpdateParams::AutoCollectionConfiguration, + credit_limit: Integer, + credit_product_token: String, + external_bank_account_token: String, + tier: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + class AutoCollectionConfiguration < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::CreditConfigurationUpdateParams::AutoCollectionConfiguration, + Lithic::Internal::AnyHash + ) + end + + # If auto collection is enabled for this account + sig { returns(T.nilable(T::Boolean)) } + attr_reader :auto_collection_enabled + + sig { params(auto_collection_enabled: T::Boolean).void } + attr_writer :auto_collection_enabled + + sig do + params(auto_collection_enabled: T::Boolean).returns( + T.attached_class + ) + end + def self.new( + # If auto collection is enabled for this account + auto_collection_enabled: nil + ) + end + + sig { override.returns({ auto_collection_enabled: T::Boolean }) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/lithic/models/financial_accounts/financial_account_credit_config.rbi b/rbi/lithic/models/financial_accounts/financial_account_credit_config.rbi new file mode 100644 index 00000000..8fe8a9c1 --- /dev/null +++ b/rbi/lithic/models/financial_accounts/financial_account_credit_config.rbi @@ -0,0 +1,122 @@ +# typed: strong + +module Lithic + module Models + FinancialAccountCreditConfig = + FinancialAccounts::FinancialAccountCreditConfig + + module FinancialAccounts + class FinancialAccountCreditConfig < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::FinancialAccountCreditConfig, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for the account + sig { returns(String) } + attr_accessor :account_token + + sig do + returns( + Lithic::FinancialAccounts::FinancialAccountCreditConfig::AutoCollectionConfiguration + ) + end + attr_reader :auto_collection_configuration + + sig do + params( + auto_collection_configuration: + Lithic::FinancialAccounts::FinancialAccountCreditConfig::AutoCollectionConfiguration::OrHash + ).void + end + attr_writer :auto_collection_configuration + + sig { returns(T.nilable(Integer)) } + attr_accessor :credit_limit + + # Globally unique identifier for the credit product + sig { returns(T.nilable(String)) } + attr_accessor :credit_product_token + + sig { returns(T.nilable(String)) } + attr_accessor :external_bank_account_token + + # Tier assigned to the financial account + sig { returns(T.nilable(String)) } + attr_accessor :tier + + sig do + params( + account_token: String, + auto_collection_configuration: + Lithic::FinancialAccounts::FinancialAccountCreditConfig::AutoCollectionConfiguration::OrHash, + credit_limit: T.nilable(Integer), + credit_product_token: T.nilable(String), + external_bank_account_token: T.nilable(String), + tier: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the account + account_token:, + auto_collection_configuration:, + credit_limit:, + # Globally unique identifier for the credit product + credit_product_token:, + external_bank_account_token:, + # Tier assigned to the financial account + tier: + ) + end + + sig do + override.returns( + { + account_token: String, + auto_collection_configuration: + Lithic::FinancialAccounts::FinancialAccountCreditConfig::AutoCollectionConfiguration, + credit_limit: T.nilable(Integer), + credit_product_token: T.nilable(String), + external_bank_account_token: T.nilable(String), + tier: T.nilable(String) + } + ) + end + def to_hash + end + + class AutoCollectionConfiguration < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::FinancialAccountCreditConfig::AutoCollectionConfiguration, + Lithic::Internal::AnyHash + ) + end + + # If auto collection is enabled for this account + sig { returns(T::Boolean) } + attr_accessor :auto_collection_enabled + + sig do + params(auto_collection_enabled: T::Boolean).returns( + T.attached_class + ) + end + def self.new( + # If auto collection is enabled for this account + auto_collection_enabled: + ) + end + + sig { override.returns({ auto_collection_enabled: T::Boolean }) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/lithic/models/financial_accounts/financial_transaction_list_params.rbi b/rbi/lithic/models/financial_accounts/financial_transaction_list_params.rbi new file mode 100644 index 00000000..c10ea0e2 --- /dev/null +++ b/rbi/lithic/models/financial_accounts/financial_transaction_list_params.rbi @@ -0,0 +1,305 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class FinancialTransactionListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::FinancialTransactionListParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :financial_account_token + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Financial Transaction category to be returned. + sig do + returns( + T.nilable( + Lithic::FinancialAccounts::FinancialTransactionListParams::Category::OrSymbol + ) + ) + end + attr_reader :category + + sig do + params( + category: + Lithic::FinancialAccounts::FinancialTransactionListParams::Category::OrSymbol + ).void + end + attr_writer :category + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Financial Transaction result to be returned. + sig do + returns( + T.nilable( + Lithic::FinancialAccounts::FinancialTransactionListParams::Result::OrSymbol + ) + ) + end + attr_reader :result + + sig do + params( + result: + Lithic::FinancialAccounts::FinancialTransactionListParams::Result::OrSymbol + ).void + end + attr_writer :result + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + # Financial Transaction status to be returned. + sig do + returns( + T.nilable( + Lithic::FinancialAccounts::FinancialTransactionListParams::Status::OrSymbol + ) + ) + end + attr_reader :status + + sig do + params( + status: + Lithic::FinancialAccounts::FinancialTransactionListParams::Status::OrSymbol + ).void + end + attr_writer :status + + sig do + params( + financial_account_token: String, + begin_: Time, + category: + Lithic::FinancialAccounts::FinancialTransactionListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + result: + Lithic::FinancialAccounts::FinancialTransactionListParams::Result::OrSymbol, + starting_after: String, + status: + Lithic::FinancialAccounts::FinancialTransactionListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + financial_account_token:, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Financial Transaction category to be returned. + category: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Financial Transaction result to be returned. + result: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Financial Transaction status to be returned. + status: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + financial_account_token: String, + begin_: Time, + category: + Lithic::FinancialAccounts::FinancialTransactionListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + result: + Lithic::FinancialAccounts::FinancialTransactionListParams::Result::OrSymbol, + starting_after: String, + status: + Lithic::FinancialAccounts::FinancialTransactionListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Financial Transaction category to be returned. + module Category + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::FinancialAccounts::FinancialTransactionListParams::Category + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACH = + T.let( + :ACH, + Lithic::FinancialAccounts::FinancialTransactionListParams::Category::TaggedSymbol + ) + CARD = + T.let( + :CARD, + Lithic::FinancialAccounts::FinancialTransactionListParams::Category::TaggedSymbol + ) + INTERNAL = + T.let( + :INTERNAL, + Lithic::FinancialAccounts::FinancialTransactionListParams::Category::TaggedSymbol + ) + TRANSFER = + T.let( + :TRANSFER, + Lithic::FinancialAccounts::FinancialTransactionListParams::Category::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::FinancialAccounts::FinancialTransactionListParams::Category::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Financial Transaction result to be returned. + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::FinancialAccounts::FinancialTransactionListParams::Result + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::FinancialAccounts::FinancialTransactionListParams::Result::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::FinancialAccounts::FinancialTransactionListParams::Result::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::FinancialAccounts::FinancialTransactionListParams::Result::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Financial Transaction status to be returned. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::FinancialAccounts::FinancialTransactionListParams::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DECLINED = + T.let( + :DECLINED, + Lithic::FinancialAccounts::FinancialTransactionListParams::Status::TaggedSymbol + ) + EXPIRED = + T.let( + :EXPIRED, + Lithic::FinancialAccounts::FinancialTransactionListParams::Status::TaggedSymbol + ) + PENDING = + T.let( + :PENDING, + Lithic::FinancialAccounts::FinancialTransactionListParams::Status::TaggedSymbol + ) + RETURNED = + T.let( + :RETURNED, + Lithic::FinancialAccounts::FinancialTransactionListParams::Status::TaggedSymbol + ) + SETTLED = + T.let( + :SETTLED, + Lithic::FinancialAccounts::FinancialTransactionListParams::Status::TaggedSymbol + ) + VOIDED = + T.let( + :VOIDED, + Lithic::FinancialAccounts::FinancialTransactionListParams::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::FinancialAccounts::FinancialTransactionListParams::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/financial_accounts/financial_transaction_retrieve_params.rbi b/rbi/lithic/models/financial_accounts/financial_transaction_retrieve_params.rbi new file mode 100644 index 00000000..004a95e0 --- /dev/null +++ b/rbi/lithic/models/financial_accounts/financial_transaction_retrieve_params.rbi @@ -0,0 +1,52 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class FinancialTransactionRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::FinancialTransactionRetrieveParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :financial_account_token + + sig { returns(String) } + attr_accessor :financial_transaction_token + + sig do + params( + financial_account_token: String, + financial_transaction_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + financial_account_token:, + financial_transaction_token:, + request_options: {} + ) + end + + sig do + override.returns( + { + financial_account_token: String, + financial_transaction_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/financial_accounts/interest_tier_schedule.rbi b/rbi/lithic/models/financial_accounts/interest_tier_schedule.rbi new file mode 100644 index 00000000..59ec251c --- /dev/null +++ b/rbi/lithic/models/financial_accounts/interest_tier_schedule.rbi @@ -0,0 +1,86 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class FinancialAccountsInterestTierSchedule < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::FinancialAccountsInterestTierSchedule, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for a credit product + sig { returns(String) } + attr_accessor :credit_product_token + + # Date the tier should be effective in YYYY-MM-DD format + sig { returns(Date) } + attr_accessor :effective_date + + # Custom rates per category for penalties + sig { returns(T.nilable(T.anything)) } + attr_reader :penalty_rates + + sig { params(penalty_rates: T.anything).void } + attr_writer :penalty_rates + + # Name of a tier contained in the credit product. Mutually exclusive with + # tier_rates + sig { returns(T.nilable(String)) } + attr_reader :tier_name + + sig { params(tier_name: String).void } + attr_writer :tier_name + + # Custom rates per category. Mutually exclusive with tier_name + sig { returns(T.nilable(T.anything)) } + attr_reader :tier_rates + + sig { params(tier_rates: T.anything).void } + attr_writer :tier_rates + + # Entry in the Tier Schedule of an account + sig do + params( + credit_product_token: String, + effective_date: Date, + penalty_rates: T.anything, + tier_name: String, + tier_rates: T.anything + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for a credit product + credit_product_token:, + # Date the tier should be effective in YYYY-MM-DD format + effective_date:, + # Custom rates per category for penalties + penalty_rates: nil, + # Name of a tier contained in the credit product. Mutually exclusive with + # tier_rates + tier_name: nil, + # Custom rates per category. Mutually exclusive with tier_name + tier_rates: nil + ) + end + + sig do + override.returns( + { + credit_product_token: String, + effective_date: Date, + penalty_rates: T.anything, + tier_name: String, + tier_rates: T.anything + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/financial_accounts/interest_tier_schedule_create_params.rbi b/rbi/lithic/models/financial_accounts/interest_tier_schedule_create_params.rbi new file mode 100644 index 00000000..3edbc566 --- /dev/null +++ b/rbi/lithic/models/financial_accounts/interest_tier_schedule_create_params.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class InterestTierScheduleCreateParams < Lithic::Models::FinancialAccounts::FinancialAccountsInterestTierSchedule + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::InterestTierScheduleCreateParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :financial_account_token + + sig do + params( + financial_account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(financial_account_token:, request_options: {}) + end + + sig do + override.returns( + { + financial_account_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/financial_accounts/interest_tier_schedule_delete_params.rbi b/rbi/lithic/models/financial_accounts/interest_tier_schedule_delete_params.rbi new file mode 100644 index 00000000..393f408e --- /dev/null +++ b/rbi/lithic/models/financial_accounts/interest_tier_schedule_delete_params.rbi @@ -0,0 +1,52 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class InterestTierScheduleDeleteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::InterestTierScheduleDeleteParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :financial_account_token + + sig { returns(Date) } + attr_accessor :effective_date + + sig do + params( + financial_account_token: String, + effective_date: Date, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + financial_account_token:, + effective_date:, + request_options: {} + ) + end + + sig do + override.returns( + { + financial_account_token: String, + effective_date: Date, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/financial_accounts/interest_tier_schedule_list_params.rbi b/rbi/lithic/models/financial_accounts/interest_tier_schedule_list_params.rbi new file mode 100644 index 00000000..f446189f --- /dev/null +++ b/rbi/lithic/models/financial_accounts/interest_tier_schedule_list_params.rbi @@ -0,0 +1,79 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class InterestTierScheduleListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::InterestTierScheduleListParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :financial_account_token + + # Return schedules with effective_date >= after_date (ISO format YYYY-MM-DD) + sig { returns(T.nilable(Date)) } + attr_reader :after_date + + sig { params(after_date: Date).void } + attr_writer :after_date + + # Return schedules with effective_date <= before_date (ISO format YYYY-MM-DD) + sig { returns(T.nilable(Date)) } + attr_reader :before_date + + sig { params(before_date: Date).void } + attr_writer :before_date + + # Return schedule with effective_date == for_date (ISO format YYYY-MM-DD) + sig { returns(T.nilable(Date)) } + attr_reader :for_date + + sig { params(for_date: Date).void } + attr_writer :for_date + + sig do + params( + financial_account_token: String, + after_date: Date, + before_date: Date, + for_date: Date, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + financial_account_token:, + # Return schedules with effective_date >= after_date (ISO format YYYY-MM-DD) + after_date: nil, + # Return schedules with effective_date <= before_date (ISO format YYYY-MM-DD) + before_date: nil, + # Return schedule with effective_date == for_date (ISO format YYYY-MM-DD) + for_date: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + financial_account_token: String, + after_date: Date, + before_date: Date, + for_date: Date, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/financial_accounts/interest_tier_schedule_retrieve_params.rbi b/rbi/lithic/models/financial_accounts/interest_tier_schedule_retrieve_params.rbi new file mode 100644 index 00000000..aa142411 --- /dev/null +++ b/rbi/lithic/models/financial_accounts/interest_tier_schedule_retrieve_params.rbi @@ -0,0 +1,52 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class InterestTierScheduleRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::InterestTierScheduleRetrieveParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :financial_account_token + + sig { returns(Date) } + attr_accessor :effective_date + + sig do + params( + financial_account_token: String, + effective_date: Date, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + financial_account_token:, + effective_date:, + request_options: {} + ) + end + + sig do + override.returns( + { + financial_account_token: String, + effective_date: Date, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/financial_accounts/interest_tier_schedule_update_params.rbi b/rbi/lithic/models/financial_accounts/interest_tier_schedule_update_params.rbi new file mode 100644 index 00000000..392f731d --- /dev/null +++ b/rbi/lithic/models/financial_accounts/interest_tier_schedule_update_params.rbi @@ -0,0 +1,87 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class InterestTierScheduleUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::InterestTierScheduleUpdateParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :financial_account_token + + sig { returns(Date) } + attr_accessor :effective_date + + # Custom rates per category for penalties + sig { returns(T.nilable(T.anything)) } + attr_reader :penalty_rates + + sig { params(penalty_rates: T.anything).void } + attr_writer :penalty_rates + + # Name of a tier contained in the credit product. Mutually exclusive with + # tier_rates + sig { returns(T.nilable(String)) } + attr_reader :tier_name + + sig { params(tier_name: String).void } + attr_writer :tier_name + + # Custom rates per category. Mutually exclusive with tier_name + sig { returns(T.nilable(T.anything)) } + attr_reader :tier_rates + + sig { params(tier_rates: T.anything).void } + attr_writer :tier_rates + + sig do + params( + financial_account_token: String, + effective_date: Date, + penalty_rates: T.anything, + tier_name: String, + tier_rates: T.anything, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + financial_account_token:, + effective_date:, + # Custom rates per category for penalties + penalty_rates: nil, + # Name of a tier contained in the credit product. Mutually exclusive with + # tier_rates + tier_name: nil, + # Custom rates per category. Mutually exclusive with tier_name + tier_rates: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + financial_account_token: String, + effective_date: Date, + penalty_rates: T.anything, + tier_name: String, + tier_rates: T.anything, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/financial_accounts/loan_tape.rbi b/rbi/lithic/models/financial_accounts/loan_tape.rbi new file mode 100644 index 00000000..cb00dfee --- /dev/null +++ b/rbi/lithic/models/financial_accounts/loan_tape.rbi @@ -0,0 +1,959 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class LoanTape < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::LoanTape, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for a loan tape + sig { returns(String) } + attr_accessor :token + + sig { returns(Lithic::FinancialAccounts::LoanTape::AccountStanding) } + attr_reader :account_standing + + sig do + params( + account_standing: + Lithic::FinancialAccounts::LoanTape::AccountStanding::OrHash + ).void + end + attr_writer :account_standing + + # Amount of credit available to spend in cents + sig { returns(Integer) } + attr_accessor :available_credit + + sig { returns(Lithic::FinancialAccounts::LoanTape::Balances) } + attr_reader :balances + + sig do + params( + balances: Lithic::FinancialAccounts::LoanTape::Balances::OrHash + ).void + end + attr_writer :balances + + # Timestamp of when the loan tape was created + sig { returns(Time) } + attr_accessor :created + + # For prepay accounts, this is the minimum prepay balance that must be maintained. + # For charge card accounts, this is the maximum credit balance extended by a + # lender + sig { returns(Integer) } + attr_accessor :credit_limit + + # Globally unique identifier for a credit product + sig { returns(String) } + attr_accessor :credit_product_token + + # Date of transactions that this loan tape covers + sig { returns(Date) } + attr_accessor :date + + sig { returns(Lithic::StatementTotals) } + attr_reader :day_totals + + sig { params(day_totals: Lithic::StatementTotals::OrHash).void } + attr_writer :day_totals + + # Balance at the end of the day + sig { returns(Integer) } + attr_accessor :ending_balance + + # Excess credits in the form of provisional credits, payments, or purchase + # refunds. If positive, the account is in net credit state with no outstanding + # balances. An overpayment could land an account in this state + sig { returns(Integer) } + attr_accessor :excess_credits + + # Globally unique identifier for a financial account + sig { returns(String) } + attr_accessor :financial_account_token + + sig do + returns( + T.nilable(Lithic::FinancialAccounts::LoanTape::InterestDetails) + ) + end + attr_reader :interest_details + + sig do + params( + interest_details: + T.nilable( + Lithic::FinancialAccounts::LoanTape::InterestDetails::OrHash + ) + ).void + end + attr_writer :interest_details + + sig do + returns(Lithic::FinancialAccounts::LoanTape::MinimumPaymentBalance) + end + attr_reader :minimum_payment_balance + + sig do + params( + minimum_payment_balance: + Lithic::FinancialAccounts::LoanTape::MinimumPaymentBalance::OrHash + ).void + end + attr_writer :minimum_payment_balance + + sig { returns(Lithic::FinancialAccounts::LoanTape::PaymentAllocation) } + attr_reader :payment_allocation + + sig do + params( + payment_allocation: + Lithic::FinancialAccounts::LoanTape::PaymentAllocation::OrHash + ).void + end + attr_writer :payment_allocation + + sig { returns(Lithic::StatementTotals) } + attr_reader :period_totals + + sig { params(period_totals: Lithic::StatementTotals::OrHash).void } + attr_writer :period_totals + + sig do + returns(Lithic::FinancialAccounts::LoanTape::PreviousStatementBalance) + end + attr_reader :previous_statement_balance + + sig do + params( + previous_statement_balance: + Lithic::FinancialAccounts::LoanTape::PreviousStatementBalance::OrHash + ).void + end + attr_writer :previous_statement_balance + + # Balance at the start of the day + sig { returns(Integer) } + attr_accessor :starting_balance + + # Timestamp of when the loan tape was updated + sig { returns(Time) } + attr_accessor :updated + + # Version number of the loan tape. This starts at 1 + sig { returns(Integer) } + attr_accessor :version + + sig { returns(Lithic::StatementTotals) } + attr_reader :ytd_totals + + sig { params(ytd_totals: Lithic::StatementTotals::OrHash).void } + attr_writer :ytd_totals + + # Day of the billing period that this loan tape covers, starting at 1 + sig { returns(T.nilable(Integer)) } + attr_accessor :day_of_period + + # Interest tier to which this account belongs to + sig { returns(T.nilable(String)) } + attr_accessor :tier + + sig do + params( + token: String, + account_standing: + Lithic::FinancialAccounts::LoanTape::AccountStanding::OrHash, + available_credit: Integer, + balances: Lithic::FinancialAccounts::LoanTape::Balances::OrHash, + created: Time, + credit_limit: Integer, + credit_product_token: String, + date: Date, + day_totals: Lithic::StatementTotals::OrHash, + ending_balance: Integer, + excess_credits: Integer, + financial_account_token: String, + interest_details: + T.nilable( + Lithic::FinancialAccounts::LoanTape::InterestDetails::OrHash + ), + minimum_payment_balance: + Lithic::FinancialAccounts::LoanTape::MinimumPaymentBalance::OrHash, + payment_allocation: + Lithic::FinancialAccounts::LoanTape::PaymentAllocation::OrHash, + period_totals: Lithic::StatementTotals::OrHash, + previous_statement_balance: + Lithic::FinancialAccounts::LoanTape::PreviousStatementBalance::OrHash, + starting_balance: Integer, + updated: Time, + version: Integer, + ytd_totals: Lithic::StatementTotals::OrHash, + day_of_period: T.nilable(Integer), + tier: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for a loan tape + token:, + account_standing:, + # Amount of credit available to spend in cents + available_credit:, + balances:, + # Timestamp of when the loan tape was created + created:, + # For prepay accounts, this is the minimum prepay balance that must be maintained. + # For charge card accounts, this is the maximum credit balance extended by a + # lender + credit_limit:, + # Globally unique identifier for a credit product + credit_product_token:, + # Date of transactions that this loan tape covers + date:, + day_totals:, + # Balance at the end of the day + ending_balance:, + # Excess credits in the form of provisional credits, payments, or purchase + # refunds. If positive, the account is in net credit state with no outstanding + # balances. An overpayment could land an account in this state + excess_credits:, + # Globally unique identifier for a financial account + financial_account_token:, + interest_details:, + minimum_payment_balance:, + payment_allocation:, + period_totals:, + previous_statement_balance:, + # Balance at the start of the day + starting_balance:, + # Timestamp of when the loan tape was updated + updated:, + # Version number of the loan tape. This starts at 1 + version:, + ytd_totals:, + # Day of the billing period that this loan tape covers, starting at 1 + day_of_period: nil, + # Interest tier to which this account belongs to + tier: nil + ) + end + + sig do + override.returns( + { + token: String, + account_standing: + Lithic::FinancialAccounts::LoanTape::AccountStanding, + available_credit: Integer, + balances: Lithic::FinancialAccounts::LoanTape::Balances, + created: Time, + credit_limit: Integer, + credit_product_token: String, + date: Date, + day_totals: Lithic::StatementTotals, + ending_balance: Integer, + excess_credits: Integer, + financial_account_token: String, + interest_details: + T.nilable(Lithic::FinancialAccounts::LoanTape::InterestDetails), + minimum_payment_balance: + Lithic::FinancialAccounts::LoanTape::MinimumPaymentBalance, + payment_allocation: + Lithic::FinancialAccounts::LoanTape::PaymentAllocation, + period_totals: Lithic::StatementTotals, + previous_statement_balance: + Lithic::FinancialAccounts::LoanTape::PreviousStatementBalance, + starting_balance: Integer, + updated: Time, + version: Integer, + ytd_totals: Lithic::StatementTotals, + day_of_period: T.nilable(Integer), + tier: T.nilable(String) + } + ) + end + def to_hash + end + + class AccountStanding < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::LoanTape::AccountStanding, + Lithic::Internal::AnyHash + ) + end + + # Number of consecutive full payments made + sig { returns(Integer) } + attr_accessor :consecutive_full_payments_made + + # Number of consecutive minimum payments made + sig { returns(Integer) } + attr_accessor :consecutive_minimum_payments_made + + # Number of consecutive minimum payments missed + sig { returns(Integer) } + attr_accessor :consecutive_minimum_payments_missed + + # Number of days past due + sig { returns(Integer) } + attr_accessor :days_past_due + + # Information about the financial account state + sig do + returns( + Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState + ) + end + attr_reader :financial_account_state + + sig do + params( + financial_account_state: + Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::OrHash + ).void + end + attr_writer :financial_account_state + + # Whether the account currently has grace or not + sig { returns(T::Boolean) } + attr_accessor :has_grace + + # Current overall period number + sig { returns(Integer) } + attr_accessor :period_number + + sig do + returns( + Lithic::FinancialAccounts::LoanTape::AccountStanding::PeriodState::TaggedSymbol + ) + end + attr_accessor :period_state + + sig do + params( + consecutive_full_payments_made: Integer, + consecutive_minimum_payments_made: Integer, + consecutive_minimum_payments_missed: Integer, + days_past_due: Integer, + financial_account_state: + Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::OrHash, + has_grace: T::Boolean, + period_number: Integer, + period_state: + Lithic::FinancialAccounts::LoanTape::AccountStanding::PeriodState::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Number of consecutive full payments made + consecutive_full_payments_made:, + # Number of consecutive minimum payments made + consecutive_minimum_payments_made:, + # Number of consecutive minimum payments missed + consecutive_minimum_payments_missed:, + # Number of days past due + days_past_due:, + # Information about the financial account state + financial_account_state:, + # Whether the account currently has grace or not + has_grace:, + # Current overall period number + period_number:, + period_state: + ) + end + + sig do + override.returns( + { + consecutive_full_payments_made: Integer, + consecutive_minimum_payments_made: Integer, + consecutive_minimum_payments_missed: Integer, + days_past_due: Integer, + financial_account_state: + Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState, + has_grace: T::Boolean, + period_number: Integer, + period_state: + Lithic::FinancialAccounts::LoanTape::AccountStanding::PeriodState::TaggedSymbol + } + ) + end + def to_hash + end + + class FinancialAccountState < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState, + Lithic::Internal::AnyHash + ) + end + + # Status of the financial account + sig do + returns( + Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Status::TaggedSymbol + ) + end + attr_accessor :status + + # Substatus for the financial account + sig do + returns( + T.nilable( + Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Substatus::TaggedSymbol + ) + ) + end + attr_accessor :substatus + + # Information about the financial account state + sig do + params( + status: + Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Status::OrSymbol, + substatus: + T.nilable( + Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Substatus::OrSymbol + ) + ).returns(T.attached_class) + end + def self.new( + # Status of the financial account + status:, + # Substatus for the financial account + substatus: nil + ) + end + + sig do + override.returns( + { + status: + Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Status::TaggedSymbol, + substatus: + T.nilable( + Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Substatus::TaggedSymbol + ) + } + ) + end + def to_hash + end + + # Status of the financial account + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + OPEN = + T.let( + :OPEN, + Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Status::TaggedSymbol + ) + CLOSED = + T.let( + :CLOSED, + Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Status::TaggedSymbol + ) + SUSPENDED = + T.let( + :SUSPENDED, + Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Status::TaggedSymbol + ) + PENDING = + T.let( + :PENDING, + Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Substatus for the financial account + module Substatus + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Substatus + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHARGED_OFF_DELINQUENT = + T.let( + :CHARGED_OFF_DELINQUENT, + Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Substatus::TaggedSymbol + ) + CHARGED_OFF_FRAUD = + T.let( + :CHARGED_OFF_FRAUD, + Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Substatus::TaggedSymbol + ) + END_USER_REQUEST = + T.let( + :END_USER_REQUEST, + Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Substatus::TaggedSymbol + ) + BANK_REQUEST = + T.let( + :BANK_REQUEST, + Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Substatus::TaggedSymbol + ) + DELINQUENT = + T.let( + :DELINQUENT, + Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Substatus::TaggedSymbol + ) + INTEREST_AND_FEES_PAUSED = + T.let( + :INTEREST_AND_FEES_PAUSED, + Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Substatus::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::Substatus::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module PeriodState + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::FinancialAccounts::LoanTape::AccountStanding::PeriodState + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + STANDARD = + T.let( + :STANDARD, + Lithic::FinancialAccounts::LoanTape::AccountStanding::PeriodState::TaggedSymbol + ) + PROMO = + T.let( + :PROMO, + Lithic::FinancialAccounts::LoanTape::AccountStanding::PeriodState::TaggedSymbol + ) + PENALTY = + T.let( + :PENALTY, + Lithic::FinancialAccounts::LoanTape::AccountStanding::PeriodState::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::FinancialAccounts::LoanTape::AccountStanding::PeriodState::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class Balances < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::LoanTape::Balances, + Lithic::Internal::AnyHash + ) + end + + # Amount due for the prior billing cycle. Any amounts not fully paid off on this + # due date will be considered past due the next day + sig { returns(Lithic::FinancialAccounts::CategoryBalances) } + attr_reader :due + + sig do + params( + due: Lithic::FinancialAccounts::CategoryBalances::OrHash + ).void + end + attr_writer :due + + # Amount due for the current billing cycle. Any amounts not paid off by early + # payments or credits will be considered due at the end of the current billing + # period + sig { returns(Lithic::FinancialAccounts::CategoryBalances) } + attr_reader :next_statement_due + + sig do + params( + next_statement_due: + Lithic::FinancialAccounts::CategoryBalances::OrHash + ).void + end + attr_writer :next_statement_due + + # Amount not paid off on previous due dates + sig { returns(Lithic::FinancialAccounts::CategoryBalances) } + attr_reader :past_due + + sig do + params( + past_due: Lithic::FinancialAccounts::CategoryBalances::OrHash + ).void + end + attr_writer :past_due + + # Amount due for the past billing cycles. + sig { returns(Lithic::FinancialAccounts::CategoryBalances) } + attr_reader :past_statements_due + + sig do + params( + past_statements_due: + Lithic::FinancialAccounts::CategoryBalances::OrHash + ).void + end + attr_writer :past_statements_due + + sig do + params( + due: Lithic::FinancialAccounts::CategoryBalances::OrHash, + next_statement_due: + Lithic::FinancialAccounts::CategoryBalances::OrHash, + past_due: Lithic::FinancialAccounts::CategoryBalances::OrHash, + past_statements_due: + Lithic::FinancialAccounts::CategoryBalances::OrHash + ).returns(T.attached_class) + end + def self.new( + # Amount due for the prior billing cycle. Any amounts not fully paid off on this + # due date will be considered past due the next day + due:, + # Amount due for the current billing cycle. Any amounts not paid off by early + # payments or credits will be considered due at the end of the current billing + # period + next_statement_due:, + # Amount not paid off on previous due dates + past_due:, + # Amount due for the past billing cycles. + past_statements_due: + ) + end + + sig do + override.returns( + { + due: Lithic::FinancialAccounts::CategoryBalances, + next_statement_due: Lithic::FinancialAccounts::CategoryBalances, + past_due: Lithic::FinancialAccounts::CategoryBalances, + past_statements_due: Lithic::FinancialAccounts::CategoryBalances + } + ) + end + def to_hash + end + end + + class InterestDetails < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::LoanTape::InterestDetails, + Lithic::Internal::AnyHash + ) + end + + sig { returns(T.nilable(Integer)) } + attr_accessor :actual_interest_charged + + sig { returns(Lithic::CategoryDetails) } + attr_reader :daily_balance_amounts + + sig do + params(daily_balance_amounts: Lithic::CategoryDetails::OrHash).void + end + attr_writer :daily_balance_amounts + + sig { returns(Lithic::CategoryDetails) } + attr_reader :effective_apr + + sig { params(effective_apr: Lithic::CategoryDetails::OrHash).void } + attr_writer :effective_apr + + sig do + returns( + Lithic::FinancialAccounts::LoanTape::InterestDetails::InterestCalculationMethod::TaggedSymbol + ) + end + attr_accessor :interest_calculation_method + + sig { returns(Lithic::CategoryDetails) } + attr_reader :interest_for_period + + sig do + params(interest_for_period: Lithic::CategoryDetails::OrHash).void + end + attr_writer :interest_for_period + + sig { returns(T.nilable(String)) } + attr_accessor :prime_rate + + sig { returns(T.nilable(Integer)) } + attr_accessor :minimum_interest_charged + + sig do + params( + actual_interest_charged: T.nilable(Integer), + daily_balance_amounts: Lithic::CategoryDetails::OrHash, + effective_apr: Lithic::CategoryDetails::OrHash, + interest_calculation_method: + Lithic::FinancialAccounts::LoanTape::InterestDetails::InterestCalculationMethod::OrSymbol, + interest_for_period: Lithic::CategoryDetails::OrHash, + prime_rate: T.nilable(String), + minimum_interest_charged: T.nilable(Integer) + ).returns(T.attached_class) + end + def self.new( + actual_interest_charged:, + daily_balance_amounts:, + effective_apr:, + interest_calculation_method:, + interest_for_period:, + prime_rate:, + minimum_interest_charged: nil + ) + end + + sig do + override.returns( + { + actual_interest_charged: T.nilable(Integer), + daily_balance_amounts: Lithic::CategoryDetails, + effective_apr: Lithic::CategoryDetails, + interest_calculation_method: + Lithic::FinancialAccounts::LoanTape::InterestDetails::InterestCalculationMethod::TaggedSymbol, + interest_for_period: Lithic::CategoryDetails, + prime_rate: T.nilable(String), + minimum_interest_charged: T.nilable(Integer) + } + ) + end + def to_hash + end + + module InterestCalculationMethod + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::FinancialAccounts::LoanTape::InterestDetails::InterestCalculationMethod + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DAILY = + T.let( + :DAILY, + Lithic::FinancialAccounts::LoanTape::InterestDetails::InterestCalculationMethod::TaggedSymbol + ) + AVERAGE_DAILY = + T.let( + :AVERAGE_DAILY, + Lithic::FinancialAccounts::LoanTape::InterestDetails::InterestCalculationMethod::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::FinancialAccounts::LoanTape::InterestDetails::InterestCalculationMethod::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class MinimumPaymentBalance < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::LoanTape::MinimumPaymentBalance, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Integer) } + attr_accessor :amount + + sig { returns(Integer) } + attr_accessor :remaining + + sig do + params(amount: Integer, remaining: Integer).returns( + T.attached_class + ) + end + def self.new(amount:, remaining:) + end + + sig { override.returns({ amount: Integer, remaining: Integer }) } + def to_hash + end + end + + class PaymentAllocation < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::LoanTape::PaymentAllocation, + Lithic::Internal::AnyHash + ) + end + + sig { returns(T.nilable(Lithic::CategoryDetails)) } + attr_reader :fee_details + + sig do + params(fee_details: T.nilable(Lithic::CategoryDetails::OrHash)).void + end + attr_writer :fee_details + + # Amount allocated to fees in cents + sig { returns(Integer) } + attr_accessor :fees + + # Amount allocated to interest in cents + sig { returns(Integer) } + attr_accessor :interest + + sig { returns(T.nilable(Lithic::CategoryDetails)) } + attr_reader :interest_details + + sig do + params( + interest_details: T.nilable(Lithic::CategoryDetails::OrHash) + ).void + end + attr_writer :interest_details + + # Amount allocated to principal in cents + sig { returns(Integer) } + attr_accessor :principal + + sig { returns(T.nilable(Lithic::CategoryDetails)) } + attr_reader :principal_details + + sig do + params( + principal_details: T.nilable(Lithic::CategoryDetails::OrHash) + ).void + end + attr_writer :principal_details + + sig do + params( + fee_details: T.nilable(Lithic::CategoryDetails::OrHash), + fees: Integer, + interest: Integer, + interest_details: T.nilable(Lithic::CategoryDetails::OrHash), + principal: Integer, + principal_details: T.nilable(Lithic::CategoryDetails::OrHash) + ).returns(T.attached_class) + end + def self.new( + fee_details:, + # Amount allocated to fees in cents + fees:, + # Amount allocated to interest in cents + interest:, + interest_details:, + # Amount allocated to principal in cents + principal:, + principal_details: + ) + end + + sig do + override.returns( + { + fee_details: T.nilable(Lithic::CategoryDetails), + fees: Integer, + interest: Integer, + interest_details: T.nilable(Lithic::CategoryDetails), + principal: Integer, + principal_details: T.nilable(Lithic::CategoryDetails) + } + ) + end + def to_hash + end + end + + class PreviousStatementBalance < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::LoanTape::PreviousStatementBalance, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Integer) } + attr_accessor :amount + + sig { returns(Integer) } + attr_accessor :remaining + + sig do + params(amount: Integer, remaining: Integer).returns( + T.attached_class + ) + end + def self.new(amount:, remaining:) + end + + sig { override.returns({ amount: Integer, remaining: Integer }) } + def to_hash + end + end + end + end + end +end diff --git a/rbi/lithic/models/financial_accounts/loan_tape_configuration.rbi b/rbi/lithic/models/financial_accounts/loan_tape_configuration.rbi new file mode 100644 index 00000000..05eab93e --- /dev/null +++ b/rbi/lithic/models/financial_accounts/loan_tape_configuration.rbi @@ -0,0 +1,99 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class FinancialAccountsLoanTapeConfiguration < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::FinancialAccountsLoanTapeConfiguration, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Time) } + attr_accessor :created_at + + sig { returns(String) } + attr_accessor :financial_account_token + + sig { returns(String) } + attr_accessor :instance_token + + sig { returns(Time) } + attr_accessor :updated_at + + sig { returns(T.nilable(String)) } + attr_reader :credit_product_token + + sig { params(credit_product_token: String).void } + attr_writer :credit_product_token + + # Configuration for building loan tapes + sig do + returns( + T.nilable(Lithic::FinancialAccounts::LoanTapeRebuildConfiguration) + ) + end + attr_reader :loan_tape_rebuild_configuration + + sig do + params( + loan_tape_rebuild_configuration: + Lithic::FinancialAccounts::LoanTapeRebuildConfiguration::OrHash + ).void + end + attr_writer :loan_tape_rebuild_configuration + + sig { returns(T.nilable(Time)) } + attr_reader :tier_schedule_changed_at + + sig { params(tier_schedule_changed_at: Time).void } + attr_writer :tier_schedule_changed_at + + # Configuration for loan tapes + sig do + params( + created_at: Time, + financial_account_token: String, + instance_token: String, + updated_at: Time, + credit_product_token: String, + loan_tape_rebuild_configuration: + Lithic::FinancialAccounts::LoanTapeRebuildConfiguration::OrHash, + tier_schedule_changed_at: Time + ).returns(T.attached_class) + end + def self.new( + created_at:, + financial_account_token:, + instance_token:, + updated_at:, + credit_product_token: nil, + # Configuration for building loan tapes + loan_tape_rebuild_configuration: nil, + tier_schedule_changed_at: nil + ) + end + + sig do + override.returns( + { + created_at: Time, + financial_account_token: String, + instance_token: String, + updated_at: Time, + credit_product_token: String, + loan_tape_rebuild_configuration: + Lithic::FinancialAccounts::LoanTapeRebuildConfiguration, + tier_schedule_changed_at: Time + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/financial_accounts/loan_tape_configuration_retrieve_params.rbi b/rbi/lithic/models/financial_accounts/loan_tape_configuration_retrieve_params.rbi new file mode 100644 index 00000000..8619c56d --- /dev/null +++ b/rbi/lithic/models/financial_accounts/loan_tape_configuration_retrieve_params.rbi @@ -0,0 +1,48 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class LoanTapeConfigurationRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::LoanTapeConfigurationRetrieveParams, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for financial account. + sig { returns(String) } + attr_accessor :financial_account_token + + sig do + params( + financial_account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for financial account. + financial_account_token:, + request_options: {} + ) + end + + sig do + override.returns( + { + financial_account_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/financial_accounts/loan_tape_list_params.rbi b/rbi/lithic/models/financial_accounts/loan_tape_list_params.rbi new file mode 100644 index 00000000..fd0adc5f --- /dev/null +++ b/rbi/lithic/models/financial_accounts/loan_tape_list_params.rbi @@ -0,0 +1,111 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class LoanTapeListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::LoanTapeListParams, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for financial account. + sig { returns(String) } + attr_accessor :financial_account_token + + # Date string in RFC 3339 format. Only entries created after the specified date + # will be included. + sig { returns(T.nilable(Date)) } + attr_reader :begin_ + + sig { params(begin_: Date).void } + attr_writer :begin_ + + # Date string in RFC 3339 format. Only entries created before the specified date + # will be included. + sig { returns(T.nilable(Date)) } + attr_reader :end_ + + sig { params(end_: Date).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + financial_account_token: String, + begin_: Date, + end_: Date, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for financial account. + financial_account_token:, + # Date string in RFC 3339 format. Only entries created after the specified date + # will be included. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified date + # will be included. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + financial_account_token: String, + begin_: Date, + end_: Date, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/financial_accounts/loan_tape_rebuild_configuration.rbi b/rbi/lithic/models/financial_accounts/loan_tape_rebuild_configuration.rbi new file mode 100644 index 00000000..ebbcb958 --- /dev/null +++ b/rbi/lithic/models/financial_accounts/loan_tape_rebuild_configuration.rbi @@ -0,0 +1,65 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class LoanTapeRebuildConfiguration < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::LoanTapeRebuildConfiguration, + Lithic::Internal::AnyHash + ) + end + + # Whether the account's loan tapes need to be rebuilt or not + sig { returns(T::Boolean) } + attr_accessor :rebuild_needed + + # The date for which the account's loan tapes were last rebuilt + sig { returns(T.nilable(Date)) } + attr_reader :last_rebuild + + sig { params(last_rebuild: Date).void } + attr_writer :last_rebuild + + # Date from which to start rebuilding from if the account requires a rebuild + sig { returns(T.nilable(Date)) } + attr_reader :rebuild_from + + sig { params(rebuild_from: Date).void } + attr_writer :rebuild_from + + # Configuration for building loan tapes + sig do + params( + rebuild_needed: T::Boolean, + last_rebuild: Date, + rebuild_from: Date + ).returns(T.attached_class) + end + def self.new( + # Whether the account's loan tapes need to be rebuilt or not + rebuild_needed:, + # The date for which the account's loan tapes were last rebuilt + last_rebuild: nil, + # Date from which to start rebuilding from if the account requires a rebuild + rebuild_from: nil + ) + end + + sig do + override.returns( + { + rebuild_needed: T::Boolean, + last_rebuild: Date, + rebuild_from: Date + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/financial_accounts/loan_tape_retrieve_params.rbi b/rbi/lithic/models/financial_accounts/loan_tape_retrieve_params.rbi new file mode 100644 index 00000000..8f70fedb --- /dev/null +++ b/rbi/lithic/models/financial_accounts/loan_tape_retrieve_params.rbi @@ -0,0 +1,56 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class LoanTapeRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::LoanTapeRetrieveParams, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for financial account. + sig { returns(String) } + attr_accessor :financial_account_token + + # Globally unique identifier for loan tape. + sig { returns(String) } + attr_accessor :loan_tape_token + + sig do + params( + financial_account_token: String, + loan_tape_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for financial account. + financial_account_token:, + # Globally unique identifier for loan tape. + loan_tape_token:, + request_options: {} + ) + end + + sig do + override.returns( + { + financial_account_token: String, + loan_tape_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/financial_accounts/statement.rbi b/rbi/lithic/models/financial_accounts/statement.rbi new file mode 100644 index 00000000..049260ad --- /dev/null +++ b/rbi/lithic/models/financial_accounts/statement.rbi @@ -0,0 +1,859 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class Statement < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::Statement, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for a statement + sig { returns(String) } + attr_accessor :token + + sig { returns(Lithic::FinancialAccounts::Statement::AccountStanding) } + attr_reader :account_standing + + sig do + params( + account_standing: + Lithic::FinancialAccounts::Statement::AccountStanding::OrHash + ).void + end + attr_writer :account_standing + + sig { returns(Lithic::FinancialAccounts::Statement::AmountDue) } + attr_reader :amount_due + + sig do + params( + amount_due: Lithic::FinancialAccounts::Statement::AmountDue::OrHash + ).void + end + attr_writer :amount_due + + # Amount of credit available to spend in cents + sig { returns(Integer) } + attr_accessor :available_credit + + # Timestamp of when the statement was created + sig { returns(Time) } + attr_accessor :created + + # This is the maximum credit balance extended by the lender in cents + sig { returns(Integer) } + attr_accessor :credit_limit + + # Globally unique identifier for a credit product + sig { returns(T.nilable(String)) } + attr_accessor :credit_product_token + + # Number of days in the billing cycle + sig { returns(Integer) } + attr_accessor :days_in_billing_cycle + + # Balance at the end of the billing period. For charge cards, this should be the + # same at the statement amount due in cents + sig { returns(Integer) } + attr_accessor :ending_balance + + # Globally unique identifier for a financial account + sig { returns(String) } + attr_accessor :financial_account_token + + # Date when the payment is due + sig { returns(T.nilable(Date)) } + attr_accessor :payment_due_date + + sig { returns(Lithic::StatementTotals) } + attr_reader :period_totals + + sig { params(period_totals: Lithic::StatementTotals::OrHash).void } + attr_writer :period_totals + + # Balance at the start of the billing period + sig { returns(Integer) } + attr_accessor :starting_balance + + # Date when the billing period ended + sig { returns(Date) } + attr_accessor :statement_end_date + + # Date when the billing period began + sig { returns(Date) } + attr_accessor :statement_start_date + + sig do + returns( + Lithic::FinancialAccounts::Statement::StatementType::TaggedSymbol + ) + end + attr_accessor :statement_type + + # Timestamp of when the statement was updated + sig { returns(Time) } + attr_accessor :updated + + sig { returns(Lithic::StatementTotals) } + attr_reader :ytd_totals + + sig { params(ytd_totals: Lithic::StatementTotals::OrHash).void } + attr_writer :ytd_totals + + sig do + returns( + T.nilable(Lithic::FinancialAccounts::Statement::InterestDetails) + ) + end + attr_reader :interest_details + + sig do + params( + interest_details: + T.nilable( + Lithic::FinancialAccounts::Statement::InterestDetails::OrHash + ) + ).void + end + attr_writer :interest_details + + # Date when the next payment is due + sig { returns(T.nilable(Date)) } + attr_accessor :next_payment_due_date + + # Date when the next billing period will end + sig { returns(T.nilable(Date)) } + attr_accessor :next_statement_end_date + + # Details on number and size of payments to pay off balance + sig do + returns( + T.nilable(Lithic::FinancialAccounts::Statement::PayoffDetails) + ) + end + attr_reader :payoff_details + + sig do + params( + payoff_details: + T.nilable( + Lithic::FinancialAccounts::Statement::PayoffDetails::OrHash + ) + ).void + end + attr_writer :payoff_details + + sig { returns(T.nilable(Lithic::StatementTotals)) } + attr_reader :statement_totals + + sig { params(statement_totals: Lithic::StatementTotals::OrHash).void } + attr_writer :statement_totals + + sig do + params( + token: String, + account_standing: + Lithic::FinancialAccounts::Statement::AccountStanding::OrHash, + amount_due: Lithic::FinancialAccounts::Statement::AmountDue::OrHash, + available_credit: Integer, + created: Time, + credit_limit: Integer, + credit_product_token: T.nilable(String), + days_in_billing_cycle: Integer, + ending_balance: Integer, + financial_account_token: String, + payment_due_date: T.nilable(Date), + period_totals: Lithic::StatementTotals::OrHash, + starting_balance: Integer, + statement_end_date: Date, + statement_start_date: Date, + statement_type: + Lithic::FinancialAccounts::Statement::StatementType::OrSymbol, + updated: Time, + ytd_totals: Lithic::StatementTotals::OrHash, + interest_details: + T.nilable( + Lithic::FinancialAccounts::Statement::InterestDetails::OrHash + ), + next_payment_due_date: T.nilable(Date), + next_statement_end_date: T.nilable(Date), + payoff_details: + T.nilable( + Lithic::FinancialAccounts::Statement::PayoffDetails::OrHash + ), + statement_totals: Lithic::StatementTotals::OrHash + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for a statement + token:, + account_standing:, + amount_due:, + # Amount of credit available to spend in cents + available_credit:, + # Timestamp of when the statement was created + created:, + # This is the maximum credit balance extended by the lender in cents + credit_limit:, + # Globally unique identifier for a credit product + credit_product_token:, + # Number of days in the billing cycle + days_in_billing_cycle:, + # Balance at the end of the billing period. For charge cards, this should be the + # same at the statement amount due in cents + ending_balance:, + # Globally unique identifier for a financial account + financial_account_token:, + # Date when the payment is due + payment_due_date:, + period_totals:, + # Balance at the start of the billing period + starting_balance:, + # Date when the billing period ended + statement_end_date:, + # Date when the billing period began + statement_start_date:, + statement_type:, + # Timestamp of when the statement was updated + updated:, + ytd_totals:, + interest_details: nil, + # Date when the next payment is due + next_payment_due_date: nil, + # Date when the next billing period will end + next_statement_end_date: nil, + # Details on number and size of payments to pay off balance + payoff_details: nil, + statement_totals: nil + ) + end + + sig do + override.returns( + { + token: String, + account_standing: + Lithic::FinancialAccounts::Statement::AccountStanding, + amount_due: Lithic::FinancialAccounts::Statement::AmountDue, + available_credit: Integer, + created: Time, + credit_limit: Integer, + credit_product_token: T.nilable(String), + days_in_billing_cycle: Integer, + ending_balance: Integer, + financial_account_token: String, + payment_due_date: T.nilable(Date), + period_totals: Lithic::StatementTotals, + starting_balance: Integer, + statement_end_date: Date, + statement_start_date: Date, + statement_type: + Lithic::FinancialAccounts::Statement::StatementType::TaggedSymbol, + updated: Time, + ytd_totals: Lithic::StatementTotals, + interest_details: + T.nilable( + Lithic::FinancialAccounts::Statement::InterestDetails + ), + next_payment_due_date: T.nilable(Date), + next_statement_end_date: T.nilable(Date), + payoff_details: + T.nilable(Lithic::FinancialAccounts::Statement::PayoffDetails), + statement_totals: Lithic::StatementTotals + } + ) + end + def to_hash + end + + class AccountStanding < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::Statement::AccountStanding, + Lithic::Internal::AnyHash + ) + end + + # Number of consecutive full payments made + sig { returns(Integer) } + attr_accessor :consecutive_full_payments_made + + # Number of consecutive minimum payments made + sig { returns(Integer) } + attr_accessor :consecutive_minimum_payments_made + + # Number of consecutive minimum payments missed + sig { returns(Integer) } + attr_accessor :consecutive_minimum_payments_missed + + # Number of days past due + sig { returns(Integer) } + attr_accessor :days_past_due + + # Information about the financial account state + sig do + returns( + Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState + ) + end + attr_reader :financial_account_state + + sig do + params( + financial_account_state: + Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::OrHash + ).void + end + attr_writer :financial_account_state + + # Whether the account currently has grace or not + sig { returns(T::Boolean) } + attr_accessor :has_grace + + # Current overall period number + sig { returns(Integer) } + attr_accessor :period_number + + sig do + returns( + Lithic::FinancialAccounts::Statement::AccountStanding::PeriodState::TaggedSymbol + ) + end + attr_accessor :period_state + + sig do + params( + consecutive_full_payments_made: Integer, + consecutive_minimum_payments_made: Integer, + consecutive_minimum_payments_missed: Integer, + days_past_due: Integer, + financial_account_state: + Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::OrHash, + has_grace: T::Boolean, + period_number: Integer, + period_state: + Lithic::FinancialAccounts::Statement::AccountStanding::PeriodState::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Number of consecutive full payments made + consecutive_full_payments_made:, + # Number of consecutive minimum payments made + consecutive_minimum_payments_made:, + # Number of consecutive minimum payments missed + consecutive_minimum_payments_missed:, + # Number of days past due + days_past_due:, + # Information about the financial account state + financial_account_state:, + # Whether the account currently has grace or not + has_grace:, + # Current overall period number + period_number:, + period_state: + ) + end + + sig do + override.returns( + { + consecutive_full_payments_made: Integer, + consecutive_minimum_payments_made: Integer, + consecutive_minimum_payments_missed: Integer, + days_past_due: Integer, + financial_account_state: + Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState, + has_grace: T::Boolean, + period_number: Integer, + period_state: + Lithic::FinancialAccounts::Statement::AccountStanding::PeriodState::TaggedSymbol + } + ) + end + def to_hash + end + + class FinancialAccountState < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState, + Lithic::Internal::AnyHash + ) + end + + # Status of the financial account + sig do + returns( + Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Status::TaggedSymbol + ) + end + attr_accessor :status + + # Substatus for the financial account + sig do + returns( + T.nilable( + Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Substatus::TaggedSymbol + ) + ) + end + attr_accessor :substatus + + # Information about the financial account state + sig do + params( + status: + Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Status::OrSymbol, + substatus: + T.nilable( + Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Substatus::OrSymbol + ) + ).returns(T.attached_class) + end + def self.new( + # Status of the financial account + status:, + # Substatus for the financial account + substatus: nil + ) + end + + sig do + override.returns( + { + status: + Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Status::TaggedSymbol, + substatus: + T.nilable( + Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Substatus::TaggedSymbol + ) + } + ) + end + def to_hash + end + + # Status of the financial account + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + OPEN = + T.let( + :OPEN, + Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Status::TaggedSymbol + ) + CLOSED = + T.let( + :CLOSED, + Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Status::TaggedSymbol + ) + SUSPENDED = + T.let( + :SUSPENDED, + Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Status::TaggedSymbol + ) + PENDING = + T.let( + :PENDING, + Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Substatus for the financial account + module Substatus + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Substatus + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHARGED_OFF_DELINQUENT = + T.let( + :CHARGED_OFF_DELINQUENT, + Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Substatus::TaggedSymbol + ) + CHARGED_OFF_FRAUD = + T.let( + :CHARGED_OFF_FRAUD, + Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Substatus::TaggedSymbol + ) + END_USER_REQUEST = + T.let( + :END_USER_REQUEST, + Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Substatus::TaggedSymbol + ) + BANK_REQUEST = + T.let( + :BANK_REQUEST, + Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Substatus::TaggedSymbol + ) + DELINQUENT = + T.let( + :DELINQUENT, + Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Substatus::TaggedSymbol + ) + INTEREST_AND_FEES_PAUSED = + T.let( + :INTEREST_AND_FEES_PAUSED, + Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Substatus::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::Substatus::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module PeriodState + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::FinancialAccounts::Statement::AccountStanding::PeriodState + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + STANDARD = + T.let( + :STANDARD, + Lithic::FinancialAccounts::Statement::AccountStanding::PeriodState::TaggedSymbol + ) + PROMO = + T.let( + :PROMO, + Lithic::FinancialAccounts::Statement::AccountStanding::PeriodState::TaggedSymbol + ) + PENALTY = + T.let( + :PENALTY, + Lithic::FinancialAccounts::Statement::AccountStanding::PeriodState::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::FinancialAccounts::Statement::AccountStanding::PeriodState::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class AmountDue < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::Statement::AmountDue, + Lithic::Internal::AnyHash + ) + end + + # Payment due at the end of the billing period in cents. Negative amount indicates + # something is owed. If the amount owed is positive there was a net credit. If + # auto-collections are enabled this is the amount that will be requested on the + # payment due date + sig { returns(Integer) } + attr_accessor :amount + + # Amount past due for statement in cents + sig { returns(Integer) } + attr_accessor :past_due + + sig do + params(amount: Integer, past_due: Integer).returns(T.attached_class) + end + def self.new( + # Payment due at the end of the billing period in cents. Negative amount indicates + # something is owed. If the amount owed is positive there was a net credit. If + # auto-collections are enabled this is the amount that will be requested on the + # payment due date + amount:, + # Amount past due for statement in cents + past_due: + ) + end + + sig { override.returns({ amount: Integer, past_due: Integer }) } + def to_hash + end + end + + module StatementType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::FinancialAccounts::Statement::StatementType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INITIAL = + T.let( + :INITIAL, + Lithic::FinancialAccounts::Statement::StatementType::TaggedSymbol + ) + PERIOD_END = + T.let( + :PERIOD_END, + Lithic::FinancialAccounts::Statement::StatementType::TaggedSymbol + ) + FINAL = + T.let( + :FINAL, + Lithic::FinancialAccounts::Statement::StatementType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::FinancialAccounts::Statement::StatementType::TaggedSymbol + ] + ) + end + def self.values + end + end + + class InterestDetails < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::Statement::InterestDetails, + Lithic::Internal::AnyHash + ) + end + + sig { returns(T.nilable(Integer)) } + attr_accessor :actual_interest_charged + + sig { returns(Lithic::CategoryDetails) } + attr_reader :daily_balance_amounts + + sig do + params(daily_balance_amounts: Lithic::CategoryDetails::OrHash).void + end + attr_writer :daily_balance_amounts + + sig { returns(Lithic::CategoryDetails) } + attr_reader :effective_apr + + sig { params(effective_apr: Lithic::CategoryDetails::OrHash).void } + attr_writer :effective_apr + + sig do + returns( + Lithic::FinancialAccounts::Statement::InterestDetails::InterestCalculationMethod::TaggedSymbol + ) + end + attr_accessor :interest_calculation_method + + sig { returns(Lithic::CategoryDetails) } + attr_reader :interest_for_period + + sig do + params(interest_for_period: Lithic::CategoryDetails::OrHash).void + end + attr_writer :interest_for_period + + sig { returns(T.nilable(String)) } + attr_accessor :prime_rate + + sig { returns(T.nilable(Integer)) } + attr_accessor :minimum_interest_charged + + sig do + params( + actual_interest_charged: T.nilable(Integer), + daily_balance_amounts: Lithic::CategoryDetails::OrHash, + effective_apr: Lithic::CategoryDetails::OrHash, + interest_calculation_method: + Lithic::FinancialAccounts::Statement::InterestDetails::InterestCalculationMethod::OrSymbol, + interest_for_period: Lithic::CategoryDetails::OrHash, + prime_rate: T.nilable(String), + minimum_interest_charged: T.nilable(Integer) + ).returns(T.attached_class) + end + def self.new( + actual_interest_charged:, + daily_balance_amounts:, + effective_apr:, + interest_calculation_method:, + interest_for_period:, + prime_rate:, + minimum_interest_charged: nil + ) + end + + sig do + override.returns( + { + actual_interest_charged: T.nilable(Integer), + daily_balance_amounts: Lithic::CategoryDetails, + effective_apr: Lithic::CategoryDetails, + interest_calculation_method: + Lithic::FinancialAccounts::Statement::InterestDetails::InterestCalculationMethod::TaggedSymbol, + interest_for_period: Lithic::CategoryDetails, + prime_rate: T.nilable(String), + minimum_interest_charged: T.nilable(Integer) + } + ) + end + def to_hash + end + + module InterestCalculationMethod + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::FinancialAccounts::Statement::InterestDetails::InterestCalculationMethod + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DAILY = + T.let( + :DAILY, + Lithic::FinancialAccounts::Statement::InterestDetails::InterestCalculationMethod::TaggedSymbol + ) + AVERAGE_DAILY = + T.let( + :AVERAGE_DAILY, + Lithic::FinancialAccounts::Statement::InterestDetails::InterestCalculationMethod::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::FinancialAccounts::Statement::InterestDetails::InterestCalculationMethod::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class PayoffDetails < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::Statement::PayoffDetails, + Lithic::Internal::AnyHash + ) + end + + # The number of months it would take to pay off the balance in full by only paying + # the minimum payment. "NA" will signal negative or zero amortization + sig { returns(String) } + attr_accessor :minimum_payment_months + + # The sum of all interest and principal paid, in cents, when only paying minimum + # monthly payment. "NA" will signal negative or zero amortization + sig { returns(String) } + attr_accessor :minimum_payment_total + + # Number of months to full pay off + sig { returns(T.nilable(Integer)) } + attr_accessor :payoff_period_length_months + + # The amount needed to be paid, in cents, each month in order to pay off current + # balance in the payoff period + sig { returns(T.nilable(Integer)) } + attr_accessor :payoff_period_monthly_payment_amount + + # The sum of all interest and principal paid, in cents, when paying off in the + # payoff period + sig { returns(T.nilable(Integer)) } + attr_accessor :payoff_period_payment_total + + # Details on number and size of payments to pay off balance + sig do + params( + minimum_payment_months: String, + minimum_payment_total: String, + payoff_period_length_months: T.nilable(Integer), + payoff_period_monthly_payment_amount: T.nilable(Integer), + payoff_period_payment_total: T.nilable(Integer) + ).returns(T.attached_class) + end + def self.new( + # The number of months it would take to pay off the balance in full by only paying + # the minimum payment. "NA" will signal negative or zero amortization + minimum_payment_months:, + # The sum of all interest and principal paid, in cents, when only paying minimum + # monthly payment. "NA" will signal negative or zero amortization + minimum_payment_total:, + # Number of months to full pay off + payoff_period_length_months:, + # The amount needed to be paid, in cents, each month in order to pay off current + # balance in the payoff period + payoff_period_monthly_payment_amount:, + # The sum of all interest and principal paid, in cents, when paying off in the + # payoff period + payoff_period_payment_total: + ) + end + + sig do + override.returns( + { + minimum_payment_months: String, + minimum_payment_total: String, + payoff_period_length_months: T.nilable(Integer), + payoff_period_monthly_payment_amount: T.nilable(Integer), + payoff_period_payment_total: T.nilable(Integer) + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/lithic/models/financial_accounts/statement_list_params.rbi b/rbi/lithic/models/financial_accounts/statement_list_params.rbi new file mode 100644 index 00000000..708d8eda --- /dev/null +++ b/rbi/lithic/models/financial_accounts/statement_list_params.rbi @@ -0,0 +1,122 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class StatementListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::StatementListParams, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for financial account. + sig { returns(String) } + attr_accessor :financial_account_token + + # Date string in RFC 3339 format. Only entries created after the specified date + # will be included. + sig { returns(T.nilable(Date)) } + attr_reader :begin_ + + sig { params(begin_: Date).void } + attr_writer :begin_ + + # Date string in RFC 3339 format. Only entries created before the specified date + # will be included. + sig { returns(T.nilable(Date)) } + attr_reader :end_ + + sig { params(end_: Date).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Whether to include the initial statement. It is not included by default. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :include_initial_statements + + sig { params(include_initial_statements: T::Boolean).void } + attr_writer :include_initial_statements + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + financial_account_token: String, + begin_: Date, + end_: Date, + ending_before: String, + include_initial_statements: T::Boolean, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for financial account. + financial_account_token:, + # Date string in RFC 3339 format. Only entries created after the specified date + # will be included. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified date + # will be included. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Whether to include the initial statement. It is not included by default. + include_initial_statements: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + financial_account_token: String, + begin_: Date, + end_: Date, + ending_before: String, + include_initial_statements: T::Boolean, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/financial_accounts/statement_retrieve_params.rbi b/rbi/lithic/models/financial_accounts/statement_retrieve_params.rbi new file mode 100644 index 00000000..c28a95be --- /dev/null +++ b/rbi/lithic/models/financial_accounts/statement_retrieve_params.rbi @@ -0,0 +1,56 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class StatementRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::StatementRetrieveParams, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for financial account. + sig { returns(String) } + attr_accessor :financial_account_token + + # Globally unique identifier for statements. + sig { returns(String) } + attr_accessor :statement_token + + sig do + params( + financial_account_token: String, + statement_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for financial account. + financial_account_token:, + # Globally unique identifier for statements. + statement_token:, + request_options: {} + ) + end + + sig do + override.returns( + { + financial_account_token: String, + statement_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/financial_accounts/statements.rbi b/rbi/lithic/models/financial_accounts/statements.rbi new file mode 100644 index 00000000..3c74151a --- /dev/null +++ b/rbi/lithic/models/financial_accounts/statements.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + class FinancialAccountsStatements < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::FinancialAccountsStatements, + Lithic::Internal::AnyHash + ) + end + + sig { returns(T::Array[Lithic::FinancialAccounts::Statement]) } + attr_accessor :data + + sig { returns(T::Boolean) } + attr_accessor :has_more + + sig do + params( + data: T::Array[Lithic::FinancialAccounts::Statement::OrHash], + has_more: T::Boolean + ).returns(T.attached_class) + end + def self.new(data:, has_more:) + end + + sig do + override.returns( + { + data: T::Array[Lithic::FinancialAccounts::Statement], + has_more: T::Boolean + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/financial_accounts/statements/line_item_list_params.rbi b/rbi/lithic/models/financial_accounts/statements/line_item_list_params.rbi new file mode 100644 index 00000000..2f99c0d7 --- /dev/null +++ b/rbi/lithic/models/financial_accounts/statements/line_item_list_params.rbi @@ -0,0 +1,95 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + module Statements + class LineItemListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::Statements::LineItemListParams, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for financial account. + sig { returns(String) } + attr_accessor :financial_account_token + + # Globally unique identifier for statements. + sig { returns(String) } + attr_accessor :statement_token + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + financial_account_token: String, + statement_token: String, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for financial account. + financial_account_token:, + # Globally unique identifier for statements. + statement_token:, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + financial_account_token: String, + statement_token: String, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/lithic/models/financial_accounts/statements/statement_line_items.rbi b/rbi/lithic/models/financial_accounts/statements/statement_line_items.rbi new file mode 100644 index 00000000..eedb1ad4 --- /dev/null +++ b/rbi/lithic/models/financial_accounts/statements/statement_line_items.rbi @@ -0,0 +1,816 @@ +# typed: strong + +module Lithic + module Models + module FinancialAccounts + StatementLineItems = Statements::StatementLineItems + + module Statements + class StatementLineItems < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::Statements::StatementLineItems, + Lithic::Internal::AnyHash + ) + end + + sig do + returns( + T::Array[ + Lithic::FinancialAccounts::Statements::StatementLineItems::Data + ] + ) + end + attr_accessor :data + + sig { returns(T::Boolean) } + attr_accessor :has_more + + sig do + params( + data: + T::Array[ + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::OrHash + ], + has_more: T::Boolean + ).returns(T.attached_class) + end + def self.new(data:, has_more:) + end + + sig do + override.returns( + { + data: + T::Array[ + Lithic::FinancialAccounts::Statements::StatementLineItems::Data + ], + has_more: T::Boolean + } + ) + end + def to_hash + end + + class Data < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::FinancialAccounts::Statements::StatementLineItems::Data, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for a Statement Line Item + sig { returns(String) } + attr_accessor :token + + # Transaction amount in cents + sig { returns(Integer) } + attr_accessor :amount + + # Note: Inbound wire transfers are coming soon (availability varies by partner + # bank). The WIRE category is a preview. To learn more, contact your customer + # success manager. + sig do + returns( + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + end + attr_accessor :category + + # Timestamp of when the line item was generated + sig { returns(Time) } + attr_accessor :created + + # 3-character alphabetic ISO 4217 code for the settling currency of the + # transaction + sig { returns(String) } + attr_accessor :currency + + # Date that the transaction effected the account balance + sig { returns(Date) } + attr_accessor :effective_date + + sig do + returns( + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + end + attr_accessor :event_type + + # Globally unique identifier for a financial account + sig { returns(String) } + attr_accessor :financial_account_token + + # Globally unique identifier for a financial transaction event + sig { returns(String) } + attr_accessor :financial_transaction_event_token + + # Globally unique identifier for a financial transaction + sig { returns(String) } + attr_accessor :financial_transaction_token + + # Globally unique identifier for a card + sig { returns(T.nilable(String)) } + attr_accessor :card_token + + sig { returns(T.nilable(String)) } + attr_reader :descriptor + + sig { params(descriptor: String).void } + attr_writer :descriptor + + # Subtype of the event that generated the line items + sig { returns(T.nilable(String)) } + attr_accessor :event_subtype + + # Date of the loan tape that generated this line item + sig { returns(T.nilable(Date)) } + attr_accessor :loan_tape_date + + sig do + params( + token: String, + amount: Integer, + category: + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category::OrSymbol, + created: Time, + currency: String, + effective_date: Date, + event_type: + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::OrSymbol, + financial_account_token: String, + financial_transaction_event_token: String, + financial_transaction_token: String, + card_token: T.nilable(String), + descriptor: String, + event_subtype: T.nilable(String), + loan_tape_date: T.nilable(Date) + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for a Statement Line Item + token:, + # Transaction amount in cents + amount:, + # Note: Inbound wire transfers are coming soon (availability varies by partner + # bank). The WIRE category is a preview. To learn more, contact your customer + # success manager. + category:, + # Timestamp of when the line item was generated + created:, + # 3-character alphabetic ISO 4217 code for the settling currency of the + # transaction + currency:, + # Date that the transaction effected the account balance + effective_date:, + event_type:, + # Globally unique identifier for a financial account + financial_account_token:, + # Globally unique identifier for a financial transaction event + financial_transaction_event_token:, + # Globally unique identifier for a financial transaction + financial_transaction_token:, + # Globally unique identifier for a card + card_token: nil, + descriptor: nil, + # Subtype of the event that generated the line items + event_subtype: nil, + # Date of the loan tape that generated this line item + loan_tape_date: nil + ) + end + + sig do + override.returns( + { + token: String, + amount: Integer, + category: + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol, + created: Time, + currency: String, + effective_date: Date, + event_type: + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol, + financial_account_token: String, + financial_transaction_event_token: String, + financial_transaction_token: String, + card_token: T.nilable(String), + descriptor: String, + event_subtype: T.nilable(String), + loan_tape_date: T.nilable(Date) + } + ) + end + def to_hash + end + + # Note: Inbound wire transfers are coming soon (availability varies by partner + # bank). The WIRE category is a preview. To learn more, contact your customer + # success manager. + module Category + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACH = + T.let( + :ACH, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + WIRE = + T.let( + :WIRE, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + BALANCE_OR_FUNDING = + T.let( + :BALANCE_OR_FUNDING, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + FEE = + T.let( + :FEE, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + REWARD = + T.let( + :REWARD, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + ADJUSTMENT = + T.let( + :ADJUSTMENT, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + DERECOGNITION = + T.let( + :DERECOGNITION, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + DISPUTE = + T.let( + :DISPUTE, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + CARD = + T.let( + :CARD, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + EXTERNAL_ACH = + T.let( + :EXTERNAL_ACH, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + EXTERNAL_CHECK = + T.let( + :EXTERNAL_CHECK, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + EXTERNAL_FEDNOW = + T.let( + :EXTERNAL_FEDNOW, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + EXTERNAL_RTP = + T.let( + :EXTERNAL_RTP, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + EXTERNAL_TRANSFER = + T.let( + :EXTERNAL_TRANSFER, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + EXTERNAL_WIRE = + T.let( + :EXTERNAL_WIRE, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + MANAGEMENT_ADJUSTMENT = + T.let( + :MANAGEMENT_ADJUSTMENT, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + MANAGEMENT_DISPUTE = + T.let( + :MANAGEMENT_DISPUTE, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + MANAGEMENT_FEE = + T.let( + :MANAGEMENT_FEE, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + MANAGEMENT_REWARD = + T.let( + :MANAGEMENT_REWARD, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + MANAGEMENT_DISBURSEMENT = + T.let( + :MANAGEMENT_DISBURSEMENT, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + HOLD = + T.let( + :HOLD, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + PROGRAM_FUNDING = + T.let( + :PROGRAM_FUNDING, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category::TaggedSymbol + ] + ) + end + def self.values + end + end + + module EventType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACH_ORIGINATION_CANCELLED = + T.let( + :ACH_ORIGINATION_CANCELLED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + ACH_ORIGINATION_INITIATED = + T.let( + :ACH_ORIGINATION_INITIATED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + ACH_ORIGINATION_PROCESSED = + T.let( + :ACH_ORIGINATION_PROCESSED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + ACH_ORIGINATION_RELEASED = + T.let( + :ACH_ORIGINATION_RELEASED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + ACH_ORIGINATION_REJECTED = + T.let( + :ACH_ORIGINATION_REJECTED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + ACH_ORIGINATION_REVIEWED = + T.let( + :ACH_ORIGINATION_REVIEWED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + ACH_ORIGINATION_SETTLED = + T.let( + :ACH_ORIGINATION_SETTLED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + ACH_RECEIPT_PROCESSED = + T.let( + :ACH_RECEIPT_PROCESSED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + ACH_RECEIPT_RELEASED = + T.let( + :ACH_RECEIPT_RELEASED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + ACH_RECEIPT_SETTLED = + T.let( + :ACH_RECEIPT_SETTLED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + ACH_RETURN_INITIATED = + T.let( + :ACH_RETURN_INITIATED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + ACH_RETURN_PROCESSED = + T.let( + :ACH_RETURN_PROCESSED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + ACH_RETURN_REJECTED = + T.let( + :ACH_RETURN_REJECTED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + ACH_RETURN_SETTLED = + T.let( + :ACH_RETURN_SETTLED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + AUTHORIZATION = + T.let( + :AUTHORIZATION, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + AUTHORIZATION_ADVICE = + T.let( + :AUTHORIZATION_ADVICE, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + AUTHORIZATION_EXPIRY = + T.let( + :AUTHORIZATION_EXPIRY, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + AUTHORIZATION_REVERSAL = + T.let( + :AUTHORIZATION_REVERSAL, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + BALANCE_INQUIRY = + T.let( + :BALANCE_INQUIRY, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + BILLING_ERROR = + T.let( + :BILLING_ERROR, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + BILLING_ERROR_REVERSAL = + T.let( + :BILLING_ERROR_REVERSAL, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + CARD_TO_CARD = + T.let( + :CARD_TO_CARD, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + CASH_BACK = + T.let( + :CASH_BACK, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + CASH_BACK_REVERSAL = + T.let( + :CASH_BACK_REVERSAL, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + CLEARING = + T.let( + :CLEARING, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + COLLECTION = + T.let( + :COLLECTION, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + CORRECTION_CREDIT = + T.let( + :CORRECTION_CREDIT, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + CORRECTION_DEBIT = + T.let( + :CORRECTION_DEBIT, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + CREDIT_AUTHORIZATION = + T.let( + :CREDIT_AUTHORIZATION, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + CREDIT_AUTHORIZATION_ADVICE = + T.let( + :CREDIT_AUTHORIZATION_ADVICE, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + CURRENCY_CONVERSION = + T.let( + :CURRENCY_CONVERSION, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + CURRENCY_CONVERSION_REVERSAL = + T.let( + :CURRENCY_CONVERSION_REVERSAL, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + DISPUTE_WON = + T.let( + :DISPUTE_WON, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_ACH_CANCELED = + T.let( + :EXTERNAL_ACH_CANCELED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_ACH_INITIATED = + T.let( + :EXTERNAL_ACH_INITIATED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_ACH_RELEASED = + T.let( + :EXTERNAL_ACH_RELEASED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_ACH_REVERSED = + T.let( + :EXTERNAL_ACH_REVERSED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_ACH_SETTLED = + T.let( + :EXTERNAL_ACH_SETTLED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_CHECK_CANCELED = + T.let( + :EXTERNAL_CHECK_CANCELED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_CHECK_INITIATED = + T.let( + :EXTERNAL_CHECK_INITIATED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_CHECK_RELEASED = + T.let( + :EXTERNAL_CHECK_RELEASED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_CHECK_REVERSED = + T.let( + :EXTERNAL_CHECK_REVERSED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_CHECK_SETTLED = + T.let( + :EXTERNAL_CHECK_SETTLED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_FEDNOW_CANCELED = + T.let( + :EXTERNAL_FEDNOW_CANCELED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_FEDNOW_INITIATED = + T.let( + :EXTERNAL_FEDNOW_INITIATED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_FEDNOW_RELEASED = + T.let( + :EXTERNAL_FEDNOW_RELEASED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_FEDNOW_REVERSED = + T.let( + :EXTERNAL_FEDNOW_REVERSED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_FEDNOW_SETTLED = + T.let( + :EXTERNAL_FEDNOW_SETTLED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_RTP_CANCELED = + T.let( + :EXTERNAL_RTP_CANCELED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_RTP_INITIATED = + T.let( + :EXTERNAL_RTP_INITIATED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_RTP_RELEASED = + T.let( + :EXTERNAL_RTP_RELEASED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_RTP_REVERSED = + T.let( + :EXTERNAL_RTP_REVERSED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_RTP_SETTLED = + T.let( + :EXTERNAL_RTP_SETTLED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_TRANSFER_CANCELED = + T.let( + :EXTERNAL_TRANSFER_CANCELED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_TRANSFER_INITIATED = + T.let( + :EXTERNAL_TRANSFER_INITIATED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_TRANSFER_RELEASED = + T.let( + :EXTERNAL_TRANSFER_RELEASED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_TRANSFER_REVERSED = + T.let( + :EXTERNAL_TRANSFER_REVERSED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_TRANSFER_SETTLED = + T.let( + :EXTERNAL_TRANSFER_SETTLED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_WIRE_CANCELED = + T.let( + :EXTERNAL_WIRE_CANCELED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_WIRE_INITIATED = + T.let( + :EXTERNAL_WIRE_INITIATED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_WIRE_RELEASED = + T.let( + :EXTERNAL_WIRE_RELEASED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_WIRE_REVERSED = + T.let( + :EXTERNAL_WIRE_REVERSED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + EXTERNAL_WIRE_SETTLED = + T.let( + :EXTERNAL_WIRE_SETTLED, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + FINANCIAL_AUTHORIZATION = + T.let( + :FINANCIAL_AUTHORIZATION, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + FINANCIAL_CREDIT_AUTHORIZATION = + T.let( + :FINANCIAL_CREDIT_AUTHORIZATION, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + INTEREST = + T.let( + :INTEREST, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + INTEREST_REVERSAL = + T.let( + :INTEREST_REVERSAL, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + INTERNAL_ADJUSTMENT = + T.let( + :INTERNAL_ADJUSTMENT, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + LATE_PAYMENT = + T.let( + :LATE_PAYMENT, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + LATE_PAYMENT_REVERSAL = + T.let( + :LATE_PAYMENT_REVERSAL, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + LOSS_WRITE_OFF = + T.let( + :LOSS_WRITE_OFF, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + PROVISIONAL_CREDIT = + T.let( + :PROVISIONAL_CREDIT, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + PROVISIONAL_CREDIT_REVERSAL = + T.let( + :PROVISIONAL_CREDIT_REVERSAL, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + SERVICE = + T.let( + :SERVICE, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + RETURN = + T.let( + :RETURN, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + RETURN_REVERSAL = + T.let( + :RETURN_REVERSAL, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + TRANSFER = + T.let( + :TRANSFER, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + TRANSFER_INSUFFICIENT_FUNDS = + T.let( + :TRANSFER_INSUFFICIENT_FUNDS, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + RETURNED_PAYMENT = + T.let( + :RETURNED_PAYMENT, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + RETURNED_PAYMENT_REVERSAL = + T.let( + :RETURNED_PAYMENT_REVERSAL, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + LITHIC_NETWORK_PAYMENT = + T.let( + :LITHIC_NETWORK_PAYMENT, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + ANNUAL = + T.let( + :ANNUAL, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + ANNUAL_REVERSAL = + T.let( + :ANNUAL_REVERSAL, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + QUARTERLY = + T.let( + :QUARTERLY, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + QUARTERLY_REVERSAL = + T.let( + :QUARTERLY_REVERSAL, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + MONTHLY = + T.let( + :MONTHLY, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + MONTHLY_REVERSAL = + T.let( + :MONTHLY_REVERSAL, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + ACCOUNT_TO_ACCOUNT = + T.let( + :ACCOUNT_TO_ACCOUNT, + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end + end +end diff --git a/rbi/lithic/models/financial_event.rbi b/rbi/lithic/models/financial_event.rbi new file mode 100644 index 00000000..8e66532f --- /dev/null +++ b/rbi/lithic/models/financial_event.rbi @@ -0,0 +1,471 @@ +# typed: strong + +module Lithic + module Models + class FinancialEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::FinancialEvent, Lithic::Internal::AnyHash) + end + + # Globally unique identifier. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # Amount of the financial event that has been settled in the currency's smallest + # unit (e.g., cents). + sig { returns(T.nilable(Integer)) } + attr_reader :amount + + sig { params(amount: Integer).void } + attr_writer :amount + + # Date and time when the financial event occurred. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :created + + sig { params(created: Time).void } + attr_writer :created + + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + sig { returns(T.nilable(Lithic::FinancialEvent::Result::TaggedSymbol)) } + attr_reader :result + + sig { params(result: Lithic::FinancialEvent::Result::OrSymbol).void } + attr_writer :result + + sig { returns(T.nilable(Lithic::FinancialEvent::Type::TaggedSymbol)) } + attr_reader :type + + sig { params(type: Lithic::FinancialEvent::Type::OrSymbol).void } + attr_writer :type + + # Financial Event + sig do + params( + token: String, + amount: Integer, + created: Time, + result: Lithic::FinancialEvent::Result::OrSymbol, + type: Lithic::FinancialEvent::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier. + token: nil, + # Amount of the financial event that has been settled in the currency's smallest + # unit (e.g., cents). + amount: nil, + # Date and time when the financial event occurred. UTC time zone. + created: nil, + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + result: nil, + type: nil + ) + end + + sig do + override.returns( + { + token: String, + amount: Integer, + created: Time, + result: Lithic::FinancialEvent::Result::TaggedSymbol, + type: Lithic::FinancialEvent::Type::TaggedSymbol + } + ) + end + def to_hash + end + + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::FinancialEvent::Result) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let(:APPROVED, Lithic::FinancialEvent::Result::TaggedSymbol) + DECLINED = + T.let(:DECLINED, Lithic::FinancialEvent::Result::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::FinancialEvent::Result::TaggedSymbol] + ) + end + def self.values + end + end + + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::FinancialEvent::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACH_ORIGINATION_CANCELLED = + T.let( + :ACH_ORIGINATION_CANCELLED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + ACH_ORIGINATION_INITIATED = + T.let( + :ACH_ORIGINATION_INITIATED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + ACH_ORIGINATION_PROCESSED = + T.let( + :ACH_ORIGINATION_PROCESSED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + ACH_ORIGINATION_RELEASED = + T.let( + :ACH_ORIGINATION_RELEASED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + ACH_ORIGINATION_REJECTED = + T.let( + :ACH_ORIGINATION_REJECTED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + ACH_ORIGINATION_REVIEWED = + T.let( + :ACH_ORIGINATION_REVIEWED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + ACH_ORIGINATION_SETTLED = + T.let( + :ACH_ORIGINATION_SETTLED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + ACH_RECEIPT_PROCESSED = + T.let( + :ACH_RECEIPT_PROCESSED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + ACH_RECEIPT_RELEASED = + T.let( + :ACH_RECEIPT_RELEASED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + ACH_RECEIPT_SETTLED = + T.let( + :ACH_RECEIPT_SETTLED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + ACH_RETURN_INITIATED = + T.let( + :ACH_RETURN_INITIATED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + ACH_RETURN_PROCESSED = + T.let( + :ACH_RETURN_PROCESSED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + ACH_RETURN_REJECTED = + T.let( + :ACH_RETURN_REJECTED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + ACH_RETURN_SETTLED = + T.let(:ACH_RETURN_SETTLED, Lithic::FinancialEvent::Type::TaggedSymbol) + AUTHORIZATION = + T.let(:AUTHORIZATION, Lithic::FinancialEvent::Type::TaggedSymbol) + AUTHORIZATION_ADVICE = + T.let( + :AUTHORIZATION_ADVICE, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + AUTHORIZATION_EXPIRY = + T.let( + :AUTHORIZATION_EXPIRY, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + AUTHORIZATION_REVERSAL = + T.let( + :AUTHORIZATION_REVERSAL, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + BALANCE_INQUIRY = + T.let(:BALANCE_INQUIRY, Lithic::FinancialEvent::Type::TaggedSymbol) + BILLING_ERROR = + T.let(:BILLING_ERROR, Lithic::FinancialEvent::Type::TaggedSymbol) + BILLING_ERROR_REVERSAL = + T.let( + :BILLING_ERROR_REVERSAL, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + CARD_TO_CARD = + T.let(:CARD_TO_CARD, Lithic::FinancialEvent::Type::TaggedSymbol) + CASH_BACK = + T.let(:CASH_BACK, Lithic::FinancialEvent::Type::TaggedSymbol) + CASH_BACK_REVERSAL = + T.let(:CASH_BACK_REVERSAL, Lithic::FinancialEvent::Type::TaggedSymbol) + CLEARING = T.let(:CLEARING, Lithic::FinancialEvent::Type::TaggedSymbol) + COLLECTION = + T.let(:COLLECTION, Lithic::FinancialEvent::Type::TaggedSymbol) + CORRECTION_CREDIT = + T.let(:CORRECTION_CREDIT, Lithic::FinancialEvent::Type::TaggedSymbol) + CORRECTION_DEBIT = + T.let(:CORRECTION_DEBIT, Lithic::FinancialEvent::Type::TaggedSymbol) + CREDIT_AUTHORIZATION = + T.let( + :CREDIT_AUTHORIZATION, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + CREDIT_AUTHORIZATION_ADVICE = + T.let( + :CREDIT_AUTHORIZATION_ADVICE, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + CURRENCY_CONVERSION = + T.let( + :CURRENCY_CONVERSION, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + CURRENCY_CONVERSION_REVERSAL = + T.let( + :CURRENCY_CONVERSION_REVERSAL, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + DISPUTE_WON = + T.let(:DISPUTE_WON, Lithic::FinancialEvent::Type::TaggedSymbol) + EXTERNAL_ACH_CANCELED = + T.let( + :EXTERNAL_ACH_CANCELED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + EXTERNAL_ACH_INITIATED = + T.let( + :EXTERNAL_ACH_INITIATED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + EXTERNAL_ACH_RELEASED = + T.let( + :EXTERNAL_ACH_RELEASED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + EXTERNAL_ACH_REVERSED = + T.let( + :EXTERNAL_ACH_REVERSED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + EXTERNAL_ACH_SETTLED = + T.let( + :EXTERNAL_ACH_SETTLED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + EXTERNAL_CHECK_CANCELED = + T.let( + :EXTERNAL_CHECK_CANCELED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + EXTERNAL_CHECK_INITIATED = + T.let( + :EXTERNAL_CHECK_INITIATED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + EXTERNAL_CHECK_RELEASED = + T.let( + :EXTERNAL_CHECK_RELEASED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + EXTERNAL_CHECK_REVERSED = + T.let( + :EXTERNAL_CHECK_REVERSED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + EXTERNAL_CHECK_SETTLED = + T.let( + :EXTERNAL_CHECK_SETTLED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + EXTERNAL_FEDNOW_CANCELED = + T.let( + :EXTERNAL_FEDNOW_CANCELED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + EXTERNAL_FEDNOW_INITIATED = + T.let( + :EXTERNAL_FEDNOW_INITIATED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + EXTERNAL_FEDNOW_RELEASED = + T.let( + :EXTERNAL_FEDNOW_RELEASED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + EXTERNAL_FEDNOW_REVERSED = + T.let( + :EXTERNAL_FEDNOW_REVERSED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + EXTERNAL_FEDNOW_SETTLED = + T.let( + :EXTERNAL_FEDNOW_SETTLED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + EXTERNAL_RTP_CANCELED = + T.let( + :EXTERNAL_RTP_CANCELED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + EXTERNAL_RTP_INITIATED = + T.let( + :EXTERNAL_RTP_INITIATED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + EXTERNAL_RTP_RELEASED = + T.let( + :EXTERNAL_RTP_RELEASED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + EXTERNAL_RTP_REVERSED = + T.let( + :EXTERNAL_RTP_REVERSED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + EXTERNAL_RTP_SETTLED = + T.let( + :EXTERNAL_RTP_SETTLED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + EXTERNAL_TRANSFER_CANCELED = + T.let( + :EXTERNAL_TRANSFER_CANCELED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + EXTERNAL_TRANSFER_INITIATED = + T.let( + :EXTERNAL_TRANSFER_INITIATED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + EXTERNAL_TRANSFER_RELEASED = + T.let( + :EXTERNAL_TRANSFER_RELEASED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + EXTERNAL_TRANSFER_REVERSED = + T.let( + :EXTERNAL_TRANSFER_REVERSED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + EXTERNAL_TRANSFER_SETTLED = + T.let( + :EXTERNAL_TRANSFER_SETTLED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + EXTERNAL_WIRE_CANCELED = + T.let( + :EXTERNAL_WIRE_CANCELED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + EXTERNAL_WIRE_INITIATED = + T.let( + :EXTERNAL_WIRE_INITIATED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + EXTERNAL_WIRE_RELEASED = + T.let( + :EXTERNAL_WIRE_RELEASED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + EXTERNAL_WIRE_REVERSED = + T.let( + :EXTERNAL_WIRE_REVERSED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + EXTERNAL_WIRE_SETTLED = + T.let( + :EXTERNAL_WIRE_SETTLED, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + FINANCIAL_AUTHORIZATION = + T.let( + :FINANCIAL_AUTHORIZATION, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + FINANCIAL_CREDIT_AUTHORIZATION = + T.let( + :FINANCIAL_CREDIT_AUTHORIZATION, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + INTEREST = T.let(:INTEREST, Lithic::FinancialEvent::Type::TaggedSymbol) + INTEREST_REVERSAL = + T.let(:INTEREST_REVERSAL, Lithic::FinancialEvent::Type::TaggedSymbol) + INTERNAL_ADJUSTMENT = + T.let( + :INTERNAL_ADJUSTMENT, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + LATE_PAYMENT = + T.let(:LATE_PAYMENT, Lithic::FinancialEvent::Type::TaggedSymbol) + LATE_PAYMENT_REVERSAL = + T.let( + :LATE_PAYMENT_REVERSAL, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + LOSS_WRITE_OFF = + T.let(:LOSS_WRITE_OFF, Lithic::FinancialEvent::Type::TaggedSymbol) + PROVISIONAL_CREDIT = + T.let(:PROVISIONAL_CREDIT, Lithic::FinancialEvent::Type::TaggedSymbol) + PROVISIONAL_CREDIT_REVERSAL = + T.let( + :PROVISIONAL_CREDIT_REVERSAL, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + SERVICE = T.let(:SERVICE, Lithic::FinancialEvent::Type::TaggedSymbol) + RETURN = T.let(:RETURN, Lithic::FinancialEvent::Type::TaggedSymbol) + RETURN_REVERSAL = + T.let(:RETURN_REVERSAL, Lithic::FinancialEvent::Type::TaggedSymbol) + TRANSFER = T.let(:TRANSFER, Lithic::FinancialEvent::Type::TaggedSymbol) + TRANSFER_INSUFFICIENT_FUNDS = + T.let( + :TRANSFER_INSUFFICIENT_FUNDS, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + RETURNED_PAYMENT = + T.let(:RETURNED_PAYMENT, Lithic::FinancialEvent::Type::TaggedSymbol) + RETURNED_PAYMENT_REVERSAL = + T.let( + :RETURNED_PAYMENT_REVERSAL, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + LITHIC_NETWORK_PAYMENT = + T.let( + :LITHIC_NETWORK_PAYMENT, + Lithic::FinancialEvent::Type::TaggedSymbol + ) + ANNUAL = T.let(:ANNUAL, Lithic::FinancialEvent::Type::TaggedSymbol) + ANNUAL_REVERSAL = + T.let(:ANNUAL_REVERSAL, Lithic::FinancialEvent::Type::TaggedSymbol) + QUARTERLY = + T.let(:QUARTERLY, Lithic::FinancialEvent::Type::TaggedSymbol) + QUARTERLY_REVERSAL = + T.let(:QUARTERLY_REVERSAL, Lithic::FinancialEvent::Type::TaggedSymbol) + MONTHLY = T.let(:MONTHLY, Lithic::FinancialEvent::Type::TaggedSymbol) + MONTHLY_REVERSAL = + T.let(:MONTHLY_REVERSAL, Lithic::FinancialEvent::Type::TaggedSymbol) + ACCOUNT_TO_ACCOUNT = + T.let(:ACCOUNT_TO_ACCOUNT, Lithic::FinancialEvent::Type::TaggedSymbol) + + sig do + override.returns(T::Array[Lithic::FinancialEvent::Type::TaggedSymbol]) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/financial_transaction.rbi b/rbi/lithic/models/financial_transaction.rbi new file mode 100644 index 00000000..a9489978 --- /dev/null +++ b/rbi/lithic/models/financial_transaction.rbi @@ -0,0 +1,253 @@ +# typed: strong + +module Lithic + module Models + class FinancialTransaction < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::FinancialTransaction, Lithic::Internal::AnyHash) + end + + # Globally unique identifier. + sig { returns(String) } + attr_accessor :token + + # Status types: + # + # - `CARD` - Issuing card transaction. + # - `ACH` - Transaction over ACH. + # - `INTERNAL` - Transaction for internal adjustment. + # - `TRANSFER` - Internal transfer of funds between financial accounts in your + # program. + sig { returns(Lithic::FinancialTransaction::Category::TaggedSymbol) } + attr_accessor :category + + # Date and time when the financial transaction first occurred. UTC time zone. + sig { returns(Time) } + attr_accessor :created + + # 3-character alphabetic ISO 4217 code for the settling currency of the + # transaction. + sig { returns(String) } + attr_accessor :currency + + # A string that provides a description of the financial transaction; may be useful + # to display to users. + sig { returns(String) } + attr_accessor :descriptor + + # A list of all financial events that have modified this financial transaction. + sig { returns(T::Array[Lithic::FinancialEvent]) } + attr_accessor :events + + # Pending amount of the transaction in the currency's smallest unit (e.g., cents), + # including any acquirer fees. + # + # The value of this field will go to zero over time once the financial transaction + # is settled. + sig { returns(Integer) } + attr_accessor :pending_amount + + # APPROVED transactions were successful while DECLINED transactions were declined + # by user, Lithic, or the network. + sig { returns(Lithic::FinancialTransaction::Result::TaggedSymbol) } + attr_accessor :result + + # Amount of the transaction that has been settled in the currency's smallest unit + # (e.g., cents), including any acquirer fees. This may change over time. + sig { returns(Integer) } + attr_accessor :settled_amount + + # Status types: + # + # - `DECLINED` - The transaction was declined. + # - `EXPIRED` - The authorization as it has passed its expiration time. Card + # transaction only. + # - `PENDING` - The transaction is expected to settle. + # - `RETURNED` - The transaction has been returned. + # - `SETTLED` - The transaction is completed. + # - `VOIDED` - The transaction was voided. Card transaction only. + sig { returns(Lithic::FinancialTransaction::Status::TaggedSymbol) } + attr_accessor :status + + # Date and time when the financial transaction was last updated. UTC time zone. + sig { returns(Time) } + attr_accessor :updated + + sig do + params( + token: String, + category: Lithic::FinancialTransaction::Category::OrSymbol, + created: Time, + currency: String, + descriptor: String, + events: T::Array[Lithic::FinancialEvent::OrHash], + pending_amount: Integer, + result: Lithic::FinancialTransaction::Result::OrSymbol, + settled_amount: Integer, + status: Lithic::FinancialTransaction::Status::OrSymbol, + updated: Time + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier. + token:, + # Status types: + # + # - `CARD` - Issuing card transaction. + # - `ACH` - Transaction over ACH. + # - `INTERNAL` - Transaction for internal adjustment. + # - `TRANSFER` - Internal transfer of funds between financial accounts in your + # program. + category:, + # Date and time when the financial transaction first occurred. UTC time zone. + created:, + # 3-character alphabetic ISO 4217 code for the settling currency of the + # transaction. + currency:, + # A string that provides a description of the financial transaction; may be useful + # to display to users. + descriptor:, + # A list of all financial events that have modified this financial transaction. + events:, + # Pending amount of the transaction in the currency's smallest unit (e.g., cents), + # including any acquirer fees. + # + # The value of this field will go to zero over time once the financial transaction + # is settled. + pending_amount:, + # APPROVED transactions were successful while DECLINED transactions were declined + # by user, Lithic, or the network. + result:, + # Amount of the transaction that has been settled in the currency's smallest unit + # (e.g., cents), including any acquirer fees. This may change over time. + settled_amount:, + # Status types: + # + # - `DECLINED` - The transaction was declined. + # - `EXPIRED` - The authorization as it has passed its expiration time. Card + # transaction only. + # - `PENDING` - The transaction is expected to settle. + # - `RETURNED` - The transaction has been returned. + # - `SETTLED` - The transaction is completed. + # - `VOIDED` - The transaction was voided. Card transaction only. + status:, + # Date and time when the financial transaction was last updated. UTC time zone. + updated: + ) + end + + sig do + override.returns( + { + token: String, + category: Lithic::FinancialTransaction::Category::TaggedSymbol, + created: Time, + currency: String, + descriptor: String, + events: T::Array[Lithic::FinancialEvent], + pending_amount: Integer, + result: Lithic::FinancialTransaction::Result::TaggedSymbol, + settled_amount: Integer, + status: Lithic::FinancialTransaction::Status::TaggedSymbol, + updated: Time + } + ) + end + def to_hash + end + + # Status types: + # + # - `CARD` - Issuing card transaction. + # - `ACH` - Transaction over ACH. + # - `INTERNAL` - Transaction for internal adjustment. + # - `TRANSFER` - Internal transfer of funds between financial accounts in your + # program. + module Category + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::FinancialTransaction::Category) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACH = T.let(:ACH, Lithic::FinancialTransaction::Category::TaggedSymbol) + CARD = + T.let(:CARD, Lithic::FinancialTransaction::Category::TaggedSymbol) + INTERNAL = + T.let(:INTERNAL, Lithic::FinancialTransaction::Category::TaggedSymbol) + TRANSFER = + T.let(:TRANSFER, Lithic::FinancialTransaction::Category::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::FinancialTransaction::Category::TaggedSymbol] + ) + end + def self.values + end + end + + # APPROVED transactions were successful while DECLINED transactions were declined + # by user, Lithic, or the network. + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::FinancialTransaction::Result) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let(:APPROVED, Lithic::FinancialTransaction::Result::TaggedSymbol) + DECLINED = + T.let(:DECLINED, Lithic::FinancialTransaction::Result::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::FinancialTransaction::Result::TaggedSymbol] + ) + end + def self.values + end + end + + # Status types: + # + # - `DECLINED` - The transaction was declined. + # - `EXPIRED` - The authorization as it has passed its expiration time. Card + # transaction only. + # - `PENDING` - The transaction is expected to settle. + # - `RETURNED` - The transaction has been returned. + # - `SETTLED` - The transaction is completed. + # - `VOIDED` - The transaction was voided. Card transaction only. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::FinancialTransaction::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DECLINED = + T.let(:DECLINED, Lithic::FinancialTransaction::Status::TaggedSymbol) + EXPIRED = + T.let(:EXPIRED, Lithic::FinancialTransaction::Status::TaggedSymbol) + PENDING = + T.let(:PENDING, Lithic::FinancialTransaction::Status::TaggedSymbol) + RETURNED = + T.let(:RETURNED, Lithic::FinancialTransaction::Status::TaggedSymbol) + SETTLED = + T.let(:SETTLED, Lithic::FinancialTransaction::Status::TaggedSymbol) + VOIDED = + T.let(:VOIDED, Lithic::FinancialTransaction::Status::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::FinancialTransaction::Status::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/fraud/transaction_report_params.rbi b/rbi/lithic/models/fraud/transaction_report_params.rbi new file mode 100644 index 00000000..3e459c9c --- /dev/null +++ b/rbi/lithic/models/fraud/transaction_report_params.rbi @@ -0,0 +1,269 @@ +# typed: strong + +module Lithic + module Models + module Fraud + class TransactionReportParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::Fraud::TransactionReportParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :transaction_token + + # The fraud status of the transaction, string (enum) supporting the following + # values: + # + # - `SUSPECTED_FRAUD`: The transaction is suspected to be fraudulent, but this + # hasn’t been confirmed. + # - `FRAUDULENT`: The transaction is confirmed to be fraudulent. A transaction may + # immediately be moved into this state, or be graduated into this state from the + # `SUSPECTED_FRAUD` state. + # - `NOT_FRAUDULENT`: The transaction is (explicitly) marked as not fraudulent. A + # transaction may immediately be moved into this state, or be graduated into + # this state from the `SUSPECTED_FRAUD` state. + sig do + returns(Lithic::Fraud::TransactionReportParams::FraudStatus::OrSymbol) + end + attr_accessor :fraud_status + + # Optional field providing additional information or context about why the + # transaction is considered fraudulent. + sig { returns(T.nilable(String)) } + attr_reader :comment + + sig { params(comment: String).void } + attr_writer :comment + + # Specifies the type or category of fraud that the transaction is suspected or + # confirmed to involve, string (enum) supporting the following values: + # + # - `FIRST_PARTY_FRAUD`: First-party fraud occurs when a legitimate account or + # cardholder intentionally misuses financial services for personal gain. This + # includes actions such as disputing legitimate transactions to obtain a refund, + # abusing return policies, or defaulting on credit obligations without intent to + # repay. + # - `ACCOUNT_TAKEOVER`: Account takeover fraud occurs when a fraudster gains + # unauthorized access to an existing account, modifies account settings, and + # carries out fraudulent transactions. + # - `CARD_COMPROMISED`: Card compromised fraud occurs when a fraudster gains + # access to card details without taking over the account, such as through + # physical card theft, cloning, or online data breaches. + # - `IDENTITY_THEFT`: Identity theft fraud occurs when a fraudster uses stolen + # personal information, such as Social Security numbers or addresses, to open + # accounts, apply for loans, or conduct financial transactions in someone's + # name. + # - `CARDHOLDER_MANIPULATION`: This type of fraud occurs when a fraudster + # manipulates or coerces a legitimate cardholder into unauthorized transactions, + # often through social engineering tactics. + sig do + returns( + T.nilable( + Lithic::Fraud::TransactionReportParams::FraudType::OrSymbol + ) + ) + end + attr_reader :fraud_type + + sig do + params( + fraud_type: + Lithic::Fraud::TransactionReportParams::FraudType::OrSymbol + ).void + end + attr_writer :fraud_type + + sig do + params( + transaction_token: String, + fraud_status: + Lithic::Fraud::TransactionReportParams::FraudStatus::OrSymbol, + comment: String, + fraud_type: + Lithic::Fraud::TransactionReportParams::FraudType::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + transaction_token:, + # The fraud status of the transaction, string (enum) supporting the following + # values: + # + # - `SUSPECTED_FRAUD`: The transaction is suspected to be fraudulent, but this + # hasn’t been confirmed. + # - `FRAUDULENT`: The transaction is confirmed to be fraudulent. A transaction may + # immediately be moved into this state, or be graduated into this state from the + # `SUSPECTED_FRAUD` state. + # - `NOT_FRAUDULENT`: The transaction is (explicitly) marked as not fraudulent. A + # transaction may immediately be moved into this state, or be graduated into + # this state from the `SUSPECTED_FRAUD` state. + fraud_status:, + # Optional field providing additional information or context about why the + # transaction is considered fraudulent. + comment: nil, + # Specifies the type or category of fraud that the transaction is suspected or + # confirmed to involve, string (enum) supporting the following values: + # + # - `FIRST_PARTY_FRAUD`: First-party fraud occurs when a legitimate account or + # cardholder intentionally misuses financial services for personal gain. This + # includes actions such as disputing legitimate transactions to obtain a refund, + # abusing return policies, or defaulting on credit obligations without intent to + # repay. + # - `ACCOUNT_TAKEOVER`: Account takeover fraud occurs when a fraudster gains + # unauthorized access to an existing account, modifies account settings, and + # carries out fraudulent transactions. + # - `CARD_COMPROMISED`: Card compromised fraud occurs when a fraudster gains + # access to card details without taking over the account, such as through + # physical card theft, cloning, or online data breaches. + # - `IDENTITY_THEFT`: Identity theft fraud occurs when a fraudster uses stolen + # personal information, such as Social Security numbers or addresses, to open + # accounts, apply for loans, or conduct financial transactions in someone's + # name. + # - `CARDHOLDER_MANIPULATION`: This type of fraud occurs when a fraudster + # manipulates or coerces a legitimate cardholder into unauthorized transactions, + # often through social engineering tactics. + fraud_type: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + transaction_token: String, + fraud_status: + Lithic::Fraud::TransactionReportParams::FraudStatus::OrSymbol, + comment: String, + fraud_type: + Lithic::Fraud::TransactionReportParams::FraudType::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # The fraud status of the transaction, string (enum) supporting the following + # values: + # + # - `SUSPECTED_FRAUD`: The transaction is suspected to be fraudulent, but this + # hasn’t been confirmed. + # - `FRAUDULENT`: The transaction is confirmed to be fraudulent. A transaction may + # immediately be moved into this state, or be graduated into this state from the + # `SUSPECTED_FRAUD` state. + # - `NOT_FRAUDULENT`: The transaction is (explicitly) marked as not fraudulent. A + # transaction may immediately be moved into this state, or be graduated into + # this state from the `SUSPECTED_FRAUD` state. + module FraudStatus + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Fraud::TransactionReportParams::FraudStatus) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SUSPECTED_FRAUD = + T.let( + :SUSPECTED_FRAUD, + Lithic::Fraud::TransactionReportParams::FraudStatus::TaggedSymbol + ) + FRAUDULENT = + T.let( + :FRAUDULENT, + Lithic::Fraud::TransactionReportParams::FraudStatus::TaggedSymbol + ) + NOT_FRAUDULENT = + T.let( + :NOT_FRAUDULENT, + Lithic::Fraud::TransactionReportParams::FraudStatus::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Fraud::TransactionReportParams::FraudStatus::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Specifies the type or category of fraud that the transaction is suspected or + # confirmed to involve, string (enum) supporting the following values: + # + # - `FIRST_PARTY_FRAUD`: First-party fraud occurs when a legitimate account or + # cardholder intentionally misuses financial services for personal gain. This + # includes actions such as disputing legitimate transactions to obtain a refund, + # abusing return policies, or defaulting on credit obligations without intent to + # repay. + # - `ACCOUNT_TAKEOVER`: Account takeover fraud occurs when a fraudster gains + # unauthorized access to an existing account, modifies account settings, and + # carries out fraudulent transactions. + # - `CARD_COMPROMISED`: Card compromised fraud occurs when a fraudster gains + # access to card details without taking over the account, such as through + # physical card theft, cloning, or online data breaches. + # - `IDENTITY_THEFT`: Identity theft fraud occurs when a fraudster uses stolen + # personal information, such as Social Security numbers or addresses, to open + # accounts, apply for loans, or conduct financial transactions in someone's + # name. + # - `CARDHOLDER_MANIPULATION`: This type of fraud occurs when a fraudster + # manipulates or coerces a legitimate cardholder into unauthorized transactions, + # often through social engineering tactics. + module FraudType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Fraud::TransactionReportParams::FraudType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FIRST_PARTY_FRAUD = + T.let( + :FIRST_PARTY_FRAUD, + Lithic::Fraud::TransactionReportParams::FraudType::TaggedSymbol + ) + ACCOUNT_TAKEOVER = + T.let( + :ACCOUNT_TAKEOVER, + Lithic::Fraud::TransactionReportParams::FraudType::TaggedSymbol + ) + CARD_COMPROMISED = + T.let( + :CARD_COMPROMISED, + Lithic::Fraud::TransactionReportParams::FraudType::TaggedSymbol + ) + IDENTITY_THEFT = + T.let( + :IDENTITY_THEFT, + Lithic::Fraud::TransactionReportParams::FraudType::TaggedSymbol + ) + CARDHOLDER_MANIPULATION = + T.let( + :CARDHOLDER_MANIPULATION, + Lithic::Fraud::TransactionReportParams::FraudType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Fraud::TransactionReportParams::FraudType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/fraud/transaction_report_response.rbi b/rbi/lithic/models/fraud/transaction_report_response.rbi new file mode 100644 index 00000000..2a1c5778 --- /dev/null +++ b/rbi/lithic/models/fraud/transaction_report_response.rbi @@ -0,0 +1,309 @@ +# typed: strong + +module Lithic + module Models + module Fraud + class TransactionReportResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::Fraud::TransactionReportResponse, + Lithic::Internal::AnyHash + ) + end + + # The fraud status of the transaction, string (enum) supporting the following + # values: + # + # - `SUSPECTED_FRAUD`: The transaction is suspected to be fraudulent, but this + # hasn’t been confirmed. + # - `FRAUDULENT`: The transaction is confirmed to be fraudulent. A transaction may + # immediately be moved into this state, or be graduated into this state from the + # `SUSPECTED_FRAUD` state. + # - `NOT_FRAUDULENT`: The transaction is (explicitly) marked as not fraudulent. A + # transaction may immediately be moved into this state, or be graduated into + # this state from the `SUSPECTED_FRAUD` state. + # - `NO_REPORTED_FRAUD`: Indicates that no fraud report exists for the + # transaction. It is the default state for transactions that have not been + # analyzed or associated with any known fraudulent activity. + sig do + returns( + Lithic::Models::Fraud::TransactionReportResponse::FraudStatus::TaggedSymbol + ) + end + attr_accessor :fraud_status + + # The universally unique identifier (UUID) associated with the transaction being + # reported. + sig { returns(String) } + attr_accessor :transaction_token + + # Provides additional context or details about the fraud report. + sig { returns(T.nilable(String)) } + attr_reader :comment + + sig { params(comment: String).void } + attr_writer :comment + + # Timestamp representing when the fraud report was created. + sig { returns(T.nilable(Time)) } + attr_reader :created_at + + sig { params(created_at: Time).void } + attr_writer :created_at + + # Specifies the type or category of fraud that the transaction is suspected or + # confirmed to involve, string (enum) supporting the following values: + # + # - `FIRST_PARTY_FRAUD`: First-party fraud occurs when a legitimate account or + # cardholder intentionally misuses financial services for personal gain. This + # includes actions such as disputing legitimate transactions to obtain a refund, + # abusing return policies, or defaulting on credit obligations without intent to + # repay. + # - `ACCOUNT_TAKEOVER`: Account takeover fraud occurs when a fraudster gains + # unauthorized access to an existing account, modifies account settings, and + # carries out fraudulent transactions. + # - `CARD_COMPROMISED`: Card compromised fraud occurs when a fraudster gains + # access to card details without taking over the account, such as through + # physical card theft, cloning, or online data breaches. + # - `IDENTITY_THEFT`: Identity theft fraud occurs when a fraudster uses stolen + # personal information, such as Social Security numbers or addresses, to open + # accounts, apply for loans, or conduct financial transactions in someone's + # name. + # - `CARDHOLDER_MANIPULATION`: This type of fraud occurs when a fraudster + # manipulates or coerces a legitimate cardholder into unauthorized transactions, + # often through social engineering tactics. + sig do + returns( + T.nilable( + Lithic::Models::Fraud::TransactionReportResponse::FraudType::TaggedSymbol + ) + ) + end + attr_reader :fraud_type + + sig do + params( + fraud_type: + Lithic::Models::Fraud::TransactionReportResponse::FraudType::OrSymbol + ).void + end + attr_writer :fraud_type + + # Timestamp representing the last update to the fraud report. + sig { returns(T.nilable(Time)) } + attr_reader :updated_at + + sig { params(updated_at: Time).void } + attr_writer :updated_at + + sig do + params( + fraud_status: + Lithic::Models::Fraud::TransactionReportResponse::FraudStatus::OrSymbol, + transaction_token: String, + comment: String, + created_at: Time, + fraud_type: + Lithic::Models::Fraud::TransactionReportResponse::FraudType::OrSymbol, + updated_at: Time + ).returns(T.attached_class) + end + def self.new( + # The fraud status of the transaction, string (enum) supporting the following + # values: + # + # - `SUSPECTED_FRAUD`: The transaction is suspected to be fraudulent, but this + # hasn’t been confirmed. + # - `FRAUDULENT`: The transaction is confirmed to be fraudulent. A transaction may + # immediately be moved into this state, or be graduated into this state from the + # `SUSPECTED_FRAUD` state. + # - `NOT_FRAUDULENT`: The transaction is (explicitly) marked as not fraudulent. A + # transaction may immediately be moved into this state, or be graduated into + # this state from the `SUSPECTED_FRAUD` state. + # - `NO_REPORTED_FRAUD`: Indicates that no fraud report exists for the + # transaction. It is the default state for transactions that have not been + # analyzed or associated with any known fraudulent activity. + fraud_status:, + # The universally unique identifier (UUID) associated with the transaction being + # reported. + transaction_token:, + # Provides additional context or details about the fraud report. + comment: nil, + # Timestamp representing when the fraud report was created. + created_at: nil, + # Specifies the type or category of fraud that the transaction is suspected or + # confirmed to involve, string (enum) supporting the following values: + # + # - `FIRST_PARTY_FRAUD`: First-party fraud occurs when a legitimate account or + # cardholder intentionally misuses financial services for personal gain. This + # includes actions such as disputing legitimate transactions to obtain a refund, + # abusing return policies, or defaulting on credit obligations without intent to + # repay. + # - `ACCOUNT_TAKEOVER`: Account takeover fraud occurs when a fraudster gains + # unauthorized access to an existing account, modifies account settings, and + # carries out fraudulent transactions. + # - `CARD_COMPROMISED`: Card compromised fraud occurs when a fraudster gains + # access to card details without taking over the account, such as through + # physical card theft, cloning, or online data breaches. + # - `IDENTITY_THEFT`: Identity theft fraud occurs when a fraudster uses stolen + # personal information, such as Social Security numbers or addresses, to open + # accounts, apply for loans, or conduct financial transactions in someone's + # name. + # - `CARDHOLDER_MANIPULATION`: This type of fraud occurs when a fraudster + # manipulates or coerces a legitimate cardholder into unauthorized transactions, + # often through social engineering tactics. + fraud_type: nil, + # Timestamp representing the last update to the fraud report. + updated_at: nil + ) + end + + sig do + override.returns( + { + fraud_status: + Lithic::Models::Fraud::TransactionReportResponse::FraudStatus::TaggedSymbol, + transaction_token: String, + comment: String, + created_at: Time, + fraud_type: + Lithic::Models::Fraud::TransactionReportResponse::FraudType::TaggedSymbol, + updated_at: Time + } + ) + end + def to_hash + end + + # The fraud status of the transaction, string (enum) supporting the following + # values: + # + # - `SUSPECTED_FRAUD`: The transaction is suspected to be fraudulent, but this + # hasn’t been confirmed. + # - `FRAUDULENT`: The transaction is confirmed to be fraudulent. A transaction may + # immediately be moved into this state, or be graduated into this state from the + # `SUSPECTED_FRAUD` state. + # - `NOT_FRAUDULENT`: The transaction is (explicitly) marked as not fraudulent. A + # transaction may immediately be moved into this state, or be graduated into + # this state from the `SUSPECTED_FRAUD` state. + # - `NO_REPORTED_FRAUD`: Indicates that no fraud report exists for the + # transaction. It is the default state for transactions that have not been + # analyzed or associated with any known fraudulent activity. + module FraudStatus + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::Fraud::TransactionReportResponse::FraudStatus + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SUSPECTED_FRAUD = + T.let( + :SUSPECTED_FRAUD, + Lithic::Models::Fraud::TransactionReportResponse::FraudStatus::TaggedSymbol + ) + FRAUDULENT = + T.let( + :FRAUDULENT, + Lithic::Models::Fraud::TransactionReportResponse::FraudStatus::TaggedSymbol + ) + NOT_FRAUDULENT = + T.let( + :NOT_FRAUDULENT, + Lithic::Models::Fraud::TransactionReportResponse::FraudStatus::TaggedSymbol + ) + NO_REPORTED_FRAUD = + T.let( + :NO_REPORTED_FRAUD, + Lithic::Models::Fraud::TransactionReportResponse::FraudStatus::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::Fraud::TransactionReportResponse::FraudStatus::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Specifies the type or category of fraud that the transaction is suspected or + # confirmed to involve, string (enum) supporting the following values: + # + # - `FIRST_PARTY_FRAUD`: First-party fraud occurs when a legitimate account or + # cardholder intentionally misuses financial services for personal gain. This + # includes actions such as disputing legitimate transactions to obtain a refund, + # abusing return policies, or defaulting on credit obligations without intent to + # repay. + # - `ACCOUNT_TAKEOVER`: Account takeover fraud occurs when a fraudster gains + # unauthorized access to an existing account, modifies account settings, and + # carries out fraudulent transactions. + # - `CARD_COMPROMISED`: Card compromised fraud occurs when a fraudster gains + # access to card details without taking over the account, such as through + # physical card theft, cloning, or online data breaches. + # - `IDENTITY_THEFT`: Identity theft fraud occurs when a fraudster uses stolen + # personal information, such as Social Security numbers or addresses, to open + # accounts, apply for loans, or conduct financial transactions in someone's + # name. + # - `CARDHOLDER_MANIPULATION`: This type of fraud occurs when a fraudster + # manipulates or coerces a legitimate cardholder into unauthorized transactions, + # often through social engineering tactics. + module FraudType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::Fraud::TransactionReportResponse::FraudType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FIRST_PARTY_FRAUD = + T.let( + :FIRST_PARTY_FRAUD, + Lithic::Models::Fraud::TransactionReportResponse::FraudType::TaggedSymbol + ) + ACCOUNT_TAKEOVER = + T.let( + :ACCOUNT_TAKEOVER, + Lithic::Models::Fraud::TransactionReportResponse::FraudType::TaggedSymbol + ) + CARD_COMPROMISED = + T.let( + :CARD_COMPROMISED, + Lithic::Models::Fraud::TransactionReportResponse::FraudType::TaggedSymbol + ) + IDENTITY_THEFT = + T.let( + :IDENTITY_THEFT, + Lithic::Models::Fraud::TransactionReportResponse::FraudType::TaggedSymbol + ) + CARDHOLDER_MANIPULATION = + T.let( + :CARDHOLDER_MANIPULATION, + Lithic::Models::Fraud::TransactionReportResponse::FraudType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::Fraud::TransactionReportResponse::FraudType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/fraud/transaction_retrieve_params.rbi b/rbi/lithic/models/fraud/transaction_retrieve_params.rbi new file mode 100644 index 00000000..d0800bf4 --- /dev/null +++ b/rbi/lithic/models/fraud/transaction_retrieve_params.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Lithic + module Models + module Fraud + class TransactionRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::Fraud::TransactionRetrieveParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :transaction_token + + sig do + params( + transaction_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(transaction_token:, request_options: {}) + end + + sig do + override.returns( + { + transaction_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/fraud/transaction_retrieve_response.rbi b/rbi/lithic/models/fraud/transaction_retrieve_response.rbi new file mode 100644 index 00000000..85312b49 --- /dev/null +++ b/rbi/lithic/models/fraud/transaction_retrieve_response.rbi @@ -0,0 +1,309 @@ +# typed: strong + +module Lithic + module Models + module Fraud + class TransactionRetrieveResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::Fraud::TransactionRetrieveResponse, + Lithic::Internal::AnyHash + ) + end + + # The fraud status of the transaction, string (enum) supporting the following + # values: + # + # - `SUSPECTED_FRAUD`: The transaction is suspected to be fraudulent, but this + # hasn’t been confirmed. + # - `FRAUDULENT`: The transaction is confirmed to be fraudulent. A transaction may + # immediately be moved into this state, or be graduated into this state from the + # `SUSPECTED_FRAUD` state. + # - `NOT_FRAUDULENT`: The transaction is (explicitly) marked as not fraudulent. A + # transaction may immediately be moved into this state, or be graduated into + # this state from the `SUSPECTED_FRAUD` state. + # - `NO_REPORTED_FRAUD`: Indicates that no fraud report exists for the + # transaction. It is the default state for transactions that have not been + # analyzed or associated with any known fraudulent activity. + sig do + returns( + Lithic::Models::Fraud::TransactionRetrieveResponse::FraudStatus::TaggedSymbol + ) + end + attr_accessor :fraud_status + + # The universally unique identifier (UUID) associated with the transaction being + # reported. + sig { returns(String) } + attr_accessor :transaction_token + + # Provides additional context or details about the fraud report. + sig { returns(T.nilable(String)) } + attr_reader :comment + + sig { params(comment: String).void } + attr_writer :comment + + # Timestamp representing when the fraud report was created. + sig { returns(T.nilable(Time)) } + attr_reader :created_at + + sig { params(created_at: Time).void } + attr_writer :created_at + + # Specifies the type or category of fraud that the transaction is suspected or + # confirmed to involve, string (enum) supporting the following values: + # + # - `FIRST_PARTY_FRAUD`: First-party fraud occurs when a legitimate account or + # cardholder intentionally misuses financial services for personal gain. This + # includes actions such as disputing legitimate transactions to obtain a refund, + # abusing return policies, or defaulting on credit obligations without intent to + # repay. + # - `ACCOUNT_TAKEOVER`: Account takeover fraud occurs when a fraudster gains + # unauthorized access to an existing account, modifies account settings, and + # carries out fraudulent transactions. + # - `CARD_COMPROMISED`: Card compromised fraud occurs when a fraudster gains + # access to card details without taking over the account, such as through + # physical card theft, cloning, or online data breaches. + # - `IDENTITY_THEFT`: Identity theft fraud occurs when a fraudster uses stolen + # personal information, such as Social Security numbers or addresses, to open + # accounts, apply for loans, or conduct financial transactions in someone's + # name. + # - `CARDHOLDER_MANIPULATION`: This type of fraud occurs when a fraudster + # manipulates or coerces a legitimate cardholder into unauthorized transactions, + # often through social engineering tactics. + sig do + returns( + T.nilable( + Lithic::Models::Fraud::TransactionRetrieveResponse::FraudType::TaggedSymbol + ) + ) + end + attr_reader :fraud_type + + sig do + params( + fraud_type: + Lithic::Models::Fraud::TransactionRetrieveResponse::FraudType::OrSymbol + ).void + end + attr_writer :fraud_type + + # Timestamp representing the last update to the fraud report. + sig { returns(T.nilable(Time)) } + attr_reader :updated_at + + sig { params(updated_at: Time).void } + attr_writer :updated_at + + sig do + params( + fraud_status: + Lithic::Models::Fraud::TransactionRetrieveResponse::FraudStatus::OrSymbol, + transaction_token: String, + comment: String, + created_at: Time, + fraud_type: + Lithic::Models::Fraud::TransactionRetrieveResponse::FraudType::OrSymbol, + updated_at: Time + ).returns(T.attached_class) + end + def self.new( + # The fraud status of the transaction, string (enum) supporting the following + # values: + # + # - `SUSPECTED_FRAUD`: The transaction is suspected to be fraudulent, but this + # hasn’t been confirmed. + # - `FRAUDULENT`: The transaction is confirmed to be fraudulent. A transaction may + # immediately be moved into this state, or be graduated into this state from the + # `SUSPECTED_FRAUD` state. + # - `NOT_FRAUDULENT`: The transaction is (explicitly) marked as not fraudulent. A + # transaction may immediately be moved into this state, or be graduated into + # this state from the `SUSPECTED_FRAUD` state. + # - `NO_REPORTED_FRAUD`: Indicates that no fraud report exists for the + # transaction. It is the default state for transactions that have not been + # analyzed or associated with any known fraudulent activity. + fraud_status:, + # The universally unique identifier (UUID) associated with the transaction being + # reported. + transaction_token:, + # Provides additional context or details about the fraud report. + comment: nil, + # Timestamp representing when the fraud report was created. + created_at: nil, + # Specifies the type or category of fraud that the transaction is suspected or + # confirmed to involve, string (enum) supporting the following values: + # + # - `FIRST_PARTY_FRAUD`: First-party fraud occurs when a legitimate account or + # cardholder intentionally misuses financial services for personal gain. This + # includes actions such as disputing legitimate transactions to obtain a refund, + # abusing return policies, or defaulting on credit obligations without intent to + # repay. + # - `ACCOUNT_TAKEOVER`: Account takeover fraud occurs when a fraudster gains + # unauthorized access to an existing account, modifies account settings, and + # carries out fraudulent transactions. + # - `CARD_COMPROMISED`: Card compromised fraud occurs when a fraudster gains + # access to card details without taking over the account, such as through + # physical card theft, cloning, or online data breaches. + # - `IDENTITY_THEFT`: Identity theft fraud occurs when a fraudster uses stolen + # personal information, such as Social Security numbers or addresses, to open + # accounts, apply for loans, or conduct financial transactions in someone's + # name. + # - `CARDHOLDER_MANIPULATION`: This type of fraud occurs when a fraudster + # manipulates or coerces a legitimate cardholder into unauthorized transactions, + # often through social engineering tactics. + fraud_type: nil, + # Timestamp representing the last update to the fraud report. + updated_at: nil + ) + end + + sig do + override.returns( + { + fraud_status: + Lithic::Models::Fraud::TransactionRetrieveResponse::FraudStatus::TaggedSymbol, + transaction_token: String, + comment: String, + created_at: Time, + fraud_type: + Lithic::Models::Fraud::TransactionRetrieveResponse::FraudType::TaggedSymbol, + updated_at: Time + } + ) + end + def to_hash + end + + # The fraud status of the transaction, string (enum) supporting the following + # values: + # + # - `SUSPECTED_FRAUD`: The transaction is suspected to be fraudulent, but this + # hasn’t been confirmed. + # - `FRAUDULENT`: The transaction is confirmed to be fraudulent. A transaction may + # immediately be moved into this state, or be graduated into this state from the + # `SUSPECTED_FRAUD` state. + # - `NOT_FRAUDULENT`: The transaction is (explicitly) marked as not fraudulent. A + # transaction may immediately be moved into this state, or be graduated into + # this state from the `SUSPECTED_FRAUD` state. + # - `NO_REPORTED_FRAUD`: Indicates that no fraud report exists for the + # transaction. It is the default state for transactions that have not been + # analyzed or associated with any known fraudulent activity. + module FraudStatus + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::Fraud::TransactionRetrieveResponse::FraudStatus + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SUSPECTED_FRAUD = + T.let( + :SUSPECTED_FRAUD, + Lithic::Models::Fraud::TransactionRetrieveResponse::FraudStatus::TaggedSymbol + ) + FRAUDULENT = + T.let( + :FRAUDULENT, + Lithic::Models::Fraud::TransactionRetrieveResponse::FraudStatus::TaggedSymbol + ) + NOT_FRAUDULENT = + T.let( + :NOT_FRAUDULENT, + Lithic::Models::Fraud::TransactionRetrieveResponse::FraudStatus::TaggedSymbol + ) + NO_REPORTED_FRAUD = + T.let( + :NO_REPORTED_FRAUD, + Lithic::Models::Fraud::TransactionRetrieveResponse::FraudStatus::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::Fraud::TransactionRetrieveResponse::FraudStatus::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Specifies the type or category of fraud that the transaction is suspected or + # confirmed to involve, string (enum) supporting the following values: + # + # - `FIRST_PARTY_FRAUD`: First-party fraud occurs when a legitimate account or + # cardholder intentionally misuses financial services for personal gain. This + # includes actions such as disputing legitimate transactions to obtain a refund, + # abusing return policies, or defaulting on credit obligations without intent to + # repay. + # - `ACCOUNT_TAKEOVER`: Account takeover fraud occurs when a fraudster gains + # unauthorized access to an existing account, modifies account settings, and + # carries out fraudulent transactions. + # - `CARD_COMPROMISED`: Card compromised fraud occurs when a fraudster gains + # access to card details without taking over the account, such as through + # physical card theft, cloning, or online data breaches. + # - `IDENTITY_THEFT`: Identity theft fraud occurs when a fraudster uses stolen + # personal information, such as Social Security numbers or addresses, to open + # accounts, apply for loans, or conduct financial transactions in someone's + # name. + # - `CARDHOLDER_MANIPULATION`: This type of fraud occurs when a fraudster + # manipulates or coerces a legitimate cardholder into unauthorized transactions, + # often through social engineering tactics. + module FraudType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::Fraud::TransactionRetrieveResponse::FraudType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FIRST_PARTY_FRAUD = + T.let( + :FIRST_PARTY_FRAUD, + Lithic::Models::Fraud::TransactionRetrieveResponse::FraudType::TaggedSymbol + ) + ACCOUNT_TAKEOVER = + T.let( + :ACCOUNT_TAKEOVER, + Lithic::Models::Fraud::TransactionRetrieveResponse::FraudType::TaggedSymbol + ) + CARD_COMPROMISED = + T.let( + :CARD_COMPROMISED, + Lithic::Models::Fraud::TransactionRetrieveResponse::FraudType::TaggedSymbol + ) + IDENTITY_THEFT = + T.let( + :IDENTITY_THEFT, + Lithic::Models::Fraud::TransactionRetrieveResponse::FraudType::TaggedSymbol + ) + CARDHOLDER_MANIPULATION = + T.let( + :CARDHOLDER_MANIPULATION, + Lithic::Models::Fraud::TransactionRetrieveResponse::FraudType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::Fraud::TransactionRetrieveResponse::FraudType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/funding_event.rbi b/rbi/lithic/models/funding_event.rbi new file mode 100644 index 00000000..0203b4a6 --- /dev/null +++ b/rbi/lithic/models/funding_event.rbi @@ -0,0 +1,162 @@ +# typed: strong + +module Lithic + module Models + class FundingEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Lithic::FundingEvent, Lithic::Internal::AnyHash) } + + # Unique token ID + sig { returns(String) } + attr_accessor :token + + # Collection resource type + sig do + returns(Lithic::FundingEvent::CollectionResourceType::TaggedSymbol) + end + attr_accessor :collection_resource_type + + # IDs of collections, further information can be gathered from the appropriate + # collection API based on collection_resource_type + sig { returns(T::Array[String]) } + attr_accessor :collection_tokens + + # Time of the creation + sig { returns(Time) } + attr_accessor :created + + # Time of the high watermark + sig { returns(Time) } + attr_accessor :high_watermark + + # Network settlement summary breakdown by network settlement date + sig { returns(T::Array[Lithic::FundingEvent::NetworkSettlementSummary]) } + attr_accessor :network_settlement_summary + + # Time of the previous high watermark + sig { returns(Time) } + attr_accessor :previous_high_watermark + + # Time of the update + sig { returns(Time) } + attr_accessor :updated + + sig do + params( + token: String, + collection_resource_type: + Lithic::FundingEvent::CollectionResourceType::OrSymbol, + collection_tokens: T::Array[String], + created: Time, + high_watermark: Time, + network_settlement_summary: + T::Array[Lithic::FundingEvent::NetworkSettlementSummary::OrHash], + previous_high_watermark: Time, + updated: Time + ).returns(T.attached_class) + end + def self.new( + # Unique token ID + token:, + # Collection resource type + collection_resource_type:, + # IDs of collections, further information can be gathered from the appropriate + # collection API based on collection_resource_type + collection_tokens:, + # Time of the creation + created:, + # Time of the high watermark + high_watermark:, + # Network settlement summary breakdown by network settlement date + network_settlement_summary:, + # Time of the previous high watermark + previous_high_watermark:, + # Time of the update + updated: + ) + end + + sig do + override.returns( + { + token: String, + collection_resource_type: + Lithic::FundingEvent::CollectionResourceType::TaggedSymbol, + collection_tokens: T::Array[String], + created: Time, + high_watermark: Time, + network_settlement_summary: + T::Array[Lithic::FundingEvent::NetworkSettlementSummary], + previous_high_watermark: Time, + updated: Time + } + ) + end + def to_hash + end + + # Collection resource type + module CollectionResourceType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::FundingEvent::CollectionResourceType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BOOK_TRANSFER = + T.let( + :BOOK_TRANSFER, + Lithic::FundingEvent::CollectionResourceType::TaggedSymbol + ) + PAYMENT = + T.let( + :PAYMENT, + Lithic::FundingEvent::CollectionResourceType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::FundingEvent::CollectionResourceType::TaggedSymbol] + ) + end + def self.values + end + end + + class NetworkSettlementSummary < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::FundingEvent::NetworkSettlementSummary, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Date) } + attr_accessor :network_settlement_date + + sig { returns(Integer) } + attr_accessor :settled_gross_amount + + sig do + params( + network_settlement_date: Date, + settled_gross_amount: Integer + ).returns(T.attached_class) + end + def self.new(network_settlement_date:, settled_gross_amount:) + end + + sig do + override.returns( + { network_settlement_date: Date, settled_gross_amount: Integer } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/funding_event_created_webhook_event.rbi b/rbi/lithic/models/funding_event_created_webhook_event.rbi new file mode 100644 index 00000000..8d623160 --- /dev/null +++ b/rbi/lithic/models/funding_event_created_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class FundingEventCreatedWebhookEvent < Lithic::Models::FundingEvent + OrHash = + T.type_alias do + T.any( + Lithic::FundingEventCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"funding_event.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/funding_event_list_params.rbi b/rbi/lithic/models/funding_event_list_params.rbi new file mode 100644 index 00000000..7d9d1518 --- /dev/null +++ b/rbi/lithic/models/funding_event_list_params.rbi @@ -0,0 +1,72 @@ +# typed: strong + +module Lithic + module Models + class FundingEventListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::FundingEventListParams, Lithic::Internal::AnyHash) + end + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/funding_event_retrieve_details_params.rbi b/rbi/lithic/models/funding_event_retrieve_details_params.rbi new file mode 100644 index 00000000..64dc35be --- /dev/null +++ b/rbi/lithic/models/funding_event_retrieve_details_params.rbi @@ -0,0 +1,41 @@ +# typed: strong + +module Lithic + module Models + class FundingEventRetrieveDetailsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::FundingEventRetrieveDetailsParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :funding_event_token + + sig do + params( + funding_event_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(funding_event_token:, request_options: {}) + end + + sig do + override.returns( + { + funding_event_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/funding_event_retrieve_details_response.rbi b/rbi/lithic/models/funding_event_retrieve_details_response.rbi new file mode 100644 index 00000000..5b73e2bd --- /dev/null +++ b/rbi/lithic/models/funding_event_retrieve_details_response.rbi @@ -0,0 +1,56 @@ +# typed: strong + +module Lithic + module Models + class FundingEventRetrieveDetailsResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::FundingEventRetrieveDetailsResponse, + Lithic::Internal::AnyHash + ) + end + + # Unique token ID + sig { returns(String) } + attr_accessor :token + + # URL of the settlement details + sig { returns(String) } + attr_accessor :settlement_details_url + + # URL of the settlement summary + sig { returns(String) } + attr_accessor :settlement_summary_url + + sig do + params( + token: String, + settlement_details_url: String, + settlement_summary_url: String + ).returns(T.attached_class) + end + def self.new( + # Unique token ID + token:, + # URL of the settlement details + settlement_details_url:, + # URL of the settlement summary + settlement_summary_url: + ) + end + + sig do + override.returns( + { + token: String, + settlement_details_url: String, + settlement_summary_url: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/funding_event_retrieve_params.rbi b/rbi/lithic/models/funding_event_retrieve_params.rbi new file mode 100644 index 00000000..09544482 --- /dev/null +++ b/rbi/lithic/models/funding_event_retrieve_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Lithic + module Models + class FundingEventRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::FundingEventRetrieveParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :funding_event_token + + sig do + params( + funding_event_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(funding_event_token:, request_options: {}) + end + + sig do + override.returns( + { + funding_event_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/hold.rbi b/rbi/lithic/models/hold.rbi new file mode 100644 index 00000000..0a00f0ae --- /dev/null +++ b/rbi/lithic/models/hold.rbi @@ -0,0 +1,183 @@ +# typed: strong + +module Lithic + module Models + class Hold < Lithic::Internal::Type::BaseModel + OrHash = T.type_alias { T.any(Lithic::Hold, Lithic::Internal::AnyHash) } + + # Unique identifier for the transaction + sig { returns(String) } + attr_accessor :token + + # ISO 8601 timestamp of when the transaction was created + sig { returns(Time) } + attr_accessor :created + + # Status of a hold transaction + sig { returns(Lithic::Hold::Status::TaggedSymbol) } + attr_accessor :status + + # ISO 8601 timestamp of when the transaction was last updated + sig { returns(Time) } + attr_accessor :updated + + sig { returns(T.nilable(String)) } + attr_reader :currency + + sig { params(currency: String).void } + attr_writer :currency + + sig { returns(T.nilable(T::Array[Lithic::HoldEvent])) } + attr_reader :events + + sig { params(events: T::Array[Lithic::HoldEvent::OrHash]).void } + attr_writer :events + + # When the hold will auto-expire if not resolved + sig { returns(T.nilable(Time)) } + attr_accessor :expiration_datetime + + # HOLD - Hold Transaction + sig { returns(T.nilable(Lithic::Hold::Family::TaggedSymbol)) } + attr_reader :family + + sig { params(family: Lithic::Hold::Family::OrSymbol).void } + attr_writer :family + + sig { returns(T.nilable(String)) } + attr_reader :financial_account_token + + sig { params(financial_account_token: String).void } + attr_writer :financial_account_token + + # Current pending amount (0 when resolved) + sig { returns(T.nilable(Integer)) } + attr_reader :pending_amount + + sig { params(pending_amount: Integer).void } + attr_writer :pending_amount + + sig { returns(T.nilable(Lithic::Hold::Result::TaggedSymbol)) } + attr_reader :result + + sig { params(result: Lithic::Hold::Result::OrSymbol).void } + attr_writer :result + + sig { returns(T.nilable(String)) } + attr_accessor :user_defined_id + + # A hold transaction representing reserved funds on a financial account. Holds + # move funds from available to pending balance in anticipation of future payments. + # They can be resolved via settlement (linked to payment), manual release, or + # expiration. + sig do + params( + token: String, + created: Time, + status: Lithic::Hold::Status::OrSymbol, + updated: Time, + currency: String, + events: T::Array[Lithic::HoldEvent::OrHash], + expiration_datetime: T.nilable(Time), + family: Lithic::Hold::Family::OrSymbol, + financial_account_token: String, + pending_amount: Integer, + result: Lithic::Hold::Result::OrSymbol, + user_defined_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the transaction + token:, + # ISO 8601 timestamp of when the transaction was created + created:, + # Status of a hold transaction + status:, + # ISO 8601 timestamp of when the transaction was last updated + updated:, + currency: nil, + events: nil, + # When the hold will auto-expire if not resolved + expiration_datetime: nil, + # HOLD - Hold Transaction + family: nil, + financial_account_token: nil, + # Current pending amount (0 when resolved) + pending_amount: nil, + result: nil, + user_defined_id: nil + ) + end + + sig do + override.returns( + { + token: String, + created: Time, + status: Lithic::Hold::Status::TaggedSymbol, + updated: Time, + currency: String, + events: T::Array[Lithic::HoldEvent], + expiration_datetime: T.nilable(Time), + family: Lithic::Hold::Family::TaggedSymbol, + financial_account_token: String, + pending_amount: Integer, + result: Lithic::Hold::Result::TaggedSymbol, + user_defined_id: T.nilable(String) + } + ) + end + def to_hash + end + + # Status of a hold transaction + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Hold::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = T.let(:PENDING, Lithic::Hold::Status::TaggedSymbol) + SETTLED = T.let(:SETTLED, Lithic::Hold::Status::TaggedSymbol) + EXPIRED = T.let(:EXPIRED, Lithic::Hold::Status::TaggedSymbol) + VOIDED = T.let(:VOIDED, Lithic::Hold::Status::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Hold::Status::TaggedSymbol) + REVERSED = T.let(:REVERSED, Lithic::Hold::Status::TaggedSymbol) + CANCELED = T.let(:CANCELED, Lithic::Hold::Status::TaggedSymbol) + RETURNED = T.let(:RETURNED, Lithic::Hold::Status::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Hold::Status::TaggedSymbol]) } + def self.values + end + end + + # HOLD - Hold Transaction + module Family + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Hold::Family) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + HOLD = T.let(:HOLD, Lithic::Hold::Family::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Hold::Family::TaggedSymbol]) } + def self.values + end + end + + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Hold::Result) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = T.let(:APPROVED, Lithic::Hold::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Hold::Result::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::Hold::Result::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/hold_create_params.rbi b/rbi/lithic/models/hold_create_params.rbi new file mode 100644 index 00000000..4a1c6ba4 --- /dev/null +++ b/rbi/lithic/models/hold_create_params.rbi @@ -0,0 +1,90 @@ +# typed: strong + +module Lithic + module Models + class HoldCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::HoldCreateParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :financial_account_token + + # Amount to hold in cents + sig { returns(Integer) } + attr_accessor :amount + + # Customer-provided token for idempotency. Becomes the hold token. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # When the hold should auto-expire + sig { returns(T.nilable(Time)) } + attr_reader :expiration_datetime + + sig { params(expiration_datetime: Time).void } + attr_writer :expiration_datetime + + # Reason for the hold + sig { returns(T.nilable(String)) } + attr_accessor :memo + + # User-provided identifier for the hold + sig { returns(T.nilable(String)) } + attr_reader :user_defined_id + + sig { params(user_defined_id: String).void } + attr_writer :user_defined_id + + sig do + params( + financial_account_token: String, + amount: Integer, + token: String, + expiration_datetime: Time, + memo: T.nilable(String), + user_defined_id: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + financial_account_token:, + # Amount to hold in cents + amount:, + # Customer-provided token for idempotency. Becomes the hold token. + token: nil, + # When the hold should auto-expire + expiration_datetime: nil, + # Reason for the hold + memo: nil, + # User-provided identifier for the hold + user_defined_id: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + financial_account_token: String, + amount: Integer, + token: String, + expiration_datetime: Time, + memo: T.nilable(String), + user_defined_id: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/hold_event.rbi b/rbi/lithic/models/hold_event.rbi new file mode 100644 index 00000000..326279d2 --- /dev/null +++ b/rbi/lithic/models/hold_event.rbi @@ -0,0 +1,148 @@ +# typed: strong + +module Lithic + module Models + class HoldEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Lithic::HoldEvent, Lithic::Internal::AnyHash) } + + sig { returns(String) } + attr_accessor :token + + # Amount in cents + sig { returns(Integer) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created + + sig { returns(T::Array[Lithic::HoldEvent::DetailedResult::TaggedSymbol]) } + attr_accessor :detailed_results + + sig { returns(T.nilable(String)) } + attr_accessor :memo + + sig { returns(Lithic::HoldEvent::Result::TaggedSymbol) } + attr_accessor :result + + # Transaction token of the payment that settled this hold (only populated for + # HOLD_SETTLED events) + sig { returns(T.nilable(String)) } + attr_accessor :settling_transaction_token + + # Type of hold lifecycle event + sig { returns(Lithic::HoldEvent::Type::TaggedSymbol) } + attr_accessor :type + + # Event representing a lifecycle change to a hold + sig do + params( + token: String, + amount: Integer, + created: Time, + detailed_results: + T::Array[Lithic::HoldEvent::DetailedResult::OrSymbol], + memo: T.nilable(String), + result: Lithic::HoldEvent::Result::OrSymbol, + settling_transaction_token: T.nilable(String), + type: Lithic::HoldEvent::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + token:, + # Amount in cents + amount:, + created:, + detailed_results:, + memo:, + result:, + # Transaction token of the payment that settled this hold (only populated for + # HOLD_SETTLED events) + settling_transaction_token:, + # Type of hold lifecycle event + type: + ) + end + + sig do + override.returns( + { + token: String, + amount: Integer, + created: Time, + detailed_results: + T::Array[Lithic::HoldEvent::DetailedResult::TaggedSymbol], + memo: T.nilable(String), + result: Lithic::HoldEvent::Result::TaggedSymbol, + settling_transaction_token: T.nilable(String), + type: Lithic::HoldEvent::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module DetailedResult + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::HoldEvent::DetailedResult) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let(:APPROVED, Lithic::HoldEvent::DetailedResult::TaggedSymbol) + INSUFFICIENT_FUNDS = + T.let( + :INSUFFICIENT_FUNDS, + Lithic::HoldEvent::DetailedResult::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::HoldEvent::DetailedResult::TaggedSymbol] + ) + end + def self.values + end + end + + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::HoldEvent::Result) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = T.let(:APPROVED, Lithic::HoldEvent::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::HoldEvent::Result::TaggedSymbol) + + sig do + override.returns(T::Array[Lithic::HoldEvent::Result::TaggedSymbol]) + end + def self.values + end + end + + # Type of hold lifecycle event + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::HoldEvent::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + HOLD_INITIATED = + T.let(:HOLD_INITIATED, Lithic::HoldEvent::Type::TaggedSymbol) + HOLD_VOIDED = T.let(:HOLD_VOIDED, Lithic::HoldEvent::Type::TaggedSymbol) + HOLD_EXPIRED = + T.let(:HOLD_EXPIRED, Lithic::HoldEvent::Type::TaggedSymbol) + HOLD_SETTLED = + T.let(:HOLD_SETTLED, Lithic::HoldEvent::Type::TaggedSymbol) + + sig do + override.returns(T::Array[Lithic::HoldEvent::Type::TaggedSymbol]) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/hold_list_params.rbi b/rbi/lithic/models/hold_list_params.rbi new file mode 100644 index 00000000..a4ef08ae --- /dev/null +++ b/rbi/lithic/models/hold_list_params.rbi @@ -0,0 +1,137 @@ +# typed: strong + +module Lithic + module Models + class HoldListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::HoldListParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :financial_account_token + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + # Hold status to filter by. + sig { returns(T.nilable(Lithic::HoldListParams::Status::OrSymbol)) } + attr_reader :status + + sig { params(status: Lithic::HoldListParams::Status::OrSymbol).void } + attr_writer :status + + sig do + params( + financial_account_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::HoldListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + financial_account_token:, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Hold status to filter by. + status: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + financial_account_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::HoldListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Hold status to filter by. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::HoldListParams::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = T.let(:PENDING, Lithic::HoldListParams::Status::TaggedSymbol) + SETTLED = T.let(:SETTLED, Lithic::HoldListParams::Status::TaggedSymbol) + EXPIRED = T.let(:EXPIRED, Lithic::HoldListParams::Status::TaggedSymbol) + VOIDED = T.let(:VOIDED, Lithic::HoldListParams::Status::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::HoldListParams::Status::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/hold_retrieve_params.rbi b/rbi/lithic/models/hold_retrieve_params.rbi new file mode 100644 index 00000000..5f71341b --- /dev/null +++ b/rbi/lithic/models/hold_retrieve_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Lithic + module Models + class HoldRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::HoldRetrieveParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :hold_token + + sig do + params( + hold_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(hold_token:, request_options: {}) + end + + sig do + override.returns( + { hold_token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/hold_void_params.rbi b/rbi/lithic/models/hold_void_params.rbi new file mode 100644 index 00000000..6a7d0f6a --- /dev/null +++ b/rbi/lithic/models/hold_void_params.rbi @@ -0,0 +1,49 @@ +# typed: strong + +module Lithic + module Models + class HoldVoidParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::HoldVoidParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :hold_token + + # Reason for voiding the hold + sig { returns(T.nilable(String)) } + attr_accessor :memo + + sig do + params( + hold_token: String, + memo: T.nilable(String), + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + hold_token:, + # Reason for voiding the hold + memo: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + hold_token: String, + memo: T.nilable(String), + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/instance_financial_account_type.rbi b/rbi/lithic/models/instance_financial_account_type.rbi new file mode 100644 index 00000000..73de08ed --- /dev/null +++ b/rbi/lithic/models/instance_financial_account_type.rbi @@ -0,0 +1,68 @@ +# typed: strong + +module Lithic + module Models + # Type of instance financial account + module InstanceFinancialAccountType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::InstanceFinancialAccountType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ISSUING = + T.let(:ISSUING, Lithic::InstanceFinancialAccountType::TaggedSymbol) + RESERVE = + T.let(:RESERVE, Lithic::InstanceFinancialAccountType::TaggedSymbol) + OPERATING = + T.let(:OPERATING, Lithic::InstanceFinancialAccountType::TaggedSymbol) + CHARGED_OFF_FEES = + T.let( + :CHARGED_OFF_FEES, + Lithic::InstanceFinancialAccountType::TaggedSymbol + ) + CHARGED_OFF_INTEREST = + T.let( + :CHARGED_OFF_INTEREST, + Lithic::InstanceFinancialAccountType::TaggedSymbol + ) + CHARGED_OFF_PRINCIPAL = + T.let( + :CHARGED_OFF_PRINCIPAL, + Lithic::InstanceFinancialAccountType::TaggedSymbol + ) + SECURITY = + T.let(:SECURITY, Lithic::InstanceFinancialAccountType::TaggedSymbol) + PROGRAM_RECEIVABLES = + T.let( + :PROGRAM_RECEIVABLES, + Lithic::InstanceFinancialAccountType::TaggedSymbol + ) + COLLECTION = + T.let(:COLLECTION, Lithic::InstanceFinancialAccountType::TaggedSymbol) + PROGRAM_BANK_ACCOUNTS_PAYABLE = + T.let( + :PROGRAM_BANK_ACCOUNTS_PAYABLE, + Lithic::InstanceFinancialAccountType::TaggedSymbol + ) + EARLY_DIRECT_DEPOSIT_FLOAT = + T.let( + :EARLY_DIRECT_DEPOSIT_FLOAT, + Lithic::InstanceFinancialAccountType::TaggedSymbol + ) + PROVISIONAL_CREDIT_ACCOUNT = + T.let( + :PROVISIONAL_CREDIT_ACCOUNT, + Lithic::InstanceFinancialAccountType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::InstanceFinancialAccountType::TaggedSymbol] + ) + end + def self.values + end + end + end +end diff --git a/rbi/lithic/models/internal_transaction.rbi b/rbi/lithic/models/internal_transaction.rbi new file mode 100644 index 00000000..705afccd --- /dev/null +++ b/rbi/lithic/models/internal_transaction.rbi @@ -0,0 +1,282 @@ +# typed: strong + +module Lithic + module Models + class InternalTransactionAPI < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::InternalTransactionAPI, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :token + + sig { returns(Lithic::InternalTransactionAPI::Category::TaggedSymbol) } + attr_accessor :category + + sig { returns(Time) } + attr_accessor :created + + sig { returns(String) } + attr_accessor :currency + + sig { returns(String) } + attr_accessor :descriptor + + sig { returns(T::Array[Lithic::InternalTransactionAPI::Event]) } + attr_accessor :events + + sig { returns(Integer) } + attr_accessor :pending_amount + + sig { returns(Lithic::InternalTransactionAPI::Result::TaggedSymbol) } + attr_accessor :result + + sig { returns(Integer) } + attr_accessor :settled_amount + + sig { returns(Lithic::InternalTransactionAPI::Status::TaggedSymbol) } + attr_accessor :status + + sig { returns(Time) } + attr_accessor :updated + + sig do + params( + token: String, + category: Lithic::InternalTransactionAPI::Category::OrSymbol, + created: Time, + currency: String, + descriptor: String, + events: T::Array[Lithic::InternalTransactionAPI::Event::OrHash], + pending_amount: Integer, + result: Lithic::InternalTransactionAPI::Result::OrSymbol, + settled_amount: Integer, + status: Lithic::InternalTransactionAPI::Status::OrSymbol, + updated: Time + ).returns(T.attached_class) + end + def self.new( + token:, + category:, + created:, + currency:, + descriptor:, + events:, + pending_amount:, + result:, + settled_amount:, + status:, + updated: + ) + end + + sig do + override.returns( + { + token: String, + category: Lithic::InternalTransactionAPI::Category::TaggedSymbol, + created: Time, + currency: String, + descriptor: String, + events: T::Array[Lithic::InternalTransactionAPI::Event], + pending_amount: Integer, + result: Lithic::InternalTransactionAPI::Result::TaggedSymbol, + settled_amount: Integer, + status: Lithic::InternalTransactionAPI::Status::TaggedSymbol, + updated: Time + } + ) + end + def to_hash + end + + module Category + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::InternalTransactionAPI::Category) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INTERNAL = + T.let( + :INTERNAL, + Lithic::InternalTransactionAPI::Category::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::InternalTransactionAPI::Category::TaggedSymbol] + ) + end + def self.values + end + end + + class Event < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::InternalTransactionAPI::Event, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :token + + sig { returns(Integer) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created + + sig do + returns(Lithic::InternalTransactionAPI::Event::Result::TaggedSymbol) + end + attr_accessor :result + + sig do + returns(Lithic::InternalTransactionAPI::Event::Type::TaggedSymbol) + end + attr_accessor :type + + sig do + params( + token: String, + amount: Integer, + created: Time, + result: Lithic::InternalTransactionAPI::Event::Result::OrSymbol, + type: Lithic::InternalTransactionAPI::Event::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(token:, amount:, created:, result:, type:) + end + + sig do + override.returns( + { + token: String, + amount: Integer, + created: Time, + result: + Lithic::InternalTransactionAPI::Event::Result::TaggedSymbol, + type: Lithic::InternalTransactionAPI::Event::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::InternalTransactionAPI::Event::Result) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::InternalTransactionAPI::Event::Result::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::InternalTransactionAPI::Event::Result::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::InternalTransactionAPI::Event::Result::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::InternalTransactionAPI::Event::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INTERNAL_ADJUSTMENT = + T.let( + :INTERNAL_ADJUSTMENT, + Lithic::InternalTransactionAPI::Event::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::InternalTransactionAPI::Event::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::InternalTransactionAPI::Result) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let(:APPROVED, Lithic::InternalTransactionAPI::Result::TaggedSymbol) + DECLINED = + T.let(:DECLINED, Lithic::InternalTransactionAPI::Result::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::InternalTransactionAPI::Result::TaggedSymbol] + ) + end + def self.values + end + end + + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::InternalTransactionAPI::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let(:PENDING, Lithic::InternalTransactionAPI::Status::TaggedSymbol) + SETTLED = + T.let(:SETTLED, Lithic::InternalTransactionAPI::Status::TaggedSymbol) + DECLINED = + T.let(:DECLINED, Lithic::InternalTransactionAPI::Status::TaggedSymbol) + REVERSED = + T.let(:REVERSED, Lithic::InternalTransactionAPI::Status::TaggedSymbol) + CANCELED = + T.let(:CANCELED, Lithic::InternalTransactionAPI::Status::TaggedSymbol) + RETURNED = + T.let(:RETURNED, Lithic::InternalTransactionAPI::Status::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::InternalTransactionAPI::Status::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/internal_transaction_created_webhook_event.rbi b/rbi/lithic/models/internal_transaction_created_webhook_event.rbi new file mode 100644 index 00000000..dfd1f13d --- /dev/null +++ b/rbi/lithic/models/internal_transaction_created_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class InternalTransactionCreatedWebhookEvent < Lithic::Models::InternalTransactionAPI + OrHash = + T.type_alias do + T.any( + Lithic::InternalTransactionCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"internal_transaction.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/internal_transaction_updated_webhook_event.rbi b/rbi/lithic/models/internal_transaction_updated_webhook_event.rbi new file mode 100644 index 00000000..3db382c6 --- /dev/null +++ b/rbi/lithic/models/internal_transaction_updated_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class InternalTransactionUpdatedWebhookEvent < Lithic::Models::InternalTransactionAPI + OrHash = + T.type_alias do + T.any( + Lithic::InternalTransactionUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"internal_transaction.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/kyb.rbi b/rbi/lithic/models/kyb.rbi new file mode 100644 index 00000000..2798eb11 --- /dev/null +++ b/rbi/lithic/models/kyb.rbi @@ -0,0 +1,482 @@ +# typed: strong + +module Lithic + module Models + class KYB < Lithic::Internal::Type::BaseModel + OrHash = T.type_alias { T.any(Lithic::KYB, Lithic::Internal::AnyHash) } + + # You must submit a list of all direct and indirect individuals with 25% or more + # ownership in the company. A maximum of 4 beneficial owners can be submitted. If + # no individual owns 25% of the company you do not need to send beneficial owner + # information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + sig { returns(T::Array[Lithic::KYB::BeneficialOwnerIndividual]) } + attr_accessor :beneficial_owner_individuals + + # Information for business for which the account is being opened and KYB is being + # run. + sig { returns(Lithic::KYB::BusinessEntity) } + attr_reader :business_entity + + sig { params(business_entity: Lithic::KYB::BusinessEntity::OrHash).void } + attr_writer :business_entity + + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + sig { returns(Lithic::KYB::ControlPerson) } + attr_reader :control_person + + sig { params(control_person: Lithic::KYB::ControlPerson::OrHash).void } + attr_writer :control_person + + # Short description of the company's line of business (i.e., what does the company + # do?). Values longer than 255 characters will be truncated before KYB + # verification + sig { returns(String) } + attr_accessor :nature_of_business + + # An RFC 3339 timestamp indicating when the account holder accepted the applicable + # legal agreements (e.g., cardholder terms) as agreed upon during API customer's + # implementation with Lithic. + sig { returns(String) } + attr_accessor :tos_timestamp + + # Specifies the type of KYB workflow to run. + sig { returns(Lithic::KYB::Workflow::OrSymbol) } + attr_accessor :workflow + + # A user provided id that can be used to link an account holder with an external + # system + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # An RFC 3339 timestamp indicating when precomputed KYB was completed on the + # business with a pass result. + # + # This field is required only if workflow type is `KYB_BYO`. + sig { returns(T.nilable(String)) } + attr_reader :kyb_passed_timestamp + + sig { params(kyb_passed_timestamp: String).void } + attr_writer :kyb_passed_timestamp + + # 6-digit North American Industry Classification System (NAICS) code for the + # business. + sig { returns(T.nilable(String)) } + attr_reader :naics_code + + sig { params(naics_code: String).void } + attr_writer :naics_code + + # Company website URL. + sig { returns(T.nilable(String)) } + attr_reader :website_url + + sig { params(website_url: String).void } + attr_writer :website_url + + sig do + params( + beneficial_owner_individuals: + T::Array[Lithic::KYB::BeneficialOwnerIndividual::OrHash], + business_entity: Lithic::KYB::BusinessEntity::OrHash, + control_person: Lithic::KYB::ControlPerson::OrHash, + nature_of_business: String, + tos_timestamp: String, + workflow: Lithic::KYB::Workflow::OrSymbol, + external_id: String, + kyb_passed_timestamp: String, + naics_code: String, + website_url: String + ).returns(T.attached_class) + end + def self.new( + # You must submit a list of all direct and indirect individuals with 25% or more + # ownership in the company. A maximum of 4 beneficial owners can be submitted. If + # no individual owns 25% of the company you do not need to send beneficial owner + # information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + beneficial_owner_individuals:, + # Information for business for which the account is being opened and KYB is being + # run. + business_entity:, + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + control_person:, + # Short description of the company's line of business (i.e., what does the company + # do?). Values longer than 255 characters will be truncated before KYB + # verification + nature_of_business:, + # An RFC 3339 timestamp indicating when the account holder accepted the applicable + # legal agreements (e.g., cardholder terms) as agreed upon during API customer's + # implementation with Lithic. + tos_timestamp:, + # Specifies the type of KYB workflow to run. + workflow:, + # A user provided id that can be used to link an account holder with an external + # system + external_id: nil, + # An RFC 3339 timestamp indicating when precomputed KYB was completed on the + # business with a pass result. + # + # This field is required only if workflow type is `KYB_BYO`. + kyb_passed_timestamp: nil, + # 6-digit North American Industry Classification System (NAICS) code for the + # business. + naics_code: nil, + # Company website URL. + website_url: nil + ) + end + + sig do + override.returns( + { + beneficial_owner_individuals: + T::Array[Lithic::KYB::BeneficialOwnerIndividual], + business_entity: Lithic::KYB::BusinessEntity, + control_person: Lithic::KYB::ControlPerson, + nature_of_business: String, + tos_timestamp: String, + workflow: Lithic::KYB::Workflow::OrSymbol, + external_id: String, + kyb_passed_timestamp: String, + naics_code: String, + website_url: String + } + ) + end + def to_hash + end + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::KYB::BeneficialOwnerIndividual, + Lithic::Internal::AnyHash + ) + end + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig { returns(Lithic::Address) } + attr_reader :address + + sig { params(address: Lithic::Address::OrHash).void } + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(String) } + attr_accessor :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(String) } + attr_accessor :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :first_name + + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + sig { returns(String) } + attr_accessor :government_id + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Individuals associated with a KYB application. Phone number is optional. + sig do + params( + address: Lithic::Address::OrHash, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + address:, + # Individual's date of birth, as an RFC 3339 date. + dob:, + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + email:, + # Individual's first name, as it appears on government-issued identity documents. + first_name:, + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + government_id:, + # Individual's last name, as it appears on government-issued identity documents. + last_name:, + # Individual's phone number, entered in E.164 format. + phone_number: nil + ) + end + + sig do + override.returns( + { + address: Lithic::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + end + + class BusinessEntity < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::KYB::BusinessEntity, Lithic::Internal::AnyHash) + end + + # Business's physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + sig { returns(Lithic::Address) } + attr_reader :address + + sig { params(address: Lithic::Address::OrHash).void } + attr_writer :address + + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + sig { returns(String) } + attr_accessor :government_id + + # Legal (formal) business name. + sig { returns(String) } + attr_accessor :legal_business_name + + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + sig { returns(T::Array[String]) } + attr_accessor :phone_numbers + + # Any name that the business operates under that is not its legal business name + # (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :dba_business_name + + sig { params(dba_business_name: String).void } + attr_writer :dba_business_name + + # Parent company name (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :parent_company + + sig { params(parent_company: String).void } + attr_writer :parent_company + + # Information for business for which the account is being opened and KYB is being + # run. + sig do + params( + address: Lithic::Address::OrHash, + government_id: String, + legal_business_name: String, + phone_numbers: T::Array[String], + dba_business_name: String, + parent_company: String + ).returns(T.attached_class) + end + def self.new( + # Business's physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + address:, + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + government_id:, + # Legal (formal) business name. + legal_business_name:, + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + phone_numbers:, + # Any name that the business operates under that is not its legal business name + # (if applicable). + dba_business_name: nil, + # Parent company name (if applicable). + parent_company: nil + ) + end + + sig do + override.returns( + { + address: Lithic::Address, + government_id: String, + legal_business_name: String, + phone_numbers: T::Array[String], + dba_business_name: String, + parent_company: String + } + ) + end + def to_hash + end + end + + class ControlPerson < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::KYB::ControlPerson, Lithic::Internal::AnyHash) + end + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig { returns(Lithic::Address) } + attr_reader :address + + sig { params(address: Lithic::Address::OrHash).void } + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(String) } + attr_accessor :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(String) } + attr_accessor :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :first_name + + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + sig { returns(String) } + attr_accessor :government_id + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + sig do + params( + address: Lithic::Address::OrHash, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + address:, + # Individual's date of birth, as an RFC 3339 date. + dob:, + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + email:, + # Individual's first name, as it appears on government-issued identity documents. + first_name:, + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + government_id:, + # Individual's last name, as it appears on government-issued identity documents. + last_name:, + # Individual's phone number, entered in E.164 format. + phone_number: nil + ) + end + + sig do + override.returns( + { + address: Lithic::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + end + + # Specifies the type of KYB workflow to run. + module Workflow + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::KYB::Workflow) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + KYB_BASIC = T.let(:KYB_BASIC, Lithic::KYB::Workflow::TaggedSymbol) + KYB_BYO = T.let(:KYB_BYO, Lithic::KYB::Workflow::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::KYB::Workflow::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/kyb_business_entity.rbi b/rbi/lithic/models/kyb_business_entity.rbi new file mode 100644 index 00000000..00c46b39 --- /dev/null +++ b/rbi/lithic/models/kyb_business_entity.rbi @@ -0,0 +1,176 @@ +# typed: strong + +module Lithic + module Models + class KYBBusinessEntity < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::KYBBusinessEntity, Lithic::Internal::AnyHash) + end + + # Business''s physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + sig { returns(Lithic::KYBBusinessEntity::Address) } + attr_reader :address + + sig { params(address: Lithic::KYBBusinessEntity::Address::OrHash).void } + attr_writer :address + + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + sig { returns(String) } + attr_accessor :government_id + + # Legal (formal) business name. + sig { returns(String) } + attr_accessor :legal_business_name + + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + sig { returns(T::Array[String]) } + attr_accessor :phone_numbers + + # Any name that the business operates under that is not its legal business name + # (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :dba_business_name + + sig { params(dba_business_name: String).void } + attr_writer :dba_business_name + + # Parent company name (if applicable). + sig { returns(T.nilable(String)) } + attr_accessor :parent_company + + sig do + params( + address: Lithic::KYBBusinessEntity::Address::OrHash, + government_id: String, + legal_business_name: String, + phone_numbers: T::Array[String], + dba_business_name: String, + parent_company: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Business''s physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + address:, + # Government-issued identification number. US Federal Employer Identification + # Numbers (EIN) are currently supported, entered as full nine-digits, with or + # without hyphens. + government_id:, + # Legal (formal) business name. + legal_business_name:, + # One or more of the business's phone number(s), entered as a list in E.164 + # format. + phone_numbers:, + # Any name that the business operates under that is not its legal business name + # (if applicable). + dba_business_name: nil, + # Parent company name (if applicable). + parent_company: nil + ) + end + + sig do + override.returns( + { + address: Lithic::KYBBusinessEntity::Address, + government_id: String, + legal_business_name: String, + phone_numbers: T::Array[String], + dba_business_name: String, + parent_company: T.nilable(String) + } + ) + end + def to_hash + end + + class Address < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::KYBBusinessEntity::Address, Lithic::Internal::AnyHash) + end + + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Business''s physical address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ).returns(T.attached_class) + end + def self.new( + # Valid deliverable address (no PO boxes). + address1:, + # Name of city. + city:, + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + country:, + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + postal_code:, + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + state:, + # Unit or apartment number (if applicable). + address2: nil + ) + end + + sig do + override.returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/kyc.rbi b/rbi/lithic/models/kyc.rbi new file mode 100644 index 00000000..4e7b0d65 --- /dev/null +++ b/rbi/lithic/models/kyc.rbi @@ -0,0 +1,199 @@ +# typed: strong + +module Lithic + module Models + class KYC < Lithic::Internal::Type::BaseModel + OrHash = T.type_alias { T.any(Lithic::KYC, Lithic::Internal::AnyHash) } + + # Information on individual for whom the account is being opened and KYC is being + # run. + sig { returns(Lithic::KYC::Individual) } + attr_reader :individual + + sig { params(individual: Lithic::KYC::Individual::OrHash).void } + attr_writer :individual + + # An RFC 3339 timestamp indicating when the account holder accepted the applicable + # legal agreements (e.g., cardholder terms) as agreed upon during API customer's + # implementation with Lithic. + sig { returns(String) } + attr_accessor :tos_timestamp + + # Specifies the type of KYC workflow to run. + sig { returns(Lithic::KYC::Workflow::OrSymbol) } + attr_accessor :workflow + + # A user provided id that can be used to link an account holder with an external + # system + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # An RFC 3339 timestamp indicating when precomputed KYC was completed on the + # individual with a pass result. + # + # This field is required only if workflow type is `KYC_BYO`. + sig { returns(T.nilable(String)) } + attr_reader :kyc_passed_timestamp + + sig { params(kyc_passed_timestamp: String).void } + attr_writer :kyc_passed_timestamp + + sig do + params( + individual: Lithic::KYC::Individual::OrHash, + tos_timestamp: String, + workflow: Lithic::KYC::Workflow::OrSymbol, + external_id: String, + kyc_passed_timestamp: String + ).returns(T.attached_class) + end + def self.new( + # Information on individual for whom the account is being opened and KYC is being + # run. + individual:, + # An RFC 3339 timestamp indicating when the account holder accepted the applicable + # legal agreements (e.g., cardholder terms) as agreed upon during API customer's + # implementation with Lithic. + tos_timestamp:, + # Specifies the type of KYC workflow to run. + workflow:, + # A user provided id that can be used to link an account holder with an external + # system + external_id: nil, + # An RFC 3339 timestamp indicating when precomputed KYC was completed on the + # individual with a pass result. + # + # This field is required only if workflow type is `KYC_BYO`. + kyc_passed_timestamp: nil + ) + end + + sig do + override.returns( + { + individual: Lithic::KYC::Individual, + tos_timestamp: String, + workflow: Lithic::KYC::Workflow::OrSymbol, + external_id: String, + kyc_passed_timestamp: String + } + ) + end + def to_hash + end + + class Individual < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::KYC::Individual, Lithic::Internal::AnyHash) + end + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig { returns(Lithic::Address) } + attr_reader :address + + sig { params(address: Lithic::Address::OrHash).void } + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(String) } + attr_accessor :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(String) } + attr_accessor :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :first_name + + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + sig { returns(String) } + attr_accessor :government_id + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(String) } + attr_accessor :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(String) } + attr_accessor :phone_number + + # Information on individual for whom the account is being opened and KYC is being + # run. + sig do + params( + address: Lithic::Address::OrHash, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + address:, + # Individual's date of birth, as an RFC 3339 date. + dob:, + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + email:, + # Individual's first name, as it appears on government-issued identity documents. + first_name:, + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + government_id:, + # Individual's last name, as it appears on government-issued identity documents. + last_name:, + # Individual's phone number, entered in E.164 format. + phone_number: + ) + end + + sig do + override.returns( + { + address: Lithic::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + end + + # Specifies the type of KYC workflow to run. + module Workflow + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::KYC::Workflow) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + KYC_BASIC = T.let(:KYC_BASIC, Lithic::KYC::Workflow::TaggedSymbol) + KYC_BYO = T.let(:KYC_BYO, Lithic::KYC::Workflow::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::KYC::Workflow::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/kyc_exempt.rbi b/rbi/lithic/models/kyc_exempt.rbi new file mode 100644 index 00000000..fc7e2813 --- /dev/null +++ b/rbi/lithic/models/kyc_exempt.rbi @@ -0,0 +1,162 @@ +# typed: strong + +module Lithic + module Models + class KYCExempt < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Lithic::KYCExempt, Lithic::Internal::AnyHash) } + + # KYC Exempt user's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + sig { returns(Lithic::Address) } + attr_reader :address + + sig { params(address: Lithic::Address::OrHash).void } + attr_writer :address + + # The KYC Exempt user's email + sig { returns(String) } + attr_accessor :email + + # The KYC Exempt user's first name + sig { returns(String) } + attr_accessor :first_name + + # Specifies the type of KYC Exempt user + sig { returns(Lithic::KYCExempt::KYCExemptionType::OrSymbol) } + attr_accessor :kyc_exemption_type + + # The KYC Exempt user's last name + sig { returns(String) } + attr_accessor :last_name + + # The KYC Exempt user's phone number, entered in E.164 format. + sig { returns(String) } + attr_accessor :phone_number + + # Specifies the workflow type. This must be 'KYC_EXEMPT' + sig { returns(Lithic::KYCExempt::Workflow::OrSymbol) } + attr_accessor :workflow + + # Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # users of businesses. Pass the account_token of the enrolled business associated + # with the AUTHORIZED_USER in this field. + sig { returns(T.nilable(String)) } + attr_reader :business_account_token + + sig { params(business_account_token: String).void } + attr_writer :business_account_token + + # A user provided id that can be used to link an account holder with an external + # system + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + sig do + params( + address: Lithic::Address::OrHash, + email: String, + first_name: String, + kyc_exemption_type: Lithic::KYCExempt::KYCExemptionType::OrSymbol, + last_name: String, + phone_number: String, + workflow: Lithic::KYCExempt::Workflow::OrSymbol, + business_account_token: String, + external_id: String + ).returns(T.attached_class) + end + def self.new( + # KYC Exempt user's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. + address:, + # The KYC Exempt user's email + email:, + # The KYC Exempt user's first name + first_name:, + # Specifies the type of KYC Exempt user + kyc_exemption_type:, + # The KYC Exempt user's last name + last_name:, + # The KYC Exempt user's phone number, entered in E.164 format. + phone_number:, + # Specifies the workflow type. This must be 'KYC_EXEMPT' + workflow:, + # Only applicable for customers using the KYC-Exempt workflow to enroll authorized + # users of businesses. Pass the account_token of the enrolled business associated + # with the AUTHORIZED_USER in this field. + business_account_token: nil, + # A user provided id that can be used to link an account holder with an external + # system + external_id: nil + ) + end + + sig do + override.returns( + { + address: Lithic::Address, + email: String, + first_name: String, + kyc_exemption_type: Lithic::KYCExempt::KYCExemptionType::OrSymbol, + last_name: String, + phone_number: String, + workflow: Lithic::KYCExempt::Workflow::OrSymbol, + business_account_token: String, + external_id: String + } + ) + end + def to_hash + end + + # Specifies the type of KYC Exempt user + module KYCExemptionType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::KYCExempt::KYCExemptionType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AUTHORIZED_USER = + T.let( + :AUTHORIZED_USER, + Lithic::KYCExempt::KYCExemptionType::TaggedSymbol + ) + PREPAID_CARD_USER = + T.let( + :PREPAID_CARD_USER, + Lithic::KYCExempt::KYCExemptionType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::KYCExempt::KYCExemptionType::TaggedSymbol] + ) + end + def self.values + end + end + + # Specifies the workflow type. This must be 'KYC_EXEMPT' + module Workflow + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::KYCExempt::Workflow) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + KYC_EXEMPT = + T.let(:KYC_EXEMPT, Lithic::KYCExempt::Workflow::TaggedSymbol) + + sig do + override.returns(T::Array[Lithic::KYCExempt::Workflow::TaggedSymbol]) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/loan_tape_created_webhook_event.rbi b/rbi/lithic/models/loan_tape_created_webhook_event.rbi new file mode 100644 index 00000000..11b172d8 --- /dev/null +++ b/rbi/lithic/models/loan_tape_created_webhook_event.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Lithic + module Models + class LoanTapeCreatedWebhookEvent < Lithic::Models::FinancialAccounts::LoanTape + OrHash = + T.type_alias do + T.any(Lithic::LoanTapeCreatedWebhookEvent, Lithic::Internal::AnyHash) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"loan_tape.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/loan_tape_updated_webhook_event.rbi b/rbi/lithic/models/loan_tape_updated_webhook_event.rbi new file mode 100644 index 00000000..910b1934 --- /dev/null +++ b/rbi/lithic/models/loan_tape_updated_webhook_event.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Lithic + module Models + class LoanTapeUpdatedWebhookEvent < Lithic::Models::FinancialAccounts::LoanTape + OrHash = + T.type_alias do + T.any(Lithic::LoanTapeUpdatedWebhookEvent, Lithic::Internal::AnyHash) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"loan_tape.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/management_operation_create_params.rbi b/rbi/lithic/models/management_operation_create_params.rbi new file mode 100644 index 00000000..4543f96f --- /dev/null +++ b/rbi/lithic/models/management_operation_create_params.rbi @@ -0,0 +1,407 @@ +# typed: strong + +module Lithic + module Models + class ManagementOperationCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::ManagementOperationCreateParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Integer) } + attr_accessor :amount + + sig do + returns(Lithic::ManagementOperationCreateParams::Category::OrSymbol) + end + attr_accessor :category + + sig do + returns(Lithic::ManagementOperationCreateParams::Direction::OrSymbol) + end + attr_accessor :direction + + sig { returns(Date) } + attr_accessor :effective_date + + sig do + returns(Lithic::ManagementOperationCreateParams::EventType::OrSymbol) + end + attr_accessor :event_type + + sig { returns(String) } + attr_accessor :financial_account_token + + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + # What to do if the financial account is closed when posting an operation + sig do + returns( + T.nilable( + Lithic::ManagementOperationCreateParams::OnClosedAccount::OrSymbol + ) + ) + end + attr_reader :on_closed_account + + sig do + params( + on_closed_account: + Lithic::ManagementOperationCreateParams::OnClosedAccount::OrSymbol + ).void + end + attr_writer :on_closed_account + + sig { returns(T.nilable(String)) } + attr_reader :subtype + + sig { params(subtype: String).void } + attr_writer :subtype + + sig { returns(T.nilable(String)) } + attr_reader :user_defined_id + + sig { params(user_defined_id: String).void } + attr_writer :user_defined_id + + sig do + params( + amount: Integer, + category: Lithic::ManagementOperationCreateParams::Category::OrSymbol, + direction: + Lithic::ManagementOperationCreateParams::Direction::OrSymbol, + effective_date: Date, + event_type: + Lithic::ManagementOperationCreateParams::EventType::OrSymbol, + financial_account_token: String, + token: String, + memo: String, + on_closed_account: + Lithic::ManagementOperationCreateParams::OnClosedAccount::OrSymbol, + subtype: String, + user_defined_id: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + amount:, + category:, + direction:, + effective_date:, + event_type:, + financial_account_token:, + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + token: nil, + memo: nil, + # What to do if the financial account is closed when posting an operation + on_closed_account: nil, + subtype: nil, + user_defined_id: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + amount: Integer, + category: + Lithic::ManagementOperationCreateParams::Category::OrSymbol, + direction: + Lithic::ManagementOperationCreateParams::Direction::OrSymbol, + effective_date: Date, + event_type: + Lithic::ManagementOperationCreateParams::EventType::OrSymbol, + financial_account_token: String, + token: String, + memo: String, + on_closed_account: + Lithic::ManagementOperationCreateParams::OnClosedAccount::OrSymbol, + subtype: String, + user_defined_id: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + module Category + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ManagementOperationCreateParams::Category) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MANAGEMENT_FEE = + T.let( + :MANAGEMENT_FEE, + Lithic::ManagementOperationCreateParams::Category::TaggedSymbol + ) + MANAGEMENT_DISPUTE = + T.let( + :MANAGEMENT_DISPUTE, + Lithic::ManagementOperationCreateParams::Category::TaggedSymbol + ) + MANAGEMENT_REWARD = + T.let( + :MANAGEMENT_REWARD, + Lithic::ManagementOperationCreateParams::Category::TaggedSymbol + ) + MANAGEMENT_ADJUSTMENT = + T.let( + :MANAGEMENT_ADJUSTMENT, + Lithic::ManagementOperationCreateParams::Category::TaggedSymbol + ) + MANAGEMENT_DISBURSEMENT = + T.let( + :MANAGEMENT_DISBURSEMENT, + Lithic::ManagementOperationCreateParams::Category::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ManagementOperationCreateParams::Category::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Direction + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ManagementOperationCreateParams::Direction) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREDIT = + T.let( + :CREDIT, + Lithic::ManagementOperationCreateParams::Direction::TaggedSymbol + ) + DEBIT = + T.let( + :DEBIT, + Lithic::ManagementOperationCreateParams::Direction::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ManagementOperationCreateParams::Direction::TaggedSymbol + ] + ) + end + def self.values + end + end + + module EventType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ManagementOperationCreateParams::EventType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LOSS_WRITE_OFF = + T.let( + :LOSS_WRITE_OFF, + Lithic::ManagementOperationCreateParams::EventType::TaggedSymbol + ) + CASH_BACK = + T.let( + :CASH_BACK, + Lithic::ManagementOperationCreateParams::EventType::TaggedSymbol + ) + CASH_BACK_REVERSAL = + T.let( + :CASH_BACK_REVERSAL, + Lithic::ManagementOperationCreateParams::EventType::TaggedSymbol + ) + CURRENCY_CONVERSION = + T.let( + :CURRENCY_CONVERSION, + Lithic::ManagementOperationCreateParams::EventType::TaggedSymbol + ) + CURRENCY_CONVERSION_REVERSAL = + T.let( + :CURRENCY_CONVERSION_REVERSAL, + Lithic::ManagementOperationCreateParams::EventType::TaggedSymbol + ) + INTEREST = + T.let( + :INTEREST, + Lithic::ManagementOperationCreateParams::EventType::TaggedSymbol + ) + INTEREST_REVERSAL = + T.let( + :INTEREST_REVERSAL, + Lithic::ManagementOperationCreateParams::EventType::TaggedSymbol + ) + LATE_PAYMENT = + T.let( + :LATE_PAYMENT, + Lithic::ManagementOperationCreateParams::EventType::TaggedSymbol + ) + LATE_PAYMENT_REVERSAL = + T.let( + :LATE_PAYMENT_REVERSAL, + Lithic::ManagementOperationCreateParams::EventType::TaggedSymbol + ) + BILLING_ERROR = + T.let( + :BILLING_ERROR, + Lithic::ManagementOperationCreateParams::EventType::TaggedSymbol + ) + BILLING_ERROR_REVERSAL = + T.let( + :BILLING_ERROR_REVERSAL, + Lithic::ManagementOperationCreateParams::EventType::TaggedSymbol + ) + PROVISIONAL_CREDIT = + T.let( + :PROVISIONAL_CREDIT, + Lithic::ManagementOperationCreateParams::EventType::TaggedSymbol + ) + PROVISIONAL_CREDIT_REVERSAL = + T.let( + :PROVISIONAL_CREDIT_REVERSAL, + Lithic::ManagementOperationCreateParams::EventType::TaggedSymbol + ) + RETURNED_PAYMENT = + T.let( + :RETURNED_PAYMENT, + Lithic::ManagementOperationCreateParams::EventType::TaggedSymbol + ) + RETURNED_PAYMENT_REVERSAL = + T.let( + :RETURNED_PAYMENT_REVERSAL, + Lithic::ManagementOperationCreateParams::EventType::TaggedSymbol + ) + DISPUTE_WON = + T.let( + :DISPUTE_WON, + Lithic::ManagementOperationCreateParams::EventType::TaggedSymbol + ) + DISPUTE_WON_REVERSAL = + T.let( + :DISPUTE_WON_REVERSAL, + Lithic::ManagementOperationCreateParams::EventType::TaggedSymbol + ) + DISBURSE = + T.let( + :DISBURSE, + Lithic::ManagementOperationCreateParams::EventType::TaggedSymbol + ) + DISBURSE_REVERSAL = + T.let( + :DISBURSE_REVERSAL, + Lithic::ManagementOperationCreateParams::EventType::TaggedSymbol + ) + ANNUAL = + T.let( + :ANNUAL, + Lithic::ManagementOperationCreateParams::EventType::TaggedSymbol + ) + ANNUAL_REVERSAL = + T.let( + :ANNUAL_REVERSAL, + Lithic::ManagementOperationCreateParams::EventType::TaggedSymbol + ) + QUARTERLY = + T.let( + :QUARTERLY, + Lithic::ManagementOperationCreateParams::EventType::TaggedSymbol + ) + QUARTERLY_REVERSAL = + T.let( + :QUARTERLY_REVERSAL, + Lithic::ManagementOperationCreateParams::EventType::TaggedSymbol + ) + MONTHLY = + T.let( + :MONTHLY, + Lithic::ManagementOperationCreateParams::EventType::TaggedSymbol + ) + MONTHLY_REVERSAL = + T.let( + :MONTHLY_REVERSAL, + Lithic::ManagementOperationCreateParams::EventType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ManagementOperationCreateParams::EventType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # What to do if the financial account is closed when posting an operation + module OnClosedAccount + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::ManagementOperationCreateParams::OnClosedAccount + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FAIL = + T.let( + :FAIL, + Lithic::ManagementOperationCreateParams::OnClosedAccount::TaggedSymbol + ) + USE_SUSPENSE = + T.let( + :USE_SUSPENSE, + Lithic::ManagementOperationCreateParams::OnClosedAccount::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ManagementOperationCreateParams::OnClosedAccount::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/management_operation_created_webhook_event.rbi b/rbi/lithic/models/management_operation_created_webhook_event.rbi new file mode 100644 index 00000000..71e6c48c --- /dev/null +++ b/rbi/lithic/models/management_operation_created_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class ManagementOperationCreatedWebhookEvent < Lithic::Models::ManagementOperationTransaction + OrHash = + T.type_alias do + T.any( + Lithic::ManagementOperationCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"management_operation.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/management_operation_list_params.rbi b/rbi/lithic/models/management_operation_list_params.rbi new file mode 100644 index 00000000..989387dd --- /dev/null +++ b/rbi/lithic/models/management_operation_list_params.rbi @@ -0,0 +1,260 @@ +# typed: strong + +module Lithic + module Models + class ManagementOperationListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::ManagementOperationListParams, + Lithic::Internal::AnyHash + ) + end + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + sig { returns(T.nilable(String)) } + attr_reader :business_account_token + + sig { params(business_account_token: String).void } + attr_writer :business_account_token + + # Management operation category to be returned. + sig do + returns( + T.nilable(Lithic::ManagementOperationListParams::Category::OrSymbol) + ) + end + attr_reader :category + + sig do + params( + category: Lithic::ManagementOperationListParams::Category::OrSymbol + ).void + end + attr_writer :category + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Globally unique identifier for the financial account. Accepted type dependent on + # the program's use case. + sig { returns(T.nilable(String)) } + attr_reader :financial_account_token + + sig { params(financial_account_token: String).void } + attr_writer :financial_account_token + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + # Management operation status to be returned. + sig do + returns( + T.nilable(Lithic::ManagementOperationListParams::Status::OrSymbol) + ) + end + attr_reader :status + + sig do + params( + status: Lithic::ManagementOperationListParams::Status::OrSymbol + ).void + end + attr_writer :status + + sig do + params( + begin_: Time, + business_account_token: String, + category: Lithic::ManagementOperationListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + starting_after: String, + status: Lithic::ManagementOperationListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + business_account_token: nil, + # Management operation category to be returned. + category: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Globally unique identifier for the financial account. Accepted type dependent on + # the program's use case. + financial_account_token: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Management operation status to be returned. + status: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + begin_: Time, + business_account_token: String, + category: Lithic::ManagementOperationListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + starting_after: String, + status: Lithic::ManagementOperationListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Management operation category to be returned. + module Category + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ManagementOperationListParams::Category) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MANAGEMENT_FEE = + T.let( + :MANAGEMENT_FEE, + Lithic::ManagementOperationListParams::Category::TaggedSymbol + ) + MANAGEMENT_DISPUTE = + T.let( + :MANAGEMENT_DISPUTE, + Lithic::ManagementOperationListParams::Category::TaggedSymbol + ) + MANAGEMENT_REWARD = + T.let( + :MANAGEMENT_REWARD, + Lithic::ManagementOperationListParams::Category::TaggedSymbol + ) + MANAGEMENT_ADJUSTMENT = + T.let( + :MANAGEMENT_ADJUSTMENT, + Lithic::ManagementOperationListParams::Category::TaggedSymbol + ) + MANAGEMENT_DISBURSEMENT = + T.let( + :MANAGEMENT_DISBURSEMENT, + Lithic::ManagementOperationListParams::Category::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ManagementOperationListParams::Category::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Management operation status to be returned. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ManagementOperationListParams::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :PENDING, + Lithic::ManagementOperationListParams::Status::TaggedSymbol + ) + SETTLED = + T.let( + :SETTLED, + Lithic::ManagementOperationListParams::Status::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::ManagementOperationListParams::Status::TaggedSymbol + ) + REVERSED = + T.let( + :REVERSED, + Lithic::ManagementOperationListParams::Status::TaggedSymbol + ) + CANCELED = + T.let( + :CANCELED, + Lithic::ManagementOperationListParams::Status::TaggedSymbol + ) + RETURNED = + T.let( + :RETURNED, + Lithic::ManagementOperationListParams::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ManagementOperationListParams::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/management_operation_retrieve_params.rbi b/rbi/lithic/models/management_operation_retrieve_params.rbi new file mode 100644 index 00000000..87a82218 --- /dev/null +++ b/rbi/lithic/models/management_operation_retrieve_params.rbi @@ -0,0 +1,41 @@ +# typed: strong + +module Lithic + module Models + class ManagementOperationRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::ManagementOperationRetrieveParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :management_operation_token + + sig do + params( + management_operation_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(management_operation_token:, request_options: {}) + end + + sig do + override.returns( + { + management_operation_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/management_operation_reverse_params.rbi b/rbi/lithic/models/management_operation_reverse_params.rbi new file mode 100644 index 00000000..1c76756b --- /dev/null +++ b/rbi/lithic/models/management_operation_reverse_params.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module Lithic + module Models + class ManagementOperationReverseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::ManagementOperationReverseParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :management_operation_token + + sig { returns(Date) } + attr_accessor :effective_date + + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + sig do + params( + management_operation_token: String, + effective_date: Date, + memo: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + management_operation_token:, + effective_date:, + memo: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + management_operation_token: String, + effective_date: Date, + memo: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/management_operation_transaction.rbi b/rbi/lithic/models/management_operation_transaction.rbi new file mode 100644 index 00000000..5d798ea8 --- /dev/null +++ b/rbi/lithic/models/management_operation_transaction.rbi @@ -0,0 +1,802 @@ +# typed: strong + +module Lithic + module Models + class ManagementOperationTransaction < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ManagementOperationTransaction, + Lithic::Internal::AnyHash + ) + end + + # Unique identifier for the transaction + sig { returns(String) } + attr_accessor :token + + # ISO 8601 timestamp of when the transaction was created + sig { returns(Time) } + attr_accessor :created + + # The status of the transaction + sig do + returns(Lithic::ManagementOperationTransaction::Status::TaggedSymbol) + end + attr_accessor :status + + # ISO 8601 timestamp of when the transaction was last updated + sig { returns(Time) } + attr_accessor :updated + + sig do + returns( + T.nilable( + Lithic::ManagementOperationTransaction::Category::TaggedSymbol + ) + ) + end + attr_reader :category + + sig do + params( + category: Lithic::ManagementOperationTransaction::Category::OrSymbol + ).void + end + attr_writer :category + + sig { returns(T.nilable(String)) } + attr_reader :currency + + sig { params(currency: String).void } + attr_writer :currency + + sig do + returns( + T.nilable( + Lithic::ManagementOperationTransaction::Direction::TaggedSymbol + ) + ) + end + attr_reader :direction + + sig do + params( + direction: Lithic::ManagementOperationTransaction::Direction::OrSymbol + ).void + end + attr_writer :direction + + sig do + returns( + T.nilable(T::Array[Lithic::ManagementOperationTransaction::Event]) + ) + end + attr_reader :events + + sig do + params( + events: + T::Array[Lithic::ManagementOperationTransaction::Event::OrHash] + ).void + end + attr_writer :events + + # External resource associated with the management operation + sig { returns(T.nilable(Lithic::ExternalResource)) } + attr_reader :external_resource + + sig do + params( + external_resource: T.nilable(Lithic::ExternalResource::OrHash) + ).void + end + attr_writer :external_resource + + # MANAGEMENT_OPERATION - Management Operation Transaction + sig do + returns( + T.nilable( + Lithic::ManagementOperationTransaction::Family::TaggedSymbol + ) + ) + end + attr_reader :family + + sig do + params( + family: Lithic::ManagementOperationTransaction::Family::OrSymbol + ).void + end + attr_writer :family + + sig { returns(T.nilable(String)) } + attr_reader :financial_account_token + + sig { params(financial_account_token: String).void } + attr_writer :financial_account_token + + sig { returns(T.nilable(Integer)) } + attr_reader :pending_amount + + sig { params(pending_amount: Integer).void } + attr_writer :pending_amount + + sig do + returns( + T.nilable( + Lithic::ManagementOperationTransaction::Result::TaggedSymbol + ) + ) + end + attr_reader :result + + sig do + params( + result: Lithic::ManagementOperationTransaction::Result::OrSymbol + ).void + end + attr_writer :result + + sig { returns(T.nilable(Integer)) } + attr_reader :settled_amount + + sig { params(settled_amount: Integer).void } + attr_writer :settled_amount + + sig do + returns( + T.nilable(Lithic::ManagementOperationTransaction::TransactionSeries) + ) + end + attr_reader :transaction_series + + sig do + params( + transaction_series: + T.nilable( + Lithic::ManagementOperationTransaction::TransactionSeries::OrHash + ) + ).void + end + attr_writer :transaction_series + + sig { returns(T.nilable(String)) } + attr_accessor :user_defined_id + + sig do + params( + token: String, + created: Time, + status: Lithic::ManagementOperationTransaction::Status::OrSymbol, + updated: Time, + category: Lithic::ManagementOperationTransaction::Category::OrSymbol, + currency: String, + direction: + Lithic::ManagementOperationTransaction::Direction::OrSymbol, + events: + T::Array[Lithic::ManagementOperationTransaction::Event::OrHash], + external_resource: T.nilable(Lithic::ExternalResource::OrHash), + family: Lithic::ManagementOperationTransaction::Family::OrSymbol, + financial_account_token: String, + pending_amount: Integer, + result: Lithic::ManagementOperationTransaction::Result::OrSymbol, + settled_amount: Integer, + transaction_series: + T.nilable( + Lithic::ManagementOperationTransaction::TransactionSeries::OrHash + ), + user_defined_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the transaction + token:, + # ISO 8601 timestamp of when the transaction was created + created:, + # The status of the transaction + status:, + # ISO 8601 timestamp of when the transaction was last updated + updated:, + category: nil, + currency: nil, + direction: nil, + events: nil, + # External resource associated with the management operation + external_resource: nil, + # MANAGEMENT_OPERATION - Management Operation Transaction + family: nil, + financial_account_token: nil, + pending_amount: nil, + result: nil, + settled_amount: nil, + transaction_series: nil, + user_defined_id: nil + ) + end + + sig do + override.returns( + { + token: String, + created: Time, + status: + Lithic::ManagementOperationTransaction::Status::TaggedSymbol, + updated: Time, + category: + Lithic::ManagementOperationTransaction::Category::TaggedSymbol, + currency: String, + direction: + Lithic::ManagementOperationTransaction::Direction::TaggedSymbol, + events: T::Array[Lithic::ManagementOperationTransaction::Event], + external_resource: T.nilable(Lithic::ExternalResource), + family: + Lithic::ManagementOperationTransaction::Family::TaggedSymbol, + financial_account_token: String, + pending_amount: Integer, + result: + Lithic::ManagementOperationTransaction::Result::TaggedSymbol, + settled_amount: Integer, + transaction_series: + T.nilable( + Lithic::ManagementOperationTransaction::TransactionSeries + ), + user_defined_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The status of the transaction + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ManagementOperationTransaction::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :PENDING, + Lithic::ManagementOperationTransaction::Status::TaggedSymbol + ) + SETTLED = + T.let( + :SETTLED, + Lithic::ManagementOperationTransaction::Status::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::ManagementOperationTransaction::Status::TaggedSymbol + ) + REVERSED = + T.let( + :REVERSED, + Lithic::ManagementOperationTransaction::Status::TaggedSymbol + ) + CANCELED = + T.let( + :CANCELED, + Lithic::ManagementOperationTransaction::Status::TaggedSymbol + ) + RETURNED = + T.let( + :RETURNED, + Lithic::ManagementOperationTransaction::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ManagementOperationTransaction::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Category + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ManagementOperationTransaction::Category) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MANAGEMENT_FEE = + T.let( + :MANAGEMENT_FEE, + Lithic::ManagementOperationTransaction::Category::TaggedSymbol + ) + MANAGEMENT_DISPUTE = + T.let( + :MANAGEMENT_DISPUTE, + Lithic::ManagementOperationTransaction::Category::TaggedSymbol + ) + MANAGEMENT_REWARD = + T.let( + :MANAGEMENT_REWARD, + Lithic::ManagementOperationTransaction::Category::TaggedSymbol + ) + MANAGEMENT_ADJUSTMENT = + T.let( + :MANAGEMENT_ADJUSTMENT, + Lithic::ManagementOperationTransaction::Category::TaggedSymbol + ) + MANAGEMENT_DISBURSEMENT = + T.let( + :MANAGEMENT_DISBURSEMENT, + Lithic::ManagementOperationTransaction::Category::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ManagementOperationTransaction::Category::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Direction + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ManagementOperationTransaction::Direction) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREDIT = + T.let( + :CREDIT, + Lithic::ManagementOperationTransaction::Direction::TaggedSymbol + ) + DEBIT = + T.let( + :DEBIT, + Lithic::ManagementOperationTransaction::Direction::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ManagementOperationTransaction::Direction::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Event < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ManagementOperationTransaction::Event, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :token + + sig { returns(Integer) } + attr_accessor :amount + + sig { returns(Time) } + attr_accessor :created + + sig do + returns( + T::Array[ + Lithic::ManagementOperationTransaction::Event::DetailedResult::TaggedSymbol + ] + ) + end + attr_accessor :detailed_results + + sig { returns(Date) } + attr_accessor :effective_date + + sig { returns(String) } + attr_accessor :memo + + sig do + returns( + Lithic::ManagementOperationTransaction::Event::Result::TaggedSymbol + ) + end + attr_accessor :result + + sig do + returns( + Lithic::ManagementOperationTransaction::Event::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig { returns(T.nilable(String)) } + attr_accessor :subtype + + sig do + params( + token: String, + amount: Integer, + created: Time, + detailed_results: + T::Array[ + Lithic::ManagementOperationTransaction::Event::DetailedResult::OrSymbol + ], + effective_date: Date, + memo: String, + result: + Lithic::ManagementOperationTransaction::Event::Result::OrSymbol, + type: Lithic::ManagementOperationTransaction::Event::Type::OrSymbol, + subtype: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + token:, + amount:, + created:, + detailed_results:, + effective_date:, + memo:, + result:, + type:, + subtype: nil + ) + end + + sig do + override.returns( + { + token: String, + amount: Integer, + created: Time, + detailed_results: + T::Array[ + Lithic::ManagementOperationTransaction::Event::DetailedResult::TaggedSymbol + ], + effective_date: Date, + memo: String, + result: + Lithic::ManagementOperationTransaction::Event::Result::TaggedSymbol, + type: + Lithic::ManagementOperationTransaction::Event::Type::TaggedSymbol, + subtype: T.nilable(String) + } + ) + end + def to_hash + end + + module DetailedResult + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::ManagementOperationTransaction::Event::DetailedResult + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::ManagementOperationTransaction::Event::DetailedResult::TaggedSymbol + ) + INSUFFICIENT_FUNDS = + T.let( + :INSUFFICIENT_FUNDS, + Lithic::ManagementOperationTransaction::Event::DetailedResult::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ManagementOperationTransaction::Event::DetailedResult::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::ManagementOperationTransaction::Event::Result + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::ManagementOperationTransaction::Event::Result::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::ManagementOperationTransaction::Event::Result::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ManagementOperationTransaction::Event::Result::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ManagementOperationTransaction::Event::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LOSS_WRITE_OFF = + T.let( + :LOSS_WRITE_OFF, + Lithic::ManagementOperationTransaction::Event::Type::TaggedSymbol + ) + CASH_BACK = + T.let( + :CASH_BACK, + Lithic::ManagementOperationTransaction::Event::Type::TaggedSymbol + ) + CASH_BACK_REVERSAL = + T.let( + :CASH_BACK_REVERSAL, + Lithic::ManagementOperationTransaction::Event::Type::TaggedSymbol + ) + CURRENCY_CONVERSION = + T.let( + :CURRENCY_CONVERSION, + Lithic::ManagementOperationTransaction::Event::Type::TaggedSymbol + ) + CURRENCY_CONVERSION_REVERSAL = + T.let( + :CURRENCY_CONVERSION_REVERSAL, + Lithic::ManagementOperationTransaction::Event::Type::TaggedSymbol + ) + INTEREST = + T.let( + :INTEREST, + Lithic::ManagementOperationTransaction::Event::Type::TaggedSymbol + ) + INTEREST_REVERSAL = + T.let( + :INTEREST_REVERSAL, + Lithic::ManagementOperationTransaction::Event::Type::TaggedSymbol + ) + LATE_PAYMENT = + T.let( + :LATE_PAYMENT, + Lithic::ManagementOperationTransaction::Event::Type::TaggedSymbol + ) + LATE_PAYMENT_REVERSAL = + T.let( + :LATE_PAYMENT_REVERSAL, + Lithic::ManagementOperationTransaction::Event::Type::TaggedSymbol + ) + BILLING_ERROR = + T.let( + :BILLING_ERROR, + Lithic::ManagementOperationTransaction::Event::Type::TaggedSymbol + ) + BILLING_ERROR_REVERSAL = + T.let( + :BILLING_ERROR_REVERSAL, + Lithic::ManagementOperationTransaction::Event::Type::TaggedSymbol + ) + PROVISIONAL_CREDIT = + T.let( + :PROVISIONAL_CREDIT, + Lithic::ManagementOperationTransaction::Event::Type::TaggedSymbol + ) + PROVISIONAL_CREDIT_REVERSAL = + T.let( + :PROVISIONAL_CREDIT_REVERSAL, + Lithic::ManagementOperationTransaction::Event::Type::TaggedSymbol + ) + RETURNED_PAYMENT = + T.let( + :RETURNED_PAYMENT, + Lithic::ManagementOperationTransaction::Event::Type::TaggedSymbol + ) + RETURNED_PAYMENT_REVERSAL = + T.let( + :RETURNED_PAYMENT_REVERSAL, + Lithic::ManagementOperationTransaction::Event::Type::TaggedSymbol + ) + DISPUTE_WON = + T.let( + :DISPUTE_WON, + Lithic::ManagementOperationTransaction::Event::Type::TaggedSymbol + ) + DISPUTE_WON_REVERSAL = + T.let( + :DISPUTE_WON_REVERSAL, + Lithic::ManagementOperationTransaction::Event::Type::TaggedSymbol + ) + DISBURSE = + T.let( + :DISBURSE, + Lithic::ManagementOperationTransaction::Event::Type::TaggedSymbol + ) + DISBURSE_REVERSAL = + T.let( + :DISBURSE_REVERSAL, + Lithic::ManagementOperationTransaction::Event::Type::TaggedSymbol + ) + ANNUAL = + T.let( + :ANNUAL, + Lithic::ManagementOperationTransaction::Event::Type::TaggedSymbol + ) + ANNUAL_REVERSAL = + T.let( + :ANNUAL_REVERSAL, + Lithic::ManagementOperationTransaction::Event::Type::TaggedSymbol + ) + QUARTERLY = + T.let( + :QUARTERLY, + Lithic::ManagementOperationTransaction::Event::Type::TaggedSymbol + ) + QUARTERLY_REVERSAL = + T.let( + :QUARTERLY_REVERSAL, + Lithic::ManagementOperationTransaction::Event::Type::TaggedSymbol + ) + MONTHLY = + T.let( + :MONTHLY, + Lithic::ManagementOperationTransaction::Event::Type::TaggedSymbol + ) + MONTHLY_REVERSAL = + T.let( + :MONTHLY_REVERSAL, + Lithic::ManagementOperationTransaction::Event::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ManagementOperationTransaction::Event::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + # MANAGEMENT_OPERATION - Management Operation Transaction + module Family + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ManagementOperationTransaction::Family) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MANAGEMENT_OPERATION = + T.let( + :MANAGEMENT_OPERATION, + Lithic::ManagementOperationTransaction::Family::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ManagementOperationTransaction::Family::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ManagementOperationTransaction::Result) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::ManagementOperationTransaction::Result::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::ManagementOperationTransaction::Result::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ManagementOperationTransaction::Result::TaggedSymbol + ] + ) + end + def self.values + end + end + + class TransactionSeries < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ManagementOperationTransaction::TransactionSeries, + Lithic::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :related_transaction_event_token + + sig { returns(T.nilable(String)) } + attr_accessor :related_transaction_token + + sig { returns(String) } + attr_accessor :type + + sig do + params( + related_transaction_event_token: T.nilable(String), + related_transaction_token: T.nilable(String), + type: String + ).returns(T.attached_class) + end + def self.new( + related_transaction_event_token:, + related_transaction_token:, + type: + ) + end + + sig do + override.returns( + { + related_transaction_event_token: T.nilable(String), + related_transaction_token: T.nilable(String), + type: String + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/management_operation_updated_webhook_event.rbi b/rbi/lithic/models/management_operation_updated_webhook_event.rbi new file mode 100644 index 00000000..4e80252a --- /dev/null +++ b/rbi/lithic/models/management_operation_updated_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class ManagementOperationUpdatedWebhookEvent < Lithic::Models::ManagementOperationTransaction + OrHash = + T.type_alias do + T.any( + Lithic::ManagementOperationUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"management_operation.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/merchant.rbi b/rbi/lithic/models/merchant.rbi new file mode 100644 index 00000000..ae956093 --- /dev/null +++ b/rbi/lithic/models/merchant.rbi @@ -0,0 +1,89 @@ +# typed: strong + +module Lithic + module Models + class Merchant < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Lithic::Merchant, Lithic::Internal::AnyHash) } + + # Unique alphanumeric identifier for the payment card acceptor (merchant). + sig { returns(String) } + attr_accessor :acceptor_id + + # Unique numeric identifier of the acquiring institution. + sig { returns(String) } + attr_accessor :acquiring_institution_id + + # City of card acceptor. Note that in many cases, particularly in card-not-present + # transactions, merchants may send through a phone number or URL in this field. + sig { returns(String) } + attr_accessor :city + + # Country or entity of card acceptor. Possible values are: (1) all ISO 3166-1 + # alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for Netherlands Antilles. + sig { returns(String) } + attr_accessor :country + + # Short description of card acceptor. + sig { returns(String) } + attr_accessor :descriptor + + # Merchant category code (MCC). A four-digit number listed in ISO 18245. An MCC is + # used to classify a business by the types of goods or services it provides. + sig { returns(String) } + attr_accessor :mcc + + # Geographic state of card acceptor. + sig { returns(String) } + attr_accessor :state + + sig do + params( + acceptor_id: String, + acquiring_institution_id: String, + city: String, + country: String, + descriptor: String, + mcc: String, + state: String + ).returns(T.attached_class) + end + def self.new( + # Unique alphanumeric identifier for the payment card acceptor (merchant). + acceptor_id:, + # Unique numeric identifier of the acquiring institution. + acquiring_institution_id:, + # City of card acceptor. Note that in many cases, particularly in card-not-present + # transactions, merchants may send through a phone number or URL in this field. + city:, + # Country or entity of card acceptor. Possible values are: (1) all ISO 3166-1 + # alpha-3 country codes, (2) QZZ for Kosovo, and (3) ANT for Netherlands Antilles. + country:, + # Short description of card acceptor. + descriptor:, + # Merchant category code (MCC). A four-digit number listed in ISO 18245. An MCC is + # used to classify a business by the types of goods or services it provides. + mcc:, + # Geographic state of card acceptor. + state: + ) + end + + sig do + override.returns( + { + acceptor_id: String, + acquiring_institution_id: String, + city: String, + country: String, + descriptor: String, + mcc: String, + state: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/message_attempt.rbi b/rbi/lithic/models/message_attempt.rbi new file mode 100644 index 00000000..5ebd47ac --- /dev/null +++ b/rbi/lithic/models/message_attempt.rbi @@ -0,0 +1,118 @@ +# typed: strong + +module Lithic + module Models + class MessageAttempt < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::MessageAttempt, Lithic::Internal::AnyHash) + end + + # Globally unique identifier. + sig { returns(String) } + attr_accessor :token + + # An RFC 3339 timestamp for when the event was created. UTC time zone. + # + # If no timezone is specified, UTC will be used. + sig { returns(Time) } + attr_accessor :created + + # Globally unique identifier. + sig { returns(String) } + attr_accessor :event_subscription_token + + # Globally unique identifier. + sig { returns(String) } + attr_accessor :event_token + + # The response body from the event subscription's URL. + sig { returns(String) } + attr_accessor :response + + # The response status code from the event subscription's URL. + sig { returns(Integer) } + attr_accessor :response_status_code + + # The status of the event attempt. + sig { returns(Lithic::MessageAttempt::Status::TaggedSymbol) } + attr_accessor :status + + sig { returns(String) } + attr_accessor :url + + # A subscription to specific event types. + sig do + params( + token: String, + created: Time, + event_subscription_token: String, + event_token: String, + response: String, + response_status_code: Integer, + status: Lithic::MessageAttempt::Status::OrSymbol, + url: String + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier. + token:, + # An RFC 3339 timestamp for when the event was created. UTC time zone. + # + # If no timezone is specified, UTC will be used. + created:, + # Globally unique identifier. + event_subscription_token:, + # Globally unique identifier. + event_token:, + # The response body from the event subscription's URL. + response:, + # The response status code from the event subscription's URL. + response_status_code:, + # The status of the event attempt. + status:, + url: + ) + end + + sig do + override.returns( + { + token: String, + created: Time, + event_subscription_token: String, + event_token: String, + response: String, + response_status_code: Integer, + status: Lithic::MessageAttempt::Status::TaggedSymbol, + url: String + } + ) + end + def to_hash + end + + # The status of the event attempt. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::MessageAttempt::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FAILED = T.let(:FAILED, Lithic::MessageAttempt::Status::TaggedSymbol) + PENDING = T.let(:PENDING, Lithic::MessageAttempt::Status::TaggedSymbol) + SENDING = T.let(:SENDING, Lithic::MessageAttempt::Status::TaggedSymbol) + SUCCESS = T.let(:SUCCESS, Lithic::MessageAttempt::Status::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::MessageAttempt::Status::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/network_program.rbi b/rbi/lithic/models/network_program.rbi new file mode 100644 index 00000000..ef671164 --- /dev/null +++ b/rbi/lithic/models/network_program.rbi @@ -0,0 +1,61 @@ +# typed: strong + +module Lithic + module Models + class NetworkProgram < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::NetworkProgram, Lithic::Internal::AnyHash) + end + + # Lithic-generated unique identifier for the program + sig { returns(String) } + attr_accessor :token + + # Network product ID associated with this program. + sig { returns(String) } + attr_accessor :default_product_code + + # The name of the network program. + sig { returns(String) } + attr_accessor :name + + # RPIN value assigned by the network. + sig { returns(String) } + attr_accessor :registered_program_identification_number + + sig do + params( + token: String, + default_product_code: String, + name: String, + registered_program_identification_number: String + ).returns(T.attached_class) + end + def self.new( + # Lithic-generated unique identifier for the program + token:, + # Network product ID associated with this program. + default_product_code:, + # The name of the network program. + name:, + # RPIN value assigned by the network. + registered_program_identification_number: + ) + end + + sig do + override.returns( + { + token: String, + default_product_code: String, + name: String, + registered_program_identification_number: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/network_program_list_params.rbi b/rbi/lithic/models/network_program_list_params.rbi new file mode 100644 index 00000000..4a32c1ac --- /dev/null +++ b/rbi/lithic/models/network_program_list_params.rbi @@ -0,0 +1,72 @@ +# typed: strong + +module Lithic + module Models + class NetworkProgramListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::NetworkProgramListParams, Lithic::Internal::AnyHash) + end + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + sig do + params( + begin_: Time, + end_: Time, + page_size: Integer, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # Page size (for pagination). + page_size: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + begin_: Time, + end_: Time, + page_size: Integer, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/network_program_retrieve_params.rbi b/rbi/lithic/models/network_program_retrieve_params.rbi new file mode 100644 index 00000000..e56aecb5 --- /dev/null +++ b/rbi/lithic/models/network_program_retrieve_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Lithic + module Models + class NetworkProgramRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::NetworkProgramRetrieveParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :network_program_token + + sig do + params( + network_program_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(network_program_token:, request_options: {}) + end + + sig do + override.returns( + { + network_program_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/network_total.rbi b/rbi/lithic/models/network_total.rbi new file mode 100644 index 00000000..220b6c9d --- /dev/null +++ b/rbi/lithic/models/network_total.rbi @@ -0,0 +1,226 @@ +# typed: strong + +module Lithic + module Models + class NetworkTotal < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Lithic::NetworkTotal, Lithic::Internal::AnyHash) } + + # Globally unique identifier. + sig { returns(String) } + attr_accessor :token + + sig { returns(Lithic::NetworkTotal::Amounts) } + attr_reader :amounts + + sig { params(amounts: Lithic::NetworkTotal::Amounts::OrHash).void } + attr_writer :amounts + + # RFC 3339 timestamp for when the record was created. UTC time zone. + sig { returns(Time) } + attr_accessor :created + + # 3-character alphabetic ISO 4217 code. + sig { returns(String) } + attr_accessor :currency + + # The institution that activity occurred on. For Mastercard: ICA (Interbank Card + # Association). For Maestro: institution ID. For Visa: lowest level SRE + # (Settlement Reporting Entity). + sig { returns(String) } + attr_accessor :institution_id + + # Indicates that all settlement records related to this Network Total are + # available in the details endpoint. + sig { returns(T::Boolean) } + attr_accessor :is_complete + + # Card network where the transaction took place. AMEX, VISA, MASTERCARD, MAESTRO, + # or INTERLINK. + sig { returns(Lithic::NetworkTotal::Network::TaggedSymbol) } + attr_accessor :network + + # Date that the network total record applies to. YYYY-MM-DD format. + sig { returns(Date) } + attr_accessor :report_date + + # The institution responsible for settlement. For Mastercard: same as + # `institution_id`. For Maestro: billing ICA. For Visa: Funds Transfer SRE + # (FTSRE). + sig { returns(String) } + attr_accessor :settlement_institution_id + + # Settlement service. + sig { returns(String) } + attr_accessor :settlement_service + + # RFC 3339 timestamp for when the record was last updated. UTC time zone. + sig { returns(Time) } + attr_accessor :updated + + # The clearing cycle that the network total record applies to. Mastercard only. + sig { returns(T.nilable(Integer)) } + attr_reader :cycle + + sig { params(cycle: Integer).void } + attr_writer :cycle + + sig do + params( + token: String, + amounts: Lithic::NetworkTotal::Amounts::OrHash, + created: Time, + currency: String, + institution_id: String, + is_complete: T::Boolean, + network: Lithic::NetworkTotal::Network::OrSymbol, + report_date: Date, + settlement_institution_id: String, + settlement_service: String, + updated: Time, + cycle: Integer + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier. + token:, + amounts:, + # RFC 3339 timestamp for when the record was created. UTC time zone. + created:, + # 3-character alphabetic ISO 4217 code. + currency:, + # The institution that activity occurred on. For Mastercard: ICA (Interbank Card + # Association). For Maestro: institution ID. For Visa: lowest level SRE + # (Settlement Reporting Entity). + institution_id:, + # Indicates that all settlement records related to this Network Total are + # available in the details endpoint. + is_complete:, + # Card network where the transaction took place. AMEX, VISA, MASTERCARD, MAESTRO, + # or INTERLINK. + network:, + # Date that the network total record applies to. YYYY-MM-DD format. + report_date:, + # The institution responsible for settlement. For Mastercard: same as + # `institution_id`. For Maestro: billing ICA. For Visa: Funds Transfer SRE + # (FTSRE). + settlement_institution_id:, + # Settlement service. + settlement_service:, + # RFC 3339 timestamp for when the record was last updated. UTC time zone. + updated:, + # The clearing cycle that the network total record applies to. Mastercard only. + cycle: nil + ) + end + + sig do + override.returns( + { + token: String, + amounts: Lithic::NetworkTotal::Amounts, + created: Time, + currency: String, + institution_id: String, + is_complete: T::Boolean, + network: Lithic::NetworkTotal::Network::TaggedSymbol, + report_date: Date, + settlement_institution_id: String, + settlement_service: String, + updated: Time, + cycle: Integer + } + ) + end + def to_hash + end + + class Amounts < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::NetworkTotal::Amounts, Lithic::Internal::AnyHash) + end + + # Total settlement amount excluding interchange, in currency's smallest unit. + sig { returns(Integer) } + attr_accessor :gross_settlement + + # Interchange amount, in currency's smallest unit. + sig { returns(Integer) } + attr_accessor :interchange_fees + + # `gross_settlement` net of `interchange_fees` and `visa_charges` (if applicable), + # in currency's smallest unit. + sig { returns(Integer) } + attr_accessor :net_settlement + + # Charges specific to Visa/Interlink, in currency's smallest unit. + sig { returns(T.nilable(Integer)) } + attr_reader :visa_charges + + sig { params(visa_charges: Integer).void } + attr_writer :visa_charges + + sig do + params( + gross_settlement: Integer, + interchange_fees: Integer, + net_settlement: Integer, + visa_charges: Integer + ).returns(T.attached_class) + end + def self.new( + # Total settlement amount excluding interchange, in currency's smallest unit. + gross_settlement:, + # Interchange amount, in currency's smallest unit. + interchange_fees:, + # `gross_settlement` net of `interchange_fees` and `visa_charges` (if applicable), + # in currency's smallest unit. + net_settlement:, + # Charges specific to Visa/Interlink, in currency's smallest unit. + visa_charges: nil + ) + end + + sig do + override.returns( + { + gross_settlement: Integer, + interchange_fees: Integer, + net_settlement: Integer, + visa_charges: Integer + } + ) + end + def to_hash + end + end + + # Card network where the transaction took place. AMEX, VISA, MASTERCARD, MAESTRO, + # or INTERLINK. + module Network + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::NetworkTotal::Network) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AMEX = T.let(:AMEX, Lithic::NetworkTotal::Network::TaggedSymbol) + VISA = T.let(:VISA, Lithic::NetworkTotal::Network::TaggedSymbol) + MASTERCARD = + T.let(:MASTERCARD, Lithic::NetworkTotal::Network::TaggedSymbol) + MAESTRO = T.let(:MAESTRO, Lithic::NetworkTotal::Network::TaggedSymbol) + INTERLINK = + T.let(:INTERLINK, Lithic::NetworkTotal::Network::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::NetworkTotal::Network::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/network_total_created_webhook_event.rbi b/rbi/lithic/models/network_total_created_webhook_event.rbi new file mode 100644 index 00000000..51aee723 --- /dev/null +++ b/rbi/lithic/models/network_total_created_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class NetworkTotalCreatedWebhookEvent < Lithic::Models::NetworkTotal + OrHash = + T.type_alias do + T.any( + Lithic::NetworkTotalCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"network_total.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/network_total_updated_webhook_event.rbi b/rbi/lithic/models/network_total_updated_webhook_event.rbi new file mode 100644 index 00000000..889ce294 --- /dev/null +++ b/rbi/lithic/models/network_total_updated_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class NetworkTotalUpdatedWebhookEvent < Lithic::Models::NetworkTotal + OrHash = + T.type_alias do + T.any( + Lithic::NetworkTotalUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"network_total.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/non_pci_card.rbi b/rbi/lithic/models/non_pci_card.rbi new file mode 100644 index 00000000..a4cd7147 --- /dev/null +++ b/rbi/lithic/models/non_pci_card.rbi @@ -0,0 +1,690 @@ +# typed: strong + +module Lithic + module Models + class NonPCICard < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Lithic::NonPCICard, Lithic::Internal::AnyHash) } + + # Globally unique identifier. + sig { returns(String) } + attr_accessor :token + + # Globally unique identifier for the account to which the card belongs. + sig { returns(String) } + attr_accessor :account_token + + # Globally unique identifier for the card program on which the card exists. + sig { returns(String) } + attr_accessor :card_program_token + + # An RFC 3339 timestamp for when the card was created. UTC time zone. + sig { returns(Time) } + attr_accessor :created + + # Funding account for a card + sig { returns(T.nilable(Lithic::NonPCICard::Funding)) } + attr_reader :funding + + sig do + params(funding: T.nilable(Lithic::NonPCICard::Funding::OrHash)).void + end + attr_writer :funding + + # Last four digits of the card number. + sig { returns(String) } + attr_accessor :last_four + + # Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect + # attempts). + sig { returns(Lithic::NonPCICard::PinStatus::TaggedSymbol) } + attr_accessor :pin_status + + # Amount (in cents) to limit approved authorizations (e.g. 100000 would be a + # $1,000 limit). Transaction requests above the spend limit will be declined. + sig { returns(Integer) } + attr_accessor :spend_limit + + # Spend limit duration values: + # + # - `ANNUALLY` - Card will authorize transactions up to spend limit for the + # trailing year. + # - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime + # of the card. + # - `MONTHLY` - Card will authorize transactions up to spend limit for the + # trailing month. To support recurring monthly payments, which can occur on + # different day every month, the time window we consider for monthly velocity + # starts 6 days after the current calendar date one month prior. + # - `TRANSACTION` - Card will authorize multiple transactions if each individual + # transaction is under the spend limit. + sig { returns(Lithic::SpendLimitDuration::TaggedSymbol) } + attr_accessor :spend_limit_duration + + # Card state values: _ `CLOSED` - Card will no longer approve authorizations. + # Closing a card cannot be undone. _ `OPEN` - Card will approve authorizations (if + # they match card and account parameters). _ `PAUSED` - Card will decline + # authorizations, but can be resumed at a later time. _ `PENDING_FULFILLMENT` - + # The initial state for cards of type `PHYSICAL`. The card is provisioned pending + # manufacturing and fulfillment. Cards in this state can accept authorizations for + # e-commerce purchases, but not for "Card Present" purchases where the physical + # card itself is present. \* `PENDING_ACTIVATION` - At regular intervals, cards of + # type `PHYSICAL` in state `PENDING_FULFILLMENT` are sent to the card production + # warehouse and updated to state `PENDING_ACTIVATION`. Similar to + # `PENDING_FULFILLMENT`, cards in this state can be used for e-commerce + # transactions or can be added to mobile wallets. API clients should update the + # card's state to `OPEN` only after the cardholder confirms receipt of the card. + # In sandbox, the same daily batch fulfillment occurs, but no cards are actually + # manufactured. + sig { returns(Lithic::NonPCICard::State::TaggedSymbol) } + attr_accessor :state + + # Card types: _ `VIRTUAL` - Card will authorize at any merchant and can be added + # to a digital wallet like Apple Pay or Google Pay (if the card program is digital + # wallet-enabled). _ `PHYSICAL` - Manufactured and sent to the cardholder. We + # offer white label branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe + # functionality. _ `SINGLE_USE` - Card is closed upon first successful + # authorization. _ `MERCHANT_LOCKED` - Card is locked to the first merchant that + # successfully authorizes the card. _ `UNLOCKED` - _[Deprecated]_ Similar behavior + # to VIRTUAL cards, please use VIRTUAL instead. _ `DIGITAL_WALLET` - + # _[Deprecated]_ Similar behavior to VIRTUAL cards, please use VIRTUAL instead. + sig { returns(Lithic::NonPCICard::Type::TaggedSymbol) } + attr_accessor :type + + # List of identifiers for the Auth Rule(s) that are applied on the card. This + # field is deprecated and will no longer be populated in the `Card` object. The + # key will be removed from the schema in a future release. Use the `/auth_rules` + # endpoints to fetch Auth Rule information instead. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :auth_rule_tokens + + sig { params(auth_rule_tokens: T::Array[String]).void } + attr_writer :auth_rule_tokens + + # Globally unique identifier for the bulk order associated with this card. Only + # applicable to physical cards that are part of a bulk shipment + sig { returns(T.nilable(String)) } + attr_accessor :bulk_order_token + + # 3-character alphabetic ISO 4217 code for the currency of the cardholder. + sig { returns(T.nilable(String)) } + attr_reader :cardholder_currency + + sig { params(cardholder_currency: String).void } + attr_writer :cardholder_currency + + # Additional context or information related to the card. + sig { returns(T.nilable(String)) } + attr_reader :comment + + sig { params(comment: String).void } + attr_writer :comment + + # Specifies the digital card art to be displayed in the user's digital wallet + # after tokenization. This artwork must be approved by Mastercard and configured + # by Lithic to use. + sig { returns(T.nilable(String)) } + attr_accessor :digital_card_art_token + + # Two digit (MM) expiry month. + sig { returns(T.nilable(String)) } + attr_reader :exp_month + + sig { params(exp_month: String).void } + attr_writer :exp_month + + # Four digit (yyyy) expiry year. + sig { returns(T.nilable(String)) } + attr_reader :exp_year + + sig { params(exp_year: String).void } + attr_writer :exp_year + + # Hostname of card's locked merchant (will be empty if not applicable). + sig { returns(T.nilable(String)) } + attr_reader :hostname + + sig { params(hostname: String).void } + attr_writer :hostname + + # Friendly name to identify the card. + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + # Globally unique identifier for the card's network program. Null if the card is + # not associated with a network program. Currently applicable to Visa cards + # participating in Account Level Management only + sig { returns(T.nilable(String)) } + attr_accessor :network_program_token + + # Indicates if there are offline PIN changes pending card interaction with an + # offline PIN terminal. Possible commands are: CHANGE_PIN, UNBLOCK_PIN. Applicable + # only to cards issued in markets supporting offline PINs. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :pending_commands + + sig { params(pending_commands: T::Array[String]).void } + attr_writer :pending_commands + + # Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic + # before use. Specifies the configuration (i.e., physical card art) that the card + # should be manufactured with. + sig { returns(T.nilable(String)) } + attr_accessor :product_id + + # If the card is a replacement for another card, the globally unique identifier + # for the card that was replaced. + sig { returns(T.nilable(String)) } + attr_accessor :replacement_for + + # Card state substatus values: _ `LOST` - The physical card is no longer in the + # cardholder's possession due to being lost or never received by the cardholder. _ + # `COMPROMISED` - Card information has been exposed, potentially leading to + # unauthorized access. This may involve physical card theft, cloning, or online + # data breaches. _ `DAMAGED` - The physical card is not functioning properly, such + # as having chip failures or a demagnetized magnetic stripe. _ + # `END_USER_REQUEST` - The cardholder requested the closure of the card for + # reasons unrelated to fraud or damage, such as switching to a different product + # or closing the account. _ `ISSUER_REQUEST` - The issuer closed the card for + # reasons unrelated to fraud or damage, such as account inactivity, product or + # policy changes, or technology upgrades. _ `NOT_ACTIVE` - The card hasn’t had any + # transaction activity for a specified period, applicable to statuses like + # `PAUSED` or `CLOSED`. _ `SUSPICIOUS_ACTIVITY` - The card has one or more + # suspicious transactions or activities that require review. This can involve + # prompting the cardholder to confirm legitimate use or report confirmed fraud. _ + # `INTERNAL_REVIEW` - The card is temporarily paused pending further internal + # review. _ `EXPIRED` - The card has expired and has been closed without being + # reissued. _ `UNDELIVERABLE` - The card cannot be delivered to the cardholder and + # has been returned. \* `OTHER` - The reason for the status does not fall into any + # of the above categories. A comment can be provided to specify the reason. + sig { returns(T.nilable(Lithic::NonPCICard::Substatus::TaggedSymbol)) } + attr_accessor :substatus + + # Card details without PCI information + sig do + params( + token: String, + account_token: String, + card_program_token: String, + created: Time, + funding: T.nilable(Lithic::NonPCICard::Funding::OrHash), + last_four: String, + pin_status: Lithic::NonPCICard::PinStatus::OrSymbol, + spend_limit: Integer, + spend_limit_duration: Lithic::SpendLimitDuration::OrSymbol, + state: Lithic::NonPCICard::State::OrSymbol, + type: Lithic::NonPCICard::Type::OrSymbol, + auth_rule_tokens: T::Array[String], + bulk_order_token: T.nilable(String), + cardholder_currency: String, + comment: String, + digital_card_art_token: T.nilable(String), + exp_month: String, + exp_year: String, + hostname: String, + memo: String, + network_program_token: T.nilable(String), + pending_commands: T::Array[String], + product_id: T.nilable(String), + replacement_for: T.nilable(String), + substatus: T.nilable(Lithic::NonPCICard::Substatus::OrSymbol) + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier. + token:, + # Globally unique identifier for the account to which the card belongs. + account_token:, + # Globally unique identifier for the card program on which the card exists. + card_program_token:, + # An RFC 3339 timestamp for when the card was created. UTC time zone. + created:, + # Funding account for a card + funding:, + # Last four digits of the card number. + last_four:, + # Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect + # attempts). + pin_status:, + # Amount (in cents) to limit approved authorizations (e.g. 100000 would be a + # $1,000 limit). Transaction requests above the spend limit will be declined. + spend_limit:, + # Spend limit duration values: + # + # - `ANNUALLY` - Card will authorize transactions up to spend limit for the + # trailing year. + # - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime + # of the card. + # - `MONTHLY` - Card will authorize transactions up to spend limit for the + # trailing month. To support recurring monthly payments, which can occur on + # different day every month, the time window we consider for monthly velocity + # starts 6 days after the current calendar date one month prior. + # - `TRANSACTION` - Card will authorize multiple transactions if each individual + # transaction is under the spend limit. + spend_limit_duration:, + # Card state values: _ `CLOSED` - Card will no longer approve authorizations. + # Closing a card cannot be undone. _ `OPEN` - Card will approve authorizations (if + # they match card and account parameters). _ `PAUSED` - Card will decline + # authorizations, but can be resumed at a later time. _ `PENDING_FULFILLMENT` - + # The initial state for cards of type `PHYSICAL`. The card is provisioned pending + # manufacturing and fulfillment. Cards in this state can accept authorizations for + # e-commerce purchases, but not for "Card Present" purchases where the physical + # card itself is present. \* `PENDING_ACTIVATION` - At regular intervals, cards of + # type `PHYSICAL` in state `PENDING_FULFILLMENT` are sent to the card production + # warehouse and updated to state `PENDING_ACTIVATION`. Similar to + # `PENDING_FULFILLMENT`, cards in this state can be used for e-commerce + # transactions or can be added to mobile wallets. API clients should update the + # card's state to `OPEN` only after the cardholder confirms receipt of the card. + # In sandbox, the same daily batch fulfillment occurs, but no cards are actually + # manufactured. + state:, + # Card types: _ `VIRTUAL` - Card will authorize at any merchant and can be added + # to a digital wallet like Apple Pay or Google Pay (if the card program is digital + # wallet-enabled). _ `PHYSICAL` - Manufactured and sent to the cardholder. We + # offer white label branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe + # functionality. _ `SINGLE_USE` - Card is closed upon first successful + # authorization. _ `MERCHANT_LOCKED` - Card is locked to the first merchant that + # successfully authorizes the card. _ `UNLOCKED` - _[Deprecated]_ Similar behavior + # to VIRTUAL cards, please use VIRTUAL instead. _ `DIGITAL_WALLET` - + # _[Deprecated]_ Similar behavior to VIRTUAL cards, please use VIRTUAL instead. + type:, + # List of identifiers for the Auth Rule(s) that are applied on the card. This + # field is deprecated and will no longer be populated in the `Card` object. The + # key will be removed from the schema in a future release. Use the `/auth_rules` + # endpoints to fetch Auth Rule information instead. + auth_rule_tokens: nil, + # Globally unique identifier for the bulk order associated with this card. Only + # applicable to physical cards that are part of a bulk shipment + bulk_order_token: nil, + # 3-character alphabetic ISO 4217 code for the currency of the cardholder. + cardholder_currency: nil, + # Additional context or information related to the card. + comment: nil, + # Specifies the digital card art to be displayed in the user's digital wallet + # after tokenization. This artwork must be approved by Mastercard and configured + # by Lithic to use. + digital_card_art_token: nil, + # Two digit (MM) expiry month. + exp_month: nil, + # Four digit (yyyy) expiry year. + exp_year: nil, + # Hostname of card's locked merchant (will be empty if not applicable). + hostname: nil, + # Friendly name to identify the card. + memo: nil, + # Globally unique identifier for the card's network program. Null if the card is + # not associated with a network program. Currently applicable to Visa cards + # participating in Account Level Management only + network_program_token: nil, + # Indicates if there are offline PIN changes pending card interaction with an + # offline PIN terminal. Possible commands are: CHANGE_PIN, UNBLOCK_PIN. Applicable + # only to cards issued in markets supporting offline PINs. + pending_commands: nil, + # Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic + # before use. Specifies the configuration (i.e., physical card art) that the card + # should be manufactured with. + product_id: nil, + # If the card is a replacement for another card, the globally unique identifier + # for the card that was replaced. + replacement_for: nil, + # Card state substatus values: _ `LOST` - The physical card is no longer in the + # cardholder's possession due to being lost or never received by the cardholder. _ + # `COMPROMISED` - Card information has been exposed, potentially leading to + # unauthorized access. This may involve physical card theft, cloning, or online + # data breaches. _ `DAMAGED` - The physical card is not functioning properly, such + # as having chip failures or a demagnetized magnetic stripe. _ + # `END_USER_REQUEST` - The cardholder requested the closure of the card for + # reasons unrelated to fraud or damage, such as switching to a different product + # or closing the account. _ `ISSUER_REQUEST` - The issuer closed the card for + # reasons unrelated to fraud or damage, such as account inactivity, product or + # policy changes, or technology upgrades. _ `NOT_ACTIVE` - The card hasn’t had any + # transaction activity for a specified period, applicable to statuses like + # `PAUSED` or `CLOSED`. _ `SUSPICIOUS_ACTIVITY` - The card has one or more + # suspicious transactions or activities that require review. This can involve + # prompting the cardholder to confirm legitimate use or report confirmed fraud. _ + # `INTERNAL_REVIEW` - The card is temporarily paused pending further internal + # review. _ `EXPIRED` - The card has expired and has been closed without being + # reissued. _ `UNDELIVERABLE` - The card cannot be delivered to the cardholder and + # has been returned. \* `OTHER` - The reason for the status does not fall into any + # of the above categories. A comment can be provided to specify the reason. + substatus: nil + ) + end + + sig do + override.returns( + { + token: String, + account_token: String, + card_program_token: String, + created: Time, + funding: T.nilable(Lithic::NonPCICard::Funding), + last_four: String, + pin_status: Lithic::NonPCICard::PinStatus::TaggedSymbol, + spend_limit: Integer, + spend_limit_duration: Lithic::SpendLimitDuration::TaggedSymbol, + state: Lithic::NonPCICard::State::TaggedSymbol, + type: Lithic::NonPCICard::Type::TaggedSymbol, + auth_rule_tokens: T::Array[String], + bulk_order_token: T.nilable(String), + cardholder_currency: String, + comment: String, + digital_card_art_token: T.nilable(String), + exp_month: String, + exp_year: String, + hostname: String, + memo: String, + network_program_token: T.nilable(String), + pending_commands: T::Array[String], + product_id: T.nilable(String), + replacement_for: T.nilable(String), + substatus: T.nilable(Lithic::NonPCICard::Substatus::TaggedSymbol) + } + ) + end + def to_hash + end + + class Funding < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::NonPCICard::Funding, Lithic::Internal::AnyHash) + end + + # A globally unique identifier for this FundingAccount. + sig { returns(String) } + attr_accessor :token + + # An RFC 3339 string representing when this funding source was added to the Lithic + # account. This may be `null`. UTC time zone. + sig { returns(Time) } + attr_accessor :created + + # The last 4 digits of the account (e.g. bank account, debit card) associated with + # this FundingAccount. This may be null. + sig { returns(String) } + attr_accessor :last_four + + # State of funding source. Funding source states: _ `ENABLED` - The funding + # account is available to use for card creation and transactions. _ `PENDING` - + # The funding account is still being verified e.g. bank micro-deposits + # verification. \* `DELETED` - The founding account has been deleted. + sig { returns(Lithic::NonPCICard::Funding::State::TaggedSymbol) } + attr_accessor :state + + # Types of funding source: _ `DEPOSITORY_CHECKING` - Bank checking account. _ + # `DEPOSITORY_SAVINGS` - Bank savings account. + sig { returns(Lithic::NonPCICard::Funding::Type::TaggedSymbol) } + attr_accessor :type + + # Account name identifying the funding source. This may be `null`. + sig { returns(T.nilable(String)) } + attr_reader :account_name + + sig { params(account_name: String).void } + attr_writer :account_name + + # The nickname given to the `FundingAccount` or `null` if it has no nickname. + sig { returns(T.nilable(String)) } + attr_accessor :nickname + + # Funding account for a card + sig do + params( + token: String, + created: Time, + last_four: String, + state: Lithic::NonPCICard::Funding::State::OrSymbol, + type: Lithic::NonPCICard::Funding::Type::OrSymbol, + account_name: String, + nickname: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # A globally unique identifier for this FundingAccount. + token:, + # An RFC 3339 string representing when this funding source was added to the Lithic + # account. This may be `null`. UTC time zone. + created:, + # The last 4 digits of the account (e.g. bank account, debit card) associated with + # this FundingAccount. This may be null. + last_four:, + # State of funding source. Funding source states: _ `ENABLED` - The funding + # account is available to use for card creation and transactions. _ `PENDING` - + # The funding account is still being verified e.g. bank micro-deposits + # verification. \* `DELETED` - The founding account has been deleted. + state:, + # Types of funding source: _ `DEPOSITORY_CHECKING` - Bank checking account. _ + # `DEPOSITORY_SAVINGS` - Bank savings account. + type:, + # Account name identifying the funding source. This may be `null`. + account_name: nil, + # The nickname given to the `FundingAccount` or `null` if it has no nickname. + nickname: nil + ) + end + + sig do + override.returns( + { + token: String, + created: Time, + last_four: String, + state: Lithic::NonPCICard::Funding::State::TaggedSymbol, + type: Lithic::NonPCICard::Funding::Type::TaggedSymbol, + account_name: String, + nickname: T.nilable(String) + } + ) + end + def to_hash + end + + # State of funding source. Funding source states: _ `ENABLED` - The funding + # account is available to use for card creation and transactions. _ `PENDING` - + # The funding account is still being verified e.g. bank micro-deposits + # verification. \* `DELETED` - The founding account has been deleted. + module State + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::NonPCICard::Funding::State) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DELETED = + T.let(:DELETED, Lithic::NonPCICard::Funding::State::TaggedSymbol) + ENABLED = + T.let(:ENABLED, Lithic::NonPCICard::Funding::State::TaggedSymbol) + PENDING = + T.let(:PENDING, Lithic::NonPCICard::Funding::State::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::NonPCICard::Funding::State::TaggedSymbol] + ) + end + def self.values + end + end + + # Types of funding source: _ `DEPOSITORY_CHECKING` - Bank checking account. _ + # `DEPOSITORY_SAVINGS` - Bank savings account. + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::NonPCICard::Funding::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DEPOSITORY_CHECKING = + T.let( + :DEPOSITORY_CHECKING, + Lithic::NonPCICard::Funding::Type::TaggedSymbol + ) + DEPOSITORY_SAVINGS = + T.let( + :DEPOSITORY_SAVINGS, + Lithic::NonPCICard::Funding::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::NonPCICard::Funding::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + + # Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect + # attempts). + module PinStatus + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::NonPCICard::PinStatus) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + OK = T.let(:OK, Lithic::NonPCICard::PinStatus::TaggedSymbol) + BLOCKED = T.let(:BLOCKED, Lithic::NonPCICard::PinStatus::TaggedSymbol) + NOT_SET = T.let(:NOT_SET, Lithic::NonPCICard::PinStatus::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::NonPCICard::PinStatus::TaggedSymbol] + ) + end + def self.values + end + end + + # Card state values: _ `CLOSED` - Card will no longer approve authorizations. + # Closing a card cannot be undone. _ `OPEN` - Card will approve authorizations (if + # they match card and account parameters). _ `PAUSED` - Card will decline + # authorizations, but can be resumed at a later time. _ `PENDING_FULFILLMENT` - + # The initial state for cards of type `PHYSICAL`. The card is provisioned pending + # manufacturing and fulfillment. Cards in this state can accept authorizations for + # e-commerce purchases, but not for "Card Present" purchases where the physical + # card itself is present. \* `PENDING_ACTIVATION` - At regular intervals, cards of + # type `PHYSICAL` in state `PENDING_FULFILLMENT` are sent to the card production + # warehouse and updated to state `PENDING_ACTIVATION`. Similar to + # `PENDING_FULFILLMENT`, cards in this state can be used for e-commerce + # transactions or can be added to mobile wallets. API clients should update the + # card's state to `OPEN` only after the cardholder confirms receipt of the card. + # In sandbox, the same daily batch fulfillment occurs, but no cards are actually + # manufactured. + module State + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::NonPCICard::State) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CLOSED = T.let(:CLOSED, Lithic::NonPCICard::State::TaggedSymbol) + OPEN = T.let(:OPEN, Lithic::NonPCICard::State::TaggedSymbol) + PAUSED = T.let(:PAUSED, Lithic::NonPCICard::State::TaggedSymbol) + PENDING_ACTIVATION = + T.let(:PENDING_ACTIVATION, Lithic::NonPCICard::State::TaggedSymbol) + PENDING_FULFILLMENT = + T.let(:PENDING_FULFILLMENT, Lithic::NonPCICard::State::TaggedSymbol) + + sig do + override.returns(T::Array[Lithic::NonPCICard::State::TaggedSymbol]) + end + def self.values + end + end + + # Card types: _ `VIRTUAL` - Card will authorize at any merchant and can be added + # to a digital wallet like Apple Pay or Google Pay (if the card program is digital + # wallet-enabled). _ `PHYSICAL` - Manufactured and sent to the cardholder. We + # offer white label branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe + # functionality. _ `SINGLE_USE` - Card is closed upon first successful + # authorization. _ `MERCHANT_LOCKED` - Card is locked to the first merchant that + # successfully authorizes the card. _ `UNLOCKED` - _[Deprecated]_ Similar behavior + # to VIRTUAL cards, please use VIRTUAL instead. _ `DIGITAL_WALLET` - + # _[Deprecated]_ Similar behavior to VIRTUAL cards, please use VIRTUAL instead. + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::NonPCICard::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MERCHANT_LOCKED = + T.let(:MERCHANT_LOCKED, Lithic::NonPCICard::Type::TaggedSymbol) + PHYSICAL = T.let(:PHYSICAL, Lithic::NonPCICard::Type::TaggedSymbol) + SINGLE_USE = T.let(:SINGLE_USE, Lithic::NonPCICard::Type::TaggedSymbol) + VIRTUAL = T.let(:VIRTUAL, Lithic::NonPCICard::Type::TaggedSymbol) + UNLOCKED = T.let(:UNLOCKED, Lithic::NonPCICard::Type::TaggedSymbol) + DIGITAL_WALLET = + T.let(:DIGITAL_WALLET, Lithic::NonPCICard::Type::TaggedSymbol) + + sig do + override.returns(T::Array[Lithic::NonPCICard::Type::TaggedSymbol]) + end + def self.values + end + end + + # Card state substatus values: _ `LOST` - The physical card is no longer in the + # cardholder's possession due to being lost or never received by the cardholder. _ + # `COMPROMISED` - Card information has been exposed, potentially leading to + # unauthorized access. This may involve physical card theft, cloning, or online + # data breaches. _ `DAMAGED` - The physical card is not functioning properly, such + # as having chip failures or a demagnetized magnetic stripe. _ + # `END_USER_REQUEST` - The cardholder requested the closure of the card for + # reasons unrelated to fraud or damage, such as switching to a different product + # or closing the account. _ `ISSUER_REQUEST` - The issuer closed the card for + # reasons unrelated to fraud or damage, such as account inactivity, product or + # policy changes, or technology upgrades. _ `NOT_ACTIVE` - The card hasn’t had any + # transaction activity for a specified period, applicable to statuses like + # `PAUSED` or `CLOSED`. _ `SUSPICIOUS_ACTIVITY` - The card has one or more + # suspicious transactions or activities that require review. This can involve + # prompting the cardholder to confirm legitimate use or report confirmed fraud. _ + # `INTERNAL_REVIEW` - The card is temporarily paused pending further internal + # review. _ `EXPIRED` - The card has expired and has been closed without being + # reissued. _ `UNDELIVERABLE` - The card cannot be delivered to the cardholder and + # has been returned. \* `OTHER` - The reason for the status does not fall into any + # of the above categories. A comment can be provided to specify the reason. + module Substatus + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::NonPCICard::Substatus) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LOST = T.let(:LOST, Lithic::NonPCICard::Substatus::TaggedSymbol) + COMPROMISED = + T.let(:COMPROMISED, Lithic::NonPCICard::Substatus::TaggedSymbol) + DAMAGED = T.let(:DAMAGED, Lithic::NonPCICard::Substatus::TaggedSymbol) + END_USER_REQUEST = + T.let(:END_USER_REQUEST, Lithic::NonPCICard::Substatus::TaggedSymbol) + ISSUER_REQUEST = + T.let(:ISSUER_REQUEST, Lithic::NonPCICard::Substatus::TaggedSymbol) + NOT_ACTIVE = + T.let(:NOT_ACTIVE, Lithic::NonPCICard::Substatus::TaggedSymbol) + SUSPICIOUS_ACTIVITY = + T.let( + :SUSPICIOUS_ACTIVITY, + Lithic::NonPCICard::Substatus::TaggedSymbol + ) + INTERNAL_REVIEW = + T.let(:INTERNAL_REVIEW, Lithic::NonPCICard::Substatus::TaggedSymbol) + EXPIRED = T.let(:EXPIRED, Lithic::NonPCICard::Substatus::TaggedSymbol) + UNDELIVERABLE = + T.let(:UNDELIVERABLE, Lithic::NonPCICard::Substatus::TaggedSymbol) + OTHER = T.let(:OTHER, Lithic::NonPCICard::Substatus::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::NonPCICard::Substatus::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/owner_type.rbi b/rbi/lithic/models/owner_type.rbi new file mode 100644 index 00000000..29fa2958 --- /dev/null +++ b/rbi/lithic/models/owner_type.rbi @@ -0,0 +1,19 @@ +# typed: strong + +module Lithic + module Models + module OwnerType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::OwnerType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INDIVIDUAL = T.let(:INDIVIDUAL, Lithic::OwnerType::TaggedSymbol) + BUSINESS = T.let(:BUSINESS, Lithic::OwnerType::TaggedSymbol) + + sig { override.returns(T::Array[Lithic::OwnerType::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/lithic/models/parsed_webhook_event.rbi b/rbi/lithic/models/parsed_webhook_event.rbi new file mode 100644 index 00000000..907b25f3 --- /dev/null +++ b/rbi/lithic/models/parsed_webhook_event.rbi @@ -0,0 +1,1310 @@ +# typed: strong + +module Lithic + module Models + # KYB payload for an updated account holder. + module ParsedWebhookEvent + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::AccountHolderCreatedWebhookEvent, + Lithic::ParsedWebhookEvent::KYBPayload, + Lithic::ParsedWebhookEvent::KYCPayload, + Lithic::ParsedWebhookEvent::LegacyPayload, + Lithic::AccountHolderVerificationWebhookEvent, + Lithic::AccountHolderDocumentUpdatedWebhookEvent, + Lithic::CardAuthorizationApprovalRequestWebhookEvent, + Lithic::CardAuthorizationChallengeWebhookEvent, + Lithic::CardAuthorizationChallengeResponseWebhookEvent, + Lithic::AuthRulesBacktestReportCreatedWebhookEvent, + Lithic::BalanceUpdatedWebhookEvent, + Lithic::BookTransferTransactionCreatedWebhookEvent, + Lithic::BookTransferTransactionUpdatedWebhookEvent, + Lithic::CardCreatedWebhookEvent, + Lithic::CardConvertedWebhookEvent, + Lithic::CardRenewedWebhookEvent, + Lithic::CardReissuedWebhookEvent, + Lithic::CardShippedWebhookEvent, + Lithic::CardUpdatedWebhookEvent, + Lithic::CardTransactionUpdatedWebhookEvent, + Lithic::CardTransactionEnhancedDataCreatedWebhookEvent, + Lithic::CardTransactionEnhancedDataUpdatedWebhookEvent, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent, + Lithic::DigitalWalletTokenizationResultWebhookEvent, + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent, + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent, + Lithic::DigitalWalletTokenizationUpdatedWebhookEvent, + Lithic::DisputeUpdatedWebhookEvent, + Lithic::DisputeEvidenceUploadFailedWebhookEvent, + Lithic::ExternalBankAccountCreatedWebhookEvent, + Lithic::ExternalBankAccountUpdatedWebhookEvent, + Lithic::ExternalPaymentCreatedWebhookEvent, + Lithic::ExternalPaymentUpdatedWebhookEvent, + Lithic::FinancialAccountCreatedWebhookEvent, + Lithic::FinancialAccountUpdatedWebhookEvent, + Lithic::FundingEventCreatedWebhookEvent, + Lithic::LoanTapeCreatedWebhookEvent, + Lithic::LoanTapeUpdatedWebhookEvent, + Lithic::ManagementOperationCreatedWebhookEvent, + Lithic::ManagementOperationUpdatedWebhookEvent, + Lithic::InternalTransactionCreatedWebhookEvent, + Lithic::InternalTransactionUpdatedWebhookEvent, + Lithic::NetworkTotalCreatedWebhookEvent, + Lithic::NetworkTotalUpdatedWebhookEvent, + Lithic::PaymentTransactionCreatedWebhookEvent, + Lithic::PaymentTransactionUpdatedWebhookEvent, + Lithic::SettlementReportUpdatedWebhookEvent, + Lithic::StatementsCreatedWebhookEvent, + Lithic::ThreeDSAuthenticationCreatedWebhookEvent, + Lithic::ThreeDSAuthenticationUpdatedWebhookEvent, + Lithic::ThreeDSAuthenticationChallengeWebhookEvent, + Lithic::TokenizationApprovalRequestWebhookEvent, + Lithic::TokenizationResultWebhookEvent, + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent, + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent, + Lithic::TokenizationUpdatedWebhookEvent, + Lithic::ThreeDSAuthenticationApprovalRequestWebhookEvent, + Lithic::DisputeTransactionCreatedWebhookEvent, + Lithic::DisputeTransactionUpdatedWebhookEvent + ) + end + + class KYBPayload < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ParsedWebhookEvent::KYBPayload, + Lithic::Internal::AnyHash + ) + end + + # The token of the account_holder that was created. + sig { returns(String) } + attr_accessor :token + + # Original request to update the account holder. + sig { returns(Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest) } + attr_reader :update_request + + sig do + params( + update_request: + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::OrHash + ).void + end + attr_writer :update_request + + # The type of event that occurred. + sig do + returns( + T.nilable( + Lithic::ParsedWebhookEvent::KYBPayload::EventType::TaggedSymbol + ) + ) + end + attr_reader :event_type + + sig do + params( + event_type: + Lithic::ParsedWebhookEvent::KYBPayload::EventType::OrSymbol + ).void + end + attr_writer :event_type + + # A user provided id that can be used to link an account holder with an external + # system + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # 6-digit North American Industry Classification System (NAICS) code for the + # business. Only present if naics_code was included in the update request. + sig { returns(T.nilable(String)) } + attr_reader :naics_code + + sig { params(naics_code: String).void } + attr_writer :naics_code + + # Short description of the company's line of business (i.e., what does the company + # do?). Values longer than 255 characters will be truncated before KYB + # verification + sig { returns(T.nilable(String)) } + attr_reader :nature_of_business + + sig { params(nature_of_business: String).void } + attr_writer :nature_of_business + + # Company website URL. + sig { returns(T.nilable(String)) } + attr_reader :website_url + + sig { params(website_url: String).void } + attr_writer :website_url + + # KYB payload for an updated account holder. + sig do + params( + token: String, + update_request: + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::OrHash, + event_type: + Lithic::ParsedWebhookEvent::KYBPayload::EventType::OrSymbol, + external_id: String, + naics_code: String, + nature_of_business: String, + website_url: String + ).returns(T.attached_class) + end + def self.new( + # The token of the account_holder that was created. + token:, + # Original request to update the account holder. + update_request:, + # The type of event that occurred. + event_type: nil, + # A user provided id that can be used to link an account holder with an external + # system + external_id: nil, + # 6-digit North American Industry Classification System (NAICS) code for the + # business. Only present if naics_code was included in the update request. + naics_code: nil, + # Short description of the company's line of business (i.e., what does the company + # do?). Values longer than 255 characters will be truncated before KYB + # verification + nature_of_business: nil, + # Company website URL. + website_url: nil + ) + end + + sig do + override.returns( + { + token: String, + update_request: + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest, + event_type: + Lithic::ParsedWebhookEvent::KYBPayload::EventType::TaggedSymbol, + external_id: String, + naics_code: String, + nature_of_business: String, + website_url: String + } + ) + end + def to_hash + end + + class UpdateRequest < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest, + Lithic::Internal::AnyHash + ) + end + + # You must submit a list of all direct and indirect individuals with 25% or more + # ownership in the company. A maximum of 4 beneficial owners can be submitted. If + # no individual owns 25% of the company you do not need to send beneficial owner + # information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + sig do + returns( + T.nilable( + T::Array[ + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual + ] + ) + ) + end + attr_reader :beneficial_owner_individuals + + sig do + params( + beneficial_owner_individuals: + T::Array[ + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::OrHash + ] + ).void + end + attr_writer :beneficial_owner_individuals + + # Information for business for which the account is being opened and KYB is being + # run. + sig { returns(T.nilable(Lithic::KYBBusinessEntity)) } + attr_reader :business_entity + + sig do + params(business_entity: Lithic::KYBBusinessEntity::OrHash).void + end + attr_writer :business_entity + + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + sig do + returns( + T.nilable( + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson + ) + ) + end + attr_reader :control_person + + sig do + params( + control_person: + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::OrHash + ).void + end + attr_writer :control_person + + # Original request to update the account holder. + sig do + params( + beneficial_owner_individuals: + T::Array[ + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::OrHash + ], + business_entity: Lithic::KYBBusinessEntity::OrHash, + control_person: + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::OrHash + ).returns(T.attached_class) + end + def self.new( + # You must submit a list of all direct and indirect individuals with 25% or more + # ownership in the company. A maximum of 4 beneficial owners can be submitted. If + # no individual owns 25% of the company you do not need to send beneficial owner + # information. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section I) for more background on individuals that should be included. + beneficial_owner_individuals: nil, + # Information for business for which the account is being opened and KYB is being + # run. + business_entity: nil, + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + control_person: nil + ) + end + + sig do + override.returns( + { + beneficial_owner_individuals: + T::Array[ + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual + ], + business_entity: Lithic::KYBBusinessEntity, + control_person: + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson + } + ) + end + def to_hash + end + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual, + Lithic::Internal::AnyHash + ) + end + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + returns( + T.nilable( + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address + ) + ) + end + attr_reader :address + + sig do + params( + address: + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address::OrHash + ).void + end + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + sig do + params( + address: + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address::OrHash, + dob: String, + email: String, + first_name: String, + last_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + address: nil, + # Individual's date of birth, as an RFC 3339 date. + dob: nil, + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + email: nil, + # Individual's first name, as it appears on government-issued identity documents. + first_name: nil, + # Individual's last name, as it appears on government-issued identity documents. + last_name: nil, + # Individual's phone number, entered in E.164 format. + phone_number: nil + ) + end + + sig do + override.returns( + { + address: + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + + class Address < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address, + Lithic::Internal::AnyHash + ) + end + + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ).returns(T.attached_class) + end + def self.new( + # Valid deliverable address (no PO boxes). + address1:, + # Name of city. + city:, + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + country:, + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + postal_code:, + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + state:, + # Unit or apartment number (if applicable). + address2: nil + ) + end + + sig do + override.returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + + class ControlPerson < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson, + Lithic::Internal::AnyHash + ) + end + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + returns( + T.nilable( + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address + ) + ) + end + attr_reader :address + + sig do + params( + address: + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address::OrHash + ).void + end + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # An individual with significant responsibility for managing the legal entity + # (e.g., a Chief Executive Officer, Chief Financial Officer, Chief Operating + # Officer, Managing Member, General Partner, President, Vice President, or + # Treasurer). This can be an executive, or someone who will have program-wide + # access to the cards that Lithic will provide. In some cases, this individual + # could also be a beneficial owner listed above. See + # [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) + # (Section II) for more background. + sig do + params( + address: + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address::OrHash, + dob: String, + email: String, + first_name: String, + last_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + address: nil, + # Individual's date of birth, as an RFC 3339 date. + dob: nil, + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + email: nil, + # Individual's first name, as it appears on government-issued identity documents. + first_name: nil, + # Individual's last name, as it appears on government-issued identity documents. + last_name: nil, + # Individual's phone number, entered in E.164 format. + phone_number: nil + ) + end + + sig do + override.returns( + { + address: + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + + class Address < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address, + Lithic::Internal::AnyHash + ) + end + + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ).returns(T.attached_class) + end + def self.new( + # Valid deliverable address (no PO boxes). + address1:, + # Name of city. + city:, + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + country:, + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + postal_code:, + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + state:, + # Unit or apartment number (if applicable). + address2: nil + ) + end + + sig do + override.returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + end + + # The type of event that occurred. + module EventType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ParsedWebhookEvent::KYBPayload::EventType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_HOLDER_UPDATED = + T.let( + :"account_holder.updated", + Lithic::ParsedWebhookEvent::KYBPayload::EventType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ParsedWebhookEvent::KYBPayload::EventType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class KYCPayload < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ParsedWebhookEvent::KYCPayload, + Lithic::Internal::AnyHash + ) + end + + # The token of the account_holder that was created. + sig { returns(String) } + attr_accessor :token + + # Original request to update the account holder. + sig { returns(Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest) } + attr_reader :update_request + + sig do + params( + update_request: + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::OrHash + ).void + end + attr_writer :update_request + + # The type of event that occurred. + sig do + returns( + T.nilable( + Lithic::ParsedWebhookEvent::KYCPayload::EventType::TaggedSymbol + ) + ) + end + attr_reader :event_type + + sig do + params( + event_type: + Lithic::ParsedWebhookEvent::KYCPayload::EventType::OrSymbol + ).void + end + attr_writer :event_type + + # A user provided id that can be used to link an account holder with an external + # system + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # KYC payload for an updated account holder. + sig do + params( + token: String, + update_request: + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::OrHash, + event_type: + Lithic::ParsedWebhookEvent::KYCPayload::EventType::OrSymbol, + external_id: String + ).returns(T.attached_class) + end + def self.new( + # The token of the account_holder that was created. + token:, + # Original request to update the account holder. + update_request:, + # The type of event that occurred. + event_type: nil, + # A user provided id that can be used to link an account holder with an external + # system + external_id: nil + ) + end + + sig do + override.returns( + { + token: String, + update_request: + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest, + event_type: + Lithic::ParsedWebhookEvent::KYCPayload::EventType::TaggedSymbol, + external_id: String + } + ) + end + def to_hash + end + + class UpdateRequest < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest, + Lithic::Internal::AnyHash + ) + end + + # Information on the individual for whom the account is being opened and KYC is + # being run. + sig do + returns( + T.nilable( + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual + ) + ) + end + attr_reader :individual + + sig do + params( + individual: + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::OrHash + ).void + end + attr_writer :individual + + # Original request to update the account holder. + sig do + params( + individual: + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::OrHash + ).returns(T.attached_class) + end + def self.new( + # Information on the individual for whom the account is being opened and KYC is + # being run. + individual: nil + ) + end + + sig do + override.returns( + { + individual: + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual + } + ) + end + def to_hash + end + + class Individual < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual, + Lithic::Internal::AnyHash + ) + end + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + returns( + T.nilable( + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address + ) + ) + end + attr_reader :address + + sig do + params( + address: + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address::OrHash + ).void + end + attr_writer :address + + # Individual's date of birth, as an RFC 3339 date. + sig { returns(T.nilable(String)) } + attr_reader :dob + + sig { params(dob: String).void } + attr_writer :dob + + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Individual's first name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # Individual's last name, as it appears on government-issued identity documents. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # Individual's phone number, entered in E.164 format. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Information on the individual for whom the account is being opened and KYC is + # being run. + sig do + params( + address: + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address::OrHash, + dob: String, + email: String, + first_name: String, + last_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + address: nil, + # Individual's date of birth, as an RFC 3339 date. + dob: nil, + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + email: nil, + # Individual's first name, as it appears on government-issued identity documents. + first_name: nil, + # Individual's last name, as it appears on government-issued identity documents. + last_name: nil, + # Individual's phone number, entered in E.164 format. + phone_number: nil + ) + end + + sig do + override.returns( + { + address: + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + ) + end + def to_hash + end + + class Address < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address, + Lithic::Internal::AnyHash + ) + end + + # Valid deliverable address (no PO boxes). + sig { returns(String) } + attr_accessor :address1 + + # Name of city. + sig { returns(String) } + attr_accessor :city + + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + sig { returns(String) } + attr_accessor :country + + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + sig { returns(String) } + attr_accessor :postal_code + + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + sig { returns(String) } + attr_accessor :state + + # Unit or apartment number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + sig do + params( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + ).returns(T.attached_class) + end + def self.new( + # Valid deliverable address (no PO boxes). + address1:, + # Name of city. + city:, + # Valid country code. Only USA is currently supported, entered in uppercase ISO + # 3166-1 alpha-3 three-character format. + country:, + # Valid postal code. Only USA ZIP codes are currently supported, entered as a + # five-digit ZIP or nine-digit ZIP+4. + postal_code:, + # Valid state code. Only USA state codes are currently supported, entered in + # uppercase ISO 3166-2 two-character format. + state:, + # Unit or apartment number (if applicable). + address2: nil + ) + end + + sig do + override.returns( + { + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + address2: String + } + ) + end + def to_hash + end + end + end + end + + # The type of event that occurred. + module EventType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ParsedWebhookEvent::KYCPayload::EventType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_HOLDER_UPDATED = + T.let( + :"account_holder.updated", + Lithic::ParsedWebhookEvent::KYCPayload::EventType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ParsedWebhookEvent::KYCPayload::EventType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class LegacyPayload < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ParsedWebhookEvent::LegacyPayload, + Lithic::Internal::AnyHash + ) + end + + # The token of the account_holder that was created. + sig { returns(String) } + attr_accessor :token + + # If applicable, represents the business account token associated with the + # account_holder. + sig { returns(T.nilable(String)) } + attr_accessor :business_account_token + + # When the account_holder updated event was created + sig { returns(T.nilable(Time)) } + attr_reader :created + + sig { params(created: Time).void } + attr_writer :created + + # If updated, the newly updated email associated with the account_holder otherwise + # the existing email is provided. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # The type of event that occurred. + sig do + returns( + T.nilable( + Lithic::ParsedWebhookEvent::LegacyPayload::EventType::TaggedSymbol + ) + ) + end + attr_reader :event_type + + sig do + params( + event_type: + Lithic::ParsedWebhookEvent::LegacyPayload::EventType::OrSymbol + ).void + end + attr_writer :event_type + + # If applicable, represents the external_id associated with the account_holder. + sig { returns(T.nilable(String)) } + attr_accessor :external_id + + # If applicable, represents the account_holder's first name. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + # If applicable, represents the account_holder's last name. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + # If applicable, represents the account_holder's business name. + sig { returns(T.nilable(String)) } + attr_reader :legal_business_name + + sig { params(legal_business_name: String).void } + attr_writer :legal_business_name + + # If updated, the newly updated phone_number associated with the account_holder + # otherwise the existing phone_number is provided. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + # Legacy payload for an updated account holder. + sig do + params( + token: String, + business_account_token: T.nilable(String), + created: Time, + email: String, + event_type: + Lithic::ParsedWebhookEvent::LegacyPayload::EventType::OrSymbol, + external_id: T.nilable(String), + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # The token of the account_holder that was created. + token:, + # If applicable, represents the business account token associated with the + # account_holder. + business_account_token: nil, + # When the account_holder updated event was created + created: nil, + # If updated, the newly updated email associated with the account_holder otherwise + # the existing email is provided. + email: nil, + # The type of event that occurred. + event_type: nil, + # If applicable, represents the external_id associated with the account_holder. + external_id: nil, + # If applicable, represents the account_holder's first name. + first_name: nil, + # If applicable, represents the account_holder's last name. + last_name: nil, + # If applicable, represents the account_holder's business name. + legal_business_name: nil, + # If updated, the newly updated phone_number associated with the account_holder + # otherwise the existing phone_number is provided. + phone_number: nil + ) + end + + sig do + override.returns( + { + token: String, + business_account_token: T.nilable(String), + created: Time, + email: String, + event_type: + Lithic::ParsedWebhookEvent::LegacyPayload::EventType::TaggedSymbol, + external_id: T.nilable(String), + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String + } + ) + end + def to_hash + end + + # The type of event that occurred. + module EventType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::ParsedWebhookEvent::LegacyPayload::EventType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_HOLDER_UPDATED = + T.let( + :"account_holder.updated", + Lithic::ParsedWebhookEvent::LegacyPayload::EventType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ParsedWebhookEvent::LegacyPayload::EventType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig { override.returns(T::Array[Lithic::ParsedWebhookEvent::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/lithic/models/payment.rbi b/rbi/lithic/models/payment.rbi new file mode 100644 index 00000000..278bfb68 --- /dev/null +++ b/rbi/lithic/models/payment.rbi @@ -0,0 +1,1233 @@ +# typed: strong + +module Lithic + module Models + class Payment < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Lithic::Payment, Lithic::Internal::AnyHash) } + + # Unique identifier for the transaction + sig { returns(String) } + attr_accessor :token + + # Transaction category + sig { returns(Lithic::Payment::Category::TaggedSymbol) } + attr_accessor :category + + # ISO 8601 timestamp of when the transaction was created + sig { returns(Time) } + attr_accessor :created + + # Transaction descriptor + sig { returns(String) } + attr_accessor :descriptor + + # Transfer direction + sig { returns(Lithic::Payment::Direction::TaggedSymbol) } + attr_accessor :direction + + # List of transaction events + sig { returns(T::Array[Lithic::Payment::Event]) } + attr_accessor :events + + # PAYMENT - Payment Transaction + sig { returns(Symbol) } + attr_accessor :family + + # Financial account token + sig { returns(String) } + attr_accessor :financial_account_token + + # Transfer method + sig { returns(Lithic::Payment::Method::TaggedSymbol) } + attr_accessor :method_ + + # Method-specific attributes + sig { returns(Lithic::Payment::MethodAttributes::Variants) } + attr_accessor :method_attributes + + # Pending amount in cents + sig { returns(Integer) } + attr_accessor :pending_amount + + # Account tokens related to a payment transaction + sig { returns(T.nilable(Lithic::Payment::RelatedAccountTokens)) } + attr_reader :related_account_tokens + + sig do + params( + related_account_tokens: + T.nilable(Lithic::Payment::RelatedAccountTokens::OrHash) + ).void + end + attr_writer :related_account_tokens + + # Transaction result + sig { returns(Lithic::Payment::Result::TaggedSymbol) } + attr_accessor :result + + # Settled amount in cents + sig { returns(Integer) } + attr_accessor :settled_amount + + # Transaction source + sig { returns(Lithic::Payment::Source::TaggedSymbol) } + attr_accessor :source + + # The status of the transaction + sig { returns(Lithic::Payment::Status::TaggedSymbol) } + attr_accessor :status + + # ISO 8601 timestamp of when the transaction was last updated + sig { returns(Time) } + attr_accessor :updated + + # Currency of the transaction in ISO 4217 format + sig { returns(T.nilable(String)) } + attr_reader :currency + + sig { params(currency: String).void } + attr_writer :currency + + # Expected release date for the transaction + sig { returns(T.nilable(Date)) } + attr_accessor :expected_release_date + + # External bank account token + sig { returns(T.nilable(String)) } + attr_accessor :external_bank_account_token + + # Key-value pairs for tagging resources. Tags allow you to associate arbitrary + # metadata with a resource for your own purposes. + sig { returns(T.nilable(T::Hash[Symbol, String])) } + attr_reader :tags + + sig { params(tags: T::Hash[Symbol, String]).void } + attr_writer :tags + + sig { returns(T.nilable(Lithic::Payment::Type::TaggedSymbol)) } + attr_reader :type + + sig { params(type: Lithic::Payment::Type::OrSymbol).void } + attr_writer :type + + # User-defined identifier + sig { returns(T.nilable(String)) } + attr_accessor :user_defined_id + + # Payment transaction + sig do + params( + token: String, + category: Lithic::Payment::Category::OrSymbol, + created: Time, + descriptor: String, + direction: Lithic::Payment::Direction::OrSymbol, + events: T::Array[Lithic::Payment::Event::OrHash], + financial_account_token: String, + method_: Lithic::Payment::Method::OrSymbol, + method_attributes: + T.any( + Lithic::Payment::MethodAttributes::ACHMethodAttributes::OrHash, + Lithic::Payment::MethodAttributes::WireMethodAttributes::OrHash + ), + pending_amount: Integer, + related_account_tokens: + T.nilable(Lithic::Payment::RelatedAccountTokens::OrHash), + result: Lithic::Payment::Result::OrSymbol, + settled_amount: Integer, + source: Lithic::Payment::Source::OrSymbol, + status: Lithic::Payment::Status::OrSymbol, + updated: Time, + currency: String, + expected_release_date: T.nilable(Date), + external_bank_account_token: T.nilable(String), + tags: T::Hash[Symbol, String], + type: Lithic::Payment::Type::OrSymbol, + user_defined_id: T.nilable(String), + family: Symbol + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the transaction + token:, + # Transaction category + category:, + # ISO 8601 timestamp of when the transaction was created + created:, + # Transaction descriptor + descriptor:, + # Transfer direction + direction:, + # List of transaction events + events:, + # Financial account token + financial_account_token:, + # Transfer method + method_:, + # Method-specific attributes + method_attributes:, + # Pending amount in cents + pending_amount:, + # Account tokens related to a payment transaction + related_account_tokens:, + # Transaction result + result:, + # Settled amount in cents + settled_amount:, + # Transaction source + source:, + # The status of the transaction + status:, + # ISO 8601 timestamp of when the transaction was last updated + updated:, + # Currency of the transaction in ISO 4217 format + currency: nil, + # Expected release date for the transaction + expected_release_date: nil, + # External bank account token + external_bank_account_token: nil, + # Key-value pairs for tagging resources. Tags allow you to associate arbitrary + # metadata with a resource for your own purposes. + tags: nil, + type: nil, + # User-defined identifier + user_defined_id: nil, + # PAYMENT - Payment Transaction + family: :PAYMENT + ) + end + + sig do + override.returns( + { + token: String, + category: Lithic::Payment::Category::TaggedSymbol, + created: Time, + descriptor: String, + direction: Lithic::Payment::Direction::TaggedSymbol, + events: T::Array[Lithic::Payment::Event], + family: Symbol, + financial_account_token: String, + method_: Lithic::Payment::Method::TaggedSymbol, + method_attributes: Lithic::Payment::MethodAttributes::Variants, + pending_amount: Integer, + related_account_tokens: + T.nilable(Lithic::Payment::RelatedAccountTokens), + result: Lithic::Payment::Result::TaggedSymbol, + settled_amount: Integer, + source: Lithic::Payment::Source::TaggedSymbol, + status: Lithic::Payment::Status::TaggedSymbol, + updated: Time, + currency: String, + expected_release_date: T.nilable(Date), + external_bank_account_token: T.nilable(String), + tags: T::Hash[Symbol, String], + type: Lithic::Payment::Type::TaggedSymbol, + user_defined_id: T.nilable(String) + } + ) + end + def to_hash + end + + # Transaction category + module Category + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Payment::Category) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACH = T.let(:ACH, Lithic::Payment::Category::TaggedSymbol) + WIRE = T.let(:WIRE, Lithic::Payment::Category::TaggedSymbol) + BALANCE_OR_FUNDING = + T.let(:BALANCE_OR_FUNDING, Lithic::Payment::Category::TaggedSymbol) + FEE = T.let(:FEE, Lithic::Payment::Category::TaggedSymbol) + REWARD = T.let(:REWARD, Lithic::Payment::Category::TaggedSymbol) + ADJUSTMENT = T.let(:ADJUSTMENT, Lithic::Payment::Category::TaggedSymbol) + DERECOGNITION = + T.let(:DERECOGNITION, Lithic::Payment::Category::TaggedSymbol) + DISPUTE = T.let(:DISPUTE, Lithic::Payment::Category::TaggedSymbol) + CARD = T.let(:CARD, Lithic::Payment::Category::TaggedSymbol) + EXTERNAL_ACH = + T.let(:EXTERNAL_ACH, Lithic::Payment::Category::TaggedSymbol) + EXTERNAL_CHECK = + T.let(:EXTERNAL_CHECK, Lithic::Payment::Category::TaggedSymbol) + EXTERNAL_FEDNOW = + T.let(:EXTERNAL_FEDNOW, Lithic::Payment::Category::TaggedSymbol) + EXTERNAL_RTP = + T.let(:EXTERNAL_RTP, Lithic::Payment::Category::TaggedSymbol) + EXTERNAL_TRANSFER = + T.let(:EXTERNAL_TRANSFER, Lithic::Payment::Category::TaggedSymbol) + EXTERNAL_WIRE = + T.let(:EXTERNAL_WIRE, Lithic::Payment::Category::TaggedSymbol) + MANAGEMENT_ADJUSTMENT = + T.let(:MANAGEMENT_ADJUSTMENT, Lithic::Payment::Category::TaggedSymbol) + MANAGEMENT_DISPUTE = + T.let(:MANAGEMENT_DISPUTE, Lithic::Payment::Category::TaggedSymbol) + MANAGEMENT_FEE = + T.let(:MANAGEMENT_FEE, Lithic::Payment::Category::TaggedSymbol) + MANAGEMENT_REWARD = + T.let(:MANAGEMENT_REWARD, Lithic::Payment::Category::TaggedSymbol) + MANAGEMENT_DISBURSEMENT = + T.let( + :MANAGEMENT_DISBURSEMENT, + Lithic::Payment::Category::TaggedSymbol + ) + HOLD = T.let(:HOLD, Lithic::Payment::Category::TaggedSymbol) + PROGRAM_FUNDING = + T.let(:PROGRAM_FUNDING, Lithic::Payment::Category::TaggedSymbol) + + sig do + override.returns(T::Array[Lithic::Payment::Category::TaggedSymbol]) + end + def self.values + end + end + + # Transfer direction + module Direction + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Payment::Direction) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREDIT = T.let(:CREDIT, Lithic::Payment::Direction::TaggedSymbol) + DEBIT = T.let(:DEBIT, Lithic::Payment::Direction::TaggedSymbol) + + sig do + override.returns(T::Array[Lithic::Payment::Direction::TaggedSymbol]) + end + def self.values + end + end + + class Event < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::Payment::Event, Lithic::Internal::AnyHash) + end + + # Globally unique identifier. + sig { returns(String) } + attr_accessor :token + + # Amount of the financial event that has been settled in the currency's smallest + # unit (e.g., cents). + sig { returns(Integer) } + attr_accessor :amount + + # Date and time when the financial event occurred. UTC time zone. + sig { returns(Time) } + attr_accessor :created + + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + sig { returns(Lithic::Payment::Event::Result::TaggedSymbol) } + attr_accessor :result + + # Note: Inbound wire transfers are coming soon (availability varies by partner + # bank). Wire-related event types below are a preview. To learn more, contact your + # customer success manager. + # + # Event types: + # + # ACH events: + # + # - `ACH_ORIGINATION_INITIATED` - ACH origination received and pending + # approval/release from an ACH hold. + # - `ACH_ORIGINATION_REVIEWED` - ACH origination has completed the review process. + # - `ACH_ORIGINATION_CANCELLED` - ACH origination has been cancelled. + # - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed and sent to + # the Federal Reserve. + # - `ACH_ORIGINATION_SETTLED` - ACH origination has settled. + # - `ACH_ORIGINATION_RELEASED` - ACH origination released from pending to + # available balance. + # - `ACH_ORIGINATION_REJECTED` - ACH origination was rejected and not sent to the + # Federal Reserve. + # - `ACH_RECEIPT_PROCESSED` - ACH receipt pending release from an ACH holder. + # - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled. + # - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available + # balance. + # - `ACH_RECEIPT_RELEASED_EARLY` - ACH receipt released early from pending to + # available balance. + # - `ACH_RETURN_INITIATED` - ACH initiated return for an ACH receipt. + # - `ACH_RETURN_PROCESSED` - ACH receipt returned by the Receiving Depository + # Financial Institution. + # - `ACH_RETURN_SETTLED` - ACH return settled by the Receiving Depository + # Financial Institution. + # - `ACH_RETURN_REJECTED` - ACH return was rejected by the Receiving Depository + # Financial Institution. + # + # Wire transfer events: + # + # - `WIRE_TRANSFER_INBOUND_RECEIVED` - Inbound wire transfer received from the + # Federal Reserve and pending release to available balance. + # - `WIRE_TRANSFER_INBOUND_SETTLED` - Inbound wire transfer funds released from + # pending to available balance. + # - `WIRE_TRANSFER_INBOUND_BLOCKED` - Inbound wire transfer blocked and funds + # frozen for regulatory review. + # + # Wire return events: + # + # - `WIRE_RETURN_OUTBOUND_INITIATED` - Outbound wire return initiated to return + # funds from an inbound wire transfer. + # - `WIRE_RETURN_OUTBOUND_SENT` - Outbound wire return sent to the Federal Reserve + # and pending acceptance. + # - `WIRE_RETURN_OUTBOUND_SETTLED` - Outbound wire return accepted by the Federal + # Reserve and funds returned to sender. + # - `WIRE_RETURN_OUTBOUND_REJECTED` - Outbound wire return rejected by the Federal + # Reserve. + sig { returns(Lithic::Payment::Event::Type::TaggedSymbol) } + attr_accessor :type + + # More detailed reasons for the event + sig do + returns( + T.nilable( + T::Array[Lithic::Payment::Event::DetailedResult::TaggedSymbol] + ) + ) + end + attr_reader :detailed_results + + sig do + params( + detailed_results: + T::Array[Lithic::Payment::Event::DetailedResult::OrSymbol] + ).void + end + attr_writer :detailed_results + + # Payment event external ID. For ACH transactions, this is the ACH trace number. + # For inbound wire transfers, this is the IMAD (Input Message Accountability + # Data). + sig { returns(T.nilable(String)) } + attr_accessor :external_id + + # Note: Inbound wire transfers are coming soon (availability varies by partner + # bank). Wire-related fields below are a preview. To learn more, contact your + # customer success manager. + # + # Payment Event + sig do + params( + token: String, + amount: Integer, + created: Time, + result: Lithic::Payment::Event::Result::OrSymbol, + type: Lithic::Payment::Event::Type::OrSymbol, + detailed_results: + T::Array[Lithic::Payment::Event::DetailedResult::OrSymbol], + external_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier. + token:, + # Amount of the financial event that has been settled in the currency's smallest + # unit (e.g., cents). + amount:, + # Date and time when the financial event occurred. UTC time zone. + created:, + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + result:, + # Note: Inbound wire transfers are coming soon (availability varies by partner + # bank). Wire-related event types below are a preview. To learn more, contact your + # customer success manager. + # + # Event types: + # + # ACH events: + # + # - `ACH_ORIGINATION_INITIATED` - ACH origination received and pending + # approval/release from an ACH hold. + # - `ACH_ORIGINATION_REVIEWED` - ACH origination has completed the review process. + # - `ACH_ORIGINATION_CANCELLED` - ACH origination has been cancelled. + # - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed and sent to + # the Federal Reserve. + # - `ACH_ORIGINATION_SETTLED` - ACH origination has settled. + # - `ACH_ORIGINATION_RELEASED` - ACH origination released from pending to + # available balance. + # - `ACH_ORIGINATION_REJECTED` - ACH origination was rejected and not sent to the + # Federal Reserve. + # - `ACH_RECEIPT_PROCESSED` - ACH receipt pending release from an ACH holder. + # - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled. + # - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available + # balance. + # - `ACH_RECEIPT_RELEASED_EARLY` - ACH receipt released early from pending to + # available balance. + # - `ACH_RETURN_INITIATED` - ACH initiated return for an ACH receipt. + # - `ACH_RETURN_PROCESSED` - ACH receipt returned by the Receiving Depository + # Financial Institution. + # - `ACH_RETURN_SETTLED` - ACH return settled by the Receiving Depository + # Financial Institution. + # - `ACH_RETURN_REJECTED` - ACH return was rejected by the Receiving Depository + # Financial Institution. + # + # Wire transfer events: + # + # - `WIRE_TRANSFER_INBOUND_RECEIVED` - Inbound wire transfer received from the + # Federal Reserve and pending release to available balance. + # - `WIRE_TRANSFER_INBOUND_SETTLED` - Inbound wire transfer funds released from + # pending to available balance. + # - `WIRE_TRANSFER_INBOUND_BLOCKED` - Inbound wire transfer blocked and funds + # frozen for regulatory review. + # + # Wire return events: + # + # - `WIRE_RETURN_OUTBOUND_INITIATED` - Outbound wire return initiated to return + # funds from an inbound wire transfer. + # - `WIRE_RETURN_OUTBOUND_SENT` - Outbound wire return sent to the Federal Reserve + # and pending acceptance. + # - `WIRE_RETURN_OUTBOUND_SETTLED` - Outbound wire return accepted by the Federal + # Reserve and funds returned to sender. + # - `WIRE_RETURN_OUTBOUND_REJECTED` - Outbound wire return rejected by the Federal + # Reserve. + type:, + # More detailed reasons for the event + detailed_results: nil, + # Payment event external ID. For ACH transactions, this is the ACH trace number. + # For inbound wire transfers, this is the IMAD (Input Message Accountability + # Data). + external_id: nil + ) + end + + sig do + override.returns( + { + token: String, + amount: Integer, + created: Time, + result: Lithic::Payment::Event::Result::TaggedSymbol, + type: Lithic::Payment::Event::Type::TaggedSymbol, + detailed_results: + T::Array[Lithic::Payment::Event::DetailedResult::TaggedSymbol], + external_id: T.nilable(String) + } + ) + end + def to_hash + end + + # APPROVED financial events were successful while DECLINED financial events were + # declined by user, Lithic, or the network. + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Payment::Event::Result) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let(:APPROVED, Lithic::Payment::Event::Result::TaggedSymbol) + DECLINED = + T.let(:DECLINED, Lithic::Payment::Event::Result::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::Payment::Event::Result::TaggedSymbol] + ) + end + def self.values + end + end + + # Note: Inbound wire transfers are coming soon (availability varies by partner + # bank). Wire-related event types below are a preview. To learn more, contact your + # customer success manager. + # + # Event types: + # + # ACH events: + # + # - `ACH_ORIGINATION_INITIATED` - ACH origination received and pending + # approval/release from an ACH hold. + # - `ACH_ORIGINATION_REVIEWED` - ACH origination has completed the review process. + # - `ACH_ORIGINATION_CANCELLED` - ACH origination has been cancelled. + # - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed and sent to + # the Federal Reserve. + # - `ACH_ORIGINATION_SETTLED` - ACH origination has settled. + # - `ACH_ORIGINATION_RELEASED` - ACH origination released from pending to + # available balance. + # - `ACH_ORIGINATION_REJECTED` - ACH origination was rejected and not sent to the + # Federal Reserve. + # - `ACH_RECEIPT_PROCESSED` - ACH receipt pending release from an ACH holder. + # - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled. + # - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available + # balance. + # - `ACH_RECEIPT_RELEASED_EARLY` - ACH receipt released early from pending to + # available balance. + # - `ACH_RETURN_INITIATED` - ACH initiated return for an ACH receipt. + # - `ACH_RETURN_PROCESSED` - ACH receipt returned by the Receiving Depository + # Financial Institution. + # - `ACH_RETURN_SETTLED` - ACH return settled by the Receiving Depository + # Financial Institution. + # - `ACH_RETURN_REJECTED` - ACH return was rejected by the Receiving Depository + # Financial Institution. + # + # Wire transfer events: + # + # - `WIRE_TRANSFER_INBOUND_RECEIVED` - Inbound wire transfer received from the + # Federal Reserve and pending release to available balance. + # - `WIRE_TRANSFER_INBOUND_SETTLED` - Inbound wire transfer funds released from + # pending to available balance. + # - `WIRE_TRANSFER_INBOUND_BLOCKED` - Inbound wire transfer blocked and funds + # frozen for regulatory review. + # + # Wire return events: + # + # - `WIRE_RETURN_OUTBOUND_INITIATED` - Outbound wire return initiated to return + # funds from an inbound wire transfer. + # - `WIRE_RETURN_OUTBOUND_SENT` - Outbound wire return sent to the Federal Reserve + # and pending acceptance. + # - `WIRE_RETURN_OUTBOUND_SETTLED` - Outbound wire return accepted by the Federal + # Reserve and funds returned to sender. + # - `WIRE_RETURN_OUTBOUND_REJECTED` - Outbound wire return rejected by the Federal + # Reserve. + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Payment::Event::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACH_ORIGINATION_CANCELLED = + T.let( + :ACH_ORIGINATION_CANCELLED, + Lithic::Payment::Event::Type::TaggedSymbol + ) + ACH_ORIGINATION_INITIATED = + T.let( + :ACH_ORIGINATION_INITIATED, + Lithic::Payment::Event::Type::TaggedSymbol + ) + ACH_ORIGINATION_PROCESSED = + T.let( + :ACH_ORIGINATION_PROCESSED, + Lithic::Payment::Event::Type::TaggedSymbol + ) + ACH_ORIGINATION_REJECTED = + T.let( + :ACH_ORIGINATION_REJECTED, + Lithic::Payment::Event::Type::TaggedSymbol + ) + ACH_ORIGINATION_RELEASED = + T.let( + :ACH_ORIGINATION_RELEASED, + Lithic::Payment::Event::Type::TaggedSymbol + ) + ACH_ORIGINATION_REVIEWED = + T.let( + :ACH_ORIGINATION_REVIEWED, + Lithic::Payment::Event::Type::TaggedSymbol + ) + ACH_ORIGINATION_SETTLED = + T.let( + :ACH_ORIGINATION_SETTLED, + Lithic::Payment::Event::Type::TaggedSymbol + ) + ACH_RECEIPT_PROCESSED = + T.let( + :ACH_RECEIPT_PROCESSED, + Lithic::Payment::Event::Type::TaggedSymbol + ) + ACH_RECEIPT_RELEASED = + T.let( + :ACH_RECEIPT_RELEASED, + Lithic::Payment::Event::Type::TaggedSymbol + ) + ACH_RECEIPT_RELEASED_EARLY = + T.let( + :ACH_RECEIPT_RELEASED_EARLY, + Lithic::Payment::Event::Type::TaggedSymbol + ) + ACH_RECEIPT_SETTLED = + T.let( + :ACH_RECEIPT_SETTLED, + Lithic::Payment::Event::Type::TaggedSymbol + ) + ACH_RETURN_INITIATED = + T.let( + :ACH_RETURN_INITIATED, + Lithic::Payment::Event::Type::TaggedSymbol + ) + ACH_RETURN_PROCESSED = + T.let( + :ACH_RETURN_PROCESSED, + Lithic::Payment::Event::Type::TaggedSymbol + ) + ACH_RETURN_REJECTED = + T.let( + :ACH_RETURN_REJECTED, + Lithic::Payment::Event::Type::TaggedSymbol + ) + ACH_RETURN_SETTLED = + T.let( + :ACH_RETURN_SETTLED, + Lithic::Payment::Event::Type::TaggedSymbol + ) + WIRE_TRANSFER_INBOUND_RECEIVED = + T.let( + :WIRE_TRANSFER_INBOUND_RECEIVED, + Lithic::Payment::Event::Type::TaggedSymbol + ) + WIRE_TRANSFER_INBOUND_SETTLED = + T.let( + :WIRE_TRANSFER_INBOUND_SETTLED, + Lithic::Payment::Event::Type::TaggedSymbol + ) + WIRE_TRANSFER_INBOUND_BLOCKED = + T.let( + :WIRE_TRANSFER_INBOUND_BLOCKED, + Lithic::Payment::Event::Type::TaggedSymbol + ) + WIRE_RETURN_OUTBOUND_INITIATED = + T.let( + :WIRE_RETURN_OUTBOUND_INITIATED, + Lithic::Payment::Event::Type::TaggedSymbol + ) + WIRE_RETURN_OUTBOUND_SENT = + T.let( + :WIRE_RETURN_OUTBOUND_SENT, + Lithic::Payment::Event::Type::TaggedSymbol + ) + WIRE_RETURN_OUTBOUND_SETTLED = + T.let( + :WIRE_RETURN_OUTBOUND_SETTLED, + Lithic::Payment::Event::Type::TaggedSymbol + ) + WIRE_RETURN_OUTBOUND_REJECTED = + T.let( + :WIRE_RETURN_OUTBOUND_REJECTED, + Lithic::Payment::Event::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::Payment::Event::Type::TaggedSymbol] + ) + end + def self.values + end + end + + module DetailedResult + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Payment::Event::DetailedResult) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::Payment::Event::DetailedResult::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::Payment::Event::DetailedResult::TaggedSymbol + ) + FUNDS_INSUFFICIENT = + T.let( + :FUNDS_INSUFFICIENT, + Lithic::Payment::Event::DetailedResult::TaggedSymbol + ) + ACCOUNT_INVALID = + T.let( + :ACCOUNT_INVALID, + Lithic::Payment::Event::DetailedResult::TaggedSymbol + ) + PROGRAM_TRANSACTION_LIMIT_EXCEEDED = + T.let( + :PROGRAM_TRANSACTION_LIMIT_EXCEEDED, + Lithic::Payment::Event::DetailedResult::TaggedSymbol + ) + PROGRAM_DAILY_LIMIT_EXCEEDED = + T.let( + :PROGRAM_DAILY_LIMIT_EXCEEDED, + Lithic::Payment::Event::DetailedResult::TaggedSymbol + ) + PROGRAM_MONTHLY_LIMIT_EXCEEDED = + T.let( + :PROGRAM_MONTHLY_LIMIT_EXCEEDED, + Lithic::Payment::Event::DetailedResult::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::Payment::Event::DetailedResult::TaggedSymbol] + ) + end + def self.values + end + end + end + + # Transfer method + module Method + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Payment::Method) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACH_NEXT_DAY = + T.let(:ACH_NEXT_DAY, Lithic::Payment::Method::TaggedSymbol) + ACH_SAME_DAY = + T.let(:ACH_SAME_DAY, Lithic::Payment::Method::TaggedSymbol) + WIRE = T.let(:WIRE, Lithic::Payment::Method::TaggedSymbol) + + sig do + override.returns(T::Array[Lithic::Payment::Method::TaggedSymbol]) + end + def self.values + end + end + + # Method-specific attributes + module MethodAttributes + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::Payment::MethodAttributes::ACHMethodAttributes, + Lithic::Payment::MethodAttributes::WireMethodAttributes + ) + end + + class ACHMethodAttributes < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Payment::MethodAttributes::ACHMethodAttributes, + Lithic::Internal::AnyHash + ) + end + + # SEC code for ACH transaction + sig do + returns( + Lithic::Payment::MethodAttributes::ACHMethodAttributes::SecCode::TaggedSymbol + ) + end + attr_accessor :sec_code + + # Number of days the ACH transaction is on hold + sig { returns(T.nilable(Integer)) } + attr_accessor :ach_hold_period + + # Addenda information + sig { returns(T.nilable(String)) } + attr_accessor :addenda + + # Company ID for the ACH transaction + sig { returns(T.nilable(String)) } + attr_accessor :company_id + + # Value to override the configured company name with. Can only be used if allowed + # to override + sig { returns(T.nilable(String)) } + attr_accessor :override_company_name + + # Receipt routing number + sig { returns(T.nilable(String)) } + attr_accessor :receipt_routing_number + + # Number of retries attempted + sig { returns(T.nilable(Integer)) } + attr_accessor :retries + + # Return reason code if the transaction was returned + sig { returns(T.nilable(String)) } + attr_accessor :return_reason_code + + # Trace numbers for the ACH transaction + sig { returns(T.nilable(T::Array[String])) } + attr_reader :trace_numbers + + sig { params(trace_numbers: T::Array[String]).void } + attr_writer :trace_numbers + + sig do + params( + sec_code: + Lithic::Payment::MethodAttributes::ACHMethodAttributes::SecCode::OrSymbol, + ach_hold_period: T.nilable(Integer), + addenda: T.nilable(String), + company_id: T.nilable(String), + override_company_name: T.nilable(String), + receipt_routing_number: T.nilable(String), + retries: T.nilable(Integer), + return_reason_code: T.nilable(String), + trace_numbers: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # SEC code for ACH transaction + sec_code:, + # Number of days the ACH transaction is on hold + ach_hold_period: nil, + # Addenda information + addenda: nil, + # Company ID for the ACH transaction + company_id: nil, + # Value to override the configured company name with. Can only be used if allowed + # to override + override_company_name: nil, + # Receipt routing number + receipt_routing_number: nil, + # Number of retries attempted + retries: nil, + # Return reason code if the transaction was returned + return_reason_code: nil, + # Trace numbers for the ACH transaction + trace_numbers: nil + ) + end + + sig do + override.returns( + { + sec_code: + Lithic::Payment::MethodAttributes::ACHMethodAttributes::SecCode::TaggedSymbol, + ach_hold_period: T.nilable(Integer), + addenda: T.nilable(String), + company_id: T.nilable(String), + override_company_name: T.nilable(String), + receipt_routing_number: T.nilable(String), + retries: T.nilable(Integer), + return_reason_code: T.nilable(String), + trace_numbers: T::Array[String] + } + ) + end + def to_hash + end + + # SEC code for ACH transaction + module SecCode + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Payment::MethodAttributes::ACHMethodAttributes::SecCode + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CCD = + T.let( + :CCD, + Lithic::Payment::MethodAttributes::ACHMethodAttributes::SecCode::TaggedSymbol + ) + PPD = + T.let( + :PPD, + Lithic::Payment::MethodAttributes::ACHMethodAttributes::SecCode::TaggedSymbol + ) + WEB = + T.let( + :WEB, + Lithic::Payment::MethodAttributes::ACHMethodAttributes::SecCode::TaggedSymbol + ) + TEL = + T.let( + :TEL, + Lithic::Payment::MethodAttributes::ACHMethodAttributes::SecCode::TaggedSymbol + ) + CIE = + T.let( + :CIE, + Lithic::Payment::MethodAttributes::ACHMethodAttributes::SecCode::TaggedSymbol + ) + CTX = + T.let( + :CTX, + Lithic::Payment::MethodAttributes::ACHMethodAttributes::SecCode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Payment::MethodAttributes::ACHMethodAttributes::SecCode::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class WireMethodAttributes < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Payment::MethodAttributes::WireMethodAttributes, + Lithic::Internal::AnyHash + ) + end + + # Type of wire message + sig { returns(T.nilable(String)) } + attr_accessor :wire_message_type + + # Type of wire transfer + sig do + returns( + Lithic::Payment::MethodAttributes::WireMethodAttributes::WireNetwork::TaggedSymbol + ) + end + attr_accessor :wire_network + + sig { returns(T.nilable(Lithic::WirePartyDetails)) } + attr_reader :creditor + + sig { params(creditor: Lithic::WirePartyDetails::OrHash).void } + attr_writer :creditor + + sig { returns(T.nilable(Lithic::WirePartyDetails)) } + attr_reader :debtor + + sig { params(debtor: Lithic::WirePartyDetails::OrHash).void } + attr_writer :debtor + + # Point to point reference identifier, as assigned by the instructing party, used + # for tracking the message through the Fedwire system + sig { returns(T.nilable(String)) } + attr_accessor :message_id + + # Payment details or invoice reference + sig { returns(T.nilable(String)) } + attr_accessor :remittance_information + + sig do + params( + wire_message_type: T.nilable(String), + wire_network: + Lithic::Payment::MethodAttributes::WireMethodAttributes::WireNetwork::OrSymbol, + creditor: Lithic::WirePartyDetails::OrHash, + debtor: Lithic::WirePartyDetails::OrHash, + message_id: T.nilable(String), + remittance_information: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Type of wire message + wire_message_type:, + # Type of wire transfer + wire_network:, + creditor: nil, + debtor: nil, + # Point to point reference identifier, as assigned by the instructing party, used + # for tracking the message through the Fedwire system + message_id: nil, + # Payment details or invoice reference + remittance_information: nil + ) + end + + sig do + override.returns( + { + wire_message_type: T.nilable(String), + wire_network: + Lithic::Payment::MethodAttributes::WireMethodAttributes::WireNetwork::TaggedSymbol, + creditor: Lithic::WirePartyDetails, + debtor: Lithic::WirePartyDetails, + message_id: T.nilable(String), + remittance_information: T.nilable(String) + } + ) + end + def to_hash + end + + # Type of wire transfer + module WireNetwork + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Payment::MethodAttributes::WireMethodAttributes::WireNetwork + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FEDWIRE = + T.let( + :FEDWIRE, + Lithic::Payment::MethodAttributes::WireMethodAttributes::WireNetwork::TaggedSymbol + ) + SWIFT = + T.let( + :SWIFT, + Lithic::Payment::MethodAttributes::WireMethodAttributes::WireNetwork::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Payment::MethodAttributes::WireMethodAttributes::WireNetwork::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig do + override.returns( + T::Array[Lithic::Payment::MethodAttributes::Variants] + ) + end + def self.variants + end + end + + class RelatedAccountTokens < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Payment::RelatedAccountTokens, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for the account + sig { returns(T.nilable(String)) } + attr_accessor :account_token + + # Globally unique identifier for the business account + sig { returns(T.nilable(String)) } + attr_accessor :business_account_token + + # Account tokens related to a payment transaction + sig do + params( + account_token: T.nilable(String), + business_account_token: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the account + account_token:, + # Globally unique identifier for the business account + business_account_token: + ) + end + + sig do + override.returns( + { + account_token: T.nilable(String), + business_account_token: T.nilable(String) + } + ) + end + def to_hash + end + end + + # Transaction result + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Payment::Result) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = T.let(:APPROVED, Lithic::Payment::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Payment::Result::TaggedSymbol) + + sig do + override.returns(T::Array[Lithic::Payment::Result::TaggedSymbol]) + end + def self.values + end + end + + # Transaction source + module Source + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Payment::Source) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LITHIC = T.let(:LITHIC, Lithic::Payment::Source::TaggedSymbol) + EXTERNAL = T.let(:EXTERNAL, Lithic::Payment::Source::TaggedSymbol) + CUSTOMER = T.let(:CUSTOMER, Lithic::Payment::Source::TaggedSymbol) + + sig do + override.returns(T::Array[Lithic::Payment::Source::TaggedSymbol]) + end + def self.values + end + end + + # The status of the transaction + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Payment::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = T.let(:PENDING, Lithic::Payment::Status::TaggedSymbol) + SETTLED = T.let(:SETTLED, Lithic::Payment::Status::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Payment::Status::TaggedSymbol) + REVERSED = T.let(:REVERSED, Lithic::Payment::Status::TaggedSymbol) + CANCELED = T.let(:CANCELED, Lithic::Payment::Status::TaggedSymbol) + RETURNED = T.let(:RETURNED, Lithic::Payment::Status::TaggedSymbol) + + sig do + override.returns(T::Array[Lithic::Payment::Status::TaggedSymbol]) + end + def self.values + end + end + + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Payment::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ORIGINATION_CREDIT = + T.let(:ORIGINATION_CREDIT, Lithic::Payment::Type::TaggedSymbol) + ORIGINATION_DEBIT = + T.let(:ORIGINATION_DEBIT, Lithic::Payment::Type::TaggedSymbol) + RECEIPT_CREDIT = + T.let(:RECEIPT_CREDIT, Lithic::Payment::Type::TaggedSymbol) + RECEIPT_DEBIT = + T.let(:RECEIPT_DEBIT, Lithic::Payment::Type::TaggedSymbol) + WIRE_INBOUND_PAYMENT = + T.let(:WIRE_INBOUND_PAYMENT, Lithic::Payment::Type::TaggedSymbol) + WIRE_INBOUND_ADMIN = + T.let(:WIRE_INBOUND_ADMIN, Lithic::Payment::Type::TaggedSymbol) + WIRE_OUTBOUND_PAYMENT = + T.let(:WIRE_OUTBOUND_PAYMENT, Lithic::Payment::Type::TaggedSymbol) + WIRE_OUTBOUND_ADMIN = + T.let(:WIRE_OUTBOUND_ADMIN, Lithic::Payment::Type::TaggedSymbol) + WIRE_INBOUND_DRAWDOWN_REQUEST = + T.let( + :WIRE_INBOUND_DRAWDOWN_REQUEST, + Lithic::Payment::Type::TaggedSymbol + ) + + sig { override.returns(T::Array[Lithic::Payment::Type::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/payment_create_params.rbi b/rbi/lithic/models/payment_create_params.rbi new file mode 100644 index 00000000..57fcea10 --- /dev/null +++ b/rbi/lithic/models/payment_create_params.rbi @@ -0,0 +1,298 @@ +# typed: strong + +module Lithic + module Models + class PaymentCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::PaymentCreateParams, Lithic::Internal::AnyHash) + end + + sig { returns(Integer) } + attr_accessor :amount + + sig { returns(String) } + attr_accessor :external_bank_account_token + + sig { returns(String) } + attr_accessor :financial_account_token + + sig { returns(Lithic::PaymentCreateParams::Method::OrSymbol) } + attr_accessor :method_ + + sig { returns(Lithic::PaymentCreateParams::MethodAttributes) } + attr_reader :method_attributes + + sig do + params( + method_attributes: + Lithic::PaymentCreateParams::MethodAttributes::OrHash + ).void + end + attr_writer :method_attributes + + sig { returns(Lithic::PaymentCreateParams::Type::OrSymbol) } + attr_accessor :type + + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # Optional hold to settle when this payment is initiated. + sig { returns(T.nilable(Lithic::PaymentCreateParams::Hold)) } + attr_reader :hold + + sig { params(hold: Lithic::PaymentCreateParams::Hold::OrHash).void } + attr_writer :hold + + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + sig { returns(T.nilable(String)) } + attr_reader :user_defined_id + + sig { params(user_defined_id: String).void } + attr_writer :user_defined_id + + sig do + params( + amount: Integer, + external_bank_account_token: String, + financial_account_token: String, + method_: Lithic::PaymentCreateParams::Method::OrSymbol, + method_attributes: + Lithic::PaymentCreateParams::MethodAttributes::OrHash, + type: Lithic::PaymentCreateParams::Type::OrSymbol, + token: String, + hold: Lithic::PaymentCreateParams::Hold::OrHash, + memo: String, + user_defined_id: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + amount:, + external_bank_account_token:, + financial_account_token:, + method_:, + method_attributes:, + type:, + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + token: nil, + # Optional hold to settle when this payment is initiated. + hold: nil, + memo: nil, + user_defined_id: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + amount: Integer, + external_bank_account_token: String, + financial_account_token: String, + method_: Lithic::PaymentCreateParams::Method::OrSymbol, + method_attributes: Lithic::PaymentCreateParams::MethodAttributes, + type: Lithic::PaymentCreateParams::Type::OrSymbol, + token: String, + hold: Lithic::PaymentCreateParams::Hold, + memo: String, + user_defined_id: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + module Method + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::PaymentCreateParams::Method) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACH_NEXT_DAY = + T.let( + :ACH_NEXT_DAY, + Lithic::PaymentCreateParams::Method::TaggedSymbol + ) + ACH_SAME_DAY = + T.let( + :ACH_SAME_DAY, + Lithic::PaymentCreateParams::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::PaymentCreateParams::Method::TaggedSymbol] + ) + end + def self.values + end + end + + class MethodAttributes < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::PaymentCreateParams::MethodAttributes, + Lithic::Internal::AnyHash + ) + end + + sig do + returns( + Lithic::PaymentCreateParams::MethodAttributes::SecCode::OrSymbol + ) + end + attr_accessor :sec_code + + # Number of days to hold the ACH payment + sig { returns(T.nilable(Integer)) } + attr_reader :ach_hold_period + + sig { params(ach_hold_period: Integer).void } + attr_writer :ach_hold_period + + sig { returns(T.nilable(String)) } + attr_accessor :addenda + + # Value to override the configured company name with. Can only be used if allowed + # to override + sig { returns(T.nilable(String)) } + attr_accessor :override_company_name + + sig do + params( + sec_code: + Lithic::PaymentCreateParams::MethodAttributes::SecCode::OrSymbol, + ach_hold_period: Integer, + addenda: T.nilable(String), + override_company_name: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + sec_code:, + # Number of days to hold the ACH payment + ach_hold_period: nil, + addenda: nil, + # Value to override the configured company name with. Can only be used if allowed + # to override + override_company_name: nil + ) + end + + sig do + override.returns( + { + sec_code: + Lithic::PaymentCreateParams::MethodAttributes::SecCode::OrSymbol, + ach_hold_period: Integer, + addenda: T.nilable(String), + override_company_name: T.nilable(String) + } + ) + end + def to_hash + end + + module SecCode + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::PaymentCreateParams::MethodAttributes::SecCode + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CCD = + T.let( + :CCD, + Lithic::PaymentCreateParams::MethodAttributes::SecCode::TaggedSymbol + ) + PPD = + T.let( + :PPD, + Lithic::PaymentCreateParams::MethodAttributes::SecCode::TaggedSymbol + ) + WEB = + T.let( + :WEB, + Lithic::PaymentCreateParams::MethodAttributes::SecCode::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::PaymentCreateParams::MethodAttributes::SecCode::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::PaymentCreateParams::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + COLLECTION = + T.let(:COLLECTION, Lithic::PaymentCreateParams::Type::TaggedSymbol) + PAYMENT = + T.let(:PAYMENT, Lithic::PaymentCreateParams::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::PaymentCreateParams::Type::TaggedSymbol] + ) + end + def self.values + end + end + + class Hold < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::PaymentCreateParams::Hold, Lithic::Internal::AnyHash) + end + + # Token of the hold to settle when this payment is initiated. + sig { returns(String) } + attr_accessor :token + + # Optional hold to settle when this payment is initiated. + sig { params(token: String).returns(T.attached_class) } + def self.new( + # Token of the hold to settle when this payment is initiated. + token: + ) + end + + sig { override.returns({ token: String }) } + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/payment_create_response.rbi b/rbi/lithic/models/payment_create_response.rbi new file mode 100644 index 00000000..11cacc2a --- /dev/null +++ b/rbi/lithic/models/payment_create_response.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module Lithic + module Models + class PaymentCreateResponse < Lithic::Models::Payment + OrHash = + T.type_alias do + T.any( + Lithic::Models::PaymentCreateResponse, + Lithic::Internal::AnyHash + ) + end + + # Balance + sig { returns(T.nilable(Lithic::Balance)) } + attr_reader :balance + + sig { params(balance: Lithic::Balance::OrHash).void } + attr_writer :balance + + # Payment transaction + sig { params(balance: Lithic::Balance::OrHash).returns(T.attached_class) } + def self.new( + # Balance + balance: nil + ) + end + + sig { override.returns({ balance: Lithic::Balance }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/payment_list_params.rbi b/rbi/lithic/models/payment_list_params.rbi new file mode 100644 index 00000000..5372d18b --- /dev/null +++ b/rbi/lithic/models/payment_list_params.rbi @@ -0,0 +1,218 @@ +# typed: strong + +module Lithic + module Models + class PaymentListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::PaymentListParams, Lithic::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + sig { returns(T.nilable(String)) } + attr_reader :business_account_token + + sig { params(business_account_token: String).void } + attr_writer :business_account_token + + sig { returns(T.nilable(Lithic::PaymentListParams::Category::OrSymbol)) } + attr_reader :category + + sig do + params(category: Lithic::PaymentListParams::Category::OrSymbol).void + end + attr_writer :category + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + sig { returns(T.nilable(String)) } + attr_reader :financial_account_token + + sig { params(financial_account_token: String).void } + attr_writer :financial_account_token + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + sig { returns(T.nilable(Lithic::PaymentListParams::Result::OrSymbol)) } + attr_reader :result + + sig { params(result: Lithic::PaymentListParams::Result::OrSymbol).void } + attr_writer :result + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig { returns(T.nilable(Lithic::PaymentListParams::Status::OrSymbol)) } + attr_reader :status + + sig { params(status: Lithic::PaymentListParams::Status::OrSymbol).void } + attr_writer :status + + sig do + params( + account_token: String, + begin_: Time, + business_account_token: String, + category: Lithic::PaymentListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::PaymentListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::PaymentListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + account_token: nil, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + business_account_token: nil, + category: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + financial_account_token: nil, + # Page size (for pagination). + page_size: nil, + result: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + status: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + account_token: String, + begin_: Time, + business_account_token: String, + category: Lithic::PaymentListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::PaymentListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::PaymentListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + module Category + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::PaymentListParams::Category) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACH = T.let(:ACH, Lithic::PaymentListParams::Category::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::PaymentListParams::Category::TaggedSymbol] + ) + end + def self.values + end + end + + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::PaymentListParams::Result) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let(:APPROVED, Lithic::PaymentListParams::Result::TaggedSymbol) + DECLINED = + T.let(:DECLINED, Lithic::PaymentListParams::Result::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::PaymentListParams::Result::TaggedSymbol] + ) + end + def self.values + end + end + + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::PaymentListParams::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DECLINED = + T.let(:DECLINED, Lithic::PaymentListParams::Status::TaggedSymbol) + PENDING = + T.let(:PENDING, Lithic::PaymentListParams::Status::TaggedSymbol) + RETURNED = + T.let(:RETURNED, Lithic::PaymentListParams::Status::TaggedSymbol) + SETTLED = + T.let(:SETTLED, Lithic::PaymentListParams::Status::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::PaymentListParams::Status::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/payment_retrieve_params.rbi b/rbi/lithic/models/payment_retrieve_params.rbi new file mode 100644 index 00000000..c5fa5cb3 --- /dev/null +++ b/rbi/lithic/models/payment_retrieve_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Lithic + module Models + class PaymentRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::PaymentRetrieveParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :payment_token + + sig do + params( + payment_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(payment_token:, request_options: {}) + end + + sig do + override.returns( + { payment_token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/payment_retry_params.rbi b/rbi/lithic/models/payment_retry_params.rbi new file mode 100644 index 00000000..17c18453 --- /dev/null +++ b/rbi/lithic/models/payment_retry_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Lithic + module Models + class PaymentRetryParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::PaymentRetryParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :payment_token + + sig do + params( + payment_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(payment_token:, request_options: {}) + end + + sig do + override.returns( + { payment_token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/payment_retry_response.rbi b/rbi/lithic/models/payment_retry_response.rbi new file mode 100644 index 00000000..ccee3a10 --- /dev/null +++ b/rbi/lithic/models/payment_retry_response.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Lithic + module Models + class PaymentRetryResponse < Lithic::Models::Payment + OrHash = + T.type_alias do + T.any(Lithic::Models::PaymentRetryResponse, Lithic::Internal::AnyHash) + end + + # Balance + sig { returns(T.nilable(Lithic::Balance)) } + attr_reader :balance + + sig { params(balance: Lithic::Balance::OrHash).void } + attr_writer :balance + + # Payment transaction + sig { params(balance: Lithic::Balance::OrHash).returns(T.attached_class) } + def self.new( + # Balance + balance: nil + ) + end + + sig { override.returns({ balance: Lithic::Balance }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/payment_return_params.rbi b/rbi/lithic/models/payment_return_params.rbi new file mode 100644 index 00000000..a2fb1cb1 --- /dev/null +++ b/rbi/lithic/models/payment_return_params.rbi @@ -0,0 +1,91 @@ +# typed: strong + +module Lithic + module Models + class PaymentReturnParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::PaymentReturnParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :payment_token + + # Globally unique identifier for the financial account + sig { returns(String) } + attr_accessor :financial_account_token + + # ACH return reason code indicating the reason for returning the payment. + # Supported codes include R01-R53 and R80-R85. For a complete list of return codes + # and their meanings, see + # [ACH Return Reasons](https://docs.lithic.com/docs/ach-overview#ach-return-reasons) + sig { returns(String) } + attr_accessor :return_reason_code + + # Optional additional information about the return. Limited to 44 characters + sig { returns(T.nilable(String)) } + attr_accessor :addenda + + # Date of death in YYYY-MM-DD format. Required when using return codes **R14** + # (representative payee deceased) or **R15** (beneficiary or account holder + # deceased) + sig { returns(T.nilable(Date)) } + attr_accessor :date_of_death + + # Optional memo for the return. Limited to 10 characters + sig { returns(T.nilable(String)) } + attr_accessor :memo + + sig do + params( + payment_token: String, + financial_account_token: String, + return_reason_code: String, + addenda: T.nilable(String), + date_of_death: T.nilable(Date), + memo: T.nilable(String), + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + payment_token:, + # Globally unique identifier for the financial account + financial_account_token:, + # ACH return reason code indicating the reason for returning the payment. + # Supported codes include R01-R53 and R80-R85. For a complete list of return codes + # and their meanings, see + # [ACH Return Reasons](https://docs.lithic.com/docs/ach-overview#ach-return-reasons) + return_reason_code:, + # Optional additional information about the return. Limited to 44 characters + addenda: nil, + # Date of death in YYYY-MM-DD format. Required when using return codes **R14** + # (representative payee deceased) or **R15** (beneficiary or account holder + # deceased) + date_of_death: nil, + # Optional memo for the return. Limited to 10 characters + memo: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + payment_token: String, + financial_account_token: String, + return_reason_code: String, + addenda: T.nilable(String), + date_of_death: T.nilable(Date), + memo: T.nilable(String), + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/payment_simulate_action_params.rbi b/rbi/lithic/models/payment_simulate_action_params.rbi new file mode 100644 index 00000000..d3790ffc --- /dev/null +++ b/rbi/lithic/models/payment_simulate_action_params.rbi @@ -0,0 +1,216 @@ +# typed: strong + +module Lithic + module Models + class PaymentSimulateActionParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::PaymentSimulateActionParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :payment_token + + # Event Type + sig { returns(Lithic::PaymentSimulateActionParams::EventType::OrSymbol) } + attr_accessor :event_type + + # Date of Death for ACH Return + sig { returns(T.nilable(Date)) } + attr_reader :date_of_death + + sig { params(date_of_death: Date).void } + attr_writer :date_of_death + + # Decline reason + sig do + returns( + T.nilable( + Lithic::PaymentSimulateActionParams::DeclineReason::OrSymbol + ) + ) + end + attr_reader :decline_reason + + sig do + params( + decline_reason: + Lithic::PaymentSimulateActionParams::DeclineReason::OrSymbol + ).void + end + attr_writer :decline_reason + + # Return Addenda + sig { returns(T.nilable(String)) } + attr_reader :return_addenda + + sig { params(return_addenda: String).void } + attr_writer :return_addenda + + # Return Reason Code + sig { returns(T.nilable(String)) } + attr_reader :return_reason_code + + sig { params(return_reason_code: String).void } + attr_writer :return_reason_code + + sig do + params( + payment_token: String, + event_type: Lithic::PaymentSimulateActionParams::EventType::OrSymbol, + date_of_death: Date, + decline_reason: + Lithic::PaymentSimulateActionParams::DeclineReason::OrSymbol, + return_addenda: String, + return_reason_code: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + payment_token:, + # Event Type + event_type:, + # Date of Death for ACH Return + date_of_death: nil, + # Decline reason + decline_reason: nil, + # Return Addenda + return_addenda: nil, + # Return Reason Code + return_reason_code: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + payment_token: String, + event_type: + Lithic::PaymentSimulateActionParams::EventType::OrSymbol, + date_of_death: Date, + decline_reason: + Lithic::PaymentSimulateActionParams::DeclineReason::OrSymbol, + return_addenda: String, + return_reason_code: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Event Type + module EventType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::PaymentSimulateActionParams::EventType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACH_ORIGINATION_REVIEWED = + T.let( + :ACH_ORIGINATION_REVIEWED, + Lithic::PaymentSimulateActionParams::EventType::TaggedSymbol + ) + ACH_ORIGINATION_RELEASED = + T.let( + :ACH_ORIGINATION_RELEASED, + Lithic::PaymentSimulateActionParams::EventType::TaggedSymbol + ) + ACH_ORIGINATION_PROCESSED = + T.let( + :ACH_ORIGINATION_PROCESSED, + Lithic::PaymentSimulateActionParams::EventType::TaggedSymbol + ) + ACH_ORIGINATION_SETTLED = + T.let( + :ACH_ORIGINATION_SETTLED, + Lithic::PaymentSimulateActionParams::EventType::TaggedSymbol + ) + ACH_RECEIPT_SETTLED = + T.let( + :ACH_RECEIPT_SETTLED, + Lithic::PaymentSimulateActionParams::EventType::TaggedSymbol + ) + ACH_RECEIPT_RELEASED = + T.let( + :ACH_RECEIPT_RELEASED, + Lithic::PaymentSimulateActionParams::EventType::TaggedSymbol + ) + ACH_RECEIPT_RELEASED_EARLY = + T.let( + :ACH_RECEIPT_RELEASED_EARLY, + Lithic::PaymentSimulateActionParams::EventType::TaggedSymbol + ) + ACH_RETURN_INITIATED = + T.let( + :ACH_RETURN_INITIATED, + Lithic::PaymentSimulateActionParams::EventType::TaggedSymbol + ) + ACH_RETURN_PROCESSED = + T.let( + :ACH_RETURN_PROCESSED, + Lithic::PaymentSimulateActionParams::EventType::TaggedSymbol + ) + ACH_RETURN_SETTLED = + T.let( + :ACH_RETURN_SETTLED, + Lithic::PaymentSimulateActionParams::EventType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::PaymentSimulateActionParams::EventType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Decline reason + module DeclineReason + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::PaymentSimulateActionParams::DeclineReason) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PROGRAM_TRANSACTION_LIMIT_EXCEEDED = + T.let( + :PROGRAM_TRANSACTION_LIMIT_EXCEEDED, + Lithic::PaymentSimulateActionParams::DeclineReason::TaggedSymbol + ) + PROGRAM_DAILY_LIMIT_EXCEEDED = + T.let( + :PROGRAM_DAILY_LIMIT_EXCEEDED, + Lithic::PaymentSimulateActionParams::DeclineReason::TaggedSymbol + ) + PROGRAM_MONTHLY_LIMIT_EXCEEDED = + T.let( + :PROGRAM_MONTHLY_LIMIT_EXCEEDED, + Lithic::PaymentSimulateActionParams::DeclineReason::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::PaymentSimulateActionParams::DeclineReason::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/payment_simulate_action_response.rbi b/rbi/lithic/models/payment_simulate_action_response.rbi new file mode 100644 index 00000000..8e03c43c --- /dev/null +++ b/rbi/lithic/models/payment_simulate_action_response.rbi @@ -0,0 +1,94 @@ +# typed: strong + +module Lithic + module Models + class PaymentSimulateActionResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::PaymentSimulateActionResponse, + Lithic::Internal::AnyHash + ) + end + + # Debugging Request Id + sig { returns(String) } + attr_accessor :debugging_request_id + + # Request Result + sig do + returns( + Lithic::Models::PaymentSimulateActionResponse::Result::TaggedSymbol + ) + end + attr_accessor :result + + # Transaction Event Token + sig { returns(String) } + attr_accessor :transaction_event_token + + sig do + params( + debugging_request_id: String, + result: + Lithic::Models::PaymentSimulateActionResponse::Result::OrSymbol, + transaction_event_token: String + ).returns(T.attached_class) + end + def self.new( + # Debugging Request Id + debugging_request_id:, + # Request Result + result:, + # Transaction Event Token + transaction_event_token: + ) + end + + sig do + override.returns( + { + debugging_request_id: String, + result: + Lithic::Models::PaymentSimulateActionResponse::Result::TaggedSymbol, + transaction_event_token: String + } + ) + end + def to_hash + end + + # Request Result + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Models::PaymentSimulateActionResponse::Result) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::Models::PaymentSimulateActionResponse::Result::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::Models::PaymentSimulateActionResponse::Result::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::PaymentSimulateActionResponse::Result::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/payment_simulate_receipt_params.rbi b/rbi/lithic/models/payment_simulate_receipt_params.rbi new file mode 100644 index 00000000..57ea6974 --- /dev/null +++ b/rbi/lithic/models/payment_simulate_receipt_params.rbi @@ -0,0 +1,114 @@ +# typed: strong + +module Lithic + module Models + class PaymentSimulateReceiptParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::PaymentSimulateReceiptParams, Lithic::Internal::AnyHash) + end + + # Customer-generated payment token used to uniquely identify the simulated payment + sig { returns(String) } + attr_accessor :token + + # Amount + sig { returns(Integer) } + attr_accessor :amount + + # Financial Account Token + sig { returns(String) } + attr_accessor :financial_account_token + + # Receipt Type + sig do + returns(Lithic::PaymentSimulateReceiptParams::ReceiptType::OrSymbol) + end + attr_accessor :receipt_type + + # Memo + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + sig do + params( + token: String, + amount: Integer, + financial_account_token: String, + receipt_type: + Lithic::PaymentSimulateReceiptParams::ReceiptType::OrSymbol, + memo: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Customer-generated payment token used to uniquely identify the simulated payment + token:, + # Amount + amount:, + # Financial Account Token + financial_account_token:, + # Receipt Type + receipt_type:, + # Memo + memo: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + token: String, + amount: Integer, + financial_account_token: String, + receipt_type: + Lithic::PaymentSimulateReceiptParams::ReceiptType::OrSymbol, + memo: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Receipt Type + module ReceiptType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::PaymentSimulateReceiptParams::ReceiptType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + RECEIPT_CREDIT = + T.let( + :RECEIPT_CREDIT, + Lithic::PaymentSimulateReceiptParams::ReceiptType::TaggedSymbol + ) + RECEIPT_DEBIT = + T.let( + :RECEIPT_DEBIT, + Lithic::PaymentSimulateReceiptParams::ReceiptType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::PaymentSimulateReceiptParams::ReceiptType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/payment_simulate_receipt_response.rbi b/rbi/lithic/models/payment_simulate_receipt_response.rbi new file mode 100644 index 00000000..03f29941 --- /dev/null +++ b/rbi/lithic/models/payment_simulate_receipt_response.rbi @@ -0,0 +1,97 @@ +# typed: strong + +module Lithic + module Models + class PaymentSimulateReceiptResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::PaymentSimulateReceiptResponse, + Lithic::Internal::AnyHash + ) + end + + # Debugging Request Id + sig { returns(String) } + attr_accessor :debugging_request_id + + # Request Result + sig do + returns( + Lithic::Models::PaymentSimulateReceiptResponse::Result::TaggedSymbol + ) + end + attr_accessor :result + + # Transaction Event Token + sig { returns(String) } + attr_accessor :transaction_event_token + + sig do + params( + debugging_request_id: String, + result: + Lithic::Models::PaymentSimulateReceiptResponse::Result::OrSymbol, + transaction_event_token: String + ).returns(T.attached_class) + end + def self.new( + # Debugging Request Id + debugging_request_id:, + # Request Result + result:, + # Transaction Event Token + transaction_event_token: + ) + end + + sig do + override.returns( + { + debugging_request_id: String, + result: + Lithic::Models::PaymentSimulateReceiptResponse::Result::TaggedSymbol, + transaction_event_token: String + } + ) + end + def to_hash + end + + # Request Result + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::PaymentSimulateReceiptResponse::Result + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::Models::PaymentSimulateReceiptResponse::Result::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::Models::PaymentSimulateReceiptResponse::Result::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::PaymentSimulateReceiptResponse::Result::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/payment_simulate_release_params.rbi b/rbi/lithic/models/payment_simulate_release_params.rbi new file mode 100644 index 00000000..e34822ce --- /dev/null +++ b/rbi/lithic/models/payment_simulate_release_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module Lithic + module Models + class PaymentSimulateReleaseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::PaymentSimulateReleaseParams, Lithic::Internal::AnyHash) + end + + # Payment Token + sig { returns(String) } + attr_accessor :payment_token + + sig do + params( + payment_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Payment Token + payment_token:, + request_options: {} + ) + end + + sig do + override.returns( + { payment_token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/payment_simulate_release_response.rbi b/rbi/lithic/models/payment_simulate_release_response.rbi new file mode 100644 index 00000000..e73e35f0 --- /dev/null +++ b/rbi/lithic/models/payment_simulate_release_response.rbi @@ -0,0 +1,97 @@ +# typed: strong + +module Lithic + module Models + class PaymentSimulateReleaseResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::PaymentSimulateReleaseResponse, + Lithic::Internal::AnyHash + ) + end + + # Debugging Request Id + sig { returns(String) } + attr_accessor :debugging_request_id + + # Request Result + sig do + returns( + Lithic::Models::PaymentSimulateReleaseResponse::Result::TaggedSymbol + ) + end + attr_accessor :result + + # Transaction Event Token + sig { returns(String) } + attr_accessor :transaction_event_token + + sig do + params( + debugging_request_id: String, + result: + Lithic::Models::PaymentSimulateReleaseResponse::Result::OrSymbol, + transaction_event_token: String + ).returns(T.attached_class) + end + def self.new( + # Debugging Request Id + debugging_request_id:, + # Request Result + result:, + # Transaction Event Token + transaction_event_token: + ) + end + + sig do + override.returns( + { + debugging_request_id: String, + result: + Lithic::Models::PaymentSimulateReleaseResponse::Result::TaggedSymbol, + transaction_event_token: String + } + ) + end + def to_hash + end + + # Request Result + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Models::PaymentSimulateReleaseResponse::Result + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::Models::PaymentSimulateReleaseResponse::Result::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::Models::PaymentSimulateReleaseResponse::Result::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::PaymentSimulateReleaseResponse::Result::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/payment_simulate_return_params.rbi b/rbi/lithic/models/payment_simulate_return_params.rbi new file mode 100644 index 00000000..dd07ad96 --- /dev/null +++ b/rbi/lithic/models/payment_simulate_return_params.rbi @@ -0,0 +1,54 @@ +# typed: strong + +module Lithic + module Models + class PaymentSimulateReturnParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::PaymentSimulateReturnParams, Lithic::Internal::AnyHash) + end + + # Payment Token + sig { returns(String) } + attr_accessor :payment_token + + # Return Reason Code + sig { returns(T.nilable(String)) } + attr_reader :return_reason_code + + sig { params(return_reason_code: String).void } + attr_writer :return_reason_code + + sig do + params( + payment_token: String, + return_reason_code: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Payment Token + payment_token:, + # Return Reason Code + return_reason_code: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + payment_token: String, + return_reason_code: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/payment_simulate_return_response.rbi b/rbi/lithic/models/payment_simulate_return_response.rbi new file mode 100644 index 00000000..10a77053 --- /dev/null +++ b/rbi/lithic/models/payment_simulate_return_response.rbi @@ -0,0 +1,94 @@ +# typed: strong + +module Lithic + module Models + class PaymentSimulateReturnResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::PaymentSimulateReturnResponse, + Lithic::Internal::AnyHash + ) + end + + # Debugging Request Id + sig { returns(String) } + attr_accessor :debugging_request_id + + # Request Result + sig do + returns( + Lithic::Models::PaymentSimulateReturnResponse::Result::TaggedSymbol + ) + end + attr_accessor :result + + # Transaction Event Token + sig { returns(String) } + attr_accessor :transaction_event_token + + sig do + params( + debugging_request_id: String, + result: + Lithic::Models::PaymentSimulateReturnResponse::Result::OrSymbol, + transaction_event_token: String + ).returns(T.attached_class) + end + def self.new( + # Debugging Request Id + debugging_request_id:, + # Request Result + result:, + # Transaction Event Token + transaction_event_token: + ) + end + + sig do + override.returns( + { + debugging_request_id: String, + result: + Lithic::Models::PaymentSimulateReturnResponse::Result::TaggedSymbol, + transaction_event_token: String + } + ) + end + def to_hash + end + + # Request Result + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Models::PaymentSimulateReturnResponse::Result) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::Models::PaymentSimulateReturnResponse::Result::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::Models::PaymentSimulateReturnResponse::Result::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Models::PaymentSimulateReturnResponse::Result::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/payment_transaction_created_webhook_event.rbi b/rbi/lithic/models/payment_transaction_created_webhook_event.rbi new file mode 100644 index 00000000..2034ecaa --- /dev/null +++ b/rbi/lithic/models/payment_transaction_created_webhook_event.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Lithic + module Models + class PaymentTransactionCreatedWebhookEvent < Lithic::Models::Payment + OrHash = + T.type_alias do + T.any( + Lithic::PaymentTransactionCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # Payment transaction + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"payment_transaction.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/payment_transaction_updated_webhook_event.rbi b/rbi/lithic/models/payment_transaction_updated_webhook_event.rbi new file mode 100644 index 00000000..6ea2c419 --- /dev/null +++ b/rbi/lithic/models/payment_transaction_updated_webhook_event.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Lithic + module Models + class PaymentTransactionUpdatedWebhookEvent < Lithic::Models::Payment + OrHash = + T.type_alias do + T.any( + Lithic::PaymentTransactionUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # Payment transaction + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"payment_transaction.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/provision_response.rbi b/rbi/lithic/models/provision_response.rbi new file mode 100644 index 00000000..4203f9f2 --- /dev/null +++ b/rbi/lithic/models/provision_response.rbi @@ -0,0 +1,58 @@ +# typed: strong + +module Lithic + module Models + class ProvisionResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::ProvisionResponse, Lithic::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_reader :activation_data + + sig { params(activation_data: String).void } + attr_writer :activation_data + + sig { returns(T.nilable(String)) } + attr_reader :encrypted_data + + sig { params(encrypted_data: String).void } + attr_writer :encrypted_data + + sig { returns(T.nilable(String)) } + attr_reader :ephemeral_public_key + + sig { params(ephemeral_public_key: String).void } + attr_writer :ephemeral_public_key + + # Object containing the fields required to add a card to Apple Pay. Applies only + # to Apple Pay wallet. + sig do + params( + activation_data: String, + encrypted_data: String, + ephemeral_public_key: String + ).returns(T.attached_class) + end + def self.new( + activation_data: nil, + encrypted_data: nil, + ephemeral_public_key: nil + ) + end + + sig do + override.returns( + { + activation_data: String, + encrypted_data: String, + ephemeral_public_key: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/reports/settlement/network_total_list_params.rbi b/rbi/lithic/models/reports/settlement/network_total_list_params.rbi new file mode 100644 index 00000000..3bbaa45e --- /dev/null +++ b/rbi/lithic/models/reports/settlement/network_total_list_params.rbi @@ -0,0 +1,236 @@ +# typed: strong + +module Lithic + module Models + module Reports + module Settlement + class NetworkTotalListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::Reports::Settlement::NetworkTotalListParams, + Lithic::Internal::AnyHash + ) + end + + # Datetime in RFC 3339 format. Only entries created after the specified time will + # be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Datetime in RFC 3339 format. Only entries created before the specified time will + # be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Institution ID to filter on. + sig { returns(T.nilable(String)) } + attr_reader :institution_id + + sig { params(institution_id: String).void } + attr_writer :institution_id + + # Network to filter on. + sig do + returns( + T.nilable( + Lithic::Reports::Settlement::NetworkTotalListParams::Network::OrSymbol + ) + ) + end + attr_reader :network + + sig do + params( + network: + Lithic::Reports::Settlement::NetworkTotalListParams::Network::OrSymbol + ).void + end + attr_writer :network + + # Number of records per page. + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # Singular report date to filter on (YYYY-MM-DD). Cannot be populated in + # conjunction with report_date_begin or report_date_end. + sig { returns(T.nilable(Date)) } + attr_reader :report_date + + sig { params(report_date: Date).void } + attr_writer :report_date + + # Earliest report date to filter on, inclusive (YYYY-MM-DD). + sig { returns(T.nilable(Date)) } + attr_reader :report_date_begin + + sig { params(report_date_begin: Date).void } + attr_writer :report_date_begin + + # Latest report date to filter on, inclusive (YYYY-MM-DD). + sig { returns(T.nilable(Date)) } + attr_reader :report_date_end + + sig { params(report_date_end: Date).void } + attr_writer :report_date_end + + # Settlement institution ID to filter on. + sig { returns(T.nilable(String)) } + attr_reader :settlement_institution_id + + sig { params(settlement_institution_id: String).void } + attr_writer :settlement_institution_id + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + begin_: Time, + end_: Time, + ending_before: String, + institution_id: String, + network: + Lithic::Reports::Settlement::NetworkTotalListParams::Network::OrSymbol, + page_size: Integer, + report_date: Date, + report_date_begin: Date, + report_date_end: Date, + settlement_institution_id: String, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Datetime in RFC 3339 format. Only entries created after the specified time will + # be included. UTC time zone. + begin_: nil, + # Datetime in RFC 3339 format. Only entries created before the specified time will + # be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Institution ID to filter on. + institution_id: nil, + # Network to filter on. + network: nil, + # Number of records per page. + page_size: nil, + # Singular report date to filter on (YYYY-MM-DD). Cannot be populated in + # conjunction with report_date_begin or report_date_end. + report_date: nil, + # Earliest report date to filter on, inclusive (YYYY-MM-DD). + report_date_begin: nil, + # Latest report date to filter on, inclusive (YYYY-MM-DD). + report_date_end: nil, + # Settlement institution ID to filter on. + settlement_institution_id: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + begin_: Time, + end_: Time, + ending_before: String, + institution_id: String, + network: + Lithic::Reports::Settlement::NetworkTotalListParams::Network::OrSymbol, + page_size: Integer, + report_date: Date, + report_date_begin: Date, + report_date_end: Date, + settlement_institution_id: String, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Network to filter on. + module Network + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Reports::Settlement::NetworkTotalListParams::Network + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AMEX = + T.let( + :AMEX, + Lithic::Reports::Settlement::NetworkTotalListParams::Network::TaggedSymbol + ) + VISA = + T.let( + :VISA, + Lithic::Reports::Settlement::NetworkTotalListParams::Network::TaggedSymbol + ) + MASTERCARD = + T.let( + :MASTERCARD, + Lithic::Reports::Settlement::NetworkTotalListParams::Network::TaggedSymbol + ) + MAESTRO = + T.let( + :MAESTRO, + Lithic::Reports::Settlement::NetworkTotalListParams::Network::TaggedSymbol + ) + INTERLINK = + T.let( + :INTERLINK, + Lithic::Reports::Settlement::NetworkTotalListParams::Network::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Reports::Settlement::NetworkTotalListParams::Network::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/lithic/models/reports/settlement/network_total_retrieve_params.rbi b/rbi/lithic/models/reports/settlement/network_total_retrieve_params.rbi new file mode 100644 index 00000000..727eabd0 --- /dev/null +++ b/rbi/lithic/models/reports/settlement/network_total_retrieve_params.rbi @@ -0,0 +1,42 @@ +# typed: strong + +module Lithic + module Models + module Reports + module Settlement + class NetworkTotalRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::Reports::Settlement::NetworkTotalRetrieveParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :token + + sig do + params( + token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(token:, request_options: {}) + end + + sig do + override.returns( + { token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/lithic/models/reports/settlement_list_details_params.rbi b/rbi/lithic/models/reports/settlement_list_details_params.rbi new file mode 100644 index 00000000..3ff93fef --- /dev/null +++ b/rbi/lithic/models/reports/settlement_list_details_params.rbi @@ -0,0 +1,83 @@ +# typed: strong + +module Lithic + module Models + module Reports + class SettlementListDetailsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::Reports::SettlementListDetailsParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Date) } + attr_accessor :report_date + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Number of records per page. + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + report_date: Date, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + report_date:, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Number of records per page. + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + report_date: Date, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/reports/settlement_summary_params.rbi b/rbi/lithic/models/reports/settlement_summary_params.rbi new file mode 100644 index 00000000..7a4b05c6 --- /dev/null +++ b/rbi/lithic/models/reports/settlement_summary_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module Lithic + module Models + module Reports + class SettlementSummaryParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::Reports::SettlementSummaryParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Date) } + attr_accessor :report_date + + sig do + params( + report_date: Date, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(report_date:, request_options: {}) + end + + sig do + override.returns( + { report_date: Date, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/required_document.rbi b/rbi/lithic/models/required_document.rbi new file mode 100644 index 00000000..2b856bef --- /dev/null +++ b/rbi/lithic/models/required_document.rbi @@ -0,0 +1,57 @@ +# typed: strong + +module Lithic + module Models + class RequiredDocument < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::RequiredDocument, Lithic::Internal::AnyHash) + end + + # Globally unique identifier for an entity. + sig { returns(String) } + attr_accessor :entity_token + + # Provides the status reasons that will be satisfied by providing one of the valid + # documents. + sig { returns(T::Array[String]) } + attr_accessor :status_reasons + + # A list of valid documents that will satisfy the KYC requirements for the + # specified entity. + sig { returns(T::Array[String]) } + attr_accessor :valid_documents + + sig do + params( + entity_token: String, + status_reasons: T::Array[String], + valid_documents: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for an entity. + entity_token:, + # Provides the status reasons that will be satisfied by providing one of the valid + # documents. + status_reasons:, + # A list of valid documents that will satisfy the KYC requirements for the + # specified entity. + valid_documents: + ) + end + + sig do + override.returns( + { + entity_token: String, + status_reasons: T::Array[String], + valid_documents: T::Array[String] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/responder_endpoint_check_status_params.rbi b/rbi/lithic/models/responder_endpoint_check_status_params.rbi new file mode 100644 index 00000000..b49fd57d --- /dev/null +++ b/rbi/lithic/models/responder_endpoint_check_status_params.rbi @@ -0,0 +1,85 @@ +# typed: strong + +module Lithic + module Models + class ResponderEndpointCheckStatusParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::ResponderEndpointCheckStatusParams, + Lithic::Internal::AnyHash + ) + end + + # The type of the endpoint. + sig do + returns(Lithic::ResponderEndpointCheckStatusParams::Type::OrSymbol) + end + attr_accessor :type + + sig do + params( + type: Lithic::ResponderEndpointCheckStatusParams::Type::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The type of the endpoint. + type:, + request_options: {} + ) + end + + sig do + override.returns( + { + type: Lithic::ResponderEndpointCheckStatusParams::Type::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # The type of the endpoint. + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ResponderEndpointCheckStatusParams::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AUTH_STREAM_ACCESS = + T.let( + :AUTH_STREAM_ACCESS, + Lithic::ResponderEndpointCheckStatusParams::Type::TaggedSymbol + ) + THREE_DS_DECISIONING = + T.let( + :THREE_DS_DECISIONING, + Lithic::ResponderEndpointCheckStatusParams::Type::TaggedSymbol + ) + TOKENIZATION_DECISIONING = + T.let( + :TOKENIZATION_DECISIONING, + Lithic::ResponderEndpointCheckStatusParams::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ResponderEndpointCheckStatusParams::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/responder_endpoint_create_params.rbi b/rbi/lithic/models/responder_endpoint_create_params.rbi new file mode 100644 index 00000000..ad06bd0d --- /dev/null +++ b/rbi/lithic/models/responder_endpoint_create_params.rbi @@ -0,0 +1,101 @@ +# typed: strong + +module Lithic + module Models + class ResponderEndpointCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::ResponderEndpointCreateParams, + Lithic::Internal::AnyHash + ) + end + + # The type of the endpoint. + sig do + returns( + T.nilable(Lithic::ResponderEndpointCreateParams::Type::OrSymbol) + ) + end + attr_reader :type + + sig do + params(type: Lithic::ResponderEndpointCreateParams::Type::OrSymbol).void + end + attr_writer :type + + # The URL for the responder endpoint (must be http(s)). + sig { returns(T.nilable(String)) } + attr_reader :url + + sig { params(url: String).void } + attr_writer :url + + sig do + params( + type: Lithic::ResponderEndpointCreateParams::Type::OrSymbol, + url: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The type of the endpoint. + type: nil, + # The URL for the responder endpoint (must be http(s)). + url: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + type: Lithic::ResponderEndpointCreateParams::Type::OrSymbol, + url: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # The type of the endpoint. + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ResponderEndpointCreateParams::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AUTH_STREAM_ACCESS = + T.let( + :AUTH_STREAM_ACCESS, + Lithic::ResponderEndpointCreateParams::Type::TaggedSymbol + ) + THREE_DS_DECISIONING = + T.let( + :THREE_DS_DECISIONING, + Lithic::ResponderEndpointCreateParams::Type::TaggedSymbol + ) + TOKENIZATION_DECISIONING = + T.let( + :TOKENIZATION_DECISIONING, + Lithic::ResponderEndpointCreateParams::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::ResponderEndpointCreateParams::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/responder_endpoint_create_response.rbi b/rbi/lithic/models/responder_endpoint_create_response.rbi new file mode 100644 index 00000000..8a8eaceb --- /dev/null +++ b/rbi/lithic/models/responder_endpoint_create_response.rbi @@ -0,0 +1,33 @@ +# typed: strong + +module Lithic + module Models + class ResponderEndpointCreateResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::ResponderEndpointCreateResponse, + Lithic::Internal::AnyHash + ) + end + + # True if the endpoint was enrolled successfully. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :enrolled + + sig { params(enrolled: T::Boolean).void } + attr_writer :enrolled + + sig { params(enrolled: T::Boolean).returns(T.attached_class) } + def self.new( + # True if the endpoint was enrolled successfully. + enrolled: nil + ) + end + + sig { override.returns({ enrolled: T::Boolean }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/responder_endpoint_delete_params.rbi b/rbi/lithic/models/responder_endpoint_delete_params.rbi new file mode 100644 index 00000000..8109fe67 --- /dev/null +++ b/rbi/lithic/models/responder_endpoint_delete_params.rbi @@ -0,0 +1,81 @@ +# typed: strong + +module Lithic + module Models + class ResponderEndpointDeleteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::ResponderEndpointDeleteParams, + Lithic::Internal::AnyHash + ) + end + + # The type of the endpoint. + sig { returns(Lithic::ResponderEndpointDeleteParams::Type::OrSymbol) } + attr_accessor :type + + sig do + params( + type: Lithic::ResponderEndpointDeleteParams::Type::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The type of the endpoint. + type:, + request_options: {} + ) + end + + sig do + override.returns( + { + type: Lithic::ResponderEndpointDeleteParams::Type::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # The type of the endpoint. + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ResponderEndpointDeleteParams::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AUTH_STREAM_ACCESS = + T.let( + :AUTH_STREAM_ACCESS, + Lithic::ResponderEndpointDeleteParams::Type::TaggedSymbol + ) + THREE_DS_DECISIONING = + T.let( + :THREE_DS_DECISIONING, + Lithic::ResponderEndpointDeleteParams::Type::TaggedSymbol + ) + TOKENIZATION_DECISIONING = + T.let( + :TOKENIZATION_DECISIONING, + Lithic::ResponderEndpointDeleteParams::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::ResponderEndpointDeleteParams::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/responder_endpoint_status.rbi b/rbi/lithic/models/responder_endpoint_status.rbi new file mode 100644 index 00000000..3f346ee2 --- /dev/null +++ b/rbi/lithic/models/responder_endpoint_status.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module Lithic + module Models + class ResponderEndpointStatus < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::ResponderEndpointStatus, Lithic::Internal::AnyHash) + end + + # True if the instance has an endpoint enrolled. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :enrolled + + sig { params(enrolled: T::Boolean).void } + attr_writer :enrolled + + # The URL of the currently enrolled endpoint or null. + sig { returns(T.nilable(String)) } + attr_accessor :url + + sig do + params(enrolled: T::Boolean, url: T.nilable(String)).returns( + T.attached_class + ) + end + def self.new( + # True if the instance has an endpoint enrolled. + enrolled: nil, + # The URL of the currently enrolled endpoint or null. + url: nil + ) + end + + sig { override.returns({ enrolled: T::Boolean, url: T.nilable(String) }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/settlement_detail.rbi b/rbi/lithic/models/settlement_detail.rbi new file mode 100644 index 00000000..787d8551 --- /dev/null +++ b/rbi/lithic/models/settlement_detail.rbi @@ -0,0 +1,324 @@ +# typed: strong + +module Lithic + module Models + class SettlementDetail < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::SettlementDetail, Lithic::Internal::AnyHash) + end + + # Globally unique identifier denoting the Settlement Detail. + sig { returns(String) } + attr_accessor :token + + # Globally unique identifier denoting the account that the associated transaction + # occurred on. + sig { returns(T.nilable(String)) } + attr_accessor :account_token + + # Globally unique identifier denoting the card program that the associated + # transaction occurred on. + sig { returns(T.nilable(String)) } + attr_accessor :card_program_token + + # Globally unique identifier denoting the card that the associated transaction + # occurred on. + sig { returns(T.nilable(String)) } + attr_accessor :card_token + + # Date and time when the transaction first occurred. UTC time zone. + sig { returns(Time) } + attr_accessor :created + + # Three-character alphabetic ISO 4217 code. + sig { returns(String) } + attr_accessor :currency + + # The total gross amount of disputes settlements. + sig { returns(Integer) } + attr_accessor :disputes_gross_amount + + # Array of globally unique identifiers for the financial events that comprise this + # settlement. Use these tokens to access detailed event-level information. + sig { returns(T::Array[String]) } + attr_accessor :event_tokens + + # The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE + # for Visa). + sig { returns(String) } + attr_accessor :institution + + # The total amount of interchange in six-digit extended precision. + sig { returns(Integer) } + attr_accessor :interchange_fee_extended_precision + + # The total amount of interchange. + sig { returns(Integer) } + attr_accessor :interchange_gross_amount + + # Card network where the transaction took place. + sig { returns(Lithic::SettlementDetail::Network::TaggedSymbol) } + attr_accessor :network + + # The total gross amount of other fees by type. + sig { returns(Lithic::SettlementDetail::OtherFeesDetails) } + attr_reader :other_fees_details + + sig do + params( + other_fees_details: Lithic::SettlementDetail::OtherFeesDetails::OrHash + ).void + end + attr_writer :other_fees_details + + # Total amount of gross other fees outside of interchange. + sig { returns(Integer) } + attr_accessor :other_fees_gross_amount + + # Date of when the report was first generated. + sig { returns(String) } + attr_accessor :report_date + + # Date of when money movement is triggered for the transaction. One exception + # applies - for Mastercard dual message settlement, this is the settlement + # advisement date, which is distinct from the date of money movement. + sig { returns(String) } + attr_accessor :settlement_date + + # Globally unique identifier denoting the associated transaction. For settlement + # records with type `CLEARING`, `FINANCIAL`, or `NON_FINANCIAL`, this references a + # card transaction token. For settlement records with type `CHARGEBACK`, + # `REPRESENTMENT`, `PREARBITRATION`, `ARBITRATION`, or `COLLABORATION`, this + # references the dispute transaction token. May be null for certain settlement + # types. + sig { returns(T.nilable(String)) } + attr_accessor :transaction_token + + # The total amount of settlement impacting transactions (excluding interchange, + # fees, and disputes). + sig { returns(Integer) } + attr_accessor :transactions_gross_amount + + # The type of settlement record. + sig { returns(Lithic::SettlementDetail::Type::TaggedSymbol) } + attr_accessor :type + + # Date and time when the transaction first occurred. UTC time zone. + sig { returns(Time) } + attr_accessor :updated + + # Network's description of a fee, only present on records with type `FEE`. + sig { returns(T.nilable(String)) } + attr_reader :fee_description + + sig { params(fee_description: String).void } + attr_writer :fee_description + + sig do + params( + token: String, + account_token: T.nilable(String), + card_program_token: T.nilable(String), + card_token: T.nilable(String), + created: Time, + currency: String, + disputes_gross_amount: Integer, + event_tokens: T::Array[String], + institution: String, + interchange_fee_extended_precision: Integer, + interchange_gross_amount: Integer, + network: Lithic::SettlementDetail::Network::OrSymbol, + other_fees_details: + Lithic::SettlementDetail::OtherFeesDetails::OrHash, + other_fees_gross_amount: Integer, + report_date: String, + settlement_date: String, + transaction_token: T.nilable(String), + transactions_gross_amount: Integer, + type: Lithic::SettlementDetail::Type::OrSymbol, + updated: Time, + fee_description: String + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier denoting the Settlement Detail. + token:, + # Globally unique identifier denoting the account that the associated transaction + # occurred on. + account_token:, + # Globally unique identifier denoting the card program that the associated + # transaction occurred on. + card_program_token:, + # Globally unique identifier denoting the card that the associated transaction + # occurred on. + card_token:, + # Date and time when the transaction first occurred. UTC time zone. + created:, + # Three-character alphabetic ISO 4217 code. + currency:, + # The total gross amount of disputes settlements. + disputes_gross_amount:, + # Array of globally unique identifiers for the financial events that comprise this + # settlement. Use these tokens to access detailed event-level information. + event_tokens:, + # The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE + # for Visa). + institution:, + # The total amount of interchange in six-digit extended precision. + interchange_fee_extended_precision:, + # The total amount of interchange. + interchange_gross_amount:, + # Card network where the transaction took place. + network:, + # The total gross amount of other fees by type. + other_fees_details:, + # Total amount of gross other fees outside of interchange. + other_fees_gross_amount:, + # Date of when the report was first generated. + report_date:, + # Date of when money movement is triggered for the transaction. One exception + # applies - for Mastercard dual message settlement, this is the settlement + # advisement date, which is distinct from the date of money movement. + settlement_date:, + # Globally unique identifier denoting the associated transaction. For settlement + # records with type `CLEARING`, `FINANCIAL`, or `NON_FINANCIAL`, this references a + # card transaction token. For settlement records with type `CHARGEBACK`, + # `REPRESENTMENT`, `PREARBITRATION`, `ARBITRATION`, or `COLLABORATION`, this + # references the dispute transaction token. May be null for certain settlement + # types. + transaction_token:, + # The total amount of settlement impacting transactions (excluding interchange, + # fees, and disputes). + transactions_gross_amount:, + # The type of settlement record. + type:, + # Date and time when the transaction first occurred. UTC time zone. + updated:, + # Network's description of a fee, only present on records with type `FEE`. + fee_description: nil + ) + end + + sig do + override.returns( + { + token: String, + account_token: T.nilable(String), + card_program_token: T.nilable(String), + card_token: T.nilable(String), + created: Time, + currency: String, + disputes_gross_amount: Integer, + event_tokens: T::Array[String], + institution: String, + interchange_fee_extended_precision: Integer, + interchange_gross_amount: Integer, + network: Lithic::SettlementDetail::Network::TaggedSymbol, + other_fees_details: Lithic::SettlementDetail::OtherFeesDetails, + other_fees_gross_amount: Integer, + report_date: String, + settlement_date: String, + transaction_token: T.nilable(String), + transactions_gross_amount: Integer, + type: Lithic::SettlementDetail::Type::TaggedSymbol, + updated: Time, + fee_description: String + } + ) + end + def to_hash + end + + # Card network where the transaction took place. + module Network + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::SettlementDetail::Network) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AMEX = T.let(:AMEX, Lithic::SettlementDetail::Network::TaggedSymbol) + INTERLINK = + T.let(:INTERLINK, Lithic::SettlementDetail::Network::TaggedSymbol) + MAESTRO = + T.let(:MAESTRO, Lithic::SettlementDetail::Network::TaggedSymbol) + MASTERCARD = + T.let(:MASTERCARD, Lithic::SettlementDetail::Network::TaggedSymbol) + UNKNOWN = + T.let(:UNKNOWN, Lithic::SettlementDetail::Network::TaggedSymbol) + VISA = T.let(:VISA, Lithic::SettlementDetail::Network::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::SettlementDetail::Network::TaggedSymbol] + ) + end + def self.values + end + end + + class OtherFeesDetails < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::SettlementDetail::OtherFeesDetails, + Lithic::Internal::AnyHash + ) + end + + sig { returns(T.nilable(Integer)) } + attr_reader :isa + + sig { params(isa: Integer).void } + attr_writer :isa + + # The total gross amount of other fees by type. + sig { params(isa: Integer).returns(T.attached_class) } + def self.new(isa: nil) + end + + sig { override.returns({ isa: Integer }) } + def to_hash + end + end + + # The type of settlement record. + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::SettlementDetail::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ADJUSTMENT = + T.let(:ADJUSTMENT, Lithic::SettlementDetail::Type::TaggedSymbol) + ARBITRATION = + T.let(:ARBITRATION, Lithic::SettlementDetail::Type::TaggedSymbol) + CHARGEBACK = + T.let(:CHARGEBACK, Lithic::SettlementDetail::Type::TaggedSymbol) + CLEARING = + T.let(:CLEARING, Lithic::SettlementDetail::Type::TaggedSymbol) + COLLABORATION = + T.let(:COLLABORATION, Lithic::SettlementDetail::Type::TaggedSymbol) + FEE = T.let(:FEE, Lithic::SettlementDetail::Type::TaggedSymbol) + FINANCIAL = + T.let(:FINANCIAL, Lithic::SettlementDetail::Type::TaggedSymbol) + NON_FINANCIAL = + T.let(:NON_FINANCIAL, Lithic::SettlementDetail::Type::TaggedSymbol) + PREARBITRATION = + T.let(:PREARBITRATION, Lithic::SettlementDetail::Type::TaggedSymbol) + REPRESENTMENT = + T.let(:REPRESENTMENT, Lithic::SettlementDetail::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::SettlementDetail::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/settlement_report.rbi b/rbi/lithic/models/settlement_report.rbi new file mode 100644 index 00000000..1407b98f --- /dev/null +++ b/rbi/lithic/models/settlement_report.rbi @@ -0,0 +1,145 @@ +# typed: strong + +module Lithic + module Models + class SettlementReport < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::SettlementReport, Lithic::Internal::AnyHash) + end + + # Date and time when the transaction first occurred. UTC time zone. + sig { returns(Time) } + attr_accessor :created + + # 3-character alphabetic ISO 4217 code. (This field is deprecated and will be + # removed in a future version of the API.) + sig { returns(String) } + attr_accessor :currency + + sig { returns(T::Array[Lithic::SettlementSummaryDetails]) } + attr_accessor :details + + # The total gross amount of disputes settlements. (This field is deprecated and + # will be removed in a future version of the API. To compute total amounts, Lithic + # recommends that customers sum the relevant settlement amounts found within + # `details`.) + sig { returns(Integer) } + attr_accessor :disputes_gross_amount + + # The total amount of interchange. (This field is deprecated and will be removed + # in a future version of the API. To compute total amounts, Lithic recommends that + # customers sum the relevant settlement amounts found within `details`.) + sig { returns(Integer) } + attr_accessor :interchange_gross_amount + + # Indicates that all data expected on the given report date is available. + sig { returns(T::Boolean) } + attr_accessor :is_complete + + # Total amount of gross other fees outside of interchange. (This field is + # deprecated and will be removed in a future version of the API. To compute total + # amounts, Lithic recommends that customers sum the relevant settlement amounts + # found within `details`.) + sig { returns(Integer) } + attr_accessor :other_fees_gross_amount + + # Date of when the report was first generated. + sig { returns(String) } + attr_accessor :report_date + + # The total net amount of cash moved. (net value of settled_gross_amount, + # interchange, fees). (This field is deprecated and will be removed in a future + # version of the API. To compute total amounts, Lithic recommends that customers + # sum the relevant settlement amounts found within `details`.) + sig { returns(Integer) } + attr_accessor :settled_net_amount + + # The total amount of settlement impacting transactions (excluding interchange, + # fees, and disputes). (This field is deprecated and will be removed in a future + # version of the API. To compute total amounts, Lithic recommends that customers + # sum the relevant settlement amounts found within `details`.) + sig { returns(Integer) } + attr_accessor :transactions_gross_amount + + # Date and time when the transaction first occurred. UTC time zone. + sig { returns(Time) } + attr_accessor :updated + + sig do + params( + created: Time, + currency: String, + details: T::Array[Lithic::SettlementSummaryDetails::OrHash], + disputes_gross_amount: Integer, + interchange_gross_amount: Integer, + is_complete: T::Boolean, + other_fees_gross_amount: Integer, + report_date: String, + settled_net_amount: Integer, + transactions_gross_amount: Integer, + updated: Time + ).returns(T.attached_class) + end + def self.new( + # Date and time when the transaction first occurred. UTC time zone. + created:, + # 3-character alphabetic ISO 4217 code. (This field is deprecated and will be + # removed in a future version of the API.) + currency:, + details:, + # The total gross amount of disputes settlements. (This field is deprecated and + # will be removed in a future version of the API. To compute total amounts, Lithic + # recommends that customers sum the relevant settlement amounts found within + # `details`.) + disputes_gross_amount:, + # The total amount of interchange. (This field is deprecated and will be removed + # in a future version of the API. To compute total amounts, Lithic recommends that + # customers sum the relevant settlement amounts found within `details`.) + interchange_gross_amount:, + # Indicates that all data expected on the given report date is available. + is_complete:, + # Total amount of gross other fees outside of interchange. (This field is + # deprecated and will be removed in a future version of the API. To compute total + # amounts, Lithic recommends that customers sum the relevant settlement amounts + # found within `details`.) + other_fees_gross_amount:, + # Date of when the report was first generated. + report_date:, + # The total net amount of cash moved. (net value of settled_gross_amount, + # interchange, fees). (This field is deprecated and will be removed in a future + # version of the API. To compute total amounts, Lithic recommends that customers + # sum the relevant settlement amounts found within `details`.) + settled_net_amount:, + # The total amount of settlement impacting transactions (excluding interchange, + # fees, and disputes). (This field is deprecated and will be removed in a future + # version of the API. To compute total amounts, Lithic recommends that customers + # sum the relevant settlement amounts found within `details`.) + transactions_gross_amount:, + # Date and time when the transaction first occurred. UTC time zone. + updated: + ) + end + + sig do + override.returns( + { + created: Time, + currency: String, + details: T::Array[Lithic::SettlementSummaryDetails], + disputes_gross_amount: Integer, + interchange_gross_amount: Integer, + is_complete: T::Boolean, + other_fees_gross_amount: Integer, + report_date: String, + settled_net_amount: Integer, + transactions_gross_amount: Integer, + updated: Time + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/settlement_report_updated_webhook_event.rbi b/rbi/lithic/models/settlement_report_updated_webhook_event.rbi new file mode 100644 index 00000000..53aae0ad --- /dev/null +++ b/rbi/lithic/models/settlement_report_updated_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class SettlementReportUpdatedWebhookEvent < Lithic::Models::SettlementReport + OrHash = + T.type_alias do + T.any( + Lithic::SettlementReportUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"settlement_report.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/settlement_summary_details.rbi b/rbi/lithic/models/settlement_summary_details.rbi new file mode 100644 index 00000000..dddcef17 --- /dev/null +++ b/rbi/lithic/models/settlement_summary_details.rbi @@ -0,0 +1,175 @@ +# typed: strong + +module Lithic + module Models + class SettlementSummaryDetails < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::SettlementSummaryDetails, Lithic::Internal::AnyHash) + end + + # 3-character alphabetic ISO 4217 code. + sig { returns(T.nilable(String)) } + attr_reader :currency + + sig { params(currency: String).void } + attr_writer :currency + + # The total gross amount of disputes settlements. + sig { returns(T.nilable(Integer)) } + attr_reader :disputes_gross_amount + + sig { params(disputes_gross_amount: Integer).void } + attr_writer :disputes_gross_amount + + # The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE + # for Visa). + sig { returns(T.nilable(String)) } + attr_reader :institution + + sig { params(institution: String).void } + attr_writer :institution + + # The total amount of interchange. + sig { returns(T.nilable(Integer)) } + attr_reader :interchange_gross_amount + + sig { params(interchange_gross_amount: Integer).void } + attr_writer :interchange_gross_amount + + # Card network where the transaction took place + sig do + returns( + T.nilable(Lithic::SettlementSummaryDetails::Network::TaggedSymbol) + ) + end + attr_reader :network + + sig do + params( + network: Lithic::SettlementSummaryDetails::Network::OrSymbol + ).void + end + attr_writer :network + + # Total amount of gross other fees outside of interchange. + sig { returns(T.nilable(Integer)) } + attr_reader :other_fees_gross_amount + + sig { params(other_fees_gross_amount: Integer).void } + attr_writer :other_fees_gross_amount + + # The total net amount of cash moved. (net value of settled_gross_amount, + # interchange, fees). + sig { returns(T.nilable(Integer)) } + attr_reader :settled_net_amount + + sig { params(settled_net_amount: Integer).void } + attr_writer :settled_net_amount + + # The total amount of settlement impacting transactions (excluding interchange, + # fees, and disputes). + sig { returns(T.nilable(Integer)) } + attr_reader :transactions_gross_amount + + sig { params(transactions_gross_amount: Integer).void } + attr_writer :transactions_gross_amount + + sig do + params( + currency: String, + disputes_gross_amount: Integer, + institution: String, + interchange_gross_amount: Integer, + network: Lithic::SettlementSummaryDetails::Network::OrSymbol, + other_fees_gross_amount: Integer, + settled_net_amount: Integer, + transactions_gross_amount: Integer + ).returns(T.attached_class) + end + def self.new( + # 3-character alphabetic ISO 4217 code. + currency: nil, + # The total gross amount of disputes settlements. + disputes_gross_amount: nil, + # The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE + # for Visa). + institution: nil, + # The total amount of interchange. + interchange_gross_amount: nil, + # Card network where the transaction took place + network: nil, + # Total amount of gross other fees outside of interchange. + other_fees_gross_amount: nil, + # The total net amount of cash moved. (net value of settled_gross_amount, + # interchange, fees). + settled_net_amount: nil, + # The total amount of settlement impacting transactions (excluding interchange, + # fees, and disputes). + transactions_gross_amount: nil + ) + end + + sig do + override.returns( + { + currency: String, + disputes_gross_amount: Integer, + institution: String, + interchange_gross_amount: Integer, + network: Lithic::SettlementSummaryDetails::Network::TaggedSymbol, + other_fees_gross_amount: Integer, + settled_net_amount: Integer, + transactions_gross_amount: Integer + } + ) + end + def to_hash + end + + # Card network where the transaction took place + module Network + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::SettlementSummaryDetails::Network) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AMEX = + T.let(:AMEX, Lithic::SettlementSummaryDetails::Network::TaggedSymbol) + INTERLINK = + T.let( + :INTERLINK, + Lithic::SettlementSummaryDetails::Network::TaggedSymbol + ) + MAESTRO = + T.let( + :MAESTRO, + Lithic::SettlementSummaryDetails::Network::TaggedSymbol + ) + MASTERCARD = + T.let( + :MASTERCARD, + Lithic::SettlementSummaryDetails::Network::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::SettlementSummaryDetails::Network::TaggedSymbol + ) + VISA = + T.let(:VISA, Lithic::SettlementSummaryDetails::Network::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::SettlementSummaryDetails::Network::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/shipping_address.rbi b/rbi/lithic/models/shipping_address.rbi new file mode 100644 index 00000000..b6b4da5f --- /dev/null +++ b/rbi/lithic/models/shipping_address.rbi @@ -0,0 +1,147 @@ +# typed: strong + +module Lithic + module Models + class ShippingAddress < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::ShippingAddress, Lithic::Internal::AnyHash) + end + + # Valid USPS routable address. + sig { returns(String) } + attr_accessor :address1 + + # City + sig { returns(String) } + attr_accessor :city + + # Uppercase ISO 3166-1 alpha-3 three character abbreviation. + sig { returns(String) } + attr_accessor :country + + # Customer's first name. This will be the first name printed on the physical card. + # The combined length of `first_name` and `last_name` may not exceed 25 + # characters. + sig { returns(String) } + attr_accessor :first_name + + # Customer's surname (family name). This will be the last name printed on the + # physical card. The combined length of `first_name` and `last_name` may not + # exceed 25 characters. + sig { returns(String) } + attr_accessor :last_name + + # Postal code (formerly zipcode). For US addresses, either five-digit postal code + # or nine-digit postal code (ZIP+4) using the format 12345-1234. + sig { returns(String) } + attr_accessor :postal_code + + # Uppercase ISO 3166-2 two character abbreviation for US and CA. Optional with a + # limit of 24 characters for other countries. + sig { returns(String) } + attr_accessor :state + + # Unit number (if applicable). + sig { returns(T.nilable(String)) } + attr_reader :address2 + + sig { params(address2: String).void } + attr_writer :address2 + + # Email address to be contacted for expedited shipping process purposes. Required + # if `shipping_method` is `EXPEDITED`. + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # Text to be printed on line two of the physical card. Use of this field requires + # additional permissions. + sig { returns(T.nilable(String)) } + attr_reader :line2_text + + sig { params(line2_text: String).void } + attr_writer :line2_text + + # Cardholder's phone number in E.164 format to be contacted for expedited shipping + # process purposes. Required if `shipping_method` is `EXPEDITED`. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + sig { params(phone_number: String).void } + attr_writer :phone_number + + sig do + params( + address1: String, + city: String, + country: String, + first_name: String, + last_name: String, + postal_code: String, + state: String, + address2: String, + email: String, + line2_text: String, + phone_number: String + ).returns(T.attached_class) + end + def self.new( + # Valid USPS routable address. + address1:, + # City + city:, + # Uppercase ISO 3166-1 alpha-3 three character abbreviation. + country:, + # Customer's first name. This will be the first name printed on the physical card. + # The combined length of `first_name` and `last_name` may not exceed 25 + # characters. + first_name:, + # Customer's surname (family name). This will be the last name printed on the + # physical card. The combined length of `first_name` and `last_name` may not + # exceed 25 characters. + last_name:, + # Postal code (formerly zipcode). For US addresses, either five-digit postal code + # or nine-digit postal code (ZIP+4) using the format 12345-1234. + postal_code:, + # Uppercase ISO 3166-2 two character abbreviation for US and CA. Optional with a + # limit of 24 characters for other countries. + state:, + # Unit number (if applicable). + address2: nil, + # Email address to be contacted for expedited shipping process purposes. Required + # if `shipping_method` is `EXPEDITED`. + email: nil, + # Text to be printed on line two of the physical card. Use of this field requires + # additional permissions. + line2_text: nil, + # Cardholder's phone number in E.164 format to be contacted for expedited shipping + # process purposes. Required if `shipping_method` is `EXPEDITED`. + phone_number: nil + ) + end + + sig do + override.returns( + { + address1: String, + city: String, + country: String, + first_name: String, + last_name: String, + postal_code: String, + state: String, + address2: String, + email: String, + line2_text: String, + phone_number: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/signals_response.rbi b/rbi/lithic/models/signals_response.rbi new file mode 100644 index 00000000..9c2caae6 --- /dev/null +++ b/rbi/lithic/models/signals_response.rbi @@ -0,0 +1,352 @@ +# typed: strong + +module Lithic + module Models + class SignalsResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::SignalsResponse, Lithic::Internal::AnyHash) + end + + # The Welford M2 accumulator for lifetime approved transaction amounts. Used + # together with `avg_transaction_amount` and `approved_txn_count` to compute the + # z-score of a new transaction amount (variance = M2 / (count - 1)). + sig { returns(T.nilable(Float)) } + attr_accessor :approved_txn_amount_m2 + + # The Welford M2 accumulator for approved transaction amounts over the last 30 + # days. + sig { returns(T.nilable(Float)) } + attr_accessor :approved_txn_amount_m2_30d + + # The Welford M2 accumulator for approved transaction amounts over the last 7 + # days. + sig { returns(T.nilable(Float)) } + attr_accessor :approved_txn_amount_m2_7d + + # The Welford M2 accumulator for approved transaction amounts over the last 90 + # days. + sig { returns(T.nilable(Float)) } + attr_accessor :approved_txn_amount_m2_90d + + # The total number of approved transactions over the entity's lifetime. + sig { returns(T.nilable(Integer)) } + attr_accessor :approved_txn_count + + # The number of approved transactions in the last 30 days. + sig { returns(T.nilable(Integer)) } + attr_accessor :approved_txn_count_30d + + # The number of approved transactions in the last 7 days. + sig { returns(T.nilable(Integer)) } + attr_accessor :approved_txn_count_7d + + # The number of approved transactions in the last 90 days. + sig { returns(T.nilable(Integer)) } + attr_accessor :approved_txn_count_90d + + # The average approved transaction amount over the entity's lifetime, in cents. + # Null if fewer than 5 approved transactions have been recorded. + sig { returns(T.nilable(Float)) } + attr_accessor :avg_transaction_amount + + # The average approved transaction amount over the last 30 days, in cents. Null if + # fewer than 5 approved transactions in window. + sig { returns(T.nilable(Float)) } + attr_accessor :avg_transaction_amount_30d + + # The average approved transaction amount over the last 7 days, in cents. Null if + # fewer than 5 approved transactions in window. + sig { returns(T.nilable(Float)) } + attr_accessor :avg_transaction_amount_7d + + # The average approved transaction amount over the last 90 days, in cents. Null if + # fewer than 5 approved transactions in window. + sig { returns(T.nilable(Float)) } + attr_accessor :avg_transaction_amount_90d + + # The number of distinct merchant countries seen in the entity's transaction + # history. + sig { returns(T.nilable(Integer)) } + attr_accessor :distinct_country_count + + # The number of distinct MCCs seen in the entity's transaction history. + sig { returns(T.nilable(Integer)) } + attr_accessor :distinct_mcc_count + + # The timestamp of the first approved transaction for the entity, in ISO 8601 + # format. + sig { returns(T.nilable(Time)) } + attr_accessor :first_txn_at + + # Whether the entity has no prior transaction history. Returns true if no history + # is found. Null if transaction history exists but a first transaction timestamp + # is unavailable. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :is_first_transaction + + # The merchant country of the last card-present transaction. + sig { returns(T.nilable(String)) } + attr_accessor :last_cp_country + + # The merchant postal code of the last card-present transaction. + sig { returns(T.nilable(String)) } + attr_accessor :last_cp_postal_code + + # The timestamp of the last card-present transaction, in ISO 8601 format. + sig { returns(T.nilable(Time)) } + attr_accessor :last_cp_timestamp + + # The timestamp of the most recent approved transaction for the entity, in ISO + # 8601 format. + sig { returns(T.nilable(Time)) } + attr_accessor :last_txn_approved_at + + # The set of merchant countries seen in the entity's transaction history. Clients + # can use this to determine whether a new transaction's country is novel (i.e. + # compute `is_new_country`). + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :seen_countries + + # The set of MCCs seen in the entity's transaction history. Clients can use this + # to determine whether a new transaction's MCC is novel (i.e. compute + # `is_new_mcc`). + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :seen_mccs + + # The set of card acceptor IDs seen in the card's approved transaction history, + # capped at the 1000 most recently seen. Null for account responses. Clients can + # use this to determine whether a new transaction's merchant is novel (i.e. + # compute `is_new_merchant`). + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :seen_merchants + + # The standard deviation of approved transaction amounts over the entity's + # lifetime, in cents. Null if fewer than 30 approved transactions have been + # recorded. + sig { returns(T.nilable(Float)) } + attr_accessor :stdev_transaction_amount + + # The standard deviation of approved transaction amounts over the last 30 days, in + # cents. Null if fewer than 30 approved transactions in window. + sig { returns(T.nilable(Float)) } + attr_accessor :stdev_transaction_amount_30d + + # The standard deviation of approved transaction amounts over the last 7 days, in + # cents. Null if fewer than 30 approved transactions in window. + sig { returns(T.nilable(Float)) } + attr_accessor :stdev_transaction_amount_7d + + # The standard deviation of approved transaction amounts over the last 90 days, in + # cents. Null if fewer than 30 approved transactions in window. + sig { returns(T.nilable(Float)) } + attr_accessor :stdev_transaction_amount_90d + + # The number of successful 3DS authentications for the card. Null for account + # responses. + sig { returns(T.nilable(Integer)) } + attr_accessor :three_ds_success_count + + # The 3DS authentication success rate for the card, as a percentage from 0.0 to + # 100.0. Null for account responses. + sig { returns(T.nilable(Float)) } + attr_accessor :three_ds_success_rate + + # The total number of 3DS authentication attempts for the card. Null for account + # responses. + sig { returns(T.nilable(Integer)) } + attr_accessor :three_ds_total_count + + # The number of days since the last approved transaction on the entity. + sig { returns(T.nilable(Float)) } + attr_accessor :time_since_last_transaction_days + + # Behavioral feature state for a card or account derived from its transaction + # history. + # + # Derived statistical features (averages, standard deviations, z-scores) are + # computed using Welford's online algorithm over approved transactions. Average + # fields are null when fewer than 5 approved transactions have been recorded. + # Standard deviation fields are null when fewer than 30 approved transactions have + # been recorded. + # + # 3DS fields (`three_ds_success_rate`, `three_ds_success_count`, + # `three_ds_total_count`) are card-scoped and will be null for account responses. + # + # Raw fields (`seen_countries`, `seen_mccs`, `approved_txn_amount_m2`, etc.) are + # included so clients can compute their own transaction-specific derivations, such + # as checking whether a new transaction's country is in `seen_countries` to + # determine `is_new_country`, or computing a z-score using the raw mean and M2 + # values. + sig do + params( + approved_txn_amount_m2: T.nilable(Float), + approved_txn_amount_m2_30d: T.nilable(Float), + approved_txn_amount_m2_7d: T.nilable(Float), + approved_txn_amount_m2_90d: T.nilable(Float), + approved_txn_count: T.nilable(Integer), + approved_txn_count_30d: T.nilable(Integer), + approved_txn_count_7d: T.nilable(Integer), + approved_txn_count_90d: T.nilable(Integer), + avg_transaction_amount: T.nilable(Float), + avg_transaction_amount_30d: T.nilable(Float), + avg_transaction_amount_7d: T.nilable(Float), + avg_transaction_amount_90d: T.nilable(Float), + distinct_country_count: T.nilable(Integer), + distinct_mcc_count: T.nilable(Integer), + first_txn_at: T.nilable(Time), + is_first_transaction: T.nilable(T::Boolean), + last_cp_country: T.nilable(String), + last_cp_postal_code: T.nilable(String), + last_cp_timestamp: T.nilable(Time), + last_txn_approved_at: T.nilable(Time), + seen_countries: T.nilable(T::Array[String]), + seen_mccs: T.nilable(T::Array[String]), + seen_merchants: T.nilable(T::Array[String]), + stdev_transaction_amount: T.nilable(Float), + stdev_transaction_amount_30d: T.nilable(Float), + stdev_transaction_amount_7d: T.nilable(Float), + stdev_transaction_amount_90d: T.nilable(Float), + three_ds_success_count: T.nilable(Integer), + three_ds_success_rate: T.nilable(Float), + three_ds_total_count: T.nilable(Integer), + time_since_last_transaction_days: T.nilable(Float) + ).returns(T.attached_class) + end + def self.new( + # The Welford M2 accumulator for lifetime approved transaction amounts. Used + # together with `avg_transaction_amount` and `approved_txn_count` to compute the + # z-score of a new transaction amount (variance = M2 / (count - 1)). + approved_txn_amount_m2:, + # The Welford M2 accumulator for approved transaction amounts over the last 30 + # days. + approved_txn_amount_m2_30d:, + # The Welford M2 accumulator for approved transaction amounts over the last 7 + # days. + approved_txn_amount_m2_7d:, + # The Welford M2 accumulator for approved transaction amounts over the last 90 + # days. + approved_txn_amount_m2_90d:, + # The total number of approved transactions over the entity's lifetime. + approved_txn_count:, + # The number of approved transactions in the last 30 days. + approved_txn_count_30d:, + # The number of approved transactions in the last 7 days. + approved_txn_count_7d:, + # The number of approved transactions in the last 90 days. + approved_txn_count_90d:, + # The average approved transaction amount over the entity's lifetime, in cents. + # Null if fewer than 5 approved transactions have been recorded. + avg_transaction_amount:, + # The average approved transaction amount over the last 30 days, in cents. Null if + # fewer than 5 approved transactions in window. + avg_transaction_amount_30d:, + # The average approved transaction amount over the last 7 days, in cents. Null if + # fewer than 5 approved transactions in window. + avg_transaction_amount_7d:, + # The average approved transaction amount over the last 90 days, in cents. Null if + # fewer than 5 approved transactions in window. + avg_transaction_amount_90d:, + # The number of distinct merchant countries seen in the entity's transaction + # history. + distinct_country_count:, + # The number of distinct MCCs seen in the entity's transaction history. + distinct_mcc_count:, + # The timestamp of the first approved transaction for the entity, in ISO 8601 + # format. + first_txn_at:, + # Whether the entity has no prior transaction history. Returns true if no history + # is found. Null if transaction history exists but a first transaction timestamp + # is unavailable. + is_first_transaction:, + # The merchant country of the last card-present transaction. + last_cp_country:, + # The merchant postal code of the last card-present transaction. + last_cp_postal_code:, + # The timestamp of the last card-present transaction, in ISO 8601 format. + last_cp_timestamp:, + # The timestamp of the most recent approved transaction for the entity, in ISO + # 8601 format. + last_txn_approved_at:, + # The set of merchant countries seen in the entity's transaction history. Clients + # can use this to determine whether a new transaction's country is novel (i.e. + # compute `is_new_country`). + seen_countries:, + # The set of MCCs seen in the entity's transaction history. Clients can use this + # to determine whether a new transaction's MCC is novel (i.e. compute + # `is_new_mcc`). + seen_mccs:, + # The set of card acceptor IDs seen in the card's approved transaction history, + # capped at the 1000 most recently seen. Null for account responses. Clients can + # use this to determine whether a new transaction's merchant is novel (i.e. + # compute `is_new_merchant`). + seen_merchants:, + # The standard deviation of approved transaction amounts over the entity's + # lifetime, in cents. Null if fewer than 30 approved transactions have been + # recorded. + stdev_transaction_amount:, + # The standard deviation of approved transaction amounts over the last 30 days, in + # cents. Null if fewer than 30 approved transactions in window. + stdev_transaction_amount_30d:, + # The standard deviation of approved transaction amounts over the last 7 days, in + # cents. Null if fewer than 30 approved transactions in window. + stdev_transaction_amount_7d:, + # The standard deviation of approved transaction amounts over the last 90 days, in + # cents. Null if fewer than 30 approved transactions in window. + stdev_transaction_amount_90d:, + # The number of successful 3DS authentications for the card. Null for account + # responses. + three_ds_success_count:, + # The 3DS authentication success rate for the card, as a percentage from 0.0 to + # 100.0. Null for account responses. + three_ds_success_rate:, + # The total number of 3DS authentication attempts for the card. Null for account + # responses. + three_ds_total_count:, + # The number of days since the last approved transaction on the entity. + time_since_last_transaction_days: + ) + end + + sig do + override.returns( + { + approved_txn_amount_m2: T.nilable(Float), + approved_txn_amount_m2_30d: T.nilable(Float), + approved_txn_amount_m2_7d: T.nilable(Float), + approved_txn_amount_m2_90d: T.nilable(Float), + approved_txn_count: T.nilable(Integer), + approved_txn_count_30d: T.nilable(Integer), + approved_txn_count_7d: T.nilable(Integer), + approved_txn_count_90d: T.nilable(Integer), + avg_transaction_amount: T.nilable(Float), + avg_transaction_amount_30d: T.nilable(Float), + avg_transaction_amount_7d: T.nilable(Float), + avg_transaction_amount_90d: T.nilable(Float), + distinct_country_count: T.nilable(Integer), + distinct_mcc_count: T.nilable(Integer), + first_txn_at: T.nilable(Time), + is_first_transaction: T.nilable(T::Boolean), + last_cp_country: T.nilable(String), + last_cp_postal_code: T.nilable(String), + last_cp_timestamp: T.nilable(Time), + last_txn_approved_at: T.nilable(Time), + seen_countries: T.nilable(T::Array[String]), + seen_mccs: T.nilable(T::Array[String]), + seen_merchants: T.nilable(T::Array[String]), + stdev_transaction_amount: T.nilable(Float), + stdev_transaction_amount_30d: T.nilable(Float), + stdev_transaction_amount_7d: T.nilable(Float), + stdev_transaction_amount_90d: T.nilable(Float), + three_ds_success_count: T.nilable(Integer), + three_ds_success_rate: T.nilable(Float), + three_ds_total_count: T.nilable(Integer), + time_since_last_transaction_days: T.nilable(Float) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/spend_limit_duration.rbi b/rbi/lithic/models/spend_limit_duration.rbi new file mode 100644 index 00000000..4bf3568f --- /dev/null +++ b/rbi/lithic/models/spend_limit_duration.rbi @@ -0,0 +1,36 @@ +# typed: strong + +module Lithic + module Models + # Spend limit duration values: + # + # - `ANNUALLY` - Card will authorize transactions up to spend limit for the + # trailing year. + # - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime + # of the card. + # - `MONTHLY` - Card will authorize transactions up to spend limit for the + # trailing month. To support recurring monthly payments, which can occur on + # different day every month, the time window we consider for monthly velocity + # starts 6 days after the current calendar date one month prior. + # - `TRANSACTION` - Card will authorize multiple transactions if each individual + # transaction is under the spend limit. + module SpendLimitDuration + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::SpendLimitDuration) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ANNUALLY = T.let(:ANNUALLY, Lithic::SpendLimitDuration::TaggedSymbol) + FOREVER = T.let(:FOREVER, Lithic::SpendLimitDuration::TaggedSymbol) + MONTHLY = T.let(:MONTHLY, Lithic::SpendLimitDuration::TaggedSymbol) + TRANSACTION = + T.let(:TRANSACTION, Lithic::SpendLimitDuration::TaggedSymbol) + + sig do + override.returns(T::Array[Lithic::SpendLimitDuration::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/lithic/models/statement_totals.rbi b/rbi/lithic/models/statement_totals.rbi new file mode 100644 index 00000000..f722e0cc --- /dev/null +++ b/rbi/lithic/models/statement_totals.rbi @@ -0,0 +1,119 @@ +# typed: strong + +module Lithic + module Models + class StatementTotals < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::StatementTotals, Lithic::Internal::AnyHash) + end + + # Opening balance transferred from previous account in cents + sig { returns(Integer) } + attr_accessor :balance_transfers + + # ATM and cashback transactions in cents + sig { returns(Integer) } + attr_accessor :cash_advances + + # Volume of credit management operation transactions less any balance transfers in + # cents + sig { returns(Integer) } + attr_accessor :credits + + # Volume of debit management operation transactions less any interest in cents + sig { returns(Integer) } + attr_accessor :debits + + # Volume of debit management operation transactions less any interest in cents + sig { returns(Integer) } + attr_accessor :fees + + # Interest accrued in cents + sig { returns(Integer) } + attr_accessor :interest + + # Any funds transfers which affective the balance in cents + sig { returns(Integer) } + attr_accessor :payments + + # Net card transaction volume less any cash advances in cents + sig { returns(Integer) } + attr_accessor :purchases + + # Breakdown of credits + sig { returns(T.nilable(T.anything)) } + attr_accessor :credit_details + + # Breakdown of debits + sig { returns(T.nilable(T.anything)) } + attr_accessor :debit_details + + # Breakdown of payments + sig { returns(T.nilable(T.anything)) } + attr_accessor :payment_details + + sig do + params( + balance_transfers: Integer, + cash_advances: Integer, + credits: Integer, + debits: Integer, + fees: Integer, + interest: Integer, + payments: Integer, + purchases: Integer, + credit_details: T.nilable(T.anything), + debit_details: T.nilable(T.anything), + payment_details: T.nilable(T.anything) + ).returns(T.attached_class) + end + def self.new( + # Opening balance transferred from previous account in cents + balance_transfers:, + # ATM and cashback transactions in cents + cash_advances:, + # Volume of credit management operation transactions less any balance transfers in + # cents + credits:, + # Volume of debit management operation transactions less any interest in cents + debits:, + # Volume of debit management operation transactions less any interest in cents + fees:, + # Interest accrued in cents + interest:, + # Any funds transfers which affective the balance in cents + payments:, + # Net card transaction volume less any cash advances in cents + purchases:, + # Breakdown of credits + credit_details: nil, + # Breakdown of debits + debit_details: nil, + # Breakdown of payments + payment_details: nil + ) + end + + sig do + override.returns( + { + balance_transfers: Integer, + cash_advances: Integer, + credits: Integer, + debits: Integer, + fees: Integer, + interest: Integer, + payments: Integer, + purchases: Integer, + credit_details: T.nilable(T.anything), + debit_details: T.nilable(T.anything), + payment_details: T.nilable(T.anything) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/statements_created_webhook_event.rbi b/rbi/lithic/models/statements_created_webhook_event.rbi new file mode 100644 index 00000000..195bdbb1 --- /dev/null +++ b/rbi/lithic/models/statements_created_webhook_event.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class StatementsCreatedWebhookEvent < Lithic::Models::FinancialAccounts::Statement + OrHash = + T.type_alias do + T.any( + Lithic::StatementsCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"statements.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/three_ds/authentication_retrieve_params.rbi b/rbi/lithic/models/three_ds/authentication_retrieve_params.rbi new file mode 100644 index 00000000..70e010ff --- /dev/null +++ b/rbi/lithic/models/three_ds/authentication_retrieve_params.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Lithic + module Models + module ThreeDS + class AuthenticationRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::ThreeDS::AuthenticationRetrieveParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :three_ds_authentication_token + + sig do + params( + three_ds_authentication_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(three_ds_authentication_token:, request_options: {}) + end + + sig do + override.returns( + { + three_ds_authentication_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/three_ds/authentication_simulate_otp_entry_params.rbi b/rbi/lithic/models/three_ds/authentication_simulate_otp_entry_params.rbi new file mode 100644 index 00000000..c0d6d502 --- /dev/null +++ b/rbi/lithic/models/three_ds/authentication_simulate_otp_entry_params.rbi @@ -0,0 +1,58 @@ +# typed: strong + +module Lithic + module Models + module ThreeDS + class AuthenticationSimulateOtpEntryParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::ThreeDS::AuthenticationSimulateOtpEntryParams, + Lithic::Internal::AnyHash + ) + end + + # A unique token returned as part of a /v1/three_ds_authentication/simulate call + # that resulted in PENDING_CHALLENGE authentication result. + sig { returns(String) } + attr_accessor :token + + # The OTP entered by the cardholder + sig { returns(String) } + attr_accessor :otp + + sig do + params( + token: String, + otp: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # A unique token returned as part of a /v1/three_ds_authentication/simulate call + # that resulted in PENDING_CHALLENGE authentication result. + token:, + # The OTP entered by the cardholder + otp:, + request_options: {} + ) + end + + sig do + override.returns( + { + token: String, + otp: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/three_ds/authentication_simulate_params.rbi b/rbi/lithic/models/three_ds/authentication_simulate_params.rbi new file mode 100644 index 00000000..e6d8b671 --- /dev/null +++ b/rbi/lithic/models/three_ds/authentication_simulate_params.rbi @@ -0,0 +1,251 @@ +# typed: strong + +module Lithic + module Models + module ThreeDS + class AuthenticationSimulateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::ThreeDS::AuthenticationSimulateParams, + Lithic::Internal::AnyHash + ) + end + + # Merchant information for the simulated transaction + sig { returns(Lithic::ThreeDS::AuthenticationSimulateParams::Merchant) } + attr_reader :merchant + + sig do + params( + merchant: + Lithic::ThreeDS::AuthenticationSimulateParams::Merchant::OrHash + ).void + end + attr_writer :merchant + + # Sixteen digit card number. + sig { returns(String) } + attr_accessor :pan + + # Transaction details for the simulation + sig do + returns(Lithic::ThreeDS::AuthenticationSimulateParams::Transaction) + end + attr_reader :transaction + + sig do + params( + transaction: + Lithic::ThreeDS::AuthenticationSimulateParams::Transaction::OrHash + ).void + end + attr_writer :transaction + + # When set will use the following values as part of the Simulated Authentication. + # When not set defaults to MATCH + sig do + returns( + T.nilable( + Lithic::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck::OrSymbol + ) + ) + end + attr_reader :card_expiry_check + + sig do + params( + card_expiry_check: + Lithic::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck::OrSymbol + ).void + end + attr_writer :card_expiry_check + + sig do + params( + merchant: + Lithic::ThreeDS::AuthenticationSimulateParams::Merchant::OrHash, + pan: String, + transaction: + Lithic::ThreeDS::AuthenticationSimulateParams::Transaction::OrHash, + card_expiry_check: + Lithic::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Merchant information for the simulated transaction + merchant:, + # Sixteen digit card number. + pan:, + # Transaction details for the simulation + transaction:, + # When set will use the following values as part of the Simulated Authentication. + # When not set defaults to MATCH + card_expiry_check: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + merchant: Lithic::ThreeDS::AuthenticationSimulateParams::Merchant, + pan: String, + transaction: + Lithic::ThreeDS::AuthenticationSimulateParams::Transaction, + card_expiry_check: + Lithic::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + class Merchant < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ThreeDS::AuthenticationSimulateParams::Merchant, + Lithic::Internal::AnyHash + ) + end + + # Unique identifier to identify the payment card acceptor. Corresponds to + # `merchant_acceptor_id` in authorization. + sig { returns(String) } + attr_accessor :id + + # Country of the address provided by the cardholder in ISO 3166-1 alpha-3 format + # (e.g. USA) + sig { returns(String) } + attr_accessor :country + + # Merchant category code for the transaction to be simulated. A four-digit number + # listed in ISO 18245. Supported merchant category codes can be found + # [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs). + sig { returns(String) } + attr_accessor :mcc + + # Merchant descriptor, corresponds to `descriptor` in authorization. If CHALLENGE + # keyword is included, Lithic will trigger a challenge. + sig { returns(String) } + attr_accessor :name + + # Merchant information for the simulated transaction + sig do + params( + id: String, + country: String, + mcc: String, + name: String + ).returns(T.attached_class) + end + def self.new( + # Unique identifier to identify the payment card acceptor. Corresponds to + # `merchant_acceptor_id` in authorization. + id:, + # Country of the address provided by the cardholder in ISO 3166-1 alpha-3 format + # (e.g. USA) + country:, + # Merchant category code for the transaction to be simulated. A four-digit number + # listed in ISO 18245. Supported merchant category codes can be found + # [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs). + mcc:, + # Merchant descriptor, corresponds to `descriptor` in authorization. If CHALLENGE + # keyword is included, Lithic will trigger a challenge. + name: + ) + end + + sig do + override.returns( + { id: String, country: String, mcc: String, name: String } + ) + end + def to_hash + end + end + + class Transaction < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ThreeDS::AuthenticationSimulateParams::Transaction, + Lithic::Internal::AnyHash + ) + end + + # Amount (in cents) to authenticate. + sig { returns(Integer) } + attr_accessor :amount + + # 3-character alphabetic ISO 4217 currency code. + sig { returns(String) } + attr_accessor :currency + + # Transaction details for the simulation + sig do + params(amount: Integer, currency: String).returns(T.attached_class) + end + def self.new( + # Amount (in cents) to authenticate. + amount:, + # 3-character alphabetic ISO 4217 currency code. + currency: + ) + end + + sig { override.returns({ amount: Integer, currency: String }) } + def to_hash + end + end + + # When set will use the following values as part of the Simulated Authentication. + # When not set defaults to MATCH + module CardExpiryCheck + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MATCH = + T.let( + :MATCH, + Lithic::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck::TaggedSymbol + ) + MISMATCH = + T.let( + :MISMATCH, + Lithic::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck::TaggedSymbol + ) + NOT_PRESENT = + T.let( + :NOT_PRESENT, + Lithic::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/three_ds/authentication_simulate_response.rbi b/rbi/lithic/models/three_ds/authentication_simulate_response.rbi new file mode 100644 index 00000000..65223260 --- /dev/null +++ b/rbi/lithic/models/three_ds/authentication_simulate_response.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Lithic + module Models + module ThreeDS + class AuthenticationSimulateResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::ThreeDS::AuthenticationSimulateResponse, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for the 3DS authentication. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + sig { params(token: String).returns(T.attached_class) } + def self.new( + # Globally unique identifier for the 3DS authentication. + token: nil + ) + end + + sig { override.returns({ token: String }) } + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/three_ds/challenge_response.rbi b/rbi/lithic/models/three_ds/challenge_response.rbi new file mode 100644 index 00000000..e63e1093 --- /dev/null +++ b/rbi/lithic/models/three_ds/challenge_response.rbi @@ -0,0 +1,50 @@ +# typed: strong + +module Lithic + module Models + module ThreeDS + class ChallengeResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::ThreeDS::ChallengeResponse, Lithic::Internal::AnyHash) + end + + # Globally unique identifier for 3DS Authentication that resulted in + # PENDING_CHALLENGE authentication result. + sig { returns(String) } + attr_accessor :token + + # Whether the Cardholder has approved or declined the issued Challenge + sig { returns(Lithic::ThreeDS::ChallengeResult::OrSymbol) } + attr_accessor :challenge_response + + # Response from Card Program to a 3DS Authentication challenge + sig do + params( + token: String, + challenge_response: Lithic::ThreeDS::ChallengeResult::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for 3DS Authentication that resulted in + # PENDING_CHALLENGE authentication result. + token:, + # Whether the Cardholder has approved or declined the issued Challenge + challenge_response: + ) + end + + sig do + override.returns( + { + token: String, + challenge_response: Lithic::ThreeDS::ChallengeResult::OrSymbol + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/three_ds/challenge_result.rbi b/rbi/lithic/models/three_ds/challenge_result.rbi new file mode 100644 index 00000000..22d443da --- /dev/null +++ b/rbi/lithic/models/three_ds/challenge_result.rbi @@ -0,0 +1,32 @@ +# typed: strong + +module Lithic + module Models + module ThreeDS + # Whether the Cardholder has approved or declined the issued Challenge + module ChallengeResult + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::ThreeDS::ChallengeResult) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVE = + T.let(:APPROVE, Lithic::ThreeDS::ChallengeResult::TaggedSymbol) + DECLINE_BY_CUSTOMER = + T.let( + :DECLINE_BY_CUSTOMER, + Lithic::ThreeDS::ChallengeResult::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::ThreeDS::ChallengeResult::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/three_ds/decisioning_challenge_response_params.rbi b/rbi/lithic/models/three_ds/decisioning_challenge_response_params.rbi new file mode 100644 index 00000000..85d46e6b --- /dev/null +++ b/rbi/lithic/models/three_ds/decisioning_challenge_response_params.rbi @@ -0,0 +1,32 @@ +# typed: strong + +module Lithic + module Models + module ThreeDS + class DecisioningChallengeResponseParams < Lithic::Models::ThreeDS::ChallengeResponse + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::ThreeDS::DecisioningChallengeResponseParams, + Lithic::Internal::AnyHash + ) + end + + sig do + params(request_options: Lithic::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: Lithic::RequestOptions }) } + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/three_ds/decisioning_retrieve_secret_params.rbi b/rbi/lithic/models/three_ds/decisioning_retrieve_secret_params.rbi new file mode 100644 index 00000000..9ce3541d --- /dev/null +++ b/rbi/lithic/models/three_ds/decisioning_retrieve_secret_params.rbi @@ -0,0 +1,32 @@ +# typed: strong + +module Lithic + module Models + module ThreeDS + class DecisioningRetrieveSecretParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::ThreeDS::DecisioningRetrieveSecretParams, + Lithic::Internal::AnyHash + ) + end + + sig do + params(request_options: Lithic::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: Lithic::RequestOptions }) } + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/three_ds/decisioning_retrieve_secret_response.rbi b/rbi/lithic/models/three_ds/decisioning_retrieve_secret_response.rbi new file mode 100644 index 00000000..7459936a --- /dev/null +++ b/rbi/lithic/models/three_ds/decisioning_retrieve_secret_response.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Lithic + module Models + module ThreeDS + class DecisioningRetrieveSecretResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::ThreeDS::DecisioningRetrieveSecretResponse, + Lithic::Internal::AnyHash + ) + end + + # The 3DS Decisioning HMAC secret + sig { returns(T.nilable(String)) } + attr_reader :secret + + sig { params(secret: String).void } + attr_writer :secret + + sig { params(secret: String).returns(T.attached_class) } + def self.new( + # The 3DS Decisioning HMAC secret + secret: nil + ) + end + + sig { override.returns({ secret: String }) } + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/three_ds/decisioning_rotate_secret_params.rbi b/rbi/lithic/models/three_ds/decisioning_rotate_secret_params.rbi new file mode 100644 index 00000000..730def40 --- /dev/null +++ b/rbi/lithic/models/three_ds/decisioning_rotate_secret_params.rbi @@ -0,0 +1,32 @@ +# typed: strong + +module Lithic + module Models + module ThreeDS + class DecisioningRotateSecretParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::ThreeDS::DecisioningRotateSecretParams, + Lithic::Internal::AnyHash + ) + end + + sig do + params(request_options: Lithic::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: Lithic::RequestOptions }) } + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/three_ds_authentication.rbi b/rbi/lithic/models/three_ds_authentication.rbi new file mode 100644 index 00000000..60250948 --- /dev/null +++ b/rbi/lithic/models/three_ds_authentication.rbi @@ -0,0 +1,2432 @@ +# typed: strong + +module Lithic + module Models + class ThreeDSAuthentication < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::ThreeDSAuthentication, Lithic::Internal::AnyHash) + end + + # Globally unique identifier for the 3DS authentication. Permitted values: + # 36-digit version 4 UUID (including hyphens). + sig { returns(String) } + attr_accessor :token + + # Type of account/card that is being used for the transaction. Maps to EMV 3DS + # field `acctType`. + sig do + returns( + T.nilable(Lithic::ThreeDSAuthentication::AccountType::TaggedSymbol) + ) + end + attr_accessor :account_type + + # Indicates the outcome of the 3DS authentication process. + sig do + returns( + Lithic::ThreeDSAuthentication::AuthenticationResult::TaggedSymbol + ) + end + attr_accessor :authentication_result + + # Indicates whether the expiration date provided by the cardholder during checkout + # matches Lithic's record of the card's expiration date. + sig do + returns(Lithic::ThreeDSAuthentication::CardExpiryCheck::TaggedSymbol) + end + attr_accessor :card_expiry_check + + # Globally unique identifier for the card on which the 3DS authentication has + # occurred. Permitted values: 36-digit version 4 UUID (including hyphens). + sig { returns(String) } + attr_accessor :card_token + + # Object containing data about the cardholder provided during the transaction. + sig { returns(Lithic::ThreeDSAuthentication::Cardholder) } + attr_reader :cardholder + + sig do + params( + cardholder: Lithic::ThreeDSAuthentication::Cardholder::OrHash + ).void + end + attr_writer :cardholder + + # Channel in which the authentication occurs. Maps to EMV 3DS field + # `deviceChannel`. + sig { returns(Lithic::ThreeDSAuthentication::Channel::TaggedSymbol) } + attr_accessor :channel + + # Date and time when the authentication was created in Lithic's system. Permitted + # values: Date string in the ISO 8601 format yyyy-MM-dd'T'hh:mm:ssZ. + sig { returns(Time) } + attr_accessor :created + + # Object containing data about the merchant involved in the e-commerce + # transaction. + sig { returns(Lithic::ThreeDSAuthentication::Merchant) } + attr_reader :merchant + + sig do + params(merchant: Lithic::ThreeDSAuthentication::Merchant::OrHash).void + end + attr_writer :merchant + + # Either PAYMENT_AUTHENTICATION or NON_PAYMENT_AUTHENTICATION. For + # NON_PAYMENT_AUTHENTICATION, additional_data and transaction fields are not + # populated. + sig do + returns(Lithic::ThreeDSAuthentication::MessageCategory::TaggedSymbol) + end + attr_accessor :message_category + + # Indicates whether a challenge is requested for this transaction + # + # - `NO_PREFERENCE` - No Preference + # - `NO_CHALLENGE_REQUESTED` - No Challenge Requested + # - `CHALLENGE_PREFERENCE` - Challenge requested (3DS Requestor preference) + # - `CHALLENGE_MANDATE` - Challenge requested (Mandate) + # - `NO_CHALLENGE_RISK_ALREADY_ASSESSED` - No Challenge requested (Transactional + # risk analysis is already performed) + # - `DATA_SHARE_ONLY` - No Challenge requested (Data Share Only) + # - `OTHER` - Other indicators not captured by above. These are rarely used + sig do + returns( + Lithic::ThreeDSAuthentication::ThreeDSRequestorChallengeIndicator::TaggedSymbol + ) + end + attr_accessor :three_ds_requestor_challenge_indicator + + # Object containing additional data about the 3DS request that is beyond the EMV + # 3DS standard spec (e.g., specific fields that only certain card networks send + # but are not required across all 3DS requests). + sig { returns(T.nilable(Lithic::ThreeDSAuthentication::AdditionalData)) } + attr_reader :additional_data + + sig do + params( + additional_data: + T.nilable(Lithic::ThreeDSAuthentication::AdditionalData::OrHash) + ).void + end + attr_writer :additional_data + + # Object containing data about the app used in the e-commerce transaction. Present + # if the channel is 'APP_BASED'. + sig { returns(T.nilable(Lithic::ThreeDSAuthentication::App)) } + attr_reader :app + + sig do + params(app: T.nilable(Lithic::ThreeDSAuthentication::App::OrHash)).void + end + attr_writer :app + + # Type of authentication request - i.e., the type of transaction or interaction is + # causing the merchant to request an authentication. Maps to EMV 3DS field + # `threeDSRequestorAuthenticationInd`. + sig do + returns( + T.nilable( + Lithic::ThreeDSAuthentication::AuthenticationRequestType::TaggedSymbol + ) + ) + end + attr_accessor :authentication_request_type + + # Object containing data about the browser used in the e-commerce transaction. + # Present if the channel is 'BROWSER'. + sig { returns(T.nilable(Lithic::ThreeDSAuthentication::Browser)) } + attr_reader :browser + + sig do + params( + browser: T.nilable(Lithic::ThreeDSAuthentication::Browser::OrHash) + ).void + end + attr_writer :browser + + # Metadata about the challenge method and delivery. Only present when a challenge + # is triggered. + sig do + returns(T.nilable(Lithic::ThreeDSAuthentication::ChallengeMetadata)) + end + attr_reader :challenge_metadata + + sig do + params( + challenge_metadata: + T.nilable(Lithic::ThreeDSAuthentication::ChallengeMetadata::OrHash) + ).void + end + attr_writer :challenge_metadata + + # Entity that orchestrates the challenge. This won't be set for authentications + # for which a decision has not yet been made (e.g. in-flight customer decisioning + # request). + sig do + returns( + T.nilable( + Lithic::ThreeDSAuthentication::ChallengeOrchestratedBy::TaggedSymbol + ) + ) + end + attr_accessor :challenge_orchestrated_by + + # Entity that made the authentication decision. This won't be set for + # authentications for which a decision has not yet been made (e.g. in-flight + # customer decisioning request). + sig do + returns( + T.nilable(Lithic::ThreeDSAuthentication::DecisionMadeBy::TaggedSymbol) + ) + end + attr_accessor :decision_made_by + + # Type of 3DS Requestor Initiated (3RI) request — i.e., a 3DS authentication that + # takes place at the initiation of the merchant rather than the cardholder. The + # most common example of this is where a merchant is authenticating before billing + # for a recurring transaction such as a pay TV subscription or a utility bill. + # Maps to EMV 3DS field `threeRIInd`. + sig do + returns( + T.nilable( + Lithic::ThreeDSAuthentication::ThreeRiRequestType::TaggedSymbol + ) + ) + end + attr_accessor :three_ri_request_type + + # Object containing data about the e-commerce transaction for which the merchant + # is requesting authentication. + sig { returns(T.nilable(Lithic::ThreeDSAuthentication::Transaction)) } + attr_reader :transaction + + sig do + params( + transaction: + T.nilable(Lithic::ThreeDSAuthentication::Transaction::OrHash) + ).void + end + attr_writer :transaction + + # Represents a 3DS authentication + sig do + params( + token: String, + account_type: + T.nilable(Lithic::ThreeDSAuthentication::AccountType::OrSymbol), + authentication_result: + Lithic::ThreeDSAuthentication::AuthenticationResult::OrSymbol, + card_expiry_check: + Lithic::ThreeDSAuthentication::CardExpiryCheck::OrSymbol, + card_token: String, + cardholder: Lithic::ThreeDSAuthentication::Cardholder::OrHash, + channel: Lithic::ThreeDSAuthentication::Channel::OrSymbol, + created: Time, + merchant: Lithic::ThreeDSAuthentication::Merchant::OrHash, + message_category: + Lithic::ThreeDSAuthentication::MessageCategory::OrSymbol, + three_ds_requestor_challenge_indicator: + Lithic::ThreeDSAuthentication::ThreeDSRequestorChallengeIndicator::OrSymbol, + additional_data: + T.nilable(Lithic::ThreeDSAuthentication::AdditionalData::OrHash), + app: T.nilable(Lithic::ThreeDSAuthentication::App::OrHash), + authentication_request_type: + T.nilable( + Lithic::ThreeDSAuthentication::AuthenticationRequestType::OrSymbol + ), + browser: T.nilable(Lithic::ThreeDSAuthentication::Browser::OrHash), + challenge_metadata: + T.nilable(Lithic::ThreeDSAuthentication::ChallengeMetadata::OrHash), + challenge_orchestrated_by: + T.nilable( + Lithic::ThreeDSAuthentication::ChallengeOrchestratedBy::OrSymbol + ), + decision_made_by: + T.nilable(Lithic::ThreeDSAuthentication::DecisionMadeBy::OrSymbol), + three_ri_request_type: + T.nilable( + Lithic::ThreeDSAuthentication::ThreeRiRequestType::OrSymbol + ), + transaction: + T.nilable(Lithic::ThreeDSAuthentication::Transaction::OrHash) + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the 3DS authentication. Permitted values: + # 36-digit version 4 UUID (including hyphens). + token:, + # Type of account/card that is being used for the transaction. Maps to EMV 3DS + # field `acctType`. + account_type:, + # Indicates the outcome of the 3DS authentication process. + authentication_result:, + # Indicates whether the expiration date provided by the cardholder during checkout + # matches Lithic's record of the card's expiration date. + card_expiry_check:, + # Globally unique identifier for the card on which the 3DS authentication has + # occurred. Permitted values: 36-digit version 4 UUID (including hyphens). + card_token:, + # Object containing data about the cardholder provided during the transaction. + cardholder:, + # Channel in which the authentication occurs. Maps to EMV 3DS field + # `deviceChannel`. + channel:, + # Date and time when the authentication was created in Lithic's system. Permitted + # values: Date string in the ISO 8601 format yyyy-MM-dd'T'hh:mm:ssZ. + created:, + # Object containing data about the merchant involved in the e-commerce + # transaction. + merchant:, + # Either PAYMENT_AUTHENTICATION or NON_PAYMENT_AUTHENTICATION. For + # NON_PAYMENT_AUTHENTICATION, additional_data and transaction fields are not + # populated. + message_category:, + # Indicates whether a challenge is requested for this transaction + # + # - `NO_PREFERENCE` - No Preference + # - `NO_CHALLENGE_REQUESTED` - No Challenge Requested + # - `CHALLENGE_PREFERENCE` - Challenge requested (3DS Requestor preference) + # - `CHALLENGE_MANDATE` - Challenge requested (Mandate) + # - `NO_CHALLENGE_RISK_ALREADY_ASSESSED` - No Challenge requested (Transactional + # risk analysis is already performed) + # - `DATA_SHARE_ONLY` - No Challenge requested (Data Share Only) + # - `OTHER` - Other indicators not captured by above. These are rarely used + three_ds_requestor_challenge_indicator:, + # Object containing additional data about the 3DS request that is beyond the EMV + # 3DS standard spec (e.g., specific fields that only certain card networks send + # but are not required across all 3DS requests). + additional_data: nil, + # Object containing data about the app used in the e-commerce transaction. Present + # if the channel is 'APP_BASED'. + app: nil, + # Type of authentication request - i.e., the type of transaction or interaction is + # causing the merchant to request an authentication. Maps to EMV 3DS field + # `threeDSRequestorAuthenticationInd`. + authentication_request_type: nil, + # Object containing data about the browser used in the e-commerce transaction. + # Present if the channel is 'BROWSER'. + browser: nil, + # Metadata about the challenge method and delivery. Only present when a challenge + # is triggered. + challenge_metadata: nil, + # Entity that orchestrates the challenge. This won't be set for authentications + # for which a decision has not yet been made (e.g. in-flight customer decisioning + # request). + challenge_orchestrated_by: nil, + # Entity that made the authentication decision. This won't be set for + # authentications for which a decision has not yet been made (e.g. in-flight + # customer decisioning request). + decision_made_by: nil, + # Type of 3DS Requestor Initiated (3RI) request — i.e., a 3DS authentication that + # takes place at the initiation of the merchant rather than the cardholder. The + # most common example of this is where a merchant is authenticating before billing + # for a recurring transaction such as a pay TV subscription or a utility bill. + # Maps to EMV 3DS field `threeRIInd`. + three_ri_request_type: nil, + # Object containing data about the e-commerce transaction for which the merchant + # is requesting authentication. + transaction: nil + ) + end + + sig do + override.returns( + { + token: String, + account_type: + T.nilable( + Lithic::ThreeDSAuthentication::AccountType::TaggedSymbol + ), + authentication_result: + Lithic::ThreeDSAuthentication::AuthenticationResult::TaggedSymbol, + card_expiry_check: + Lithic::ThreeDSAuthentication::CardExpiryCheck::TaggedSymbol, + card_token: String, + cardholder: Lithic::ThreeDSAuthentication::Cardholder, + channel: Lithic::ThreeDSAuthentication::Channel::TaggedSymbol, + created: Time, + merchant: Lithic::ThreeDSAuthentication::Merchant, + message_category: + Lithic::ThreeDSAuthentication::MessageCategory::TaggedSymbol, + three_ds_requestor_challenge_indicator: + Lithic::ThreeDSAuthentication::ThreeDSRequestorChallengeIndicator::TaggedSymbol, + additional_data: + T.nilable(Lithic::ThreeDSAuthentication::AdditionalData), + app: T.nilable(Lithic::ThreeDSAuthentication::App), + authentication_request_type: + T.nilable( + Lithic::ThreeDSAuthentication::AuthenticationRequestType::TaggedSymbol + ), + browser: T.nilable(Lithic::ThreeDSAuthentication::Browser), + challenge_metadata: + T.nilable(Lithic::ThreeDSAuthentication::ChallengeMetadata), + challenge_orchestrated_by: + T.nilable( + Lithic::ThreeDSAuthentication::ChallengeOrchestratedBy::TaggedSymbol + ), + decision_made_by: + T.nilable( + Lithic::ThreeDSAuthentication::DecisionMadeBy::TaggedSymbol + ), + three_ri_request_type: + T.nilable( + Lithic::ThreeDSAuthentication::ThreeRiRequestType::TaggedSymbol + ), + transaction: T.nilable(Lithic::ThreeDSAuthentication::Transaction) + } + ) + end + def to_hash + end + + # Type of account/card that is being used for the transaction. Maps to EMV 3DS + # field `acctType`. + module AccountType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ThreeDSAuthentication::AccountType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREDIT = + T.let( + :CREDIT, + Lithic::ThreeDSAuthentication::AccountType::TaggedSymbol + ) + DEBIT = + T.let( + :DEBIT, + Lithic::ThreeDSAuthentication::AccountType::TaggedSymbol + ) + NOT_APPLICABLE = + T.let( + :NOT_APPLICABLE, + Lithic::ThreeDSAuthentication::AccountType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::ThreeDSAuthentication::AccountType::TaggedSymbol] + ) + end + def self.values + end + end + + # Indicates the outcome of the 3DS authentication process. + module AuthenticationResult + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ThreeDSAuthentication::AuthenticationResult) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DECLINE = + T.let( + :DECLINE, + Lithic::ThreeDSAuthentication::AuthenticationResult::TaggedSymbol + ) + SUCCESS = + T.let( + :SUCCESS, + Lithic::ThreeDSAuthentication::AuthenticationResult::TaggedSymbol + ) + PENDING_CHALLENGE = + T.let( + :PENDING_CHALLENGE, + Lithic::ThreeDSAuthentication::AuthenticationResult::TaggedSymbol + ) + PENDING_DECISION = + T.let( + :PENDING_DECISION, + Lithic::ThreeDSAuthentication::AuthenticationResult::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ThreeDSAuthentication::AuthenticationResult::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Indicates whether the expiration date provided by the cardholder during checkout + # matches Lithic's record of the card's expiration date. + module CardExpiryCheck + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ThreeDSAuthentication::CardExpiryCheck) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MATCH = + T.let( + :MATCH, + Lithic::ThreeDSAuthentication::CardExpiryCheck::TaggedSymbol + ) + MISMATCH = + T.let( + :MISMATCH, + Lithic::ThreeDSAuthentication::CardExpiryCheck::TaggedSymbol + ) + NOT_PRESENT = + T.let( + :NOT_PRESENT, + Lithic::ThreeDSAuthentication::CardExpiryCheck::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ThreeDSAuthentication::CardExpiryCheck::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Cardholder < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ThreeDSAuthentication::Cardholder, + Lithic::Internal::AnyHash + ) + end + + # Indicates whether the shipping address and billing address provided by the + # cardholder are the same. This value - and assessment of whether the addresses + # match - is provided directly in the 3DS request and is not determined by Lithic. + # Maps to EMV 3DS field `addrMatch`. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :address_match + + # Lithic's evaluation result comparing the transaction's address data with the + # cardholder KYC data if it exists. In the event Lithic does not have any + # Cardholder KYC data, or the transaction does not contain any address data, + # NOT_PRESENT will be returned + sig do + returns( + T.nilable( + Lithic::ThreeDSAuthentication::Cardholder::AddressOnFileMatch::TaggedSymbol + ) + ) + end + attr_reader :address_on_file_match + + sig do + params( + address_on_file_match: + Lithic::ThreeDSAuthentication::Cardholder::AddressOnFileMatch::OrSymbol + ).void + end + attr_writer :address_on_file_match + + # Object containing data on the billing address provided during the transaction. + sig do + returns( + T.nilable(Lithic::ThreeDSAuthentication::Cardholder::BillingAddress) + ) + end + attr_reader :billing_address + + sig do + params( + billing_address: + Lithic::ThreeDSAuthentication::Cardholder::BillingAddress::OrHash + ).void + end + attr_writer :billing_address + + # Email address that is either provided by the cardholder or is on file with the + # merchant in a 3RI request. Maps to EMV 3DS field `email`. + sig { returns(T.nilable(String)) } + attr_accessor :email + + # Name of the cardholder. Maps to EMV 3DS field `cardholderName`. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # Home phone number in E.164 format provided by the cardholder. Maps to EMV 3DS + # fields `homePhone.cc` and `homePhone.subscriber`. + sig { returns(T.nilable(String)) } + attr_accessor :phone_number_home + + # Mobile/cell phone number in E.164 format provided by the cardholder. Maps to EMV + # 3DS fields `mobilePhone.cc` and `mobilePhone.subscriber`. + sig { returns(T.nilable(String)) } + attr_accessor :phone_number_mobile + + # Work phone number in E.164 format provided by the cardholder. Maps to EMV 3DS + # fields `workPhone.cc` and `workPhone.subscriber`. + sig { returns(T.nilable(String)) } + attr_accessor :phone_number_work + + # Object containing data on the shipping address provided during the transaction. + sig do + returns( + T.nilable( + Lithic::ThreeDSAuthentication::Cardholder::ShippingAddress + ) + ) + end + attr_reader :shipping_address + + sig do + params( + shipping_address: + Lithic::ThreeDSAuthentication::Cardholder::ShippingAddress::OrHash + ).void + end + attr_writer :shipping_address + + # Object containing data about the cardholder provided during the transaction. + sig do + params( + address_match: T.nilable(T::Boolean), + address_on_file_match: + Lithic::ThreeDSAuthentication::Cardholder::AddressOnFileMatch::OrSymbol, + billing_address: + Lithic::ThreeDSAuthentication::Cardholder::BillingAddress::OrHash, + email: T.nilable(String), + name: T.nilable(String), + phone_number_home: T.nilable(String), + phone_number_mobile: T.nilable(String), + phone_number_work: T.nilable(String), + shipping_address: + Lithic::ThreeDSAuthentication::Cardholder::ShippingAddress::OrHash + ).returns(T.attached_class) + end + def self.new( + # Indicates whether the shipping address and billing address provided by the + # cardholder are the same. This value - and assessment of whether the addresses + # match - is provided directly in the 3DS request and is not determined by Lithic. + # Maps to EMV 3DS field `addrMatch`. + address_match: nil, + # Lithic's evaluation result comparing the transaction's address data with the + # cardholder KYC data if it exists. In the event Lithic does not have any + # Cardholder KYC data, or the transaction does not contain any address data, + # NOT_PRESENT will be returned + address_on_file_match: nil, + # Object containing data on the billing address provided during the transaction. + billing_address: nil, + # Email address that is either provided by the cardholder or is on file with the + # merchant in a 3RI request. Maps to EMV 3DS field `email`. + email: nil, + # Name of the cardholder. Maps to EMV 3DS field `cardholderName`. + name: nil, + # Home phone number in E.164 format provided by the cardholder. Maps to EMV 3DS + # fields `homePhone.cc` and `homePhone.subscriber`. + phone_number_home: nil, + # Mobile/cell phone number in E.164 format provided by the cardholder. Maps to EMV + # 3DS fields `mobilePhone.cc` and `mobilePhone.subscriber`. + phone_number_mobile: nil, + # Work phone number in E.164 format provided by the cardholder. Maps to EMV 3DS + # fields `workPhone.cc` and `workPhone.subscriber`. + phone_number_work: nil, + # Object containing data on the shipping address provided during the transaction. + shipping_address: nil + ) + end + + sig do + override.returns( + { + address_match: T.nilable(T::Boolean), + address_on_file_match: + Lithic::ThreeDSAuthentication::Cardholder::AddressOnFileMatch::TaggedSymbol, + billing_address: + Lithic::ThreeDSAuthentication::Cardholder::BillingAddress, + email: T.nilable(String), + name: T.nilable(String), + phone_number_home: T.nilable(String), + phone_number_mobile: T.nilable(String), + phone_number_work: T.nilable(String), + shipping_address: + Lithic::ThreeDSAuthentication::Cardholder::ShippingAddress + } + ) + end + def to_hash + end + + # Lithic's evaluation result comparing the transaction's address data with the + # cardholder KYC data if it exists. In the event Lithic does not have any + # Cardholder KYC data, or the transaction does not contain any address data, + # NOT_PRESENT will be returned + module AddressOnFileMatch + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::ThreeDSAuthentication::Cardholder::AddressOnFileMatch + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MATCH = + T.let( + :MATCH, + Lithic::ThreeDSAuthentication::Cardholder::AddressOnFileMatch::TaggedSymbol + ) + MATCH_ADDRESS_ONLY = + T.let( + :MATCH_ADDRESS_ONLY, + Lithic::ThreeDSAuthentication::Cardholder::AddressOnFileMatch::TaggedSymbol + ) + MATCH_ZIP_ONLY = + T.let( + :MATCH_ZIP_ONLY, + Lithic::ThreeDSAuthentication::Cardholder::AddressOnFileMatch::TaggedSymbol + ) + MISMATCH = + T.let( + :MISMATCH, + Lithic::ThreeDSAuthentication::Cardholder::AddressOnFileMatch::TaggedSymbol + ) + NOT_PRESENT = + T.let( + :NOT_PRESENT, + Lithic::ThreeDSAuthentication::Cardholder::AddressOnFileMatch::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ThreeDSAuthentication::Cardholder::AddressOnFileMatch::TaggedSymbol + ] + ) + end + def self.values + end + end + + class BillingAddress < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ThreeDSAuthentication::Cardholder::BillingAddress, + Lithic::Internal::AnyHash + ) + end + + # First line of the street address provided by the cardholder. + sig { returns(T.nilable(String)) } + attr_accessor :address1 + + # Second line of the street address provided by the cardholder. + sig { returns(T.nilable(String)) } + attr_accessor :address2 + + # Third line of the street address provided by the cardholder. + sig { returns(T.nilable(String)) } + attr_accessor :address3 + + # City of the address provided by the cardholder. + sig { returns(T.nilable(String)) } + attr_accessor :city + + # Country of the address provided by the cardholder in ISO 3166-1 alpha-3 format + # (e.g. USA) + sig { returns(T.nilable(String)) } + attr_accessor :country + + # Postal code (e.g., ZIP code) of the address provided by the cardholder + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + # Object containing data on the billing address provided during the transaction. + sig do + params( + address1: T.nilable(String), + address2: T.nilable(String), + address3: T.nilable(String), + city: T.nilable(String), + country: T.nilable(String), + postal_code: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # First line of the street address provided by the cardholder. + address1: nil, + # Second line of the street address provided by the cardholder. + address2: nil, + # Third line of the street address provided by the cardholder. + address3: nil, + # City of the address provided by the cardholder. + city: nil, + # Country of the address provided by the cardholder in ISO 3166-1 alpha-3 format + # (e.g. USA) + country: nil, + # Postal code (e.g., ZIP code) of the address provided by the cardholder + postal_code: nil + ) + end + + sig do + override.returns( + { + address1: T.nilable(String), + address2: T.nilable(String), + address3: T.nilable(String), + city: T.nilable(String), + country: T.nilable(String), + postal_code: T.nilable(String) + } + ) + end + def to_hash + end + end + + class ShippingAddress < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ThreeDSAuthentication::Cardholder::ShippingAddress, + Lithic::Internal::AnyHash + ) + end + + # First line of the street address provided by the cardholder. + sig { returns(T.nilable(String)) } + attr_accessor :address1 + + # Second line of the street address provided by the cardholder. + sig { returns(T.nilable(String)) } + attr_accessor :address2 + + # Third line of the street address provided by the cardholder. + sig { returns(T.nilable(String)) } + attr_accessor :address3 + + # City of the address provided by the cardholder. + sig { returns(T.nilable(String)) } + attr_accessor :city + + # Country of the address provided by the cardholder in ISO 3166-1 alpha-3 format + # (e.g. USA) + sig { returns(T.nilable(String)) } + attr_accessor :country + + # Postal code (e.g., ZIP code) of the address provided by the cardholder + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + # Object containing data on the shipping address provided during the transaction. + sig do + params( + address1: T.nilable(String), + address2: T.nilable(String), + address3: T.nilable(String), + city: T.nilable(String), + country: T.nilable(String), + postal_code: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # First line of the street address provided by the cardholder. + address1: nil, + # Second line of the street address provided by the cardholder. + address2: nil, + # Third line of the street address provided by the cardholder. + address3: nil, + # City of the address provided by the cardholder. + city: nil, + # Country of the address provided by the cardholder in ISO 3166-1 alpha-3 format + # (e.g. USA) + country: nil, + # Postal code (e.g., ZIP code) of the address provided by the cardholder + postal_code: nil + ) + end + + sig do + override.returns( + { + address1: T.nilable(String), + address2: T.nilable(String), + address3: T.nilable(String), + city: T.nilable(String), + country: T.nilable(String), + postal_code: T.nilable(String) + } + ) + end + def to_hash + end + end + end + + # Channel in which the authentication occurs. Maps to EMV 3DS field + # `deviceChannel`. + module Channel + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::ThreeDSAuthentication::Channel) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APP_BASED = + T.let( + :APP_BASED, + Lithic::ThreeDSAuthentication::Channel::TaggedSymbol + ) + BROWSER = + T.let(:BROWSER, Lithic::ThreeDSAuthentication::Channel::TaggedSymbol) + THREE_DS_REQUESTOR_INITIATED = + T.let( + :THREE_DS_REQUESTOR_INITIATED, + Lithic::ThreeDSAuthentication::Channel::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::ThreeDSAuthentication::Channel::TaggedSymbol] + ) + end + def self.values + end + end + + class Merchant < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ThreeDSAuthentication::Merchant, + Lithic::Internal::AnyHash + ) + end + + # Object containing additional data indicating additional risk factors related to + # the e-commerce transaction. + sig { returns(Lithic::ThreeDSAuthentication::Merchant::RiskIndicator) } + attr_reader :risk_indicator + + sig do + params( + risk_indicator: + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::OrHash + ).void + end + attr_writer :risk_indicator + + # Merchant identifier as assigned by the acquirer. Maps to EMV 3DS field + # `acquirerMerchantId`. May not be present for non-payment authentications. + sig { returns(T.nilable(String)) } + attr_accessor :id + + # Country code of the merchant requesting 3DS authentication. Maps to EMV 3DS + # field `merchantCountryCode`. Permitted values: ISO 3166-1 alpha-3 country code + # (e.g., USA). May not be present for non-payment authentications. + sig { returns(T.nilable(String)) } + attr_accessor :country + + # Merchant category code assigned to the merchant that describes its business + # activity type. Maps to EMV 3DS field `mcc`. May not be present for non-payment + # authentications. + sig { returns(T.nilable(String)) } + attr_accessor :mcc + + # Name of the merchant. Maps to EMV 3DS field `merchantName`. May not be present + # for non-payment authentications. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # Object containing data about the merchant involved in the e-commerce + # transaction. + sig do + params( + risk_indicator: + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::OrHash, + id: T.nilable(String), + country: T.nilable(String), + mcc: T.nilable(String), + name: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Object containing additional data indicating additional risk factors related to + # the e-commerce transaction. + risk_indicator:, + # Merchant identifier as assigned by the acquirer. Maps to EMV 3DS field + # `acquirerMerchantId`. May not be present for non-payment authentications. + id: nil, + # Country code of the merchant requesting 3DS authentication. Maps to EMV 3DS + # field `merchantCountryCode`. Permitted values: ISO 3166-1 alpha-3 country code + # (e.g., USA). May not be present for non-payment authentications. + country: nil, + # Merchant category code assigned to the merchant that describes its business + # activity type. Maps to EMV 3DS field `mcc`. May not be present for non-payment + # authentications. + mcc: nil, + # Name of the merchant. Maps to EMV 3DS field `merchantName`. May not be present + # for non-payment authentications. + name: nil + ) + end + + sig do + override.returns( + { + risk_indicator: + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator, + id: T.nilable(String), + country: T.nilable(String), + mcc: T.nilable(String), + name: T.nilable(String) + } + ) + end + def to_hash + end + + class RiskIndicator < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator, + Lithic::Internal::AnyHash + ) + end + + # In transactions with electronic delivery, email address to which merchandise is + # delivered. Maps to EMV 3DS field `deliveryEmailAddress`. + sig { returns(T.nilable(String)) } + attr_accessor :delivery_email_address + + # The delivery time frame for the merchandise. Maps to EMV 3DS field + # `deliveryTimeframe`. + sig do + returns( + T.nilable( + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::DeliveryTimeFrame::TaggedSymbol + ) + ) + end + attr_accessor :delivery_time_frame + + # In prepaid or gift card purchase transactions, purchase amount total in major + # units (e.g., a purchase of USD $205.10 would be 205). Maps to EMV 3DS field + # `giftCardAmount`. + sig { returns(T.nilable(Integer)) } + attr_accessor :gift_card_amount + + # In prepaid or gift card purchase transactions, count of individual prepaid or + # gift cards/codes purchased. Maps to EMV 3DS field `giftCardCount`. + sig { returns(T.nilable(Integer)) } + attr_accessor :gift_card_count + + # In prepaid or gift card purchase transactions, currency code of the gift card. + # Maps to EMV 3DS field `giftCardCurr`. Permitted values: ISO 4217 three-character + # currency code (e.g., USD). + sig { returns(T.nilable(String)) } + attr_accessor :gift_card_currency + + # Indicates whether the purchase is for merchandise that is available now or at a + # future date. Maps to EMV 3DS field `preOrderPurchaseInd`. + sig do + returns( + T.nilable( + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::OrderAvailability::TaggedSymbol + ) + ) + end + attr_accessor :order_availability + + # In pre-order purchase transactions, the expected date that the merchandise will + # be available. Maps to EMV 3DS field `preOrderDate`. Permitted values: Date + # string in the ISO 8601 format yyyy-MM-dd'T'hh:mm:ssZ + sig { returns(T.nilable(Time)) } + attr_accessor :pre_order_available_date + + # Indicates whether the cardholder is reordering previously purchased merchandise. + # Maps to EMV 3DS field `reorderItemsInd`. + sig do + returns( + T.nilable( + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::ReorderItems::TaggedSymbol + ) + ) + end + attr_accessor :reorder_items + + # Shipping method that the cardholder chose for the transaction. If purchase + # includes one or more item, this indicator is used for the physical goods; if the + # purchase only includes digital goods, this indicator is used to describe the + # most expensive item purchased. Maps to EMV 3DS field `shipIndicator`. + sig do + returns( + T.nilable( + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::ShippingMethod::TaggedSymbol + ) + ) + end + attr_accessor :shipping_method + + # Object containing additional data indicating additional risk factors related to + # the e-commerce transaction. + sig do + params( + delivery_email_address: T.nilable(String), + delivery_time_frame: + T.nilable( + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::DeliveryTimeFrame::OrSymbol + ), + gift_card_amount: T.nilable(Integer), + gift_card_count: T.nilable(Integer), + gift_card_currency: T.nilable(String), + order_availability: + T.nilable( + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::OrderAvailability::OrSymbol + ), + pre_order_available_date: T.nilable(Time), + reorder_items: + T.nilable( + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::ReorderItems::OrSymbol + ), + shipping_method: + T.nilable( + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::ShippingMethod::OrSymbol + ) + ).returns(T.attached_class) + end + def self.new( + # In transactions with electronic delivery, email address to which merchandise is + # delivered. Maps to EMV 3DS field `deliveryEmailAddress`. + delivery_email_address: nil, + # The delivery time frame for the merchandise. Maps to EMV 3DS field + # `deliveryTimeframe`. + delivery_time_frame: nil, + # In prepaid or gift card purchase transactions, purchase amount total in major + # units (e.g., a purchase of USD $205.10 would be 205). Maps to EMV 3DS field + # `giftCardAmount`. + gift_card_amount: nil, + # In prepaid or gift card purchase transactions, count of individual prepaid or + # gift cards/codes purchased. Maps to EMV 3DS field `giftCardCount`. + gift_card_count: nil, + # In prepaid or gift card purchase transactions, currency code of the gift card. + # Maps to EMV 3DS field `giftCardCurr`. Permitted values: ISO 4217 three-character + # currency code (e.g., USD). + gift_card_currency: nil, + # Indicates whether the purchase is for merchandise that is available now or at a + # future date. Maps to EMV 3DS field `preOrderPurchaseInd`. + order_availability: nil, + # In pre-order purchase transactions, the expected date that the merchandise will + # be available. Maps to EMV 3DS field `preOrderDate`. Permitted values: Date + # string in the ISO 8601 format yyyy-MM-dd'T'hh:mm:ssZ + pre_order_available_date: nil, + # Indicates whether the cardholder is reordering previously purchased merchandise. + # Maps to EMV 3DS field `reorderItemsInd`. + reorder_items: nil, + # Shipping method that the cardholder chose for the transaction. If purchase + # includes one or more item, this indicator is used for the physical goods; if the + # purchase only includes digital goods, this indicator is used to describe the + # most expensive item purchased. Maps to EMV 3DS field `shipIndicator`. + shipping_method: nil + ) + end + + sig do + override.returns( + { + delivery_email_address: T.nilable(String), + delivery_time_frame: + T.nilable( + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::DeliveryTimeFrame::TaggedSymbol + ), + gift_card_amount: T.nilable(Integer), + gift_card_count: T.nilable(Integer), + gift_card_currency: T.nilable(String), + order_availability: + T.nilable( + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::OrderAvailability::TaggedSymbol + ), + pre_order_available_date: T.nilable(Time), + reorder_items: + T.nilable( + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::ReorderItems::TaggedSymbol + ), + shipping_method: + T.nilable( + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::ShippingMethod::TaggedSymbol + ) + } + ) + end + def to_hash + end + + # The delivery time frame for the merchandise. Maps to EMV 3DS field + # `deliveryTimeframe`. + module DeliveryTimeFrame + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::DeliveryTimeFrame + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ELECTRONIC_DELIVERY = + T.let( + :ELECTRONIC_DELIVERY, + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::DeliveryTimeFrame::TaggedSymbol + ) + OVERNIGHT_SHIPPING = + T.let( + :OVERNIGHT_SHIPPING, + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::DeliveryTimeFrame::TaggedSymbol + ) + SAME_DAY_SHIPPING = + T.let( + :SAME_DAY_SHIPPING, + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::DeliveryTimeFrame::TaggedSymbol + ) + TWO_DAY_OR_MORE_SHIPPING = + T.let( + :TWO_DAY_OR_MORE_SHIPPING, + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::DeliveryTimeFrame::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::DeliveryTimeFrame::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Indicates whether the purchase is for merchandise that is available now or at a + # future date. Maps to EMV 3DS field `preOrderPurchaseInd`. + module OrderAvailability + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::OrderAvailability + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FUTURE_AVAILABILITY = + T.let( + :FUTURE_AVAILABILITY, + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::OrderAvailability::TaggedSymbol + ) + MERCHANDISE_AVAILABLE = + T.let( + :MERCHANDISE_AVAILABLE, + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::OrderAvailability::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::OrderAvailability::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Indicates whether the cardholder is reordering previously purchased merchandise. + # Maps to EMV 3DS field `reorderItemsInd`. + module ReorderItems + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::ReorderItems + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FIRST_TIME_ORDERED = + T.let( + :FIRST_TIME_ORDERED, + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::ReorderItems::TaggedSymbol + ) + REORDERED = + T.let( + :REORDERED, + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::ReorderItems::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::ReorderItems::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Shipping method that the cardholder chose for the transaction. If purchase + # includes one or more item, this indicator is used for the physical goods; if the + # purchase only includes digital goods, this indicator is used to describe the + # most expensive item purchased. Maps to EMV 3DS field `shipIndicator`. + module ShippingMethod + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::ShippingMethod + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DIGITAL_GOODS = + T.let( + :DIGITAL_GOODS, + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::ShippingMethod::TaggedSymbol + ) + LOCKER_DELIVERY = + T.let( + :LOCKER_DELIVERY, + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::ShippingMethod::TaggedSymbol + ) + OTHER = + T.let( + :OTHER, + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::ShippingMethod::TaggedSymbol + ) + PICK_UP_AND_GO_DELIVERY = + T.let( + :PICK_UP_AND_GO_DELIVERY, + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::ShippingMethod::TaggedSymbol + ) + SHIP_TO_BILLING_ADDRESS = + T.let( + :SHIP_TO_BILLING_ADDRESS, + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::ShippingMethod::TaggedSymbol + ) + SHIP_TO_NON_BILLING_ADDRESS = + T.let( + :SHIP_TO_NON_BILLING_ADDRESS, + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::ShippingMethod::TaggedSymbol + ) + SHIP_TO_OTHER_VERIFIED_ADDRESS = + T.let( + :SHIP_TO_OTHER_VERIFIED_ADDRESS, + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::ShippingMethod::TaggedSymbol + ) + SHIP_TO_STORE = + T.let( + :SHIP_TO_STORE, + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::ShippingMethod::TaggedSymbol + ) + TRAVEL_AND_EVENT_TICKETS = + T.let( + :TRAVEL_AND_EVENT_TICKETS, + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::ShippingMethod::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ThreeDSAuthentication::Merchant::RiskIndicator::ShippingMethod::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + + # Either PAYMENT_AUTHENTICATION or NON_PAYMENT_AUTHENTICATION. For + # NON_PAYMENT_AUTHENTICATION, additional_data and transaction fields are not + # populated. + module MessageCategory + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ThreeDSAuthentication::MessageCategory) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NON_PAYMENT_AUTHENTICATION = + T.let( + :NON_PAYMENT_AUTHENTICATION, + Lithic::ThreeDSAuthentication::MessageCategory::TaggedSymbol + ) + PAYMENT_AUTHENTICATION = + T.let( + :PAYMENT_AUTHENTICATION, + Lithic::ThreeDSAuthentication::MessageCategory::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ThreeDSAuthentication::MessageCategory::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Indicates whether a challenge is requested for this transaction + # + # - `NO_PREFERENCE` - No Preference + # - `NO_CHALLENGE_REQUESTED` - No Challenge Requested + # - `CHALLENGE_PREFERENCE` - Challenge requested (3DS Requestor preference) + # - `CHALLENGE_MANDATE` - Challenge requested (Mandate) + # - `NO_CHALLENGE_RISK_ALREADY_ASSESSED` - No Challenge requested (Transactional + # risk analysis is already performed) + # - `DATA_SHARE_ONLY` - No Challenge requested (Data Share Only) + # - `OTHER` - Other indicators not captured by above. These are rarely used + module ThreeDSRequestorChallengeIndicator + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::ThreeDSAuthentication::ThreeDSRequestorChallengeIndicator + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NO_PREFERENCE = + T.let( + :NO_PREFERENCE, + Lithic::ThreeDSAuthentication::ThreeDSRequestorChallengeIndicator::TaggedSymbol + ) + NO_CHALLENGE_REQUESTED = + T.let( + :NO_CHALLENGE_REQUESTED, + Lithic::ThreeDSAuthentication::ThreeDSRequestorChallengeIndicator::TaggedSymbol + ) + CHALLENGE_PREFERENCE = + T.let( + :CHALLENGE_PREFERENCE, + Lithic::ThreeDSAuthentication::ThreeDSRequestorChallengeIndicator::TaggedSymbol + ) + CHALLENGE_MANDATE = + T.let( + :CHALLENGE_MANDATE, + Lithic::ThreeDSAuthentication::ThreeDSRequestorChallengeIndicator::TaggedSymbol + ) + NO_CHALLENGE_RISK_ALREADY_ASSESSED = + T.let( + :NO_CHALLENGE_RISK_ALREADY_ASSESSED, + Lithic::ThreeDSAuthentication::ThreeDSRequestorChallengeIndicator::TaggedSymbol + ) + DATA_SHARE_ONLY = + T.let( + :DATA_SHARE_ONLY, + Lithic::ThreeDSAuthentication::ThreeDSRequestorChallengeIndicator::TaggedSymbol + ) + OTHER = + T.let( + :OTHER, + Lithic::ThreeDSAuthentication::ThreeDSRequestorChallengeIndicator::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ThreeDSAuthentication::ThreeDSRequestorChallengeIndicator::TaggedSymbol + ] + ) + end + def self.values + end + end + + class AdditionalData < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ThreeDSAuthentication::AdditionalData, + Lithic::Internal::AnyHash + ) + end + + # Mastercard only: Indicates whether the network would have considered the + # authentication request to be low risk or not. + sig do + returns( + T.nilable( + Lithic::ThreeDSAuthentication::AdditionalData::NetworkDecision::TaggedSymbol + ) + ) + end + attr_accessor :network_decision + + # Mastercard only: Assessment by the network of the authentication risk level, + # with a higher value indicating a higher amount of risk. Permitted values: + # Integer between 0-950, in increments of 50. + sig { returns(T.nilable(Integer)) } + attr_accessor :network_risk_score + + # Object containing additional data about the 3DS request that is beyond the EMV + # 3DS standard spec (e.g., specific fields that only certain card networks send + # but are not required across all 3DS requests). + sig do + params( + network_decision: + T.nilable( + Lithic::ThreeDSAuthentication::AdditionalData::NetworkDecision::OrSymbol + ), + network_risk_score: T.nilable(Integer) + ).returns(T.attached_class) + end + def self.new( + # Mastercard only: Indicates whether the network would have considered the + # authentication request to be low risk or not. + network_decision: nil, + # Mastercard only: Assessment by the network of the authentication risk level, + # with a higher value indicating a higher amount of risk. Permitted values: + # Integer between 0-950, in increments of 50. + network_risk_score: nil + ) + end + + sig do + override.returns( + { + network_decision: + T.nilable( + Lithic::ThreeDSAuthentication::AdditionalData::NetworkDecision::TaggedSymbol + ), + network_risk_score: T.nilable(Integer) + } + ) + end + def to_hash + end + + # Mastercard only: Indicates whether the network would have considered the + # authentication request to be low risk or not. + module NetworkDecision + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::ThreeDSAuthentication::AdditionalData::NetworkDecision + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LOW_RISK = + T.let( + :LOW_RISK, + Lithic::ThreeDSAuthentication::AdditionalData::NetworkDecision::TaggedSymbol + ) + NOT_LOW_RISK = + T.let( + :NOT_LOW_RISK, + Lithic::ThreeDSAuthentication::AdditionalData::NetworkDecision::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ThreeDSAuthentication::AdditionalData::NetworkDecision::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class App < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::ThreeDSAuthentication::App, Lithic::Internal::AnyHash) + end + + # Device model: e.g. "Apple iPhone 16". + sig { returns(T.nilable(String)) } + attr_accessor :device + + # Raw device information - base64-encoded JSON object. Maps to EMV 3DS field + # `deviceInfo`. + sig { returns(T.nilable(String)) } + attr_accessor :device_info + + # IP address of the device. + sig { returns(T.nilable(String)) } + attr_reader :ip + + sig { params(ip: String).void } + attr_writer :ip + + # Latitude coordinate of current device location. + sig { returns(T.nilable(Float)) } + attr_accessor :latitude + + # Device locale: e.g. "en-US". + sig { returns(T.nilable(String)) } + attr_accessor :locale + + # Longitude coordinate of current device location. + sig { returns(T.nilable(Float)) } + attr_accessor :longitude + + # Operating System: e.g. "Android 12", "iOS 17.1". + sig { returns(T.nilable(String)) } + attr_accessor :os + + # Device platform: Android, iOS, Windows, etc. + sig { returns(T.nilable(String)) } + attr_accessor :platform + + # Screen height in pixels. + sig { returns(T.nilable(Integer)) } + attr_accessor :screen_height + + # Screen width in pixels. + sig { returns(T.nilable(Integer)) } + attr_accessor :screen_width + + # Time zone offset in minutes between UTC and device local time. + sig { returns(T.nilable(String)) } + attr_accessor :time_zone + + # Object containing data about the app used in the e-commerce transaction. Present + # if the channel is 'APP_BASED'. + sig do + params( + device: T.nilable(String), + device_info: T.nilable(String), + ip: String, + latitude: T.nilable(Float), + locale: T.nilable(String), + longitude: T.nilable(Float), + os: T.nilable(String), + platform: T.nilable(String), + screen_height: T.nilable(Integer), + screen_width: T.nilable(Integer), + time_zone: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Device model: e.g. "Apple iPhone 16". + device: nil, + # Raw device information - base64-encoded JSON object. Maps to EMV 3DS field + # `deviceInfo`. + device_info: nil, + # IP address of the device. + ip: nil, + # Latitude coordinate of current device location. + latitude: nil, + # Device locale: e.g. "en-US". + locale: nil, + # Longitude coordinate of current device location. + longitude: nil, + # Operating System: e.g. "Android 12", "iOS 17.1". + os: nil, + # Device platform: Android, iOS, Windows, etc. + platform: nil, + # Screen height in pixels. + screen_height: nil, + # Screen width in pixels. + screen_width: nil, + # Time zone offset in minutes between UTC and device local time. + time_zone: nil + ) + end + + sig do + override.returns( + { + device: T.nilable(String), + device_info: T.nilable(String), + ip: String, + latitude: T.nilable(Float), + locale: T.nilable(String), + longitude: T.nilable(Float), + os: T.nilable(String), + platform: T.nilable(String), + screen_height: T.nilable(Integer), + screen_width: T.nilable(Integer), + time_zone: T.nilable(String) + } + ) + end + def to_hash + end + end + + # Type of authentication request - i.e., the type of transaction or interaction is + # causing the merchant to request an authentication. Maps to EMV 3DS field + # `threeDSRequestorAuthenticationInd`. + module AuthenticationRequestType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::ThreeDSAuthentication::AuthenticationRequestType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ADD_CARD = + T.let( + :ADD_CARD, + Lithic::ThreeDSAuthentication::AuthenticationRequestType::TaggedSymbol + ) + BILLING_AGREEMENT = + T.let( + :BILLING_AGREEMENT, + Lithic::ThreeDSAuthentication::AuthenticationRequestType::TaggedSymbol + ) + DELAYED_SHIPMENT = + T.let( + :DELAYED_SHIPMENT, + Lithic::ThreeDSAuthentication::AuthenticationRequestType::TaggedSymbol + ) + EMV_TOKEN_CARDHOLDER_VERIFICATION = + T.let( + :EMV_TOKEN_CARDHOLDER_VERIFICATION, + Lithic::ThreeDSAuthentication::AuthenticationRequestType::TaggedSymbol + ) + INSTALLMENT_TRANSACTION = + T.let( + :INSTALLMENT_TRANSACTION, + Lithic::ThreeDSAuthentication::AuthenticationRequestType::TaggedSymbol + ) + MAINTAIN_CARD = + T.let( + :MAINTAIN_CARD, + Lithic::ThreeDSAuthentication::AuthenticationRequestType::TaggedSymbol + ) + PAYMENT_TRANSACTION = + T.let( + :PAYMENT_TRANSACTION, + Lithic::ThreeDSAuthentication::AuthenticationRequestType::TaggedSymbol + ) + RECURRING_TRANSACTION = + T.let( + :RECURRING_TRANSACTION, + Lithic::ThreeDSAuthentication::AuthenticationRequestType::TaggedSymbol + ) + SPLIT_PAYMENT = + T.let( + :SPLIT_PAYMENT, + Lithic::ThreeDSAuthentication::AuthenticationRequestType::TaggedSymbol + ) + SPLIT_SHIPMENT = + T.let( + :SPLIT_SHIPMENT, + Lithic::ThreeDSAuthentication::AuthenticationRequestType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ThreeDSAuthentication::AuthenticationRequestType::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Browser < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ThreeDSAuthentication::Browser, + Lithic::Internal::AnyHash + ) + end + + # Content of the HTTP accept headers as sent from the cardholder's browser to the + # 3DS requestor (e.g., merchant or digital wallet). + sig { returns(T.nilable(String)) } + attr_accessor :accept_header + + # IP address of the browser as returned by the HTTP headers to the 3DS requestor + # (e.g., merchant or digital wallet). Maps to EMV 3DS field `browserIP`. + sig { returns(T.nilable(String)) } + attr_accessor :ip + + # Indicates whether the cardholder's browser has the ability to execute Java. Maps + # to EMV 3DS field `browserJavaEnabled`. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :java_enabled + + # Indicates whether the cardholder's browser has the ability to execute + # JavaScript. Maps to EMV 3DS field `browserJavascriptEnabled`. + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :javascript_enabled + + # Language of the cardholder's browser as defined in IETF BCP47. Maps to EMV 3DS + # field `browserLanguage`. + sig { returns(T.nilable(String)) } + attr_accessor :language + + # Time zone offset in minutes between UTC and browser local time. Maps to EMV 3DS + # field `browserTz`. + sig { returns(T.nilable(String)) } + attr_accessor :time_zone + + # Content of the HTTP user-agent header. Maps to EMV 3DS field `browserUserAgent`. + sig { returns(T.nilable(String)) } + attr_accessor :user_agent + + # Object containing data about the browser used in the e-commerce transaction. + # Present if the channel is 'BROWSER'. + sig do + params( + accept_header: T.nilable(String), + ip: T.nilable(String), + java_enabled: T.nilable(T::Boolean), + javascript_enabled: T.nilable(T::Boolean), + language: T.nilable(String), + time_zone: T.nilable(String), + user_agent: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Content of the HTTP accept headers as sent from the cardholder's browser to the + # 3DS requestor (e.g., merchant or digital wallet). + accept_header: nil, + # IP address of the browser as returned by the HTTP headers to the 3DS requestor + # (e.g., merchant or digital wallet). Maps to EMV 3DS field `browserIP`. + ip: nil, + # Indicates whether the cardholder's browser has the ability to execute Java. Maps + # to EMV 3DS field `browserJavaEnabled`. + java_enabled: nil, + # Indicates whether the cardholder's browser has the ability to execute + # JavaScript. Maps to EMV 3DS field `browserJavascriptEnabled`. + javascript_enabled: nil, + # Language of the cardholder's browser as defined in IETF BCP47. Maps to EMV 3DS + # field `browserLanguage`. + language: nil, + # Time zone offset in minutes between UTC and browser local time. Maps to EMV 3DS + # field `browserTz`. + time_zone: nil, + # Content of the HTTP user-agent header. Maps to EMV 3DS field `browserUserAgent`. + user_agent: nil + ) + end + + sig do + override.returns( + { + accept_header: T.nilable(String), + ip: T.nilable(String), + java_enabled: T.nilable(T::Boolean), + javascript_enabled: T.nilable(T::Boolean), + language: T.nilable(String), + time_zone: T.nilable(String), + user_agent: T.nilable(String) + } + ) + end + def to_hash + end + end + + class ChallengeMetadata < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ThreeDSAuthentication::ChallengeMetadata, + Lithic::Internal::AnyHash + ) + end + + # The type of challenge method used for authentication. + sig do + returns( + Lithic::ThreeDSAuthentication::ChallengeMetadata::MethodType::TaggedSymbol + ) + end + attr_accessor :method_type + + # Indicates the status of the challenge + # + # - SUCCESS - Cardholder completed the challenge successfully + # - PENDING - Challenge was issued to the cardholder and was not completed yet + # - SMS_DELIVERY_FAILED - Lithic confirmed undeliverability of the SMS to the + # provided phone number. Relevant only for SMS_OTP method + # - CARDHOLDER_TIMEOUT - Cardholder failed to complete the challenge within the + # given challenge TTL + # - CANCELED_VIA_CHALLENGE_UI - Cardholder canceled the challenge by selecting + # "cancel" on the challenge UI + # - CANCELED_OOB - Cardholder canceled the challenge out of band + # - ATTEMPTS_EXCEEDED - Cardholder failed the challenge by either entering an + # incorrect OTP more than the allowed number of times or requesting a new OTP + # more than the allowed number of times + # - ABORTED - Merchant aborted authentication after a challenge was requested + # - ERROR - The challenge failed for a reason different than those documented + sig do + returns( + Lithic::ThreeDSAuthentication::ChallengeMetadata::Status::TaggedSymbol + ) + end + attr_accessor :status + + # The phone number used for delivering the OTP. Relevant only for SMS_OTP method. + sig { returns(T.nilable(String)) } + attr_accessor :phone_number + + # Metadata about the challenge method and delivery. Only present when a challenge + # is triggered. + sig do + params( + method_type: + Lithic::ThreeDSAuthentication::ChallengeMetadata::MethodType::OrSymbol, + status: + Lithic::ThreeDSAuthentication::ChallengeMetadata::Status::OrSymbol, + phone_number: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The type of challenge method used for authentication. + method_type:, + # Indicates the status of the challenge + # + # - SUCCESS - Cardholder completed the challenge successfully + # - PENDING - Challenge was issued to the cardholder and was not completed yet + # - SMS_DELIVERY_FAILED - Lithic confirmed undeliverability of the SMS to the + # provided phone number. Relevant only for SMS_OTP method + # - CARDHOLDER_TIMEOUT - Cardholder failed to complete the challenge within the + # given challenge TTL + # - CANCELED_VIA_CHALLENGE_UI - Cardholder canceled the challenge by selecting + # "cancel" on the challenge UI + # - CANCELED_OOB - Cardholder canceled the challenge out of band + # - ATTEMPTS_EXCEEDED - Cardholder failed the challenge by either entering an + # incorrect OTP more than the allowed number of times or requesting a new OTP + # more than the allowed number of times + # - ABORTED - Merchant aborted authentication after a challenge was requested + # - ERROR - The challenge failed for a reason different than those documented + status:, + # The phone number used for delivering the OTP. Relevant only for SMS_OTP method. + phone_number: nil + ) + end + + sig do + override.returns( + { + method_type: + Lithic::ThreeDSAuthentication::ChallengeMetadata::MethodType::TaggedSymbol, + status: + Lithic::ThreeDSAuthentication::ChallengeMetadata::Status::TaggedSymbol, + phone_number: T.nilable(String) + } + ) + end + def to_hash + end + + # The type of challenge method used for authentication. + module MethodType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::ThreeDSAuthentication::ChallengeMetadata::MethodType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SMS_OTP = + T.let( + :SMS_OTP, + Lithic::ThreeDSAuthentication::ChallengeMetadata::MethodType::TaggedSymbol + ) + OUT_OF_BAND = + T.let( + :OUT_OF_BAND, + Lithic::ThreeDSAuthentication::ChallengeMetadata::MethodType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ThreeDSAuthentication::ChallengeMetadata::MethodType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Indicates the status of the challenge + # + # - SUCCESS - Cardholder completed the challenge successfully + # - PENDING - Challenge was issued to the cardholder and was not completed yet + # - SMS_DELIVERY_FAILED - Lithic confirmed undeliverability of the SMS to the + # provided phone number. Relevant only for SMS_OTP method + # - CARDHOLDER_TIMEOUT - Cardholder failed to complete the challenge within the + # given challenge TTL + # - CANCELED_VIA_CHALLENGE_UI - Cardholder canceled the challenge by selecting + # "cancel" on the challenge UI + # - CANCELED_OOB - Cardholder canceled the challenge out of band + # - ATTEMPTS_EXCEEDED - Cardholder failed the challenge by either entering an + # incorrect OTP more than the allowed number of times or requesting a new OTP + # more than the allowed number of times + # - ABORTED - Merchant aborted authentication after a challenge was requested + # - ERROR - The challenge failed for a reason different than those documented + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::ThreeDSAuthentication::ChallengeMetadata::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SUCCESS = + T.let( + :SUCCESS, + Lithic::ThreeDSAuthentication::ChallengeMetadata::Status::TaggedSymbol + ) + PENDING = + T.let( + :PENDING, + Lithic::ThreeDSAuthentication::ChallengeMetadata::Status::TaggedSymbol + ) + SMS_DELIVERY_FAILED = + T.let( + :SMS_DELIVERY_FAILED, + Lithic::ThreeDSAuthentication::ChallengeMetadata::Status::TaggedSymbol + ) + CARDHOLDER_TIMEOUT = + T.let( + :CARDHOLDER_TIMEOUT, + Lithic::ThreeDSAuthentication::ChallengeMetadata::Status::TaggedSymbol + ) + CANCELED_VIA_CHALLENGE_UI = + T.let( + :CANCELED_VIA_CHALLENGE_UI, + Lithic::ThreeDSAuthentication::ChallengeMetadata::Status::TaggedSymbol + ) + CANCELED_OOB = + T.let( + :CANCELED_OOB, + Lithic::ThreeDSAuthentication::ChallengeMetadata::Status::TaggedSymbol + ) + ATTEMPTS_EXCEEDED = + T.let( + :ATTEMPTS_EXCEEDED, + Lithic::ThreeDSAuthentication::ChallengeMetadata::Status::TaggedSymbol + ) + ABORTED = + T.let( + :ABORTED, + Lithic::ThreeDSAuthentication::ChallengeMetadata::Status::TaggedSymbol + ) + ERROR = + T.let( + :ERROR, + Lithic::ThreeDSAuthentication::ChallengeMetadata::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ThreeDSAuthentication::ChallengeMetadata::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + # Entity that orchestrates the challenge. This won't be set for authentications + # for which a decision has not yet been made (e.g. in-flight customer decisioning + # request). + module ChallengeOrchestratedBy + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::ThreeDSAuthentication::ChallengeOrchestratedBy + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LITHIC = + T.let( + :LITHIC, + Lithic::ThreeDSAuthentication::ChallengeOrchestratedBy::TaggedSymbol + ) + CUSTOMER = + T.let( + :CUSTOMER, + Lithic::ThreeDSAuthentication::ChallengeOrchestratedBy::TaggedSymbol + ) + NO_CHALLENGE = + T.let( + :NO_CHALLENGE, + Lithic::ThreeDSAuthentication::ChallengeOrchestratedBy::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ThreeDSAuthentication::ChallengeOrchestratedBy::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Entity that made the authentication decision. This won't be set for + # authentications for which a decision has not yet been made (e.g. in-flight + # customer decisioning request). + module DecisionMadeBy + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ThreeDSAuthentication::DecisionMadeBy) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LITHIC_RULES = + T.let( + :LITHIC_RULES, + Lithic::ThreeDSAuthentication::DecisionMadeBy::TaggedSymbol + ) + LITHIC_DEFAULT = + T.let( + :LITHIC_DEFAULT, + Lithic::ThreeDSAuthentication::DecisionMadeBy::TaggedSymbol + ) + CUSTOMER_RULES = + T.let( + :CUSTOMER_RULES, + Lithic::ThreeDSAuthentication::DecisionMadeBy::TaggedSymbol + ) + CUSTOMER_ENDPOINT = + T.let( + :CUSTOMER_ENDPOINT, + Lithic::ThreeDSAuthentication::DecisionMadeBy::TaggedSymbol + ) + NETWORK = + T.let( + :NETWORK, + Lithic::ThreeDSAuthentication::DecisionMadeBy::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::ThreeDSAuthentication::DecisionMadeBy::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ThreeDSAuthentication::DecisionMadeBy::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Type of 3DS Requestor Initiated (3RI) request — i.e., a 3DS authentication that + # takes place at the initiation of the merchant rather than the cardholder. The + # most common example of this is where a merchant is authenticating before billing + # for a recurring transaction such as a pay TV subscription or a utility bill. + # Maps to EMV 3DS field `threeRIInd`. + module ThreeRiRequestType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ThreeDSAuthentication::ThreeRiRequestType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_VERIFICATION = + T.let( + :ACCOUNT_VERIFICATION, + Lithic::ThreeDSAuthentication::ThreeRiRequestType::TaggedSymbol + ) + ADD_CARD = + T.let( + :ADD_CARD, + Lithic::ThreeDSAuthentication::ThreeRiRequestType::TaggedSymbol + ) + BILLING_AGREEMENT = + T.let( + :BILLING_AGREEMENT, + Lithic::ThreeDSAuthentication::ThreeRiRequestType::TaggedSymbol + ) + CARD_SECURITY_CODE_STATUS_CHECK = + T.let( + :CARD_SECURITY_CODE_STATUS_CHECK, + Lithic::ThreeDSAuthentication::ThreeRiRequestType::TaggedSymbol + ) + DELAYED_SHIPMENT = + T.let( + :DELAYED_SHIPMENT, + Lithic::ThreeDSAuthentication::ThreeRiRequestType::TaggedSymbol + ) + DEVICE_BINDING_STATUS_CHECK = + T.let( + :DEVICE_BINDING_STATUS_CHECK, + Lithic::ThreeDSAuthentication::ThreeRiRequestType::TaggedSymbol + ) + INSTALLMENT_TRANSACTION = + T.let( + :INSTALLMENT_TRANSACTION, + Lithic::ThreeDSAuthentication::ThreeRiRequestType::TaggedSymbol + ) + MAIL_ORDER = + T.let( + :MAIL_ORDER, + Lithic::ThreeDSAuthentication::ThreeRiRequestType::TaggedSymbol + ) + MAINTAIN_CARD_INFO = + T.let( + :MAINTAIN_CARD_INFO, + Lithic::ThreeDSAuthentication::ThreeRiRequestType::TaggedSymbol + ) + OTHER_PAYMENT = + T.let( + :OTHER_PAYMENT, + Lithic::ThreeDSAuthentication::ThreeRiRequestType::TaggedSymbol + ) + RECURRING_TRANSACTION = + T.let( + :RECURRING_TRANSACTION, + Lithic::ThreeDSAuthentication::ThreeRiRequestType::TaggedSymbol + ) + SPLIT_PAYMENT = + T.let( + :SPLIT_PAYMENT, + Lithic::ThreeDSAuthentication::ThreeRiRequestType::TaggedSymbol + ) + SPLIT_SHIPMENT = + T.let( + :SPLIT_SHIPMENT, + Lithic::ThreeDSAuthentication::ThreeRiRequestType::TaggedSymbol + ) + TELEPHONE_ORDER = + T.let( + :TELEPHONE_ORDER, + Lithic::ThreeDSAuthentication::ThreeRiRequestType::TaggedSymbol + ) + TOP_UP = + T.let( + :TOP_UP, + Lithic::ThreeDSAuthentication::ThreeRiRequestType::TaggedSymbol + ) + TRUST_LIST_STATUS_CHECK = + T.let( + :TRUST_LIST_STATUS_CHECK, + Lithic::ThreeDSAuthentication::ThreeRiRequestType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ThreeDSAuthentication::ThreeRiRequestType::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Transaction < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ThreeDSAuthentication::Transaction, + Lithic::Internal::AnyHash + ) + end + + # Amount of the purchase in minor units of currency with all punctuation removed. + # Maps to EMV 3DS field `purchaseAmount`. + sig { returns(Float) } + attr_accessor :amount + + # Approximate amount of the purchase in minor units of cardholder currency. + # Derived from `amount` using a daily conversion rate. + sig { returns(T.nilable(Float)) } + attr_accessor :cardholder_amount + + # Currency of the purchase. Maps to EMV 3DS field `purchaseCurrency`. Permitted + # values: ISO 4217 three-character currency code (e.g., USD). + sig { returns(String) } + attr_accessor :currency + + # Minor units of currency, as specified in ISO 4217 currency exponent. Maps to EMV + # 3DS field `purchaseExponent`. + sig { returns(Float) } + attr_accessor :currency_exponent + + # Date and time when the authentication was generated by the merchant/acquirer's + # 3DS server. Maps to EMV 3DS field `purchaseDate`. Permitted values: Date string + # in the ISO 8601 format yyyy-MM-dd'T'hh:mm:ssZ. + sig { returns(Time) } + attr_accessor :date_time + + # Type of the transaction for which a 3DS authentication request is occurring. + # Maps to EMV 3DS field `transType`. + sig do + returns( + T.nilable( + Lithic::ThreeDSAuthentication::Transaction::Type::TaggedSymbol + ) + ) + end + attr_accessor :type + + # Object containing data about the e-commerce transaction for which the merchant + # is requesting authentication. + sig do + params( + amount: Float, + cardholder_amount: T.nilable(Float), + currency: String, + currency_exponent: Float, + date_time: Time, + type: + T.nilable( + Lithic::ThreeDSAuthentication::Transaction::Type::OrSymbol + ) + ).returns(T.attached_class) + end + def self.new( + # Amount of the purchase in minor units of currency with all punctuation removed. + # Maps to EMV 3DS field `purchaseAmount`. + amount:, + # Approximate amount of the purchase in minor units of cardholder currency. + # Derived from `amount` using a daily conversion rate. + cardholder_amount:, + # Currency of the purchase. Maps to EMV 3DS field `purchaseCurrency`. Permitted + # values: ISO 4217 three-character currency code (e.g., USD). + currency:, + # Minor units of currency, as specified in ISO 4217 currency exponent. Maps to EMV + # 3DS field `purchaseExponent`. + currency_exponent:, + # Date and time when the authentication was generated by the merchant/acquirer's + # 3DS server. Maps to EMV 3DS field `purchaseDate`. Permitted values: Date string + # in the ISO 8601 format yyyy-MM-dd'T'hh:mm:ssZ. + date_time:, + # Type of the transaction for which a 3DS authentication request is occurring. + # Maps to EMV 3DS field `transType`. + type: + ) + end + + sig do + override.returns( + { + amount: Float, + cardholder_amount: T.nilable(Float), + currency: String, + currency_exponent: Float, + date_time: Time, + type: + T.nilable( + Lithic::ThreeDSAuthentication::Transaction::Type::TaggedSymbol + ) + } + ) + end + def to_hash + end + + # Type of the transaction for which a 3DS authentication request is occurring. + # Maps to EMV 3DS field `transType`. + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::ThreeDSAuthentication::Transaction::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_FUNDING = + T.let( + :ACCOUNT_FUNDING, + Lithic::ThreeDSAuthentication::Transaction::Type::TaggedSymbol + ) + CHECK_ACCEPTANCE = + T.let( + :CHECK_ACCEPTANCE, + Lithic::ThreeDSAuthentication::Transaction::Type::TaggedSymbol + ) + GOODS_SERVICE_PURCHASE = + T.let( + :GOODS_SERVICE_PURCHASE, + Lithic::ThreeDSAuthentication::Transaction::Type::TaggedSymbol + ) + PREPAID_ACTIVATION_AND_LOAD = + T.let( + :PREPAID_ACTIVATION_AND_LOAD, + Lithic::ThreeDSAuthentication::Transaction::Type::TaggedSymbol + ) + QUASI_CASH_TRANSACTION = + T.let( + :QUASI_CASH_TRANSACTION, + Lithic::ThreeDSAuthentication::Transaction::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ThreeDSAuthentication::Transaction::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/three_ds_authentication_approval_request_webhook_event.rbi b/rbi/lithic/models/three_ds_authentication_approval_request_webhook_event.rbi new file mode 100644 index 00000000..b64ca923 --- /dev/null +++ b/rbi/lithic/models/three_ds_authentication_approval_request_webhook_event.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Lithic + module Models + class ThreeDSAuthenticationApprovalRequestWebhookEvent < Lithic::Models::ThreeDSAuthentication + OrHash = + T.type_alias do + T.any( + Lithic::ThreeDSAuthenticationApprovalRequestWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Symbol) } + attr_accessor :event_type + + # Represents a 3DS authentication + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new(event_type: :"three_ds_authentication.approval_request") + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/three_ds_authentication_challenge_webhook_event.rbi b/rbi/lithic/models/three_ds_authentication_challenge_webhook_event.rbi new file mode 100644 index 00000000..48c3b5e9 --- /dev/null +++ b/rbi/lithic/models/three_ds_authentication_challenge_webhook_event.rbi @@ -0,0 +1,175 @@ +# typed: strong + +module Lithic + module Models + class ThreeDSAuthenticationChallengeWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ThreeDSAuthenticationChallengeWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # Represents a 3DS authentication + sig { returns(Lithic::ThreeDSAuthentication) } + attr_reader :authentication_object + + sig do + params( + authentication_object: Lithic::ThreeDSAuthentication::OrHash + ).void + end + attr_writer :authentication_object + + # Represents a challenge object for 3DS authentication + sig do + returns(Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge) + end + attr_reader :challenge + + sig do + params( + challenge: + Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::OrHash + ).void + end + attr_writer :challenge + + sig { returns(Symbol) } + attr_accessor :event_type + + sig do + params( + authentication_object: Lithic::ThreeDSAuthentication::OrHash, + challenge: + Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::OrHash, + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Represents a 3DS authentication + authentication_object:, + # Represents a challenge object for 3DS authentication + challenge:, + event_type: :"three_ds_authentication.challenge" + ) + end + + sig do + override.returns( + { + authentication_object: Lithic::ThreeDSAuthentication, + challenge: + Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge, + event_type: Symbol + } + ) + end + def to_hash + end + + class Challenge < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge, + Lithic::Internal::AnyHash + ) + end + + # The type of challenge method issued to the cardholder + sig do + returns( + Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::ChallengeMethodType::TaggedSymbol + ) + end + attr_accessor :challenge_method_type + + # ISO-8601 time at which the challenge expires + sig { returns(Time) } + attr_accessor :expiry_time + + # ISO-8601 time at which the challenge has started + sig { returns(Time) } + attr_accessor :start_time + + # Fully qualified app URL of the merchant app. This should be used to redirect the + # cardholder back to the merchant app after completing an app-based challenge. + # This URL will only be populated if the 3DS Requestor App is provided to the 3DS + # SDK. + sig { returns(T.nilable(String)) } + attr_accessor :app_requestor_url + + # Represents a challenge object for 3DS authentication + sig do + params( + challenge_method_type: + Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::ChallengeMethodType::OrSymbol, + expiry_time: Time, + start_time: Time, + app_requestor_url: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The type of challenge method issued to the cardholder + challenge_method_type:, + # ISO-8601 time at which the challenge expires + expiry_time:, + # ISO-8601 time at which the challenge has started + start_time:, + # Fully qualified app URL of the merchant app. This should be used to redirect the + # cardholder back to the merchant app after completing an app-based challenge. + # This URL will only be populated if the 3DS Requestor App is provided to the 3DS + # SDK. + app_requestor_url: nil + ) + end + + sig do + override.returns( + { + challenge_method_type: + Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::ChallengeMethodType::TaggedSymbol, + expiry_time: Time, + start_time: Time, + app_requestor_url: T.nilable(String) + } + ) + end + def to_hash + end + + # The type of challenge method issued to the cardholder + module ChallengeMethodType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::ChallengeMethodType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + OUT_OF_BAND = + T.let( + :OUT_OF_BAND, + Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::ChallengeMethodType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::ChallengeMethodType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/three_ds_authentication_created_webhook_event.rbi b/rbi/lithic/models/three_ds_authentication_created_webhook_event.rbi new file mode 100644 index 00000000..bdb5ff54 --- /dev/null +++ b/rbi/lithic/models/three_ds_authentication_created_webhook_event.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Lithic + module Models + class ThreeDSAuthenticationCreatedWebhookEvent < Lithic::Models::ThreeDSAuthentication + OrHash = + T.type_alias do + T.any( + Lithic::ThreeDSAuthenticationCreatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # Represents a 3DS authentication + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"three_ds_authentication.created" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/three_ds_authentication_updated_webhook_event.rbi b/rbi/lithic/models/three_ds_authentication_updated_webhook_event.rbi new file mode 100644 index 00000000..7de3e565 --- /dev/null +++ b/rbi/lithic/models/three_ds_authentication_updated_webhook_event.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Lithic + module Models + class ThreeDSAuthenticationUpdatedWebhookEvent < Lithic::Models::ThreeDSAuthentication + OrHash = + T.type_alias do + T.any( + Lithic::ThreeDSAuthenticationUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # Represents a 3DS authentication + sig { params(event_type: Symbol).returns(T.attached_class) } + def self.new( + # The type of event that occurred. + event_type: :"three_ds_authentication.updated" + ) + end + + sig { override.returns({ event_type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/token_info.rbi b/rbi/lithic/models/token_info.rbi new file mode 100644 index 00000000..76648070 --- /dev/null +++ b/rbi/lithic/models/token_info.rbi @@ -0,0 +1,70 @@ +# typed: strong + +module Lithic + module Models + class TokenInfo < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Lithic::TokenInfo, Lithic::Internal::AnyHash) } + + # The wallet_type field will indicate the source of the token. Possible token + # sources include digital wallets (Apple, Google, or Samsung Pay), merchant + # tokenization, and “other” sources like in-flight commerce. Masterpass is not + # currently supported and is included for future use. + sig { returns(Lithic::TokenInfo::WalletType::TaggedSymbol) } + attr_accessor :wallet_type + + sig do + params(wallet_type: Lithic::TokenInfo::WalletType::OrSymbol).returns( + T.attached_class + ) + end + def self.new( + # The wallet_type field will indicate the source of the token. Possible token + # sources include digital wallets (Apple, Google, or Samsung Pay), merchant + # tokenization, and “other” sources like in-flight commerce. Masterpass is not + # currently supported and is included for future use. + wallet_type: + ) + end + + sig do + override.returns( + { wallet_type: Lithic::TokenInfo::WalletType::TaggedSymbol } + ) + end + def to_hash + end + + # The wallet_type field will indicate the source of the token. Possible token + # sources include digital wallets (Apple, Google, or Samsung Pay), merchant + # tokenization, and “other” sources like in-flight commerce. Masterpass is not + # currently supported and is included for future use. + module WalletType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::TokenInfo::WalletType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPLE_PAY = + T.let(:APPLE_PAY, Lithic::TokenInfo::WalletType::TaggedSymbol) + GOOGLE_PAY = + T.let(:GOOGLE_PAY, Lithic::TokenInfo::WalletType::TaggedSymbol) + MASTERPASS = + T.let(:MASTERPASS, Lithic::TokenInfo::WalletType::TaggedSymbol) + MERCHANT = T.let(:MERCHANT, Lithic::TokenInfo::WalletType::TaggedSymbol) + OTHER = T.let(:OTHER, Lithic::TokenInfo::WalletType::TaggedSymbol) + SAMSUNG_PAY = + T.let(:SAMSUNG_PAY, Lithic::TokenInfo::WalletType::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::TokenInfo::WalletType::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/token_metadata.rbi b/rbi/lithic/models/token_metadata.rbi new file mode 100644 index 00000000..5a51b2bb --- /dev/null +++ b/rbi/lithic/models/token_metadata.rbi @@ -0,0 +1,283 @@ +# typed: strong + +module Lithic + module Models + class TokenMetadata < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Lithic::TokenMetadata, Lithic::Internal::AnyHash) } + + # Contains the information of the account responsible for the payment. + sig { returns(Lithic::TokenMetadata::PaymentAccountInfo) } + attr_reader :payment_account_info + + sig do + params( + payment_account_info: + Lithic::TokenMetadata::PaymentAccountInfo::OrHash + ).void + end + attr_writer :payment_account_info + + # The current status of the digital wallet token. Pending or declined. + sig { returns(String) } + attr_accessor :status + + # The identifier of the Payment App instance within a device that will be + # provisioned with a token + sig { returns(T.nilable(String)) } + attr_accessor :payment_app_instance_id + + # The party that requested the digitization + sig { returns(T.nilable(String)) } + attr_reader :token_requestor_id + + sig { params(token_requestor_id: String).void } + attr_writer :token_requestor_id + + # Human-readable name of the wallet that the token_requestor_id maps to. + sig do + returns( + T.nilable(Lithic::TokenMetadata::TokenRequestorName::TaggedSymbol) + ) + end + attr_reader :token_requestor_name + + sig do + params( + token_requestor_name: + Lithic::TokenMetadata::TokenRequestorName::OrSymbol + ).void + end + attr_writer :token_requestor_name + + # Contains the metadata for the digital wallet being tokenized. + sig do + params( + payment_account_info: + Lithic::TokenMetadata::PaymentAccountInfo::OrHash, + status: String, + payment_app_instance_id: T.nilable(String), + token_requestor_id: String, + token_requestor_name: + Lithic::TokenMetadata::TokenRequestorName::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Contains the information of the account responsible for the payment. + payment_account_info:, + # The current status of the digital wallet token. Pending or declined. + status:, + # The identifier of the Payment App instance within a device that will be + # provisioned with a token + payment_app_instance_id: nil, + # The party that requested the digitization + token_requestor_id: nil, + # Human-readable name of the wallet that the token_requestor_id maps to. + token_requestor_name: nil + ) + end + + sig do + override.returns( + { + payment_account_info: Lithic::TokenMetadata::PaymentAccountInfo, + status: String, + payment_app_instance_id: T.nilable(String), + token_requestor_id: String, + token_requestor_name: + Lithic::TokenMetadata::TokenRequestorName::TaggedSymbol + } + ) + end + def to_hash + end + + class PaymentAccountInfo < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TokenMetadata::PaymentAccountInfo, + Lithic::Internal::AnyHash + ) + end + + # Additional information that can be used to identify the account holder, such as + # name, address, etc + sig do + returns(Lithic::TokenMetadata::PaymentAccountInfo::AccountHolderData) + end + attr_reader :account_holder_data + + sig do + params( + account_holder_data: + Lithic::TokenMetadata::PaymentAccountInfo::AccountHolderData::OrHash + ).void + end + attr_writer :account_holder_data + + # Reference to the PAN that is unique per Wallet Provider + sig { returns(T.nilable(String)) } + attr_accessor :pan_unique_reference + + # The unique account reference assigned to the PAN + sig { returns(T.nilable(String)) } + attr_accessor :payment_account_reference + + # A unique reference assigned following the allocation of a token used to identify + # the token for the duration of its lifetime. + sig { returns(T.nilable(String)) } + attr_accessor :token_unique_reference + + # Contains the information of the account responsible for the payment. + sig do + params( + account_holder_data: + Lithic::TokenMetadata::PaymentAccountInfo::AccountHolderData::OrHash, + pan_unique_reference: T.nilable(String), + payment_account_reference: T.nilable(String), + token_unique_reference: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Additional information that can be used to identify the account holder, such as + # name, address, etc + account_holder_data:, + # Reference to the PAN that is unique per Wallet Provider + pan_unique_reference: nil, + # The unique account reference assigned to the PAN + payment_account_reference: nil, + # A unique reference assigned following the allocation of a token used to identify + # the token for the duration of its lifetime. + token_unique_reference: nil + ) + end + + sig do + override.returns( + { + account_holder_data: + Lithic::TokenMetadata::PaymentAccountInfo::AccountHolderData, + pan_unique_reference: T.nilable(String), + payment_account_reference: T.nilable(String), + token_unique_reference: T.nilable(String) + } + ) + end + def to_hash + end + + class AccountHolderData < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TokenMetadata::PaymentAccountInfo::AccountHolderData, + Lithic::Internal::AnyHash + ) + end + + # The phone number, may contain country code along with phone number when + # countryDialInCode is not present + sig { returns(T.nilable(String)) } + attr_accessor :phone_number + + # Additional information that can be used to identify the account holder, such as + # name, address, etc + sig do + params(phone_number: T.nilable(String)).returns(T.attached_class) + end + def self.new( + # The phone number, may contain country code along with phone number when + # countryDialInCode is not present + phone_number: nil + ) + end + + sig { override.returns({ phone_number: T.nilable(String) }) } + def to_hash + end + end + end + + # Human-readable name of the wallet that the token_requestor_id maps to. + module TokenRequestorName + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::TokenMetadata::TokenRequestorName) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AMAZON_ONE = + T.let( + :AMAZON_ONE, + Lithic::TokenMetadata::TokenRequestorName::TaggedSymbol + ) + ANDROID_PAY = + T.let( + :ANDROID_PAY, + Lithic::TokenMetadata::TokenRequestorName::TaggedSymbol + ) + APPLE_PAY = + T.let( + :APPLE_PAY, + Lithic::TokenMetadata::TokenRequestorName::TaggedSymbol + ) + FACEBOOK = + T.let( + :FACEBOOK, + Lithic::TokenMetadata::TokenRequestorName::TaggedSymbol + ) + FITBIT_PAY = + T.let( + :FITBIT_PAY, + Lithic::TokenMetadata::TokenRequestorName::TaggedSymbol + ) + GARMIN_PAY = + T.let( + :GARMIN_PAY, + Lithic::TokenMetadata::TokenRequestorName::TaggedSymbol + ) + GOOGLE_PAY = + T.let( + :GOOGLE_PAY, + Lithic::TokenMetadata::TokenRequestorName::TaggedSymbol + ) + MICROSOFT_PAY = + T.let( + :MICROSOFT_PAY, + Lithic::TokenMetadata::TokenRequestorName::TaggedSymbol + ) + NETFLIX = + T.let( + :NETFLIX, + Lithic::TokenMetadata::TokenRequestorName::TaggedSymbol + ) + SAMSUNG_PAY = + T.let( + :SAMSUNG_PAY, + Lithic::TokenMetadata::TokenRequestorName::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::TokenMetadata::TokenRequestorName::TaggedSymbol + ) + VISA_CHECKOUT = + T.let( + :VISA_CHECKOUT, + Lithic::TokenMetadata::TokenRequestorName::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::TokenMetadata::TokenRequestorName::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/tokenization.rbi b/rbi/lithic/models/tokenization.rbi new file mode 100644 index 00000000..e2f6df28 --- /dev/null +++ b/rbi/lithic/models/tokenization.rbi @@ -0,0 +1,550 @@ +# typed: strong + +module Lithic + module Models + class Tokenization < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Lithic::Tokenization, Lithic::Internal::AnyHash) } + + # Globally unique identifier for a Tokenization + sig { returns(String) } + attr_accessor :token + + # The account token associated with the card being tokenized. + sig { returns(String) } + attr_accessor :account_token + + # The card token associated with the card being tokenized. + sig { returns(String) } + attr_accessor :card_token + + # Date and time when the tokenization first occurred. UTC time zone. + sig { returns(Time) } + attr_accessor :created_at + + # The dynamic pan assigned to the token by the network. + sig { returns(T.nilable(String)) } + attr_accessor :dpan + + # The status of the tokenization request + sig { returns(Lithic::Tokenization::Status::TaggedSymbol) } + attr_accessor :status + + # The entity that requested the tokenization. For digital wallets, this will be + # one of the defined wallet types. For merchant tokenizations, this will be a + # free-form merchant name string. + sig { returns(Lithic::Tokenization::TokenRequestorName::Variants) } + attr_accessor :token_requestor_name + + # The network's unique reference for the tokenization. + sig { returns(String) } + attr_accessor :token_unique_reference + + # The channel through which the tokenization was made. + sig { returns(Lithic::Tokenization::TokenizationChannel::TaggedSymbol) } + attr_accessor :tokenization_channel + + # Latest date and time when the tokenization was updated. UTC time zone. + sig { returns(Time) } + attr_accessor :updated_at + + # The device identifier associated with the tokenization. + sig { returns(T.nilable(String)) } + attr_accessor :device_id + + # Specifies the digital card art displayed in the user's digital wallet after + # tokenization. This will be null if the tokenization was created without an + # associated digital card art. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + sig { returns(T.nilable(String)) } + attr_accessor :digital_card_art_token + + # A list of events related to the tokenization. + sig { returns(T.nilable(T::Array[Lithic::Tokenization::Event])) } + attr_reader :events + + sig { params(events: T::Array[Lithic::Tokenization::Event::OrHash]).void } + attr_writer :events + + # The network's unique reference for the card that is tokenized. + sig { returns(T.nilable(String)) } + attr_accessor :payment_account_reference_id + + sig do + params( + token: String, + account_token: String, + card_token: String, + created_at: Time, + dpan: T.nilable(String), + status: Lithic::Tokenization::Status::OrSymbol, + token_requestor_name: + T.any(Lithic::Tokenization::TokenRequestorName::OrSymbol, String), + token_unique_reference: String, + tokenization_channel: + Lithic::Tokenization::TokenizationChannel::OrSymbol, + updated_at: Time, + device_id: T.nilable(String), + digital_card_art_token: T.nilable(String), + events: T::Array[Lithic::Tokenization::Event::OrHash], + payment_account_reference_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for a Tokenization + token:, + # The account token associated with the card being tokenized. + account_token:, + # The card token associated with the card being tokenized. + card_token:, + # Date and time when the tokenization first occurred. UTC time zone. + created_at:, + # The dynamic pan assigned to the token by the network. + dpan:, + # The status of the tokenization request + status:, + # The entity that requested the tokenization. For digital wallets, this will be + # one of the defined wallet types. For merchant tokenizations, this will be a + # free-form merchant name string. + token_requestor_name:, + # The network's unique reference for the tokenization. + token_unique_reference:, + # The channel through which the tokenization was made. + tokenization_channel:, + # Latest date and time when the tokenization was updated. UTC time zone. + updated_at:, + # The device identifier associated with the tokenization. + device_id: nil, + # Specifies the digital card art displayed in the user's digital wallet after + # tokenization. This will be null if the tokenization was created without an + # associated digital card art. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + digital_card_art_token: nil, + # A list of events related to the tokenization. + events: nil, + # The network's unique reference for the card that is tokenized. + payment_account_reference_id: nil + ) + end + + sig do + override.returns( + { + token: String, + account_token: String, + card_token: String, + created_at: Time, + dpan: T.nilable(String), + status: Lithic::Tokenization::Status::TaggedSymbol, + token_requestor_name: + Lithic::Tokenization::TokenRequestorName::Variants, + token_unique_reference: String, + tokenization_channel: + Lithic::Tokenization::TokenizationChannel::TaggedSymbol, + updated_at: Time, + device_id: T.nilable(String), + digital_card_art_token: T.nilable(String), + events: T::Array[Lithic::Tokenization::Event], + payment_account_reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The status of the tokenization request + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Tokenization::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTIVE = T.let(:ACTIVE, Lithic::Tokenization::Status::TaggedSymbol) + DEACTIVATED = + T.let(:DEACTIVATED, Lithic::Tokenization::Status::TaggedSymbol) + INACTIVE = T.let(:INACTIVE, Lithic::Tokenization::Status::TaggedSymbol) + PAUSED = T.let(:PAUSED, Lithic::Tokenization::Status::TaggedSymbol) + PENDING_2_FA = + T.let(:PENDING_2FA, Lithic::Tokenization::Status::TaggedSymbol) + PENDING_ACTIVATION = + T.let(:PENDING_ACTIVATION, Lithic::Tokenization::Status::TaggedSymbol) + UNKNOWN = T.let(:UNKNOWN, Lithic::Tokenization::Status::TaggedSymbol) + + sig do + override.returns(T::Array[Lithic::Tokenization::Status::TaggedSymbol]) + end + def self.values + end + end + + # The entity that requested the tokenization. For digital wallets, this will be + # one of the defined wallet types. For merchant tokenizations, this will be a + # free-form merchant name string. + module TokenRequestorName + extend Lithic::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Lithic::Tokenization::TokenRequestorName::TaggedSymbol, + String + ) + end + + sig do + override.returns( + T::Array[Lithic::Tokenization::TokenRequestorName::Variants] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Tokenization::TokenRequestorName) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AMAZON_ONE = + T.let( + :AMAZON_ONE, + Lithic::Tokenization::TokenRequestorName::TaggedSymbol + ) + ANDROID_PAY = + T.let( + :ANDROID_PAY, + Lithic::Tokenization::TokenRequestorName::TaggedSymbol + ) + APPLE_PAY = + T.let( + :APPLE_PAY, + Lithic::Tokenization::TokenRequestorName::TaggedSymbol + ) + FACEBOOK = + T.let( + :FACEBOOK, + Lithic::Tokenization::TokenRequestorName::TaggedSymbol + ) + FITBIT_PAY = + T.let( + :FITBIT_PAY, + Lithic::Tokenization::TokenRequestorName::TaggedSymbol + ) + GARMIN_PAY = + T.let( + :GARMIN_PAY, + Lithic::Tokenization::TokenRequestorName::TaggedSymbol + ) + GOOGLE_PAY = + T.let( + :GOOGLE_PAY, + Lithic::Tokenization::TokenRequestorName::TaggedSymbol + ) + MICROSOFT_PAY = + T.let( + :MICROSOFT_PAY, + Lithic::Tokenization::TokenRequestorName::TaggedSymbol + ) + NETFLIX = + T.let( + :NETFLIX, + Lithic::Tokenization::TokenRequestorName::TaggedSymbol + ) + SAMSUNG_PAY = + T.let( + :SAMSUNG_PAY, + Lithic::Tokenization::TokenRequestorName::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::Tokenization::TokenRequestorName::TaggedSymbol + ) + VISA_CHECKOUT = + T.let( + :VISA_CHECKOUT, + Lithic::Tokenization::TokenRequestorName::TaggedSymbol + ) + end + + # The channel through which the tokenization was made. + module TokenizationChannel + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Tokenization::TokenizationChannel) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DIGITAL_WALLET = + T.let( + :DIGITAL_WALLET, + Lithic::Tokenization::TokenizationChannel::TaggedSymbol + ) + MERCHANT = + T.let( + :MERCHANT, + Lithic::Tokenization::TokenizationChannel::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::Tokenization::TokenizationChannel::TaggedSymbol] + ) + end + def self.values + end + end + + class Event < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::Tokenization::Event, Lithic::Internal::AnyHash) + end + + # Globally unique identifier for a Tokenization Event + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # Date and time when the tokenization event first occurred. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :created_at + + sig { params(created_at: Time).void } + attr_writer :created_at + + # Enum representing the result of the tokenization event + sig do + returns(T.nilable(Lithic::Tokenization::Event::Result::TaggedSymbol)) + end + attr_reader :result + + sig do + params(result: Lithic::Tokenization::Event::Result::OrSymbol).void + end + attr_writer :result + + # Results from rules that were evaluated for this tokenization + sig { returns(T.nilable(T::Array[Lithic::TokenizationRuleResult])) } + attr_reader :rule_results + + sig do + params( + rule_results: T::Array[Lithic::TokenizationRuleResult::OrHash] + ).void + end + attr_writer :rule_results + + # List of reasons why the tokenization was declined + sig do + returns( + T.nilable(T::Array[Lithic::TokenizationDeclineReason::TaggedSymbol]) + ) + end + attr_reader :tokenization_decline_reasons + + sig do + params( + tokenization_decline_reasons: + T::Array[Lithic::TokenizationDeclineReason::OrSymbol] + ).void + end + attr_writer :tokenization_decline_reasons + + # List of reasons why two-factor authentication was required + sig do + returns( + T.nilable(T::Array[Lithic::TokenizationTfaReason::TaggedSymbol]) + ) + end + attr_reader :tokenization_tfa_reasons + + sig do + params( + tokenization_tfa_reasons: + T::Array[Lithic::TokenizationTfaReason::OrSymbol] + ).void + end + attr_writer :tokenization_tfa_reasons + + # Enum representing the type of tokenization event that occurred + sig do + returns(T.nilable(Lithic::Tokenization::Event::Type::TaggedSymbol)) + end + attr_reader :type + + sig { params(type: Lithic::Tokenization::Event::Type::OrSymbol).void } + attr_writer :type + + sig do + params( + token: String, + created_at: Time, + result: Lithic::Tokenization::Event::Result::OrSymbol, + rule_results: T::Array[Lithic::TokenizationRuleResult::OrHash], + tokenization_decline_reasons: + T::Array[Lithic::TokenizationDeclineReason::OrSymbol], + tokenization_tfa_reasons: + T::Array[Lithic::TokenizationTfaReason::OrSymbol], + type: Lithic::Tokenization::Event::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for a Tokenization Event + token: nil, + # Date and time when the tokenization event first occurred. UTC time zone. + created_at: nil, + # Enum representing the result of the tokenization event + result: nil, + # Results from rules that were evaluated for this tokenization + rule_results: nil, + # List of reasons why the tokenization was declined + tokenization_decline_reasons: nil, + # List of reasons why two-factor authentication was required + tokenization_tfa_reasons: nil, + # Enum representing the type of tokenization event that occurred + type: nil + ) + end + + sig do + override.returns( + { + token: String, + created_at: Time, + result: Lithic::Tokenization::Event::Result::TaggedSymbol, + rule_results: T::Array[Lithic::TokenizationRuleResult], + tokenization_decline_reasons: + T::Array[Lithic::TokenizationDeclineReason::TaggedSymbol], + tokenization_tfa_reasons: + T::Array[Lithic::TokenizationTfaReason::TaggedSymbol], + type: Lithic::Tokenization::Event::Type::TaggedSymbol + } + ) + end + def to_hash + end + + # Enum representing the result of the tokenization event + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Tokenization::Event::Result) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let(:APPROVED, Lithic::Tokenization::Event::Result::TaggedSymbol) + DECLINED = + T.let(:DECLINED, Lithic::Tokenization::Event::Result::TaggedSymbol) + NOTIFICATION_DELIVERED = + T.let( + :NOTIFICATION_DELIVERED, + Lithic::Tokenization::Event::Result::TaggedSymbol + ) + REQUIRE_ADDITIONAL_AUTHENTICATION = + T.let( + :REQUIRE_ADDITIONAL_AUTHENTICATION, + Lithic::Tokenization::Event::Result::TaggedSymbol + ) + TOKEN_ACTIVATED = + T.let( + :TOKEN_ACTIVATED, + Lithic::Tokenization::Event::Result::TaggedSymbol + ) + TOKEN_CREATED = + T.let( + :TOKEN_CREATED, + Lithic::Tokenization::Event::Result::TaggedSymbol + ) + TOKEN_DEACTIVATED = + T.let( + :TOKEN_DEACTIVATED, + Lithic::Tokenization::Event::Result::TaggedSymbol + ) + TOKEN_DELETED_FROM_CONSUMER_APP = + T.let( + :TOKEN_DELETED_FROM_CONSUMER_APP, + Lithic::Tokenization::Event::Result::TaggedSymbol + ) + TOKEN_INACTIVE = + T.let( + :TOKEN_INACTIVE, + Lithic::Tokenization::Event::Result::TaggedSymbol + ) + TOKEN_STATE_UNKNOWN = + T.let( + :TOKEN_STATE_UNKNOWN, + Lithic::Tokenization::Event::Result::TaggedSymbol + ) + TOKEN_SUSPENDED = + T.let( + :TOKEN_SUSPENDED, + Lithic::Tokenization::Event::Result::TaggedSymbol + ) + TOKEN_UPDATED = + T.let( + :TOKEN_UPDATED, + Lithic::Tokenization::Event::Result::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::Tokenization::Event::Result::TaggedSymbol] + ) + end + def self.values + end + end + + # Enum representing the type of tokenization event that occurred + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Tokenization::Event::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TOKENIZATION_2_FA = + T.let( + :TOKENIZATION_2FA, + Lithic::Tokenization::Event::Type::TaggedSymbol + ) + TOKENIZATION_AUTHORIZATION = + T.let( + :TOKENIZATION_AUTHORIZATION, + Lithic::Tokenization::Event::Type::TaggedSymbol + ) + TOKENIZATION_DECISIONING = + T.let( + :TOKENIZATION_DECISIONING, + Lithic::Tokenization::Event::Type::TaggedSymbol + ) + TOKENIZATION_ELIGIBILITY_CHECK = + T.let( + :TOKENIZATION_ELIGIBILITY_CHECK, + Lithic::Tokenization::Event::Type::TaggedSymbol + ) + TOKENIZATION_UPDATED = + T.let( + :TOKENIZATION_UPDATED, + Lithic::Tokenization::Event::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::Tokenization::Event::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/tokenization_activate_params.rbi b/rbi/lithic/models/tokenization_activate_params.rbi new file mode 100644 index 00000000..f00107c6 --- /dev/null +++ b/rbi/lithic/models/tokenization_activate_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Lithic + module Models + class TokenizationActivateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::TokenizationActivateParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :tokenization_token + + sig do + params( + tokenization_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(tokenization_token:, request_options: {}) + end + + sig do + override.returns( + { + tokenization_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/tokenization_approval_request_webhook_event.rbi b/rbi/lithic/models/tokenization_approval_request_webhook_event.rbi new file mode 100644 index 00000000..dcc42788 --- /dev/null +++ b/rbi/lithic/models/tokenization_approval_request_webhook_event.rbi @@ -0,0 +1,542 @@ +# typed: strong + +module Lithic + module Models + class TokenizationApprovalRequestWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TokenizationApprovalRequestWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # Unique identifier for the user tokenizing a card + sig { returns(String) } + attr_accessor :account_token + + # Unique identifier for the card being tokenized + sig { returns(String) } + attr_accessor :card_token + + # Indicate when the request was received from Mastercard or Visa + sig { returns(Time) } + attr_accessor :created + + # Contains the metadata for the customer tokenization decision. + sig do + returns( + T.nilable( + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision + ) + ) + end + attr_reader :customer_tokenization_decision + + sig do + params( + customer_tokenization_decision: + T.nilable( + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::OrHash + ) + ).void + end + attr_writer :customer_tokenization_decision + + # The name of this event + sig do + returns( + Lithic::TokenizationApprovalRequestWebhookEvent::EventType::TaggedSymbol + ) + end + attr_accessor :event_type + + # Whether Lithic decisioned on the token, and if so, what the decision was. + # APPROVED/VERIFICATION_REQUIRED/DENIED. + sig do + returns( + Lithic::TokenizationApprovalRequestWebhookEvent::IssuerDecision::TaggedSymbol + ) + end + attr_accessor :issuer_decision + + # Contains the metadata for the digital wallet being tokenized. + sig { returns(Lithic::TokenMetadata) } + attr_reader :token_metadata + + sig { params(token_metadata: Lithic::TokenMetadata::OrHash).void } + attr_writer :token_metadata + + # The channel through which the tokenization was made. + sig do + returns( + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationChannel::TaggedSymbol + ) + end + attr_accessor :tokenization_channel + + # Unique identifier for the digital wallet token attempt + sig { returns(String) } + attr_accessor :tokenization_token + + sig { returns(Lithic::WalletDecisioningInfo) } + attr_reader :wallet_decisioning_info + + sig do + params( + wallet_decisioning_info: Lithic::WalletDecisioningInfo::OrHash + ).void + end + attr_writer :wallet_decisioning_info + + sig { returns(T.nilable(Lithic::Device)) } + attr_reader :device + + sig { params(device: Lithic::Device::OrHash).void } + attr_writer :device + + # Results from rules that were evaluated for this tokenization + sig { returns(T.nilable(T::Array[Lithic::TokenizationRuleResult])) } + attr_reader :rule_results + + sig do + params( + rule_results: T::Array[Lithic::TokenizationRuleResult::OrHash] + ).void + end + attr_writer :rule_results + + # List of reasons why the tokenization was declined + sig do + returns( + T.nilable(T::Array[Lithic::TokenizationDeclineReason::TaggedSymbol]) + ) + end + attr_reader :tokenization_decline_reasons + + sig do + params( + tokenization_decline_reasons: + T::Array[Lithic::TokenizationDeclineReason::OrSymbol] + ).void + end + attr_writer :tokenization_decline_reasons + + # The source of the tokenization. + sig do + returns( + T.nilable( + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + ) + end + attr_reader :tokenization_source + + sig do + params( + tokenization_source: + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationSource::OrSymbol + ).void + end + attr_writer :tokenization_source + + # List of reasons why two-factor authentication was required + sig do + returns( + T.nilable(T::Array[Lithic::TokenizationTfaReason::TaggedSymbol]) + ) + end + attr_reader :tokenization_tfa_reasons + + sig do + params( + tokenization_tfa_reasons: + T::Array[Lithic::TokenizationTfaReason::OrSymbol] + ).void + end + attr_writer :tokenization_tfa_reasons + + sig do + params( + account_token: String, + card_token: String, + created: Time, + customer_tokenization_decision: + T.nilable( + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::OrHash + ), + event_type: + Lithic::TokenizationApprovalRequestWebhookEvent::EventType::OrSymbol, + issuer_decision: + Lithic::TokenizationApprovalRequestWebhookEvent::IssuerDecision::OrSymbol, + token_metadata: Lithic::TokenMetadata::OrHash, + tokenization_channel: + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationChannel::OrSymbol, + tokenization_token: String, + wallet_decisioning_info: Lithic::WalletDecisioningInfo::OrHash, + device: Lithic::Device::OrHash, + rule_results: T::Array[Lithic::TokenizationRuleResult::OrHash], + tokenization_decline_reasons: + T::Array[Lithic::TokenizationDeclineReason::OrSymbol], + tokenization_source: + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationSource::OrSymbol, + tokenization_tfa_reasons: + T::Array[Lithic::TokenizationTfaReason::OrSymbol] + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the user tokenizing a card + account_token:, + # Unique identifier for the card being tokenized + card_token:, + # Indicate when the request was received from Mastercard or Visa + created:, + # Contains the metadata for the customer tokenization decision. + customer_tokenization_decision:, + # The name of this event + event_type:, + # Whether Lithic decisioned on the token, and if so, what the decision was. + # APPROVED/VERIFICATION_REQUIRED/DENIED. + issuer_decision:, + # Contains the metadata for the digital wallet being tokenized. + token_metadata:, + # The channel through which the tokenization was made. + tokenization_channel:, + # Unique identifier for the digital wallet token attempt + tokenization_token:, + wallet_decisioning_info:, + device: nil, + # Results from rules that were evaluated for this tokenization + rule_results: nil, + # List of reasons why the tokenization was declined + tokenization_decline_reasons: nil, + # The source of the tokenization. + tokenization_source: nil, + # List of reasons why two-factor authentication was required + tokenization_tfa_reasons: nil + ) + end + + sig do + override.returns( + { + account_token: String, + card_token: String, + created: Time, + customer_tokenization_decision: + T.nilable( + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision + ), + event_type: + Lithic::TokenizationApprovalRequestWebhookEvent::EventType::TaggedSymbol, + issuer_decision: + Lithic::TokenizationApprovalRequestWebhookEvent::IssuerDecision::TaggedSymbol, + token_metadata: Lithic::TokenMetadata, + tokenization_channel: + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationChannel::TaggedSymbol, + tokenization_token: String, + wallet_decisioning_info: Lithic::WalletDecisioningInfo, + device: Lithic::Device, + rule_results: T::Array[Lithic::TokenizationRuleResult], + tokenization_decline_reasons: + T::Array[Lithic::TokenizationDeclineReason::TaggedSymbol], + tokenization_source: + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol, + tokenization_tfa_reasons: + T::Array[Lithic::TokenizationTfaReason::TaggedSymbol] + } + ) + end + def to_hash + end + + class CustomerTokenizationDecision < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision, + Lithic::Internal::AnyHash + ) + end + + # The outcome of the customer's decision + sig do + returns( + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ) + end + attr_accessor :outcome + + # The customer's subscribed URL + sig { returns(String) } + attr_accessor :responder_url + + # Time in ms it took for the customer's URL to respond + sig { returns(T.nilable(String)) } + attr_reader :latency + + sig { params(latency: String).void } + attr_writer :latency + + # The response code that the customer provided + sig { returns(T.nilable(String)) } + attr_reader :response_code + + sig { params(response_code: String).void } + attr_writer :response_code + + # Contains the metadata for the customer tokenization decision. + sig do + params( + outcome: + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::OrSymbol, + responder_url: String, + latency: String, + response_code: String + ).returns(T.attached_class) + end + def self.new( + # The outcome of the customer's decision + outcome:, + # The customer's subscribed URL + responder_url:, + # Time in ms it took for the customer's URL to respond + latency: nil, + # The response code that the customer provided + response_code: nil + ) + end + + sig do + override.returns( + { + outcome: + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol, + responder_url: String, + latency: String, + response_code: String + } + ) + end + def to_hash + end + + # The outcome of the customer's decision + module Outcome + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ) + ERROR = + T.let( + :ERROR, + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ) + INVALID_RESPONSE = + T.let( + :INVALID_RESPONSE, + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ) + REQUIRE_ADDITIONAL_AUTHENTICATION = + T.let( + :REQUIRE_ADDITIONAL_AUTHENTICATION, + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ) + TIMEOUT = + T.let( + :TIMEOUT, + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::Outcome::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + # The name of this event + module EventType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::TokenizationApprovalRequestWebhookEvent::EventType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TOKENIZATION_APPROVAL_REQUEST = + T.let( + :"tokenization.approval_request", + Lithic::TokenizationApprovalRequestWebhookEvent::EventType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::TokenizationApprovalRequestWebhookEvent::EventType::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Whether Lithic decisioned on the token, and if so, what the decision was. + # APPROVED/VERIFICATION_REQUIRED/DENIED. + module IssuerDecision + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::TokenizationApprovalRequestWebhookEvent::IssuerDecision + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::TokenizationApprovalRequestWebhookEvent::IssuerDecision::TaggedSymbol + ) + DENIED = + T.let( + :DENIED, + Lithic::TokenizationApprovalRequestWebhookEvent::IssuerDecision::TaggedSymbol + ) + VERIFICATION_REQUIRED = + T.let( + :VERIFICATION_REQUIRED, + Lithic::TokenizationApprovalRequestWebhookEvent::IssuerDecision::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::TokenizationApprovalRequestWebhookEvent::IssuerDecision::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The channel through which the tokenization was made. + module TokenizationChannel + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationChannel + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DIGITAL_WALLET = + T.let( + :DIGITAL_WALLET, + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationChannel::TaggedSymbol + ) + MERCHANT = + T.let( + :MERCHANT, + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationChannel::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationChannel::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The source of the tokenization. + module TokenizationSource + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationSource + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_ON_FILE = + T.let( + :ACCOUNT_ON_FILE, + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + CONTACTLESS_TAP = + T.let( + :CONTACTLESS_TAP, + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + MANUAL_PROVISION = + T.let( + :MANUAL_PROVISION, + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + PUSH_PROVISION = + T.let( + :PUSH_PROVISION, + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + TOKEN = + T.let( + :TOKEN, + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::TokenizationApprovalRequestWebhookEvent::TokenizationSource::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/tokenization_deactivate_params.rbi b/rbi/lithic/models/tokenization_deactivate_params.rbi new file mode 100644 index 00000000..a135894a --- /dev/null +++ b/rbi/lithic/models/tokenization_deactivate_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Lithic + module Models + class TokenizationDeactivateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::TokenizationDeactivateParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :tokenization_token + + sig do + params( + tokenization_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(tokenization_token:, request_options: {}) + end + + sig do + override.returns( + { + tokenization_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/tokenization_decisioning_retrieve_secret_params.rbi b/rbi/lithic/models/tokenization_decisioning_retrieve_secret_params.rbi new file mode 100644 index 00000000..0e9ebd03 --- /dev/null +++ b/rbi/lithic/models/tokenization_decisioning_retrieve_secret_params.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class TokenizationDecisioningRetrieveSecretParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TokenizationDecisioningRetrieveSecretParams, + Lithic::Internal::AnyHash + ) + end + + sig do + params(request_options: Lithic::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: Lithic::RequestOptions }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/tokenization_decisioning_rotate_secret_params.rbi b/rbi/lithic/models/tokenization_decisioning_rotate_secret_params.rbi new file mode 100644 index 00000000..2549f233 --- /dev/null +++ b/rbi/lithic/models/tokenization_decisioning_rotate_secret_params.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class TokenizationDecisioningRotateSecretParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TokenizationDecisioningRotateSecretParams, + Lithic::Internal::AnyHash + ) + end + + sig do + params(request_options: Lithic::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: Lithic::RequestOptions }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/tokenization_decisioning_rotate_secret_response.rbi b/rbi/lithic/models/tokenization_decisioning_rotate_secret_response.rbi new file mode 100644 index 00000000..efce81a1 --- /dev/null +++ b/rbi/lithic/models/tokenization_decisioning_rotate_secret_response.rbi @@ -0,0 +1,33 @@ +# typed: strong + +module Lithic + module Models + class TokenizationDecisioningRotateSecretResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::TokenizationDecisioningRotateSecretResponse, + Lithic::Internal::AnyHash + ) + end + + # The new Tokenization Decisioning HMAC secret + sig { returns(T.nilable(String)) } + attr_reader :secret + + sig { params(secret: String).void } + attr_writer :secret + + sig { params(secret: String).returns(T.attached_class) } + def self.new( + # The new Tokenization Decisioning HMAC secret + secret: nil + ) + end + + sig { override.returns({ secret: String }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/tokenization_decline_reason.rbi b/rbi/lithic/models/tokenization_decline_reason.rbi new file mode 100644 index 00000000..263802b0 --- /dev/null +++ b/rbi/lithic/models/tokenization_decline_reason.rbi @@ -0,0 +1,75 @@ +# typed: strong + +module Lithic + module Models + # Reason code for why a tokenization was declined + module TokenizationDeclineReason + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::TokenizationDeclineReason) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_SCORE_1 = + T.let(:ACCOUNT_SCORE_1, Lithic::TokenizationDeclineReason::TaggedSymbol) + DEVICE_SCORE_1 = + T.let(:DEVICE_SCORE_1, Lithic::TokenizationDeclineReason::TaggedSymbol) + ALL_WALLET_DECLINE_REASONS_PRESENT = + T.let( + :ALL_WALLET_DECLINE_REASONS_PRESENT, + Lithic::TokenizationDeclineReason::TaggedSymbol + ) + WALLET_RECOMMENDED_DECISION_RED = + T.let( + :WALLET_RECOMMENDED_DECISION_RED, + Lithic::TokenizationDeclineReason::TaggedSymbol + ) + CVC_MISMATCH = + T.let(:CVC_MISMATCH, Lithic::TokenizationDeclineReason::TaggedSymbol) + CARD_EXPIRY_MONTH_MISMATCH = + T.let( + :CARD_EXPIRY_MONTH_MISMATCH, + Lithic::TokenizationDeclineReason::TaggedSymbol + ) + CARD_EXPIRY_YEAR_MISMATCH = + T.let( + :CARD_EXPIRY_YEAR_MISMATCH, + Lithic::TokenizationDeclineReason::TaggedSymbol + ) + CARD_INVALID_STATE = + T.let( + :CARD_INVALID_STATE, + Lithic::TokenizationDeclineReason::TaggedSymbol + ) + CUSTOMER_RED_PATH = + T.let( + :CUSTOMER_RED_PATH, + Lithic::TokenizationDeclineReason::TaggedSymbol + ) + INVALID_CUSTOMER_RESPONSE = + T.let( + :INVALID_CUSTOMER_RESPONSE, + Lithic::TokenizationDeclineReason::TaggedSymbol + ) + NETWORK_FAILURE = + T.let(:NETWORK_FAILURE, Lithic::TokenizationDeclineReason::TaggedSymbol) + GENERIC_DECLINE = + T.let(:GENERIC_DECLINE, Lithic::TokenizationDeclineReason::TaggedSymbol) + DIGITAL_CARD_ART_REQUIRED = + T.let( + :DIGITAL_CARD_ART_REQUIRED, + Lithic::TokenizationDeclineReason::TaggedSymbol + ) + INVALID_PAN = + T.let(:INVALID_PAN, Lithic::TokenizationDeclineReason::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::TokenizationDeclineReason::TaggedSymbol] + ) + end + def self.values + end + end + end +end diff --git a/rbi/lithic/models/tokenization_list_params.rbi b/rbi/lithic/models/tokenization_list_params.rbi new file mode 100644 index 00000000..be2230bf --- /dev/null +++ b/rbi/lithic/models/tokenization_list_params.rbi @@ -0,0 +1,180 @@ +# typed: strong + +module Lithic + module Models + class TokenizationListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::TokenizationListParams, Lithic::Internal::AnyHash) + end + + # Filters for tokenizations associated with a specific account. + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Filter for tokenizations created after this date. + sig { returns(T.nilable(Date)) } + attr_reader :begin_ + + sig { params(begin_: Date).void } + attr_writer :begin_ + + # Filters for tokenizations associated with a specific card. + sig { returns(T.nilable(String)) } + attr_reader :card_token + + sig { params(card_token: String).void } + attr_writer :card_token + + # Filter for tokenizations created before this date. + sig { returns(T.nilable(Date)) } + attr_reader :end_ + + sig { params(end_: Date).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + # Filter for tokenizations by tokenization channel. If this is not specified, only + # DIGITAL_WALLET tokenizations will be returned. + sig do + returns( + T.nilable( + Lithic::TokenizationListParams::TokenizationChannel::OrSymbol + ) + ) + end + attr_reader :tokenization_channel + + sig do + params( + tokenization_channel: + Lithic::TokenizationListParams::TokenizationChannel::OrSymbol + ).void + end + attr_writer :tokenization_channel + + sig do + params( + account_token: String, + begin_: Date, + card_token: String, + end_: Date, + ending_before: String, + page_size: Integer, + starting_after: String, + tokenization_channel: + Lithic::TokenizationListParams::TokenizationChannel::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Filters for tokenizations associated with a specific account. + account_token: nil, + # Filter for tokenizations created after this date. + begin_: nil, + # Filters for tokenizations associated with a specific card. + card_token: nil, + # Filter for tokenizations created before this date. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Filter for tokenizations by tokenization channel. If this is not specified, only + # DIGITAL_WALLET tokenizations will be returned. + tokenization_channel: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + account_token: String, + begin_: Date, + card_token: String, + end_: Date, + ending_before: String, + page_size: Integer, + starting_after: String, + tokenization_channel: + Lithic::TokenizationListParams::TokenizationChannel::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Filter for tokenizations by tokenization channel. If this is not specified, only + # DIGITAL_WALLET tokenizations will be returned. + module TokenizationChannel + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::TokenizationListParams::TokenizationChannel) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DIGITAL_WALLET = + T.let( + :DIGITAL_WALLET, + Lithic::TokenizationListParams::TokenizationChannel::TaggedSymbol + ) + MERCHANT = + T.let( + :MERCHANT, + Lithic::TokenizationListParams::TokenizationChannel::TaggedSymbol + ) + ALL = + T.let( + :ALL, + Lithic::TokenizationListParams::TokenizationChannel::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::TokenizationListParams::TokenizationChannel::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/tokenization_pause_params.rbi b/rbi/lithic/models/tokenization_pause_params.rbi new file mode 100644 index 00000000..2b0722a9 --- /dev/null +++ b/rbi/lithic/models/tokenization_pause_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Lithic + module Models + class TokenizationPauseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::TokenizationPauseParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :tokenization_token + + sig do + params( + tokenization_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(tokenization_token:, request_options: {}) + end + + sig do + override.returns( + { + tokenization_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/tokenization_resend_activation_code_params.rbi b/rbi/lithic/models/tokenization_resend_activation_code_params.rbi new file mode 100644 index 00000000..12177ed5 --- /dev/null +++ b/rbi/lithic/models/tokenization_resend_activation_code_params.rbi @@ -0,0 +1,109 @@ +# typed: strong + +module Lithic + module Models + class TokenizationResendActivationCodeParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TokenizationResendActivationCodeParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :tokenization_token + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + sig do + returns( + T.nilable( + Lithic::TokenizationResendActivationCodeParams::ActivationMethodType::OrSymbol + ) + ) + end + attr_reader :activation_method_type + + sig do + params( + activation_method_type: + Lithic::TokenizationResendActivationCodeParams::ActivationMethodType::OrSymbol + ).void + end + attr_writer :activation_method_type + + sig do + params( + tokenization_token: String, + activation_method_type: + Lithic::TokenizationResendActivationCodeParams::ActivationMethodType::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + tokenization_token:, + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + activation_method_type: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + tokenization_token: String, + activation_method_type: + Lithic::TokenizationResendActivationCodeParams::ActivationMethodType::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + module ActivationMethodType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::TokenizationResendActivationCodeParams::ActivationMethodType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EMAIL_TO_CARDHOLDER_ADDRESS = + T.let( + :EMAIL_TO_CARDHOLDER_ADDRESS, + Lithic::TokenizationResendActivationCodeParams::ActivationMethodType::TaggedSymbol + ) + TEXT_TO_CARDHOLDER_NUMBER = + T.let( + :TEXT_TO_CARDHOLDER_NUMBER, + Lithic::TokenizationResendActivationCodeParams::ActivationMethodType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::TokenizationResendActivationCodeParams::ActivationMethodType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/tokenization_result_webhook_event.rbi b/rbi/lithic/models/tokenization_result_webhook_event.rbi new file mode 100644 index 00000000..40b5f190 --- /dev/null +++ b/rbi/lithic/models/tokenization_result_webhook_event.rbi @@ -0,0 +1,295 @@ +# typed: strong + +module Lithic + module Models + class TokenizationResultWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TokenizationResultWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # Account token + sig { returns(String) } + attr_accessor :account_token + + # Card token + sig { returns(String) } + attr_accessor :card_token + + # Created date + sig { returns(Time) } + attr_accessor :created + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # The result of the tokenization request. + sig do + returns( + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails + ) + end + attr_reader :tokenization_result_details + + sig do + params( + tokenization_result_details: + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::OrHash + ).void + end + attr_writer :tokenization_result_details + + # Tokenization token + sig { returns(String) } + attr_accessor :tokenization_token + + sig do + params( + account_token: String, + card_token: String, + created: Time, + tokenization_result_details: + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::OrHash, + tokenization_token: String, + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Account token + account_token:, + # Card token + card_token:, + # Created date + created:, + # The result of the tokenization request. + tokenization_result_details:, + # Tokenization token + tokenization_token:, + # The type of event that occurred. + event_type: :"tokenization.result" + ) + end + + sig do + override.returns( + { + account_token: String, + card_token: String, + created: Time, + event_type: Symbol, + tokenization_result_details: + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails, + tokenization_token: String + } + ) + end + def to_hash + end + + class TokenizationResultDetails < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails, + Lithic::Internal::AnyHash + ) + end + + # Lithic's tokenization decision. + sig { returns(String) } + attr_accessor :issuer_decision + + # List of reasons why the tokenization was declined + sig do + returns( + T::Array[ + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ] + ) + end + attr_accessor :tokenization_decline_reasons + + # The customer's tokenization decision if applicable. + sig { returns(T.nilable(String)) } + attr_accessor :customer_decision + + # Results from rules that were evaluated for this tokenization + sig { returns(T.nilable(T::Array[Lithic::TokenizationRuleResult])) } + attr_reader :rule_results + + sig do + params( + rule_results: T::Array[Lithic::TokenizationRuleResult::OrHash] + ).void + end + attr_writer :rule_results + + # An RFC 3339 timestamp indicating when the tokenization succeeded. + sig { returns(T.nilable(Time)) } + attr_accessor :token_activated_date_time + + # List of reasons why two-factor authentication was required + sig do + returns( + T.nilable(T::Array[Lithic::TokenizationTfaReason::TaggedSymbol]) + ) + end + attr_reader :tokenization_tfa_reasons + + sig do + params( + tokenization_tfa_reasons: + T::Array[Lithic::TokenizationTfaReason::OrSymbol] + ).void + end + attr_writer :tokenization_tfa_reasons + + # The wallet's recommended decision. + sig { returns(T.nilable(String)) } + attr_accessor :wallet_decision + + # The result of the tokenization request. + sig do + params( + issuer_decision: String, + tokenization_decline_reasons: + T::Array[ + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::OrSymbol + ], + customer_decision: T.nilable(String), + rule_results: T::Array[Lithic::TokenizationRuleResult::OrHash], + token_activated_date_time: T.nilable(Time), + tokenization_tfa_reasons: + T::Array[Lithic::TokenizationTfaReason::OrSymbol], + wallet_decision: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Lithic's tokenization decision. + issuer_decision:, + # List of reasons why the tokenization was declined + tokenization_decline_reasons:, + # The customer's tokenization decision if applicable. + customer_decision: nil, + # Results from rules that were evaluated for this tokenization + rule_results: nil, + # An RFC 3339 timestamp indicating when the tokenization succeeded. + token_activated_date_time: nil, + # List of reasons why two-factor authentication was required + tokenization_tfa_reasons: nil, + # The wallet's recommended decision. + wallet_decision: nil + ) + end + + sig do + override.returns( + { + issuer_decision: String, + tokenization_decline_reasons: + T::Array[ + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ], + customer_decision: T.nilable(String), + rule_results: T::Array[Lithic::TokenizationRuleResult], + token_activated_date_time: T.nilable(Time), + tokenization_tfa_reasons: + T::Array[Lithic::TokenizationTfaReason::TaggedSymbol], + wallet_decision: T.nilable(String) + } + ) + end + def to_hash + end + + module TokenizationDeclineReason + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_SCORE_1 = + T.let( + :ACCOUNT_SCORE_1, + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + ALL_WALLET_DECLINE_REASONS_PRESENT = + T.let( + :ALL_WALLET_DECLINE_REASONS_PRESENT, + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + CARD_EXPIRY_MONTH_MISMATCH = + T.let( + :CARD_EXPIRY_MONTH_MISMATCH, + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + CARD_EXPIRY_YEAR_MISMATCH = + T.let( + :CARD_EXPIRY_YEAR_MISMATCH, + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + CARD_INVALID_STATE = + T.let( + :CARD_INVALID_STATE, + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + CUSTOMER_RED_PATH = + T.let( + :CUSTOMER_RED_PATH, + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + CVC_MISMATCH = + T.let( + :CVC_MISMATCH, + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + DEVICE_SCORE_1 = + T.let( + :DEVICE_SCORE_1, + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + GENERIC_DECLINE = + T.let( + :GENERIC_DECLINE, + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + INVALID_CUSTOMER_RESPONSE = + T.let( + :INVALID_CUSTOMER_RESPONSE, + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + NETWORK_FAILURE = + T.let( + :NETWORK_FAILURE, + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + WALLET_RECOMMENDED_DECISION_RED = + T.let( + :WALLET_RECOMMENDED_DECISION_RED, + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails::TokenizationDeclineReason::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/tokenization_retrieve_params.rbi b/rbi/lithic/models/tokenization_retrieve_params.rbi new file mode 100644 index 00000000..1eb38d9d --- /dev/null +++ b/rbi/lithic/models/tokenization_retrieve_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Lithic + module Models + class TokenizationRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::TokenizationRetrieveParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :tokenization_token + + sig do + params( + tokenization_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(tokenization_token:, request_options: {}) + end + + sig do + override.returns( + { + tokenization_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/tokenization_rule_result.rbi b/rbi/lithic/models/tokenization_rule_result.rbi new file mode 100644 index 00000000..f3ccf71c --- /dev/null +++ b/rbi/lithic/models/tokenization_rule_result.rbi @@ -0,0 +1,96 @@ +# typed: strong + +module Lithic + module Models + class TokenizationRuleResult < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::TokenizationRuleResult, Lithic::Internal::AnyHash) + end + + # The Auth Rule Token associated with the rule. If this is set to null, then the + # result was not associated with a customer-configured rule. This may happen in + # cases where a tokenization is declined or requires TFA due to a + # Lithic-configured security or compliance rule, for example. + sig { returns(T.nilable(String)) } + attr_accessor :auth_rule_token + + # A human-readable explanation outlining the motivation for the rule's result + sig { returns(T.nilable(String)) } + attr_accessor :explanation + + # The name for the rule, if any was configured + sig { returns(T.nilable(String)) } + attr_accessor :name + + # The result associated with this rule + sig { returns(Lithic::TokenizationRuleResult::Result::TaggedSymbol) } + attr_accessor :result + + sig do + params( + auth_rule_token: T.nilable(String), + explanation: T.nilable(String), + name: T.nilable(String), + result: Lithic::TokenizationRuleResult::Result::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The Auth Rule Token associated with the rule. If this is set to null, then the + # result was not associated with a customer-configured rule. This may happen in + # cases where a tokenization is declined or requires TFA due to a + # Lithic-configured security or compliance rule, for example. + auth_rule_token:, + # A human-readable explanation outlining the motivation for the rule's result + explanation:, + # The name for the rule, if any was configured + name:, + # The result associated with this rule + result: + ) + end + + sig do + override.returns( + { + auth_rule_token: T.nilable(String), + explanation: T.nilable(String), + name: T.nilable(String), + result: Lithic::TokenizationRuleResult::Result::TaggedSymbol + } + ) + end + def to_hash + end + + # The result associated with this rule + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::TokenizationRuleResult::Result) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let(:APPROVED, Lithic::TokenizationRuleResult::Result::TaggedSymbol) + DECLINED = + T.let(:DECLINED, Lithic::TokenizationRuleResult::Result::TaggedSymbol) + REQUIRE_TFA = + T.let( + :REQUIRE_TFA, + Lithic::TokenizationRuleResult::Result::TaggedSymbol + ) + ERROR = + T.let(:ERROR, Lithic::TokenizationRuleResult::Result::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::TokenizationRuleResult::Result::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/tokenization_secret.rbi b/rbi/lithic/models/tokenization_secret.rbi new file mode 100644 index 00000000..7621ef04 --- /dev/null +++ b/rbi/lithic/models/tokenization_secret.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Models + class TokenizationSecret < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::TokenizationSecret, Lithic::Internal::AnyHash) + end + + # The Tokenization Decisioning HMAC secret + sig { returns(T.nilable(String)) } + attr_reader :secret + + sig { params(secret: String).void } + attr_writer :secret + + sig { params(secret: String).returns(T.attached_class) } + def self.new( + # The Tokenization Decisioning HMAC secret + secret: nil + ) + end + + sig { override.returns({ secret: String }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/tokenization_simulate_params.rbi b/rbi/lithic/models/tokenization_simulate_params.rbi new file mode 100644 index 00000000..b56b7e96 --- /dev/null +++ b/rbi/lithic/models/tokenization_simulate_params.rbi @@ -0,0 +1,221 @@ +# typed: strong + +module Lithic + module Models + class TokenizationSimulateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::TokenizationSimulateParams, Lithic::Internal::AnyHash) + end + + # The three digit cvv for the card. + sig { returns(String) } + attr_accessor :cvv + + # The expiration date of the card in 'MM/YY' format. + sig { returns(String) } + attr_accessor :expiration_date + + # The sixteen digit card number. + sig { returns(String) } + attr_accessor :pan + + # The source of the tokenization request. + sig do + returns( + Lithic::TokenizationSimulateParams::TokenizationSource::OrSymbol + ) + end + attr_accessor :tokenization_source + + # The account score (1-5) that represents how the Digital Wallet's view on how + # reputable an end user's account is. + sig { returns(T.nilable(Integer)) } + attr_reader :account_score + + sig { params(account_score: Integer).void } + attr_writer :account_score + + # The device score (1-5) that represents how the Digital Wallet's view on how + # reputable an end user's device is. + sig { returns(T.nilable(Integer)) } + attr_reader :device_score + + sig { params(device_score: Integer).void } + attr_writer :device_score + + # Optional field to specify the token requestor name for a merchant token + # simulation. Ignored when tokenization_source is not MERCHANT. + sig { returns(T.nilable(String)) } + attr_reader :entity + + sig { params(entity: String).void } + attr_writer :entity + + # The decision that the Digital Wallet's recommend + sig do + returns( + T.nilable( + Lithic::TokenizationSimulateParams::WalletRecommendedDecision::OrSymbol + ) + ) + end + attr_reader :wallet_recommended_decision + + sig do + params( + wallet_recommended_decision: + Lithic::TokenizationSimulateParams::WalletRecommendedDecision::OrSymbol + ).void + end + attr_writer :wallet_recommended_decision + + sig do + params( + cvv: String, + expiration_date: String, + pan: String, + tokenization_source: + Lithic::TokenizationSimulateParams::TokenizationSource::OrSymbol, + account_score: Integer, + device_score: Integer, + entity: String, + wallet_recommended_decision: + Lithic::TokenizationSimulateParams::WalletRecommendedDecision::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The three digit cvv for the card. + cvv:, + # The expiration date of the card in 'MM/YY' format. + expiration_date:, + # The sixteen digit card number. + pan:, + # The source of the tokenization request. + tokenization_source:, + # The account score (1-5) that represents how the Digital Wallet's view on how + # reputable an end user's account is. + account_score: nil, + # The device score (1-5) that represents how the Digital Wallet's view on how + # reputable an end user's device is. + device_score: nil, + # Optional field to specify the token requestor name for a merchant token + # simulation. Ignored when tokenization_source is not MERCHANT. + entity: nil, + # The decision that the Digital Wallet's recommend + wallet_recommended_decision: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + cvv: String, + expiration_date: String, + pan: String, + tokenization_source: + Lithic::TokenizationSimulateParams::TokenizationSource::OrSymbol, + account_score: Integer, + device_score: Integer, + entity: String, + wallet_recommended_decision: + Lithic::TokenizationSimulateParams::WalletRecommendedDecision::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # The source of the tokenization request. + module TokenizationSource + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::TokenizationSimulateParams::TokenizationSource + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPLE_PAY = + T.let( + :APPLE_PAY, + Lithic::TokenizationSimulateParams::TokenizationSource::TaggedSymbol + ) + GOOGLE = + T.let( + :GOOGLE, + Lithic::TokenizationSimulateParams::TokenizationSource::TaggedSymbol + ) + SAMSUNG_PAY = + T.let( + :SAMSUNG_PAY, + Lithic::TokenizationSimulateParams::TokenizationSource::TaggedSymbol + ) + MERCHANT = + T.let( + :MERCHANT, + Lithic::TokenizationSimulateParams::TokenizationSource::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::TokenizationSimulateParams::TokenizationSource::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The decision that the Digital Wallet's recommend + module WalletRecommendedDecision + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::TokenizationSimulateParams::WalletRecommendedDecision + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let( + :APPROVED, + Lithic::TokenizationSimulateParams::WalletRecommendedDecision::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::TokenizationSimulateParams::WalletRecommendedDecision::TaggedSymbol + ) + REQUIRE_ADDITIONAL_AUTHENTICATION = + T.let( + :REQUIRE_ADDITIONAL_AUTHENTICATION, + Lithic::TokenizationSimulateParams::WalletRecommendedDecision::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::TokenizationSimulateParams::WalletRecommendedDecision::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/tokenization_tfa_reason.rbi b/rbi/lithic/models/tokenization_tfa_reason.rbi new file mode 100644 index 00000000..e8637d04 --- /dev/null +++ b/rbi/lithic/models/tokenization_tfa_reason.rbi @@ -0,0 +1,74 @@ +# typed: strong + +module Lithic + module Models + # Reason code for why a tokenization required two-factor authentication + module TokenizationTfaReason + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::TokenizationTfaReason) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_RECOMMENDED_TFA = + T.let( + :WALLET_RECOMMENDED_TFA, + Lithic::TokenizationTfaReason::TaggedSymbol + ) + SUSPICIOUS_ACTIVITY = + T.let(:SUSPICIOUS_ACTIVITY, Lithic::TokenizationTfaReason::TaggedSymbol) + DEVICE_RECENTLY_LOST = + T.let( + :DEVICE_RECENTLY_LOST, + Lithic::TokenizationTfaReason::TaggedSymbol + ) + TOO_MANY_RECENT_ATTEMPTS = + T.let( + :TOO_MANY_RECENT_ATTEMPTS, + Lithic::TokenizationTfaReason::TaggedSymbol + ) + TOO_MANY_RECENT_TOKENS = + T.let( + :TOO_MANY_RECENT_TOKENS, + Lithic::TokenizationTfaReason::TaggedSymbol + ) + TOO_MANY_DIFFERENT_CARDHOLDERS = + T.let( + :TOO_MANY_DIFFERENT_CARDHOLDERS, + Lithic::TokenizationTfaReason::TaggedSymbol + ) + OUTSIDE_HOME_TERRITORY = + T.let( + :OUTSIDE_HOME_TERRITORY, + Lithic::TokenizationTfaReason::TaggedSymbol + ) + HAS_SUSPENDED_TOKENS = + T.let( + :HAS_SUSPENDED_TOKENS, + Lithic::TokenizationTfaReason::TaggedSymbol + ) + HIGH_RISK = T.let(:HIGH_RISK, Lithic::TokenizationTfaReason::TaggedSymbol) + ACCOUNT_SCORE_LOW = + T.let(:ACCOUNT_SCORE_LOW, Lithic::TokenizationTfaReason::TaggedSymbol) + DEVICE_SCORE_LOW = + T.let(:DEVICE_SCORE_LOW, Lithic::TokenizationTfaReason::TaggedSymbol) + CARD_STATE_TFA = + T.let(:CARD_STATE_TFA, Lithic::TokenizationTfaReason::TaggedSymbol) + HARDCODED_TFA = + T.let(:HARDCODED_TFA, Lithic::TokenizationTfaReason::TaggedSymbol) + CUSTOMER_RULE_TFA = + T.let(:CUSTOMER_RULE_TFA, Lithic::TokenizationTfaReason::TaggedSymbol) + DEVICE_HOST_CARD_EMULATION = + T.let( + :DEVICE_HOST_CARD_EMULATION, + Lithic::TokenizationTfaReason::TaggedSymbol + ) + + sig do + override.returns(T::Array[Lithic::TokenizationTfaReason::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/lithic/models/tokenization_two_factor_authentication_code_sent_webhook_event.rbi b/rbi/lithic/models/tokenization_two_factor_authentication_code_sent_webhook_event.rbi new file mode 100644 index 00000000..83259f17 --- /dev/null +++ b/rbi/lithic/models/tokenization_two_factor_authentication_code_sent_webhook_event.rbi @@ -0,0 +1,186 @@ +# typed: strong + +module Lithic + module Models + class TokenizationTwoFactorAuthenticationCodeSentWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # Unique identifier for the user tokenizing a card + sig { returns(String) } + attr_accessor :account_token + + sig do + returns( + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod + ) + end + attr_reader :activation_method + + sig do + params( + activation_method: + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::OrHash + ).void + end + attr_writer :activation_method + + # Unique identifier for the card being tokenized + sig { returns(String) } + attr_accessor :card_token + + # Indicate when the request was received from Mastercard or Visa + sig { returns(Time) } + attr_accessor :created + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # Unique identifier for the tokenization + sig { returns(String) } + attr_accessor :tokenization_token + + sig do + params( + account_token: String, + activation_method: + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::OrHash, + card_token: String, + created: Time, + tokenization_token: String, + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the user tokenizing a card + account_token:, + activation_method:, + # Unique identifier for the card being tokenized + card_token:, + # Indicate when the request was received from Mastercard or Visa + created:, + # Unique identifier for the tokenization + tokenization_token:, + # The type of event that occurred. + event_type: :"tokenization.two_factor_authentication_code_sent" + ) + end + + sig do + override.returns( + { + account_token: String, + activation_method: + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod, + card_token: String, + created: Time, + event_type: Symbol, + tokenization_token: String + } + ) + end + def to_hash + end + + class ActivationMethod < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod, + Lithic::Internal::AnyHash + ) + end + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + sig do + returns( + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type::TaggedSymbol + ) + end + attr_accessor :type + + # The location to which the authentication code was sent. The format depends on + # the ActivationMethod.Type field. If Type is Email, the Value will be the email + # address. If the Type is Sms, the Value will be the phone number. + sig { returns(String) } + attr_accessor :value + + sig do + params( + type: + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type::OrSymbol, + value: String + ).returns(T.attached_class) + end + def self.new( + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + type:, + # The location to which the authentication code was sent. The format depends on + # the ActivationMethod.Type field. If Type is Email, the Value will be the email + # address. If the Type is Sms, the Value will be the phone number. + value: + ) + end + + sig do + override.returns( + { + type: + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type::TaggedSymbol, + value: String + } + ) + end + def to_hash + end + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EMAIL_TO_CARDHOLDER_ADDRESS = + T.let( + :EMAIL_TO_CARDHOLDER_ADDRESS, + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type::TaggedSymbol + ) + TEXT_TO_CARDHOLDER_NUMBER = + T.let( + :TEXT_TO_CARDHOLDER_NUMBER, + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/tokenization_two_factor_authentication_code_webhook_event.rbi b/rbi/lithic/models/tokenization_two_factor_authentication_code_webhook_event.rbi new file mode 100644 index 00000000..2bc789e3 --- /dev/null +++ b/rbi/lithic/models/tokenization_two_factor_authentication_code_webhook_event.rbi @@ -0,0 +1,194 @@ +# typed: strong + +module Lithic + module Models + class TokenizationTwoFactorAuthenticationCodeWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # Unique identifier for the user tokenizing a card + sig { returns(String) } + attr_accessor :account_token + + sig do + returns( + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod + ) + end + attr_reader :activation_method + + sig do + params( + activation_method: + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::OrHash + ).void + end + attr_writer :activation_method + + # Authentication code to provide to the user tokenizing a card. + sig { returns(String) } + attr_accessor :authentication_code + + # Unique identifier for the card being tokenized + sig { returns(String) } + attr_accessor :card_token + + # Indicate when the request was received from Mastercard or Visa + sig { returns(Time) } + attr_accessor :created + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + # Unique identifier for the tokenization + sig { returns(String) } + attr_accessor :tokenization_token + + sig do + params( + account_token: String, + activation_method: + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::OrHash, + authentication_code: String, + card_token: String, + created: Time, + tokenization_token: String, + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the user tokenizing a card + account_token:, + activation_method:, + # Authentication code to provide to the user tokenizing a card. + authentication_code:, + # Unique identifier for the card being tokenized + card_token:, + # Indicate when the request was received from Mastercard or Visa + created:, + # Unique identifier for the tokenization + tokenization_token:, + # The type of event that occurred. + event_type: :"tokenization.two_factor_authentication_code" + ) + end + + sig do + override.returns( + { + account_token: String, + activation_method: + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod, + authentication_code: String, + card_token: String, + created: Time, + event_type: Symbol, + tokenization_token: String + } + ) + end + def to_hash + end + + class ActivationMethod < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod, + Lithic::Internal::AnyHash + ) + end + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + sig do + returns( + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type::TaggedSymbol + ) + end + attr_accessor :type + + # The location where the user wants to receive the authentication code. The format + # depends on the ActivationMethod.Type field. If Type is Email, the Value will be + # the email address. If the Type is Sms, the Value will be the phone number. + sig { returns(String) } + attr_accessor :value + + sig do + params( + type: + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type::OrSymbol, + value: String + ).returns(T.attached_class) + end + def self.new( + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + type:, + # The location where the user wants to receive the authentication code. The format + # depends on the ActivationMethod.Type field. If Type is Email, the Value will be + # the email address. If the Type is Sms, the Value will be the phone number. + value: + ) + end + + sig do + override.returns( + { + type: + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type::TaggedSymbol, + value: String + } + ) + end + def to_hash + end + + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EMAIL_TO_CARDHOLDER_ADDRESS = + T.let( + :EMAIL_TO_CARDHOLDER_ADDRESS, + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type::TaggedSymbol + ) + TEXT_TO_CARDHOLDER_NUMBER = + T.let( + :TEXT_TO_CARDHOLDER_NUMBER, + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/tokenization_unpause_params.rbi b/rbi/lithic/models/tokenization_unpause_params.rbi new file mode 100644 index 00000000..a19a35fd --- /dev/null +++ b/rbi/lithic/models/tokenization_unpause_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Lithic + module Models + class TokenizationUnpauseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::TokenizationUnpauseParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :tokenization_token + + sig do + params( + tokenization_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(tokenization_token:, request_options: {}) + end + + sig do + override.returns( + { + tokenization_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/tokenization_update_digital_card_art_params.rbi b/rbi/lithic/models/tokenization_update_digital_card_art_params.rbi new file mode 100644 index 00000000..0fe06edb --- /dev/null +++ b/rbi/lithic/models/tokenization_update_digital_card_art_params.rbi @@ -0,0 +1,61 @@ +# typed: strong + +module Lithic + module Models + class TokenizationUpdateDigitalCardArtParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TokenizationUpdateDigitalCardArtParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :tokenization_token + + # Specifies the digital card art to be displayed in the user’s digital wallet for + # a tokenization. This artwork must be approved by the network and configured by + # Lithic to use. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + sig { returns(T.nilable(String)) } + attr_reader :digital_card_art_token + + sig { params(digital_card_art_token: String).void } + attr_writer :digital_card_art_token + + sig do + params( + tokenization_token: String, + digital_card_art_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + tokenization_token:, + # Specifies the digital card art to be displayed in the user’s digital wallet for + # a tokenization. This artwork must be approved by the network and configured by + # Lithic to use. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + digital_card_art_token: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + tokenization_token: String, + digital_card_art_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/tokenization_updated_webhook_event.rbi b/rbi/lithic/models/tokenization_updated_webhook_event.rbi new file mode 100644 index 00000000..dbebf045 --- /dev/null +++ b/rbi/lithic/models/tokenization_updated_webhook_event.rbi @@ -0,0 +1,73 @@ +# typed: strong + +module Lithic + module Models + class TokenizationUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TokenizationUpdatedWebhookEvent, + Lithic::Internal::AnyHash + ) + end + + # Account token + sig { returns(String) } + attr_accessor :account_token + + # Card token + sig { returns(String) } + attr_accessor :card_token + + # Created date + sig { returns(Time) } + attr_accessor :created + + # The type of event that occurred. + sig { returns(Symbol) } + attr_accessor :event_type + + sig { returns(Lithic::Tokenization) } + attr_reader :tokenization + + sig { params(tokenization: Lithic::Tokenization::OrHash).void } + attr_writer :tokenization + + sig do + params( + account_token: String, + card_token: String, + created: Time, + tokenization: Lithic::Tokenization::OrHash, + event_type: Symbol + ).returns(T.attached_class) + end + def self.new( + # Account token + account_token:, + # Card token + card_token:, + # Created date + created:, + tokenization:, + # The type of event that occurred. + event_type: :"tokenization.updated" + ) + end + + sig do + override.returns( + { + account_token: String, + card_token: String, + created: Time, + event_type: Symbol, + tokenization: Lithic::Tokenization + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/transaction.rbi b/rbi/lithic/models/transaction.rbi new file mode 100644 index 00000000..9878c97a --- /dev/null +++ b/rbi/lithic/models/transaction.rbi @@ -0,0 +1,3378 @@ +# typed: strong + +module Lithic + module Models + class Transaction < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Lithic::Transaction, Lithic::Internal::AnyHash) } + + # Globally unique identifier. + sig { returns(String) } + attr_accessor :token + + # The token for the account associated with this transaction. + sig { returns(String) } + attr_accessor :account_token + + # Fee assessed by the merchant and paid for by the cardholder in the smallest unit + # of the currency. Will be zero if no fee is assessed. Rebates may be transmitted + # as a negative value to indicate credited fees. + sig { returns(T.nilable(Integer)) } + attr_accessor :acquirer_fee + + # Unique identifier assigned to a transaction by the acquirer that can be used in + # dispute and chargeback filing. This field has been deprecated in favor of the + # `acquirer_reference_number` that resides in the event-level `network_info`. + sig { returns(T.nilable(String)) } + attr_accessor :acquirer_reference_number + + # When the transaction is pending, this represents the authorization amount of the + # transaction in the anticipated settlement currency. Once the transaction has + # settled, this field represents the settled amount in the settlement currency. + sig { returns(Integer) } + attr_accessor :amount + + sig { returns(Lithic::Transaction::Amounts) } + attr_reader :amounts + + sig { params(amounts: Lithic::Transaction::Amounts::OrHash).void } + attr_writer :amounts + + # The authorization amount of the transaction in the anticipated settlement + # currency. + sig { returns(T.nilable(Integer)) } + attr_accessor :authorization_amount + + # A fixed-width 6-digit numeric identifier that can be used to identify a + # transaction with networks. + sig { returns(T.nilable(String)) } + attr_accessor :authorization_code + + sig { returns(T.nilable(Lithic::Transaction::Avs)) } + attr_reader :avs + + sig { params(avs: T.nilable(Lithic::Transaction::Avs::OrHash)).void } + attr_writer :avs + + # Token for the card used in this transaction. + sig { returns(String) } + attr_accessor :card_token + + sig { returns(T.nilable(Lithic::CardholderAuthentication)) } + attr_reader :cardholder_authentication + + sig do + params( + cardholder_authentication: + T.nilable(Lithic::CardholderAuthentication::OrHash) + ).void + end + attr_writer :cardholder_authentication + + # Date and time when the transaction first occurred. UTC time zone. + sig { returns(Time) } + attr_accessor :created + + sig { returns(T.nilable(String)) } + attr_accessor :financial_account_token + + # Merchant information including full location details. + sig { returns(Lithic::Transaction::Merchant) } + attr_reader :merchant + + sig { params(merchant: Lithic::Transaction::Merchant::OrHash).void } + attr_writer :merchant + + # Analogous to the 'amount', but in the merchant currency. + sig { returns(T.nilable(Integer)) } + attr_accessor :merchant_amount + + # Analogous to the 'authorization_amount', but in the merchant currency. + sig { returns(T.nilable(Integer)) } + attr_accessor :merchant_authorization_amount + + # 3-character alphabetic ISO 4217 code for the local currency of the transaction. + sig { returns(String) } + attr_accessor :merchant_currency + + # Card network of the authorization. Value is `UNKNOWN` when Lithic cannot + # determine the network code from the upstream provider. + sig { returns(T.nilable(Lithic::Transaction::Network::TaggedSymbol)) } + attr_accessor :network + + # Network-provided score assessing risk level associated with a given + # authorization. Scores are on a range of 0-999, with 0 representing the lowest + # risk and 999 representing the highest risk. For Visa transactions, where the raw + # score has a range of 0-99, Lithic will normalize the score by multiplying the + # raw score by 10x. + sig { returns(T.nilable(Integer)) } + attr_accessor :network_risk_score + + sig { returns(Lithic::Transaction::Pos) } + attr_reader :pos + + sig { params(pos: Lithic::Transaction::Pos::OrHash).void } + attr_writer :pos + + sig { returns(Lithic::Transaction::Result::TaggedSymbol) } + attr_accessor :result + + # Where the cardholder received the service, when different from the card acceptor + # location. This is populated from network data elements such as Mastercard DE-122 + # SE1 SF9-14 and Visa F34 DS02. + sig { returns(T.nilable(Lithic::Transaction::ServiceLocation)) } + attr_reader :service_location + + sig do + params( + service_location: + T.nilable(Lithic::Transaction::ServiceLocation::OrHash) + ).void + end + attr_writer :service_location + + # The settled amount of the transaction in the settlement currency. + sig { returns(Integer) } + attr_accessor :settled_amount + + # Status of the transaction. + sig { returns(Lithic::Transaction::Status::TaggedSymbol) } + attr_accessor :status + + # Key-value pairs for tagging resources. Tags allow you to associate arbitrary + # metadata with a resource for your own purposes. + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :tags + + sig { returns(T.nilable(Lithic::TokenInfo)) } + attr_reader :token_info + + sig { params(token_info: T.nilable(Lithic::TokenInfo::OrHash)).void } + attr_writer :token_info + + # Date and time when the transaction last updated. UTC time zone. + sig { returns(Time) } + attr_accessor :updated + + sig { returns(T.nilable(T::Array[Lithic::Transaction::Event])) } + attr_reader :events + + sig { params(events: T::Array[Lithic::Transaction::Event::OrHash]).void } + attr_writer :events + + sig do + params( + token: String, + account_token: String, + acquirer_fee: T.nilable(Integer), + acquirer_reference_number: T.nilable(String), + amount: Integer, + amounts: Lithic::Transaction::Amounts::OrHash, + authorization_amount: T.nilable(Integer), + authorization_code: T.nilable(String), + avs: T.nilable(Lithic::Transaction::Avs::OrHash), + card_token: String, + cardholder_authentication: + T.nilable(Lithic::CardholderAuthentication::OrHash), + created: Time, + financial_account_token: T.nilable(String), + merchant: Lithic::Transaction::Merchant::OrHash, + merchant_amount: T.nilable(Integer), + merchant_authorization_amount: T.nilable(Integer), + merchant_currency: String, + network: T.nilable(Lithic::Transaction::Network::OrSymbol), + network_risk_score: T.nilable(Integer), + pos: Lithic::Transaction::Pos::OrHash, + result: Lithic::Transaction::Result::OrSymbol, + service_location: + T.nilable(Lithic::Transaction::ServiceLocation::OrHash), + settled_amount: Integer, + status: Lithic::Transaction::Status::OrSymbol, + tags: T::Hash[Symbol, String], + token_info: T.nilable(Lithic::TokenInfo::OrHash), + updated: Time, + events: T::Array[Lithic::Transaction::Event::OrHash] + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier. + token:, + # The token for the account associated with this transaction. + account_token:, + # Fee assessed by the merchant and paid for by the cardholder in the smallest unit + # of the currency. Will be zero if no fee is assessed. Rebates may be transmitted + # as a negative value to indicate credited fees. + acquirer_fee:, + # Unique identifier assigned to a transaction by the acquirer that can be used in + # dispute and chargeback filing. This field has been deprecated in favor of the + # `acquirer_reference_number` that resides in the event-level `network_info`. + acquirer_reference_number:, + # When the transaction is pending, this represents the authorization amount of the + # transaction in the anticipated settlement currency. Once the transaction has + # settled, this field represents the settled amount in the settlement currency. + amount:, + amounts:, + # The authorization amount of the transaction in the anticipated settlement + # currency. + authorization_amount:, + # A fixed-width 6-digit numeric identifier that can be used to identify a + # transaction with networks. + authorization_code:, + avs:, + # Token for the card used in this transaction. + card_token:, + cardholder_authentication:, + # Date and time when the transaction first occurred. UTC time zone. + created:, + financial_account_token:, + # Merchant information including full location details. + merchant:, + # Analogous to the 'amount', but in the merchant currency. + merchant_amount:, + # Analogous to the 'authorization_amount', but in the merchant currency. + merchant_authorization_amount:, + # 3-character alphabetic ISO 4217 code for the local currency of the transaction. + merchant_currency:, + # Card network of the authorization. Value is `UNKNOWN` when Lithic cannot + # determine the network code from the upstream provider. + network:, + # Network-provided score assessing risk level associated with a given + # authorization. Scores are on a range of 0-999, with 0 representing the lowest + # risk and 999 representing the highest risk. For Visa transactions, where the raw + # score has a range of 0-99, Lithic will normalize the score by multiplying the + # raw score by 10x. + network_risk_score:, + pos:, + result:, + # Where the cardholder received the service, when different from the card acceptor + # location. This is populated from network data elements such as Mastercard DE-122 + # SE1 SF9-14 and Visa F34 DS02. + service_location:, + # The settled amount of the transaction in the settlement currency. + settled_amount:, + # Status of the transaction. + status:, + # Key-value pairs for tagging resources. Tags allow you to associate arbitrary + # metadata with a resource for your own purposes. + tags:, + token_info:, + # Date and time when the transaction last updated. UTC time zone. + updated:, + events: nil + ) + end + + sig do + override.returns( + { + token: String, + account_token: String, + acquirer_fee: T.nilable(Integer), + acquirer_reference_number: T.nilable(String), + amount: Integer, + amounts: Lithic::Transaction::Amounts, + authorization_amount: T.nilable(Integer), + authorization_code: T.nilable(String), + avs: T.nilable(Lithic::Transaction::Avs), + card_token: String, + cardholder_authentication: + T.nilable(Lithic::CardholderAuthentication), + created: Time, + financial_account_token: T.nilable(String), + merchant: Lithic::Transaction::Merchant, + merchant_amount: T.nilable(Integer), + merchant_authorization_amount: T.nilable(Integer), + merchant_currency: String, + network: T.nilable(Lithic::Transaction::Network::TaggedSymbol), + network_risk_score: T.nilable(Integer), + pos: Lithic::Transaction::Pos, + result: Lithic::Transaction::Result::TaggedSymbol, + service_location: T.nilable(Lithic::Transaction::ServiceLocation), + settled_amount: Integer, + status: Lithic::Transaction::Status::TaggedSymbol, + tags: T::Hash[Symbol, String], + token_info: T.nilable(Lithic::TokenInfo), + updated: Time, + events: T::Array[Lithic::Transaction::Event] + } + ) + end + def to_hash + end + + class Amounts < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::Transaction::Amounts, Lithic::Internal::AnyHash) + end + + sig { returns(Lithic::Transaction::Amounts::Cardholder) } + attr_reader :cardholder + + sig do + params( + cardholder: Lithic::Transaction::Amounts::Cardholder::OrHash + ).void + end + attr_writer :cardholder + + sig { returns(Lithic::Transaction::Amounts::Hold) } + attr_reader :hold + + sig { params(hold: Lithic::Transaction::Amounts::Hold::OrHash).void } + attr_writer :hold + + sig { returns(Lithic::Transaction::Amounts::Merchant) } + attr_reader :merchant + + sig do + params(merchant: Lithic::Transaction::Amounts::Merchant::OrHash).void + end + attr_writer :merchant + + sig { returns(Lithic::Transaction::Amounts::Settlement) } + attr_reader :settlement + + sig do + params( + settlement: Lithic::Transaction::Amounts::Settlement::OrHash + ).void + end + attr_writer :settlement + + sig do + params( + cardholder: Lithic::Transaction::Amounts::Cardholder::OrHash, + hold: Lithic::Transaction::Amounts::Hold::OrHash, + merchant: Lithic::Transaction::Amounts::Merchant::OrHash, + settlement: Lithic::Transaction::Amounts::Settlement::OrHash + ).returns(T.attached_class) + end + def self.new(cardholder:, hold:, merchant:, settlement:) + end + + sig do + override.returns( + { + cardholder: Lithic::Transaction::Amounts::Cardholder, + hold: Lithic::Transaction::Amounts::Hold, + merchant: Lithic::Transaction::Amounts::Merchant, + settlement: Lithic::Transaction::Amounts::Settlement + } + ) + end + def to_hash + end + + class Cardholder < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Transaction::Amounts::Cardholder, + Lithic::Internal::AnyHash + ) + end + + # The estimated settled amount of the transaction in the cardholder billing + # currency. + sig { returns(Integer) } + attr_accessor :amount + + # The exchange rate used to convert the merchant amount to the cardholder billing + # amount. + sig { returns(String) } + attr_accessor :conversion_rate + + # 3-character alphabetic ISO 4217 currency + sig { returns(String) } + attr_accessor :currency + + sig do + params( + amount: Integer, + conversion_rate: String, + currency: String + ).returns(T.attached_class) + end + def self.new( + # The estimated settled amount of the transaction in the cardholder billing + # currency. + amount:, + # The exchange rate used to convert the merchant amount to the cardholder billing + # amount. + conversion_rate:, + # 3-character alphabetic ISO 4217 currency + currency: + ) + end + + sig do + override.returns( + { amount: Integer, conversion_rate: String, currency: String } + ) + end + def to_hash + end + end + + class Hold < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Transaction::Amounts::Hold, + Lithic::Internal::AnyHash + ) + end + + # The pending amount of the transaction in the anticipated settlement currency. + sig { returns(Integer) } + attr_accessor :amount + + # 3-character alphabetic ISO 4217 currency + sig { returns(String) } + attr_accessor :currency + + sig do + params(amount: Integer, currency: String).returns(T.attached_class) + end + def self.new( + # The pending amount of the transaction in the anticipated settlement currency. + amount:, + # 3-character alphabetic ISO 4217 currency + currency: + ) + end + + sig { override.returns({ amount: Integer, currency: String }) } + def to_hash + end + end + + class Merchant < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Transaction::Amounts::Merchant, + Lithic::Internal::AnyHash + ) + end + + # The settled amount of the transaction in the merchant currency. + sig { returns(Integer) } + attr_accessor :amount + + # 3-character alphabetic ISO 4217 currency + sig { returns(String) } + attr_accessor :currency + + sig do + params(amount: Integer, currency: String).returns(T.attached_class) + end + def self.new( + # The settled amount of the transaction in the merchant currency. + amount:, + # 3-character alphabetic ISO 4217 currency + currency: + ) + end + + sig { override.returns({ amount: Integer, currency: String }) } + def to_hash + end + end + + class Settlement < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Transaction::Amounts::Settlement, + Lithic::Internal::AnyHash + ) + end + + # The settled amount of the transaction in the settlement currency. + sig { returns(Integer) } + attr_accessor :amount + + # 3-character alphabetic ISO 4217 currency + sig { returns(String) } + attr_accessor :currency + + sig do + params(amount: Integer, currency: String).returns(T.attached_class) + end + def self.new( + # The settled amount of the transaction in the settlement currency. + amount:, + # 3-character alphabetic ISO 4217 currency + currency: + ) + end + + sig { override.returns({ amount: Integer, currency: String }) } + def to_hash + end + end + end + + class Avs < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::Transaction::Avs, Lithic::Internal::AnyHash) + end + + # Cardholder address + sig { returns(String) } + attr_accessor :address + + # Cardholder ZIP code + sig { returns(String) } + attr_accessor :zipcode + + sig do + params(address: String, zipcode: String).returns(T.attached_class) + end + def self.new( + # Cardholder address + address:, + # Cardholder ZIP code + zipcode: + ) + end + + sig { override.returns({ address: String, zipcode: String }) } + def to_hash + end + end + + class Merchant < Lithic::Models::Merchant + OrHash = + T.type_alias do + T.any(Lithic::Transaction::Merchant, Lithic::Internal::AnyHash) + end + + # Phone number of card acceptor. + sig { returns(T.nilable(String)) } + attr_accessor :phone_number + + # Postal code of card acceptor. + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + # Street address of card acceptor. + sig { returns(T.nilable(String)) } + attr_accessor :street_address + + # Merchant information including full location details. + sig do + params( + phone_number: T.nilable(String), + postal_code: T.nilable(String), + street_address: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Phone number of card acceptor. + phone_number:, + # Postal code of card acceptor. + postal_code:, + # Street address of card acceptor. + street_address: + ) + end + + sig do + override.returns( + { + phone_number: T.nilable(String), + postal_code: T.nilable(String), + street_address: T.nilable(String) + } + ) + end + def to_hash + end + end + + # Card network of the authorization. Value is `UNKNOWN` when Lithic cannot + # determine the network code from the upstream provider. + module Network + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Transaction::Network) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AMEX = T.let(:AMEX, Lithic::Transaction::Network::TaggedSymbol) + INTERLINK = + T.let(:INTERLINK, Lithic::Transaction::Network::TaggedSymbol) + MAESTRO = T.let(:MAESTRO, Lithic::Transaction::Network::TaggedSymbol) + MASTERCARD = + T.let(:MASTERCARD, Lithic::Transaction::Network::TaggedSymbol) + UNKNOWN = T.let(:UNKNOWN, Lithic::Transaction::Network::TaggedSymbol) + VISA = T.let(:VISA, Lithic::Transaction::Network::TaggedSymbol) + + sig do + override.returns(T::Array[Lithic::Transaction::Network::TaggedSymbol]) + end + def self.values + end + end + + class Pos < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::Transaction::Pos, Lithic::Internal::AnyHash) + end + + sig { returns(Lithic::Transaction::Pos::EntryMode) } + attr_reader :entry_mode + + sig do + params(entry_mode: Lithic::Transaction::Pos::EntryMode::OrHash).void + end + attr_writer :entry_mode + + sig { returns(Lithic::Transaction::Pos::Terminal) } + attr_reader :terminal + + sig do + params(terminal: Lithic::Transaction::Pos::Terminal::OrHash).void + end + attr_writer :terminal + + sig do + params( + entry_mode: Lithic::Transaction::Pos::EntryMode::OrHash, + terminal: Lithic::Transaction::Pos::Terminal::OrHash + ).returns(T.attached_class) + end + def self.new(entry_mode:, terminal:) + end + + sig do + override.returns( + { + entry_mode: Lithic::Transaction::Pos::EntryMode, + terminal: Lithic::Transaction::Pos::Terminal + } + ) + end + def to_hash + end + + class EntryMode < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Transaction::Pos::EntryMode, + Lithic::Internal::AnyHash + ) + end + + # Card presence indicator + sig do + returns(Lithic::Transaction::Pos::EntryMode::Card::TaggedSymbol) + end + attr_accessor :card + + # Cardholder presence indicator + sig do + returns( + Lithic::Transaction::Pos::EntryMode::Cardholder::TaggedSymbol + ) + end + attr_accessor :cardholder + + # Method of entry for the PAN + sig do + returns(Lithic::Transaction::Pos::EntryMode::Pan::TaggedSymbol) + end + attr_accessor :pan + + # Indicates whether the cardholder entered the PIN. True if the PIN was entered. + sig { returns(T::Boolean) } + attr_accessor :pin_entered + + sig do + params( + card: Lithic::Transaction::Pos::EntryMode::Card::OrSymbol, + cardholder: + Lithic::Transaction::Pos::EntryMode::Cardholder::OrSymbol, + pan: Lithic::Transaction::Pos::EntryMode::Pan::OrSymbol, + pin_entered: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # Card presence indicator + card:, + # Cardholder presence indicator + cardholder:, + # Method of entry for the PAN + pan:, + # Indicates whether the cardholder entered the PIN. True if the PIN was entered. + pin_entered: + ) + end + + sig do + override.returns( + { + card: Lithic::Transaction::Pos::EntryMode::Card::TaggedSymbol, + cardholder: + Lithic::Transaction::Pos::EntryMode::Cardholder::TaggedSymbol, + pan: Lithic::Transaction::Pos::EntryMode::Pan::TaggedSymbol, + pin_entered: T::Boolean + } + ) + end + def to_hash + end + + # Card presence indicator + module Card + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Transaction::Pos::EntryMode::Card) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NOT_PRESENT = + T.let( + :NOT_PRESENT, + Lithic::Transaction::Pos::EntryMode::Card::TaggedSymbol + ) + PREAUTHORIZED = + T.let( + :PREAUTHORIZED, + Lithic::Transaction::Pos::EntryMode::Card::TaggedSymbol + ) + PRESENT = + T.let( + :PRESENT, + Lithic::Transaction::Pos::EntryMode::Card::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::Transaction::Pos::EntryMode::Card::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Transaction::Pos::EntryMode::Card::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Cardholder presence indicator + module Cardholder + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Transaction::Pos::EntryMode::Cardholder) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DEFERRED_BILLING = + T.let( + :DEFERRED_BILLING, + Lithic::Transaction::Pos::EntryMode::Cardholder::TaggedSymbol + ) + ELECTRONIC_ORDER = + T.let( + :ELECTRONIC_ORDER, + Lithic::Transaction::Pos::EntryMode::Cardholder::TaggedSymbol + ) + INSTALLMENT = + T.let( + :INSTALLMENT, + Lithic::Transaction::Pos::EntryMode::Cardholder::TaggedSymbol + ) + MAIL_ORDER = + T.let( + :MAIL_ORDER, + Lithic::Transaction::Pos::EntryMode::Cardholder::TaggedSymbol + ) + NOT_PRESENT = + T.let( + :NOT_PRESENT, + Lithic::Transaction::Pos::EntryMode::Cardholder::TaggedSymbol + ) + PREAUTHORIZED = + T.let( + :PREAUTHORIZED, + Lithic::Transaction::Pos::EntryMode::Cardholder::TaggedSymbol + ) + PRESENT = + T.let( + :PRESENT, + Lithic::Transaction::Pos::EntryMode::Cardholder::TaggedSymbol + ) + REOCCURRING = + T.let( + :REOCCURRING, + Lithic::Transaction::Pos::EntryMode::Cardholder::TaggedSymbol + ) + TELEPHONE_ORDER = + T.let( + :TELEPHONE_ORDER, + Lithic::Transaction::Pos::EntryMode::Cardholder::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::Transaction::Pos::EntryMode::Cardholder::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Transaction::Pos::EntryMode::Cardholder::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Method of entry for the PAN + module Pan + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Transaction::Pos::EntryMode::Pan) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AUTO_ENTRY = + T.let( + :AUTO_ENTRY, + Lithic::Transaction::Pos::EntryMode::Pan::TaggedSymbol + ) + BAR_CODE = + T.let( + :BAR_CODE, + Lithic::Transaction::Pos::EntryMode::Pan::TaggedSymbol + ) + CONTACTLESS = + T.let( + :CONTACTLESS, + Lithic::Transaction::Pos::EntryMode::Pan::TaggedSymbol + ) + CREDENTIAL_ON_FILE = + T.let( + :CREDENTIAL_ON_FILE, + Lithic::Transaction::Pos::EntryMode::Pan::TaggedSymbol + ) + ECOMMERCE = + T.let( + :ECOMMERCE, + Lithic::Transaction::Pos::EntryMode::Pan::TaggedSymbol + ) + ERROR_KEYED = + T.let( + :ERROR_KEYED, + Lithic::Transaction::Pos::EntryMode::Pan::TaggedSymbol + ) + ERROR_MAGNETIC_STRIPE = + T.let( + :ERROR_MAGNETIC_STRIPE, + Lithic::Transaction::Pos::EntryMode::Pan::TaggedSymbol + ) + ICC = + T.let( + :ICC, + Lithic::Transaction::Pos::EntryMode::Pan::TaggedSymbol + ) + KEY_ENTERED = + T.let( + :KEY_ENTERED, + Lithic::Transaction::Pos::EntryMode::Pan::TaggedSymbol + ) + MAGNETIC_STRIPE = + T.let( + :MAGNETIC_STRIPE, + Lithic::Transaction::Pos::EntryMode::Pan::TaggedSymbol + ) + MANUAL = + T.let( + :MANUAL, + Lithic::Transaction::Pos::EntryMode::Pan::TaggedSymbol + ) + OCR = + T.let( + :OCR, + Lithic::Transaction::Pos::EntryMode::Pan::TaggedSymbol + ) + SECURE_CARDLESS = + T.let( + :SECURE_CARDLESS, + Lithic::Transaction::Pos::EntryMode::Pan::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::Transaction::Pos::EntryMode::Pan::TaggedSymbol + ) + UNSPECIFIED = + T.let( + :UNSPECIFIED, + Lithic::Transaction::Pos::EntryMode::Pan::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::Transaction::Pos::EntryMode::Pan::TaggedSymbol] + ) + end + def self.values + end + end + end + + class Terminal < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Transaction::Pos::Terminal, + Lithic::Internal::AnyHash + ) + end + + # True if a clerk is present at the sale. + sig { returns(T::Boolean) } + attr_accessor :attended + + # True if the terminal is capable of retaining the card. + sig { returns(T::Boolean) } + attr_accessor :card_retention_capable + + # True if the sale was made at the place of business (vs. mobile). + sig { returns(T::Boolean) } + attr_accessor :on_premise + + # The person that is designated to swipe the card + sig do + returns(Lithic::Transaction::Pos::Terminal::Operator::TaggedSymbol) + end + attr_accessor :operator + + # True if the terminal is capable of partial approval. Partial approval is when + # part of a transaction is approved and another payment must be used for the + # remainder. Example scenario: A $40 transaction is attempted on a prepaid card + # with a $25 balance. If partial approval is enabled, $25 can be authorized, at + # which point the POS will prompt the user for an additional payment of $15. + sig { returns(T::Boolean) } + attr_accessor :partial_approval_capable + + # Status of whether the POS is able to accept PINs + sig do + returns( + Lithic::Transaction::Pos::Terminal::PinCapability::TaggedSymbol + ) + end + attr_accessor :pin_capability + + # POS Type + sig do + returns(Lithic::Transaction::Pos::Terminal::Type::TaggedSymbol) + end + attr_accessor :type + + # Uniquely identifies a terminal at the card acceptor location of acquiring + # institutions or merchant POS Systems + sig { returns(T.nilable(String)) } + attr_accessor :acceptor_terminal_id + + sig do + params( + attended: T::Boolean, + card_retention_capable: T::Boolean, + on_premise: T::Boolean, + operator: Lithic::Transaction::Pos::Terminal::Operator::OrSymbol, + partial_approval_capable: T::Boolean, + pin_capability: + Lithic::Transaction::Pos::Terminal::PinCapability::OrSymbol, + type: Lithic::Transaction::Pos::Terminal::Type::OrSymbol, + acceptor_terminal_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # True if a clerk is present at the sale. + attended:, + # True if the terminal is capable of retaining the card. + card_retention_capable:, + # True if the sale was made at the place of business (vs. mobile). + on_premise:, + # The person that is designated to swipe the card + operator:, + # True if the terminal is capable of partial approval. Partial approval is when + # part of a transaction is approved and another payment must be used for the + # remainder. Example scenario: A $40 transaction is attempted on a prepaid card + # with a $25 balance. If partial approval is enabled, $25 can be authorized, at + # which point the POS will prompt the user for an additional payment of $15. + partial_approval_capable:, + # Status of whether the POS is able to accept PINs + pin_capability:, + # POS Type + type:, + # Uniquely identifies a terminal at the card acceptor location of acquiring + # institutions or merchant POS Systems + acceptor_terminal_id: nil + ) + end + + sig do + override.returns( + { + attended: T::Boolean, + card_retention_capable: T::Boolean, + on_premise: T::Boolean, + operator: + Lithic::Transaction::Pos::Terminal::Operator::TaggedSymbol, + partial_approval_capable: T::Boolean, + pin_capability: + Lithic::Transaction::Pos::Terminal::PinCapability::TaggedSymbol, + type: Lithic::Transaction::Pos::Terminal::Type::TaggedSymbol, + acceptor_terminal_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The person that is designated to swipe the card + module Operator + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Transaction::Pos::Terminal::Operator) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ADMINISTRATIVE = + T.let( + :ADMINISTRATIVE, + Lithic::Transaction::Pos::Terminal::Operator::TaggedSymbol + ) + CARDHOLDER = + T.let( + :CARDHOLDER, + Lithic::Transaction::Pos::Terminal::Operator::TaggedSymbol + ) + CARD_ACCEPTOR = + T.let( + :CARD_ACCEPTOR, + Lithic::Transaction::Pos::Terminal::Operator::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::Transaction::Pos::Terminal::Operator::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Transaction::Pos::Terminal::Operator::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Status of whether the POS is able to accept PINs + module PinCapability + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Transaction::Pos::Terminal::PinCapability) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CAPABLE = + T.let( + :CAPABLE, + Lithic::Transaction::Pos::Terminal::PinCapability::TaggedSymbol + ) + INOPERATIVE = + T.let( + :INOPERATIVE, + Lithic::Transaction::Pos::Terminal::PinCapability::TaggedSymbol + ) + NOT_CAPABLE = + T.let( + :NOT_CAPABLE, + Lithic::Transaction::Pos::Terminal::PinCapability::TaggedSymbol + ) + UNSPECIFIED = + T.let( + :UNSPECIFIED, + Lithic::Transaction::Pos::Terminal::PinCapability::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Transaction::Pos::Terminal::PinCapability::TaggedSymbol + ] + ) + end + def self.values + end + end + + # POS Type + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Transaction::Pos::Terminal::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ADMINISTRATIVE = + T.let( + :ADMINISTRATIVE, + Lithic::Transaction::Pos::Terminal::Type::TaggedSymbol + ) + ATM = + T.let( + :ATM, + Lithic::Transaction::Pos::Terminal::Type::TaggedSymbol + ) + AUTHORIZATION = + T.let( + :AUTHORIZATION, + Lithic::Transaction::Pos::Terminal::Type::TaggedSymbol + ) + COUPON_MACHINE = + T.let( + :COUPON_MACHINE, + Lithic::Transaction::Pos::Terminal::Type::TaggedSymbol + ) + DIAL_TERMINAL = + T.let( + :DIAL_TERMINAL, + Lithic::Transaction::Pos::Terminal::Type::TaggedSymbol + ) + ECOMMERCE = + T.let( + :ECOMMERCE, + Lithic::Transaction::Pos::Terminal::Type::TaggedSymbol + ) + ECR = + T.let( + :ECR, + Lithic::Transaction::Pos::Terminal::Type::TaggedSymbol + ) + FUEL_MACHINE = + T.let( + :FUEL_MACHINE, + Lithic::Transaction::Pos::Terminal::Type::TaggedSymbol + ) + HOME_TERMINAL = + T.let( + :HOME_TERMINAL, + Lithic::Transaction::Pos::Terminal::Type::TaggedSymbol + ) + MICR = + T.let( + :MICR, + Lithic::Transaction::Pos::Terminal::Type::TaggedSymbol + ) + OFF_PREMISE = + T.let( + :OFF_PREMISE, + Lithic::Transaction::Pos::Terminal::Type::TaggedSymbol + ) + PAYMENT = + T.let( + :PAYMENT, + Lithic::Transaction::Pos::Terminal::Type::TaggedSymbol + ) + PDA = + T.let( + :PDA, + Lithic::Transaction::Pos::Terminal::Type::TaggedSymbol + ) + PHONE = + T.let( + :PHONE, + Lithic::Transaction::Pos::Terminal::Type::TaggedSymbol + ) + POINT = + T.let( + :POINT, + Lithic::Transaction::Pos::Terminal::Type::TaggedSymbol + ) + POS_TERMINAL = + T.let( + :POS_TERMINAL, + Lithic::Transaction::Pos::Terminal::Type::TaggedSymbol + ) + PUBLIC_UTILITY = + T.let( + :PUBLIC_UTILITY, + Lithic::Transaction::Pos::Terminal::Type::TaggedSymbol + ) + SELF_SERVICE = + T.let( + :SELF_SERVICE, + Lithic::Transaction::Pos::Terminal::Type::TaggedSymbol + ) + TELEVISION = + T.let( + :TELEVISION, + Lithic::Transaction::Pos::Terminal::Type::TaggedSymbol + ) + TELLER = + T.let( + :TELLER, + Lithic::Transaction::Pos::Terminal::Type::TaggedSymbol + ) + TRAVELERS_CHECK_MACHINE = + T.let( + :TRAVELERS_CHECK_MACHINE, + Lithic::Transaction::Pos::Terminal::Type::TaggedSymbol + ) + VENDING = + T.let( + :VENDING, + Lithic::Transaction::Pos::Terminal::Type::TaggedSymbol + ) + VOICE = + T.let( + :VOICE, + Lithic::Transaction::Pos::Terminal::Type::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::Transaction::Pos::Terminal::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::Transaction::Pos::Terminal::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end + + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Transaction::Result) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_PAUSED = + T.let(:ACCOUNT_PAUSED, Lithic::Transaction::Result::TaggedSymbol) + ACCOUNT_STATE_TRANSACTION_FAIL = + T.let( + :ACCOUNT_STATE_TRANSACTION_FAIL, + Lithic::Transaction::Result::TaggedSymbol + ) + APPROVED = T.let(:APPROVED, Lithic::Transaction::Result::TaggedSymbol) + BANK_CONNECTION_ERROR = + T.let( + :BANK_CONNECTION_ERROR, + Lithic::Transaction::Result::TaggedSymbol + ) + BANK_NOT_VERIFIED = + T.let(:BANK_NOT_VERIFIED, Lithic::Transaction::Result::TaggedSymbol) + CARD_CLOSED = + T.let(:CARD_CLOSED, Lithic::Transaction::Result::TaggedSymbol) + CARD_PAUSED = + T.let(:CARD_PAUSED, Lithic::Transaction::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Transaction::Result::TaggedSymbol) + FRAUD_ADVICE = + T.let(:FRAUD_ADVICE, Lithic::Transaction::Result::TaggedSymbol) + IGNORED_TTL_EXPIRY = + T.let(:IGNORED_TTL_EXPIRY, Lithic::Transaction::Result::TaggedSymbol) + SUSPECTED_FRAUD = + T.let(:SUSPECTED_FRAUD, Lithic::Transaction::Result::TaggedSymbol) + INACTIVE_ACCOUNT = + T.let(:INACTIVE_ACCOUNT, Lithic::Transaction::Result::TaggedSymbol) + INCORRECT_PIN = + T.let(:INCORRECT_PIN, Lithic::Transaction::Result::TaggedSymbol) + INVALID_CARD_DETAILS = + T.let( + :INVALID_CARD_DETAILS, + Lithic::Transaction::Result::TaggedSymbol + ) + INSUFFICIENT_FUNDS = + T.let(:INSUFFICIENT_FUNDS, Lithic::Transaction::Result::TaggedSymbol) + INSUFFICIENT_FUNDS_PRELOAD = + T.let( + :INSUFFICIENT_FUNDS_PRELOAD, + Lithic::Transaction::Result::TaggedSymbol + ) + INVALID_TRANSACTION = + T.let(:INVALID_TRANSACTION, Lithic::Transaction::Result::TaggedSymbol) + MERCHANT_BLACKLIST = + T.let(:MERCHANT_BLACKLIST, Lithic::Transaction::Result::TaggedSymbol) + ORIGINAL_NOT_FOUND = + T.let(:ORIGINAL_NOT_FOUND, Lithic::Transaction::Result::TaggedSymbol) + PREVIOUSLY_COMPLETED = + T.let( + :PREVIOUSLY_COMPLETED, + Lithic::Transaction::Result::TaggedSymbol + ) + SINGLE_USE_RECHARGED = + T.let( + :SINGLE_USE_RECHARGED, + Lithic::Transaction::Result::TaggedSymbol + ) + SWITCH_INOPERATIVE_ADVICE = + T.let( + :SWITCH_INOPERATIVE_ADVICE, + Lithic::Transaction::Result::TaggedSymbol + ) + UNAUTHORIZED_MERCHANT = + T.let( + :UNAUTHORIZED_MERCHANT, + Lithic::Transaction::Result::TaggedSymbol + ) + UNKNOWN_HOST_TIMEOUT = + T.let( + :UNKNOWN_HOST_TIMEOUT, + Lithic::Transaction::Result::TaggedSymbol + ) + USER_TRANSACTION_LIMIT = + T.let( + :USER_TRANSACTION_LIMIT, + Lithic::Transaction::Result::TaggedSymbol + ) + + sig do + override.returns(T::Array[Lithic::Transaction::Result::TaggedSymbol]) + end + def self.values + end + end + + class ServiceLocation < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Transaction::ServiceLocation, + Lithic::Internal::AnyHash + ) + end + + # City of service location. + sig { returns(T.nilable(String)) } + attr_accessor :city + + # Country code of service location, ISO 3166-1 alpha-3. + sig { returns(T.nilable(String)) } + attr_accessor :country + + # Postal code of service location. + sig { returns(T.nilable(String)) } + attr_accessor :postal_code + + # State/province code of service location, ISO 3166-2. + sig { returns(T.nilable(String)) } + attr_accessor :state + + # Street address of service location. + sig { returns(T.nilable(String)) } + attr_accessor :street_address + + # Where the cardholder received the service, when different from the card acceptor + # location. This is populated from network data elements such as Mastercard DE-122 + # SE1 SF9-14 and Visa F34 DS02. + sig do + params( + city: T.nilable(String), + country: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String), + street_address: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # City of service location. + city:, + # Country code of service location, ISO 3166-1 alpha-3. + country:, + # Postal code of service location. + postal_code:, + # State/province code of service location, ISO 3166-2. + state:, + # Street address of service location. + street_address: + ) + end + + sig do + override.returns( + { + city: T.nilable(String), + country: T.nilable(String), + postal_code: T.nilable(String), + state: T.nilable(String), + street_address: T.nilable(String) + } + ) + end + def to_hash + end + end + + # Status of the transaction. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Transaction::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DECLINED = T.let(:DECLINED, Lithic::Transaction::Status::TaggedSymbol) + EXPIRED = T.let(:EXPIRED, Lithic::Transaction::Status::TaggedSymbol) + PENDING = T.let(:PENDING, Lithic::Transaction::Status::TaggedSymbol) + SETTLED = T.let(:SETTLED, Lithic::Transaction::Status::TaggedSymbol) + VOIDED = T.let(:VOIDED, Lithic::Transaction::Status::TaggedSymbol) + + sig do + override.returns(T::Array[Lithic::Transaction::Status::TaggedSymbol]) + end + def self.values + end + end + + class Event < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::Transaction::Event, Lithic::Internal::AnyHash) + end + + # Transaction event identifier. + sig { returns(String) } + attr_accessor :token + + # Amount of the event in the settlement currency. + sig { returns(Integer) } + attr_accessor :amount + + sig { returns(Lithic::Transaction::Event::Amounts) } + attr_reader :amounts + + sig do + params(amounts: Lithic::Transaction::Event::Amounts::OrHash).void + end + attr_writer :amounts + + # RFC 3339 date and time this event entered the system. UTC time zone. + sig { returns(Time) } + attr_accessor :created + + sig do + returns( + T::Array[Lithic::Transaction::Event::DetailedResult::TaggedSymbol] + ) + end + attr_accessor :detailed_results + + # Indicates whether the transaction event is a credit or debit to the account. + sig do + returns(Lithic::Transaction::Event::EffectivePolarity::TaggedSymbol) + end + attr_accessor :effective_polarity + + # Information provided by the card network in each event. This includes common + # identifiers shared between you, Lithic, the card network and in some cases the + # acquirer. These identifiers often link together events within the same + # transaction lifecycle and can be used to locate a particular transaction, such + # as during processing of disputes. Not all fields are available in all events, + # and the presence of these fields is dependent on the card network and the event + # type. If the field is populated by the network, we will pass it through as is + # unless otherwise specified. Please consult the official network documentation + # for more details about these fields and how to use them. + sig { returns(T.nilable(Lithic::Transaction::Event::NetworkInfo)) } + attr_reader :network_info + + sig do + params( + network_info: + T.nilable(Lithic::Transaction::Event::NetworkInfo::OrHash) + ).void + end + attr_writer :network_info + + sig { returns(Lithic::Transaction::Event::Result::TaggedSymbol) } + attr_accessor :result + + sig { returns(T::Array[Lithic::Transaction::Event::RuleResult]) } + attr_accessor :rule_results + + # Type of transaction event + sig { returns(Lithic::Transaction::Event::Type::TaggedSymbol) } + attr_accessor :type + + sig do + returns( + T.nilable(Lithic::Transaction::Event::AccountType::TaggedSymbol) + ) + end + attr_reader :account_type + + sig do + params( + account_type: Lithic::Transaction::Event::AccountType::OrSymbol + ).void + end + attr_writer :account_type + + sig do + returns(T.nilable(Lithic::Transaction::Event::NetworkSpecificData)) + end + attr_reader :network_specific_data + + sig do + params( + network_specific_data: + T.nilable(Lithic::Transaction::Event::NetworkSpecificData::OrHash) + ).void + end + attr_writer :network_specific_data + + sig do + params( + token: String, + amount: Integer, + amounts: Lithic::Transaction::Event::Amounts::OrHash, + created: Time, + detailed_results: + T::Array[Lithic::Transaction::Event::DetailedResult::OrSymbol], + effective_polarity: + Lithic::Transaction::Event::EffectivePolarity::OrSymbol, + network_info: + T.nilable(Lithic::Transaction::Event::NetworkInfo::OrHash), + result: Lithic::Transaction::Event::Result::OrSymbol, + rule_results: + T::Array[Lithic::Transaction::Event::RuleResult::OrHash], + type: Lithic::Transaction::Event::Type::OrSymbol, + account_type: Lithic::Transaction::Event::AccountType::OrSymbol, + network_specific_data: + T.nilable(Lithic::Transaction::Event::NetworkSpecificData::OrHash) + ).returns(T.attached_class) + end + def self.new( + # Transaction event identifier. + token:, + # Amount of the event in the settlement currency. + amount:, + amounts:, + # RFC 3339 date and time this event entered the system. UTC time zone. + created:, + detailed_results:, + # Indicates whether the transaction event is a credit or debit to the account. + effective_polarity:, + # Information provided by the card network in each event. This includes common + # identifiers shared between you, Lithic, the card network and in some cases the + # acquirer. These identifiers often link together events within the same + # transaction lifecycle and can be used to locate a particular transaction, such + # as during processing of disputes. Not all fields are available in all events, + # and the presence of these fields is dependent on the card network and the event + # type. If the field is populated by the network, we will pass it through as is + # unless otherwise specified. Please consult the official network documentation + # for more details about these fields and how to use them. + network_info:, + result:, + rule_results:, + # Type of transaction event + type:, + account_type: nil, + network_specific_data: nil + ) + end + + sig do + override.returns( + { + token: String, + amount: Integer, + amounts: Lithic::Transaction::Event::Amounts, + created: Time, + detailed_results: + T::Array[ + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ], + effective_polarity: + Lithic::Transaction::Event::EffectivePolarity::TaggedSymbol, + network_info: T.nilable(Lithic::Transaction::Event::NetworkInfo), + result: Lithic::Transaction::Event::Result::TaggedSymbol, + rule_results: T::Array[Lithic::Transaction::Event::RuleResult], + type: Lithic::Transaction::Event::Type::TaggedSymbol, + account_type: + Lithic::Transaction::Event::AccountType::TaggedSymbol, + network_specific_data: + T.nilable(Lithic::Transaction::Event::NetworkSpecificData) + } + ) + end + def to_hash + end + + class Amounts < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Transaction::Event::Amounts, + Lithic::Internal::AnyHash + ) + end + + sig { returns(Lithic::Transaction::Event::Amounts::Cardholder) } + attr_reader :cardholder + + sig do + params( + cardholder: + Lithic::Transaction::Event::Amounts::Cardholder::OrHash + ).void + end + attr_writer :cardholder + + sig { returns(Lithic::Transaction::Event::Amounts::Merchant) } + attr_reader :merchant + + sig do + params( + merchant: Lithic::Transaction::Event::Amounts::Merchant::OrHash + ).void + end + attr_writer :merchant + + sig do + returns(T.nilable(Lithic::Transaction::Event::Amounts::Settlement)) + end + attr_reader :settlement + + sig do + params( + settlement: + T.nilable( + Lithic::Transaction::Event::Amounts::Settlement::OrHash + ) + ).void + end + attr_writer :settlement + + sig do + params( + cardholder: + Lithic::Transaction::Event::Amounts::Cardholder::OrHash, + merchant: Lithic::Transaction::Event::Amounts::Merchant::OrHash, + settlement: + T.nilable( + Lithic::Transaction::Event::Amounts::Settlement::OrHash + ) + ).returns(T.attached_class) + end + def self.new(cardholder:, merchant:, settlement:) + end + + sig do + override.returns( + { + cardholder: Lithic::Transaction::Event::Amounts::Cardholder, + merchant: Lithic::Transaction::Event::Amounts::Merchant, + settlement: + T.nilable(Lithic::Transaction::Event::Amounts::Settlement) + } + ) + end + def to_hash + end + + class Cardholder < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Transaction::Event::Amounts::Cardholder, + Lithic::Internal::AnyHash + ) + end + + # Amount of the event in the cardholder billing currency. + sig { returns(Integer) } + attr_accessor :amount + + # Exchange rate used to convert the merchant amount to the cardholder billing + # amount. + sig { returns(String) } + attr_accessor :conversion_rate + + # 3-character alphabetic ISO 4217 currency + sig { returns(String) } + attr_accessor :currency + + sig do + params( + amount: Integer, + conversion_rate: String, + currency: String + ).returns(T.attached_class) + end + def self.new( + # Amount of the event in the cardholder billing currency. + amount:, + # Exchange rate used to convert the merchant amount to the cardholder billing + # amount. + conversion_rate:, + # 3-character alphabetic ISO 4217 currency + currency: + ) + end + + sig do + override.returns( + { amount: Integer, conversion_rate: String, currency: String } + ) + end + def to_hash + end + end + + class Merchant < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Transaction::Event::Amounts::Merchant, + Lithic::Internal::AnyHash + ) + end + + # Amount of the event in the merchant currency. + sig { returns(Integer) } + attr_accessor :amount + + # 3-character alphabetic ISO 4217 currency + sig { returns(String) } + attr_accessor :currency + + sig do + params(amount: Integer, currency: String).returns( + T.attached_class + ) + end + def self.new( + # Amount of the event in the merchant currency. + amount:, + # 3-character alphabetic ISO 4217 currency + currency: + ) + end + + sig { override.returns({ amount: Integer, currency: String }) } + def to_hash + end + end + + class Settlement < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Transaction::Event::Amounts::Settlement, + Lithic::Internal::AnyHash + ) + end + + # Amount of the event, if it is financial, in the settlement currency. + # Non-financial events do not contain this amount because they do not move funds. + sig { returns(Integer) } + attr_accessor :amount + + # Exchange rate used to convert the merchant amount to the settlement amount. + sig { returns(String) } + attr_accessor :conversion_rate + + # 3-character alphabetic ISO 4217 currency + sig { returns(String) } + attr_accessor :currency + + sig do + params( + amount: Integer, + conversion_rate: String, + currency: String + ).returns(T.attached_class) + end + def self.new( + # Amount of the event, if it is financial, in the settlement currency. + # Non-financial events do not contain this amount because they do not move funds. + amount:, + # Exchange rate used to convert the merchant amount to the settlement amount. + conversion_rate:, + # 3-character alphabetic ISO 4217 currency + currency: + ) + end + + sig do + override.returns( + { amount: Integer, conversion_rate: String, currency: String } + ) + end + def to_hash + end + end + end + + module DetailedResult + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Transaction::Event::DetailedResult) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED = + T.let( + :ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + ACCOUNT_DELINQUENT = + T.let( + :ACCOUNT_DELINQUENT, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + ACCOUNT_INACTIVE = + T.let( + :ACCOUNT_INACTIVE, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED = + T.let( + :ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED = + T.let( + :ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + ACCOUNT_PAUSED = + T.let( + :ACCOUNT_PAUSED, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + ACCOUNT_UNDER_REVIEW = + T.let( + :ACCOUNT_UNDER_REVIEW, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + ADDRESS_INCORRECT = + T.let( + :ADDRESS_INCORRECT, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + APPROVED = + T.let( + :APPROVED, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + AUTH_RULE_ALLOWED_COUNTRY = + T.let( + :AUTH_RULE_ALLOWED_COUNTRY, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + AUTH_RULE_ALLOWED_MCC = + T.let( + :AUTH_RULE_ALLOWED_MCC, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + AUTH_RULE_BLOCKED_COUNTRY = + T.let( + :AUTH_RULE_BLOCKED_COUNTRY, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + AUTH_RULE_BLOCKED_MCC = + T.let( + :AUTH_RULE_BLOCKED_MCC, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + AUTH_RULE = + T.let( + :AUTH_RULE, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + CARD_CLOSED = + T.let( + :CARD_CLOSED, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + CARD_CRYPTOGRAM_VALIDATION_FAILURE = + T.let( + :CARD_CRYPTOGRAM_VALIDATION_FAILURE, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + CARD_EXPIRED = + T.let( + :CARD_EXPIRED, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + CARD_EXPIRY_DATE_INCORRECT = + T.let( + :CARD_EXPIRY_DATE_INCORRECT, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + CARD_INVALID = + T.let( + :CARD_INVALID, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + CARD_NOT_ACTIVATED = + T.let( + :CARD_NOT_ACTIVATED, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + CARD_PAUSED = + T.let( + :CARD_PAUSED, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + CARD_PIN_INCORRECT = + T.let( + :CARD_PIN_INCORRECT, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + CARD_RESTRICTED = + T.let( + :CARD_RESTRICTED, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + CARD_SECURITY_CODE_INCORRECT = + T.let( + :CARD_SECURITY_CODE_INCORRECT, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + CARD_SPEND_LIMIT_EXCEEDED = + T.let( + :CARD_SPEND_LIMIT_EXCEEDED, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + CONTACT_CARD_ISSUER = + T.let( + :CONTACT_CARD_ISSUER, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + CUSTOMER_ASA_TIMEOUT = + T.let( + :CUSTOMER_ASA_TIMEOUT, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + CUSTOM_ASA_RESULT = + T.let( + :CUSTOM_ASA_RESULT, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + DO_NOT_HONOR = + T.let( + :DO_NOT_HONOR, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + DRIVER_NUMBER_INVALID = + T.let( + :DRIVER_NUMBER_INVALID, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + FORMAT_ERROR = + T.let( + :FORMAT_ERROR, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + INSUFFICIENT_FUNDING_SOURCE_BALANCE = + T.let( + :INSUFFICIENT_FUNDING_SOURCE_BALANCE, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + INSUFFICIENT_FUNDS = + T.let( + :INSUFFICIENT_FUNDS, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + LITHIC_SYSTEM_ERROR = + T.let( + :LITHIC_SYSTEM_ERROR, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + LITHIC_SYSTEM_RATE_LIMIT = + T.let( + :LITHIC_SYSTEM_RATE_LIMIT, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + MALFORMED_ASA_RESPONSE = + T.let( + :MALFORMED_ASA_RESPONSE, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + MERCHANT_INVALID = + T.let( + :MERCHANT_INVALID, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE = + T.let( + :MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + MERCHANT_NOT_PERMITTED = + T.let( + :MERCHANT_NOT_PERMITTED, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + OVER_REVERSAL_ATTEMPTED = + T.let( + :OVER_REVERSAL_ATTEMPTED, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + PIN_BLOCKED = + T.let( + :PIN_BLOCKED, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + PROGRAM_CARD_SPEND_LIMIT_EXCEEDED = + T.let( + :PROGRAM_CARD_SPEND_LIMIT_EXCEEDED, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + PROGRAM_SUSPENDED = + T.let( + :PROGRAM_SUSPENDED, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + PROGRAM_USAGE_RESTRICTION = + T.let( + :PROGRAM_USAGE_RESTRICTION, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + REVERSAL_UNMATCHED = + T.let( + :REVERSAL_UNMATCHED, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + SECURITY_VIOLATION = + T.let( + :SECURITY_VIOLATION, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + SINGLE_USE_CARD_REATTEMPTED = + T.let( + :SINGLE_USE_CARD_REATTEMPTED, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + SUSPECTED_FRAUD = + T.let( + :SUSPECTED_FRAUD, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + TRANSACTION_INVALID = + T.let( + :TRANSACTION_INVALID, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL = + T.let( + :TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER = + T.let( + :TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + TRANSACTION_PREVIOUSLY_COMPLETED = + T.let( + :TRANSACTION_PREVIOUSLY_COMPLETED, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + UNAUTHORIZED_MERCHANT = + T.let( + :UNAUTHORIZED_MERCHANT, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + VEHICLE_NUMBER_INVALID = + T.let( + :VEHICLE_NUMBER_INVALID, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + CARDHOLDER_CHALLENGED = + T.let( + :CARDHOLDER_CHALLENGED, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + CARDHOLDER_CHALLENGE_FAILED = + T.let( + :CARDHOLDER_CHALLENGE_FAILED, + Lithic::Transaction::Event::DetailedResult::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::Transaction::Event::DetailedResult::TaggedSymbol] + ) + end + def self.values + end + end + + # Indicates whether the transaction event is a credit or debit to the account. + module EffectivePolarity + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Transaction::Event::EffectivePolarity) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREDIT = + T.let( + :CREDIT, + Lithic::Transaction::Event::EffectivePolarity::TaggedSymbol + ) + DEBIT = + T.let( + :DEBIT, + Lithic::Transaction::Event::EffectivePolarity::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Transaction::Event::EffectivePolarity::TaggedSymbol + ] + ) + end + def self.values + end + end + + class NetworkInfo < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Transaction::Event::NetworkInfo, + Lithic::Internal::AnyHash + ) + end + + sig do + returns( + T.nilable(Lithic::Transaction::Event::NetworkInfo::Acquirer) + ) + end + attr_reader :acquirer + + sig do + params( + acquirer: + T.nilable( + Lithic::Transaction::Event::NetworkInfo::Acquirer::OrHash + ) + ).void + end + attr_writer :acquirer + + sig do + returns(T.nilable(Lithic::Transaction::Event::NetworkInfo::Amex)) + end + attr_reader :amex + + sig do + params( + amex: + T.nilable(Lithic::Transaction::Event::NetworkInfo::Amex::OrHash) + ).void + end + attr_writer :amex + + sig do + returns( + T.nilable(Lithic::Transaction::Event::NetworkInfo::Mastercard) + ) + end + attr_reader :mastercard + + sig do + params( + mastercard: + T.nilable( + Lithic::Transaction::Event::NetworkInfo::Mastercard::OrHash + ) + ).void + end + attr_writer :mastercard + + sig do + returns(T.nilable(Lithic::Transaction::Event::NetworkInfo::Visa)) + end + attr_reader :visa + + sig do + params( + visa: + T.nilable(Lithic::Transaction::Event::NetworkInfo::Visa::OrHash) + ).void + end + attr_writer :visa + + # Information provided by the card network in each event. This includes common + # identifiers shared between you, Lithic, the card network and in some cases the + # acquirer. These identifiers often link together events within the same + # transaction lifecycle and can be used to locate a particular transaction, such + # as during processing of disputes. Not all fields are available in all events, + # and the presence of these fields is dependent on the card network and the event + # type. If the field is populated by the network, we will pass it through as is + # unless otherwise specified. Please consult the official network documentation + # for more details about these fields and how to use them. + sig do + params( + acquirer: + T.nilable( + Lithic::Transaction::Event::NetworkInfo::Acquirer::OrHash + ), + amex: + T.nilable( + Lithic::Transaction::Event::NetworkInfo::Amex::OrHash + ), + mastercard: + T.nilable( + Lithic::Transaction::Event::NetworkInfo::Mastercard::OrHash + ), + visa: + T.nilable(Lithic::Transaction::Event::NetworkInfo::Visa::OrHash) + ).returns(T.attached_class) + end + def self.new(acquirer:, amex:, mastercard:, visa:) + end + + sig do + override.returns( + { + acquirer: + T.nilable(Lithic::Transaction::Event::NetworkInfo::Acquirer), + amex: T.nilable(Lithic::Transaction::Event::NetworkInfo::Amex), + mastercard: + T.nilable( + Lithic::Transaction::Event::NetworkInfo::Mastercard + ), + visa: T.nilable(Lithic::Transaction::Event::NetworkInfo::Visa) + } + ) + end + def to_hash + end + + class Acquirer < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Transaction::Event::NetworkInfo::Acquirer, + Lithic::Internal::AnyHash + ) + end + + # Identifier assigned by the acquirer, applicable to dual-message transactions + # only. The acquirer reference number (ARN) is only populated once a transaction + # has been cleared, and it is not available in all transactions (such as automated + # fuel dispenser transactions). A single transaction can contain multiple ARNs if + # the merchant sends multiple clearings. + sig { returns(T.nilable(String)) } + attr_accessor :acquirer_reference_number + + # Identifier assigned by the acquirer. + sig { returns(T.nilable(String)) } + attr_accessor :retrieval_reference_number + + sig do + params( + acquirer_reference_number: T.nilable(String), + retrieval_reference_number: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Identifier assigned by the acquirer, applicable to dual-message transactions + # only. The acquirer reference number (ARN) is only populated once a transaction + # has been cleared, and it is not available in all transactions (such as automated + # fuel dispenser transactions). A single transaction can contain multiple ARNs if + # the merchant sends multiple clearings. + acquirer_reference_number:, + # Identifier assigned by the acquirer. + retrieval_reference_number: + ) + end + + sig do + override.returns( + { + acquirer_reference_number: T.nilable(String), + retrieval_reference_number: T.nilable(String) + } + ) + end + def to_hash + end + end + + class Amex < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Transaction::Event::NetworkInfo::Amex, + Lithic::Internal::AnyHash + ) + end + + # Identifier assigned by American Express. Matches the `transaction_id` of a prior + # related event. May be populated in incremental authorizations (authorization + # requests that augment a previously authorized amount), authorization advices, + # financial authorizations, and clearings. + sig { returns(T.nilable(String)) } + attr_accessor :original_transaction_id + + # Identifier assigned by American Express to link original messages to subsequent + # messages. Guaranteed by American Express to be unique for each original + # authorization and financial authorization. + sig { returns(T.nilable(String)) } + attr_accessor :transaction_id + + sig do + params( + original_transaction_id: T.nilable(String), + transaction_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Identifier assigned by American Express. Matches the `transaction_id` of a prior + # related event. May be populated in incremental authorizations (authorization + # requests that augment a previously authorized amount), authorization advices, + # financial authorizations, and clearings. + original_transaction_id:, + # Identifier assigned by American Express to link original messages to subsequent + # messages. Guaranteed by American Express to be unique for each original + # authorization and financial authorization. + transaction_id: + ) + end + + sig do + override.returns( + { + original_transaction_id: T.nilable(String), + transaction_id: T.nilable(String) + } + ) + end + def to_hash + end + end + + class Mastercard < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Transaction::Event::NetworkInfo::Mastercard, + Lithic::Internal::AnyHash + ) + end + + # Identifier assigned by Mastercard. Guaranteed by Mastercard to be unique for any + # transaction within a specific financial network on any processing day. + sig { returns(T.nilable(String)) } + attr_accessor :banknet_reference_number + + # Identifier assigned by Mastercard. Matches the `banknet_reference_number` of a + # prior related event. May be populated in authorization reversals, incremental + # authorizations (authorization requests that augment a previously authorized + # amount), automated fuel dispenser authorization advices and clearings, and + # financial authorizations. If the original banknet reference number contains all + # zeroes, then no actual reference number could be found by the network or + # acquirer. If Mastercard converts a transaction from dual-message to + # single-message, such as for certain ATM transactions, it will populate the + # original banknet reference number in the resulting financial authorization with + # the banknet reference number of the initial authorization, which Lithic does not + # receive. + sig { returns(T.nilable(String)) } + attr_accessor :original_banknet_reference_number + + # Identifier assigned by Mastercard. Matches the `switch_serial_number` of a prior + # related event. May be populated in returns and return reversals. Applicable to + # single-message transactions only. + sig { returns(T.nilable(String)) } + attr_accessor :original_switch_serial_number + + # Identifier assigned by Mastercard, applicable to single-message transactions + # only. + sig { returns(T.nilable(String)) } + attr_accessor :switch_serial_number + + sig do + params( + banknet_reference_number: T.nilable(String), + original_banknet_reference_number: T.nilable(String), + original_switch_serial_number: T.nilable(String), + switch_serial_number: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Identifier assigned by Mastercard. Guaranteed by Mastercard to be unique for any + # transaction within a specific financial network on any processing day. + banknet_reference_number:, + # Identifier assigned by Mastercard. Matches the `banknet_reference_number` of a + # prior related event. May be populated in authorization reversals, incremental + # authorizations (authorization requests that augment a previously authorized + # amount), automated fuel dispenser authorization advices and clearings, and + # financial authorizations. If the original banknet reference number contains all + # zeroes, then no actual reference number could be found by the network or + # acquirer. If Mastercard converts a transaction from dual-message to + # single-message, such as for certain ATM transactions, it will populate the + # original banknet reference number in the resulting financial authorization with + # the banknet reference number of the initial authorization, which Lithic does not + # receive. + original_banknet_reference_number:, + # Identifier assigned by Mastercard. Matches the `switch_serial_number` of a prior + # related event. May be populated in returns and return reversals. Applicable to + # single-message transactions only. + original_switch_serial_number:, + # Identifier assigned by Mastercard, applicable to single-message transactions + # only. + switch_serial_number: + ) + end + + sig do + override.returns( + { + banknet_reference_number: T.nilable(String), + original_banknet_reference_number: T.nilable(String), + original_switch_serial_number: T.nilable(String), + switch_serial_number: T.nilable(String) + } + ) + end + def to_hash + end + end + + class Visa < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Transaction::Event::NetworkInfo::Visa, + Lithic::Internal::AnyHash + ) + end + + # Identifier assigned by Visa. Matches the `transaction_id` of a prior related + # event. May be populated in incremental authorizations (authorization requests + # that augment a previously authorized amount), authorization advices, financial + # authorizations, and clearings. + sig { returns(T.nilable(String)) } + attr_accessor :original_transaction_id + + # Identifier assigned by Visa to link original messages to subsequent messages. + # Guaranteed by Visa to be unique for each original authorization and financial + # authorization. + sig { returns(T.nilable(String)) } + attr_accessor :transaction_id + + sig do + params( + original_transaction_id: T.nilable(String), + transaction_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Identifier assigned by Visa. Matches the `transaction_id` of a prior related + # event. May be populated in incremental authorizations (authorization requests + # that augment a previously authorized amount), authorization advices, financial + # authorizations, and clearings. + original_transaction_id:, + # Identifier assigned by Visa to link original messages to subsequent messages. + # Guaranteed by Visa to be unique for each original authorization and financial + # authorization. + transaction_id: + ) + end + + sig do + override.returns( + { + original_transaction_id: T.nilable(String), + transaction_id: T.nilable(String) + } + ) + end + def to_hash + end + end + end + + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Transaction::Event::Result) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_PAUSED = + T.let( + :ACCOUNT_PAUSED, + Lithic::Transaction::Event::Result::TaggedSymbol + ) + ACCOUNT_STATE_TRANSACTION_FAIL = + T.let( + :ACCOUNT_STATE_TRANSACTION_FAIL, + Lithic::Transaction::Event::Result::TaggedSymbol + ) + APPROVED = + T.let(:APPROVED, Lithic::Transaction::Event::Result::TaggedSymbol) + BANK_CONNECTION_ERROR = + T.let( + :BANK_CONNECTION_ERROR, + Lithic::Transaction::Event::Result::TaggedSymbol + ) + BANK_NOT_VERIFIED = + T.let( + :BANK_NOT_VERIFIED, + Lithic::Transaction::Event::Result::TaggedSymbol + ) + CARD_CLOSED = + T.let( + :CARD_CLOSED, + Lithic::Transaction::Event::Result::TaggedSymbol + ) + CARD_PAUSED = + T.let( + :CARD_PAUSED, + Lithic::Transaction::Event::Result::TaggedSymbol + ) + DECLINED = + T.let(:DECLINED, Lithic::Transaction::Event::Result::TaggedSymbol) + FRAUD_ADVICE = + T.let( + :FRAUD_ADVICE, + Lithic::Transaction::Event::Result::TaggedSymbol + ) + IGNORED_TTL_EXPIRY = + T.let( + :IGNORED_TTL_EXPIRY, + Lithic::Transaction::Event::Result::TaggedSymbol + ) + SUSPECTED_FRAUD = + T.let( + :SUSPECTED_FRAUD, + Lithic::Transaction::Event::Result::TaggedSymbol + ) + INACTIVE_ACCOUNT = + T.let( + :INACTIVE_ACCOUNT, + Lithic::Transaction::Event::Result::TaggedSymbol + ) + INCORRECT_PIN = + T.let( + :INCORRECT_PIN, + Lithic::Transaction::Event::Result::TaggedSymbol + ) + INVALID_CARD_DETAILS = + T.let( + :INVALID_CARD_DETAILS, + Lithic::Transaction::Event::Result::TaggedSymbol + ) + INSUFFICIENT_FUNDS = + T.let( + :INSUFFICIENT_FUNDS, + Lithic::Transaction::Event::Result::TaggedSymbol + ) + INSUFFICIENT_FUNDS_PRELOAD = + T.let( + :INSUFFICIENT_FUNDS_PRELOAD, + Lithic::Transaction::Event::Result::TaggedSymbol + ) + INVALID_TRANSACTION = + T.let( + :INVALID_TRANSACTION, + Lithic::Transaction::Event::Result::TaggedSymbol + ) + MERCHANT_BLACKLIST = + T.let( + :MERCHANT_BLACKLIST, + Lithic::Transaction::Event::Result::TaggedSymbol + ) + ORIGINAL_NOT_FOUND = + T.let( + :ORIGINAL_NOT_FOUND, + Lithic::Transaction::Event::Result::TaggedSymbol + ) + PREVIOUSLY_COMPLETED = + T.let( + :PREVIOUSLY_COMPLETED, + Lithic::Transaction::Event::Result::TaggedSymbol + ) + SINGLE_USE_RECHARGED = + T.let( + :SINGLE_USE_RECHARGED, + Lithic::Transaction::Event::Result::TaggedSymbol + ) + SWITCH_INOPERATIVE_ADVICE = + T.let( + :SWITCH_INOPERATIVE_ADVICE, + Lithic::Transaction::Event::Result::TaggedSymbol + ) + UNAUTHORIZED_MERCHANT = + T.let( + :UNAUTHORIZED_MERCHANT, + Lithic::Transaction::Event::Result::TaggedSymbol + ) + UNKNOWN_HOST_TIMEOUT = + T.let( + :UNKNOWN_HOST_TIMEOUT, + Lithic::Transaction::Event::Result::TaggedSymbol + ) + USER_TRANSACTION_LIMIT = + T.let( + :USER_TRANSACTION_LIMIT, + Lithic::Transaction::Event::Result::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::Transaction::Event::Result::TaggedSymbol] + ) + end + def self.values + end + end + + class RuleResult < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Transaction::Event::RuleResult, + Lithic::Internal::AnyHash + ) + end + + # The Auth Rule Token associated with the rule from which the decline originated. + # If this is set to null, then the decline was not associated with a + # customer-configured Auth Rule. This may happen in cases where a transaction is + # declined due to a Lithic-configured security or compliance rule, for example. + sig { returns(T.nilable(String)) } + attr_accessor :auth_rule_token + + # A human-readable explanation outlining the motivation for the rule's decline. + sig { returns(T.nilable(String)) } + attr_accessor :explanation + + # The name for the rule, if any was configured. + sig { returns(T.nilable(String)) } + attr_accessor :name + + # The detailed_result associated with this rule's decline. + sig do + returns( + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + end + attr_accessor :result + + sig do + params( + auth_rule_token: T.nilable(String), + explanation: T.nilable(String), + name: T.nilable(String), + result: Lithic::Transaction::Event::RuleResult::Result::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The Auth Rule Token associated with the rule from which the decline originated. + # If this is set to null, then the decline was not associated with a + # customer-configured Auth Rule. This may happen in cases where a transaction is + # declined due to a Lithic-configured security or compliance rule, for example. + auth_rule_token:, + # A human-readable explanation outlining the motivation for the rule's decline. + explanation:, + # The name for the rule, if any was configured. + name:, + # The detailed_result associated with this rule's decline. + result: + ) + end + + sig do + override.returns( + { + auth_rule_token: T.nilable(String), + explanation: T.nilable(String), + name: T.nilable(String), + result: + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + } + ) + end + def to_hash + end + + # The detailed_result associated with this rule's decline. + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Transaction::Event::RuleResult::Result) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED = + T.let( + :ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + ACCOUNT_DELINQUENT = + T.let( + :ACCOUNT_DELINQUENT, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + ACCOUNT_INACTIVE = + T.let( + :ACCOUNT_INACTIVE, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED = + T.let( + :ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED = + T.let( + :ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + ACCOUNT_PAUSED = + T.let( + :ACCOUNT_PAUSED, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + ACCOUNT_UNDER_REVIEW = + T.let( + :ACCOUNT_UNDER_REVIEW, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + ADDRESS_INCORRECT = + T.let( + :ADDRESS_INCORRECT, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + APPROVED = + T.let( + :APPROVED, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + AUTH_RULE_ALLOWED_COUNTRY = + T.let( + :AUTH_RULE_ALLOWED_COUNTRY, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + AUTH_RULE_ALLOWED_MCC = + T.let( + :AUTH_RULE_ALLOWED_MCC, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + AUTH_RULE_BLOCKED_COUNTRY = + T.let( + :AUTH_RULE_BLOCKED_COUNTRY, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + AUTH_RULE_BLOCKED_MCC = + T.let( + :AUTH_RULE_BLOCKED_MCC, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + AUTH_RULE = + T.let( + :AUTH_RULE, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + CARD_CLOSED = + T.let( + :CARD_CLOSED, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + CARD_CRYPTOGRAM_VALIDATION_FAILURE = + T.let( + :CARD_CRYPTOGRAM_VALIDATION_FAILURE, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + CARD_EXPIRED = + T.let( + :CARD_EXPIRED, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + CARD_EXPIRY_DATE_INCORRECT = + T.let( + :CARD_EXPIRY_DATE_INCORRECT, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + CARD_INVALID = + T.let( + :CARD_INVALID, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + CARD_NOT_ACTIVATED = + T.let( + :CARD_NOT_ACTIVATED, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + CARD_PAUSED = + T.let( + :CARD_PAUSED, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + CARD_PIN_INCORRECT = + T.let( + :CARD_PIN_INCORRECT, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + CARD_RESTRICTED = + T.let( + :CARD_RESTRICTED, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + CARD_SECURITY_CODE_INCORRECT = + T.let( + :CARD_SECURITY_CODE_INCORRECT, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + CARD_SPEND_LIMIT_EXCEEDED = + T.let( + :CARD_SPEND_LIMIT_EXCEEDED, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + CONTACT_CARD_ISSUER = + T.let( + :CONTACT_CARD_ISSUER, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + CUSTOMER_ASA_TIMEOUT = + T.let( + :CUSTOMER_ASA_TIMEOUT, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + CUSTOM_ASA_RESULT = + T.let( + :CUSTOM_ASA_RESULT, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + DECLINED = + T.let( + :DECLINED, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + DO_NOT_HONOR = + T.let( + :DO_NOT_HONOR, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + DRIVER_NUMBER_INVALID = + T.let( + :DRIVER_NUMBER_INVALID, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + FORMAT_ERROR = + T.let( + :FORMAT_ERROR, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + INSUFFICIENT_FUNDING_SOURCE_BALANCE = + T.let( + :INSUFFICIENT_FUNDING_SOURCE_BALANCE, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + INSUFFICIENT_FUNDS = + T.let( + :INSUFFICIENT_FUNDS, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + LITHIC_SYSTEM_ERROR = + T.let( + :LITHIC_SYSTEM_ERROR, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + LITHIC_SYSTEM_RATE_LIMIT = + T.let( + :LITHIC_SYSTEM_RATE_LIMIT, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + MALFORMED_ASA_RESPONSE = + T.let( + :MALFORMED_ASA_RESPONSE, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + MERCHANT_INVALID = + T.let( + :MERCHANT_INVALID, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE = + T.let( + :MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + MERCHANT_NOT_PERMITTED = + T.let( + :MERCHANT_NOT_PERMITTED, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + OVER_REVERSAL_ATTEMPTED = + T.let( + :OVER_REVERSAL_ATTEMPTED, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + PIN_BLOCKED = + T.let( + :PIN_BLOCKED, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + PROGRAM_CARD_SPEND_LIMIT_EXCEEDED = + T.let( + :PROGRAM_CARD_SPEND_LIMIT_EXCEEDED, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + PROGRAM_SUSPENDED = + T.let( + :PROGRAM_SUSPENDED, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + PROGRAM_USAGE_RESTRICTION = + T.let( + :PROGRAM_USAGE_RESTRICTION, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + REVERSAL_UNMATCHED = + T.let( + :REVERSAL_UNMATCHED, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + SECURITY_VIOLATION = + T.let( + :SECURITY_VIOLATION, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + SINGLE_USE_CARD_REATTEMPTED = + T.let( + :SINGLE_USE_CARD_REATTEMPTED, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + SUSPECTED_FRAUD = + T.let( + :SUSPECTED_FRAUD, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + TRANSACTION_INVALID = + T.let( + :TRANSACTION_INVALID, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL = + T.let( + :TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER = + T.let( + :TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + TRANSACTION_PREVIOUSLY_COMPLETED = + T.let( + :TRANSACTION_PREVIOUSLY_COMPLETED, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + UNAUTHORIZED_MERCHANT = + T.let( + :UNAUTHORIZED_MERCHANT, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + VEHICLE_NUMBER_INVALID = + T.let( + :VEHICLE_NUMBER_INVALID, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + CARDHOLDER_CHALLENGED = + T.let( + :CARDHOLDER_CHALLENGED, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + CARDHOLDER_CHALLENGE_FAILED = + T.let( + :CARDHOLDER_CHALLENGE_FAILED, + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Transaction::Event::RuleResult::Result::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + # Type of transaction event + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Transaction::Event::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AUTHORIZATION = + T.let( + :AUTHORIZATION, + Lithic::Transaction::Event::Type::TaggedSymbol + ) + AUTHORIZATION_ADVICE = + T.let( + :AUTHORIZATION_ADVICE, + Lithic::Transaction::Event::Type::TaggedSymbol + ) + AUTHORIZATION_EXPIRY = + T.let( + :AUTHORIZATION_EXPIRY, + Lithic::Transaction::Event::Type::TaggedSymbol + ) + AUTHORIZATION_REVERSAL = + T.let( + :AUTHORIZATION_REVERSAL, + Lithic::Transaction::Event::Type::TaggedSymbol + ) + BALANCE_INQUIRY = + T.let( + :BALANCE_INQUIRY, + Lithic::Transaction::Event::Type::TaggedSymbol + ) + CLEARING = + T.let(:CLEARING, Lithic::Transaction::Event::Type::TaggedSymbol) + CORRECTION_CREDIT = + T.let( + :CORRECTION_CREDIT, + Lithic::Transaction::Event::Type::TaggedSymbol + ) + CORRECTION_DEBIT = + T.let( + :CORRECTION_DEBIT, + Lithic::Transaction::Event::Type::TaggedSymbol + ) + CREDIT_AUTHORIZATION = + T.let( + :CREDIT_AUTHORIZATION, + Lithic::Transaction::Event::Type::TaggedSymbol + ) + CREDIT_AUTHORIZATION_ADVICE = + T.let( + :CREDIT_AUTHORIZATION_ADVICE, + Lithic::Transaction::Event::Type::TaggedSymbol + ) + FINANCIAL_AUTHORIZATION = + T.let( + :FINANCIAL_AUTHORIZATION, + Lithic::Transaction::Event::Type::TaggedSymbol + ) + FINANCIAL_CREDIT_AUTHORIZATION = + T.let( + :FINANCIAL_CREDIT_AUTHORIZATION, + Lithic::Transaction::Event::Type::TaggedSymbol + ) + RETURN = + T.let(:RETURN, Lithic::Transaction::Event::Type::TaggedSymbol) + RETURN_REVERSAL = + T.let( + :RETURN_REVERSAL, + Lithic::Transaction::Event::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::Transaction::Event::Type::TaggedSymbol] + ) + end + def self.values + end + end + + module AccountType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::Transaction::Event::AccountType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHECKING = + T.let( + :CHECKING, + Lithic::Transaction::Event::AccountType::TaggedSymbol + ) + SAVINGS = + T.let( + :SAVINGS, + Lithic::Transaction::Event::AccountType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::Transaction::Event::AccountType::TaggedSymbol] + ) + end + def self.values + end + end + + class NetworkSpecificData < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Transaction::Event::NetworkSpecificData, + Lithic::Internal::AnyHash + ) + end + + sig do + returns(Lithic::Transaction::Event::NetworkSpecificData::Mastercard) + end + attr_reader :mastercard + + sig do + params( + mastercard: + Lithic::Transaction::Event::NetworkSpecificData::Mastercard::OrHash + ).void + end + attr_writer :mastercard + + sig { returns(Lithic::Transaction::Event::NetworkSpecificData::Visa) } + attr_reader :visa + + sig do + params( + visa: + Lithic::Transaction::Event::NetworkSpecificData::Visa::OrHash + ).void + end + attr_writer :visa + + sig do + params( + mastercard: + Lithic::Transaction::Event::NetworkSpecificData::Mastercard::OrHash, + visa: + Lithic::Transaction::Event::NetworkSpecificData::Visa::OrHash + ).returns(T.attached_class) + end + def self.new(mastercard:, visa:) + end + + sig do + override.returns( + { + mastercard: + Lithic::Transaction::Event::NetworkSpecificData::Mastercard, + visa: Lithic::Transaction::Event::NetworkSpecificData::Visa + } + ) + end + def to_hash + end + + class Mastercard < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Transaction::Event::NetworkSpecificData::Mastercard, + Lithic::Internal::AnyHash + ) + end + + # Indicates the electronic commerce security level and UCAF collection. + sig { returns(T.nilable(String)) } + attr_accessor :ecommerce_security_level_indicator + + # The On-behalf Service performed on the transaction and the results. Contains all + # applicable, on-behalf service results that were performed on a given + # transaction. + sig do + returns( + T.nilable( + T::Array[ + Lithic::Transaction::Event::NetworkSpecificData::Mastercard::OnBehalfServiceResult + ] + ) + ) + end + attr_accessor :on_behalf_service_result + + # Indicates the type of additional transaction purpose. + sig { returns(T.nilable(String)) } + attr_accessor :transaction_type_identifier + + sig do + params( + ecommerce_security_level_indicator: T.nilable(String), + on_behalf_service_result: + T.nilable( + T::Array[ + Lithic::Transaction::Event::NetworkSpecificData::Mastercard::OnBehalfServiceResult::OrHash + ] + ), + transaction_type_identifier: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Indicates the electronic commerce security level and UCAF collection. + ecommerce_security_level_indicator:, + # The On-behalf Service performed on the transaction and the results. Contains all + # applicable, on-behalf service results that were performed on a given + # transaction. + on_behalf_service_result:, + # Indicates the type of additional transaction purpose. + transaction_type_identifier: + ) + end + + sig do + override.returns( + { + ecommerce_security_level_indicator: T.nilable(String), + on_behalf_service_result: + T.nilable( + T::Array[ + Lithic::Transaction::Event::NetworkSpecificData::Mastercard::OnBehalfServiceResult + ] + ), + transaction_type_identifier: T.nilable(String) + } + ) + end + def to_hash + end + + class OnBehalfServiceResult < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Transaction::Event::NetworkSpecificData::Mastercard::OnBehalfServiceResult, + Lithic::Internal::AnyHash + ) + end + + # Indicates the results of the service processing. + sig { returns(String) } + attr_accessor :result_1 + + # Identifies the results of the service processing. + sig { returns(String) } + attr_accessor :result_2 + + # Indicates the service performed on the transaction. + sig { returns(String) } + attr_accessor :service + + sig do + params( + result_1: String, + result_2: String, + service: String + ).returns(T.attached_class) + end + def self.new( + # Indicates the results of the service processing. + result_1:, + # Identifies the results of the service processing. + result_2:, + # Indicates the service performed on the transaction. + service: + ) + end + + sig do + override.returns( + { result_1: String, result_2: String, service: String } + ) + end + def to_hash + end + end + end + + class Visa < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Transaction::Event::NetworkSpecificData::Visa, + Lithic::Internal::AnyHash + ) + end + + # Identifies the purpose or category of a transaction, used to classify and + # process transactions according to Visa’s rules. + sig { returns(T.nilable(String)) } + attr_accessor :business_application_identifier + + sig do + params( + business_application_identifier: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Identifies the purpose or category of a transaction, used to classify and + # process transactions according to Visa’s rules. + business_application_identifier: + ) + end + + sig do + override.returns( + { business_application_identifier: T.nilable(String) } + ) + end + def to_hash + end + end + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_expire_authorization_params.rbi b/rbi/lithic/models/transaction_expire_authorization_params.rbi new file mode 100644 index 00000000..6f819014 --- /dev/null +++ b/rbi/lithic/models/transaction_expire_authorization_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Lithic + module Models + class TransactionExpireAuthorizationParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TransactionExpireAuthorizationParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :transaction_token + + sig do + params( + transaction_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(transaction_token:, request_options: {}) + end + + sig do + override.returns( + { transaction_token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/transaction_list_params.rbi b/rbi/lithic/models/transaction_list_params.rbi new file mode 100644 index 00000000..7de3a77a --- /dev/null +++ b/rbi/lithic/models/transaction_list_params.rbi @@ -0,0 +1,203 @@ +# typed: strong + +module Lithic + module Models + class TransactionListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::TransactionListParams, Lithic::Internal::AnyHash) + end + + # Filters for transactions associated with a specific account. + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Filters for transactions associated with a specific card. + sig { returns(T.nilable(String)) } + attr_reader :card_token + + sig { params(card_token: String).void } + attr_writer :card_token + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # Filters for transactions using transaction result field. Can filter by + # `APPROVED`, and `DECLINED`. + sig do + returns(T.nilable(Lithic::TransactionListParams::Result::OrSymbol)) + end + attr_reader :result + + sig do + params(result: Lithic::TransactionListParams::Result::OrSymbol).void + end + attr_writer :result + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + # Filters for transactions using transaction status field. + sig do + returns(T.nilable(Lithic::TransactionListParams::Status::OrSymbol)) + end + attr_reader :status + + sig do + params(status: Lithic::TransactionListParams::Status::OrSymbol).void + end + attr_writer :status + + sig do + params( + account_token: String, + begin_: Time, + card_token: String, + end_: Time, + ending_before: String, + page_size: Integer, + result: Lithic::TransactionListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::TransactionListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Filters for transactions associated with a specific account. + account_token: nil, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Filters for transactions associated with a specific card. + card_token: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # Filters for transactions using transaction result field. Can filter by + # `APPROVED`, and `DECLINED`. + result: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Filters for transactions using transaction status field. + status: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + account_token: String, + begin_: Time, + card_token: String, + end_: Time, + ending_before: String, + page_size: Integer, + result: Lithic::TransactionListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::TransactionListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Filters for transactions using transaction result field. Can filter by + # `APPROVED`, and `DECLINED`. + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::TransactionListParams::Result) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let(:APPROVED, Lithic::TransactionListParams::Result::TaggedSymbol) + DECLINED = + T.let(:DECLINED, Lithic::TransactionListParams::Result::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::TransactionListParams::Result::TaggedSymbol] + ) + end + def self.values + end + end + + # Filters for transactions using transaction status field. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::TransactionListParams::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let(:PENDING, Lithic::TransactionListParams::Status::TaggedSymbol) + VOIDED = + T.let(:VOIDED, Lithic::TransactionListParams::Status::TaggedSymbol) + SETTLED = + T.let(:SETTLED, Lithic::TransactionListParams::Status::TaggedSymbol) + DECLINED = + T.let(:DECLINED, Lithic::TransactionListParams::Status::TaggedSymbol) + EXPIRED = + T.let(:EXPIRED, Lithic::TransactionListParams::Status::TaggedSymbol) + + sig do + override.returns( + T::Array[Lithic::TransactionListParams::Status::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/case_activity_entry.rbi b/rbi/lithic/models/transaction_monitoring/case_activity_entry.rbi new file mode 100644 index 00000000..2e34edef --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/case_activity_entry.rbi @@ -0,0 +1,107 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + class CaseActivityEntry < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TransactionMonitoring::CaseActivityEntry, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for the activity entry + sig { returns(String) } + attr_accessor :token + + # Identifier of the actor that produced the activity entry + sig { returns(T.nilable(String)) } + attr_accessor :actor_token + + # Date and time at which the activity entry was created + sig { returns(Time) } + attr_accessor :created + + # The case field that changed, or the action that was taken, in an activity entry: + # + # - `STATUS` - The case status changed + # - `TITLE` - The case title changed + # - `ASSIGNED_TO` - The case assignee changed + # - `RESOLUTION_OUTCOME` - The resolution outcome was set or changed + # - `RESOLUTION_NOTES` - The resolution notes were set or changed + # - `TAGS` - The case tags changed + # - `PRIORITY` - The case priority changed + # - `COMMENT` - A comment was added or edited + # - `FILE` - A file was attached to the case + sig do + returns(Lithic::TransactionMonitoring::CaseActivityType::TaggedSymbol) + end + attr_accessor :entry_type + + # New value of the changed field, when applicable + sig { returns(T.nilable(String)) } + attr_accessor :new_value + + # Previous value of the changed field, when applicable + sig { returns(T.nilable(String)) } + attr_accessor :previous_value + + # A single entry in a case's activity feed + sig do + params( + token: String, + actor_token: T.nilable(String), + created: Time, + entry_type: + Lithic::TransactionMonitoring::CaseActivityType::OrSymbol, + new_value: T.nilable(String), + previous_value: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the activity entry + token:, + # Identifier of the actor that produced the activity entry + actor_token:, + # Date and time at which the activity entry was created + created:, + # The case field that changed, or the action that was taken, in an activity entry: + # + # - `STATUS` - The case status changed + # - `TITLE` - The case title changed + # - `ASSIGNED_TO` - The case assignee changed + # - `RESOLUTION_OUTCOME` - The resolution outcome was set or changed + # - `RESOLUTION_NOTES` - The resolution notes were set or changed + # - `TAGS` - The case tags changed + # - `PRIORITY` - The case priority changed + # - `COMMENT` - A comment was added or edited + # - `FILE` - A file was attached to the case + entry_type:, + # New value of the changed field, when applicable + new_value:, + # Previous value of the changed field, when applicable + previous_value: + ) + end + + sig do + override.returns( + { + token: String, + actor_token: T.nilable(String), + created: Time, + entry_type: + Lithic::TransactionMonitoring::CaseActivityType::TaggedSymbol, + new_value: T.nilable(String), + previous_value: T.nilable(String) + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/case_activity_type.rbi b/rbi/lithic/models/transaction_monitoring/case_activity_type.rbi new file mode 100644 index 00000000..78fa4d42 --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/case_activity_type.rbi @@ -0,0 +1,84 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + # The case field that changed, or the action that was taken, in an activity entry: + # + # - `STATUS` - The case status changed + # - `TITLE` - The case title changed + # - `ASSIGNED_TO` - The case assignee changed + # - `RESOLUTION_OUTCOME` - The resolution outcome was set or changed + # - `RESOLUTION_NOTES` - The resolution notes were set or changed + # - `TAGS` - The case tags changed + # - `PRIORITY` - The case priority changed + # - `COMMENT` - A comment was added or edited + # - `FILE` - A file was attached to the case + module CaseActivityType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::TransactionMonitoring::CaseActivityType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + STATUS = + T.let( + :STATUS, + Lithic::TransactionMonitoring::CaseActivityType::TaggedSymbol + ) + TITLE = + T.let( + :TITLE, + Lithic::TransactionMonitoring::CaseActivityType::TaggedSymbol + ) + ASSIGNED_TO = + T.let( + :ASSIGNED_TO, + Lithic::TransactionMonitoring::CaseActivityType::TaggedSymbol + ) + RESOLUTION_OUTCOME = + T.let( + :RESOLUTION_OUTCOME, + Lithic::TransactionMonitoring::CaseActivityType::TaggedSymbol + ) + RESOLUTION_NOTES = + T.let( + :RESOLUTION_NOTES, + Lithic::TransactionMonitoring::CaseActivityType::TaggedSymbol + ) + TAGS = + T.let( + :TAGS, + Lithic::TransactionMonitoring::CaseActivityType::TaggedSymbol + ) + PRIORITY = + T.let( + :PRIORITY, + Lithic::TransactionMonitoring::CaseActivityType::TaggedSymbol + ) + COMMENT = + T.let( + :COMMENT, + Lithic::TransactionMonitoring::CaseActivityType::TaggedSymbol + ) + FILE = + T.let( + :FILE, + Lithic::TransactionMonitoring::CaseActivityType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::TransactionMonitoring::CaseActivityType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/case_card.rbi b/rbi/lithic/models/transaction_monitoring/case_card.rbi new file mode 100644 index 00000000..df763a25 --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/case_card.rbi @@ -0,0 +1,60 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + class CaseCard < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TransactionMonitoring::CaseCard, + Lithic::Internal::AnyHash + ) + end + + # Token of the account the card belongs to + sig { returns(String) } + attr_accessor :account_token + + # Token of the card + sig { returns(String) } + attr_accessor :card_token + + # Number of the card's transactions associated with the case + sig { returns(Integer) } + attr_accessor :transaction_count + + # Summary of a card's involvement in a case, aggregated across the case's + # transactions + sig do + params( + account_token: String, + card_token: String, + transaction_count: Integer + ).returns(T.attached_class) + end + def self.new( + # Token of the account the card belongs to + account_token:, + # Token of the card + card_token:, + # Number of the card's transactions associated with the case + transaction_count: + ) + end + + sig do + override.returns( + { + account_token: String, + card_token: String, + transaction_count: Integer + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/case_entity.rbi b/rbi/lithic/models/transaction_monitoring/case_entity.rbi new file mode 100644 index 00000000..0c6f5690 --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/case_entity.rbi @@ -0,0 +1,101 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + class CaseEntity < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TransactionMonitoring::CaseEntity, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for the associated entity + sig { returns(String) } + attr_accessor :entity_token + + # The type of entity a case is associated with: + # + # - `CARD` - The case is associated with a card + # - `ACCOUNT` - The case is associated with an account + sig do + returns( + Lithic::TransactionMonitoring::CaseEntity::EntityType::TaggedSymbol + ) + end + attr_accessor :entity_type + + # The entity a case is associated with + sig do + params( + entity_token: String, + entity_type: + Lithic::TransactionMonitoring::CaseEntity::EntityType::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the associated entity + entity_token:, + # The type of entity a case is associated with: + # + # - `CARD` - The case is associated with a card + # - `ACCOUNT` - The case is associated with an account + entity_type: + ) + end + + sig do + override.returns( + { + entity_token: String, + entity_type: + Lithic::TransactionMonitoring::CaseEntity::EntityType::TaggedSymbol + } + ) + end + def to_hash + end + + # The type of entity a case is associated with: + # + # - `CARD` - The case is associated with a card + # - `ACCOUNT` - The case is associated with an account + module EntityType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::TransactionMonitoring::CaseEntity::EntityType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CARD = + T.let( + :CARD, + Lithic::TransactionMonitoring::CaseEntity::EntityType::TaggedSymbol + ) + ACCOUNT = + T.let( + :ACCOUNT, + Lithic::TransactionMonitoring::CaseEntity::EntityType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::TransactionMonitoring::CaseEntity::EntityType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/case_list_activity_params.rbi b/rbi/lithic/models/transaction_monitoring/case_list_activity_params.rbi new file mode 100644 index 00000000..2438b2d7 --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/case_list_activity_params.rbi @@ -0,0 +1,83 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + class CaseListActivityParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TransactionMonitoring::CaseListActivityParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :case_token + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + case_token: String, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + case_token:, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + case_token: String, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/case_list_params.rbi b/rbi/lithic/models/transaction_monitoring/case_list_params.rbi new file mode 100644 index 00000000..d917f0d9 --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/case_list_params.rbi @@ -0,0 +1,220 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + class CaseListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TransactionMonitoring::CaseListParams, + Lithic::Internal::AnyHash + ) + end + + # Only return cases that include transactions on the provided account. + sig { returns(T.nilable(String)) } + attr_reader :account_token + + sig { params(account_token: String).void } + attr_writer :account_token + + # Only return cases assigned to the provided value. Pass an empty string to return + # only unassigned cases. + sig { returns(T.nilable(String)) } + attr_reader :assignee + + sig { params(assignee: String).void } + attr_writer :assignee + + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :begin_ + + sig { params(begin_: Time).void } + attr_writer :begin_ + + # Only return cases that include transactions on the provided card. + sig { returns(T.nilable(String)) } + attr_reader :card_token + + sig { params(card_token: String).void } + attr_writer :card_token + + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :end_ + + sig { params(end_: Time).void } + attr_writer :end_ + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Only return cases associated with the provided entity. + sig { returns(T.nilable(String)) } + attr_reader :entity_token + + sig { params(entity_token: String).void } + attr_writer :entity_token + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # Only return cases belonging to the provided queue. + sig { returns(T.nilable(String)) } + attr_reader :queue_token + + sig { params(queue_token: String).void } + attr_writer :queue_token + + # Only return cases triggered by the provided transaction monitoring rule. + sig { returns(T.nilable(String)) } + attr_reader :rule_token + + sig { params(rule_token: String).void } + attr_writer :rule_token + + # Sort order for the returned cases. + sig do + returns( + T.nilable(Lithic::TransactionMonitoring::CaseSortOrder::OrSymbol) + ) + end + attr_reader :sort_by + + sig do + params( + sort_by: Lithic::TransactionMonitoring::CaseSortOrder::OrSymbol + ).void + end + attr_writer :sort_by + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + # Only return cases with the provided status. + sig do + returns( + T.nilable(Lithic::TransactionMonitoring::CaseStatus::OrSymbol) + ) + end + attr_reader :status + + sig do + params( + status: Lithic::TransactionMonitoring::CaseStatus::OrSymbol + ).void + end + attr_writer :status + + # Only return cases that include the provided transaction. + sig { returns(T.nilable(String)) } + attr_reader :transaction_token + + sig { params(transaction_token: String).void } + attr_writer :transaction_token + + sig do + params( + account_token: String, + assignee: String, + begin_: Time, + card_token: String, + end_: Time, + ending_before: String, + entity_token: String, + page_size: Integer, + queue_token: String, + rule_token: String, + sort_by: Lithic::TransactionMonitoring::CaseSortOrder::OrSymbol, + starting_after: String, + status: Lithic::TransactionMonitoring::CaseStatus::OrSymbol, + transaction_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Only return cases that include transactions on the provided account. + account_token: nil, + # Only return cases assigned to the provided value. Pass an empty string to return + # only unassigned cases. + assignee: nil, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Only return cases that include transactions on the provided card. + card_token: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Only return cases associated with the provided entity. + entity_token: nil, + # Page size (for pagination). + page_size: nil, + # Only return cases belonging to the provided queue. + queue_token: nil, + # Only return cases triggered by the provided transaction monitoring rule. + rule_token: nil, + # Sort order for the returned cases. + sort_by: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Only return cases with the provided status. + status: nil, + # Only return cases that include the provided transaction. + transaction_token: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + account_token: String, + assignee: String, + begin_: Time, + card_token: String, + end_: Time, + ending_before: String, + entity_token: String, + page_size: Integer, + queue_token: String, + rule_token: String, + sort_by: Lithic::TransactionMonitoring::CaseSortOrder::OrSymbol, + starting_after: String, + status: Lithic::TransactionMonitoring::CaseStatus::OrSymbol, + transaction_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/case_list_transactions_params.rbi b/rbi/lithic/models/transaction_monitoring/case_list_transactions_params.rbi new file mode 100644 index 00000000..f7211682 --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/case_list_transactions_params.rbi @@ -0,0 +1,83 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + class CaseListTransactionsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TransactionMonitoring::CaseListTransactionsParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :case_token + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + case_token: String, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + case_token:, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + case_token: String, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/case_priority.rbi b/rbi/lithic/models/transaction_monitoring/case_priority.rbi new file mode 100644 index 00000000..63eb3c0d --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/case_priority.rbi @@ -0,0 +1,44 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + # Priority level of a case, controlling queue ordering and SLA urgency + module CasePriority + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::TransactionMonitoring::CasePriority) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LOW = + T.let(:LOW, Lithic::TransactionMonitoring::CasePriority::TaggedSymbol) + MEDIUM = + T.let( + :MEDIUM, + Lithic::TransactionMonitoring::CasePriority::TaggedSymbol + ) + HIGH = + T.let( + :HIGH, + Lithic::TransactionMonitoring::CasePriority::TaggedSymbol + ) + CRITICAL = + T.let( + :CRITICAL, + Lithic::TransactionMonitoring::CasePriority::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::TransactionMonitoring::CasePriority::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/case_retrieve_cards_params.rbi b/rbi/lithic/models/transaction_monitoring/case_retrieve_cards_params.rbi new file mode 100644 index 00000000..59b10825 --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/case_retrieve_cards_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + class CaseRetrieveCardsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TransactionMonitoring::CaseRetrieveCardsParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :case_token + + sig do + params( + case_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(case_token:, request_options: {}) + end + + sig do + override.returns( + { case_token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/case_retrieve_cards_response.rbi b/rbi/lithic/models/transaction_monitoring/case_retrieve_cards_response.rbi new file mode 100644 index 00000000..748db072 --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/case_retrieve_cards_response.rbi @@ -0,0 +1,15 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + CaseRetrieveCardsResponse = + T.let( + Lithic::Internal::Type::ArrayOf[ + Lithic::TransactionMonitoring::CaseCard + ], + Lithic::Internal::Type::Converter + ) + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/case_retrieve_params.rbi b/rbi/lithic/models/transaction_monitoring/case_retrieve_params.rbi new file mode 100644 index 00000000..a2e832ff --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/case_retrieve_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + class CaseRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TransactionMonitoring::CaseRetrieveParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :case_token + + sig do + params( + case_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(case_token:, request_options: {}) + end + + sig do + override.returns( + { case_token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/case_sort_order.rbi b/rbi/lithic/models/transaction_monitoring/case_sort_order.rbi new file mode 100644 index 00000000..63d51357 --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/case_sort_order.rbi @@ -0,0 +1,64 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + # Sort order for listing cases. Defaults to `CREATED_DESC` (newest first): + # + # - `CREATED_ASC` - Oldest first + # - `CREATED_DESC` - Newest first + # - `PRIORITY_DESC` - Highest priority first + # - `PRIORITY_ASC` - Lowest priority first + # - `STATUS_DESC` - Furthest workflow stage first + # - `STATUS_ASC` - Earliest workflow stage first + module CaseSortOrder + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::TransactionMonitoring::CaseSortOrder) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATED_ASC = + T.let( + :CREATED_ASC, + Lithic::TransactionMonitoring::CaseSortOrder::TaggedSymbol + ) + CREATED_DESC = + T.let( + :CREATED_DESC, + Lithic::TransactionMonitoring::CaseSortOrder::TaggedSymbol + ) + PRIORITY_DESC = + T.let( + :PRIORITY_DESC, + Lithic::TransactionMonitoring::CaseSortOrder::TaggedSymbol + ) + PRIORITY_ASC = + T.let( + :PRIORITY_ASC, + Lithic::TransactionMonitoring::CaseSortOrder::TaggedSymbol + ) + STATUS_DESC = + T.let( + :STATUS_DESC, + Lithic::TransactionMonitoring::CaseSortOrder::TaggedSymbol + ) + STATUS_ASC = + T.let( + :STATUS_ASC, + Lithic::TransactionMonitoring::CaseSortOrder::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::TransactionMonitoring::CaseSortOrder::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/case_status.rbi b/rbi/lithic/models/transaction_monitoring/case_status.rbi new file mode 100644 index 00000000..6e3ee116 --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/case_status.rbi @@ -0,0 +1,63 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + # Status of a case as it progresses through the review workflow: + # + # - `OPEN` - The case has been created and is still collecting matching + # transactions + # - `ASSIGNED` - An analyst has been assigned and transaction collection has + # stopped + # - `IN_REVIEW` - The case is actively being investigated + # - `ESCALATED` - The case has been reviewed and requires additional oversight + # - `RESOLVED` - A determination has been made and a resolution recorded + # - `CLOSED` - The case is finalized + module CaseStatus + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::TransactionMonitoring::CaseStatus) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + OPEN = + T.let(:OPEN, Lithic::TransactionMonitoring::CaseStatus::TaggedSymbol) + ASSIGNED = + T.let( + :ASSIGNED, + Lithic::TransactionMonitoring::CaseStatus::TaggedSymbol + ) + IN_REVIEW = + T.let( + :IN_REVIEW, + Lithic::TransactionMonitoring::CaseStatus::TaggedSymbol + ) + ESCALATED = + T.let( + :ESCALATED, + Lithic::TransactionMonitoring::CaseStatus::TaggedSymbol + ) + RESOLVED = + T.let( + :RESOLVED, + Lithic::TransactionMonitoring::CaseStatus::TaggedSymbol + ) + CLOSED = + T.let( + :CLOSED, + Lithic::TransactionMonitoring::CaseStatus::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::TransactionMonitoring::CaseStatus::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/case_transaction.rbi b/rbi/lithic/models/transaction_monitoring/case_transaction.rbi new file mode 100644 index 00000000..ef8463e8 --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/case_transaction.rbi @@ -0,0 +1,75 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + class CaseTransaction < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TransactionMonitoring::CaseTransaction, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for the transaction + sig { returns(String) } + attr_accessor :token + + # Token of the account the transaction belongs to + sig { returns(String) } + attr_accessor :account_token + + # Date and time at which the transaction was added to the case + sig { returns(Time) } + attr_accessor :added_at + + # Token of the card the transaction was made on + sig { returns(String) } + attr_accessor :card_token + + # Date and time at which the transaction was created + sig { returns(Time) } + attr_accessor :transaction_created_at + + # A single transaction associated with a case + sig do + params( + token: String, + account_token: String, + added_at: Time, + card_token: String, + transaction_created_at: Time + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the transaction + token:, + # Token of the account the transaction belongs to + account_token:, + # Date and time at which the transaction was added to the case + added_at:, + # Token of the card the transaction was made on + card_token:, + # Date and time at which the transaction was created + transaction_created_at: + ) + end + + sig do + override.returns( + { + token: String, + account_token: String, + added_at: Time, + card_token: String, + transaction_created_at: Time + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/case_update_params.rbi b/rbi/lithic/models/transaction_monitoring/case_update_params.rbi new file mode 100644 index 00000000..1d2e79aa --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/case_update_params.rbi @@ -0,0 +1,201 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + class CaseUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TransactionMonitoring::CaseUpdateParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :case_token + + # Optional client-provided identifier for the actor performing this action, + # recorded on the resulting activity entry. This value is supplied by the client + # (for example, your own internal user ID) and is not authenticated by Lithic + sig { returns(T.nilable(String)) } + attr_reader :actor_token + + sig { params(actor_token: String).void } + attr_writer :actor_token + + # New assignee for the case, or `null` to unassign + sig { returns(T.nilable(String)) } + attr_accessor :assignee + + # Priority level of a case, controlling queue ordering and SLA urgency + sig do + returns( + T.nilable(Lithic::TransactionMonitoring::CasePriority::OrSymbol) + ) + end + attr_reader :priority + + sig do + params( + priority: Lithic::TransactionMonitoring::CasePriority::OrSymbol + ).void + end + attr_writer :priority + + # Outcome recorded when a case is resolved: + # + # - `CONFIRMED_FRAUD` - The reviewed activity was confirmed to be fraudulent + # - `SUSPICIOUS_ACTIVITY` - The activity is suspicious but not confirmed fraud + # - `FALSE_POSITIVE` - The activity was legitimate and the alert was a false + # positive + # - `NO_ACTION_REQUIRED` - No further action is required + # - `ESCALATED_EXTERNAL` - The case was escalated to an external party + sig do + returns( + T.nilable( + Lithic::TransactionMonitoring::ResolutionOutcome::OrSymbol + ) + ) + end + attr_reader :resolution + + sig do + params( + resolution: + Lithic::TransactionMonitoring::ResolutionOutcome::OrSymbol + ).void + end + attr_writer :resolution + + # Notes describing the resolution + sig { returns(T.nilable(String)) } + attr_reader :resolution_notes + + sig { params(resolution_notes: String).void } + attr_writer :resolution_notes + + # New SLA deadline for the case, or `null` to clear it + sig { returns(T.nilable(Time)) } + attr_accessor :sla_deadline + + # Status of a case as it progresses through the review workflow: + # + # - `OPEN` - The case has been created and is still collecting matching + # transactions + # - `ASSIGNED` - An analyst has been assigned and transaction collection has + # stopped + # - `IN_REVIEW` - The case is actively being investigated + # - `ESCALATED` - The case has been reviewed and requires additional oversight + # - `RESOLVED` - A determination has been made and a resolution recorded + # - `CLOSED` - The case is finalized + sig do + returns( + T.nilable(Lithic::TransactionMonitoring::CaseStatus::OrSymbol) + ) + end + attr_reader :status + + sig do + params( + status: Lithic::TransactionMonitoring::CaseStatus::OrSymbol + ).void + end + attr_writer :status + + # Arbitrary key-value metadata to set on the case + sig { returns(T.nilable(T::Hash[Symbol, String])) } + attr_reader :tags + + sig { params(tags: T::Hash[Symbol, String]).void } + attr_writer :tags + + # New title for the case, or `null` to clear it + sig { returns(T.nilable(String)) } + attr_accessor :title + + sig do + params( + case_token: String, + actor_token: String, + assignee: T.nilable(String), + priority: Lithic::TransactionMonitoring::CasePriority::OrSymbol, + resolution: + Lithic::TransactionMonitoring::ResolutionOutcome::OrSymbol, + resolution_notes: String, + sla_deadline: T.nilable(Time), + status: Lithic::TransactionMonitoring::CaseStatus::OrSymbol, + tags: T::Hash[Symbol, String], + title: T.nilable(String), + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + case_token:, + # Optional client-provided identifier for the actor performing this action, + # recorded on the resulting activity entry. This value is supplied by the client + # (for example, your own internal user ID) and is not authenticated by Lithic + actor_token: nil, + # New assignee for the case, or `null` to unassign + assignee: nil, + # Priority level of a case, controlling queue ordering and SLA urgency + priority: nil, + # Outcome recorded when a case is resolved: + # + # - `CONFIRMED_FRAUD` - The reviewed activity was confirmed to be fraudulent + # - `SUSPICIOUS_ACTIVITY` - The activity is suspicious but not confirmed fraud + # - `FALSE_POSITIVE` - The activity was legitimate and the alert was a false + # positive + # - `NO_ACTION_REQUIRED` - No further action is required + # - `ESCALATED_EXTERNAL` - The case was escalated to an external party + resolution: nil, + # Notes describing the resolution + resolution_notes: nil, + # New SLA deadline for the case, or `null` to clear it + sla_deadline: nil, + # Status of a case as it progresses through the review workflow: + # + # - `OPEN` - The case has been created and is still collecting matching + # transactions + # - `ASSIGNED` - An analyst has been assigned and transaction collection has + # stopped + # - `IN_REVIEW` - The case is actively being investigated + # - `ESCALATED` - The case has been reviewed and requires additional oversight + # - `RESOLVED` - A determination has been made and a resolution recorded + # - `CLOSED` - The case is finalized + status: nil, + # Arbitrary key-value metadata to set on the case + tags: nil, + # New title for the case, or `null` to clear it + title: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + case_token: String, + actor_token: String, + assignee: T.nilable(String), + priority: Lithic::TransactionMonitoring::CasePriority::OrSymbol, + resolution: + Lithic::TransactionMonitoring::ResolutionOutcome::OrSymbol, + resolution_notes: String, + sla_deadline: T.nilable(Time), + status: Lithic::TransactionMonitoring::CaseStatus::OrSymbol, + tags: T::Hash[Symbol, String], + title: T.nilable(String), + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/cases/case_file.rbi b/rbi/lithic/models/transaction_monitoring/cases/case_file.rbi new file mode 100644 index 00000000..f3156b0b --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/cases/case_file.rbi @@ -0,0 +1,188 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + CaseFile = Cases::CaseFile + + module Cases + class CaseFile < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TransactionMonitoring::Cases::CaseFile, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for the file + sig { returns(String) } + attr_accessor :token + + # Date and time at which the file record was created + sig { returns(Time) } + attr_accessor :created + + # Presigned URL the client uses to download the file + sig { returns(T.nilable(String)) } + attr_accessor :download_url + + # Date and time at which the download URL expires + sig { returns(T.nilable(Time)) } + attr_accessor :download_url_expires + + # Reason the file was rejected, when applicable + sig { returns(T.nilable(String)) } + attr_accessor :failure_reason + + # MIME type of the file, available once the file is ready + sig { returns(T.nilable(String)) } + attr_accessor :mime_type + + # Name of the file + sig { returns(String) } + attr_accessor :name + + # Size of the file in bytes, available once the file is ready + sig { returns(T.nilable(Integer)) } + attr_accessor :size_bytes + + # Lifecycle status of a case file: + # + # - `PENDING` - An upload URL has been issued and the file is awaiting upload + # - `READY` - The file has been uploaded and validated; a download URL is + # available + # - `REJECTED` - File validation failed; see `failure_reason` for details + sig do + returns( + Lithic::TransactionMonitoring::Cases::FileStatus::TaggedSymbol + ) + end + attr_accessor :status + + # Date and time at which the file record was last updated + sig { returns(Time) } + attr_accessor :updated + + # Constraints applied to a file upload, returned alongside the upload URL so + # clients can validate before uploading + sig do + returns( + T.nilable(Lithic::TransactionMonitoring::Cases::UploadConstraints) + ) + end + attr_reader :upload_constraints + + sig do + params( + upload_constraints: + T.nilable( + Lithic::TransactionMonitoring::Cases::UploadConstraints::OrHash + ) + ).void + end + attr_writer :upload_constraints + + # Presigned URL the client uses to upload the file + sig { returns(T.nilable(String)) } + attr_accessor :upload_url + + # Date and time at which the upload URL expires + sig { returns(T.nilable(Time)) } + attr_accessor :upload_url_expires + + # A file attached to a case. Status-dependent fields are always present but may be + # `null`: + # + # - `upload_url`, `upload_url_expires`, and `upload_constraints` are populated + # when `status` is `PENDING` or `REJECTED` + # - `download_url` and `download_url_expires` are populated when `status` is + # `READY` + # - `failure_reason` is populated when `status` is `REJECTED` + sig do + params( + token: String, + created: Time, + download_url: T.nilable(String), + download_url_expires: T.nilable(Time), + failure_reason: T.nilable(String), + mime_type: T.nilable(String), + name: String, + size_bytes: T.nilable(Integer), + status: + Lithic::TransactionMonitoring::Cases::FileStatus::OrSymbol, + updated: Time, + upload_constraints: + T.nilable( + Lithic::TransactionMonitoring::Cases::UploadConstraints::OrHash + ), + upload_url: T.nilable(String), + upload_url_expires: T.nilable(Time) + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the file + token:, + # Date and time at which the file record was created + created:, + # Presigned URL the client uses to download the file + download_url:, + # Date and time at which the download URL expires + download_url_expires:, + # Reason the file was rejected, when applicable + failure_reason:, + # MIME type of the file, available once the file is ready + mime_type:, + # Name of the file + name:, + # Size of the file in bytes, available once the file is ready + size_bytes:, + # Lifecycle status of a case file: + # + # - `PENDING` - An upload URL has been issued and the file is awaiting upload + # - `READY` - The file has been uploaded and validated; a download URL is + # available + # - `REJECTED` - File validation failed; see `failure_reason` for details + status:, + # Date and time at which the file record was last updated + updated:, + # Constraints applied to a file upload, returned alongside the upload URL so + # clients can validate before uploading + upload_constraints:, + # Presigned URL the client uses to upload the file + upload_url:, + # Date and time at which the upload URL expires + upload_url_expires: + ) + end + + sig do + override.returns( + { + token: String, + created: Time, + download_url: T.nilable(String), + download_url_expires: T.nilable(Time), + failure_reason: T.nilable(String), + mime_type: T.nilable(String), + name: String, + size_bytes: T.nilable(Integer), + status: + Lithic::TransactionMonitoring::Cases::FileStatus::TaggedSymbol, + updated: Time, + upload_constraints: + T.nilable( + Lithic::TransactionMonitoring::Cases::UploadConstraints + ), + upload_url: T.nilable(String), + upload_url_expires: T.nilable(Time) + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/cases/comment_create_params.rbi b/rbi/lithic/models/transaction_monitoring/cases/comment_create_params.rbi new file mode 100644 index 00000000..a1b79144 --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/cases/comment_create_params.rbi @@ -0,0 +1,71 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + module Cases + class CommentCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TransactionMonitoring::Cases::CommentCreateParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :case_token + + # Text of the comment + sig { returns(String) } + attr_accessor :comment + + # Optional client-provided identifier for the actor performing this action, + # recorded on the resulting activity entry. This value is supplied by the client + # (for example, your own internal user ID) and is not authenticated by Lithic + sig { returns(T.nilable(String)) } + attr_reader :actor_token + + sig { params(actor_token: String).void } + attr_writer :actor_token + + sig do + params( + case_token: String, + comment: String, + actor_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + case_token:, + # Text of the comment + comment:, + # Optional client-provided identifier for the actor performing this action, + # recorded on the resulting activity entry. This value is supplied by the client + # (for example, your own internal user ID) and is not authenticated by Lithic + actor_token: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + case_token: String, + comment: String, + actor_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/cases/comment_delete_params.rbi b/rbi/lithic/models/transaction_monitoring/cases/comment_delete_params.rbi new file mode 100644 index 00000000..d9c5cf59 --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/cases/comment_delete_params.rbi @@ -0,0 +1,50 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + module Cases + class CommentDeleteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TransactionMonitoring::Cases::CommentDeleteParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :case_token + + sig { returns(String) } + attr_accessor :comment_token + + sig do + params( + case_token: String, + comment_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(case_token:, comment_token:, request_options: {}) + end + + sig do + override.returns( + { + case_token: String, + comment_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/cases/comment_update_params.rbi b/rbi/lithic/models/transaction_monitoring/cases/comment_update_params.rbi new file mode 100644 index 00000000..7775581d --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/cases/comment_update_params.rbi @@ -0,0 +1,77 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + module Cases + class CommentUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TransactionMonitoring::Cases::CommentUpdateParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :case_token + + sig { returns(String) } + attr_accessor :comment_token + + # New text of the comment + sig { returns(String) } + attr_accessor :comment + + # Optional client-provided identifier for the actor performing this action, + # recorded on the resulting activity entry. This value is supplied by the client + # (for example, your own internal user ID) and is not authenticated by Lithic + sig { returns(T.nilable(String)) } + attr_reader :actor_token + + sig { params(actor_token: String).void } + attr_writer :actor_token + + sig do + params( + case_token: String, + comment_token: String, + comment: String, + actor_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + case_token:, + comment_token:, + # New text of the comment + comment:, + # Optional client-provided identifier for the actor performing this action, + # recorded on the resulting activity entry. This value is supplied by the client + # (for example, your own internal user ID) and is not authenticated by Lithic + actor_token: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + case_token: String, + comment_token: String, + comment: String, + actor_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/cases/file_create_params.rbi b/rbi/lithic/models/transaction_monitoring/cases/file_create_params.rbi new file mode 100644 index 00000000..a7efe7a1 --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/cases/file_create_params.rbi @@ -0,0 +1,56 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + module Cases + class FileCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TransactionMonitoring::Cases::FileCreateParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :case_token + + # Name of the file to upload + sig { returns(String) } + attr_accessor :name + + sig do + params( + case_token: String, + name: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + case_token:, + # Name of the file to upload + name:, + request_options: {} + ) + end + + sig do + override.returns( + { + case_token: String, + name: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/cases/file_delete_params.rbi b/rbi/lithic/models/transaction_monitoring/cases/file_delete_params.rbi new file mode 100644 index 00000000..cb06f0c4 --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/cases/file_delete_params.rbi @@ -0,0 +1,50 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + module Cases + class FileDeleteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TransactionMonitoring::Cases::FileDeleteParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :case_token + + sig { returns(String) } + attr_accessor :file_token + + sig do + params( + case_token: String, + file_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(case_token:, file_token:, request_options: {}) + end + + sig do + override.returns( + { + case_token: String, + file_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/cases/file_list_params.rbi b/rbi/lithic/models/transaction_monitoring/cases/file_list_params.rbi new file mode 100644 index 00000000..55ab854a --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/cases/file_list_params.rbi @@ -0,0 +1,85 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + module Cases + class FileListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TransactionMonitoring::Cases::FileListParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :case_token + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + case_token: String, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + case_token:, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + case_token: String, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/cases/file_retrieve_params.rbi b/rbi/lithic/models/transaction_monitoring/cases/file_retrieve_params.rbi new file mode 100644 index 00000000..e26e8a0f --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/cases/file_retrieve_params.rbi @@ -0,0 +1,50 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + module Cases + class FileRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TransactionMonitoring::Cases::FileRetrieveParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :case_token + + sig { returns(String) } + attr_accessor :file_token + + sig do + params( + case_token: String, + file_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(case_token:, file_token:, request_options: {}) + end + + sig do + override.returns( + { + case_token: String, + file_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/cases/file_status.rbi b/rbi/lithic/models/transaction_monitoring/cases/file_status.rbi new file mode 100644 index 00000000..8c2b5a67 --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/cases/file_status.rbi @@ -0,0 +1,51 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + module Cases + # Lifecycle status of a case file: + # + # - `PENDING` - An upload URL has been issued and the file is awaiting upload + # - `READY` - The file has been uploaded and validated; a download URL is + # available + # - `REJECTED` - File validation failed; see `failure_reason` for details + module FileStatus + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::TransactionMonitoring::Cases::FileStatus) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :PENDING, + Lithic::TransactionMonitoring::Cases::FileStatus::TaggedSymbol + ) + READY = + T.let( + :READY, + Lithic::TransactionMonitoring::Cases::FileStatus::TaggedSymbol + ) + REJECTED = + T.let( + :REJECTED, + Lithic::TransactionMonitoring::Cases::FileStatus::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::TransactionMonitoring::Cases::FileStatus::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/cases/upload_constraints.rbi b/rbi/lithic/models/transaction_monitoring/cases/upload_constraints.rbi new file mode 100644 index 00000000..8cb78442 --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/cases/upload_constraints.rbi @@ -0,0 +1,51 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + module Cases + class UploadConstraints < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TransactionMonitoring::Cases::UploadConstraints, + Lithic::Internal::AnyHash + ) + end + + # MIME types accepted for the upload + sig { returns(T::Array[String]) } + attr_accessor :accepted_mime_types + + # Maximum accepted file size, in bytes + sig { returns(Integer) } + attr_accessor :max_size_bytes + + # Constraints applied to a file upload, returned alongside the upload URL so + # clients can validate before uploading + sig do + params( + accepted_mime_types: T::Array[String], + max_size_bytes: Integer + ).returns(T.attached_class) + end + def self.new( + # MIME types accepted for the upload + accepted_mime_types:, + # Maximum accepted file size, in bytes + max_size_bytes: + ) + end + + sig do + override.returns( + { accepted_mime_types: T::Array[String], max_size_bytes: Integer } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/entity_type.rbi b/rbi/lithic/models/transaction_monitoring/entity_type.rbi new file mode 100644 index 00000000..6fe79373 --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/entity_type.rbi @@ -0,0 +1,37 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + # The type of entity associated with an account holder + module EntityType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::TransactionMonitoring::EntityType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BENEFICIAL_OWNER_INDIVIDUAL = + T.let( + :BENEFICIAL_OWNER_INDIVIDUAL, + Lithic::TransactionMonitoring::EntityType::TaggedSymbol + ) + CONTROL_PERSON = + T.let( + :CONTROL_PERSON, + Lithic::TransactionMonitoring::EntityType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::TransactionMonitoring::EntityType::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/monitoring_case.rbi b/rbi/lithic/models/transaction_monitoring/monitoring_case.rbi new file mode 100644 index 00000000..915da180 --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/monitoring_case.rbi @@ -0,0 +1,226 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + class MonitoringCase < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TransactionMonitoring::MonitoringCase, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for the case + sig { returns(String) } + attr_accessor :token + + # Identifier of the user the case is currently assigned to + sig { returns(T.nilable(String)) } + attr_accessor :assignee + + # Date and time at which transaction collection stopped for the case + sig { returns(T.nilable(Time)) } + attr_accessor :collection_stopped + + # Date and time at which the case was created + sig { returns(Time) } + attr_accessor :created + + # The entity a case is associated with + sig { returns(T.nilable(Lithic::TransactionMonitoring::CaseEntity)) } + attr_reader :entity + + sig do + params( + entity: T.nilable(Lithic::TransactionMonitoring::CaseEntity::OrHash) + ).void + end + attr_writer :entity + + # Whether the case still has transaction scopes pending resolution + sig { returns(T::Boolean) } + attr_accessor :pending_transactions + + # Priority level of a case, controlling queue ordering and SLA urgency + sig do + returns(Lithic::TransactionMonitoring::CasePriority::TaggedSymbol) + end + attr_accessor :priority + + # Token of the queue the case belongs to + sig { returns(String) } + attr_accessor :queue_token + + # Outcome recorded when a case is resolved: + # + # - `CONFIRMED_FRAUD` - The reviewed activity was confirmed to be fraudulent + # - `SUSPICIOUS_ACTIVITY` - The activity is suspicious but not confirmed fraud + # - `FALSE_POSITIVE` - The activity was legitimate and the alert was a false + # positive + # - `NO_ACTION_REQUIRED` - No further action is required + # - `ESCALATED_EXTERNAL` - The case was escalated to an external party + sig do + returns( + T.nilable( + Lithic::TransactionMonitoring::ResolutionOutcome::TaggedSymbol + ) + ) + end + attr_accessor :resolution + + # Free-form notes describing the resolution + sig { returns(T.nilable(String)) } + attr_accessor :resolution_notes + + # Date and time at which the case was resolved + sig { returns(T.nilable(Time)) } + attr_accessor :resolved + + # Token of the transaction monitoring rule that triggered the case + sig { returns(T.nilable(String)) } + attr_accessor :rule_token + + # Deadline by which the case is expected to be resolved + sig { returns(T.nilable(Time)) } + attr_accessor :sla_deadline + + # Status of a case as it progresses through the review workflow: + # + # - `OPEN` - The case has been created and is still collecting matching + # transactions + # - `ASSIGNED` - An analyst has been assigned and transaction collection has + # stopped + # - `IN_REVIEW` - The case is actively being investigated + # - `ESCALATED` - The case has been reviewed and requires additional oversight + # - `RESOLVED` - A determination has been made and a resolution recorded + # - `CLOSED` - The case is finalized + sig { returns(Lithic::TransactionMonitoring::CaseStatus::TaggedSymbol) } + attr_accessor :status + + # Arbitrary key-value metadata associated with the case + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :tags + + # Short, human-readable summary of the case + sig { returns(T.nilable(String)) } + attr_accessor :title + + # Date and time at which the case was last updated + sig { returns(Time) } + attr_accessor :updated + + # A transaction monitoring case + sig do + params( + token: String, + assignee: T.nilable(String), + collection_stopped: T.nilable(Time), + created: Time, + entity: + T.nilable(Lithic::TransactionMonitoring::CaseEntity::OrHash), + pending_transactions: T::Boolean, + priority: Lithic::TransactionMonitoring::CasePriority::OrSymbol, + queue_token: String, + resolution: + T.nilable( + Lithic::TransactionMonitoring::ResolutionOutcome::OrSymbol + ), + resolution_notes: T.nilable(String), + resolved: T.nilable(Time), + rule_token: T.nilable(String), + sla_deadline: T.nilable(Time), + status: Lithic::TransactionMonitoring::CaseStatus::OrSymbol, + tags: T::Hash[Symbol, String], + title: T.nilable(String), + updated: Time + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the case + token:, + # Identifier of the user the case is currently assigned to + assignee:, + # Date and time at which transaction collection stopped for the case + collection_stopped:, + # Date and time at which the case was created + created:, + # The entity a case is associated with + entity:, + # Whether the case still has transaction scopes pending resolution + pending_transactions:, + # Priority level of a case, controlling queue ordering and SLA urgency + priority:, + # Token of the queue the case belongs to + queue_token:, + # Outcome recorded when a case is resolved: + # + # - `CONFIRMED_FRAUD` - The reviewed activity was confirmed to be fraudulent + # - `SUSPICIOUS_ACTIVITY` - The activity is suspicious but not confirmed fraud + # - `FALSE_POSITIVE` - The activity was legitimate and the alert was a false + # positive + # - `NO_ACTION_REQUIRED` - No further action is required + # - `ESCALATED_EXTERNAL` - The case was escalated to an external party + resolution:, + # Free-form notes describing the resolution + resolution_notes:, + # Date and time at which the case was resolved + resolved:, + # Token of the transaction monitoring rule that triggered the case + rule_token:, + # Deadline by which the case is expected to be resolved + sla_deadline:, + # Status of a case as it progresses through the review workflow: + # + # - `OPEN` - The case has been created and is still collecting matching + # transactions + # - `ASSIGNED` - An analyst has been assigned and transaction collection has + # stopped + # - `IN_REVIEW` - The case is actively being investigated + # - `ESCALATED` - The case has been reviewed and requires additional oversight + # - `RESOLVED` - A determination has been made and a resolution recorded + # - `CLOSED` - The case is finalized + status:, + # Arbitrary key-value metadata associated with the case + tags:, + # Short, human-readable summary of the case + title:, + # Date and time at which the case was last updated + updated: + ) + end + + sig do + override.returns( + { + token: String, + assignee: T.nilable(String), + collection_stopped: T.nilable(Time), + created: Time, + entity: T.nilable(Lithic::TransactionMonitoring::CaseEntity), + pending_transactions: T::Boolean, + priority: + Lithic::TransactionMonitoring::CasePriority::TaggedSymbol, + queue_token: String, + resolution: + T.nilable( + Lithic::TransactionMonitoring::ResolutionOutcome::TaggedSymbol + ), + resolution_notes: T.nilable(String), + resolved: T.nilable(Time), + rule_token: T.nilable(String), + sla_deadline: T.nilable(Time), + status: Lithic::TransactionMonitoring::CaseStatus::TaggedSymbol, + tags: T::Hash[Symbol, String], + title: T.nilable(String), + updated: Time + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/queue.rbi b/rbi/lithic/models/transaction_monitoring/queue.rbi new file mode 100644 index 00000000..6abc7d7a --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/queue.rbi @@ -0,0 +1,189 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + class Queue < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TransactionMonitoring::Queue, + Lithic::Internal::AnyHash + ) + end + + # Globally unique identifier for the queue + sig { returns(String) } + attr_accessor :token + + # Number of cases in the queue, broken down by status. A status is omitted when + # the queue has no cases in that status + sig { returns(Lithic::TransactionMonitoring::Queue::CaseCounts) } + attr_reader :case_counts + + sig do + params( + case_counts: + Lithic::TransactionMonitoring::Queue::CaseCounts::OrHash + ).void + end + attr_writer :case_counts + + # Date and time at which the queue was created + sig { returns(Time) } + attr_accessor :created + + # Optional description of the queue + sig { returns(T.nilable(String)) } + attr_accessor :description + + # Human-readable name of the queue + sig { returns(String) } + attr_accessor :name + + # Date and time at which the queue was last updated + sig { returns(Time) } + attr_accessor :updated + + # A queue that groups transaction monitoring cases for review + sig do + params( + token: String, + case_counts: + Lithic::TransactionMonitoring::Queue::CaseCounts::OrHash, + created: Time, + description: T.nilable(String), + name: String, + updated: Time + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the queue + token:, + # Number of cases in the queue, broken down by status. A status is omitted when + # the queue has no cases in that status + case_counts:, + # Date and time at which the queue was created + created:, + # Optional description of the queue + description:, + # Human-readable name of the queue + name:, + # Date and time at which the queue was last updated + updated: + ) + end + + sig do + override.returns( + { + token: String, + case_counts: Lithic::TransactionMonitoring::Queue::CaseCounts, + created: Time, + description: T.nilable(String), + name: String, + updated: Time + } + ) + end + def to_hash + end + + class CaseCounts < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TransactionMonitoring::Queue::CaseCounts, + Lithic::Internal::AnyHash + ) + end + + # Number of cases in the queue with status `ASSIGNED` + sig { returns(T.nilable(Integer)) } + attr_reader :assigned + + sig { params(assigned: Integer).void } + attr_writer :assigned + + # Number of cases in the queue with status `CLOSED` + sig { returns(T.nilable(Integer)) } + attr_reader :closed + + sig { params(closed: Integer).void } + attr_writer :closed + + # Number of cases in the queue with status `ESCALATED` + sig { returns(T.nilable(Integer)) } + attr_reader :escalated + + sig { params(escalated: Integer).void } + attr_writer :escalated + + # Number of cases in the queue with status `IN_REVIEW` + sig { returns(T.nilable(Integer)) } + attr_reader :in_review + + sig { params(in_review: Integer).void } + attr_writer :in_review + + # Number of cases in the queue with status `OPEN` + sig { returns(T.nilable(Integer)) } + attr_reader :open_ + + sig { params(open_: Integer).void } + attr_writer :open_ + + # Number of cases in the queue with status `RESOLVED` + sig { returns(T.nilable(Integer)) } + attr_reader :resolved + + sig { params(resolved: Integer).void } + attr_writer :resolved + + # Number of cases in the queue, broken down by status. A status is omitted when + # the queue has no cases in that status + sig do + params( + assigned: Integer, + closed: Integer, + escalated: Integer, + in_review: Integer, + open_: Integer, + resolved: Integer + ).returns(T.attached_class) + end + def self.new( + # Number of cases in the queue with status `ASSIGNED` + assigned: nil, + # Number of cases in the queue with status `CLOSED` + closed: nil, + # Number of cases in the queue with status `ESCALATED` + escalated: nil, + # Number of cases in the queue with status `IN_REVIEW` + in_review: nil, + # Number of cases in the queue with status `OPEN` + open_: nil, + # Number of cases in the queue with status `RESOLVED` + resolved: nil + ) + end + + sig do + override.returns( + { + assigned: Integer, + closed: Integer, + escalated: Integer, + in_review: Integer, + open_: Integer, + resolved: Integer + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/queue_create_params.rbi b/rbi/lithic/models/transaction_monitoring/queue_create_params.rbi new file mode 100644 index 00000000..2ef88493 --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/queue_create_params.rbi @@ -0,0 +1,56 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + class QueueCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TransactionMonitoring::QueueCreateParams, + Lithic::Internal::AnyHash + ) + end + + # Human-readable name of the queue + sig { returns(String) } + attr_accessor :name + + # Optional description of the queue + sig { returns(T.nilable(String)) } + attr_accessor :description + + sig do + params( + name: String, + description: T.nilable(String), + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Human-readable name of the queue + name:, + # Optional description of the queue + description: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + name: String, + description: T.nilable(String), + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/queue_delete_params.rbi b/rbi/lithic/models/transaction_monitoring/queue_delete_params.rbi new file mode 100644 index 00000000..4c693367 --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/queue_delete_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + class QueueDeleteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TransactionMonitoring::QueueDeleteParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :queue_token + + sig do + params( + queue_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(queue_token:, request_options: {}) + end + + sig do + override.returns( + { queue_token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/queue_list_params.rbi b/rbi/lithic/models/transaction_monitoring/queue_list_params.rbi new file mode 100644 index 00000000..d11294d2 --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/queue_list_params.rbi @@ -0,0 +1,77 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + class QueueListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TransactionMonitoring::QueueListParams, + Lithic::Internal::AnyHash + ) + end + + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + sig { returns(T.nilable(String)) } + attr_reader :ending_before + + sig { params(ending_before: String).void } + attr_writer :ending_before + + # Page size (for pagination). + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + sig { returns(T.nilable(String)) } + attr_reader :starting_after + + sig { params(starting_after: String).void } + attr_writer :starting_after + + sig do + params( + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/queue_retrieve_params.rbi b/rbi/lithic/models/transaction_monitoring/queue_retrieve_params.rbi new file mode 100644 index 00000000..91601050 --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/queue_retrieve_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + class QueueRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TransactionMonitoring::QueueRetrieveParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :queue_token + + sig do + params( + queue_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(queue_token:, request_options: {}) + end + + sig do + override.returns( + { queue_token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/queue_update_params.rbi b/rbi/lithic/models/transaction_monitoring/queue_update_params.rbi new file mode 100644 index 00000000..6b422b80 --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/queue_update_params.rbi @@ -0,0 +1,65 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + class QueueUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TransactionMonitoring::QueueUpdateParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :queue_token + + # New description for the queue, or `null` to clear it + sig { returns(T.nilable(String)) } + attr_accessor :description + + # New name for the queue + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig do + params( + queue_token: String, + description: T.nilable(String), + name: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + queue_token:, + # New description for the queue, or `null` to clear it + description: nil, + # New name for the queue + name: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + queue_token: String, + description: T.nilable(String), + name: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_monitoring/resolution_outcome.rbi b/rbi/lithic/models/transaction_monitoring/resolution_outcome.rbi new file mode 100644 index 00000000..f614a2e8 --- /dev/null +++ b/rbi/lithic/models/transaction_monitoring/resolution_outcome.rbi @@ -0,0 +1,61 @@ +# typed: strong + +module Lithic + module Models + module TransactionMonitoring + # Outcome recorded when a case is resolved: + # + # - `CONFIRMED_FRAUD` - The reviewed activity was confirmed to be fraudulent + # - `SUSPICIOUS_ACTIVITY` - The activity is suspicious but not confirmed fraud + # - `FALSE_POSITIVE` - The activity was legitimate and the alert was a false + # positive + # - `NO_ACTION_REQUIRED` - No further action is required + # - `ESCALATED_EXTERNAL` - The case was escalated to an external party + module ResolutionOutcome + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::TransactionMonitoring::ResolutionOutcome) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CONFIRMED_FRAUD = + T.let( + :CONFIRMED_FRAUD, + Lithic::TransactionMonitoring::ResolutionOutcome::TaggedSymbol + ) + SUSPICIOUS_ACTIVITY = + T.let( + :SUSPICIOUS_ACTIVITY, + Lithic::TransactionMonitoring::ResolutionOutcome::TaggedSymbol + ) + FALSE_POSITIVE = + T.let( + :FALSE_POSITIVE, + Lithic::TransactionMonitoring::ResolutionOutcome::TaggedSymbol + ) + NO_ACTION_REQUIRED = + T.let( + :NO_ACTION_REQUIRED, + Lithic::TransactionMonitoring::ResolutionOutcome::TaggedSymbol + ) + ESCALATED_EXTERNAL = + T.let( + :ESCALATED_EXTERNAL, + Lithic::TransactionMonitoring::ResolutionOutcome::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::TransactionMonitoring::ResolutionOutcome::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_retrieve_params.rbi b/rbi/lithic/models/transaction_retrieve_params.rbi new file mode 100644 index 00000000..63801408 --- /dev/null +++ b/rbi/lithic/models/transaction_retrieve_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Lithic + module Models + class TransactionRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::TransactionRetrieveParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :transaction_token + + sig do + params( + transaction_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(transaction_token:, request_options: {}) + end + + sig do + override.returns( + { transaction_token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/transaction_route_params.rbi b/rbi/lithic/models/transaction_route_params.rbi new file mode 100644 index 00000000..e9f9bfd1 --- /dev/null +++ b/rbi/lithic/models/transaction_route_params.rbi @@ -0,0 +1,49 @@ +# typed: strong + +module Lithic + module Models + class TransactionRouteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::TransactionRouteParams, Lithic::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :transaction_token + + # The token of the financial account to route the transaction to. + sig { returns(String) } + attr_accessor :financial_account_token + + sig do + params( + transaction_token: String, + financial_account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + transaction_token:, + # The token of the financial account to route the transaction to. + financial_account_token:, + request_options: {} + ) + end + + sig do + override.returns( + { + transaction_token: String, + financial_account_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/transaction_simulate_authorization_advice_params.rbi b/rbi/lithic/models/transaction_simulate_authorization_advice_params.rbi new file mode 100644 index 00000000..3f70da92 --- /dev/null +++ b/rbi/lithic/models/transaction_simulate_authorization_advice_params.rbi @@ -0,0 +1,56 @@ +# typed: strong + +module Lithic + module Models + class TransactionSimulateAuthorizationAdviceParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TransactionSimulateAuthorizationAdviceParams, + Lithic::Internal::AnyHash + ) + end + + # The transaction token returned from the /v1/simulate/authorize. response. + sig { returns(String) } + attr_accessor :token + + # Amount (in cents) to authorize. This amount will override the transaction's + # amount that was originally set by /v1/simulate/authorize. + sig { returns(Integer) } + attr_accessor :amount + + sig do + params( + token: String, + amount: Integer, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The transaction token returned from the /v1/simulate/authorize. response. + token:, + # Amount (in cents) to authorize. This amount will override the transaction's + # amount that was originally set by /v1/simulate/authorize. + amount:, + request_options: {} + ) + end + + sig do + override.returns( + { + token: String, + amount: Integer, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/transaction_simulate_authorization_advice_response.rbi b/rbi/lithic/models/transaction_simulate_authorization_advice_response.rbi new file mode 100644 index 00000000..9b081c0d --- /dev/null +++ b/rbi/lithic/models/transaction_simulate_authorization_advice_response.rbi @@ -0,0 +1,46 @@ +# typed: strong + +module Lithic + module Models + class TransactionSimulateAuthorizationAdviceResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::TransactionSimulateAuthorizationAdviceResponse, + Lithic::Internal::AnyHash + ) + end + + # A unique token to reference this transaction. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # Debugging request ID to share with Lithic Support team. + sig { returns(T.nilable(String)) } + attr_reader :debugging_request_id + + sig { params(debugging_request_id: String).void } + attr_writer :debugging_request_id + + sig do + params(token: String, debugging_request_id: String).returns( + T.attached_class + ) + end + def self.new( + # A unique token to reference this transaction. + token: nil, + # Debugging request ID to share with Lithic Support team. + debugging_request_id: nil + ) + end + + sig { override.returns({ token: String, debugging_request_id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/transaction_simulate_authorization_params.rbi b/rbi/lithic/models/transaction_simulate_authorization_params.rbi new file mode 100644 index 00000000..cd38dd35 --- /dev/null +++ b/rbi/lithic/models/transaction_simulate_authorization_params.rbi @@ -0,0 +1,300 @@ +# typed: strong + +module Lithic + module Models + class TransactionSimulateAuthorizationParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TransactionSimulateAuthorizationParams, + Lithic::Internal::AnyHash + ) + end + + # Amount (in cents) to authorize. For credit authorizations and financial credit + # authorizations, any value entered will be converted into a negative amount in + # the simulated transaction. For example, entering 100 in this field will result + # in a -100 amount in the transaction. For balance inquiries, this field must be + # set to 0. + sig { returns(Integer) } + attr_accessor :amount + + # Merchant descriptor. + sig { returns(String) } + attr_accessor :descriptor + + # Sixteen digit card number. + sig { returns(String) } + attr_accessor :pan + + # Merchant category code for the transaction to be simulated. A four-digit number + # listed in ISO 18245. Supported merchant category codes can be found + # [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs). + sig { returns(T.nilable(String)) } + attr_reader :mcc + + sig { params(mcc: String).void } + attr_writer :mcc + + # Merchant acceptor city + sig { returns(T.nilable(String)) } + attr_reader :merchant_acceptor_city + + sig { params(merchant_acceptor_city: String).void } + attr_writer :merchant_acceptor_city + + # Merchant acceptor country code (ISO 3166-1 alpha-3) + sig { returns(T.nilable(String)) } + attr_reader :merchant_acceptor_country + + sig { params(merchant_acceptor_country: String).void } + attr_writer :merchant_acceptor_country + + # Unique identifier to identify the payment card acceptor. + sig { returns(T.nilable(String)) } + attr_reader :merchant_acceptor_id + + sig { params(merchant_acceptor_id: String).void } + attr_writer :merchant_acceptor_id + + # Merchant acceptor state/province (ISO 3166-2 subdivision code) + sig { returns(T.nilable(String)) } + attr_reader :merchant_acceptor_state + + sig { params(merchant_acceptor_state: String).void } + attr_writer :merchant_acceptor_state + + # Amount of the transaction to be simulated in currency specified in + # merchant_currency, including any acquirer fees. + sig { returns(T.nilable(Integer)) } + attr_reader :merchant_amount + + sig { params(merchant_amount: Integer).void } + attr_writer :merchant_amount + + # 3-character alphabetic ISO 4217 currency code. Note: Simulator only accepts USD, + # GBP, EUR and defaults to GBP if another ISO 4217 code is provided + sig { returns(T.nilable(String)) } + attr_reader :merchant_currency + + sig { params(merchant_currency: String).void } + attr_writer :merchant_currency + + # Set to true if the terminal is capable of partial approval otherwise false. + # Partial approval is when part of a transaction is approved and another payment + # must be used for the remainder. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :partial_approval_capable + + sig { params(partial_approval_capable: T::Boolean).void } + attr_writer :partial_approval_capable + + # Simulate entering a PIN. If omitted, PIN check will not be performed. + sig { returns(T.nilable(String)) } + attr_reader :pin + + sig { params(pin: String).void } + attr_writer :pin + + # Type of event to simulate. + # + # - `AUTHORIZATION` is a dual message purchase authorization, meaning a subsequent + # clearing step is required to settle the transaction. + # - `BALANCE_INQUIRY` is a $0 authorization requesting the balance held on the + # card, and is most often observed when a cardholder requests to view a card's + # balance at an ATM. + # - `CREDIT_AUTHORIZATION` is a dual message request from a merchant to authorize + # a refund, meaning a subsequent clearing step is required to settle the + # transaction. + # - `FINANCIAL_AUTHORIZATION` is a single message request from a merchant to debit + # funds immediately (such as an ATM withdrawal), and no subsequent clearing is + # required to settle the transaction. + # - `FINANCIAL_CREDIT_AUTHORIZATION` is a single message request from a merchant + # to credit funds immediately, and no subsequent clearing is required to settle + # the transaction. + sig do + returns( + T.nilable( + Lithic::TransactionSimulateAuthorizationParams::Status::OrSymbol + ) + ) + end + attr_reader :status + + sig do + params( + status: + Lithic::TransactionSimulateAuthorizationParams::Status::OrSymbol + ).void + end + attr_writer :status + + sig do + params( + amount: Integer, + descriptor: String, + pan: String, + mcc: String, + merchant_acceptor_city: String, + merchant_acceptor_country: String, + merchant_acceptor_id: String, + merchant_acceptor_state: String, + merchant_amount: Integer, + merchant_currency: String, + partial_approval_capable: T::Boolean, + pin: String, + status: + Lithic::TransactionSimulateAuthorizationParams::Status::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Amount (in cents) to authorize. For credit authorizations and financial credit + # authorizations, any value entered will be converted into a negative amount in + # the simulated transaction. For example, entering 100 in this field will result + # in a -100 amount in the transaction. For balance inquiries, this field must be + # set to 0. + amount:, + # Merchant descriptor. + descriptor:, + # Sixteen digit card number. + pan:, + # Merchant category code for the transaction to be simulated. A four-digit number + # listed in ISO 18245. Supported merchant category codes can be found + # [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs). + mcc: nil, + # Merchant acceptor city + merchant_acceptor_city: nil, + # Merchant acceptor country code (ISO 3166-1 alpha-3) + merchant_acceptor_country: nil, + # Unique identifier to identify the payment card acceptor. + merchant_acceptor_id: nil, + # Merchant acceptor state/province (ISO 3166-2 subdivision code) + merchant_acceptor_state: nil, + # Amount of the transaction to be simulated in currency specified in + # merchant_currency, including any acquirer fees. + merchant_amount: nil, + # 3-character alphabetic ISO 4217 currency code. Note: Simulator only accepts USD, + # GBP, EUR and defaults to GBP if another ISO 4217 code is provided + merchant_currency: nil, + # Set to true if the terminal is capable of partial approval otherwise false. + # Partial approval is when part of a transaction is approved and another payment + # must be used for the remainder. + partial_approval_capable: nil, + # Simulate entering a PIN. If omitted, PIN check will not be performed. + pin: nil, + # Type of event to simulate. + # + # - `AUTHORIZATION` is a dual message purchase authorization, meaning a subsequent + # clearing step is required to settle the transaction. + # - `BALANCE_INQUIRY` is a $0 authorization requesting the balance held on the + # card, and is most often observed when a cardholder requests to view a card's + # balance at an ATM. + # - `CREDIT_AUTHORIZATION` is a dual message request from a merchant to authorize + # a refund, meaning a subsequent clearing step is required to settle the + # transaction. + # - `FINANCIAL_AUTHORIZATION` is a single message request from a merchant to debit + # funds immediately (such as an ATM withdrawal), and no subsequent clearing is + # required to settle the transaction. + # - `FINANCIAL_CREDIT_AUTHORIZATION` is a single message request from a merchant + # to credit funds immediately, and no subsequent clearing is required to settle + # the transaction. + status: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + amount: Integer, + descriptor: String, + pan: String, + mcc: String, + merchant_acceptor_city: String, + merchant_acceptor_country: String, + merchant_acceptor_id: String, + merchant_acceptor_state: String, + merchant_amount: Integer, + merchant_currency: String, + partial_approval_capable: T::Boolean, + pin: String, + status: + Lithic::TransactionSimulateAuthorizationParams::Status::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Type of event to simulate. + # + # - `AUTHORIZATION` is a dual message purchase authorization, meaning a subsequent + # clearing step is required to settle the transaction. + # - `BALANCE_INQUIRY` is a $0 authorization requesting the balance held on the + # card, and is most often observed when a cardholder requests to view a card's + # balance at an ATM. + # - `CREDIT_AUTHORIZATION` is a dual message request from a merchant to authorize + # a refund, meaning a subsequent clearing step is required to settle the + # transaction. + # - `FINANCIAL_AUTHORIZATION` is a single message request from a merchant to debit + # funds immediately (such as an ATM withdrawal), and no subsequent clearing is + # required to settle the transaction. + # - `FINANCIAL_CREDIT_AUTHORIZATION` is a single message request from a merchant + # to credit funds immediately, and no subsequent clearing is required to settle + # the transaction. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::TransactionSimulateAuthorizationParams::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AUTHORIZATION = + T.let( + :AUTHORIZATION, + Lithic::TransactionSimulateAuthorizationParams::Status::TaggedSymbol + ) + BALANCE_INQUIRY = + T.let( + :BALANCE_INQUIRY, + Lithic::TransactionSimulateAuthorizationParams::Status::TaggedSymbol + ) + CREDIT_AUTHORIZATION = + T.let( + :CREDIT_AUTHORIZATION, + Lithic::TransactionSimulateAuthorizationParams::Status::TaggedSymbol + ) + FINANCIAL_AUTHORIZATION = + T.let( + :FINANCIAL_AUTHORIZATION, + Lithic::TransactionSimulateAuthorizationParams::Status::TaggedSymbol + ) + FINANCIAL_CREDIT_AUTHORIZATION = + T.let( + :FINANCIAL_CREDIT_AUTHORIZATION, + Lithic::TransactionSimulateAuthorizationParams::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::TransactionSimulateAuthorizationParams::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_simulate_authorization_response.rbi b/rbi/lithic/models/transaction_simulate_authorization_response.rbi new file mode 100644 index 00000000..62f3f4f5 --- /dev/null +++ b/rbi/lithic/models/transaction_simulate_authorization_response.rbi @@ -0,0 +1,48 @@ +# typed: strong + +module Lithic + module Models + class TransactionSimulateAuthorizationResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::TransactionSimulateAuthorizationResponse, + Lithic::Internal::AnyHash + ) + end + + # A unique token to reference this transaction with later calls to void or clear + # the authorization. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # Debugging request ID to share with Lithic Support team. + sig { returns(T.nilable(String)) } + attr_reader :debugging_request_id + + sig { params(debugging_request_id: String).void } + attr_writer :debugging_request_id + + sig do + params(token: String, debugging_request_id: String).returns( + T.attached_class + ) + end + def self.new( + # A unique token to reference this transaction with later calls to void or clear + # the authorization. + token: nil, + # Debugging request ID to share with Lithic Support team. + debugging_request_id: nil + ) + end + + sig { override.returns({ token: String, debugging_request_id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/transaction_simulate_clearing_params.rbi b/rbi/lithic/models/transaction_simulate_clearing_params.rbi new file mode 100644 index 00000000..691a6ed4 --- /dev/null +++ b/rbi/lithic/models/transaction_simulate_clearing_params.rbi @@ -0,0 +1,73 @@ +# typed: strong + +module Lithic + module Models + class TransactionSimulateClearingParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TransactionSimulateClearingParams, + Lithic::Internal::AnyHash + ) + end + + # The transaction token returned from the /v1/simulate/authorize response. + sig { returns(String) } + attr_accessor :token + + # Amount (in cents) to clear. Typically this will match the amount in the original + # authorization, but can be higher or lower. The sign of this amount will + # automatically match the sign of the original authorization's amount. For + # example, entering 100 in this field will result in a -100 amount in the + # transaction, if the original authorization is a credit authorization. + # + # If `amount` is not set, the full amount of the transaction will be cleared. + # Transactions that have already cleared, either partially or fully, cannot be + # cleared again using this endpoint. + sig { returns(T.nilable(Integer)) } + attr_reader :amount + + sig { params(amount: Integer).void } + attr_writer :amount + + sig do + params( + token: String, + amount: Integer, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The transaction token returned from the /v1/simulate/authorize response. + token:, + # Amount (in cents) to clear. Typically this will match the amount in the original + # authorization, but can be higher or lower. The sign of this amount will + # automatically match the sign of the original authorization's amount. For + # example, entering 100 in this field will result in a -100 amount in the + # transaction, if the original authorization is a credit authorization. + # + # If `amount` is not set, the full amount of the transaction will be cleared. + # Transactions that have already cleared, either partially or fully, cannot be + # cleared again using this endpoint. + amount: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + token: String, + amount: Integer, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/transaction_simulate_clearing_response.rbi b/rbi/lithic/models/transaction_simulate_clearing_response.rbi new file mode 100644 index 00000000..0762fd59 --- /dev/null +++ b/rbi/lithic/models/transaction_simulate_clearing_response.rbi @@ -0,0 +1,33 @@ +# typed: strong + +module Lithic + module Models + class TransactionSimulateClearingResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::TransactionSimulateClearingResponse, + Lithic::Internal::AnyHash + ) + end + + # Debugging request ID to share with Lithic Support team. + sig { returns(T.nilable(String)) } + attr_reader :debugging_request_id + + sig { params(debugging_request_id: String).void } + attr_writer :debugging_request_id + + sig { params(debugging_request_id: String).returns(T.attached_class) } + def self.new( + # Debugging request ID to share with Lithic Support team. + debugging_request_id: nil + ) + end + + sig { override.returns({ debugging_request_id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/transaction_simulate_credit_authorization_advice_params.rbi b/rbi/lithic/models/transaction_simulate_credit_authorization_advice_params.rbi new file mode 100644 index 00000000..73df4c85 --- /dev/null +++ b/rbi/lithic/models/transaction_simulate_credit_authorization_advice_params.rbi @@ -0,0 +1,125 @@ +# typed: strong + +module Lithic + module Models + class TransactionSimulateCreditAuthorizationAdviceParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TransactionSimulateCreditAuthorizationAdviceParams, + Lithic::Internal::AnyHash + ) + end + + # Amount (in cents). Any value entered will be converted into a negative amount in + # the simulated transaction. For example, entering 100 in this field will appear + # as a -100 amount in the transaction. + sig { returns(Integer) } + attr_accessor :amount + + # Merchant descriptor. + sig { returns(String) } + attr_accessor :descriptor + + # Sixteen digit card number. + sig { returns(String) } + attr_accessor :pan + + # Merchant category code for the transaction to be simulated. A four-digit number + # listed in ISO 18245. Supported merchant category codes can be found + # [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs). + sig { returns(T.nilable(String)) } + attr_reader :mcc + + sig { params(mcc: String).void } + attr_writer :mcc + + # Merchant acceptor city + sig { returns(T.nilable(String)) } + attr_reader :merchant_acceptor_city + + sig { params(merchant_acceptor_city: String).void } + attr_writer :merchant_acceptor_city + + # Merchant acceptor country code (ISO 3166-1 alpha-3) + sig { returns(T.nilable(String)) } + attr_reader :merchant_acceptor_country + + sig { params(merchant_acceptor_country: String).void } + attr_writer :merchant_acceptor_country + + # Unique identifier to identify the payment card acceptor. + sig { returns(T.nilable(String)) } + attr_reader :merchant_acceptor_id + + sig { params(merchant_acceptor_id: String).void } + attr_writer :merchant_acceptor_id + + # Merchant acceptor state/province (ISO 3166-2 subdivision code) + sig { returns(T.nilable(String)) } + attr_reader :merchant_acceptor_state + + sig { params(merchant_acceptor_state: String).void } + attr_writer :merchant_acceptor_state + + sig do + params( + amount: Integer, + descriptor: String, + pan: String, + mcc: String, + merchant_acceptor_city: String, + merchant_acceptor_country: String, + merchant_acceptor_id: String, + merchant_acceptor_state: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Amount (in cents). Any value entered will be converted into a negative amount in + # the simulated transaction. For example, entering 100 in this field will appear + # as a -100 amount in the transaction. + amount:, + # Merchant descriptor. + descriptor:, + # Sixteen digit card number. + pan:, + # Merchant category code for the transaction to be simulated. A four-digit number + # listed in ISO 18245. Supported merchant category codes can be found + # [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs). + mcc: nil, + # Merchant acceptor city + merchant_acceptor_city: nil, + # Merchant acceptor country code (ISO 3166-1 alpha-3) + merchant_acceptor_country: nil, + # Unique identifier to identify the payment card acceptor. + merchant_acceptor_id: nil, + # Merchant acceptor state/province (ISO 3166-2 subdivision code) + merchant_acceptor_state: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + amount: Integer, + descriptor: String, + pan: String, + mcc: String, + merchant_acceptor_city: String, + merchant_acceptor_country: String, + merchant_acceptor_id: String, + merchant_acceptor_state: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/transaction_simulate_credit_authorization_advice_response.rbi b/rbi/lithic/models/transaction_simulate_credit_authorization_advice_response.rbi new file mode 100644 index 00000000..08910eee --- /dev/null +++ b/rbi/lithic/models/transaction_simulate_credit_authorization_advice_response.rbi @@ -0,0 +1,46 @@ +# typed: strong + +module Lithic + module Models + class TransactionSimulateCreditAuthorizationAdviceResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::TransactionSimulateCreditAuthorizationAdviceResponse, + Lithic::Internal::AnyHash + ) + end + + # A unique token to reference this transaction. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # Debugging request ID to share with Lithic Support team. + sig { returns(T.nilable(String)) } + attr_reader :debugging_request_id + + sig { params(debugging_request_id: String).void } + attr_writer :debugging_request_id + + sig do + params(token: String, debugging_request_id: String).returns( + T.attached_class + ) + end + def self.new( + # A unique token to reference this transaction. + token: nil, + # Debugging request ID to share with Lithic Support team. + debugging_request_id: nil + ) + end + + sig { override.returns({ token: String, debugging_request_id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/transaction_simulate_return_params.rbi b/rbi/lithic/models/transaction_simulate_return_params.rbi new file mode 100644 index 00000000..89cfe608 --- /dev/null +++ b/rbi/lithic/models/transaction_simulate_return_params.rbi @@ -0,0 +1,62 @@ +# typed: strong + +module Lithic + module Models + class TransactionSimulateReturnParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TransactionSimulateReturnParams, + Lithic::Internal::AnyHash + ) + end + + # Amount (in cents) to authorize. + sig { returns(Integer) } + attr_accessor :amount + + # Merchant descriptor. + sig { returns(String) } + attr_accessor :descriptor + + # Sixteen digit card number. + sig { returns(String) } + attr_accessor :pan + + sig do + params( + amount: Integer, + descriptor: String, + pan: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Amount (in cents) to authorize. + amount:, + # Merchant descriptor. + descriptor:, + # Sixteen digit card number. + pan:, + request_options: {} + ) + end + + sig do + override.returns( + { + amount: Integer, + descriptor: String, + pan: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/transaction_simulate_return_response.rbi b/rbi/lithic/models/transaction_simulate_return_response.rbi new file mode 100644 index 00000000..ecfb01c7 --- /dev/null +++ b/rbi/lithic/models/transaction_simulate_return_response.rbi @@ -0,0 +1,46 @@ +# typed: strong + +module Lithic + module Models + class TransactionSimulateReturnResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::TransactionSimulateReturnResponse, + Lithic::Internal::AnyHash + ) + end + + # A unique token to reference this transaction. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # Debugging request ID to share with Lithic Support team. + sig { returns(T.nilable(String)) } + attr_reader :debugging_request_id + + sig { params(debugging_request_id: String).void } + attr_writer :debugging_request_id + + sig do + params(token: String, debugging_request_id: String).returns( + T.attached_class + ) + end + def self.new( + # A unique token to reference this transaction. + token: nil, + # Debugging request ID to share with Lithic Support team. + debugging_request_id: nil + ) + end + + sig { override.returns({ token: String, debugging_request_id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/transaction_simulate_return_reversal_params.rbi b/rbi/lithic/models/transaction_simulate_return_reversal_params.rbi new file mode 100644 index 00000000..dfb5c04f --- /dev/null +++ b/rbi/lithic/models/transaction_simulate_return_reversal_params.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Lithic + module Models + class TransactionSimulateReturnReversalParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TransactionSimulateReturnReversalParams, + Lithic::Internal::AnyHash + ) + end + + # The transaction token returned from the /v1/simulate/authorize response. + sig { returns(String) } + attr_accessor :token + + sig do + params( + token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The transaction token returned from the /v1/simulate/authorize response. + token:, + request_options: {} + ) + end + + sig do + override.returns( + { token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/transaction_simulate_return_reversal_response.rbi b/rbi/lithic/models/transaction_simulate_return_reversal_response.rbi new file mode 100644 index 00000000..f48b9a35 --- /dev/null +++ b/rbi/lithic/models/transaction_simulate_return_reversal_response.rbi @@ -0,0 +1,33 @@ +# typed: strong + +module Lithic + module Models + class TransactionSimulateReturnReversalResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::TransactionSimulateReturnReversalResponse, + Lithic::Internal::AnyHash + ) + end + + # Debugging request ID to share with Lithic Support team. + sig { returns(T.nilable(String)) } + attr_reader :debugging_request_id + + sig { params(debugging_request_id: String).void } + attr_writer :debugging_request_id + + sig { params(debugging_request_id: String).returns(T.attached_class) } + def self.new( + # Debugging request ID to share with Lithic Support team. + debugging_request_id: nil + ) + end + + sig { override.returns({ debugging_request_id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/transaction_simulate_void_params.rbi b/rbi/lithic/models/transaction_simulate_void_params.rbi new file mode 100644 index 00000000..c0f7557d --- /dev/null +++ b/rbi/lithic/models/transaction_simulate_void_params.rbi @@ -0,0 +1,120 @@ +# typed: strong + +module Lithic + module Models + class TransactionSimulateVoidParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::TransactionSimulateVoidParams, + Lithic::Internal::AnyHash + ) + end + + # The transaction token returned from the /v1/simulate/authorize response. + sig { returns(String) } + attr_accessor :token + + # Amount (in cents) to void. Typically this will match the amount in the original + # authorization, but can be less. Applies to authorization reversals only. An + # authorization expiry will always apply to the full pending amount. + sig { returns(T.nilable(Integer)) } + attr_reader :amount + + sig { params(amount: Integer).void } + attr_writer :amount + + # Type of event to simulate. Defaults to `AUTHORIZATION_REVERSAL`. + # + # - `AUTHORIZATION_EXPIRY` indicates authorization has expired and been reversed + # by Lithic. + # - `AUTHORIZATION_REVERSAL` indicates authorization was reversed by the merchant. + sig do + returns( + T.nilable(Lithic::TransactionSimulateVoidParams::Type::OrSymbol) + ) + end + attr_reader :type + + sig do + params(type: Lithic::TransactionSimulateVoidParams::Type::OrSymbol).void + end + attr_writer :type + + sig do + params( + token: String, + amount: Integer, + type: Lithic::TransactionSimulateVoidParams::Type::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The transaction token returned from the /v1/simulate/authorize response. + token:, + # Amount (in cents) to void. Typically this will match the amount in the original + # authorization, but can be less. Applies to authorization reversals only. An + # authorization expiry will always apply to the full pending amount. + amount: nil, + # Type of event to simulate. Defaults to `AUTHORIZATION_REVERSAL`. + # + # - `AUTHORIZATION_EXPIRY` indicates authorization has expired and been reversed + # by Lithic. + # - `AUTHORIZATION_REVERSAL` indicates authorization was reversed by the merchant. + type: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + token: String, + amount: Integer, + type: Lithic::TransactionSimulateVoidParams::Type::OrSymbol, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + + # Type of event to simulate. Defaults to `AUTHORIZATION_REVERSAL`. + # + # - `AUTHORIZATION_EXPIRY` indicates authorization has expired and been reversed + # by Lithic. + # - `AUTHORIZATION_REVERSAL` indicates authorization was reversed by the merchant. + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Lithic::TransactionSimulateVoidParams::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AUTHORIZATION_EXPIRY = + T.let( + :AUTHORIZATION_EXPIRY, + Lithic::TransactionSimulateVoidParams::Type::TaggedSymbol + ) + AUTHORIZATION_REVERSAL = + T.let( + :AUTHORIZATION_REVERSAL, + Lithic::TransactionSimulateVoidParams::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Lithic::TransactionSimulateVoidParams::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/transaction_simulate_void_response.rbi b/rbi/lithic/models/transaction_simulate_void_response.rbi new file mode 100644 index 00000000..d89f7e7f --- /dev/null +++ b/rbi/lithic/models/transaction_simulate_void_response.rbi @@ -0,0 +1,33 @@ +# typed: strong + +module Lithic + module Models + class TransactionSimulateVoidResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::TransactionSimulateVoidResponse, + Lithic::Internal::AnyHash + ) + end + + # Debugging request ID to share with Lithic Support team. + sig { returns(T.nilable(String)) } + attr_reader :debugging_request_id + + sig { params(debugging_request_id: String).void } + attr_writer :debugging_request_id + + sig { params(debugging_request_id: String).returns(T.attached_class) } + def self.new( + # Debugging request ID to share with Lithic Support team. + debugging_request_id: nil + ) + end + + sig { override.returns({ debugging_request_id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/transactions/enhanced_commercial_data_retrieve_params.rbi b/rbi/lithic/models/transactions/enhanced_commercial_data_retrieve_params.rbi new file mode 100644 index 00000000..b28fc1f8 --- /dev/null +++ b/rbi/lithic/models/transactions/enhanced_commercial_data_retrieve_params.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Lithic + module Models + module Transactions + class EnhancedCommercialDataRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::Transactions::EnhancedCommercialDataRetrieveParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :transaction_token + + sig do + params( + transaction_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(transaction_token:, request_options: {}) + end + + sig do + override.returns( + { + transaction_token: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/transactions/enhanced_commercial_data_retrieve_response.rbi b/rbi/lithic/models/transactions/enhanced_commercial_data_retrieve_response.rbi new file mode 100644 index 00000000..5e831784 --- /dev/null +++ b/rbi/lithic/models/transactions/enhanced_commercial_data_retrieve_response.rbi @@ -0,0 +1,36 @@ +# typed: strong + +module Lithic + module Models + module Transactions + class EnhancedCommercialDataRetrieveResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Models::Transactions::EnhancedCommercialDataRetrieveResponse, + Lithic::Internal::AnyHash + ) + end + + sig { returns(T::Array[Lithic::Transactions::Events::EnhancedData]) } + attr_accessor :data + + sig do + params( + data: T::Array[Lithic::Transactions::Events::EnhancedData::OrHash] + ).returns(T.attached_class) + end + def self.new(data:) + end + + sig do + override.returns( + { data: T::Array[Lithic::Transactions::Events::EnhancedData] } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/lithic/models/transactions/events/enhanced_commercial_data_retrieve_params.rbi b/rbi/lithic/models/transactions/events/enhanced_commercial_data_retrieve_params.rbi new file mode 100644 index 00000000..8c3aa3b9 --- /dev/null +++ b/rbi/lithic/models/transactions/events/enhanced_commercial_data_retrieve_params.rbi @@ -0,0 +1,42 @@ +# typed: strong + +module Lithic + module Models + module Transactions + module Events + class EnhancedCommercialDataRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Lithic::Transactions::Events::EnhancedCommercialDataRetrieveParams, + Lithic::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :event_token + + sig do + params( + event_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(event_token:, request_options: {}) + end + + sig do + override.returns( + { event_token: String, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/lithic/models/transactions/events/enhanced_data.rbi b/rbi/lithic/models/transactions/events/enhanced_data.rbi new file mode 100644 index 00000000..cb2b76a5 --- /dev/null +++ b/rbi/lithic/models/transactions/events/enhanced_data.rbi @@ -0,0 +1,1305 @@ +# typed: strong + +module Lithic + module Models + module Transactions + module Events + class EnhancedData < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Transactions::Events::EnhancedData, + Lithic::Internal::AnyHash + ) + end + + # A unique identifier for the enhanced commercial data. + sig { returns(String) } + attr_accessor :token + + sig { returns(Lithic::Transactions::Events::EnhancedData::Common) } + attr_reader :common + + sig do + params( + common: Lithic::Transactions::Events::EnhancedData::Common::OrHash + ).void + end + attr_writer :common + + # The token of the event that the enhanced data is associated with. + sig { returns(String) } + attr_accessor :event_token + + sig do + returns(T::Array[Lithic::Transactions::Events::EnhancedData::Fleet]) + end + attr_accessor :fleet + + # The token of the transaction that the enhanced data is associated with. + sig { returns(String) } + attr_accessor :transaction_token + + sig do + params( + token: String, + common: + Lithic::Transactions::Events::EnhancedData::Common::OrHash, + event_token: String, + fleet: + T::Array[ + Lithic::Transactions::Events::EnhancedData::Fleet::OrHash + ], + transaction_token: String + ).returns(T.attached_class) + end + def self.new( + # A unique identifier for the enhanced commercial data. + token:, + common:, + # The token of the event that the enhanced data is associated with. + event_token:, + fleet:, + # The token of the transaction that the enhanced data is associated with. + transaction_token: + ) + end + + sig do + override.returns( + { + token: String, + common: Lithic::Transactions::Events::EnhancedData::Common, + event_token: String, + fleet: + T::Array[Lithic::Transactions::Events::EnhancedData::Fleet], + transaction_token: String + } + ) + end + def to_hash + end + + class Common < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Transactions::Events::EnhancedData::Common, + Lithic::Internal::AnyHash + ) + end + + sig do + returns( + T::Array[ + Lithic::Transactions::Events::EnhancedData::Common::LineItem + ] + ) + end + attr_accessor :line_items + + sig do + returns(Lithic::Transactions::Events::EnhancedData::Common::Tax) + end + attr_reader :tax + + sig do + params( + tax: + Lithic::Transactions::Events::EnhancedData::Common::Tax::OrHash + ).void + end + attr_writer :tax + + # A customer identifier. + sig { returns(T.nilable(String)) } + attr_accessor :customer_reference_number + + # A merchant identifier. + sig { returns(T.nilable(String)) } + attr_accessor :merchant_reference_number + + # The date of the order. + sig { returns(T.nilable(Date)) } + attr_accessor :order_date + + sig do + params( + line_items: + T::Array[ + Lithic::Transactions::Events::EnhancedData::Common::LineItem::OrHash + ], + tax: + Lithic::Transactions::Events::EnhancedData::Common::Tax::OrHash, + customer_reference_number: T.nilable(String), + merchant_reference_number: T.nilable(String), + order_date: T.nilable(Date) + ).returns(T.attached_class) + end + def self.new( + line_items:, + tax:, + # A customer identifier. + customer_reference_number: nil, + # A merchant identifier. + merchant_reference_number: nil, + # The date of the order. + order_date: nil + ) + end + + sig do + override.returns( + { + line_items: + T::Array[ + Lithic::Transactions::Events::EnhancedData::Common::LineItem + ], + tax: Lithic::Transactions::Events::EnhancedData::Common::Tax, + customer_reference_number: T.nilable(String), + merchant_reference_number: T.nilable(String), + order_date: T.nilable(Date) + } + ) + end + def to_hash + end + + class LineItem < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Transactions::Events::EnhancedData::Common::LineItem, + Lithic::Internal::AnyHash + ) + end + + # The price of the item purchased in merchant currency. + sig { returns(T.nilable(String)) } + attr_accessor :amount + + # A human-readable description of the item. + sig { returns(T.nilable(String)) } + attr_accessor :description + + # An identifier for the item purchased. + sig { returns(T.nilable(String)) } + attr_accessor :product_code + + # The quantity of the item purchased. + sig { returns(T.nilable(String)) } + attr_accessor :quantity + + # An L2/L3 enhanced commercial data line item. + sig do + params( + amount: T.nilable(String), + description: T.nilable(String), + product_code: T.nilable(String), + quantity: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The price of the item purchased in merchant currency. + amount: nil, + # A human-readable description of the item. + description: nil, + # An identifier for the item purchased. + product_code: nil, + # The quantity of the item purchased. + quantity: nil + ) + end + + sig do + override.returns( + { + amount: T.nilable(String), + description: T.nilable(String), + product_code: T.nilable(String), + quantity: T.nilable(String) + } + ) + end + def to_hash + end + end + + class Tax < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Transactions::Events::EnhancedData::Common::Tax, + Lithic::Internal::AnyHash + ) + end + + # The amount of tax collected. + sig { returns(T.nilable(Integer)) } + attr_accessor :amount + + # A flag indicating whether the transaction is tax exempt or not. + sig do + returns( + T.nilable( + Lithic::Transactions::Events::EnhancedData::Common::Tax::Exempt::TaggedSymbol + ) + ) + end + attr_accessor :exempt + + # The tax ID of the merchant. + sig { returns(T.nilable(String)) } + attr_accessor :merchant_tax_id + + sig do + params( + amount: T.nilable(Integer), + exempt: + T.nilable( + Lithic::Transactions::Events::EnhancedData::Common::Tax::Exempt::OrSymbol + ), + merchant_tax_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The amount of tax collected. + amount: nil, + # A flag indicating whether the transaction is tax exempt or not. + exempt: nil, + # The tax ID of the merchant. + merchant_tax_id: nil + ) + end + + sig do + override.returns( + { + amount: T.nilable(Integer), + exempt: + T.nilable( + Lithic::Transactions::Events::EnhancedData::Common::Tax::Exempt::TaggedSymbol + ), + merchant_tax_id: T.nilable(String) + } + ) + end + def to_hash + end + + # A flag indicating whether the transaction is tax exempt or not. + module Exempt + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Transactions::Events::EnhancedData::Common::Tax::Exempt + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TAX_INCLUDED = + T.let( + :TAX_INCLUDED, + Lithic::Transactions::Events::EnhancedData::Common::Tax::Exempt::TaggedSymbol + ) + TAX_NOT_INCLUDED = + T.let( + :TAX_NOT_INCLUDED, + Lithic::Transactions::Events::EnhancedData::Common::Tax::Exempt::TaggedSymbol + ) + NOT_SUPPORTED = + T.let( + :NOT_SUPPORTED, + Lithic::Transactions::Events::EnhancedData::Common::Tax::Exempt::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Transactions::Events::EnhancedData::Common::Tax::Exempt::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + + class Fleet < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Transactions::Events::EnhancedData::Fleet, + Lithic::Internal::AnyHash + ) + end + + sig do + returns( + Lithic::Transactions::Events::EnhancedData::Fleet::AmountTotals + ) + end + attr_reader :amount_totals + + sig do + params( + amount_totals: + Lithic::Transactions::Events::EnhancedData::Fleet::AmountTotals::OrHash + ).void + end + attr_writer :amount_totals + + sig do + returns(Lithic::Transactions::Events::EnhancedData::Fleet::Fuel) + end + attr_reader :fuel + + sig do + params( + fuel: + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::OrHash + ).void + end + attr_writer :fuel + + # The driver number entered into the terminal at the time of sale, with leading + # zeros stripped. + sig { returns(T.nilable(String)) } + attr_accessor :driver_number + + # The odometer reading entered into the terminal at the time of sale. + sig { returns(T.nilable(Integer)) } + attr_accessor :odometer + + # The type of fuel service. + sig do + returns( + T.nilable( + Lithic::Transactions::Events::EnhancedData::Fleet::ServiceType::TaggedSymbol + ) + ) + end + attr_reader :service_type + + sig do + params( + service_type: + Lithic::Transactions::Events::EnhancedData::Fleet::ServiceType::OrSymbol + ).void + end + attr_writer :service_type + + # The vehicle number entered into the terminal at the time of sale, with leading + # zeros stripped. + sig { returns(T.nilable(String)) } + attr_accessor :vehicle_number + + sig do + params( + amount_totals: + Lithic::Transactions::Events::EnhancedData::Fleet::AmountTotals::OrHash, + fuel: + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::OrHash, + driver_number: T.nilable(String), + odometer: T.nilable(Integer), + service_type: + Lithic::Transactions::Events::EnhancedData::Fleet::ServiceType::OrSymbol, + vehicle_number: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + amount_totals:, + fuel:, + # The driver number entered into the terminal at the time of sale, with leading + # zeros stripped. + driver_number: nil, + # The odometer reading entered into the terminal at the time of sale. + odometer: nil, + # The type of fuel service. + service_type: nil, + # The vehicle number entered into the terminal at the time of sale, with leading + # zeros stripped. + vehicle_number: nil + ) + end + + sig do + override.returns( + { + amount_totals: + Lithic::Transactions::Events::EnhancedData::Fleet::AmountTotals, + fuel: Lithic::Transactions::Events::EnhancedData::Fleet::Fuel, + driver_number: T.nilable(String), + odometer: T.nilable(Integer), + service_type: + Lithic::Transactions::Events::EnhancedData::Fleet::ServiceType::TaggedSymbol, + vehicle_number: T.nilable(String) + } + ) + end + def to_hash + end + + class AmountTotals < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Transactions::Events::EnhancedData::Fleet::AmountTotals, + Lithic::Internal::AnyHash + ) + end + + # The discount applied to the gross sale amount. + sig { returns(T.nilable(Integer)) } + attr_accessor :discount + + # The gross sale amount. + sig { returns(T.nilable(Integer)) } + attr_accessor :gross_sale + + # The amount after discount. + sig { returns(T.nilable(Integer)) } + attr_accessor :net_sale + + sig do + params( + discount: T.nilable(Integer), + gross_sale: T.nilable(Integer), + net_sale: T.nilable(Integer) + ).returns(T.attached_class) + end + def self.new( + # The discount applied to the gross sale amount. + discount: nil, + # The gross sale amount. + gross_sale: nil, + # The amount after discount. + net_sale: nil + ) + end + + sig do + override.returns( + { + discount: T.nilable(Integer), + gross_sale: T.nilable(Integer), + net_sale: T.nilable(Integer) + } + ) + end + def to_hash + end + end + + class Fuel < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel, + Lithic::Internal::AnyHash + ) + end + + # The quantity of fuel purchased. + sig { returns(T.nilable(String)) } + attr_accessor :quantity + + # The type of fuel purchased. + sig do + returns( + T.nilable( + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + ) + end + attr_accessor :type + + # Unit of measure for fuel disbursement. + sig do + returns( + T.nilable( + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure::TaggedSymbol + ) + ) + end + attr_accessor :unit_of_measure + + # The price per unit of fuel. + sig { returns(T.nilable(Integer)) } + attr_accessor :unit_price + + sig do + params( + quantity: T.nilable(String), + type: + T.nilable( + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::OrSymbol + ), + unit_of_measure: + T.nilable( + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure::OrSymbol + ), + unit_price: T.nilable(Integer) + ).returns(T.attached_class) + end + def self.new( + # The quantity of fuel purchased. + quantity: nil, + # The type of fuel purchased. + type: nil, + # Unit of measure for fuel disbursement. + unit_of_measure: nil, + # The price per unit of fuel. + unit_price: nil + ) + end + + sig do + override.returns( + { + quantity: T.nilable(String), + type: + T.nilable( + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ), + unit_of_measure: + T.nilable( + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure::TaggedSymbol + ), + unit_price: T.nilable(Integer) + } + ) + end + def to_hash + end + + # The type of fuel purchased. + module Type + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + REGULAR = + T.let( + :REGULAR, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + MID_PLUS = + T.let( + :MID_PLUS, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + PREMIUM_SUPER = + T.let( + :PREMIUM_SUPER, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + MID_PLUS_2 = + T.let( + :MID_PLUS_2, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + PREMIUM_SUPER_2 = + T.let( + :PREMIUM_SUPER_2, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + ETHANOL_5_7_BLEND = + T.let( + :ETHANOL_5_7_BLEND, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + MID_PLUS_ETHANOL_5_7_PERCENT_BLEND = + T.let( + :MID_PLUS_ETHANOL_5_7_PERCENT_BLEND, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + PREMIUM_SUPER_ETHANOL_5_7_PERCENT_BLEND = + T.let( + :PREMIUM_SUPER_ETHANOL_5_7_PERCENT_BLEND, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + ETHANOL_7_7_PERCENT_BLEND = + T.let( + :ETHANOL_7_7_PERCENT_BLEND, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + MID_PLUS_ETHANOL_7_7_PERCENT_BLEND = + T.let( + :MID_PLUS_ETHANOL_7_7_PERCENT_BLEND, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + GREEN_GASOLINE_REGULAR = + T.let( + :GREEN_GASOLINE_REGULAR, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + GREEN_GASOLINE_MID_PLUS = + T.let( + :GREEN_GASOLINE_MID_PLUS, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + GREEN_GASOLINE_PREMIUM_SUPER = + T.let( + :GREEN_GASOLINE_PREMIUM_SUPER, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + REGULAR_DIESEL_2 = + T.let( + :REGULAR_DIESEL_2, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + PREMIUM_DIESEL_2 = + T.let( + :PREMIUM_DIESEL_2, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + REGULAR_DIESEL_1 = + T.let( + :REGULAR_DIESEL_1, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + COMPRESSED_NATURAL_GAS = + T.let( + :COMPRESSED_NATURAL_GAS, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + LIQUID_PROPANE_GAS = + T.let( + :LIQUID_PROPANE_GAS, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + LIQUID_NATURAL_GAS = + T.let( + :LIQUID_NATURAL_GAS, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + E_85 = + T.let( + :E_85, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + REFORMULATED_1 = + T.let( + :REFORMULATED_1, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + REFORMULATED_2 = + T.let( + :REFORMULATED_2, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + REFORMULATED_3 = + T.let( + :REFORMULATED_3, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + REFORMULATED_4 = + T.let( + :REFORMULATED_4, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + REFORMULATED_5 = + T.let( + :REFORMULATED_5, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + DIESEL_OFF_ROAD_1_AND_2_NON_TAXABLE = + T.let( + :DIESEL_OFF_ROAD_1_AND_2_NON_TAXABLE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + DIESEL_OFF_ROAD_NON_TAXABLE = + T.let( + :DIESEL_OFF_ROAD_NON_TAXABLE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + BIODIESEL_BLEND_OFF_ROAD_NON_TAXABLE = + T.let( + :BIODIESEL_BLEND_OFF_ROAD_NON_TAXABLE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + UNDEFINED_FUEL = + T.let( + :UNDEFINED_FUEL, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + RACING_FUEL = + T.let( + :RACING_FUEL, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + MID_PLUS_2_10_PERCENT_BLEND = + T.let( + :MID_PLUS_2_10_PERCENT_BLEND, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + PREMIUM_SUPER_2_10_PERCENT_BLEND = + T.let( + :PREMIUM_SUPER_2_10_PERCENT_BLEND, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + MID_PLUS_ETHANOL_2_15_PERCENT_BLEND = + T.let( + :MID_PLUS_ETHANOL_2_15_PERCENT_BLEND, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + PREMIUM_SUPER_ETHANOL_2_15_PERCENT_BLEND = + T.let( + :PREMIUM_SUPER_ETHANOL_2_15_PERCENT_BLEND, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + PREMIUM_SUPER_ETHANOL_7_7_PERCENT_BLEND = + T.let( + :PREMIUM_SUPER_ETHANOL_7_7_PERCENT_BLEND, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + REGULAR_ETHANOL_10_PERCENT_BLEND = + T.let( + :REGULAR_ETHANOL_10_PERCENT_BLEND, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + MID_PLUS_ETHANOL_10_PERCENT_BLEND = + T.let( + :MID_PLUS_ETHANOL_10_PERCENT_BLEND, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + PREMIUM_SUPER_ETHANOL_10_PERCENT_BLEND = + T.let( + :PREMIUM_SUPER_ETHANOL_10_PERCENT_BLEND, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + B2_DIESEL_BLEND_2_PERCENT_BIODIESEL = + T.let( + :B2_DIESEL_BLEND_2_PERCENT_BIODIESEL, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + B5_DIESEL_BLEND_5_PERCENT_BIODIESEL = + T.let( + :B5_DIESEL_BLEND_5_PERCENT_BIODIESEL, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + B10_DIESEL_BLEND_10_PERCENT_BIODIESEL = + T.let( + :B10_DIESEL_BLEND_10_PERCENT_BIODIESEL, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + B11_DIESEL_BLEND_11_PERCENT_BIODIESEL = + T.let( + :B11_DIESEL_BLEND_11_PERCENT_BIODIESEL, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + B15_DIESEL_BLEND_15_PERCENT_BIODIESEL = + T.let( + :B15_DIESEL_BLEND_15_PERCENT_BIODIESEL, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + B20_DIESEL_BLEND_20_PERCENT_BIODIESEL = + T.let( + :B20_DIESEL_BLEND_20_PERCENT_BIODIESEL, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + B100_DIESEL_BLEND_100_PERCENT_BIODIESEL = + T.let( + :B100_DIESEL_BLEND_100_PERCENT_BIODIESEL, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + B1_DIESEL_BLEND_1_PERCENT_BIODIESEL = + T.let( + :B1_DIESEL_BLEND_1_PERCENT_BIODIESEL, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + ADDITIZED_DIESEL_2 = + T.let( + :ADDITIZED_DIESEL_2, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + ADDITIZED_DIESEL_3 = + T.let( + :ADDITIZED_DIESEL_3, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + RENEWABLE_DIESEL_R95 = + T.let( + :RENEWABLE_DIESEL_R95, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + RENEWABLE_DIESEL_BIODIESEL_6_20_PERCENT = + T.let( + :RENEWABLE_DIESEL_BIODIESEL_6_20_PERCENT, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + DIESEL_EXHAUST_FLUID = + T.let( + :DIESEL_EXHAUST_FLUID, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + PREMIUM_DIESEL_1 = + T.let( + :PREMIUM_DIESEL_1, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + REGULAR_ETHANOL_15_PERCENT_BLEND = + T.let( + :REGULAR_ETHANOL_15_PERCENT_BLEND, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + MID_PLUS_ETHANOL_15_PERCENT_BLEND = + T.let( + :MID_PLUS_ETHANOL_15_PERCENT_BLEND, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + PREMIUM_SUPER_ETHANOL_15_PERCENT_BLEND = + T.let( + :PREMIUM_SUPER_ETHANOL_15_PERCENT_BLEND, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + PREMIUM_DIESEL_BLEND_LESS_THAN_20_PERCENT_BIODIESEL = + T.let( + :PREMIUM_DIESEL_BLEND_LESS_THAN_20_PERCENT_BIODIESEL, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + PREMIUM_DIESEL_BLEND_GREATER_THAN_20_PERCENT_BIODIESEL = + T.let( + :PREMIUM_DIESEL_BLEND_GREATER_THAN_20_PERCENT_BIODIESEL, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + B75_DIESEL_BLEND_75_PERCENT_BIODIESEL = + T.let( + :B75_DIESEL_BLEND_75_PERCENT_BIODIESEL, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + B99_DIESEL_BLEND_99_PERCENT_BIODIESEL = + T.let( + :B99_DIESEL_BLEND_99_PERCENT_BIODIESEL, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + MISCELLANEOUS_FUEL = + T.let( + :MISCELLANEOUS_FUEL, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + JET_FUEL = + T.let( + :JET_FUEL, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + AVIATION_FUEL_REGULAR = + T.let( + :AVIATION_FUEL_REGULAR, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + AVIATION_FUEL_PREMIUM = + T.let( + :AVIATION_FUEL_PREMIUM, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + AVIATION_FUEL_JP8 = + T.let( + :AVIATION_FUEL_JP8, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + AVIATION_FUEL_4 = + T.let( + :AVIATION_FUEL_4, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + AVIATION_FUEL_5 = + T.let( + :AVIATION_FUEL_5, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + BIOJET_DIESEL = + T.let( + :BIOJET_DIESEL, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + AVIATION_BIOFUEL_GASOLINE = + T.let( + :AVIATION_BIOFUEL_GASOLINE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + MISCELLANEOUS_AVIATION_FUEL = + T.let( + :MISCELLANEOUS_AVIATION_FUEL, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + MARINE_FUEL_1 = + T.let( + :MARINE_FUEL_1, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + MARINE_FUEL_2 = + T.let( + :MARINE_FUEL_2, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + MARINE_FUEL_3 = + T.let( + :MARINE_FUEL_3, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + MARINE_FUEL_4 = + T.let( + :MARINE_FUEL_4, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + MARINE_FUEL_5 = + T.let( + :MARINE_FUEL_5, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + MARINE_OTHER = + T.let( + :MARINE_OTHER, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + MARINE_DIESEL = + T.let( + :MARINE_DIESEL, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + MISCELLANEOUS_MARINE_FUEL = + T.let( + :MISCELLANEOUS_MARINE_FUEL, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + KEROSENE_LOW_SULFUR = + T.let( + :KEROSENE_LOW_SULFUR, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + WHITE_GAS = + T.let( + :WHITE_GAS, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + HEATING_OIL = + T.let( + :HEATING_OIL, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + OTHER_FUEL_NON_TAXABLE = + T.let( + :OTHER_FUEL_NON_TAXABLE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + KEROSENE_ULTRA_LOW_SULFUR = + T.let( + :KEROSENE_ULTRA_LOW_SULFUR, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + KEROSENE_LOW_SULFUR_NON_TAXABLE = + T.let( + :KEROSENE_LOW_SULFUR_NON_TAXABLE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + KEROSENE_ULTRA_LOW_SULFUR_NON_TAXABLE = + T.let( + :KEROSENE_ULTRA_LOW_SULFUR_NON_TAXABLE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + EVC_1_LEVEL_1_CHARGE_110_V_15_AMP = + T.let( + :EVC_1_LEVEL_1_CHARGE_110V_15_AMP, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + EVC_2_LEVEL_2_CHARGE_240_V_15_40_AMP = + T.let( + :EVC_2_LEVEL_2_CHARGE_240V_15_40_AMP, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + EVC_3_LEVEL_3_CHARGE_480_V_3_PHASE_CHARGE = + T.let( + :EVC_3_LEVEL_3_CHARGE_480V_3_PHASE_CHARGE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + BIODIESEL_BLEND_2_PERCENT_OFF_ROAD_NON_TAXABLE = + T.let( + :BIODIESEL_BLEND_2_PERCENT_OFF_ROAD_NON_TAXABLE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + BIODIESEL_BLEND_5_PERCENT_OFF_ROAD_NON_TAXABLE = + T.let( + :BIODIESEL_BLEND_5_PERCENT_OFF_ROAD_NON_TAXABLE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + BIODIESEL_BLEND_10_PERCENT_OFF_ROAD_NON_TAXABLE = + T.let( + :BIODIESEL_BLEND_10_PERCENT_OFF_ROAD_NON_TAXABLE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + BIODIESEL_BLEND_11_PERCENT_OFF_ROAD_NON_TAXABLE = + T.let( + :BIODIESEL_BLEND_11_PERCENT_OFF_ROAD_NON_TAXABLE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + BIODIESEL_BLEND_15_PERCENT_OFF_ROAD_NON_TAXABLE = + T.let( + :BIODIESEL_BLEND_15_PERCENT_OFF_ROAD_NON_TAXABLE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + BIODIESEL_BLEND_20_PERCENT_OFF_ROAD_NON_TAXABLE = + T.let( + :BIODIESEL_BLEND_20_PERCENT_OFF_ROAD_NON_TAXABLE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + DIESEL_1_OFF_ROAD_NON_TAXABLE = + T.let( + :DIESEL_1_OFF_ROAD_NON_TAXABLE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + DIESEL_2_OFF_ROAD_NON_TAXABLE = + T.let( + :DIESEL_2_OFF_ROAD_NON_TAXABLE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + DIESEL_1_PREMIUM_OFF_ROAD_NON_TAXABLE = + T.let( + :DIESEL_1_PREMIUM_OFF_ROAD_NON_TAXABLE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + DIESEL_2_PREMIUM_OFF_ROAD_NON_TAXABLE = + T.let( + :DIESEL_2_PREMIUM_OFF_ROAD_NON_TAXABLE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + ADDITIVE_DOSAGE = + T.let( + :ADDITIVE_DOSAGE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + ETHANOL_BLENDS_E16_E84 = + T.let( + :ETHANOL_BLENDS_E16_E84, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + LOW_OCTANE_UNL = + T.let( + :LOW_OCTANE_UNL, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + BLENDED_DIESEL_1_AND_2 = + T.let( + :BLENDED_DIESEL_1_AND_2, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + OFF_ROAD_REGULAR_NON_TAXABLE = + T.let( + :OFF_ROAD_REGULAR_NON_TAXABLE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + OFF_ROAD_MID_PLUS_NON_TAXABLE = + T.let( + :OFF_ROAD_MID_PLUS_NON_TAXABLE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + OFF_ROAD_PREMIUM_SUPER_NON_TAXABLE = + T.let( + :OFF_ROAD_PREMIUM_SUPER_NON_TAXABLE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + OFF_ROAD_MID_PLUS_2_NON_TAXABLE = + T.let( + :OFF_ROAD_MID_PLUS_2_NON_TAXABLE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + OFF_ROAD_PREMIUM_SUPER_2_NON_TAXABLE = + T.let( + :OFF_ROAD_PREMIUM_SUPER_2_NON_TAXABLE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + RECREATIONAL_FUEL_90_OCTANE = + T.let( + :RECREATIONAL_FUEL_90_OCTANE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + HYDROGEN_H35 = + T.let( + :HYDROGEN_H35, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + HYDROGEN_H70 = + T.let( + :HYDROGEN_H70, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + RENEWABLE_DIESEL_R95_OFF_ROAD_NON_TAXABLE = + T.let( + :RENEWABLE_DIESEL_R95_OFF_ROAD_NON_TAXABLE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + BIODIESEL_BLEND_1_PERCENT_OFF_ROAD_NON_TAXABLE = + T.let( + :BIODIESEL_BLEND_1_PERCENT_OFF_ROAD_NON_TAXABLE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + BIODIESEL_BLEND_75_PERCENT_OFF_ROAD_NON_TAXABLE = + T.let( + :BIODIESEL_BLEND_75_PERCENT_OFF_ROAD_NON_TAXABLE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + BIODIESEL_BLEND_99_PERCENT_OFF_ROAD_NON_TAXABLE = + T.let( + :BIODIESEL_BLEND_99_PERCENT_OFF_ROAD_NON_TAXABLE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + BIODIESEL_BLEND_100_PERCENT_OFF_ROAD_NON_TAXABLE = + T.let( + :BIODIESEL_BLEND_100_PERCENT_OFF_ROAD_NON_TAXABLE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + RENEWABLE_DIESEL_BIODIESEL_6_20_PERCENT_OFF_ROAD_NON_TAXABLE = + T.let( + :RENEWABLE_DIESEL_BIODIESEL_6_20_PERCENT_OFF_ROAD_NON_TAXABLE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + MISCELLANEOUS_OTHER_FUEL = + T.let( + :MISCELLANEOUS_OTHER_FUEL, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Unit of measure for fuel disbursement. + module UnitOfMeasure + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + GALLONS = + T.let( + :GALLONS, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure::TaggedSymbol + ) + LITERS = + T.let( + :LITERS, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure::TaggedSymbol + ) + POUNDS = + T.let( + :POUNDS, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure::TaggedSymbol + ) + KILOGRAMS = + T.let( + :KILOGRAMS, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure::TaggedSymbol + ) + IMPERIAL_GALLONS = + T.let( + :IMPERIAL_GALLONS, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure::TaggedSymbol + ) + NOT_APPLICABLE = + T.let( + :NOT_APPLICABLE, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure::TaggedSymbol + ) + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Transactions::Events::EnhancedData::Fleet::Fuel::UnitOfMeasure::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + # The type of fuel service. + module ServiceType + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Lithic::Transactions::Events::EnhancedData::Fleet::ServiceType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + UNKNOWN = + T.let( + :UNKNOWN, + Lithic::Transactions::Events::EnhancedData::Fleet::ServiceType::TaggedSymbol + ) + UNDEFINED = + T.let( + :UNDEFINED, + Lithic::Transactions::Events::EnhancedData::Fleet::ServiceType::TaggedSymbol + ) + SELF_SERVICE = + T.let( + :SELF_SERVICE, + Lithic::Transactions::Events::EnhancedData::Fleet::ServiceType::TaggedSymbol + ) + FULL_SERVICE = + T.let( + :FULL_SERVICE, + Lithic::Transactions::Events::EnhancedData::Fleet::ServiceType::TaggedSymbol + ) + NON_FUEL_ONLY = + T.let( + :NON_FUEL_ONLY, + Lithic::Transactions::Events::EnhancedData::Fleet::ServiceType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Lithic::Transactions::Events::EnhancedData::Fleet::ServiceType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end + end +end diff --git a/rbi/lithic/models/transfer.rbi b/rbi/lithic/models/transfer.rbi new file mode 100644 index 00000000..aa204151 --- /dev/null +++ b/rbi/lithic/models/transfer.rbi @@ -0,0 +1,264 @@ +# typed: strong + +module Lithic + module Models + class Transfer < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Lithic::Transfer, Lithic::Internal::AnyHash) } + + # Globally unique identifier for the transfer event. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # Status types: + # + # - `TRANSFER` - Internal transfer of funds between financial accounts in your + # program. + sig { returns(T.nilable(Lithic::Transfer::Category::TaggedSymbol)) } + attr_reader :category + + sig { params(category: Lithic::Transfer::Category::OrSymbol).void } + attr_writer :category + + # Date and time when the transfer occurred. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :created + + sig { params(created: Time).void } + attr_writer :created + + # 3-character alphabetic ISO 4217 code for the settling currency of the + # transaction. + sig { returns(T.nilable(String)) } + attr_reader :currency + + sig { params(currency: String).void } + attr_writer :currency + + # A string that provides a description of the transfer; may be useful to display + # to users. + sig { returns(T.nilable(String)) } + attr_reader :descriptor + + sig { params(descriptor: String).void } + attr_writer :descriptor + + # A list of all financial events that have modified this trasnfer. + sig { returns(T.nilable(T::Array[Lithic::FinancialEvent])) } + attr_reader :events + + sig { params(events: T::Array[Lithic::FinancialEvent::OrHash]).void } + attr_writer :events + + # The updated balance of the sending financial account. + sig { returns(T.nilable(T::Array[Lithic::Balance])) } + attr_reader :from_balance + + sig { params(from_balance: T::Array[Lithic::Balance::OrHash]).void } + attr_writer :from_balance + + # Pending amount of the transaction in the currency's smallest unit (e.g., cents), + # including any acquirer fees. The value of this field will go to zero over time + # once the financial transaction is settled. + sig { returns(T.nilable(Integer)) } + attr_reader :pending_amount + + sig { params(pending_amount: Integer).void } + attr_writer :pending_amount + + # APPROVED transactions were successful while DECLINED transactions were declined + # by user, Lithic, or the network. + sig { returns(T.nilable(Lithic::Transfer::Result::TaggedSymbol)) } + attr_reader :result + + sig { params(result: Lithic::Transfer::Result::OrSymbol).void } + attr_writer :result + + # Amount of the transaction that has been settled in the currency's smallest unit + # (e.g., cents). + sig { returns(T.nilable(Integer)) } + attr_reader :settled_amount + + sig { params(settled_amount: Integer).void } + attr_writer :settled_amount + + # Status types: + # + # - `DECLINED` - The transfer was declined. + # - `EXPIRED` - The transfer was held in pending for too long and expired. + # - `PENDING` - The transfer is pending release from a hold. + # - `SETTLED` - The transfer is completed. + # - `VOIDED` - The transfer was reversed before it settled. + sig { returns(T.nilable(Lithic::Transfer::Status::TaggedSymbol)) } + attr_reader :status + + sig { params(status: Lithic::Transfer::Status::OrSymbol).void } + attr_writer :status + + # The updated balance of the receiving financial account. + sig { returns(T.nilable(T::Array[Lithic::Balance])) } + attr_reader :to_balance + + sig { params(to_balance: T::Array[Lithic::Balance::OrHash]).void } + attr_writer :to_balance + + # Date and time when the financial transaction was last updated. UTC time zone. + sig { returns(T.nilable(Time)) } + attr_reader :updated + + sig { params(updated: Time).void } + attr_writer :updated + + sig do + params( + token: String, + category: Lithic::Transfer::Category::OrSymbol, + created: Time, + currency: String, + descriptor: String, + events: T::Array[Lithic::FinancialEvent::OrHash], + from_balance: T::Array[Lithic::Balance::OrHash], + pending_amount: Integer, + result: Lithic::Transfer::Result::OrSymbol, + settled_amount: Integer, + status: Lithic::Transfer::Status::OrSymbol, + to_balance: T::Array[Lithic::Balance::OrHash], + updated: Time + ).returns(T.attached_class) + end + def self.new( + # Globally unique identifier for the transfer event. + token: nil, + # Status types: + # + # - `TRANSFER` - Internal transfer of funds between financial accounts in your + # program. + category: nil, + # Date and time when the transfer occurred. UTC time zone. + created: nil, + # 3-character alphabetic ISO 4217 code for the settling currency of the + # transaction. + currency: nil, + # A string that provides a description of the transfer; may be useful to display + # to users. + descriptor: nil, + # A list of all financial events that have modified this trasnfer. + events: nil, + # The updated balance of the sending financial account. + from_balance: nil, + # Pending amount of the transaction in the currency's smallest unit (e.g., cents), + # including any acquirer fees. The value of this field will go to zero over time + # once the financial transaction is settled. + pending_amount: nil, + # APPROVED transactions were successful while DECLINED transactions were declined + # by user, Lithic, or the network. + result: nil, + # Amount of the transaction that has been settled in the currency's smallest unit + # (e.g., cents). + settled_amount: nil, + # Status types: + # + # - `DECLINED` - The transfer was declined. + # - `EXPIRED` - The transfer was held in pending for too long and expired. + # - `PENDING` - The transfer is pending release from a hold. + # - `SETTLED` - The transfer is completed. + # - `VOIDED` - The transfer was reversed before it settled. + status: nil, + # The updated balance of the receiving financial account. + to_balance: nil, + # Date and time when the financial transaction was last updated. UTC time zone. + updated: nil + ) + end + + sig do + override.returns( + { + token: String, + category: Lithic::Transfer::Category::TaggedSymbol, + created: Time, + currency: String, + descriptor: String, + events: T::Array[Lithic::FinancialEvent], + from_balance: T::Array[Lithic::Balance], + pending_amount: Integer, + result: Lithic::Transfer::Result::TaggedSymbol, + settled_amount: Integer, + status: Lithic::Transfer::Status::TaggedSymbol, + to_balance: T::Array[Lithic::Balance], + updated: Time + } + ) + end + def to_hash + end + + # Status types: + # + # - `TRANSFER` - Internal transfer of funds between financial accounts in your + # program. + module Category + extend Lithic::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Lithic::Transfer::Category) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRANSFER = T.let(:TRANSFER, Lithic::Transfer::Category::TaggedSymbol) + + sig do + override.returns(T::Array[Lithic::Transfer::Category::TaggedSymbol]) + end + def self.values + end + end + + # APPROVED transactions were successful while DECLINED transactions were declined + # by user, Lithic, or the network. + module Result + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Transfer::Result) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = T.let(:APPROVED, Lithic::Transfer::Result::TaggedSymbol) + DECLINED = T.let(:DECLINED, Lithic::Transfer::Result::TaggedSymbol) + + sig do + override.returns(T::Array[Lithic::Transfer::Result::TaggedSymbol]) + end + def self.values + end + end + + # Status types: + # + # - `DECLINED` - The transfer was declined. + # - `EXPIRED` - The transfer was held in pending for too long and expired. + # - `PENDING` - The transfer is pending release from a hold. + # - `SETTLED` - The transfer is completed. + # - `VOIDED` - The transfer was reversed before it settled. + module Status + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::Transfer::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DECLINED = T.let(:DECLINED, Lithic::Transfer::Status::TaggedSymbol) + EXPIRED = T.let(:EXPIRED, Lithic::Transfer::Status::TaggedSymbol) + PENDING = T.let(:PENDING, Lithic::Transfer::Status::TaggedSymbol) + SETTLED = T.let(:SETTLED, Lithic::Transfer::Status::TaggedSymbol) + VOIDED = T.let(:VOIDED, Lithic::Transfer::Status::TaggedSymbol) + + sig do + override.returns(T::Array[Lithic::Transfer::Status::TaggedSymbol]) + end + def self.values + end + end + end + end +end diff --git a/rbi/lithic/models/transfer_create_params.rbi b/rbi/lithic/models/transfer_create_params.rbi new file mode 100644 index 00000000..a007786b --- /dev/null +++ b/rbi/lithic/models/transfer_create_params.rbi @@ -0,0 +1,89 @@ +# typed: strong + +module Lithic + module Models + class TransferCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::TransferCreateParams, Lithic::Internal::AnyHash) + end + + # Amount to be transferred in the currency’s smallest unit (e.g., cents for USD). + # This should always be a positive value. + sig { returns(Integer) } + attr_accessor :amount + + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + sig { returns(String) } + attr_accessor :from + + # Globally unique identifier for the financial account or card that will receive + # the funds. Accepted type dependent on the program's use case. + sig { returns(String) } + attr_accessor :to + + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # Optional descriptor for the transfer. + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + sig do + params( + amount: Integer, + from: String, + to: String, + token: String, + memo: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Amount to be transferred in the currency’s smallest unit (e.g., cents for USD). + # This should always be a positive value. + amount:, + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + from:, + # Globally unique identifier for the financial account or card that will receive + # the funds. Accepted type dependent on the program's use case. + to:, + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + token: nil, + # Optional descriptor for the transfer. + memo: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + amount: Integer, + from: String, + to: String, + token: String, + memo: String, + request_options: Lithic::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/transfer_limit_list_params.rbi b/rbi/lithic/models/transfer_limit_list_params.rbi new file mode 100644 index 00000000..4d04f197 --- /dev/null +++ b/rbi/lithic/models/transfer_limit_list_params.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Lithic + module Models + class TransferLimitListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::TransferLimitListParams, Lithic::Internal::AnyHash) + end + + # Date for which to retrieve transfer limits (ISO 8601 format) + sig { returns(T.nilable(Date)) } + attr_reader :date + + sig { params(date: Date).void } + attr_writer :date + + sig do + params( + date: Date, + request_options: Lithic::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Date for which to retrieve transfer limits (ISO 8601 format) + date: nil, + request_options: {} + ) + end + + sig do + override.returns( + { date: Date, request_options: Lithic::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/transfer_limits_response.rbi b/rbi/lithic/models/transfer_limits_response.rbi new file mode 100644 index 00000000..871acff0 --- /dev/null +++ b/rbi/lithic/models/transfer_limits_response.rbi @@ -0,0 +1,604 @@ +# typed: strong + +module Lithic + module Models + class TransferLimitsResponse < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::TransferLimitsResponse, Lithic::Internal::AnyHash) + end + + # List of transfer limits + sig { returns(T::Array[Lithic::TransferLimitsResponse::Data]) } + attr_accessor :data + + # Whether there are more transfer limits + sig { returns(T::Boolean) } + attr_accessor :has_more + + sig do + params( + data: T::Array[Lithic::TransferLimitsResponse::Data::OrHash], + has_more: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # List of transfer limits + data:, + # Whether there are more transfer limits + has_more: + ) + end + + sig do + override.returns( + { + data: T::Array[Lithic::TransferLimitsResponse::Data], + has_more: T::Boolean + } + ) + end + def to_hash + end + + class Data < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TransferLimitsResponse::Data, + Lithic::Internal::AnyHash + ) + end + + # Company ID + sig { returns(String) } + attr_accessor :company_id + + # Daily limits with progress + sig { returns(Lithic::TransferLimitsResponse::Data::DailyLimit) } + attr_reader :daily_limit + + sig do + params( + daily_limit: + Lithic::TransferLimitsResponse::Data::DailyLimit::OrHash + ).void + end + attr_writer :daily_limit + + # The date for the limit view (ISO format) + sig { returns(Date) } + attr_accessor :date + + # Whether the company is a FBO; based on the company ID prefix + sig { returns(T::Boolean) } + attr_accessor :is_fbo + + # Monthly limits with progress + sig { returns(Lithic::TransferLimitsResponse::Data::MonthlyLimit) } + attr_reader :monthly_limit + + sig do + params( + monthly_limit: + Lithic::TransferLimitsResponse::Data::MonthlyLimit::OrHash + ).void + end + attr_writer :monthly_limit + + # Program transaction limits + sig do + returns( + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction + ) + end + attr_reader :program_limit_per_transaction + + sig do + params( + program_limit_per_transaction: + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::OrHash + ).void + end + attr_writer :program_limit_per_transaction + + sig do + params( + company_id: String, + daily_limit: + Lithic::TransferLimitsResponse::Data::DailyLimit::OrHash, + date: Date, + is_fbo: T::Boolean, + monthly_limit: + Lithic::TransferLimitsResponse::Data::MonthlyLimit::OrHash, + program_limit_per_transaction: + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::OrHash + ).returns(T.attached_class) + end + def self.new( + # Company ID + company_id:, + # Daily limits with progress + daily_limit:, + # The date for the limit view (ISO format) + date:, + # Whether the company is a FBO; based on the company ID prefix + is_fbo:, + # Monthly limits with progress + monthly_limit:, + # Program transaction limits + program_limit_per_transaction: + ) + end + + sig do + override.returns( + { + company_id: String, + daily_limit: Lithic::TransferLimitsResponse::Data::DailyLimit, + date: Date, + is_fbo: T::Boolean, + monthly_limit: Lithic::TransferLimitsResponse::Data::MonthlyLimit, + program_limit_per_transaction: + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction + } + ) + end + def to_hash + end + + class DailyLimit < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TransferLimitsResponse::Data::DailyLimit, + Lithic::Internal::AnyHash + ) + end + + # Credit limits + sig do + returns(Lithic::TransferLimitsResponse::Data::DailyLimit::Credit) + end + attr_reader :credit + + sig do + params( + credit: + Lithic::TransferLimitsResponse::Data::DailyLimit::Credit::OrHash + ).void + end + attr_writer :credit + + # Debit limits + sig do + returns(Lithic::TransferLimitsResponse::Data::DailyLimit::Debit) + end + attr_reader :debit + + sig do + params( + debit: + Lithic::TransferLimitsResponse::Data::DailyLimit::Debit::OrHash + ).void + end + attr_writer :debit + + # Daily limits with progress + sig do + params( + credit: + Lithic::TransferLimitsResponse::Data::DailyLimit::Credit::OrHash, + debit: + Lithic::TransferLimitsResponse::Data::DailyLimit::Debit::OrHash + ).returns(T.attached_class) + end + def self.new( + # Credit limits + credit:, + # Debit limits + debit: + ) + end + + sig do + override.returns( + { + credit: + Lithic::TransferLimitsResponse::Data::DailyLimit::Credit, + debit: Lithic::TransferLimitsResponse::Data::DailyLimit::Debit + } + ) + end + def to_hash + end + + class Credit < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TransferLimitsResponse::Data::DailyLimit::Credit, + Lithic::Internal::AnyHash + ) + end + + # The limit amount + sig { returns(Integer) } + attr_accessor :limit + + # Amount originated towards limit + sig { returns(T.nilable(Integer)) } + attr_accessor :amount_originated + + # Credit limits + sig do + params( + limit: Integer, + amount_originated: T.nilable(Integer) + ).returns(T.attached_class) + end + def self.new( + # The limit amount + limit:, + # Amount originated towards limit + amount_originated: nil + ) + end + + sig do + override.returns( + { limit: Integer, amount_originated: T.nilable(Integer) } + ) + end + def to_hash + end + end + + class Debit < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TransferLimitsResponse::Data::DailyLimit::Debit, + Lithic::Internal::AnyHash + ) + end + + # The limit amount + sig { returns(Integer) } + attr_accessor :limit + + # Amount originated towards limit + sig { returns(T.nilable(Integer)) } + attr_accessor :amount_originated + + # Debit limits + sig do + params( + limit: Integer, + amount_originated: T.nilable(Integer) + ).returns(T.attached_class) + end + def self.new( + # The limit amount + limit:, + # Amount originated towards limit + amount_originated: nil + ) + end + + sig do + override.returns( + { limit: Integer, amount_originated: T.nilable(Integer) } + ) + end + def to_hash + end + end + end + + class MonthlyLimit < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TransferLimitsResponse::Data::MonthlyLimit, + Lithic::Internal::AnyHash + ) + end + + # Credit limits + sig do + returns(Lithic::TransferLimitsResponse::Data::MonthlyLimit::Credit) + end + attr_reader :credit + + sig do + params( + credit: + Lithic::TransferLimitsResponse::Data::MonthlyLimit::Credit::OrHash + ).void + end + attr_writer :credit + + # Debit limits + sig do + returns(Lithic::TransferLimitsResponse::Data::MonthlyLimit::Debit) + end + attr_reader :debit + + sig do + params( + debit: + Lithic::TransferLimitsResponse::Data::MonthlyLimit::Debit::OrHash + ).void + end + attr_writer :debit + + # Monthly limits with progress + sig do + params( + credit: + Lithic::TransferLimitsResponse::Data::MonthlyLimit::Credit::OrHash, + debit: + Lithic::TransferLimitsResponse::Data::MonthlyLimit::Debit::OrHash + ).returns(T.attached_class) + end + def self.new( + # Credit limits + credit:, + # Debit limits + debit: + ) + end + + sig do + override.returns( + { + credit: + Lithic::TransferLimitsResponse::Data::MonthlyLimit::Credit, + debit: Lithic::TransferLimitsResponse::Data::MonthlyLimit::Debit + } + ) + end + def to_hash + end + + class Credit < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TransferLimitsResponse::Data::MonthlyLimit::Credit, + Lithic::Internal::AnyHash + ) + end + + # The limit amount + sig { returns(Integer) } + attr_accessor :limit + + # Amount originated towards limit + sig { returns(T.nilable(Integer)) } + attr_accessor :amount_originated + + # Credit limits + sig do + params( + limit: Integer, + amount_originated: T.nilable(Integer) + ).returns(T.attached_class) + end + def self.new( + # The limit amount + limit:, + # Amount originated towards limit + amount_originated: nil + ) + end + + sig do + override.returns( + { limit: Integer, amount_originated: T.nilable(Integer) } + ) + end + def to_hash + end + end + + class Debit < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TransferLimitsResponse::Data::MonthlyLimit::Debit, + Lithic::Internal::AnyHash + ) + end + + # The limit amount + sig { returns(Integer) } + attr_accessor :limit + + # Amount originated towards limit + sig { returns(T.nilable(Integer)) } + attr_accessor :amount_originated + + # Debit limits + sig do + params( + limit: Integer, + amount_originated: T.nilable(Integer) + ).returns(T.attached_class) + end + def self.new( + # The limit amount + limit:, + # Amount originated towards limit + amount_originated: nil + ) + end + + sig do + override.returns( + { limit: Integer, amount_originated: T.nilable(Integer) } + ) + end + def to_hash + end + end + end + + class ProgramLimitPerTransaction < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction, + Lithic::Internal::AnyHash + ) + end + + # Credit limits + sig do + returns( + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Credit + ) + end + attr_reader :credit + + sig do + params( + credit: + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Credit::OrHash + ).void + end + attr_writer :credit + + # Debit limits + sig do + returns( + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Debit + ) + end + attr_reader :debit + + sig do + params( + debit: + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Debit::OrHash + ).void + end + attr_writer :debit + + # Program transaction limits + sig do + params( + credit: + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Credit::OrHash, + debit: + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Debit::OrHash + ).returns(T.attached_class) + end + def self.new( + # Credit limits + credit:, + # Debit limits + debit: + ) + end + + sig do + override.returns( + { + credit: + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Credit, + debit: + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Debit + } + ) + end + def to_hash + end + + class Credit < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Credit, + Lithic::Internal::AnyHash + ) + end + + # The limit amount + sig { returns(Integer) } + attr_accessor :limit + + # Amount originated towards limit + sig { returns(T.nilable(Integer)) } + attr_accessor :amount_originated + + # Credit limits + sig do + params( + limit: Integer, + amount_originated: T.nilable(Integer) + ).returns(T.attached_class) + end + def self.new( + # The limit amount + limit:, + # Amount originated towards limit + amount_originated: nil + ) + end + + sig do + override.returns( + { limit: Integer, amount_originated: T.nilable(Integer) } + ) + end + def to_hash + end + end + + class Debit < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Debit, + Lithic::Internal::AnyHash + ) + end + + # The limit amount + sig { returns(Integer) } + attr_accessor :limit + + # Amount originated towards limit + sig { returns(T.nilable(Integer)) } + attr_accessor :amount_originated + + # Debit limits + sig do + params( + limit: Integer, + amount_originated: T.nilable(Integer) + ).returns(T.attached_class) + end + def self.new( + # The limit amount + limit:, + # Amount originated towards limit + amount_originated: nil + ) + end + + sig do + override.returns( + { limit: Integer, amount_originated: T.nilable(Integer) } + ) + end + def to_hash + end + end + end + end + end + end +end diff --git a/rbi/lithic/models/verification_method.rbi b/rbi/lithic/models/verification_method.rbi new file mode 100644 index 00000000..009c3b93 --- /dev/null +++ b/rbi/lithic/models/verification_method.rbi @@ -0,0 +1,26 @@ +# typed: strong + +module Lithic + module Models + module VerificationMethod + extend Lithic::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Lithic::VerificationMethod) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MANUAL = T.let(:MANUAL, Lithic::VerificationMethod::TaggedSymbol) + MICRO_DEPOSIT = + T.let(:MICRO_DEPOSIT, Lithic::VerificationMethod::TaggedSymbol) + PRENOTE = T.let(:PRENOTE, Lithic::VerificationMethod::TaggedSymbol) + EXTERNALLY_VERIFIED = + T.let(:EXTERNALLY_VERIFIED, Lithic::VerificationMethod::TaggedSymbol) + UNVERIFIED = T.let(:UNVERIFIED, Lithic::VerificationMethod::TaggedSymbol) + + sig do + override.returns(T::Array[Lithic::VerificationMethod::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/lithic/models/wallet_decisioning_info.rbi b/rbi/lithic/models/wallet_decisioning_info.rbi new file mode 100644 index 00000000..db653ce1 --- /dev/null +++ b/rbi/lithic/models/wallet_decisioning_info.rbi @@ -0,0 +1,63 @@ +# typed: strong + +module Lithic + module Models + class WalletDecisioningInfo < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::WalletDecisioningInfo, Lithic::Internal::AnyHash) + end + + # Score given to the account by the Wallet Provider + sig { returns(T.nilable(String)) } + attr_accessor :account_score + + # Score given to the device by the Wallet Provider + sig { returns(T.nilable(String)) } + attr_accessor :device_score + + # The decision recommended by the Wallet Provider + sig { returns(T.nilable(String)) } + attr_accessor :recommended_decision + + # Reasons provided to the Wallet Provider on how the recommended decision was + # reached + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :recommendation_reasons + + sig do + params( + account_score: T.nilable(String), + device_score: T.nilable(String), + recommended_decision: T.nilable(String), + recommendation_reasons: T.nilable(T::Array[String]) + ).returns(T.attached_class) + end + def self.new( + # Score given to the account by the Wallet Provider + account_score:, + # Score given to the device by the Wallet Provider + device_score:, + # The decision recommended by the Wallet Provider + recommended_decision:, + # Reasons provided to the Wallet Provider on how the recommended decision was + # reached + recommendation_reasons: nil + ) + end + + sig do + override.returns( + { + account_score: T.nilable(String), + device_score: T.nilable(String), + recommended_decision: T.nilable(String), + recommendation_reasons: T.nilable(T::Array[String]) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/webhook_parsed_params.rbi b/rbi/lithic/models/webhook_parsed_params.rbi new file mode 100644 index 00000000..4d4b5b39 --- /dev/null +++ b/rbi/lithic/models/webhook_parsed_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Lithic + module Models + class WebhookParsedParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Lithic::WebhookParsedParams, Lithic::Internal::AnyHash) + end + + sig do + params(request_options: Lithic::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: Lithic::RequestOptions }) } + def to_hash + end + end + end +end diff --git a/rbi/lithic/models/wire_party_details.rbi b/rbi/lithic/models/wire_party_details.rbi new file mode 100644 index 00000000..442e7bb5 --- /dev/null +++ b/rbi/lithic/models/wire_party_details.rbi @@ -0,0 +1,61 @@ +# typed: strong + +module Lithic + module Models + class WirePartyDetails < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Lithic::WirePartyDetails, Lithic::Internal::AnyHash) + end + + # Account number + sig { returns(T.nilable(String)) } + attr_accessor :account_number + + # Routing number or BIC of the financial institution + sig { returns(T.nilable(String)) } + attr_accessor :agent_id + + # Name of the financial institution + sig { returns(T.nilable(String)) } + attr_accessor :agent_name + + # Name of the person or company + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig do + params( + account_number: T.nilable(String), + agent_id: T.nilable(String), + agent_name: T.nilable(String), + name: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Account number + account_number: nil, + # Routing number or BIC of the financial institution + agent_id: nil, + # Name of the financial institution + agent_name: nil, + # Name of the person or company + name: nil + ) + end + + sig do + override.returns( + { + account_number: T.nilable(String), + agent_id: T.nilable(String), + agent_name: T.nilable(String), + name: T.nilable(String) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/lithic/request_options.rbi b/rbi/lithic/request_options.rbi new file mode 100644 index 00000000..ecba175b --- /dev/null +++ b/rbi/lithic/request_options.rbi @@ -0,0 +1,55 @@ +# typed: strong + +module Lithic + # 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 < Lithic::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Lithic::RequestOptions, Lithic::Internal::AnyHash) } + + # @api private + sig { params(opts: Lithic::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 { params(values: Lithic::Internal::AnyHash).returns(T.attached_class) } + def self.new(values = {}) + end + end +end diff --git a/rbi/lithic/resources/account_activity.rbi b/rbi/lithic/resources/account_activity.rbi new file mode 100644 index 00000000..97373b9c --- /dev/null +++ b/rbi/lithic/resources/account_activity.rbi @@ -0,0 +1,80 @@ +# typed: strong + +module Lithic + module Resources + class AccountActivity + # Retrieve a list of transactions across all public accounts. + sig do + params( + account_token: String, + begin_: Time, + business_account_token: String, + category: Lithic::AccountActivityListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::AccountActivityListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::AccountActivityListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns( + Lithic::Internal::CursorPage[ + Lithic::Models::AccountActivityListResponse::Variants + ] + ) + end + def list( + # Filter by account token + account_token: nil, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Filter by business account token + business_account_token: nil, + # Filter by transaction category + category: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Filter by financial account token + financial_account_token: nil, + # Page size (for pagination). + page_size: nil, + # Filter by transaction result + result: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Filter by transaction status + status: nil, + request_options: {} + ) + end + + # Retrieve a single transaction + sig do + params( + transaction_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns( + Lithic::Models::AccountActivityRetrieveTransactionResponse::Variants + ) + end + def retrieve_transaction( + # The unique identifier for the transaction + transaction_token, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/account_holders.rbi b/rbi/lithic/resources/account_holders.rbi new file mode 100644 index 00000000..e61d3564 --- /dev/null +++ b/rbi/lithic/resources/account_holders.rbi @@ -0,0 +1,285 @@ +# typed: strong + +module Lithic + module Resources + class AccountHolders + sig { returns(Lithic::Resources::AccountHolders::Entities) } + attr_reader :entities + + # Create an account holder and initiate the appropriate onboarding workflow. + # Account holders and accounts have a 1:1 relationship. When an account holder is + # successfully created an associated account is also created. All calls to this + # endpoint will return a synchronous response. The response time will depend on + # the workflow. In some cases, the response may indicate the workflow is under + # review or further action will be needed to complete the account creation + # process. This endpoint can only be used on accounts that are part of the program + # that the calling API key manages. + sig do + params( + body: + T.any( + Lithic::KYB::OrHash, + Lithic::AccountHolderCreateParams::Body::KYBDelegated::OrHash, + Lithic::KYC::OrHash, + Lithic::KYCExempt::OrHash + ), + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::AccountHolderCreateResponse) + end + def create(body:, request_options: {}) + end + + # Get an Individual or Business Account Holder and/or their KYC or KYB evaluation + # status. + sig do + params( + account_holder_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::AccountHolder) + end + def retrieve( + # Globally unique identifier for the account holder. + account_holder_token, + request_options: {} + ) + end + + # Update the information associated with a particular account holder (including + # business owners and control persons associated to a business account). If Lithic + # is performing KYB or KYC and additional verification is required we will run the + # individual's or business's updated information again and return whether the + # status is accepted or pending (i.e., further action required). All calls to this + # endpoint will return a synchronous response. The response time will depend on + # the workflow. In some cases, the response may indicate the workflow is under + # review or further action will be needed to complete the account creation + # process. This endpoint can only be used on existing accounts that are part of + # the program that the calling API key manages. + sig do + params( + account_holder_token: String, + body: + T.any( + Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::OrHash, + Lithic::AccountHolderUpdateParams::Body::KYCPatchRequest::OrHash, + Lithic::AccountHolderUpdateParams::Body::PatchRequest::OrHash + ), + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::AccountHolderUpdateResponse::Variants) + end + def update( + # Globally unique identifier for the account holder. + account_holder_token, + # The KYB request payload for updating a business. + body:, + request_options: {} + ) + end + + # Get a list of individual or business account holders and their KYC or KYB + # evaluation status. + sig do + params( + begin_: Time, + email: String, + end_: Time, + ending_before: String, + external_id: String, + first_name: String, + last_name: String, + legal_business_name: String, + limit: Integer, + phone_number: String, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Internal::SinglePage[Lithic::AccountHolder]) + end + def list( + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Email address of the account holder. The query must be an exact match, case + # insensitive. + email: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # If applicable, represents the external_id associated with the account_holder. + external_id: nil, + # (Individual Account Holders only) The first name of the account holder. The + # query is case insensitive and supports partial matches. + first_name: nil, + # (Individual Account Holders only) The last name of the account holder. The query + # is case insensitive and supports partial matches. + last_name: nil, + # (Business Account Holders only) The legal business name of the account holder. + # The query is case insensitive and supports partial matches. + legal_business_name: nil, + # The number of account_holders to limit the response to. + limit: nil, + # Phone number of the account holder. The query must be an exact match. + phone_number: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + # Retrieve the status of account holder document uploads, or retrieve the upload + # URLs to process your image uploads. + # + # Note that this is not equivalent to checking the status of the KYC evaluation + # overall (a document may be successfully uploaded but not be sufficient for KYC + # to pass). + # + # In the event your upload URLs have expired, calling this endpoint will refresh + # them. Similarly, in the event a previous account holder document upload has + # failed, you can use this endpoint to get a new upload URL for the failed image + # upload. + # + # When a new document upload is generated for a failed attempt, the response will + # show an additional entry in the `required_document_uploads` list in a `PENDING` + # state for the corresponding `image_type`. + sig do + params( + account_holder_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::AccountHolderListDocumentsResponse) + end + def list_documents( + # Globally unique identifier for the account holder. + account_holder_token, + request_options: {} + ) + end + + # Check the status of an account holder document upload, or retrieve the upload + # URLs to process your image uploads. + # + # Note that this is not equivalent to checking the status of the KYC evaluation + # overall (a document may be successfully uploaded but not be sufficient for KYC + # to pass). + # + # In the event your upload URLs have expired, calling this endpoint will refresh + # them. Similarly, in the event a document upload has failed, you can use this + # endpoint to get a new upload URL for the failed image upload. + # + # When a new account holder document upload is generated for a failed attempt, the + # response will show an additional entry in the `required_document_uploads` array + # in a `PENDING` state for the corresponding `image_type`. + sig do + params( + document_token: String, + account_holder_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Document) + end + def retrieve_document( + # Globally unique identifier for the document. + document_token, + # Globally unique identifier for the account holder. + account_holder_token:, + request_options: {} + ) + end + + # Simulates a review for an account holder document upload. + sig do + params( + document_upload_token: String, + status: + Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::Status::OrSymbol, + accepted_entity_status_reasons: T::Array[String], + status_reason: + Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams::StatusReason::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Document) + end + def simulate_enrollment_document_review( + # The account holder document upload which to perform the simulation upon. + document_upload_token:, + # An account holder document's upload status for use within the simulation. + status:, + # A list of status reasons associated with a KYB account holder in PENDING_REVIEW + accepted_entity_status_reasons: nil, + # Status reason that will be associated with the simulated account holder status. + # Only required for a `REJECTED` status or `PARTIAL_APPROVAL` status. + status_reason: nil, + request_options: {} + ) + end + + # Simulates an enrollment review for an account holder. This endpoint is only + # applicable for workflows that may required intervention such as `KYB_BASIC`. + sig do + params( + account_holder_token: String, + status: + Lithic::AccountHolderSimulateEnrollmentReviewParams::Status::OrSymbol, + status_reasons: + T::Array[ + Lithic::AccountHolderSimulateEnrollmentReviewParams::StatusReason::OrSymbol + ], + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse) + end + def simulate_enrollment_review( + # The account holder which to perform the simulation upon. + account_holder_token: nil, + # An account holder's status for use within the simulation. + status: nil, + # Status reason that will be associated with the simulated account holder status. + # Only required for a `REJECTED` status. + status_reasons: nil, + request_options: {} + ) + end + + # Use this endpoint to identify which type of supported government-issued + # documentation you will upload for further verification. It will return two URLs + # to upload your document images to - one for the front image and one for the back + # image. + # + # This endpoint is only valid for evaluations in a `PENDING_DOCUMENT` state. + # + # Supported file types include `jpg`, `png`, and `pdf`. Each file must be less + # than 15 MiB. Once both required uploads have been successfully completed, your + # document will be run through KYC verification. + # + # If you have registered a webhook, you will receive evaluation updates for any + # document submission evaluations, as well as for any failed document uploads. + # + # Two document submission attempts are permitted via this endpoint before a + # `REJECTED` status is returned and the account creation process is ended. + # Currently only one type of account holder document is supported per KYC + # verification. + sig do + params( + account_holder_token: String, + document_type: + Lithic::AccountHolderUploadDocumentParams::DocumentType::OrSymbol, + entity_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Document) + end + def upload_document( + # Globally unique identifier for the account holder. + account_holder_token, + # The type of document to upload + document_type:, + # Globally unique identifier for the entity. + entity_token:, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/account_holders/entities.rbi b/rbi/lithic/resources/account_holders/entities.rbi new file mode 100644 index 00000000..e4bf03ea --- /dev/null +++ b/rbi/lithic/resources/account_holders/entities.rbi @@ -0,0 +1,80 @@ +# typed: strong + +module Lithic + module Resources + class AccountHolders + class Entities + # Create a new beneficial owner individual or replace the control person entity on + # an existing KYB account holder. This endpoint is only applicable for account + # holders enrolled through a KYB workflow with the Persona KYB provider. A new + # control person can only replace the existing one. A maximum of 4 beneficial + # owners can be associated with an account holder. + sig do + params( + account_holder_token: String, + address: + Lithic::AccountHolders::EntityCreateParams::Address::OrHash, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String, + type: Lithic::TransactionMonitoring::EntityType::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::AccountHolders::EntityCreateResponse) + end + def create( + # Globally unique identifier for the account holder. + account_holder_token, + # Individual's current address - PO boxes, UPS drops, and FedEx drops are not + # acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + address:, + # Individual's date of birth, as an RFC 3339 date. + dob:, + # Individual's email address. If utilizing Lithic for chargeback processing, this + # customer email address may be used to communicate dispute status and resolution. + email:, + # Individual's first name, as it appears on government-issued identity documents. + first_name:, + # Government-issued identification number (required for identity verification and + # compliance with banking regulations). Social Security Numbers (SSN) and + # Individual Taxpayer Identification Numbers (ITIN) are currently supported, + # entered as full nine-digits, with or without hyphens + government_id:, + # Individual's last name, as it appears on government-issued identity documents. + last_name:, + # Individual's phone number, entered in E.164 format. + phone_number:, + # The type of entity to create on the account holder + type:, + request_options: {} + ) + end + + # Deactivate a beneficial owner individual on an existing KYB account holder. Only + # beneficial owner individuals can be deactivated. + sig do + params( + entity_token: String, + account_holder_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::AccountHolders::AccountHolderEntity) + end + def delete( + # Globally unique identifier for the entity. + entity_token, + # Globally unique identifier for the account holder. + account_holder_token:, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lithic/resources/accounts.rbi b/rbi/lithic/resources/accounts.rbi new file mode 100644 index 00000000..223b6eb0 --- /dev/null +++ b/rbi/lithic/resources/accounts.rbi @@ -0,0 +1,171 @@ +# typed: strong + +module Lithic + module Resources + class Accounts + # Get account configuration such as spend limits. + sig do + params( + account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Account) + end + def retrieve( + # Globally unique identifier for account. + account_token, + request_options: {} + ) + end + + # Update account configuration such as state or spend limits. Can only be run on + # accounts that are part of the program managed by this API key. Accounts that are + # in the `PAUSED` state will not be able to transact or create new cards. + sig do + params( + account_token: String, + comment: String, + daily_spend_limit: Integer, + lifetime_spend_limit: Integer, + monthly_spend_limit: Integer, + state: Lithic::AccountUpdateParams::State::OrSymbol, + substatus: + T.nilable(Lithic::AccountUpdateParams::Substatus::OrSymbol), + verification_address: + Lithic::AccountUpdateParams::VerificationAddress::OrHash, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Account) + end + def update( + # Globally unique identifier for account. + account_token, + # Additional context or information related to the account. + comment: nil, + # Amount (in cents) for the account's daily spend limit (e.g. 100000 would be a + # $1,000 limit). By default the daily spend limit is set to $1,250. + daily_spend_limit: nil, + # Amount (in cents) for the account's lifetime spend limit (e.g. 100000 would be a + # $1,000 limit). Once this limit is reached, no transactions will be accepted on + # any card created for this account until the limit is updated. Note that a spend + # limit of 0 is effectively no limit, and should only be used to reset or remove a + # prior limit. Only a limit of 1 or above will result in declined transactions due + # to checks against the account limit. This behavior differs from the daily spend + # limit and the monthly spend limit. + lifetime_spend_limit: nil, + # Amount (in cents) for the account's monthly spend limit (e.g. 100000 would be a + # $1,000 limit). By default the monthly spend limit is set to $5,000. + monthly_spend_limit: nil, + # Account states. + state: nil, + # Account state substatus values: + # + # - `FRAUD_IDENTIFIED` - The account has been recognized as being created or used + # with stolen or fabricated identity information, encompassing both true + # identity theft and synthetic identities. + # - `SUSPICIOUS_ACTIVITY` - The account has exhibited suspicious behavior, such as + # unauthorized access or fraudulent transactions, necessitating further + # investigation. + # - `RISK_VIOLATION` - The account has been involved in deliberate misuse by the + # legitimate account holder. Examples include disputing valid transactions + # without cause, falsely claiming non-receipt of goods, or engaging in + # intentional bust-out schemes to exploit account services. + # - `END_USER_REQUEST` - The account holder has voluntarily requested the closure + # of the account for personal reasons. This encompasses situations such as + # bankruptcy, other financial considerations, or the account holder's death. + # - `ISSUER_REQUEST` - The issuer has initiated the closure of the account due to + # business strategy, risk management, inactivity, product changes, regulatory + # concerns, or violations of terms and conditions. + # - `NOT_ACTIVE` - The account has not had any transactions or payment activity + # within a specified period. This status applies to accounts that are paused or + # closed due to inactivity. + # - `INTERNAL_REVIEW` - The account is temporarily paused pending further internal + # review. In future implementations, this status may prevent clients from + # activating the account via APIs until the review is completed. + # - `OTHER` - The reason for the account's current status does not fall into any + # of the above categories. A comment should be provided to specify the + # particular reason. + substatus: nil, + # Address used during Address Verification Service (AVS) checks during + # transactions if enabled via Auth Rules. This field is deprecated as AVS checks + # are no longer supported by Auth Rules. The field will be removed from the schema + # in a future release. + verification_address: nil, + request_options: {} + ) + end + + # List account configurations. + sig do + params( + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Internal::CursorPage[Lithic::Account]) + end + def list( + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + # Returns behavioral feature state derived from an account's transaction history. + # + # These signals expose the same data used by behavioral rule attributes (e.g. + # `AMOUNT_Z_SCORE` with `scope: ACCOUNT`, `IS_NEW_COUNTRY` with `scope: ACCOUNT`) + # and custom code `TRANSACTION_HISTORY_SIGNALS` features, allowing clients to + # inspect feature values before writing rules and debug rule behavior. + # + # Note: 3DS fields are not available at the account scope and will be null. + sig do + params( + account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::SignalsResponse) + end + def retrieve_signals( + # The token of the account to fetch signals for. + account_token, + request_options: {} + ) + end + + # Get an Account's available spend limits, which is based on the spend limit + # configured on the Account and the amount already spent over the spend limit's + # duration. For example, if the Account has a daily spend limit of $1000 + # configured, and has spent $600 in the last 24 hours, the available spend limit + # returned would be $400. + sig do + params( + account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::AccountSpendLimits) + end + def retrieve_spend_limits( + # Globally unique identifier for account. + account_token, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/auth_rules.rbi b/rbi/lithic/resources/auth_rules.rbi new file mode 100644 index 00000000..cc1a511d --- /dev/null +++ b/rbi/lithic/resources/auth_rules.rbi @@ -0,0 +1,15 @@ +# typed: strong + +module Lithic + module Resources + class AuthRules + sig { returns(Lithic::Resources::AuthRules::V2) } + attr_reader :v2 + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/auth_rules/v2.rbi b/rbi/lithic/resources/auth_rules/v2.rbi new file mode 100644 index 00000000..e1254643 --- /dev/null +++ b/rbi/lithic/resources/auth_rules/v2.rbi @@ -0,0 +1,276 @@ +# typed: strong + +module Lithic + module Resources + class AuthRules + class V2 + sig { returns(Lithic::Resources::AuthRules::V2::Backtests) } + attr_reader :backtests + + # Creates a new V2 Auth rule in draft mode + sig do + params( + body: + T.any( + Lithic::AuthRules::V2CreateParams::Body::AccountLevelRule::OrHash, + Lithic::AuthRules::V2CreateParams::Body::CardLevelRule::OrHash, + Lithic::AuthRules::V2CreateParams::Body::ProgramLevelRule::OrHash + ), + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::AuthRules::AuthRule) + end + def create(body:, request_options: {}) + end + + # Fetches a V2 Auth rule by its token + sig do + params( + auth_rule_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::AuthRules::AuthRule) + end + def retrieve(auth_rule_token, request_options: {}) + end + + # Updates a V2 Auth rule's properties + # + # If `account_tokens`, `card_tokens`, `program_level`, `excluded_card_tokens`, + # `excluded_account_tokens`, or `excluded_business_account_tokens` is provided, + # this will replace existing associations with the provided list of entities. + sig do + params( + auth_rule_token: String, + body: + T.any( + Lithic::AuthRules::V2UpdateParams::Body::AccountLevelRule::OrHash, + Lithic::AuthRules::V2UpdateParams::Body::CardLevelRule::OrHash, + Lithic::AuthRules::V2UpdateParams::Body::ProgramLevelRule::OrHash + ), + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::AuthRules::AuthRule) + end + def update(auth_rule_token, body:, request_options: {}) + end + + # Lists V2 Auth rules + sig do + params( + account_token: String, + business_account_token: String, + card_token: String, + ending_before: String, + event_stream: Lithic::AuthRules::EventStream::OrSymbol, + event_streams: T::Array[Lithic::AuthRules::EventStream::OrSymbol], + page_size: Integer, + scope: Lithic::AuthRules::V2ListParams::Scope::OrSymbol, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Internal::CursorPage[Lithic::AuthRules::AuthRule]) + end + def list( + # Only return Auth Rules that are bound to the provided account token. + account_token: nil, + # Only return Auth Rules that are bound to the provided business account token. + business_account_token: nil, + # Only return Auth Rules that are bound to the provided card token. + card_token: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Deprecated: Use event_streams instead. Only return Auth rules that are executed + # during the provided event stream. + event_stream: nil, + # Only return Auth rules that are executed during any of the provided event + # streams. If event_streams and event_stream are specified, the values will be + # combined. + event_streams: nil, + # Page size (for pagination). + page_size: nil, + # Only return Auth Rules that are bound to the provided scope. + scope: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + # Deletes a V2 Auth rule + sig do + params( + auth_rule_token: String, + request_options: Lithic::RequestOptions::OrHash + ).void + end + def delete(auth_rule_token, request_options: {}) + end + + # Creates a new draft version of a rule that will be ran in shadow mode. + # + # This can also be utilized to reset the draft parameters, causing a draft version + # to no longer be ran in shadow mode. + sig do + params( + auth_rule_token: String, + parameters: + T.nilable( + T.any( + Lithic::AuthRules::ConditionalBlockParameters::OrHash, + Lithic::AuthRules::VelocityLimitParams::OrHash, + Lithic::AuthRules::MerchantLockParameters::OrHash, + Lithic::AuthRules::Conditional3DSActionParameters::OrHash, + Lithic::AuthRules::ConditionalAuthorizationActionParameters::OrHash, + Lithic::AuthRules::ConditionalACHActionParameters::OrHash, + Lithic::AuthRules::ConditionalTokenizationActionParameters::OrHash, + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::OrHash, + Lithic::AuthRules::TypescriptCodeParameters::OrHash, + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::OrHash + ) + ), + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::AuthRules::AuthRule) + end + def draft( + auth_rule_token, + # Parameters for the Auth Rule + parameters: nil, + request_options: {} + ) + end + + # Lists Auth Rule evaluation results. + # + # **Limitations:** + # + # - Results are available for the past 3 months only + # - At least one filter (`event_token` or `auth_rule_token`) must be provided + # - When filtering by `event_token`, pagination is not supported + sig do + params( + auth_rule_token: String, + begin_: Time, + end_: Time, + ending_before: String, + event_token: String, + has_actions: T::Boolean, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns( + Lithic::Internal::CursorPage[ + Lithic::Models::AuthRules::V2ListResultsResponse::Variants + ] + ) + end + def list_results( + # Filter by Auth Rule token + auth_rule_token: nil, + # Date string in RFC 3339 format. Only events evaluated after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only events evaluated before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Filter by event token + event_token: nil, + # Filter by whether the rule evaluation produced any actions. When not provided, + # all results are returned. + has_actions: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + # Returns all versions of an auth rule, sorted by version number descending + # (newest first). + sig do + params( + auth_rule_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::AuthRules::V2ListVersionsResponse) + end + def list_versions(auth_rule_token, request_options: {}) + end + + # Promotes the draft version of an Auth rule to the currently active version such + # that it is enforced in the respective stream. + sig do + params( + auth_rule_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::AuthRules::AuthRule) + end + def promote(auth_rule_token, request_options: {}) + end + + # Fetches the current calculated Feature values for the given Auth Rule + # + # This only calculates the features for the active version. + # + # - VelocityLimit Rules calculates the current Velocity Feature data. This + # requires a `card_token` or `account_token` matching what the rule is Scoped + # to. + # - ConditionalBlock Rules calculates the CARD*TRANSACTION_COUNT*\* attributes on + # the rule. This requires a `card_token` + sig do + params( + auth_rule_token: String, + account_token: String, + card_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::AuthRules::V2RetrieveFeaturesResponse) + end + def retrieve_features( + auth_rule_token, + account_token: nil, + card_token: nil, + request_options: {} + ) + end + + # Retrieves a performance report for an Auth rule containing daily statistics and + # evaluation outcomes. + # + # **Time Range Limitations:** + # + # - Reports are supported for the past 3 months only + # - Maximum interval length is 1 month + # - Report data is available only through the previous day in UTC (current day + # data is not available) + # + # The report provides daily statistics for both current and draft versions of the + # Auth rule, including approval, decline, and challenge counts along with sample + # events. + sig do + params( + auth_rule_token: String, + begin_: Date, + end_: Date, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::AuthRules::V2RetrieveReportResponse) + end + def retrieve_report( + auth_rule_token, + # Start date for the report + begin_:, + # End date for the report + end_:, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lithic/resources/auth_rules/v2/backtests.rbi b/rbi/lithic/resources/auth_rules/v2/backtests.rbi new file mode 100644 index 00000000..ef926011 --- /dev/null +++ b/rbi/lithic/resources/auth_rules/v2/backtests.rbi @@ -0,0 +1,91 @@ +# typed: strong + +module Lithic + module Resources + class AuthRules + class V2 + class Backtests + # Initiates a request to asynchronously generate a backtest for an Auth rule. + # During backtesting, both the active version (if one exists) and the draft + # version of the Auth Rule are evaluated by replaying historical transaction data + # against the rule's conditions. This process allows customers to simulate and + # understand the effects of proposed rule changes before deployment. The generated + # backtest report provides detailed results showing whether the draft version of + # the Auth Rule would have approved or declined historical transactions which were + # processed during the backtest period. These reports help evaluate how changes to + # rule configurations might affect overall transaction approval rates. + # + # The generated backtest report will be delivered asynchronously through a webhook + # with `event_type` = `auth_rules.backtest_report.created`. See the docs on + # setting up [webhook subscriptions](https://docs.lithic.com/docs/events-api). It + # is also possible to request backtest reports on-demand through the + # `/v2/auth_rules/{auth_rule_token}/backtests/{auth_rule_backtest_token}` + # endpoint. + # + # Lithic currently supports backtesting for `CONDITIONAL_BLOCK` / + # `CONDITIONAL_ACTION` rules. Backtesting for `VELOCITY_LIMIT` rules is generally + # not supported. In specific cases (i.e. where Lithic has pre-calculated the + # requested velocity metrics for historical transactions), a backtest may be + # feasible. However, such cases are uncommon and customers should not anticipate + # support for velocity backtests under most configurations. If a historical + # transaction does not feature the required inputs to evaluate the rule, then it + # will not be included in the final backtest report. + sig do + params( + auth_rule_token: String, + end_: Time, + start: Time, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::AuthRules::V2::BacktestCreateResponse) + end + def create( + auth_rule_token, + # The end time of the backtest. + end_: nil, + # The start time of the backtest. + start: nil, + request_options: {} + ) + end + + # Returns the backtest results of an Auth rule (if available). + # + # Backtesting is an asynchronous process that requires time to complete. If a + # customer retrieves the backtest results using this endpoint before the report is + # fully generated, the response will return null for `results.current_version` and + # `results.draft_version`. Customers are advised to wait for the backtest creation + # process to complete (as indicated by the webhook event + # auth_rules.backtest_report.created) before retrieving results from this + # endpoint. + # + # Backtesting is an asynchronous process, while the backtest is being processed, + # results will not be available which will cause `results.current_version` and + # `results.draft_version` objects to contain `null`. The entries in `results` will + # also always represent the configuration of the rule at the time requests are + # made to this endpoint. For example, the results for `current_version` in the + # served backtest report will be consistent with which version of the rule is + # currently activated in the respective event stream, regardless of which version + # of the rule was active in the event stream at the time a backtest is requested. + sig do + params( + auth_rule_backtest_token: String, + auth_rule_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::AuthRules::V2::BacktestResults) + end + def retrieve( + auth_rule_backtest_token, + auth_rule_token:, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end + end +end diff --git a/rbi/lithic/resources/auth_stream_enrollment.rbi b/rbi/lithic/resources/auth_stream_enrollment.rbi new file mode 100644 index 00000000..e625ad65 --- /dev/null +++ b/rbi/lithic/resources/auth_stream_enrollment.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module Lithic + module Resources + class AuthStreamEnrollment + # Retrieve the ASA HMAC secret key. If one does not exist for your program yet, + # calling this endpoint will create one for you. The headers (which you can use to + # verify webhooks) will begin appearing shortly after calling this endpoint for + # the first time. See + # [this page](https://docs.lithic.com/docs/auth-stream-access-asa#asa-webhook-verification) + # for more detail about verifying ASA webhooks. + sig do + params(request_options: Lithic::RequestOptions::OrHash).returns( + Lithic::AuthStreamSecret + ) + end + def retrieve_secret(request_options: {}) + end + + # Generate a new ASA HMAC secret key. The old ASA HMAC secret key will be + # deactivated 24 hours after a successful request to this endpoint. Make a + # [`GET /auth_stream/secret`](https://docs.lithic.com/reference/getauthstreamsecret) + # request to retrieve the new secret key. + sig { params(request_options: Lithic::RequestOptions::OrHash).void } + def rotate_secret(request_options: {}) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/balances.rbi b/rbi/lithic/resources/balances.rbi new file mode 100644 index 00000000..2b7b59ab --- /dev/null +++ b/rbi/lithic/resources/balances.rbi @@ -0,0 +1,37 @@ +# typed: strong + +module Lithic + module Resources + class Balances + # Get the balances for a program, business, or a given end-user account + sig do + params( + account_token: String, + balance_date: Time, + business_account_token: String, + financial_account_type: + Lithic::BalanceListParams::FinancialAccountType::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Internal::SinglePage[Lithic::Balance]) + end + def list( + # List balances for all financial accounts of a given account_token. + account_token: nil, + # UTC date and time of the balances to retrieve. Defaults to latest available + # balances + balance_date: nil, + # List balances for all financial accounts of a given business_account_token. + business_account_token: nil, + # List balances for a given Financial Account type. + financial_account_type: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/book_transfers.rbi b/rbi/lithic/resources/book_transfers.rbi new file mode 100644 index 00000000..1131114c --- /dev/null +++ b/rbi/lithic/resources/book_transfers.rbi @@ -0,0 +1,157 @@ +# typed: strong + +module Lithic + module Resources + class BookTransfers + # Book transfer funds between two financial accounts or between a financial + # account and card + sig do + params( + amount: Integer, + category: Lithic::BookTransferCreateParams::Category::OrSymbol, + from_financial_account_token: String, + subtype: String, + to_financial_account_token: String, + type: Lithic::BookTransferCreateParams::Type::OrSymbol, + token: String, + external_id: String, + hold_token: String, + memo: String, + on_closed_account: + Lithic::BookTransferCreateParams::OnClosedAccount::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::BookTransferResponse) + end + def create( + # Amount to be transferred in the currency's smallest unit (e.g., cents for USD). + # This should always be a positive value. + amount:, + category:, + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + from_financial_account_token:, + # The program specific subtype code for the specified category/type. + subtype:, + # Globally unique identifier for the financial account or card that will receive + # the funds. Accepted type dependent on the program's use case. + to_financial_account_token:, + # Type of the book transfer + type:, + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + token: nil, + # External ID defined by the customer + external_id: nil, + # Token of an existing hold to settle when this transfer is initiated + hold_token: nil, + # Optional descriptor for the transfer. + memo: nil, + # What to do if the financial account is closed when posting an operation + on_closed_account: nil, + request_options: {} + ) + end + + # Get book transfer by token + sig do + params( + book_transfer_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::BookTransferResponse) + end + def retrieve( + # Id of the book transfer to retrieve + book_transfer_token, + request_options: {} + ) + end + + # List book transfers + sig do + params( + account_token: String, + begin_: Time, + business_account_token: String, + category: Lithic::BookTransferListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::BookTransferListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::BookTransferListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Internal::CursorPage[Lithic::BookTransferResponse]) + end + def list( + account_token: nil, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + business_account_token: nil, + # Book Transfer category to be returned. + category: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + financial_account_token: nil, + # Page size (for pagination). + page_size: nil, + # Book transfer result to be returned. + result: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Book transfer status to be returned. + status: nil, + request_options: {} + ) + end + + # Retry a book transfer that has been declined + sig do + params( + book_transfer_token: String, + retry_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::BookTransferResponse) + end + def retry_( + # Token of the book transfer to retry + book_transfer_token, + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + retry_token:, + request_options: {} + ) + end + + # Reverse a book transfer + sig do + params( + book_transfer_token: String, + memo: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::BookTransferResponse) + end + def reverse( + # Id of the book transfer to retrieve + book_transfer_token, + # Optional descriptor for the reversal. + memo: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/card_authorizations.rbi b/rbi/lithic/resources/card_authorizations.rbi new file mode 100644 index 00000000..1a61b928 --- /dev/null +++ b/rbi/lithic/resources/card_authorizations.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Lithic + module Resources + class CardAuthorizations + # Card program's response to Authorization Challenge. Programs that have + # Authorization Challenges configured as Out of Band receive a + # [card_authorization.challenge](https://docs.lithic.com/reference/post_card-authorization-challenge) + # webhook when an authorization attempt triggers a challenge. The card program + # should respond using this endpoint after the cardholder completes the challenge. + sig do + params( + event_token: String, + response: + Lithic::CardAuthorizationChallengeResponseParams::Response::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).void + end + def challenge_response( + # Globally unique identifier for the authorization event that triggered the + # challenge + event_token, + # Whether the cardholder has approved or declined the issued challenge + response:, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/card_bulk_orders.rbi b/rbi/lithic/resources/card_bulk_orders.rbi new file mode 100644 index 00000000..f76c8a25 --- /dev/null +++ b/rbi/lithic/resources/card_bulk_orders.rbi @@ -0,0 +1,101 @@ +# typed: strong + +module Lithic + module Resources + class CardBulkOrders + # Create a new bulk order for physical card shipments. Cards can be added to the + # order via the POST /v1/cards endpoint by specifying the bulk_order_token. Lock + # the order via PATCH /v1/card_bulk_orders/{bulk_order_token} to prepare for + # shipment. Please work with your Customer Success Manager and card + # personalization bureau to ensure bulk shipping is supported for your program. + sig do + params( + customer_product_id: String, + shipping_address: T.anything, + shipping_method: + Lithic::CardBulkOrderCreateParams::ShippingMethod::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::CardBulkOrder) + end + def create( + # Customer-specified product configuration for physical card manufacturing. This + # must be configured with Lithic before use + customer_product_id:, + # Shipping address for all cards in this bulk order + shipping_address:, + # Shipping method for all cards in this bulk order. BULK_PRIORITY, BULK_2_DAY, and + # BULK_EXPRESS are only available with Perfect Plastic Printing + shipping_method:, + request_options: {} + ) + end + + # Retrieve a specific bulk order by token + sig do + params( + bulk_order_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::CardBulkOrder) + end + def retrieve( + # Globally unique identifier for the bulk order + bulk_order_token, + request_options: {} + ) + end + + # Update a bulk order. Primarily used to lock the order, preventing additional + # cards from being added + sig do + params( + bulk_order_token: String, + status: Lithic::CardBulkOrderUpdateParams::Status::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::CardBulkOrder) + end + def update( + # Globally unique identifier for the bulk order + bulk_order_token, + # Status to update the bulk order to. Use LOCKED to finalize the order + status:, + request_options: {} + ) + end + + # List bulk orders for physical card shipments + sig do + params( + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Internal::CursorPage[Lithic::CardBulkOrder]) + end + def list( + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/card_programs.rbi b/rbi/lithic/resources/card_programs.rbi new file mode 100644 index 00000000..68951e69 --- /dev/null +++ b/rbi/lithic/resources/card_programs.rbi @@ -0,0 +1,48 @@ +# typed: strong + +module Lithic + module Resources + class CardPrograms + # Get card program. + sig do + params( + card_program_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::CardProgram) + end + def retrieve( + # Globally unique identifier for the card program. + card_program_token, + request_options: {} + ) + end + + # List card programs. + sig do + params( + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Internal::CursorPage[Lithic::CardProgram]) + end + def list( + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/cards.rbi b/rbi/lithic/resources/cards.rbi new file mode 100644 index 00000000..dacf2039 --- /dev/null +++ b/rbi/lithic/resources/cards.rbi @@ -0,0 +1,684 @@ +# typed: strong + +module Lithic + module Resources + class Cards + sig { returns(Lithic::Resources::Cards::Balances) } + attr_reader :balances + + sig { returns(Lithic::Resources::Cards::FinancialTransactions) } + attr_reader :financial_transactions + + # Create a new virtual or physical card. Parameters `shipping_address` and + # `product_id` only apply to physical cards. + sig do + params( + type: Lithic::CardCreateParams::Type::OrSymbol, + account_token: String, + bulk_order_token: String, + card_program_token: String, + carrier: Lithic::Carrier::OrHash, + digital_card_art_token: String, + exp_month: String, + exp_year: String, + memo: String, + pin: String, + product_id: String, + replacement_account_token: String, + replacement_comment: String, + replacement_for: String, + replacement_substatus: + Lithic::CardCreateParams::ReplacementSubstatus::OrSymbol, + shipping_address: Lithic::ShippingAddress::OrHash, + shipping_method: Lithic::CardCreateParams::ShippingMethod::OrSymbol, + spend_limit: Integer, + spend_limit_duration: Lithic::SpendLimitDuration::OrSymbol, + state: Lithic::CardCreateParams::State::OrSymbol, + idempotency_key: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Card) + end + def create( + # Body param: Card types: + # + # - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital + # wallet like Apple Pay or Google Pay (if the card program is digital + # wallet-enabled). + # - `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label + # branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality. + # Reach out at [lithic.com/contact](https://lithic.com/contact) for more + # information. + # - `SINGLE_USE` - Card is closed upon first successful authorization. + # - `MERCHANT_LOCKED` - Card is locked to the first merchant that successfully + # authorizes the card. + # - `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use + # VIRTUAL instead. + # - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please + # use VIRTUAL instead. + type:, + # Body param: Globally unique identifier for the account that the card will be + # associated with. Required for programs enrolling users using the + # [/account_holders endpoint](https://docs.lithic.com/docs/account-holders-kyc). + # See [Managing Your Program](doc:managing-your-program) for more information. + account_token: nil, + # Body param: Globally unique identifier for an existing bulk order to associate + # this card with. When specified, the card will be added to the bulk order for + # batch shipment. Only applicable to cards of type PHYSICAL + bulk_order_token: nil, + # Body param: For card programs with more than one BIN range. This must be + # configured with Lithic before use. Identifies the card program/BIN range under + # which to create the card. If omitted, will utilize the program's default + # `card_program_token`. In Sandbox, use 00000000-0000-0000-1000-000000000000 and + # 00000000-0000-0000-2000-000000000000 to test creating cards on specific card + # programs. + card_program_token: nil, + # Body param + carrier: nil, + # Body param: Specifies the digital card art to be displayed in the user’s digital + # wallet after tokenization. This artwork must be approved by Mastercard and + # configured by Lithic to use. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + digital_card_art_token: nil, + # Body param: Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` + # is provided, an expiration date five years in the future will be generated. Five + # years is the maximum expiration date. + exp_month: nil, + # Body param: Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` + # is provided, an expiration date five years in the future will be generated. Five + # years is the maximum expiration date. + exp_year: nil, + # Body param: Friendly name to identify the card. + memo: nil, + # Body param: Encrypted PIN block (in base64). Applies to cards of type `PHYSICAL` + # and `VIRTUAL`. See + # [Encrypted PIN Block](https://docs.lithic.com/docs/cards#encrypted-pin-block). + pin: nil, + # Body param: Only applicable to cards of type `PHYSICAL`. This must be configured + # with Lithic before use. Specifies the configuration (i.e., physical card art) + # that the card should be manufactured with. + product_id: nil, + # Body param: Restricted field limited to select use cases. Lithic will reach out + # directly if this field should be used. Globally unique identifier for the + # replacement card's account. If this field is specified, `replacement_for` must + # also be specified. If `replacement_for` is specified and this field is omitted, + # the replacement card's account will be inferred from the card being replaced. + replacement_account_token: nil, + # Body param: Additional context or information related to the card that this card + # will replace. + replacement_comment: nil, + # Body param: Globally unique identifier for the card that this card will replace. + # If the card type is `PHYSICAL` it will be replaced by a `PHYSICAL` card. If the + # card type is `VIRTUAL` it will be replaced by a `VIRTUAL` card. + replacement_for: nil, + # Body param: Card state substatus values for the card that this card will + # replace: + # + # - `LOST` - The physical card is no longer in the cardholder's possession due to + # being lost or never received by the cardholder. + # - `COMPROMISED` - Card information has been exposed, potentially leading to + # unauthorized access. This may involve physical card theft, cloning, or online + # data breaches. + # - `DAMAGED` - The physical card is not functioning properly, such as having chip + # failures or a demagnetized magnetic stripe. + # - `END_USER_REQUEST` - The cardholder requested the closure of the card for + # reasons unrelated to fraud or damage, such as switching to a different product + # or closing the account. + # - `ISSUER_REQUEST` - The issuer closed the card for reasons unrelated to fraud + # or damage, such as account inactivity, product or policy changes, or + # technology upgrades. + # - `NOT_ACTIVE` - The card hasn’t had any transaction activity for a specified + # period, applicable to statuses like `PAUSED` or `CLOSED`. + # - `SUSPICIOUS_ACTIVITY` - The card has one or more suspicious transactions or + # activities that require review. This can involve prompting the cardholder to + # confirm legitimate use or report confirmed fraud. + # - `INTERNAL_REVIEW` - The card is temporarily paused pending further internal + # review. + # - `EXPIRED` - The card has expired and has been closed without being reissued. + # - `UNDELIVERABLE` - The card cannot be delivered to the cardholder and has been + # returned. + # - `OTHER` - The reason for the status does not fall into any of the above + # categories. A comment should be provided to specify the reason. + replacement_substatus: nil, + # Body param + shipping_address: nil, + # Body param: Shipping method for the card. Only applies to cards of type + # PHYSICAL. Use of options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx or UPS depending on card manufacturer, Express, 3-day + # shipping, with tracking + # - `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with + # tracking + # - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight + # or similar international option, with tracking + # - `BULK` - Card will be shipped as part of a bulk fulfillment order. The + # shipping method and timeline are inherited from the parent bulk order. + shipping_method: nil, + # Body param: Amount (in cents) to limit approved authorizations (e.g. 100000 + # would be a $1,000 limit). Transaction requests above the spend limit will be + # declined. Note that a spend limit of 0 is effectively no limit, and should only + # be used to reset or remove a prior limit. Only a limit of 1 or above will result + # in declined transactions due to checks against the card limit. + spend_limit: nil, + # Body param: Spend limit duration values: + # + # - `ANNUALLY` - Card will authorize transactions up to spend limit for the + # trailing year. + # - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime + # of the card. + # - `MONTHLY` - Card will authorize transactions up to spend limit for the + # trailing month. To support recurring monthly payments, which can occur on + # different day every month, the time window we consider for monthly velocity + # starts 6 days after the current calendar date one month prior. + # - `TRANSACTION` - Card will authorize multiple transactions if each individual + # transaction is under the spend limit. + spend_limit_duration: nil, + # Body param: Card state values: + # + # - `OPEN` - Card will approve authorizations (if they match card and account + # parameters). + # - `PAUSED` - Card will decline authorizations, but can be resumed at a later + # time. + state: nil, + # Header param: Idempotency key for the request + idempotency_key: nil, + request_options: {} + ) + end + + # Get card configuration such as spend limit and state. + sig do + params( + card_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Card) + end + def retrieve(card_token, request_options: {}) + end + + # Update the specified properties of the card. Unsupplied properties will remain + # unchanged. + # + # _Note: setting a card to a `CLOSED` state is a final action that cannot be + # undone._ + sig do + params( + card_token: String, + comment: String, + digital_card_art_token: String, + memo: String, + network_program_token: String, + pin: String, + pin_status: Lithic::CardUpdateParams::PinStatus::OrSymbol, + spend_limit: Integer, + spend_limit_duration: Lithic::SpendLimitDuration::OrSymbol, + state: Lithic::CardUpdateParams::State::OrSymbol, + substatus: Lithic::CardUpdateParams::Substatus::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Card) + end + def update( + card_token, + # Additional context or information related to the card. + comment: nil, + # Specifies the digital card art to be displayed in the user’s digital wallet + # after tokenization. This artwork must be approved by Mastercard and configured + # by Lithic to use. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + digital_card_art_token: nil, + # Friendly name to identify the card. + memo: nil, + # Globally unique identifier for the card's network program. Currently applicable + # to Visa cards participating in Account Level Management only. + network_program_token: nil, + # Encrypted PIN block (in base64). Only applies to cards of type `PHYSICAL` and + # `VIRTUAL`. Changing PIN also resets PIN status to `OK`. See + # [Encrypted PIN Block](https://docs.lithic.com/docs/cards#encrypted-pin-block). + pin: nil, + # Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect + # attempts). Can only be set to `OK` to unblock a card. + pin_status: nil, + # Amount (in cents) to limit approved authorizations (e.g. 100000 would be a + # $1,000 limit). Transaction requests above the spend limit will be declined. Note + # that a spend limit of 0 is effectively no limit, and should only be used to + # reset or remove a prior limit. Only a limit of 1 or above will result in + # declined transactions due to checks against the card limit. + spend_limit: nil, + # Spend limit duration values: + # + # - `ANNUALLY` - Card will authorize transactions up to spend limit for the + # trailing year. + # - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime + # of the card. + # - `MONTHLY` - Card will authorize transactions up to spend limit for the + # trailing month. To support recurring monthly payments, which can occur on + # different day every month, the time window we consider for monthly velocity + # starts 6 days after the current calendar date one month prior. + # - `TRANSACTION` - Card will authorize multiple transactions if each individual + # transaction is under the spend limit. + spend_limit_duration: nil, + # Card state values: + # + # - `CLOSED` - Card will no longer approve authorizations. Closing a card cannot + # be undone. + # - `OPEN` - Card will approve authorizations (if they match card and account + # parameters). + # - `PAUSED` - Card will decline authorizations, but can be resumed at a later + # time. + state: nil, + # Card state substatus values: + # + # - `LOST` - The physical card is no longer in the cardholder's possession due to + # being lost or never received by the cardholder. + # - `COMPROMISED` - Card information has been exposed, potentially leading to + # unauthorized access. This may involve physical card theft, cloning, or online + # data breaches. + # - `DAMAGED` - The physical card is not functioning properly, such as having chip + # failures or a demagnetized magnetic stripe. + # - `END_USER_REQUEST` - The cardholder requested the closure of the card for + # reasons unrelated to fraud or damage, such as switching to a different product + # or closing the account. + # - `ISSUER_REQUEST` - The issuer closed the card for reasons unrelated to fraud + # or damage, such as account inactivity, product or policy changes, or + # technology upgrades. + # - `NOT_ACTIVE` - The card hasn’t had any transaction activity for a specified + # period, applicable to statuses like `PAUSED` or `CLOSED`. + # - `SUSPICIOUS_ACTIVITY` - The card has one or more suspicious transactions or + # activities that require review. This can involve prompting the cardholder to + # confirm legitimate use or report confirmed fraud. + # - `INTERNAL_REVIEW` - The card is temporarily paused pending further internal + # review. + # - `EXPIRED` - The card has expired and has been closed without being reissued. + # - `UNDELIVERABLE` - The card cannot be delivered to the cardholder and has been + # returned. + # - `OTHER` - The reason for the status does not fall into any of the above + # categories. A comment should be provided to specify the reason. + substatus: nil, + request_options: {} + ) + end + + # List cards. + sig do + params( + account_token: String, + begin_: Time, + end_: Time, + ending_before: String, + memo: String, + page_size: Integer, + starting_after: String, + state: Lithic::CardListParams::State::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Internal::CursorPage[Lithic::NonPCICard]) + end + def list( + # Returns cards associated with the specified account. + account_token: nil, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Returns cards containing the specified partial or full memo text. + memo: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Returns cards with the specified state. + state: nil, + request_options: {} + ) + end + + # Convert a virtual card into a physical card and manufacture it. Customer must + # supply relevant fields for physical card creation including `product_id`, + # `carrier`, `shipping_method`, and `shipping_address`. The card token will be + # unchanged. The card's type will be altered to `PHYSICAL`. The card will be set + # to state `PENDING_FULFILLMENT` and fulfilled at next fulfillment cycle. Virtual + # cards created on card programs which do not support physical cards cannot be + # converted. The card program cannot be changed as part of the conversion. Cards + # must be in an `OPEN` state to be converted. Only applies to cards of type + # `VIRTUAL` (or existing cards with deprecated types of `DIGITAL_WALLET` and + # `UNLOCKED`). + sig do + params( + card_token: String, + shipping_address: Lithic::ShippingAddress::OrHash, + carrier: Lithic::Carrier::OrHash, + product_id: String, + shipping_method: + Lithic::CardConvertPhysicalParams::ShippingMethod::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Card) + end + def convert_physical( + card_token, + # The shipping address this card will be sent to. + shipping_address:, + # If omitted, the previous carrier will be used. + carrier: nil, + # Specifies the configuration (e.g. physical card art) that the card should be + # manufactured with, and only applies to cards of type `PHYSICAL`. This must be + # configured with Lithic before use. + product_id: nil, + # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of + # options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx or UPS depending on card manufacturer, Express, 3-day + # shipping, with tracking + # - `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with + # tracking + # - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight + # or similar international option, with tracking + # - `BULK` - Card will be shipped as part of a bulk fulfillment order. The + # shipping method and timeline are inherited from the parent bulk order. + shipping_method: nil, + request_options: {} + ) + end + + # Handling full card PANs and CVV codes requires that you comply with the Payment + # Card Industry Data Security Standards (PCI DSS). Some clients choose to reduce + # their compliance obligations by leveraging our embedded card UI solution + # documented below. + # + # In this setup, PANs and CVV codes are presented to the end-user via a card UI + # that we provide, optionally styled in the customer's branding using a specified + # css stylesheet. A user's browser makes the request directly to api.lithic.com, + # so card PANs and CVVs never touch the API customer's servers while full card + # data is displayed to their end-users. The response contains an HTML document + # (see Embedded Card UI or Changelog for upcoming changes in January). This means + # that the url for the request can be inserted straight into the `src` attribute + # of an iframe. + # + # ```html + # + # ``` + # + # You should compute the request payload on the server side. You can render it (or + # the whole iframe) on the server or make an ajax call from your front end code, + # but **do not ever embed your API key into front end code, as doing so introduces + # a serious security vulnerability**. + sig do + params( + embed_request: String, + hmac: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(String) + end + def embed( + # A base64 encoded JSON string of an EmbedRequest to specify which card to load. + embed_request:, + # SHA256 HMAC of the embed_request JSON string with base64 digest. + hmac:, + request_options: {} + ) + end + + # Allow your cardholders to directly add payment cards to the device's digital + # wallet (e.g. Apple Pay) with one touch from your app. + # + # This requires some additional setup and configuration. Please + # [Contact Us](https://lithic.com/contact) or your Customer Success representative + # for more information. + sig do + params( + card_token: String, + certificate: String, + client_device_id: String, + client_wallet_account_id: String, + digital_wallet: Lithic::CardProvisionParams::DigitalWallet::OrSymbol, + nonce: String, + nonce_signature: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::CardProvisionResponse) + end + def provision( + # The unique token of the card to add to the device's digital wallet. + card_token, + # Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only + # `activationData` in the response. Apple's public leaf certificate. Base64 + # encoded in PEM format with headers `(-----BEGIN CERTIFICATE-----)` and trailers + # omitted. Provided by the device's wallet. + certificate: nil, + # Only applicable if `digital_wallet` is `GOOGLE_PAY` or `SAMSUNG_PAY` and the + # card is on the Visa network. Stable device identification set by the wallet + # provider. + client_device_id: nil, + # Only applicable if `digital_wallet` is `GOOGLE_PAY` or `SAMSUNG_PAY` and the + # card is on the Visa network. Consumer ID that identifies the wallet account + # holder entity. + client_wallet_account_id: nil, + # Name of digital wallet provider. + digital_wallet: nil, + # Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only + # `activationData` in the response. Base64 cryptographic nonce provided by the + # device's wallet. + nonce: nil, + # Only applicable if `digital_wallet` is `APPLE_PAY`. Omit to receive only + # `activationData` in the response. Base64 cryptographic nonce provided by the + # device's wallet. + nonce_signature: nil, + request_options: {} + ) + end + + # Initiate print and shipment of a duplicate physical card (e.g. card is + # physically damaged). The PAN, expiry, and CVC2 will remain the same and the + # original card can continue to be used until the new card is activated. Only + # applies to cards of type `PHYSICAL`. A card can be reissued or renewed a total + # of 8 times. + sig do + params( + card_token: String, + carrier: Lithic::Carrier::OrHash, + product_id: String, + shipping_address: Lithic::ShippingAddress::OrHash, + shipping_method: Lithic::CardReissueParams::ShippingMethod::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Card) + end + def reissue( + card_token, + # If omitted, the previous carrier will be used. + carrier: nil, + # Specifies the configuration (e.g. physical card art) that the card should be + # manufactured with, and only applies to cards of type `PHYSICAL`. This must be + # configured with Lithic before use. + product_id: nil, + # If omitted, the previous shipping address will be used. + shipping_address: nil, + # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of + # options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx or UPS depending on card manufacturer, Express, 3-day + # shipping, with tracking + # - `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with + # tracking + # - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight + # or similar international option, with tracking + # - `BULK` - Card will be shipped as part of a bulk fulfillment order. The + # shipping method and timeline are inherited from the parent bulk order. + shipping_method: nil, + request_options: {} + ) + end + + # Applies to card types `PHYSICAL` and `VIRTUAL`. For `PHYSICAL`, creates a new + # card with the same card token and PAN, but updated expiry and CVC2 code. The + # original card will keep working for card-present transactions until the new card + # is activated. For card-not-present transactions, the original card details + # (expiry, CVC2) will also keep working until the new card is activated. A + # `PHYSICAL` card can be reissued or renewed a total of 8 times. For `VIRTUAL`, + # the card will retain the same card token and PAN and receive an updated expiry + # and CVC2 code. `product_id`, `shipping_method`, `shipping_address`, `carrier` + # are only relevant for renewing `PHYSICAL` cards. + sig do + params( + card_token: String, + shipping_address: Lithic::ShippingAddress::OrHash, + carrier: Lithic::Carrier::OrHash, + exp_month: String, + exp_year: String, + product_id: String, + shipping_method: Lithic::CardRenewParams::ShippingMethod::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Card) + end + def renew( + card_token, + # The shipping address this card will be sent to. + shipping_address:, + # If omitted, the previous carrier will be used. + carrier: nil, + # Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, + # an expiration date five years in the future will be generated. Five years is the + # maximum expiration date. + exp_month: nil, + # Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is + # provided, an expiration date five years in the future will be generated. Five + # years is the maximum expiration date. + exp_year: nil, + # Specifies the configuration (e.g. physical card art) that the card should be + # manufactured with, and only applies to cards of type `PHYSICAL`. This must be + # configured with Lithic before use. + product_id: nil, + # Shipping method for the card. Only applies to cards of type PHYSICAL. Use of + # options besides `STANDARD` require additional permissions. + # + # - `STANDARD` - USPS regular mail or similar international option, with no + # tracking + # - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, + # with tracking + # - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + # - `EXPRESS` - FedEx or UPS depending on card manufacturer, Express, 3-day + # shipping, with tracking + # - `2_DAY` - FedEx or UPS depending on card manufacturer, 2-day shipping, with + # tracking + # - `EXPEDITED` - FedEx or UPS depending on card manufacturer, Standard Overnight + # or similar international option, with tracking + # - `BULK` - Card will be shipped as part of a bulk fulfillment order. The + # shipping method and timeline are inherited from the parent bulk order. + shipping_method: nil, + request_options: {} + ) + end + + # Returns behavioral feature state derived from a card's transaction history. + # + # These signals expose the same data used by behavioral rule attributes (e.g. + # `AMOUNT_Z_SCORE` with `scope: CARD`, `IS_NEW_COUNTRY` with `scope: CARD`) and + # custom code `TRANSACTION_HISTORY_SIGNALS` features, allowing clients to inspect + # feature values before writing rules and debug rule behavior. + sig do + params( + card_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::SignalsResponse) + end + def retrieve_signals( + # The token of the card to fetch signals for. + card_token, + request_options: {} + ) + end + + # Get a Card's available spend limit, which is based on the spend limit configured + # on the Card and the amount already spent over the spend limit's duration. For + # example, if the Card has a monthly spend limit of $1000 configured, and has + # spent $600 in the last month, the available spend limit returned would be $400. + sig do + params( + card_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::CardSpendLimits) + end + def retrieve_spend_limits(card_token, request_options: {}) + end + + # Get card configuration such as spend limit and state. Customers must be PCI + # compliant to use this endpoint. Please contact + # [support.lithic.com](https://support.lithic.com/) for questions. _Note: this is + # a `POST` endpoint because it is more secure to send sensitive data in a request + # body than in a URL._ + sig do + params( + pan: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Card) + end + def search_by_pan( + # The PAN for the card being retrieved. + pan:, + request_options: {} + ) + end + + # Allow your cardholders to directly add payment cards to the device's digital + # wallet from a browser on the web. + # + # This requires some additional setup and configuration. Please + # [Contact Us](https://lithic.com/contact) or your Customer Success representative + # for more information. + sig do + params( + card_token: String, + client_device_id: String, + client_wallet_account_id: String, + digital_wallet: + Lithic::CardWebProvisionParams::DigitalWallet::OrSymbol, + server_session_id: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::CardWebProvisionResponse::Variants) + end + def web_provision( + # The unique token of the card to add to the device's digital wallet. + card_token, + # Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push + # Provisioning device identifier required for the tokenization flow + client_device_id: nil, + # Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push + # Provisioning wallet account identifier required for the tokenization flow + client_wallet_account_id: nil, + # Name of digital wallet provider. + digital_wallet: nil, + # Only applicable if `digital_wallet` is GOOGLE_PAY. Google Pay Web Push + # Provisioning session identifier required for the FPAN flow. + server_session_id: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/cards/balances.rbi b/rbi/lithic/resources/cards/balances.rbi new file mode 100644 index 00000000..c549bc87 --- /dev/null +++ b/rbi/lithic/resources/cards/balances.rbi @@ -0,0 +1,37 @@ +# typed: strong + +module Lithic + module Resources + class Cards + class Balances + # Get the balances for a given card. + sig do + params( + card_token: String, + balance_date: Time, + last_transaction_event_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns( + Lithic::Internal::SinglePage[Lithic::FinancialAccountBalance] + ) + end + def list( + card_token, + # UTC date of the balance to retrieve. Defaults to latest available balance + balance_date: nil, + # Balance after a given financial event occured. For example, passing the + # event_token of a $5 CARD_CLEARING financial event will return a balance + # decreased by $5 + last_transaction_event_token: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lithic/resources/cards/financial_transactions.rbi b/rbi/lithic/resources/cards/financial_transactions.rbi new file mode 100644 index 00000000..41d23589 --- /dev/null +++ b/rbi/lithic/resources/cards/financial_transactions.rbi @@ -0,0 +1,71 @@ +# typed: strong + +module Lithic + module Resources + class Cards + class FinancialTransactions + # Get the card financial transaction for the provided token. + sig do + params( + financial_transaction_token: String, + card_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::FinancialTransaction) + end + def retrieve( + # Globally unique identifier for financial transaction token. + financial_transaction_token, + card_token:, + request_options: {} + ) + end + + # List the financial transactions for a given card. + sig do + params( + card_token: String, + begin_: Time, + category: + Lithic::Cards::FinancialTransactionListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + result: + Lithic::Cards::FinancialTransactionListParams::Result::OrSymbol, + starting_after: String, + status: + Lithic::Cards::FinancialTransactionListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Internal::SinglePage[Lithic::FinancialTransaction]) + end + def list( + card_token, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Financial Transaction category to be returned. + category: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Financial Transaction result to be returned. + result: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Financial Transaction status to be returned. + status: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lithic/resources/credit_products.rbi b/rbi/lithic/resources/credit_products.rbi new file mode 100644 index 00000000..83500f1d --- /dev/null +++ b/rbi/lithic/resources/credit_products.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Lithic + module Resources + class CreditProducts + sig { returns(Lithic::Resources::CreditProducts::ExtendedCredit) } + attr_reader :extended_credit + + sig { returns(Lithic::Resources::CreditProducts::PrimeRates) } + attr_reader :prime_rates + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/credit_products/extended_credit.rbi b/rbi/lithic/resources/credit_products/extended_credit.rbi new file mode 100644 index 00000000..64fa2650 --- /dev/null +++ b/rbi/lithic/resources/credit_products/extended_credit.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Lithic + module Resources + class CreditProducts + class ExtendedCredit + # Get the extended credit for a given credit product under a program + sig do + params( + credit_product_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::CreditProducts::CreditProductsExtendedCredit) + end + def retrieve( + # Credit Product Token + credit_product_token, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lithic/resources/credit_products/prime_rates.rbi b/rbi/lithic/resources/credit_products/prime_rates.rbi new file mode 100644 index 00000000..d1cf0db2 --- /dev/null +++ b/rbi/lithic/resources/credit_products/prime_rates.rbi @@ -0,0 +1,54 @@ +# typed: strong + +module Lithic + module Resources + class CreditProducts + class PrimeRates + # Post Credit Product Prime Rate + sig do + params( + credit_product_token: String, + effective_date: Date, + rate: String, + request_options: Lithic::RequestOptions::OrHash + ).void + end + def create( + # Globally unique identifier for credit products. + credit_product_token, + # Date the rate goes into effect + effective_date:, + # The rate in decimal format + rate:, + request_options: {} + ) + end + + # Get Credit Product Prime Rates + sig do + params( + credit_product_token: String, + ending_before: Date, + starting_after: Date, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::CreditProducts::PrimeRateRetrieveResponse) + end + def retrieve( + # Globally unique identifier for credit products. + credit_product_token, + # The effective date that the prime rates ends before + ending_before: nil, + # The effective date that the prime rate starts after + starting_after: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lithic/resources/digital_card_art.rbi b/rbi/lithic/resources/digital_card_art.rbi new file mode 100644 index 00000000..c46763b3 --- /dev/null +++ b/rbi/lithic/resources/digital_card_art.rbi @@ -0,0 +1,51 @@ +# typed: strong + +module Lithic + module Resources + class DigitalCardArt + # Get digital card art by token. + sig do + params( + digital_card_art_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::DigitalCardArtAPI) + end + def retrieve( + # Specifies the digital card art to be displayed in the user’s digital wallet + # after tokenization. This artwork must be approved by Mastercard and configured + # by Lithic to use. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + digital_card_art_token, + request_options: {} + ) + end + + # List digital card art. + sig do + params( + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Internal::CursorPage[Lithic::DigitalCardArtAPI]) + end + def list( + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/disputes.rbi b/rbi/lithic/resources/disputes.rbi new file mode 100644 index 00000000..251b33a3 --- /dev/null +++ b/rbi/lithic/resources/disputes.rbi @@ -0,0 +1,194 @@ +# typed: strong + +module Lithic + module Resources + class Disputes + # Request a chargeback. + sig do + params( + amount: Integer, + reason: Lithic::DisputeCreateParams::Reason::OrSymbol, + transaction_token: String, + customer_filed_date: Time, + customer_note: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Dispute) + end + def create( + # Amount for chargeback + amount:, + # Reason for chargeback + reason:, + # Transaction for chargeback + transaction_token:, + # Date the customer filed the chargeback request + customer_filed_date: nil, + # Customer description + customer_note: nil, + request_options: {} + ) + end + + # Get chargeback request. + sig do + params( + dispute_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Dispute) + end + def retrieve(dispute_token, request_options: {}) + end + + # Update chargeback request. Can only be modified if status is `NEW`. + sig do + params( + dispute_token: String, + amount: Integer, + customer_filed_date: Time, + customer_note: String, + reason: Lithic::DisputeUpdateParams::Reason::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Dispute) + end + def update( + dispute_token, + # Amount for chargeback + amount: nil, + # Date the customer filed the chargeback request + customer_filed_date: nil, + # Customer description + customer_note: nil, + # Reason for chargeback + reason: nil, + request_options: {} + ) + end + + # List chargeback requests. + sig do + params( + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::DisputeListParams::Status::OrSymbol, + transaction_tokens: T::Array[String], + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Internal::CursorPage[Lithic::Dispute]) + end + def list( + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Filter by status. + status: nil, + # Transaction tokens to filter by. + transaction_tokens: nil, + request_options: {} + ) + end + + # Withdraw chargeback request. + sig do + params( + dispute_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Dispute) + end + def delete(dispute_token, request_options: {}) + end + + # Soft delete evidence for a chargeback request. Evidence will not be reviewed or + # submitted by Lithic after it is withdrawn. + sig do + params( + evidence_token: String, + dispute_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::DisputeEvidence) + end + def delete_evidence(evidence_token, dispute_token:, request_options: {}) + end + + # Use this endpoint to upload evidence for a chargeback request. It will return a + # URL to upload your documents to. The URL will expire in 30 minutes. + # + # Uploaded documents must either be a `jpg`, `png` or `pdf` file, and each must be + # less than 5 GiB. + sig do + params( + dispute_token: String, + filename: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::DisputeEvidence) + end + def initiate_evidence_upload( + dispute_token, + # Filename of the evidence. + filename: nil, + request_options: {} + ) + end + + # List evidence for a chargeback request. + sig do + params( + dispute_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Internal::CursorPage[Lithic::DisputeEvidence]) + end + def list_evidences( + dispute_token, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + # Get evidence for a chargeback request. + sig do + params( + evidence_token: String, + dispute_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::DisputeEvidence) + end + def retrieve_evidence(evidence_token, dispute_token:, request_options: {}) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/disputes_v2.rbi b/rbi/lithic/resources/disputes_v2.rbi new file mode 100644 index 00000000..23b97002 --- /dev/null +++ b/rbi/lithic/resources/disputes_v2.rbi @@ -0,0 +1,64 @@ +# typed: strong + +module Lithic + module Resources + class DisputesV2 + # Retrieves a specific dispute by its token. + sig do + params( + dispute_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::DisputeV2) + end + def retrieve( + # Token of the dispute to retrieve. + dispute_token, + request_options: {} + ) + end + + # Returns a paginated list of disputes. + sig do + params( + account_token: String, + begin_: Time, + card_token: String, + disputed_transaction_token: String, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Internal::CursorPage[Lithic::DisputeV2]) + end + def list( + # Filter by account token. + account_token: nil, + # RFC 3339 timestamp for filtering by created date, inclusive. + begin_: nil, + # Filter by card token. + card_token: nil, + # Filter by the token of the transaction being disputed. Corresponds with + # transaction_series.related_transaction_token in the Dispute. + disputed_transaction_token: nil, + # RFC 3339 timestamp for filtering by created date, inclusive. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Number of items to return. + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/events.rbi b/rbi/lithic/resources/events.rbi new file mode 100644 index 00000000..e75c3349 --- /dev/null +++ b/rbi/lithic/resources/events.rbi @@ -0,0 +1,98 @@ +# typed: strong + +module Lithic + module Resources + class Events + sig { returns(Lithic::Resources::Events::Subscriptions) } + attr_reader :subscriptions + + sig { returns(Lithic::Resources::Events::EventSubscriptions) } + attr_reader :event_subscriptions + + # Get an event. + sig do + params( + event_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Event) + end + def retrieve(event_token, request_options: {}) + end + + # List all events. + sig do + params( + begin_: Time, + end_: Time, + ending_before: String, + event_types: T::Array[Lithic::EventListParams::EventType::OrSymbol], + page_size: Integer, + starting_after: String, + with_content: T::Boolean, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Internal::CursorPage[Lithic::Event]) + end + def list( + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Event types to filter events by. + event_types: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Whether to include the event payload content in the response. + with_content: nil, + request_options: {} + ) + end + + # List all the message attempts for a given event. + sig do + params( + event_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::EventListAttemptsParams::Status::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Internal::CursorPage[Lithic::MessageAttempt]) + end + def list_attempts( + event_token, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + status: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/events/event_subscriptions.rbi b/rbi/lithic/resources/events/event_subscriptions.rbi new file mode 100644 index 00000000..b1434549 --- /dev/null +++ b/rbi/lithic/resources/events/event_subscriptions.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Lithic + module Resources + class Events + class EventSubscriptions + # Resend an event to an event subscription. + sig do + params( + event_subscription_token: String, + event_token: String, + request_options: Lithic::RequestOptions::OrHash + ).void + end + def resend(event_subscription_token, event_token:, request_options: {}) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lithic/resources/events/subscriptions.rbi b/rbi/lithic/resources/events/subscriptions.rbi new file mode 100644 index 00000000..9678fd8b --- /dev/null +++ b/rbi/lithic/resources/events/subscriptions.rbi @@ -0,0 +1,231 @@ +# typed: strong + +module Lithic + module Resources + class Events + class Subscriptions + # Create a new event subscription. + sig do + params( + url: String, + description: String, + disabled: T::Boolean, + event_types: + T::Array[ + Lithic::Events::SubscriptionCreateParams::EventType::OrSymbol + ], + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::EventSubscription) + end + def create( + # URL to which event webhooks will be sent. URL must be a valid HTTPS address. + url:, + # Event subscription description. + description: nil, + # Whether the event subscription is active (false) or inactive (true). + disabled: nil, + # Indicates types of events that will be sent to this subscription. If left blank, + # all types will be sent. + event_types: nil, + request_options: {} + ) + end + + # Get an event subscription. + sig do + params( + event_subscription_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::EventSubscription) + end + def retrieve(event_subscription_token, request_options: {}) + end + + # Update an event subscription. + sig do + params( + event_subscription_token: String, + url: String, + description: String, + disabled: T::Boolean, + event_types: + T::Array[ + Lithic::Events::SubscriptionUpdateParams::EventType::OrSymbol + ], + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::EventSubscription) + end + def update( + event_subscription_token, + # URL to which event webhooks will be sent. URL must be a valid HTTPS address. + url:, + # Event subscription description. + description: nil, + # Whether the event subscription is active (false) or inactive (true). + disabled: nil, + # Indicates types of events that will be sent to this subscription. If left blank, + # all types will be sent. + event_types: nil, + request_options: {} + ) + end + + # List all the event subscriptions. + sig do + params( + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Internal::CursorPage[Lithic::EventSubscription]) + end + def list( + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + # Delete an event subscription. + sig do + params( + event_subscription_token: String, + request_options: Lithic::RequestOptions::OrHash + ).void + end + def delete(event_subscription_token, request_options: {}) + end + + # List all the message attempts for a given event subscription. + sig do + params( + event_subscription_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: + Lithic::Events::SubscriptionListAttemptsParams::Status::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Internal::CursorPage[Lithic::MessageAttempt]) + end + def list_attempts( + event_subscription_token, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + status: nil, + request_options: {} + ) + end + + # Resend all failed messages since a given time. + sig do + params( + event_subscription_token: String, + begin_: Time, + end_: Time, + request_options: Lithic::RequestOptions::OrHash + ).void + end + def recover( + event_subscription_token, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + request_options: {} + ) + end + + # Replays messages to the endpoint. Only messages that were created after `begin` + # will be sent. Messages that were previously sent to the endpoint are not resent. + # Message will be retried if endpoint responds with a non-2xx status code. See + # [Retry Schedule](https://docs.lithic.com/docs/events-api#retry-schedule) for + # details. + sig do + params( + event_subscription_token: String, + begin_: Time, + end_: Time, + request_options: Lithic::RequestOptions::OrHash + ).void + end + def replay_missing( + event_subscription_token, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + request_options: {} + ) + end + + # Get the secret for an event subscription. + sig do + params( + event_subscription_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::Events::SubscriptionRetrieveSecretResponse) + end + def retrieve_secret(event_subscription_token, request_options: {}) + end + + # Rotate the secret for an event subscription. The previous secret will be valid + # for the next 24 hours. + sig do + params( + event_subscription_token: String, + request_options: Lithic::RequestOptions::OrHash + ).void + end + def rotate_secret(event_subscription_token, request_options: {}) + end + + # Send an example message for event. + sig do + params( + event_subscription_token: String, + event_type: + Lithic::Events::SubscriptionSendSimulatedExampleParams::EventType::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).void + end + def send_simulated_example( + event_subscription_token, + # Event type to send example message for. + event_type: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lithic/resources/external_bank_accounts.rbi b/rbi/lithic/resources/external_bank_accounts.rbi new file mode 100644 index 00000000..ccdcf0cb --- /dev/null +++ b/rbi/lithic/resources/external_bank_accounts.rbi @@ -0,0 +1,197 @@ +# typed: strong + +module Lithic + module Resources + class ExternalBankAccounts + sig { returns(Lithic::Resources::ExternalBankAccounts::MicroDeposits) } + attr_reader :micro_deposits + + # Creates an external bank account within a program or Lithic account. + sig do + params( + body: + T.any( + Lithic::ExternalBankAccountCreateParams::Body::ExternallyVerified::OrHash, + Lithic::ExternalBankAccountCreateParams::Body::Unverified::OrHash, + Lithic::ExternalBankAccountCreateParams::Body::BankVerifiedCreateBankAccountAPIRequest::OrHash + ), + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::ExternalBankAccountCreateResponse) + end + def create(body:, request_options: {}) + end + + # Get the external bank account by token. + sig do + params( + external_bank_account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::ExternalBankAccountRetrieveResponse) + end + def retrieve(external_bank_account_token, request_options: {}) + end + + # Update the external bank account by token. + sig do + params( + external_bank_account_token: String, + address: Lithic::ExternalBankAccountAddress::OrHash, + company_id: String, + dob: Date, + doing_business_as: String, + name: String, + owner: String, + owner_type: Lithic::OwnerType::OrSymbol, + type: Lithic::ExternalBankAccountUpdateParams::Type::OrSymbol, + user_defined_id: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::ExternalBankAccountUpdateResponse) + end + def update( + external_bank_account_token, + # Address + address: nil, + # Optional field that helps identify bank accounts in receipts + company_id: nil, + # Date of Birth of the Individual that owns the external bank account + dob: nil, + # Doing Business As + doing_business_as: nil, + # The nickname for this External Bank Account + name: nil, + # Legal Name of the business or individual who owns the external account. This + # will appear in statements + owner: nil, + # Owner Type + owner_type: nil, + type: nil, + # User Defined ID + user_defined_id: nil, + request_options: {} + ) + end + + # List all the external bank accounts for the provided search criteria. + sig do + params( + account_token: String, + account_types: + T::Array[ + Lithic::ExternalBankAccountListParams::AccountType::OrSymbol + ], + countries: T::Array[String], + ending_before: String, + owner_types: T::Array[Lithic::OwnerType::OrSymbol], + page_size: Integer, + starting_after: String, + states: + T::Array[Lithic::ExternalBankAccountListParams::State::OrSymbol], + verification_states: + T::Array[ + Lithic::ExternalBankAccountListParams::VerificationState::OrSymbol + ], + request_options: Lithic::RequestOptions::OrHash + ).returns( + Lithic::Internal::CursorPage[ + Lithic::Models::ExternalBankAccountListResponse + ] + ) + end + def list( + account_token: nil, + account_types: nil, + countries: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + owner_types: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + states: nil, + verification_states: nil, + request_options: {} + ) + end + + # Pause an external bank account + sig do + params( + external_bank_account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::ExternalBankAccount) + end + def pause(external_bank_account_token, request_options: {}) + end + + # Retry external bank account micro deposit verification. + sig do + params( + external_bank_account_token: String, + financial_account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse) + end + def retry_micro_deposits( + external_bank_account_token, + financial_account_token: nil, + request_options: {} + ) + end + + # Retry external bank account prenote verification. + sig do + params( + external_bank_account_token: String, + financial_account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::ExternalBankAccount) + end + def retry_prenote( + external_bank_account_token, + financial_account_token: nil, + request_options: {} + ) + end + + # Update the verification method for an external bank account. Verification method + # can only be updated if the `verification_state` is `PENDING`. + sig do + params( + external_bank_account_token: String, + verification_method: + Lithic::ExternalBankAccountSetVerificationMethodParams::VerificationMethod::OrSymbol, + financial_account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::ExternalBankAccount) + end + def set_verification_method( + external_bank_account_token, + # The verification method to set for the external bank account + verification_method:, + # The financial account token of the operating account to fund the micro deposits. + # Required when verification_method is MICRO_DEPOSIT or PRENOTE. + financial_account_token: nil, + request_options: {} + ) + end + + # Unpause an external bank account + sig do + params( + external_bank_account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::ExternalBankAccount) + end + def unpause(external_bank_account_token, request_options: {}) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/external_bank_accounts/micro_deposits.rbi b/rbi/lithic/resources/external_bank_accounts/micro_deposits.rbi new file mode 100644 index 00000000..9baafdcd --- /dev/null +++ b/rbi/lithic/resources/external_bank_accounts/micro_deposits.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Lithic + module Resources + class ExternalBankAccounts + class MicroDeposits + # Verify the external bank account by providing the micro deposit amounts. + sig do + params( + external_bank_account_token: String, + micro_deposits: T::Array[Integer], + request_options: Lithic::RequestOptions::OrHash + ).returns( + Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse + ) + end + def create( + external_bank_account_token, + micro_deposits:, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lithic/resources/external_payments.rbi b/rbi/lithic/resources/external_payments.rbi new file mode 100644 index 00000000..65b83005 --- /dev/null +++ b/rbi/lithic/resources/external_payments.rbi @@ -0,0 +1,179 @@ +# typed: strong + +module Lithic + module Resources + class ExternalPayments + # Create external payment + sig do + params( + amount: Integer, + category: Lithic::ExternalPaymentCreateParams::Category::OrSymbol, + effective_date: Date, + financial_account_token: String, + payment_type: + Lithic::ExternalPaymentCreateParams::PaymentType::OrSymbol, + token: String, + memo: String, + progress_to: + Lithic::ExternalPaymentCreateParams::ProgressTo::OrSymbol, + user_defined_id: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::ExternalPayment) + end + def create( + amount:, + category:, + effective_date:, + financial_account_token:, + payment_type:, + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + token: nil, + memo: nil, + progress_to: nil, + user_defined_id: nil, + request_options: {} + ) + end + + # Get external payment + sig do + params( + external_payment_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::ExternalPayment) + end + def retrieve( + # Globally unique identifier for the external payment + external_payment_token, + request_options: {} + ) + end + + # List external payments + sig do + params( + begin_: Time, + business_account_token: String, + category: Lithic::ExternalPaymentListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::ExternalPaymentListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::ExternalPaymentListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Internal::CursorPage[Lithic::ExternalPayment]) + end + def list( + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + business_account_token: nil, + # External Payment category to be returned. + category: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + financial_account_token: nil, + # Page size (for pagination). + page_size: nil, + # External Payment result to be returned. + result: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Book transfer status to be returned. + status: nil, + request_options: {} + ) + end + + # Cancel external payment + sig do + params( + external_payment_token: String, + effective_date: Date, + memo: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::ExternalPayment) + end + def cancel( + # Globally unique identifier for the external payment + external_payment_token, + effective_date:, + memo: nil, + request_options: {} + ) + end + + # Release external payment + sig do + params( + external_payment_token: String, + effective_date: Date, + memo: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::ExternalPayment) + end + def release( + # Globally unique identifier for the external payment + external_payment_token, + effective_date:, + memo: nil, + request_options: {} + ) + end + + # Reverse external payment + sig do + params( + external_payment_token: String, + effective_date: Date, + memo: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::ExternalPayment) + end + def reverse( + # Globally unique identifier for the external payment + external_payment_token, + effective_date:, + memo: nil, + request_options: {} + ) + end + + # Settle external payment + sig do + params( + external_payment_token: String, + effective_date: Date, + memo: String, + progress_to: + Lithic::ExternalPaymentSettleParams::ProgressTo::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::ExternalPayment) + end + def settle( + # Globally unique identifier for the external payment + external_payment_token, + effective_date:, + memo: nil, + progress_to: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/financial_accounts.rbi b/rbi/lithic/resources/financial_accounts.rbi new file mode 100644 index 00000000..bd89fe0a --- /dev/null +++ b/rbi/lithic/resources/financial_accounts.rbi @@ -0,0 +1,149 @@ +# typed: strong + +module Lithic + module Resources + class FinancialAccounts + sig { returns(Lithic::Resources::FinancialAccounts::Balances) } + attr_reader :balances + + sig do + returns(Lithic::Resources::FinancialAccounts::FinancialTransactions) + end + attr_reader :financial_transactions + + sig { returns(Lithic::Resources::FinancialAccounts::CreditConfiguration) } + attr_reader :credit_configuration + + sig { returns(Lithic::Resources::FinancialAccounts::Statements) } + attr_reader :statements + + sig { returns(Lithic::Resources::FinancialAccounts::LoanTapes) } + attr_reader :loan_tapes + + sig do + returns(Lithic::Resources::FinancialAccounts::LoanTapeConfiguration) + end + attr_reader :loan_tape_configuration + + sig do + returns(Lithic::Resources::FinancialAccounts::InterestTierSchedule) + end + attr_reader :interest_tier_schedule + + # Create a new financial account + sig do + params( + nickname: String, + type: Lithic::FinancialAccountCreateParams::Type::OrSymbol, + account_token: String, + is_for_benefit_of: T::Boolean, + idempotency_key: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::FinancialAccount) + end + def create( + # Body param + nickname:, + # Body param + type:, + # Body param + account_token: nil, + # Body param + is_for_benefit_of: nil, + # Header param: Idempotency key for the request + idempotency_key: nil, + request_options: {} + ) + end + + # Get a financial account + sig do + params( + financial_account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::FinancialAccount) + end + def retrieve(financial_account_token, request_options: {}) + end + + # Update a financial account + sig do + params( + financial_account_token: String, + nickname: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::FinancialAccount) + end + def update(financial_account_token, nickname: nil, request_options: {}) + end + + # Retrieve information on your financial accounts including routing and account + # number. + sig do + params( + account_token: String, + business_account_token: String, + type: Lithic::FinancialAccountListParams::Type::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Internal::SinglePage[Lithic::FinancialAccount]) + end + def list( + # List financial accounts for a given account_token or business_account_token + account_token: nil, + # List financial accounts for a given business_account_token + business_account_token: nil, + # List financial accounts of a given type + type: nil, + request_options: {} + ) + end + + # Register account number + sig do + params( + financial_account_token: String, + account_number: String, + request_options: Lithic::RequestOptions::OrHash + ).void + end + def register_account_number( + # Globally unique identifier for financial account. + financial_account_token, + account_number:, + request_options: {} + ) + end + + # Update financial account status + sig do + params( + financial_account_token: String, + status: Lithic::FinancialAccountUpdateStatusParams::Status::OrSymbol, + substatus: + T.nilable( + Lithic::FinancialAccountUpdateStatusParams::Substatus::OrSymbol + ), + user_defined_status: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::FinancialAccount) + end + def update_status( + # Globally unique identifier for financial account. + financial_account_token, + # Status of the financial account + status:, + # Substatus for the financial account + substatus:, + # User-defined status for the financial account + user_defined_status: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/financial_accounts/balances.rbi b/rbi/lithic/resources/financial_accounts/balances.rbi new file mode 100644 index 00000000..64889964 --- /dev/null +++ b/rbi/lithic/resources/financial_accounts/balances.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Lithic + module Resources + class FinancialAccounts + class Balances + # Get the balances for a given financial account. + sig do + params( + financial_account_token: String, + balance_date: Time, + last_transaction_event_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns( + Lithic::Internal::SinglePage[Lithic::FinancialAccountBalance] + ) + end + def list( + # Globally unique identifier for financial account. + financial_account_token, + # UTC date of the balance to retrieve. Defaults to latest available balance + balance_date: nil, + # Balance after a given financial event occured. For example, passing the + # event_token of a $5 CARD_CLEARING financial event will return a balance + # decreased by $5 + last_transaction_event_token: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lithic/resources/financial_accounts/credit_configuration.rbi b/rbi/lithic/resources/financial_accounts/credit_configuration.rbi new file mode 100644 index 00000000..7c487077 --- /dev/null +++ b/rbi/lithic/resources/financial_accounts/credit_configuration.rbi @@ -0,0 +1,55 @@ +# typed: strong + +module Lithic + module Resources + class FinancialAccounts + class CreditConfiguration + # Get an Account's credit configuration + sig do + params( + financial_account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::FinancialAccounts::FinancialAccountCreditConfig) + end + def retrieve( + # Globally unique identifier for financial account. + financial_account_token, + request_options: {} + ) + end + + # Update an account's credit configuration + sig do + params( + financial_account_token: String, + auto_collection_configuration: + Lithic::FinancialAccounts::CreditConfigurationUpdateParams::AutoCollectionConfiguration::OrHash, + credit_limit: Integer, + credit_product_token: String, + external_bank_account_token: String, + tier: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::FinancialAccounts::FinancialAccountCreditConfig) + end + def update( + # Globally unique identifier for financial account. + financial_account_token, + auto_collection_configuration: nil, + credit_limit: nil, + # Globally unique identifier for the credit product + credit_product_token: nil, + external_bank_account_token: nil, + # Tier to assign to a financial account + tier: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lithic/resources/financial_accounts/financial_transactions.rbi b/rbi/lithic/resources/financial_accounts/financial_transactions.rbi new file mode 100644 index 00000000..baf28da2 --- /dev/null +++ b/rbi/lithic/resources/financial_accounts/financial_transactions.rbi @@ -0,0 +1,73 @@ +# typed: strong + +module Lithic + module Resources + class FinancialAccounts + class FinancialTransactions + # Get the financial transaction for the provided token. + sig do + params( + financial_transaction_token: String, + financial_account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::FinancialTransaction) + end + def retrieve( + # Globally unique identifier for financial transaction token. + financial_transaction_token, + # Globally unique identifier for financial account. + financial_account_token:, + request_options: {} + ) + end + + # List the financial transactions for a given financial account. + sig do + params( + financial_account_token: String, + begin_: Time, + category: + Lithic::FinancialAccounts::FinancialTransactionListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + result: + Lithic::FinancialAccounts::FinancialTransactionListParams::Result::OrSymbol, + starting_after: String, + status: + Lithic::FinancialAccounts::FinancialTransactionListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Internal::SinglePage[Lithic::FinancialTransaction]) + end + def list( + # Globally unique identifier for financial account. + financial_account_token, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Financial Transaction category to be returned. + category: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Financial Transaction result to be returned. + result: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Financial Transaction status to be returned. + status: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lithic/resources/financial_accounts/interest_tier_schedule.rbi b/rbi/lithic/resources/financial_accounts/interest_tier_schedule.rbi new file mode 100644 index 00000000..9ab976b7 --- /dev/null +++ b/rbi/lithic/resources/financial_accounts/interest_tier_schedule.rbi @@ -0,0 +1,162 @@ +# typed: strong + +module Lithic + module Resources + class FinancialAccounts + class InterestTierSchedule + # Create a new interest tier schedule entry for a supported financial account + sig do + params( + financial_account_token: String, + credit_product_token: String, + effective_date: Date, + penalty_rates: T.anything, + tier_name: String, + tier_rates: T.anything, + request_options: Lithic::RequestOptions::OrHash + ).returns( + Lithic::FinancialAccounts::FinancialAccountsInterestTierSchedule + ) + end + def create( + # Globally unique identifier for financial account + financial_account_token, + # Globally unique identifier for a credit product + credit_product_token:, + # Date the tier should be effective in YYYY-MM-DD format + effective_date:, + # Custom rates per category for penalties + penalty_rates: nil, + # Name of a tier contained in the credit product. Mutually exclusive with + # tier_rates + tier_name: nil, + # Custom rates per category. Mutually exclusive with tier_name + tier_rates: nil, + request_options: {} + ) + end + + # Get a specific interest tier schedule by effective date + sig do + params( + effective_date: Date, + financial_account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns( + Lithic::FinancialAccounts::FinancialAccountsInterestTierSchedule + ) + end + def retrieve( + # Effective date in ISO format (YYYY-MM-DD) + effective_date, + # Globally unique identifier for financial account + financial_account_token:, + request_options: {} + ) + end + + # Update an existing interest tier schedule + sig do + params( + effective_date: Date, + financial_account_token: String, + penalty_rates: T.anything, + tier_name: String, + tier_rates: T.anything, + request_options: Lithic::RequestOptions::OrHash + ).returns( + Lithic::FinancialAccounts::FinancialAccountsInterestTierSchedule + ) + end + def update( + # Path param: Effective date in ISO format (YYYY-MM-DD) + effective_date, + # Path param: Globally unique identifier for financial account + financial_account_token:, + # Body param: Custom rates per category for penalties + penalty_rates: nil, + # Body param: Name of a tier contained in the credit product. Mutually exclusive + # with tier_rates + tier_name: nil, + # Body param: Custom rates per category. Mutually exclusive with tier_name + tier_rates: nil, + request_options: {} + ) + end + + # List interest tier schedules for a financial account with optional date + # filtering. + # + # If no date parameters are provided, returns all tier schedules. If date + # parameters are provided, uses filtering to return matching schedules (max 100). + # + # - for_date: Returns exact match (takes precedence over other dates) + # - before_date: Returns schedules with effective_date <= before_date + # - after_date: Returns schedules with effective_date >= after_date + # - Both before_date and after_date: Returns schedules in range + sig do + params( + financial_account_token: String, + after_date: Date, + before_date: Date, + for_date: Date, + request_options: Lithic::RequestOptions::OrHash + ).returns( + Lithic::Internal::SinglePage[ + Lithic::FinancialAccounts::FinancialAccountsInterestTierSchedule + ] + ) + end + def list( + # Globally unique identifier for financial account + financial_account_token, + # Return schedules with effective_date >= after_date (ISO format YYYY-MM-DD) + after_date: nil, + # Return schedules with effective_date <= before_date (ISO format YYYY-MM-DD) + before_date: nil, + # Return schedule with effective_date == for_date (ISO format YYYY-MM-DD) + for_date: nil, + request_options: {} + ) + end + + # Delete an interest tier schedule entry. + # + # Returns: + # + # - 400 Bad Request: Invalid effective_date format OR attempting to delete the + # earliest tier schedule entry for a non-PENDING account + # - 404 Not Found: Tier schedule entry not found for the given effective_date OR + # ledger account not found + # + # Note: PENDING accounts can delete the earliest tier schedule entry (account + # hasn't opened yet). Active/non-PENDING accounts cannot delete the earliest entry + # to prevent orphaning the account. + # + # If the deleted tier schedule has a past effective_date and the account is + # ACTIVE, the loan tape rebuild configuration will be updated to trigger rebuilds + # from that date. + sig do + params( + effective_date: Date, + financial_account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).void + end + def delete( + # Effective date in ISO format (YYYY-MM-DD) + effective_date, + # Globally unique identifier for financial account + financial_account_token:, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lithic/resources/financial_accounts/loan_tape_configuration.rbi b/rbi/lithic/resources/financial_accounts/loan_tape_configuration.rbi new file mode 100644 index 00000000..6b32dc17 --- /dev/null +++ b/rbi/lithic/resources/financial_accounts/loan_tape_configuration.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Lithic + module Resources + class FinancialAccounts + class LoanTapeConfiguration + # Get the loan tape configuration for a given financial account. + sig do + params( + financial_account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns( + Lithic::FinancialAccounts::FinancialAccountsLoanTapeConfiguration + ) + end + def retrieve( + # Globally unique identifier for financial account. + financial_account_token, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lithic/resources/financial_accounts/loan_tapes.rbi b/rbi/lithic/resources/financial_accounts/loan_tapes.rbi new file mode 100644 index 00000000..4789de00 --- /dev/null +++ b/rbi/lithic/resources/financial_accounts/loan_tapes.rbi @@ -0,0 +1,66 @@ +# typed: strong + +module Lithic + module Resources + class FinancialAccounts + class LoanTapes + # Get a specific loan tape for a given financial account. + sig do + params( + loan_tape_token: String, + financial_account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::FinancialAccounts::LoanTape) + end + def retrieve( + # Globally unique identifier for loan tape. + loan_tape_token, + # Globally unique identifier for financial account. + financial_account_token:, + request_options: {} + ) + end + + # List the loan tapes for a given financial account. + sig do + params( + financial_account_token: String, + begin_: Date, + end_: Date, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns( + Lithic::Internal::CursorPage[Lithic::FinancialAccounts::LoanTape] + ) + end + def list( + # Globally unique identifier for financial account. + financial_account_token, + # Date string in RFC 3339 format. Only entries created after the specified date + # will be included. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified date + # will be included. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lithic/resources/financial_accounts/statements.rbi b/rbi/lithic/resources/financial_accounts/statements.rbi new file mode 100644 index 00000000..14d7ad39 --- /dev/null +++ b/rbi/lithic/resources/financial_accounts/statements.rbi @@ -0,0 +1,74 @@ +# typed: strong + +module Lithic + module Resources + class FinancialAccounts + class Statements + sig do + returns(Lithic::Resources::FinancialAccounts::Statements::LineItems) + end + attr_reader :line_items + + # Get a specific statement for a given financial account. + sig do + params( + statement_token: String, + financial_account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::FinancialAccounts::Statement) + end + def retrieve( + # Globally unique identifier for statements. + statement_token, + # Globally unique identifier for financial account. + financial_account_token:, + request_options: {} + ) + end + + # List the statements for a given financial account. + sig do + params( + financial_account_token: String, + begin_: Date, + end_: Date, + ending_before: String, + include_initial_statements: T::Boolean, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns( + Lithic::Internal::CursorPage[Lithic::FinancialAccounts::Statement] + ) + end + def list( + # Globally unique identifier for financial account. + financial_account_token, + # Date string in RFC 3339 format. Only entries created after the specified date + # will be included. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified date + # will be included. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Whether to include the initial statement. It is not included by default. + include_initial_statements: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lithic/resources/financial_accounts/statements/line_items.rbi b/rbi/lithic/resources/financial_accounts/statements/line_items.rbi new file mode 100644 index 00000000..825e8ddd --- /dev/null +++ b/rbi/lithic/resources/financial_accounts/statements/line_items.rbi @@ -0,0 +1,49 @@ +# typed: strong + +module Lithic + module Resources + class FinancialAccounts + class Statements + class LineItems + # List the line items for a given statement within a given financial account. + sig do + params( + statement_token: String, + financial_account_token: String, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns( + Lithic::Internal::CursorPage[ + Lithic::FinancialAccounts::Statements::StatementLineItems::Data + ] + ) + end + def list( + # Path param: Globally unique identifier for statements. + statement_token, + # Path param: Globally unique identifier for financial account. + financial_account_token:, + # Query param: A cursor representing an item's token before which a page of + # results should end. Used to retrieve the previous page of results before this + # item. + ending_before: nil, + # Query param: Page size (for pagination). + page_size: nil, + # Query param: A cursor representing an item's token after which a page of results + # should begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end + end +end diff --git a/rbi/lithic/resources/fraud.rbi b/rbi/lithic/resources/fraud.rbi new file mode 100644 index 00000000..cd8d8aea --- /dev/null +++ b/rbi/lithic/resources/fraud.rbi @@ -0,0 +1,15 @@ +# typed: strong + +module Lithic + module Resources + class Fraud + sig { returns(Lithic::Resources::Fraud::Transactions) } + attr_reader :transactions + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/fraud/transactions.rbi b/rbi/lithic/resources/fraud/transactions.rbi new file mode 100644 index 00000000..b526ca26 --- /dev/null +++ b/rbi/lithic/resources/fraud/transactions.rbi @@ -0,0 +1,86 @@ +# typed: strong + +module Lithic + module Resources + class Fraud + class Transactions + # Retrieve a fraud report for a specific transaction identified by its unique + # transaction token. + sig do + params( + transaction_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::Fraud::TransactionRetrieveResponse) + end + def retrieve( + # The token of the transaction that the enhanced data is associated with. + transaction_token, + request_options: {} + ) + end + + # Report fraud for a specific transaction token by providing details such as fraud + # type, fraud status, and any additional comments. + sig do + params( + transaction_token: String, + fraud_status: + Lithic::Fraud::TransactionReportParams::FraudStatus::OrSymbol, + comment: String, + fraud_type: + Lithic::Fraud::TransactionReportParams::FraudType::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::Fraud::TransactionReportResponse) + end + def report( + # The token of the transaction that the enhanced data is associated with. + transaction_token, + # The fraud status of the transaction, string (enum) supporting the following + # values: + # + # - `SUSPECTED_FRAUD`: The transaction is suspected to be fraudulent, but this + # hasn’t been confirmed. + # - `FRAUDULENT`: The transaction is confirmed to be fraudulent. A transaction may + # immediately be moved into this state, or be graduated into this state from the + # `SUSPECTED_FRAUD` state. + # - `NOT_FRAUDULENT`: The transaction is (explicitly) marked as not fraudulent. A + # transaction may immediately be moved into this state, or be graduated into + # this state from the `SUSPECTED_FRAUD` state. + fraud_status:, + # Optional field providing additional information or context about why the + # transaction is considered fraudulent. + comment: nil, + # Specifies the type or category of fraud that the transaction is suspected or + # confirmed to involve, string (enum) supporting the following values: + # + # - `FIRST_PARTY_FRAUD`: First-party fraud occurs when a legitimate account or + # cardholder intentionally misuses financial services for personal gain. This + # includes actions such as disputing legitimate transactions to obtain a refund, + # abusing return policies, or defaulting on credit obligations without intent to + # repay. + # - `ACCOUNT_TAKEOVER`: Account takeover fraud occurs when a fraudster gains + # unauthorized access to an existing account, modifies account settings, and + # carries out fraudulent transactions. + # - `CARD_COMPROMISED`: Card compromised fraud occurs when a fraudster gains + # access to card details without taking over the account, such as through + # physical card theft, cloning, or online data breaches. + # - `IDENTITY_THEFT`: Identity theft fraud occurs when a fraudster uses stolen + # personal information, such as Social Security numbers or addresses, to open + # accounts, apply for loans, or conduct financial transactions in someone's + # name. + # - `CARDHOLDER_MANIPULATION`: This type of fraud occurs when a fraudster + # manipulates or coerces a legitimate cardholder into unauthorized transactions, + # often through social engineering tactics. + fraud_type: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lithic/resources/funding_events.rbi b/rbi/lithic/resources/funding_events.rbi new file mode 100644 index 00000000..8b97aa4e --- /dev/null +++ b/rbi/lithic/resources/funding_events.rbi @@ -0,0 +1,62 @@ +# typed: strong + +module Lithic + module Resources + class FundingEvents + # Get funding event for program by id + sig do + params( + funding_event_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::FundingEvent) + end + def retrieve( + # Globally unique identifier for funding event. + funding_event_token, + request_options: {} + ) + end + + # Get all funding events for program + sig do + params( + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Internal::CursorPage[Lithic::FundingEvent]) + end + def list( + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + # Get funding event details by id + sig do + params( + funding_event_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::FundingEventRetrieveDetailsResponse) + end + def retrieve_details( + # Globally unique identifier for funding event. + funding_event_token, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/holds.rbi b/rbi/lithic/resources/holds.rbi new file mode 100644 index 00000000..5e0d7556 --- /dev/null +++ b/rbi/lithic/resources/holds.rbi @@ -0,0 +1,111 @@ +# typed: strong + +module Lithic + module Resources + class Holds + # Create a hold on a financial account. Holds reserve funds by moving them from + # available to pending balance. They can be resolved via settlement (linked to a + # payment or book transfer), voiding, or expiration. + sig do + params( + financial_account_token: String, + amount: Integer, + token: String, + expiration_datetime: Time, + memo: T.nilable(String), + user_defined_id: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Hold) + end + def create( + # Globally unique identifier for the financial account. + financial_account_token, + # Amount to hold in cents + amount:, + # Customer-provided token for idempotency. Becomes the hold token. + token: nil, + # When the hold should auto-expire + expiration_datetime: nil, + # Reason for the hold + memo: nil, + # User-provided identifier for the hold + user_defined_id: nil, + request_options: {} + ) + end + + # Get hold by token. + sig do + params( + hold_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Hold) + end + def retrieve( + # Globally unique identifier for the hold. + hold_token, + request_options: {} + ) + end + + # List holds for a financial account. + sig do + params( + financial_account_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::HoldListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Internal::CursorPage[Lithic::Hold]) + end + def list( + # Globally unique identifier for the financial account. + financial_account_token, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Hold status to filter by. + status: nil, + request_options: {} + ) + end + + # Void an active hold. This returns the held funds from pending back to available + # balance. Only holds in PENDING status can be voided. + sig do + params( + hold_token: String, + memo: T.nilable(String), + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Hold) + end + def void( + # Globally unique identifier for the hold. + hold_token, + # Reason for voiding the hold + memo: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/internal_transaction.rbi b/rbi/lithic/resources/internal_transaction.rbi new file mode 100644 index 00000000..53f15ac9 --- /dev/null +++ b/rbi/lithic/resources/internal_transaction.rbi @@ -0,0 +1,12 @@ +# typed: strong + +module Lithic + module Resources + class InternalTransaction + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/management_operations.rbi b/rbi/lithic/resources/management_operations.rbi new file mode 100644 index 00000000..528bdc7d --- /dev/null +++ b/rbi/lithic/resources/management_operations.rbi @@ -0,0 +1,127 @@ +# typed: strong + +module Lithic + module Resources + class ManagementOperations + # Create management operation + sig do + params( + amount: Integer, + category: Lithic::ManagementOperationCreateParams::Category::OrSymbol, + direction: + Lithic::ManagementOperationCreateParams::Direction::OrSymbol, + effective_date: Date, + event_type: + Lithic::ManagementOperationCreateParams::EventType::OrSymbol, + financial_account_token: String, + token: String, + memo: String, + on_closed_account: + Lithic::ManagementOperationCreateParams::OnClosedAccount::OrSymbol, + subtype: String, + user_defined_id: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::ManagementOperationTransaction) + end + def create( + amount:, + category:, + direction:, + effective_date:, + event_type:, + financial_account_token:, + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + token: nil, + memo: nil, + # What to do if the financial account is closed when posting an operation + on_closed_account: nil, + subtype: nil, + user_defined_id: nil, + request_options: {} + ) + end + + # Get management operation + sig do + params( + management_operation_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::ManagementOperationTransaction) + end + def retrieve( + # Globally unique identifier for the management operation + management_operation_token, + request_options: {} + ) + end + + # List management operations + sig do + params( + begin_: Time, + business_account_token: String, + category: Lithic::ManagementOperationListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + starting_after: String, + status: Lithic::ManagementOperationListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns( + Lithic::Internal::CursorPage[Lithic::ManagementOperationTransaction] + ) + end + def list( + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + business_account_token: nil, + # Management operation category to be returned. + category: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Globally unique identifier for the financial account. Accepted type dependent on + # the program's use case. + financial_account_token: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Management operation status to be returned. + status: nil, + request_options: {} + ) + end + + # Reverse a management operation + sig do + params( + management_operation_token: String, + effective_date: Date, + memo: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::ManagementOperationTransaction) + end + def reverse( + # Globally unique identifier for the management operation + management_operation_token, + effective_date:, + memo: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/network_programs.rbi b/rbi/lithic/resources/network_programs.rbi new file mode 100644 index 00000000..175ccc14 --- /dev/null +++ b/rbi/lithic/resources/network_programs.rbi @@ -0,0 +1,48 @@ +# typed: strong + +module Lithic + module Resources + class NetworkPrograms + # Get network program. + sig do + params( + network_program_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::NetworkProgram) + end + def retrieve( + # Globally unique identifier for the network program. + network_program_token, + request_options: {} + ) + end + + # List network programs. + sig do + params( + begin_: Time, + end_: Time, + page_size: Integer, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Internal::SinglePage[Lithic::NetworkProgram]) + end + def list( + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # Page size (for pagination). + page_size: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/payments.rbi b/rbi/lithic/resources/payments.rbi new file mode 100644 index 00000000..8e59659a --- /dev/null +++ b/rbi/lithic/resources/payments.rbi @@ -0,0 +1,242 @@ +# typed: strong + +module Lithic + module Resources + class Payments + # Initiates a payment between a financial account and an external bank account. + sig do + params( + amount: Integer, + external_bank_account_token: String, + financial_account_token: String, + method_: Lithic::PaymentCreateParams::Method::OrSymbol, + method_attributes: + Lithic::PaymentCreateParams::MethodAttributes::OrHash, + type: Lithic::PaymentCreateParams::Type::OrSymbol, + token: String, + hold: Lithic::PaymentCreateParams::Hold::OrHash, + memo: String, + user_defined_id: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::PaymentCreateResponse) + end + def create( + amount:, + external_bank_account_token:, + financial_account_token:, + method_:, + method_attributes:, + type:, + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + token: nil, + # Optional hold to settle when this payment is initiated. + hold: nil, + memo: nil, + user_defined_id: nil, + request_options: {} + ) + end + + # Get the payment by token. + sig do + params( + payment_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Payment) + end + def retrieve(payment_token, request_options: {}) + end + + # List all the payments for the provided search criteria. + sig do + params( + account_token: String, + begin_: Time, + business_account_token: String, + category: Lithic::PaymentListParams::Category::OrSymbol, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::PaymentListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::PaymentListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Internal::CursorPage[Lithic::Payment]) + end + def list( + account_token: nil, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + business_account_token: nil, + category: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + financial_account_token: nil, + # Page size (for pagination). + page_size: nil, + result: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + status: nil, + request_options: {} + ) + end + + # Retry an origination which has been returned. + sig do + params( + payment_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::PaymentRetryResponse) + end + def retry_(payment_token, request_options: {}) + end + + # Return an ACH payment with a specified return reason code. Returns must be + # initiated within the time window specified by NACHA rules for each return code + # (typically 2 banking days for most codes, 60 calendar days for unauthorized + # debits). For a complete list of return codes and their meanings, see the + # [ACH Return Reasons documentation](https://docs.lithic.com/docs/ach-overview#ach-return-reasons). + # + # Note: + # + # - This endpoint does not modify the state of the financial account associated + # with the payment. If you would like to change the account state, use the + # [Update financial account status](https://docs.lithic.com/reference/updatefinancialaccountstatus) + # endpoint. + # - By default this endpoint is not enabled for your account. Please contact your + # implementations manager to enable this feature. + sig do + params( + payment_token: String, + financial_account_token: String, + return_reason_code: String, + addenda: T.nilable(String), + date_of_death: T.nilable(Date), + memo: T.nilable(String), + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Payment) + end + def return_( + payment_token, + # Globally unique identifier for the financial account + financial_account_token:, + # ACH return reason code indicating the reason for returning the payment. + # Supported codes include R01-R53 and R80-R85. For a complete list of return codes + # and their meanings, see + # [ACH Return Reasons](https://docs.lithic.com/docs/ach-overview#ach-return-reasons) + return_reason_code:, + # Optional additional information about the return. Limited to 44 characters + addenda: nil, + # Date of death in YYYY-MM-DD format. Required when using return codes **R14** + # (representative payee deceased) or **R15** (beneficiary or account holder + # deceased) + date_of_death: nil, + # Optional memo for the return. Limited to 10 characters + memo: nil, + request_options: {} + ) + end + + # Simulate payment lifecycle event + sig do + params( + payment_token: String, + event_type: Lithic::PaymentSimulateActionParams::EventType::OrSymbol, + date_of_death: Date, + decline_reason: + Lithic::PaymentSimulateActionParams::DeclineReason::OrSymbol, + return_addenda: String, + return_reason_code: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::PaymentSimulateActionResponse) + end + def simulate_action( + payment_token, + # Event Type + event_type:, + # Date of Death for ACH Return + date_of_death: nil, + # Decline reason + decline_reason: nil, + # Return Addenda + return_addenda: nil, + # Return Reason Code + return_reason_code: nil, + request_options: {} + ) + end + + # Simulates a receipt of a Payment. + sig do + params( + token: String, + amount: Integer, + financial_account_token: String, + receipt_type: + Lithic::PaymentSimulateReceiptParams::ReceiptType::OrSymbol, + memo: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::PaymentSimulateReceiptResponse) + end + def simulate_receipt( + # Customer-generated payment token used to uniquely identify the simulated payment + token:, + # Amount + amount:, + # Financial Account Token + financial_account_token:, + # Receipt Type + receipt_type:, + # Memo + memo: nil, + request_options: {} + ) + end + + # Simulates a release of a Payment. + sig do + params( + payment_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::PaymentSimulateReleaseResponse) + end + def simulate_release( + # Payment Token + payment_token:, + request_options: {} + ) + end + + # Simulates a return of a Payment. + sig do + params( + payment_token: String, + return_reason_code: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::PaymentSimulateReturnResponse) + end + def simulate_return( + # Payment Token + payment_token:, + # Return Reason Code + return_reason_code: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/reports.rbi b/rbi/lithic/resources/reports.rbi new file mode 100644 index 00000000..a0bc8a2b --- /dev/null +++ b/rbi/lithic/resources/reports.rbi @@ -0,0 +1,15 @@ +# typed: strong + +module Lithic + module Resources + class Reports + sig { returns(Lithic::Resources::Reports::Settlement) } + attr_reader :settlement + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/reports/settlement.rbi b/rbi/lithic/resources/reports/settlement.rbi new file mode 100644 index 00000000..da1578e5 --- /dev/null +++ b/rbi/lithic/resources/reports/settlement.rbi @@ -0,0 +1,56 @@ +# typed: strong + +module Lithic + module Resources + class Reports + class Settlement + sig { returns(Lithic::Resources::Reports::Settlement::NetworkTotals) } + attr_reader :network_totals + + # List details. + sig do + params( + report_date: Date, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Internal::CursorPage[Lithic::SettlementDetail]) + end + def list_details( + # Date of the settlement report to retrieve. Not available in sandbox. + report_date, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Number of records per page. + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + # Get the settlement report for a specified report date. Not available in sandbox. + sig do + params( + report_date: Date, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::SettlementReport) + end + def summary( + # Date of the settlement report to retrieve. + report_date, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lithic/resources/reports/settlement/network_totals.rbi b/rbi/lithic/resources/reports/settlement/network_totals.rbi new file mode 100644 index 00000000..517f6878 --- /dev/null +++ b/rbi/lithic/resources/reports/settlement/network_totals.rbi @@ -0,0 +1,80 @@ +# typed: strong + +module Lithic + module Resources + class Reports + class Settlement + class NetworkTotals + # Retrieve a specific network total record by token. Not available in sandbox. + sig do + params( + token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::NetworkTotal) + end + def retrieve( + # Token of the network total record to retrieve + token, + request_options: {} + ) + end + + # List network total records with optional filters. Not available in sandbox. + sig do + params( + begin_: Time, + end_: Time, + ending_before: String, + institution_id: String, + network: + Lithic::Reports::Settlement::NetworkTotalListParams::Network::OrSymbol, + page_size: Integer, + report_date: Date, + report_date_begin: Date, + report_date_end: Date, + settlement_institution_id: String, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Internal::CursorPage[Lithic::NetworkTotal]) + end + def list( + # Datetime in RFC 3339 format. Only entries created after the specified time will + # be included. UTC time zone. + begin_: nil, + # Datetime in RFC 3339 format. Only entries created before the specified time will + # be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Institution ID to filter on. + institution_id: nil, + # Network to filter on. + network: nil, + # Number of records per page. + page_size: nil, + # Singular report date to filter on (YYYY-MM-DD). Cannot be populated in + # conjunction with report_date_begin or report_date_end. + report_date: nil, + # Earliest report date to filter on, inclusive (YYYY-MM-DD). + report_date_begin: nil, + # Latest report date to filter on, inclusive (YYYY-MM-DD). + report_date_end: nil, + # Settlement institution ID to filter on. + settlement_institution_id: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end + end +end diff --git a/rbi/lithic/resources/responder_endpoints.rbi b/rbi/lithic/resources/responder_endpoints.rbi new file mode 100644 index 00000000..31e725a6 --- /dev/null +++ b/rbi/lithic/resources/responder_endpoints.rbi @@ -0,0 +1,57 @@ +# typed: strong + +module Lithic + module Resources + class ResponderEndpoints + # Enroll a responder endpoint + sig do + params( + type: Lithic::ResponderEndpointCreateParams::Type::OrSymbol, + url: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::ResponderEndpointCreateResponse) + end + def create( + # The type of the endpoint. + type: nil, + # The URL for the responder endpoint (must be http(s)). + url: nil, + request_options: {} + ) + end + + # Disenroll a responder endpoint + sig do + params( + type: Lithic::ResponderEndpointDeleteParams::Type::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).void + end + def delete( + # The type of the endpoint. + type:, + request_options: {} + ) + end + + # Check the status of a responder endpoint + sig do + params( + type: Lithic::ResponderEndpointCheckStatusParams::Type::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::ResponderEndpointStatus) + end + def check_status( + # The type of the endpoint. + type:, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/three_ds.rbi b/rbi/lithic/resources/three_ds.rbi new file mode 100644 index 00000000..26c25a3f --- /dev/null +++ b/rbi/lithic/resources/three_ds.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Lithic + module Resources + class ThreeDS + sig { returns(Lithic::Resources::ThreeDS::Authentication) } + attr_reader :authentication + + sig { returns(Lithic::Resources::ThreeDS::Decisioning) } + attr_reader :decisioning + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/three_ds/authentication.rbi b/rbi/lithic/resources/three_ds/authentication.rbi new file mode 100644 index 00000000..f33fddd4 --- /dev/null +++ b/rbi/lithic/resources/three_ds/authentication.rbi @@ -0,0 +1,81 @@ +# typed: strong + +module Lithic + module Resources + class ThreeDS + class Authentication + # Get 3DS Authentication by token + sig do + params( + three_ds_authentication_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::ThreeDSAuthentication) + end + def retrieve( + # Globally unique identifier for the 3DS authentication. + three_ds_authentication_token, + request_options: {} + ) + end + + # Simulates a 3DS authentication request from the payment network as if it came + # from an ACS. If you're configured for 3DS Customer Decisioning, simulating + # authentications requires your customer decisioning endpoint to be set up + # properly (respond with a valid JSON). If the authentication decision is to + # challenge, ensure that the account holder associated with the card transaction + # has a valid phone number configured to receive the OTP code via SMS. + sig do + params( + merchant: + Lithic::ThreeDS::AuthenticationSimulateParams::Merchant::OrHash, + pan: String, + transaction: + Lithic::ThreeDS::AuthenticationSimulateParams::Transaction::OrHash, + card_expiry_check: + Lithic::ThreeDS::AuthenticationSimulateParams::CardExpiryCheck::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::ThreeDS::AuthenticationSimulateResponse) + end + def simulate( + # Merchant information for the simulated transaction + merchant:, + # Sixteen digit card number. + pan:, + # Transaction details for the simulation + transaction:, + # When set will use the following values as part of the Simulated Authentication. + # When not set defaults to MATCH + card_expiry_check: nil, + request_options: {} + ) + end + + # Endpoint for simulating entering OTP into 3DS Challenge UI. A call to + # [/v1/three_ds_authentication/simulate](https://docs.lithic.com/reference/postsimulateauthentication) + # that resulted in triggered SMS-OTP challenge must precede. Only a single attempt + # is supported; upon entering OTP, the challenge is either approved or declined. + sig do + params( + token: String, + otp: String, + request_options: Lithic::RequestOptions::OrHash + ).void + end + def simulate_otp_entry( + # A unique token returned as part of a /v1/three_ds_authentication/simulate call + # that resulted in PENDING_CHALLENGE authentication result. + token:, + # The OTP entered by the cardholder + otp:, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lithic/resources/three_ds/decisioning.rbi b/rbi/lithic/resources/three_ds/decisioning.rbi new file mode 100644 index 00000000..b92ad037 --- /dev/null +++ b/rbi/lithic/resources/three_ds/decisioning.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module Lithic + module Resources + class ThreeDS + class Decisioning + # Card program's response to a 3DS Challenge Request. Challenge Request is emitted + # as a webhook + # [three_ds_authentication.challenge](https://docs.lithic.com/reference/post_three-ds-authentication-challenge) + # and your Card Program needs to be configured with Out of Band (OOB) Challenges + # in order to receive it (see https://docs.lithic.com/docs/3ds-challenge-flow for + # more information). + sig do + params( + token: String, + challenge_response: Lithic::ThreeDS::ChallengeResult::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).void + end + def challenge_response( + # Globally unique identifier for 3DS Authentication that resulted in + # PENDING_CHALLENGE authentication result. + token:, + # Whether the Cardholder has approved or declined the issued Challenge + challenge_response:, + request_options: {} + ) + end + + # Retrieve the 3DS Decisioning HMAC secret key. If one does not exist for your + # program yet, calling this endpoint will create one for you. The headers (which + # you can use to verify 3DS Decisioning requests) will begin appearing shortly + # after calling this endpoint for the first time. See + # [this page](https://docs.lithic.com/docs/3ds-decisioning#3ds-decisioning-hmac-secrets) + # for more detail about verifying 3DS Decisioning requests. + sig do + params(request_options: Lithic::RequestOptions::OrHash).returns( + Lithic::Models::ThreeDS::DecisioningRetrieveSecretResponse + ) + end + def retrieve_secret(request_options: {}) + end + + # Generate a new 3DS Decisioning HMAC secret key. The old secret key will be + # deactivated 24 hours after a successful request to this endpoint. Make a + # [`GET /three_ds_decisioning/secret`](https://docs.lithic.com/reference/getthreedsdecisioningsecret) + # request to retrieve the new secret key. + sig { params(request_options: Lithic::RequestOptions::OrHash).void } + def rotate_secret(request_options: {}) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lithic/resources/tokenization_decisioning.rbi b/rbi/lithic/resources/tokenization_decisioning.rbi new file mode 100644 index 00000000..c0c5376b --- /dev/null +++ b/rbi/lithic/resources/tokenization_decisioning.rbi @@ -0,0 +1,37 @@ +# typed: strong + +module Lithic + module Resources + class TokenizationDecisioning + # Retrieve the Tokenization Decisioning secret key. If one does not exist your + # program yet, calling this endpoint will create one for you. The headers of the + # Tokenization Decisioning request will contain a hmac signature which you can use + # to verify requests originate from Lithic. See + # [this page](https://docs.lithic.com/docs/events-api#verifying-webhooks) for more + # detail about verifying Tokenization Decisioning requests. + sig do + params(request_options: Lithic::RequestOptions::OrHash).returns( + Lithic::TokenizationSecret + ) + end + def retrieve_secret(request_options: {}) + end + + # Generate a new Tokenization Decisioning secret key. The old Tokenization + # Decisioning secret key will be deactivated 24 hours after a successful request + # to this endpoint. + sig do + params(request_options: Lithic::RequestOptions::OrHash).returns( + Lithic::Models::TokenizationDecisioningRotateSecretResponse + ) + end + def rotate_secret(request_options: {}) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/tokenizations.rbi b/rbi/lithic/resources/tokenizations.rbi new file mode 100644 index 00000000..12d04ff9 --- /dev/null +++ b/rbi/lithic/resources/tokenizations.rbi @@ -0,0 +1,246 @@ +# typed: strong + +module Lithic + module Resources + class Tokenizations + # Get tokenization + sig do + params( + tokenization_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Tokenization) + end + def retrieve( + # Tokenization token + tokenization_token, + request_options: {} + ) + end + + # List card tokenizations + sig do + params( + account_token: String, + begin_: Date, + card_token: String, + end_: Date, + ending_before: String, + page_size: Integer, + starting_after: String, + tokenization_channel: + Lithic::TokenizationListParams::TokenizationChannel::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Internal::CursorPage[Lithic::Tokenization]) + end + def list( + # Filters for tokenizations associated with a specific account. + account_token: nil, + # Filter for tokenizations created after this date. + begin_: nil, + # Filters for tokenizations associated with a specific card. + card_token: nil, + # Filter for tokenizations created before this date. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Filter for tokenizations by tokenization channel. If this is not specified, only + # DIGITAL_WALLET tokenizations will be returned. + tokenization_channel: nil, + request_options: {} + ) + end + + # This endpoint is used to ask the card network to activate a tokenization. A + # successful response indicates that the request was successfully delivered to the + # card network. When the card network activates the tokenization, the state will + # be updated and a tokenization.updated event will be sent. The endpoint may only + # be used on digital wallet tokenizations with status `INACTIVE`, + # `PENDING_ACTIVATION`, or `PENDING_2FA`. This will put the tokenization in an + # active state, and transactions will be allowed. Reach out at + # [lithic.com/contact](https://lithic.com/contact) for more information. + sig do + params( + tokenization_token: String, + request_options: Lithic::RequestOptions::OrHash + ).void + end + def activate( + # Tokenization token + tokenization_token, + request_options: {} + ) + end + + # This endpoint is used to ask the card network to deactivate a tokenization. A + # successful response indicates that the request was successfully delivered to the + # card network. When the card network deactivates the tokenization, the state will + # be updated and a tokenization.updated event will be sent. Authorizations + # attempted with a deactivated tokenization will be blocked and will not be + # forwarded to Lithic from the network. Deactivating the token is a permanent + # operation. If the target is a digital wallet tokenization, it will be removed + # from its device. Reach out at [lithic.com/contact](https://lithic.com/contact) + # for more information. + sig do + params( + tokenization_token: String, + request_options: Lithic::RequestOptions::OrHash + ).void + end + def deactivate( + # Tokenization token + tokenization_token, + request_options: {} + ) + end + + # This endpoint is used to ask the card network to pause a tokenization. A + # successful response indicates that the request was successfully delivered to the + # card network. When the card network pauses the tokenization, the state will be + # updated and a tokenization.updated event will be sent. The endpoint may only be + # used on tokenizations with status `ACTIVE`. A paused token will prevent + # merchants from sending authorizations, and is a temporary status that can be + # changed. Reach out at [lithic.com/contact](https://lithic.com/contact) for more + # information. + sig do + params( + tokenization_token: String, + request_options: Lithic::RequestOptions::OrHash + ).void + end + def pause( + # Tokenization token + tokenization_token, + request_options: {} + ) + end + + # This endpoint is used to ask the card network to send another activation code to + # a cardholder that has already tried tokenizing a card. A successful response + # indicates that the request was successfully delivered to the card network. The + # endpoint may only be used on Mastercard digital wallet tokenizations with status + # `INACTIVE`, `PENDING_ACTIVATION`, or `PENDING_2FA`. The network will send a new + # activation code to the one of the contact methods provided in the initial + # tokenization flow. If a user fails to enter the code correctly 3 times, the + # contact method will not be eligible for resending the activation code, and the + # cardholder must restart the provision process. Reach out at + # [lithic.com/contact](https://lithic.com/contact) for more information. + sig do + params( + tokenization_token: String, + activation_method_type: + Lithic::TokenizationResendActivationCodeParams::ActivationMethodType::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).void + end + def resend_activation_code( + # Tokenization token + tokenization_token, + # The communication method that the user has selected to use to receive the + # authentication code. Supported Values: Sms = "TEXT_TO_CARDHOLDER_NUMBER". Email + # = "EMAIL_TO_CARDHOLDER_ADDRESS" + activation_method_type: nil, + request_options: {} + ) + end + + # This endpoint is used to simulate a card's tokenization in the Digital Wallet + # and merchant tokenization ecosystem. + sig do + params( + cvv: String, + expiration_date: String, + pan: String, + tokenization_source: + Lithic::TokenizationSimulateParams::TokenizationSource::OrSymbol, + account_score: Integer, + device_score: Integer, + entity: String, + wallet_recommended_decision: + Lithic::TokenizationSimulateParams::WalletRecommendedDecision::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Tokenization) + end + def simulate( + # The three digit cvv for the card. + cvv:, + # The expiration date of the card in 'MM/YY' format. + expiration_date:, + # The sixteen digit card number. + pan:, + # The source of the tokenization request. + tokenization_source:, + # The account score (1-5) that represents how the Digital Wallet's view on how + # reputable an end user's account is. + account_score: nil, + # The device score (1-5) that represents how the Digital Wallet's view on how + # reputable an end user's device is. + device_score: nil, + # Optional field to specify the token requestor name for a merchant token + # simulation. Ignored when tokenization_source is not MERCHANT. + entity: nil, + # The decision that the Digital Wallet's recommend + wallet_recommended_decision: nil, + request_options: {} + ) + end + + # This endpoint is used to ask the card network to unpause a tokenization. A + # successful response indicates that the request was successfully delivered to the + # card network. When the card network unpauses the tokenization, the state will be + # updated and a tokenization.updated event will be sent. The endpoint may only be + # used on tokenizations with status `PAUSED`. This will put the tokenization in an + # active state, and transactions may resume. Reach out at + # [lithic.com/contact](https://lithic.com/contact) for more information. + sig do + params( + tokenization_token: String, + request_options: Lithic::RequestOptions::OrHash + ).void + end + def unpause( + # Tokenization token + tokenization_token, + request_options: {} + ) + end + + # This endpoint is used update the digital card art for a digital wallet + # tokenization. A successful response indicates that the card network has updated + # the tokenization's art, and the tokenization's `digital_cart_art_token` field + # was updated. The endpoint may not be used on tokenizations with status + # `DEACTIVATED`. Note that this updates the art for one specific tokenization, not + # all tokenizations for a card. New tokenizations for a card will be created with + # the art referenced in the card object's `digital_card_art_token` field. Reach + # out at [lithic.com/contact](https://lithic.com/contact) for more information. + sig do + params( + tokenization_token: String, + digital_card_art_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Tokenization) + end + def update_digital_card_art( + # Tokenization token + tokenization_token, + # Specifies the digital card art to be displayed in the user’s digital wallet for + # a tokenization. This artwork must be approved by the network and configured by + # Lithic to use. See + # [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + digital_card_art_token: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/transaction_monitoring.rbi b/rbi/lithic/resources/transaction_monitoring.rbi new file mode 100644 index 00000000..43789396 --- /dev/null +++ b/rbi/lithic/resources/transaction_monitoring.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Lithic + module Resources + class TransactionMonitoring + sig { returns(Lithic::Resources::TransactionMonitoring::Cases) } + attr_reader :cases + + sig { returns(Lithic::Resources::TransactionMonitoring::Queues) } + attr_reader :queues + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/transaction_monitoring/cases.rbi b/rbi/lithic/resources/transaction_monitoring/cases.rbi new file mode 100644 index 00000000..c341531f --- /dev/null +++ b/rbi/lithic/resources/transaction_monitoring/cases.rbi @@ -0,0 +1,230 @@ +# typed: strong + +module Lithic + module Resources + class TransactionMonitoring + class Cases + sig do + returns(Lithic::Resources::TransactionMonitoring::Cases::Comments) + end + attr_reader :comments + + sig { returns(Lithic::Resources::TransactionMonitoring::Cases::Files) } + attr_reader :files + + # Retrieves a single transaction monitoring case. + sig do + params( + case_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::TransactionMonitoring::MonitoringCase) + end + def retrieve( + # Globally unique identifier for the case. + case_token, + request_options: {} + ) + end + + # Updates a transaction monitoring case. + sig do + params( + case_token: String, + actor_token: String, + assignee: T.nilable(String), + priority: Lithic::TransactionMonitoring::CasePriority::OrSymbol, + resolution: + Lithic::TransactionMonitoring::ResolutionOutcome::OrSymbol, + resolution_notes: String, + sla_deadline: T.nilable(Time), + status: Lithic::TransactionMonitoring::CaseStatus::OrSymbol, + tags: T::Hash[Symbol, String], + title: T.nilable(String), + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::TransactionMonitoring::MonitoringCase) + end + def update( + # Globally unique identifier for the case. + case_token, + # Optional client-provided identifier for the actor performing this action, + # recorded on the resulting activity entry. This value is supplied by the client + # (for example, your own internal user ID) and is not authenticated by Lithic + actor_token: nil, + # New assignee for the case, or `null` to unassign + assignee: nil, + # Priority level of a case, controlling queue ordering and SLA urgency + priority: nil, + # Outcome recorded when a case is resolved: + # + # - `CONFIRMED_FRAUD` - The reviewed activity was confirmed to be fraudulent + # - `SUSPICIOUS_ACTIVITY` - The activity is suspicious but not confirmed fraud + # - `FALSE_POSITIVE` - The activity was legitimate and the alert was a false + # positive + # - `NO_ACTION_REQUIRED` - No further action is required + # - `ESCALATED_EXTERNAL` - The case was escalated to an external party + resolution: nil, + # Notes describing the resolution + resolution_notes: nil, + # New SLA deadline for the case, or `null` to clear it + sla_deadline: nil, + # Status of a case as it progresses through the review workflow: + # + # - `OPEN` - The case has been created and is still collecting matching + # transactions + # - `ASSIGNED` - An analyst has been assigned and transaction collection has + # stopped + # - `IN_REVIEW` - The case is actively being investigated + # - `ESCALATED` - The case has been reviewed and requires additional oversight + # - `RESOLVED` - A determination has been made and a resolution recorded + # - `CLOSED` - The case is finalized + status: nil, + # Arbitrary key-value metadata to set on the case + tags: nil, + # New title for the case, or `null` to clear it + title: nil, + request_options: {} + ) + end + + # Lists transaction monitoring cases, optionally filtered. + sig do + params( + account_token: String, + assignee: String, + begin_: Time, + card_token: String, + end_: Time, + ending_before: String, + entity_token: String, + page_size: Integer, + queue_token: String, + rule_token: String, + sort_by: Lithic::TransactionMonitoring::CaseSortOrder::OrSymbol, + starting_after: String, + status: Lithic::TransactionMonitoring::CaseStatus::OrSymbol, + transaction_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns( + Lithic::Internal::CursorPage[ + Lithic::TransactionMonitoring::MonitoringCase + ] + ) + end + def list( + # Only return cases that include transactions on the provided account. + account_token: nil, + # Only return cases assigned to the provided value. Pass an empty string to return + # only unassigned cases. + assignee: nil, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Only return cases that include transactions on the provided card. + card_token: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Only return cases associated with the provided entity. + entity_token: nil, + # Page size (for pagination). + page_size: nil, + # Only return cases belonging to the provided queue. + queue_token: nil, + # Only return cases triggered by the provided transaction monitoring rule. + rule_token: nil, + # Sort order for the returned cases. + sort_by: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Only return cases with the provided status. + status: nil, + # Only return cases that include the provided transaction. + transaction_token: nil, + request_options: {} + ) + end + + # Lists the activity feed for a case. + sig do + params( + case_token: String, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns( + Lithic::Internal::CursorPage[ + Lithic::TransactionMonitoring::CaseActivityEntry + ] + ) + end + def list_activity( + # Globally unique identifier for the case. + case_token, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + # Lists the transactions associated with a case. + sig do + params( + case_token: String, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns( + Lithic::Internal::CursorPage[ + Lithic::TransactionMonitoring::CaseTransaction + ] + ) + end + def list_transactions( + # Globally unique identifier for the case. + case_token, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + # Lists the cards involved in a case, with per-card transaction counts. + sig do + params( + case_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(T::Array[Lithic::TransactionMonitoring::CaseCard]) + end + def retrieve_cards( + # Globally unique identifier for the case. + case_token, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lithic/resources/transaction_monitoring/cases/comments.rbi b/rbi/lithic/resources/transaction_monitoring/cases/comments.rbi new file mode 100644 index 00000000..379e2cf0 --- /dev/null +++ b/rbi/lithic/resources/transaction_monitoring/cases/comments.rbi @@ -0,0 +1,81 @@ +# typed: strong + +module Lithic + module Resources + class TransactionMonitoring + class Cases + class Comments + # Adds a comment to a case. + sig do + params( + case_token: String, + comment: String, + actor_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::TransactionMonitoring::CaseActivityEntry) + end + def create( + # Globally unique identifier for the case. + case_token, + # Text of the comment + comment:, + # Optional client-provided identifier for the actor performing this action, + # recorded on the resulting activity entry. This value is supplied by the client + # (for example, your own internal user ID) and is not authenticated by Lithic + actor_token: nil, + request_options: {} + ) + end + + # Edits an existing comment on a case. + sig do + params( + comment_token: String, + case_token: String, + comment: String, + actor_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::TransactionMonitoring::CaseActivityEntry) + end + def update( + # Path param: Globally unique identifier for the comment. + comment_token, + # Path param: Globally unique identifier for the case. + case_token:, + # Body param: New text of the comment + comment:, + # Body param: Optional client-provided identifier for the actor performing this + # action, recorded on the resulting activity entry. This value is supplied by the + # client (for example, your own internal user ID) and is not authenticated by + # Lithic + actor_token: nil, + request_options: {} + ) + end + + # Deletes a comment from a case. + sig do + params( + comment_token: String, + case_token: String, + request_options: Lithic::RequestOptions::OrHash + ).void + end + def delete( + # Globally unique identifier for the comment. + comment_token, + # Globally unique identifier for the case. + case_token:, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end + end +end diff --git a/rbi/lithic/resources/transaction_monitoring/cases/files.rbi b/rbi/lithic/resources/transaction_monitoring/cases/files.rbi new file mode 100644 index 00000000..682cf42e --- /dev/null +++ b/rbi/lithic/resources/transaction_monitoring/cases/files.rbi @@ -0,0 +1,98 @@ +# typed: strong + +module Lithic + module Resources + class TransactionMonitoring + class Cases + class Files + # Creates a file record and returns a presigned URL for uploading the file to the + # case. + sig do + params( + case_token: String, + name: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::TransactionMonitoring::Cases::CaseFile) + end + def create( + # Globally unique identifier for the case. + case_token, + # Name of the file to upload + name:, + request_options: {} + ) + end + + # Retrieves a single file attached to a case, including a presigned download URL + # when the file is ready. + sig do + params( + file_token: String, + case_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::TransactionMonitoring::Cases::CaseFile) + end + def retrieve( + # Globally unique identifier for the file. + file_token, + # Globally unique identifier for the case. + case_token:, + request_options: {} + ) + end + + # Lists the files attached to a case. + sig do + params( + case_token: String, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns( + Lithic::Internal::CursorPage[ + Lithic::TransactionMonitoring::Cases::CaseFile + ] + ) + end + def list( + # Globally unique identifier for the case. + case_token, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + # Deletes a file from a case. + sig do + params( + file_token: String, + case_token: String, + request_options: Lithic::RequestOptions::OrHash + ).void + end + def delete( + # Globally unique identifier for the file. + file_token, + # Globally unique identifier for the case. + case_token:, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end + end +end diff --git a/rbi/lithic/resources/transaction_monitoring/queues.rbi b/rbi/lithic/resources/transaction_monitoring/queues.rbi new file mode 100644 index 00000000..6a19689c --- /dev/null +++ b/rbi/lithic/resources/transaction_monitoring/queues.rbi @@ -0,0 +1,103 @@ +# typed: strong + +module Lithic + module Resources + class TransactionMonitoring + class Queues + # Creates a new queue for grouping transaction monitoring cases. + sig do + params( + name: String, + description: T.nilable(String), + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::TransactionMonitoring::Queue) + end + def create( + # Human-readable name of the queue + name:, + # Optional description of the queue + description: nil, + request_options: {} + ) + end + + # Retrieves a single transaction monitoring queue. + sig do + params( + queue_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::TransactionMonitoring::Queue) + end + def retrieve( + # Globally unique identifier for the queue. + queue_token, + request_options: {} + ) + end + + # Updates a transaction monitoring queue. + sig do + params( + queue_token: String, + description: T.nilable(String), + name: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::TransactionMonitoring::Queue) + end + def update( + # Globally unique identifier for the queue. + queue_token, + # New description for the queue, or `null` to clear it + description: nil, + # New name for the queue + name: nil, + request_options: {} + ) + end + + # Lists transaction monitoring queues. + sig do + params( + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions::OrHash + ).returns( + Lithic::Internal::CursorPage[Lithic::TransactionMonitoring::Queue] + ) + end + def list( + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + request_options: {} + ) + end + + # Deletes a transaction monitoring queue. + sig do + params( + queue_token: String, + request_options: Lithic::RequestOptions::OrHash + ).void + end + def delete( + # Globally unique identifier for the queue. + queue_token, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lithic/resources/transactions.rbi b/rbi/lithic/resources/transactions.rbi new file mode 100644 index 00000000..958a1edf --- /dev/null +++ b/rbi/lithic/resources/transactions.rbi @@ -0,0 +1,353 @@ +# typed: strong + +module Lithic + module Resources + class Transactions + sig { returns(Lithic::Resources::Transactions::EnhancedCommercialData) } + attr_reader :enhanced_commercial_data + + sig { returns(Lithic::Resources::Transactions::Events) } + attr_reader :events + + # Get a specific card transaction. All amounts are in the smallest unit of their + # respective currency (e.g., cents for USD). + sig do + params( + transaction_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Transaction) + end + def retrieve( + # Globally unique identifier for the transaction. + transaction_token, + request_options: {} + ) + end + + # List card transactions. All amounts are in the smallest unit of their respective + # currency (e.g., cents for USD) and inclusive of any acquirer fees. + sig do + params( + account_token: String, + begin_: Time, + card_token: String, + end_: Time, + ending_before: String, + page_size: Integer, + result: Lithic::TransactionListParams::Result::OrSymbol, + starting_after: String, + status: Lithic::TransactionListParams::Status::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Internal::CursorPage[Lithic::Transaction]) + end + def list( + # Filters for transactions associated with a specific account. + account_token: nil, + # Date string in RFC 3339 format. Only entries created after the specified time + # will be included. UTC time zone. + begin_: nil, + # Filters for transactions associated with a specific card. + card_token: nil, + # Date string in RFC 3339 format. Only entries created before the specified time + # will be included. UTC time zone. + end_: nil, + # A cursor representing an item's token before which a page of results should end. + # Used to retrieve the previous page of results before this item. + ending_before: nil, + # Page size (for pagination). + page_size: nil, + # Filters for transactions using transaction result field. Can filter by + # `APPROVED`, and `DECLINED`. + result: nil, + # A cursor representing an item's token after which a page of results should + # begin. Used to retrieve the next page of results after this item. + starting_after: nil, + # Filters for transactions using transaction status field. + status: nil, + request_options: {} + ) + end + + # Expire authorization + sig do + params( + transaction_token: String, + request_options: Lithic::RequestOptions::OrHash + ).void + end + def expire_authorization( + # The token of the transaction to expire. + transaction_token, + request_options: {} + ) + end + + # Route a card transaction to a financial account. Only available for select use + # cases and programs. + sig do + params( + transaction_token: String, + financial_account_token: String, + request_options: Lithic::RequestOptions::OrHash + ).void + end + def route( + # The token of the transaction to route. + transaction_token, + # The token of the financial account to route the transaction to. + financial_account_token:, + request_options: {} + ) + end + + # Simulates an authorization request from the card network as if it came from a + # merchant acquirer. If you are configured for ASA, simulating authorizations + # requires your ASA client to be set up properly, i.e. be able to respond to the + # ASA request with a valid JSON. For users that are not configured for ASA, a + # daily transaction limit of $5000 USD is applied by default. You can update this + # limit via the + # [update account](https://docs.lithic.com/reference/patchaccountbytoken) + # endpoint. + sig do + params( + amount: Integer, + descriptor: String, + pan: String, + mcc: String, + merchant_acceptor_city: String, + merchant_acceptor_country: String, + merchant_acceptor_id: String, + merchant_acceptor_state: String, + merchant_amount: Integer, + merchant_currency: String, + partial_approval_capable: T::Boolean, + pin: String, + status: + Lithic::TransactionSimulateAuthorizationParams::Status::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::TransactionSimulateAuthorizationResponse) + end + def simulate_authorization( + # Amount (in cents) to authorize. For credit authorizations and financial credit + # authorizations, any value entered will be converted into a negative amount in + # the simulated transaction. For example, entering 100 in this field will result + # in a -100 amount in the transaction. For balance inquiries, this field must be + # set to 0. + amount:, + # Merchant descriptor. + descriptor:, + # Sixteen digit card number. + pan:, + # Merchant category code for the transaction to be simulated. A four-digit number + # listed in ISO 18245. Supported merchant category codes can be found + # [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs). + mcc: nil, + # Merchant acceptor city + merchant_acceptor_city: nil, + # Merchant acceptor country code (ISO 3166-1 alpha-3) + merchant_acceptor_country: nil, + # Unique identifier to identify the payment card acceptor. + merchant_acceptor_id: nil, + # Merchant acceptor state/province (ISO 3166-2 subdivision code) + merchant_acceptor_state: nil, + # Amount of the transaction to be simulated in currency specified in + # merchant_currency, including any acquirer fees. + merchant_amount: nil, + # 3-character alphabetic ISO 4217 currency code. Note: Simulator only accepts USD, + # GBP, EUR and defaults to GBP if another ISO 4217 code is provided + merchant_currency: nil, + # Set to true if the terminal is capable of partial approval otherwise false. + # Partial approval is when part of a transaction is approved and another payment + # must be used for the remainder. + partial_approval_capable: nil, + # Simulate entering a PIN. If omitted, PIN check will not be performed. + pin: nil, + # Type of event to simulate. + # + # - `AUTHORIZATION` is a dual message purchase authorization, meaning a subsequent + # clearing step is required to settle the transaction. + # - `BALANCE_INQUIRY` is a $0 authorization requesting the balance held on the + # card, and is most often observed when a cardholder requests to view a card's + # balance at an ATM. + # - `CREDIT_AUTHORIZATION` is a dual message request from a merchant to authorize + # a refund, meaning a subsequent clearing step is required to settle the + # transaction. + # - `FINANCIAL_AUTHORIZATION` is a single message request from a merchant to debit + # funds immediately (such as an ATM withdrawal), and no subsequent clearing is + # required to settle the transaction. + # - `FINANCIAL_CREDIT_AUTHORIZATION` is a single message request from a merchant + # to credit funds immediately, and no subsequent clearing is required to settle + # the transaction. + status: nil, + request_options: {} + ) + end + + # Simulates an authorization advice from the card network as if it came from a + # merchant acquirer. An authorization advice changes the pending amount of the + # transaction. + sig do + params( + token: String, + amount: Integer, + request_options: Lithic::RequestOptions::OrHash + ).returns( + Lithic::Models::TransactionSimulateAuthorizationAdviceResponse + ) + end + def simulate_authorization_advice( + # The transaction token returned from the /v1/simulate/authorize. response. + token:, + # Amount (in cents) to authorize. This amount will override the transaction's + # amount that was originally set by /v1/simulate/authorize. + amount:, + request_options: {} + ) + end + + # Clears an existing authorization, either debit or credit. After this event, the + # transaction transitions from `PENDING` to `SETTLED` status. + # + # If `amount` is not set, the full amount of the transaction will be cleared. + # Transactions that have already cleared, either partially or fully, cannot be + # cleared again using this endpoint. + sig do + params( + token: String, + amount: Integer, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::TransactionSimulateClearingResponse) + end + def simulate_clearing( + # The transaction token returned from the /v1/simulate/authorize response. + token:, + # Amount (in cents) to clear. Typically this will match the amount in the original + # authorization, but can be higher or lower. The sign of this amount will + # automatically match the sign of the original authorization's amount. For + # example, entering 100 in this field will result in a -100 amount in the + # transaction, if the original authorization is a credit authorization. + # + # If `amount` is not set, the full amount of the transaction will be cleared. + # Transactions that have already cleared, either partially or fully, cannot be + # cleared again using this endpoint. + amount: nil, + request_options: {} + ) + end + + # Simulates a credit authorization advice from the card network. This message + # indicates that the network approved a credit authorization on your behalf. + sig do + params( + amount: Integer, + descriptor: String, + pan: String, + mcc: String, + merchant_acceptor_city: String, + merchant_acceptor_country: String, + merchant_acceptor_id: String, + merchant_acceptor_state: String, + request_options: Lithic::RequestOptions::OrHash + ).returns( + Lithic::Models::TransactionSimulateCreditAuthorizationAdviceResponse + ) + end + def simulate_credit_authorization_advice( + # Amount (in cents). Any value entered will be converted into a negative amount in + # the simulated transaction. For example, entering 100 in this field will appear + # as a -100 amount in the transaction. + amount:, + # Merchant descriptor. + descriptor:, + # Sixteen digit card number. + pan:, + # Merchant category code for the transaction to be simulated. A four-digit number + # listed in ISO 18245. Supported merchant category codes can be found + # [here](https://docs.lithic.com/docs/transactions#merchant-category-codes-mccs). + mcc: nil, + # Merchant acceptor city + merchant_acceptor_city: nil, + # Merchant acceptor country code (ISO 3166-1 alpha-3) + merchant_acceptor_country: nil, + # Unique identifier to identify the payment card acceptor. + merchant_acceptor_id: nil, + # Merchant acceptor state/province (ISO 3166-2 subdivision code) + merchant_acceptor_state: nil, + request_options: {} + ) + end + + # Returns, or refunds, an amount back to a card. Returns simulated via this + # endpoint clear immediately, without prior authorization, and result in a + # `SETTLED` transaction status. + sig do + params( + amount: Integer, + descriptor: String, + pan: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::TransactionSimulateReturnResponse) + end + def simulate_return( + # Amount (in cents) to authorize. + amount:, + # Merchant descriptor. + descriptor:, + # Sixteen digit card number. + pan:, + request_options: {} + ) + end + + # Reverses a return, i.e. a credit transaction with a `SETTLED` status. Returns + # can be financial credit authorizations, or credit authorizations that have + # cleared. + sig do + params( + token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::TransactionSimulateReturnReversalResponse) + end + def simulate_return_reversal( + # The transaction token returned from the /v1/simulate/authorize response. + token:, + request_options: {} + ) + end + + # Voids a pending authorization. If `amount` is not set, the full amount will be + # voided. Can be used on partially voided transactions but not partially cleared + # transactions. _Simulating an authorization expiry on credit authorizations or + # credit authorization advice is not currently supported but will be added soon._ + sig do + params( + token: String, + amount: Integer, + type: Lithic::TransactionSimulateVoidParams::Type::OrSymbol, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Models::TransactionSimulateVoidResponse) + end + def simulate_void( + # The transaction token returned from the /v1/simulate/authorize response. + token:, + # Amount (in cents) to void. Typically this will match the amount in the original + # authorization, but can be less. Applies to authorization reversals only. An + # authorization expiry will always apply to the full pending amount. + amount: nil, + # Type of event to simulate. Defaults to `AUTHORIZATION_REVERSAL`. + # + # - `AUTHORIZATION_EXPIRY` indicates authorization has expired and been reversed + # by Lithic. + # - `AUTHORIZATION_REVERSAL` indicates authorization was reversed by the merchant. + type: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/transactions/enhanced_commercial_data.rbi b/rbi/lithic/resources/transactions/enhanced_commercial_data.rbi new file mode 100644 index 00000000..c4c7664c --- /dev/null +++ b/rbi/lithic/resources/transactions/enhanced_commercial_data.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Lithic + module Resources + class Transactions + class EnhancedCommercialData + # Get all L2/L3 enhanced commercial data associated with a transaction. Not + # available in sandbox. + sig do + params( + transaction_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns( + Lithic::Models::Transactions::EnhancedCommercialDataRetrieveResponse + ) + end + def retrieve( + # The token of the transaction that the enhanced data is associated with. + transaction_token, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lithic/resources/transactions/events.rbi b/rbi/lithic/resources/transactions/events.rbi new file mode 100644 index 00000000..a777eade --- /dev/null +++ b/rbi/lithic/resources/transactions/events.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module Lithic + module Resources + class Transactions + class Events + sig do + returns( + Lithic::Resources::Transactions::Events::EnhancedCommercialData + ) + end + attr_reader :enhanced_commercial_data + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/lithic/resources/transactions/events/enhanced_commercial_data.rbi b/rbi/lithic/resources/transactions/events/enhanced_commercial_data.rbi new file mode 100644 index 00000000..9ce84b87 --- /dev/null +++ b/rbi/lithic/resources/transactions/events/enhanced_commercial_data.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Lithic + module Resources + class Transactions + class Events + class EnhancedCommercialData + # Get L2/L3 enhanced commercial data associated with a transaction event. Not + # available in sandbox. + sig do + params( + event_token: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Transactions::Events::EnhancedData) + end + def retrieve( + # The token of the transaction event that the enhanced data is associated with. + event_token, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end + end +end diff --git a/rbi/lithic/resources/transfer_limits.rbi b/rbi/lithic/resources/transfer_limits.rbi new file mode 100644 index 00000000..1cc8e669 --- /dev/null +++ b/rbi/lithic/resources/transfer_limits.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Lithic + module Resources + class TransferLimits + # Get transfer limits for a specified date + sig do + params( + date: Date, + request_options: Lithic::RequestOptions::OrHash + ).returns( + Lithic::Internal::SinglePage[Lithic::TransferLimitsResponse::Data] + ) + end + def list( + # Date for which to retrieve transfer limits (ISO 8601 format) + date: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/transfers.rbi b/rbi/lithic/resources/transfers.rbi new file mode 100644 index 00000000..cd90fe14 --- /dev/null +++ b/rbi/lithic/resources/transfers.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Lithic + module Resources + class Transfers + # Transfer funds between two financial accounts or between a financial account and + # card + sig do + params( + amount: Integer, + from: String, + to: String, + token: String, + memo: String, + request_options: Lithic::RequestOptions::OrHash + ).returns(Lithic::Transfer) + end + def create( + # Amount to be transferred in the currency’s smallest unit (e.g., cents for USD). + # This should always be a positive value. + amount:, + # Globally unique identifier for the financial account or card that will send the + # funds. Accepted type dependent on the program's use case. + from:, + # Globally unique identifier for the financial account or card that will receive + # the funds. Accepted type dependent on the program's use case. + to:, + # Customer-provided token that will serve as an idempotency token. This token will + # become the transaction token. + token: nil, + # Optional descriptor for the transfer. + memo: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/resources/webhooks.rbi b/rbi/lithic/resources/webhooks.rbi new file mode 100644 index 00000000..5b3050aa --- /dev/null +++ b/rbi/lithic/resources/webhooks.rbi @@ -0,0 +1,91 @@ +# typed: strong + +module Lithic + module Resources + class Webhooks + sig do + params( + payload: String, + headers: T::Hash[String, String], + key: T.nilable(String) + ).returns( + T.any( + Lithic::AccountHolderCreatedWebhookEvent, + Lithic::ParsedWebhookEvent::KYBPayload, + Lithic::ParsedWebhookEvent::KYCPayload, + Lithic::ParsedWebhookEvent::LegacyPayload, + Lithic::AccountHolderVerificationWebhookEvent, + Lithic::AccountHolderDocumentUpdatedWebhookEvent, + Lithic::CardAuthorizationApprovalRequestWebhookEvent, + Lithic::CardAuthorizationChallengeWebhookEvent, + Lithic::CardAuthorizationChallengeResponseWebhookEvent, + Lithic::AuthRulesBacktestReportCreatedWebhookEvent, + Lithic::BalanceUpdatedWebhookEvent, + Lithic::BookTransferTransactionCreatedWebhookEvent, + Lithic::BookTransferTransactionUpdatedWebhookEvent, + Lithic::CardCreatedWebhookEvent, + Lithic::CardConvertedWebhookEvent, + Lithic::CardRenewedWebhookEvent, + Lithic::CardReissuedWebhookEvent, + Lithic::CardShippedWebhookEvent, + Lithic::CardUpdatedWebhookEvent, + Lithic::CardTransactionUpdatedWebhookEvent, + Lithic::CardTransactionEnhancedDataCreatedWebhookEvent, + Lithic::CardTransactionEnhancedDataUpdatedWebhookEvent, + Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent, + Lithic::DigitalWalletTokenizationResultWebhookEvent, + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent, + Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent, + Lithic::DigitalWalletTokenizationUpdatedWebhookEvent, + Lithic::DisputeUpdatedWebhookEvent, + Lithic::DisputeEvidenceUploadFailedWebhookEvent, + Lithic::ExternalBankAccountCreatedWebhookEvent, + Lithic::ExternalBankAccountUpdatedWebhookEvent, + Lithic::ExternalPaymentCreatedWebhookEvent, + Lithic::ExternalPaymentUpdatedWebhookEvent, + Lithic::FinancialAccountCreatedWebhookEvent, + Lithic::FinancialAccountUpdatedWebhookEvent, + Lithic::FundingEventCreatedWebhookEvent, + Lithic::LoanTapeCreatedWebhookEvent, + Lithic::LoanTapeUpdatedWebhookEvent, + Lithic::ManagementOperationCreatedWebhookEvent, + Lithic::ManagementOperationUpdatedWebhookEvent, + Lithic::InternalTransactionCreatedWebhookEvent, + Lithic::InternalTransactionUpdatedWebhookEvent, + Lithic::NetworkTotalCreatedWebhookEvent, + Lithic::NetworkTotalUpdatedWebhookEvent, + Lithic::PaymentTransactionCreatedWebhookEvent, + Lithic::PaymentTransactionUpdatedWebhookEvent, + Lithic::SettlementReportUpdatedWebhookEvent, + Lithic::StatementsCreatedWebhookEvent, + Lithic::ThreeDSAuthenticationCreatedWebhookEvent, + Lithic::ThreeDSAuthenticationUpdatedWebhookEvent, + Lithic::ThreeDSAuthenticationChallengeWebhookEvent, + Lithic::TokenizationApprovalRequestWebhookEvent, + Lithic::TokenizationResultWebhookEvent, + Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent, + Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent, + Lithic::TokenizationUpdatedWebhookEvent, + Lithic::ThreeDSAuthenticationApprovalRequestWebhookEvent, + Lithic::DisputeTransactionCreatedWebhookEvent, + Lithic::DisputeTransactionUpdatedWebhookEvent + ) + ) + end + def parsed( + # The raw webhook payload as a string + payload, + # The raw HTTP headers that came with the payload + headers:, + # The webhook signing key + key: @client.webhook_secret + ) + end + + # @api private + sig { params(client: Lithic::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/lithic/version.rbi b/rbi/lithic/version.rbi new file mode 100644 index 00000000..40f3f268 --- /dev/null +++ b/rbi/lithic/version.rbi @@ -0,0 +1,5 @@ +# typed: strong + +module Lithic + VERSION = T.let(T.unsafe(nil), String) +end diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000..75c095c0 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,70 @@ +{ + "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/lithic/version.rb", + "extra-files": [ + { + "type": "ruby-readme", + "path": "README.md" + } + ] +} \ No newline at end of file diff --git a/scripts/bootstrap b/scripts/bootstrap new file mode 100755 index 00000000..a5e1b80a --- /dev/null +++ b/scripts/bootstrap @@ -0,0 +1,24 @@ +#!/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 new file mode 100755 index 00000000..6d5973fb --- /dev/null +++ b/scripts/fast-format @@ -0,0 +1,18 @@ +#!/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 new file mode 100755 index 00000000..177d1e63 --- /dev/null +++ b/scripts/format @@ -0,0 +1,9 @@ +#!/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 new file mode 100755 index 00000000..08b0dbeb --- /dev/null +++ b/scripts/lint @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -e + +cd -- "$(dirname -- "$0")/.." + +echo "==> Running linters" + +exec -- bundle exec rake lint "$@" diff --git a/scripts/mock b/scripts/mock new file mode 100755 index 00000000..bcf3b392 --- /dev/null +++ b/scripts/mock @@ -0,0 +1,52 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +if [[ -n "$1" && "$1" != '--'* ]]; then + URL="$1" + shift +else + URL="$(grep 'openapi_spec_url' .stats.yml | cut -d' ' -f2)" +fi + +# Check if the URL is empty +if [ -z "$URL" ]; then + echo "Error: No OpenAPI spec path/url provided or found in .stats.yml" + exit 1 +fi + +echo "==> Starting mock server with URL ${URL}" + +# Run prism mock on the given spec +if [ "$1" == "--daemon" ]; then + # Pre-install the package so the download doesn't eat into the startup timeout + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism --version + + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & + + # Wait for server to come online (max 30s) + echo -n "Waiting for server" + attempts=0 + while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do + attempts=$((attempts + 1)) + if [ "$attempts" -ge 300 ]; then + echo + echo "Timed out waiting for Prism server to start" + cat .prism.log + exit 1 + fi + echo -n "." + sleep 0.1 + done + + if grep -q "✖ fatal" ".prism.log"; then + cat .prism.log + exit 1 + fi + + echo +else + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" +fi diff --git a/scripts/test b/scripts/test new file mode 100755 index 00000000..e0dc1374 --- /dev/null +++ b/scripts/test @@ -0,0 +1,56 @@ +#!/usr/bin/env bash + +set -e + +cd -- "$(dirname -- "$0")/.." + +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +NC='\033[0m' # No Color + +function prism_is_running() { + curl --silent "http://localhost:4010" >/dev/null 2>&1 +} + +kill_server_on_port() { + pids=$(lsof -t -i tcp:"$1" || echo "") + if [ "$pids" != "" ]; then + kill "$pids" + echo "Stopped $pids." + fi +} + +function is_overriding_api_base_url() { + [ -n "$TEST_API_BASE_URL" ] +} + +if ! is_overriding_api_base_url && ! prism_is_running ; then + # When we exit this script, make sure to kill the background mock server process + trap 'kill_server_on_port 4010' EXIT + + # Start the dev server + ./scripts/mock --daemon +fi + +if is_overriding_api_base_url ; then + echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" + echo +elif ! prism_is_running ; then + echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" + echo -e "running against your OpenAPI spec." + echo + echo -e "To run the server, pass in the path or url of your OpenAPI" + echo -e "spec to the prism command:" + echo + echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" + echo + + exit 1 +else + echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" + echo +fi + +echo "==> Running tests" +bundle exec rake test "$@" diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh new file mode 100755 index 00000000..05150a1e --- /dev/null +++ b/scripts/utils/upload-artifact.sh @@ -0,0 +1,113 @@ +#!/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 lithic && bundle add lithic --source 'https://pkg.stainless.com/s/lithic-ruby/$SHA'\033[0m" diff --git a/sig/lithic/client.rbs b/sig/lithic/client.rbs new file mode 100644 index 00000000..c419da07 --- /dev/null +++ b/sig/lithic/client.rbs @@ -0,0 +1,109 @@ +module Lithic + class Client < Lithic::Internal::Transport::BaseClient + DEFAULT_MAX_RETRIES: 2 + + DEFAULT_TIMEOUT_IN_SECONDS: Float + + DEFAULT_INITIAL_RETRY_DELAY: Float + + DEFAULT_MAX_RETRY_DELAY: Float + + ENVIRONMENTS: { + production: "https://api.lithic.com", + sandbox: "https://sandbox.lithic.com" + } + + attr_reader api_key: String + + attr_reader webhook_secret: String? + + attr_reader accounts: Lithic::Resources::Accounts + + attr_reader account_holders: Lithic::Resources::AccountHolders + + attr_reader auth_rules: Lithic::Resources::AuthRules + + attr_reader transaction_monitoring: Lithic::Resources::TransactionMonitoring + + attr_reader auth_stream_enrollment: Lithic::Resources::AuthStreamEnrollment + + attr_reader tokenization_decisioning: Lithic::Resources::TokenizationDecisioning + + attr_reader tokenizations: Lithic::Resources::Tokenizations + + attr_reader cards: Lithic::Resources::Cards + + attr_reader card_authorizations: Lithic::Resources::CardAuthorizations + + attr_reader card_bulk_orders: Lithic::Resources::CardBulkOrders + + attr_reader balances: Lithic::Resources::Balances + + attr_reader disputes: Lithic::Resources::Disputes + + attr_reader disputes_v2: Lithic::Resources::DisputesV2 + + attr_reader events: Lithic::Resources::Events + + attr_reader transfers: Lithic::Resources::Transfers + + attr_reader financial_accounts: Lithic::Resources::FinancialAccounts + + attr_reader transactions: Lithic::Resources::Transactions + + attr_reader responder_endpoints: Lithic::Resources::ResponderEndpoints + + attr_reader external_bank_accounts: Lithic::Resources::ExternalBankAccounts + + attr_reader payments: Lithic::Resources::Payments + + attr_reader three_ds: Lithic::Resources::ThreeDS + + attr_reader reports: Lithic::Resources::Reports + + attr_reader card_programs: Lithic::Resources::CardPrograms + + attr_reader digital_card_art: Lithic::Resources::DigitalCardArt + + attr_reader book_transfers: Lithic::Resources::BookTransfers + + attr_reader credit_products: Lithic::Resources::CreditProducts + + attr_reader external_payments: Lithic::Resources::ExternalPayments + + attr_reader management_operations: Lithic::Resources::ManagementOperations + + attr_reader internal_transaction: Lithic::Resources::InternalTransaction + + attr_reader funding_events: Lithic::Resources::FundingEvents + + attr_reader fraud: Lithic::Resources::Fraud + + attr_reader network_programs: Lithic::Resources::NetworkPrograms + + attr_reader holds: Lithic::Resources::Holds + + attr_reader account_activity: Lithic::Resources::AccountActivity + + attr_reader transfer_limits: Lithic::Resources::TransferLimits + + attr_reader webhooks: Lithic::Resources::Webhooks + + def api_status: ( + ?request_options: Lithic::request_opts + ) -> Lithic::APIStatus + + private def auth_headers: -> ::Hash[String, String] + + def initialize: ( + ?api_key: String?, + ?webhook_secret: String?, + ?environment: :production | :sandbox | nil, + ?base_url: String?, + ?max_retries: Integer, + ?timeout: Float, + ?initial_retry_delay: Float, + ?max_retry_delay: Float + ) -> void + end +end diff --git a/sig/lithic/errors.rbs b/sig/lithic/errors.rbs new file mode 100644 index 00000000..acf818cf --- /dev/null +++ b/sig/lithic/errors.rbs @@ -0,0 +1,117 @@ +module Lithic + module Errors + class Error < StandardError + attr_accessor cause: StandardError? + end + + class ConversionError < Lithic::Errors::Error + def cause: -> StandardError? + + def initialize: ( + on: Class, + method: Symbol, + target: top, + value: top, + ?cause: StandardError? + ) -> void + end + + class APIError < Lithic::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 < Lithic::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 < Lithic::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 < Lithic::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 < Lithic::Errors::APIStatusError + HTTP_STATUS: 400 + end + + class AuthenticationError < Lithic::Errors::APIStatusError + HTTP_STATUS: 401 + end + + class PermissionDeniedError < Lithic::Errors::APIStatusError + HTTP_STATUS: 403 + end + + class NotFoundError < Lithic::Errors::APIStatusError + HTTP_STATUS: 404 + end + + class ConflictError < Lithic::Errors::APIStatusError + HTTP_STATUS: 409 + end + + class UnprocessableEntityError < Lithic::Errors::APIStatusError + HTTP_STATUS: 422 + end + + class RateLimitError < Lithic::Errors::APIStatusError + HTTP_STATUS: 429 + end + + class InternalServerError < Lithic::Errors::APIStatusError + HTTP_STATUS: Range[Integer] + end + end +end diff --git a/sig/lithic/file_part.rbs b/sig/lithic/file_part.rbs new file mode 100644 index 00000000..fcee8355 --- /dev/null +++ b/sig/lithic/file_part.rbs @@ -0,0 +1,21 @@ +module Lithic + 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/lithic/internal.rbs b/sig/lithic/internal.rbs new file mode 100644 index 00000000..15474c01 --- /dev/null +++ b/sig/lithic/internal.rbs @@ -0,0 +1,9 @@ +module Lithic + module Internal + extend Lithic::Internal::Util::SorbetRuntimeSupport + + type file_input = Pathname | StringIO | IO | String | Lithic::FilePart + + OMIT: Object + end +end diff --git a/sig/lithic/internal/cursor_page.rbs b/sig/lithic/internal/cursor_page.rbs new file mode 100644 index 00000000..d132d0fd --- /dev/null +++ b/sig/lithic/internal/cursor_page.rbs @@ -0,0 +1,13 @@ +module Lithic + module Internal + class CursorPage[Elem] + include Lithic::Internal::Type::BasePage[Elem] + + attr_accessor data: ::Array[Elem]? + + attr_accessor has_more: bool + + def inspect: -> String + end + end +end diff --git a/sig/lithic/internal/single_page.rbs b/sig/lithic/internal/single_page.rbs new file mode 100644 index 00000000..9d0519dc --- /dev/null +++ b/sig/lithic/internal/single_page.rbs @@ -0,0 +1,13 @@ +module Lithic + module Internal + class SinglePage[Elem] + include Lithic::Internal::Type::BasePage[Elem] + + attr_accessor data: ::Array[Elem]? + + attr_accessor has_more: bool + + def inspect: -> String + end + end +end diff --git a/sig/lithic/internal/transport/base_client.rbs b/sig/lithic/internal/transport/base_client.rbs new file mode 100644 index 00000000..1a375823 --- /dev/null +++ b/sig/lithic/internal/transport/base_client.rbs @@ -0,0 +1,133 @@ +module Lithic + module Internal + module Transport + class BaseClient + extend Lithic::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: Lithic::Internal::Type::Converter::input?, + options: Lithic::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!: ( + Lithic::Internal::Transport::BaseClient::request_components req + ) -> void + + def self.should_retry?: ( + Integer status, + headers: ::Hash[String, String] + ) -> bool + + def self.follow_redirect: ( + Lithic::Internal::Transport::BaseClient::request_input request, + status: Integer, + response_headers: ::Hash[String, String] + ) -> Lithic::Internal::Transport::BaseClient::request_input + + def self.reap_connection!: ( + Integer | Lithic::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: Lithic::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: ( + Lithic::Internal::Transport::BaseClient::request_components req, + Lithic::request_options opts + ) -> Lithic::Internal::Transport::BaseClient::request_input + + private def retry_delay: ( + ::Hash[String, String] headers, + retry_count: Integer + ) -> Float + + def send_request: ( + Lithic::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: Lithic::Internal::Type::Converter::input?, + ?options: Lithic::request_opts? + ) -> top + + def inspect: -> String + end + end + end +end diff --git a/sig/lithic/internal/transport/pooled_net_requester.rbs b/sig/lithic/internal/transport/pooled_net_requester.rbs new file mode 100644 index 00000000..9c3c4155 --- /dev/null +++ b/sig/lithic/internal/transport/pooled_net_requester.rbs @@ -0,0 +1,48 @@ +module Lithic + module Internal + module Transport + class PooledNetRequester + extend Lithic::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: ( + Lithic::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: ( + Lithic::Internal::Transport::PooledNetRequester::request request + ) -> [Integer, top, Enumerable[String]] + + def initialize: (?size: Integer) -> void + end + end + end +end diff --git a/sig/lithic/internal/type/array_of.rbs b/sig/lithic/internal/type/array_of.rbs new file mode 100644 index 00000000..2d639b1c --- /dev/null +++ b/sig/lithic/internal/type/array_of.rbs @@ -0,0 +1,48 @@ +module Lithic + module Internal + module Type + class ArrayOf[Elem] + include Lithic::Internal::Type::Converter + include Lithic::Internal::Util::SorbetRuntimeSupport + + def self.[]: ( + ::Hash[Symbol, top] + | ^-> Lithic::Internal::Type::Converter::input + | Lithic::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: Lithic::Internal::Type::Converter::coerce_state + ) -> (::Array[top] | top) + + def dump: ( + ::Array[top] | top value, + state: Lithic::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] + | ^-> Lithic::Internal::Type::Converter::input + | Lithic::Internal::Type::Converter::input type_info, + ?::Hash[Symbol, top] spec + ) -> void + + def inspect: (?depth: Integer) -> String + end + end + end +end diff --git a/sig/lithic/internal/type/base_model.rbs b/sig/lithic/internal/type/base_model.rbs new file mode 100644 index 00000000..a90561f6 --- /dev/null +++ b/sig/lithic/internal/type/base_model.rbs @@ -0,0 +1,102 @@ +module Lithic + module Internal + module Type + class BaseModel + extend Lithic::Internal::Type::Converter + extend Lithic::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, (Lithic::Internal::Type::BaseModel::known_field + & { type_fn: (^-> Lithic::Internal::Type::Converter::input) })] + + def self.fields: -> ::Hash[Symbol, (Lithic::Internal::Type::BaseModel::known_field + & { type: Lithic::Internal::Type::Converter::input })] + + private def self.add_field: ( + Symbol name_sym, + required: bool, + type_info: { + const: (nil | bool | Integer | Float | Symbol)?, + enum: ^-> Lithic::Internal::Type::Converter::input?, + union: ^-> Lithic::Internal::Type::Converter::input?, + api_name: Symbol + } + | ^-> Lithic::Internal::Type::Converter::input + | Lithic::Internal::Type::Converter::input, + spec: ::Hash[Symbol, top] + ) -> void + + def self.required: ( + Symbol name_sym, + ::Hash[Symbol, top] + | ^-> Lithic::Internal::Type::Converter::input + | Lithic::Internal::Type::Converter::input type_info, + ?::Hash[Symbol, top] spec + ) -> void + + def self.optional: ( + Symbol name_sym, + ::Hash[Symbol, top] + | ^-> Lithic::Internal::Type::Converter::input + | Lithic::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: ( + Lithic::Internal::Type::BaseModel | ::Hash[top, top] | top value, + state: Lithic::Internal::Type::Converter::coerce_state + ) -> (instance | top) + + def self.dump: ( + instance | top value, + state: Lithic::Internal::Type::Converter::dump_state + ) -> (::Hash[top, top] | top) + + def self.to_sorbet_type: -> top + + def self.recursively_to_h: ( + Lithic::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/lithic/internal/type/base_page.rbs b/sig/lithic/internal/type/base_page.rbs new file mode 100644 index 00000000..5107501f --- /dev/null +++ b/sig/lithic/internal/type/base_page.rbs @@ -0,0 +1,24 @@ +module Lithic + 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: Lithic::Internal::Transport::BaseClient, + req: Lithic::Internal::Transport::BaseClient::request_components, + headers: ::Hash[String, String], + page_data: top + ) -> void + end + end + end +end diff --git a/sig/lithic/internal/type/boolean.rbs b/sig/lithic/internal/type/boolean.rbs new file mode 100644 index 00000000..becb59f0 --- /dev/null +++ b/sig/lithic/internal/type/boolean.rbs @@ -0,0 +1,26 @@ +module Lithic + module Internal + module Type + class Boolean + extend Lithic::Internal::Type::Converter + extend Lithic::Internal::Util::SorbetRuntimeSupport + + def self.===: (top other) -> bool + + def self.==: (top other) -> bool + + def self.coerce: ( + bool | top value, + state: Lithic::Internal::Type::Converter::coerce_state + ) -> (bool | top) + + def self.dump: ( + bool | top value, + state: Lithic::Internal::Type::Converter::dump_state + ) -> (bool | top) + + def self.to_sorbet_type: -> top + end + end + end +end diff --git a/sig/lithic/internal/type/converter.rbs b/sig/lithic/internal/type/converter.rbs new file mode 100644 index 00000000..9f2139ce --- /dev/null +++ b/sig/lithic/internal/type/converter.rbs @@ -0,0 +1,79 @@ +module Lithic + module Internal + module Type + module Converter + extend Lithic::Internal::Util::SorbetRuntimeSupport + + type input = Lithic::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: Lithic::Internal::Type::Converter::coerce_state + ) -> top + + def dump: ( + top value, + state: Lithic::Internal::Type::Converter::dump_state + ) -> top + + def inspect: (?depth: Integer) -> String + + def self.type_info: ( + { + const: (nil | bool | Integer | Float | Symbol)?, + enum: ^-> Lithic::Internal::Type::Converter::input?, + union: ^-> Lithic::Internal::Type::Converter::input? + } + | ^-> Lithic::Internal::Type::Converter::input + | Lithic::Internal::Type::Converter::input spec + ) -> (^-> top) + + def self.meta_info: ( + { + const: (nil | bool | Integer | Float | Symbol)?, + enum: ^-> Lithic::Internal::Type::Converter::input?, + union: ^-> Lithic::Internal::Type::Converter::input? + } + | ^-> Lithic::Internal::Type::Converter::input + | Lithic::Internal::Type::Converter::input type_info, + { + const: (nil | bool | Integer | Float | Symbol)?, + enum: ^-> Lithic::Internal::Type::Converter::input?, + union: ^-> Lithic::Internal::Type::Converter::input? + } + | ^-> Lithic::Internal::Type::Converter::input + | Lithic::Internal::Type::Converter::input spec + ) -> ::Hash[Symbol, top] + + def self.new_coerce_state: ( + ?translate_names: bool + ) -> Lithic::Internal::Type::Converter::coerce_state + + def self.coerce: ( + Lithic::Internal::Type::Converter::input target, + top value, + ?state: Lithic::Internal::Type::Converter::coerce_state + ) -> top + + def self.dump: ( + Lithic::Internal::Type::Converter::input target, + top value, + ?state: Lithic::Internal::Type::Converter::dump_state + ) -> top + + def self.inspect: (top target, depth: Integer) -> String + end + end + end +end diff --git a/sig/lithic/internal/type/enum.rbs b/sig/lithic/internal/type/enum.rbs new file mode 100644 index 00000000..33d5d05d --- /dev/null +++ b/sig/lithic/internal/type/enum.rbs @@ -0,0 +1,32 @@ +module Lithic + module Internal + module Type + module Enum + include Lithic::Internal::Type::Converter + include Lithic::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: Lithic::Internal::Type::Converter::coerce_state + ) -> (Symbol | top) + + def dump: ( + Symbol | top value, + state: Lithic::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/lithic/internal/type/file_input.rbs b/sig/lithic/internal/type/file_input.rbs new file mode 100644 index 00000000..52cc3681 --- /dev/null +++ b/sig/lithic/internal/type/file_input.rbs @@ -0,0 +1,25 @@ +module Lithic + module Internal + module Type + class FileInput + extend Lithic::Internal::Type::Converter + + def self.===: (top other) -> bool + + def self.==: (top other) -> bool + + def self.coerce: ( + StringIO | String | top value, + state: Lithic::Internal::Type::Converter::coerce_state + ) -> (StringIO | top) + + def self.dump: ( + Pathname | StringIO | IO | String | top value, + state: Lithic::Internal::Type::Converter::dump_state + ) -> (Pathname | StringIO | IO | String | top) + + def self.to_sorbet_type: -> top + end + end + end +end diff --git a/sig/lithic/internal/type/hash_of.rbs b/sig/lithic/internal/type/hash_of.rbs new file mode 100644 index 00000000..87d8a417 --- /dev/null +++ b/sig/lithic/internal/type/hash_of.rbs @@ -0,0 +1,48 @@ +module Lithic + module Internal + module Type + class HashOf[Elem] + include Lithic::Internal::Type::Converter + include Lithic::Internal::Util::SorbetRuntimeSupport + + def self.[]: ( + ::Hash[Symbol, top] + | ^-> Lithic::Internal::Type::Converter::input + | Lithic::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: Lithic::Internal::Type::Converter::coerce_state + ) -> (::Hash[Symbol, top] | top) + + def dump: ( + ::Hash[top, top] | top value, + state: Lithic::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] + | ^-> Lithic::Internal::Type::Converter::input + | Lithic::Internal::Type::Converter::input type_info, + ?::Hash[Symbol, top] spec + ) -> void + + def inspect: (?depth: Integer) -> String + end + end + end +end diff --git a/sig/lithic/internal/type/request_parameters.rbs b/sig/lithic/internal/type/request_parameters.rbs new file mode 100644 index 00000000..cf1794ea --- /dev/null +++ b/sig/lithic/internal/type/request_parameters.rbs @@ -0,0 +1,17 @@ +module Lithic + module Internal + module Type + type request_parameters = { request_options: Lithic::request_opts } + + module RequestParameters + attr_reader request_options: Lithic::request_opts + + def request_options=: (Lithic::request_opts) -> Lithic::request_opts + + module Converter + def dump_request: (top params) -> [top, ::Hash[Symbol, top]] + end + end + end + end +end diff --git a/sig/lithic/internal/type/union.rbs b/sig/lithic/internal/type/union.rbs new file mode 100644 index 00000000..fbe48976 --- /dev/null +++ b/sig/lithic/internal/type/union.rbs @@ -0,0 +1,52 @@ +module Lithic + module Internal + module Type + module Union + include Lithic::Internal::Type::Converter + include Lithic::Internal::Util::SorbetRuntimeSupport + + private def self.known_variants: -> ::Array[[Symbol?, (^-> Lithic::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] + | ^-> Lithic::Internal::Type::Converter::input + | Lithic::Internal::Type::Converter::input key, + ?::Hash[Symbol, top] + | ^-> Lithic::Internal::Type::Converter::input + | Lithic::Internal::Type::Converter::input spec + ) -> void + + private def self.resolve_variant: ( + top value + ) -> Lithic::Internal::Type::Converter::input? + + def ===: (top other) -> bool + + def ==: (top other) -> bool + + def hash: -> Integer + + def coerce: ( + top value, + state: Lithic::Internal::Type::Converter::coerce_state + ) -> top + + def dump: ( + top value, + state: Lithic::Internal::Type::Converter::dump_state + ) -> top + + def to_sorbet_type: -> top + + def inspect: (?depth: Integer) -> String + end + end + end +end diff --git a/sig/lithic/internal/type/unknown.rbs b/sig/lithic/internal/type/unknown.rbs new file mode 100644 index 00000000..696a6f9f --- /dev/null +++ b/sig/lithic/internal/type/unknown.rbs @@ -0,0 +1,26 @@ +module Lithic + module Internal + module Type + class Unknown + extend Lithic::Internal::Type::Converter + extend Lithic::Internal::Util::SorbetRuntimeSupport + + def self.===: (top other) -> bool + + def self.==: (top other) -> bool + + def self.coerce: ( + top value, + state: Lithic::Internal::Type::Converter::coerce_state + ) -> top + + def self.dump: ( + top value, + state: Lithic::Internal::Type::Converter::dump_state + ) -> top + + def self.to_sorbet_type: -> top + end + end + end +end diff --git a/sig/lithic/internal/util.rbs b/sig/lithic/internal/util.rbs new file mode 100644 index 00000000..a12f9cc3 --- /dev/null +++ b/sig/lithic/internal/util.rbs @@ -0,0 +1,199 @@ +module Lithic + module Internal + module Util + extend Lithic::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 + ) -> Lithic::Internal::Util::parsed_uri + + def self?.unparse_uri: ( + Lithic::Internal::Util::parsed_uri parsed + ) -> URI::Generic + + def self?.join_parsed_uri: ( + Lithic::Internal::Util::parsed_uri lhs, + Lithic::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[Lithic::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: ( + Lithic::Internal::Util::SorbetRuntimeSupport | top `type` + ) -> top + end + end + end +end diff --git a/sig/lithic/models.rbs b/sig/lithic/models.rbs new file mode 100644 index 00000000..d80ccd69 --- /dev/null +++ b/sig/lithic/models.rbs @@ -0,0 +1,561 @@ +module Lithic + class Account = Lithic::Models::Account + + class AccountActivityListParams = Lithic::Models::AccountActivityListParams + + class AccountActivityRetrieveTransactionParams = Lithic::Models::AccountActivityRetrieveTransactionParams + + module AccountFinancialAccountType = Lithic::Models::AccountFinancialAccountType + + class AccountHolder = Lithic::Models::AccountHolder + + class AccountHolderCreatedWebhookEvent = Lithic::Models::AccountHolderCreatedWebhookEvent + + class AccountHolderCreateParams = Lithic::Models::AccountHolderCreateParams + + class AccountHolderDocumentUpdatedWebhookEvent = Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent + + class AccountHolderListDocumentsParams = Lithic::Models::AccountHolderListDocumentsParams + + class AccountHolderListParams = Lithic::Models::AccountHolderListParams + + class AccountHolderRetrieveDocumentParams = Lithic::Models::AccountHolderRetrieveDocumentParams + + class AccountHolderRetrieveParams = Lithic::Models::AccountHolderRetrieveParams + + module AccountHolders = Lithic::Models::AccountHolders + + class AccountHolderSimulateEnrollmentDocumentReviewParams = Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams + + class AccountHolderSimulateEnrollmentReviewParams = Lithic::Models::AccountHolderSimulateEnrollmentReviewParams + + module AccountHolderUpdatedWebhookEvent = Lithic::Models::AccountHolderUpdatedWebhookEvent + + class AccountHolderUpdateParams = Lithic::Models::AccountHolderUpdateParams + + class AccountHolderUploadDocumentParams = Lithic::Models::AccountHolderUploadDocumentParams + + class AccountHolderVerificationWebhookEvent = Lithic::Models::AccountHolderVerificationWebhookEvent + + class AccountListParams = Lithic::Models::AccountListParams + + class AccountRetrieveParams = Lithic::Models::AccountRetrieveParams + + class AccountRetrieveSignalsParams = Lithic::Models::AccountRetrieveSignalsParams + + class AccountRetrieveSpendLimitsParams = Lithic::Models::AccountRetrieveSpendLimitsParams + + class AccountSpendLimits = Lithic::Models::AccountSpendLimits + + class AccountUpdateParams = Lithic::Models::AccountUpdateParams + + class Address = Lithic::Models::Address + + class AddressUpdate = Lithic::Models::AddressUpdate + + class APIStatus = Lithic::Models::APIStatus + + module AuthRules = Lithic::Models::AuthRules + + class AuthRulesBacktestReportCreatedWebhookEvent = Lithic::Models::AuthRulesBacktestReportCreatedWebhookEvent + + class AuthStreamEnrollmentRetrieveSecretParams = Lithic::Models::AuthStreamEnrollmentRetrieveSecretParams + + class AuthStreamEnrollmentRotateSecretParams = Lithic::Models::AuthStreamEnrollmentRotateSecretParams + + class AuthStreamSecret = Lithic::Models::AuthStreamSecret + + class Balance = Lithic::Models::Balance + + class BalanceListParams = Lithic::Models::BalanceListParams + + class BalanceUpdatedWebhookEvent = Lithic::Models::BalanceUpdatedWebhookEvent + + class BookTransferCreateParams = Lithic::Models::BookTransferCreateParams + + class BookTransferListParams = Lithic::Models::BookTransferListParams + + class BookTransferResponse = Lithic::Models::BookTransferResponse + + class BookTransferRetrieveParams = Lithic::Models::BookTransferRetrieveParams + + class BookTransferRetryParams = Lithic::Models::BookTransferRetryParams + + class BookTransferReverseParams = Lithic::Models::BookTransferReverseParams + + class BookTransferTransactionCreatedWebhookEvent = Lithic::Models::BookTransferTransactionCreatedWebhookEvent + + class BookTransferTransactionUpdatedWebhookEvent = Lithic::Models::BookTransferTransactionUpdatedWebhookEvent + + class Card = Lithic::Models::Card + + class CardAuthorization = Lithic::Models::CardAuthorization + + class CardAuthorizationApprovalRequestWebhookEvent = Lithic::Models::CardAuthorizationApprovalRequestWebhookEvent + + class CardAuthorizationChallengeResponseParams = Lithic::Models::CardAuthorizationChallengeResponseParams + + class CardAuthorizationChallengeResponseWebhookEvent = Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent + + class CardAuthorizationChallengeWebhookEvent = Lithic::Models::CardAuthorizationChallengeWebhookEvent + + class CardBulkOrder = Lithic::Models::CardBulkOrder + + class CardBulkOrderCreateParams = Lithic::Models::CardBulkOrderCreateParams + + class CardBulkOrderListParams = Lithic::Models::CardBulkOrderListParams + + class CardBulkOrderRetrieveParams = Lithic::Models::CardBulkOrderRetrieveParams + + class CardBulkOrderUpdateParams = Lithic::Models::CardBulkOrderUpdateParams + + class CardConvertedWebhookEvent = Lithic::Models::CardConvertedWebhookEvent + + class CardConvertPhysicalParams = Lithic::Models::CardConvertPhysicalParams + + class CardCreatedWebhookEvent = Lithic::Models::CardCreatedWebhookEvent + + class CardCreateParams = Lithic::Models::CardCreateParams + + class CardEmbedParams = Lithic::Models::CardEmbedParams + + class CardholderAuthentication = Lithic::Models::CardholderAuthentication + + class CardListParams = Lithic::Models::CardListParams + + class CardProgram = Lithic::Models::CardProgram + + class CardProgramListParams = Lithic::Models::CardProgramListParams + + class CardProgramRetrieveParams = Lithic::Models::CardProgramRetrieveParams + + class CardProvisionParams = Lithic::Models::CardProvisionParams + + class CardReissuedWebhookEvent = Lithic::Models::CardReissuedWebhookEvent + + class CardReissueParams = Lithic::Models::CardReissueParams + + class CardRenewedWebhookEvent = Lithic::Models::CardRenewedWebhookEvent + + class CardRenewParams = Lithic::Models::CardRenewParams + + class CardRetrieveParams = Lithic::Models::CardRetrieveParams + + class CardRetrieveSignalsParams = Lithic::Models::CardRetrieveSignalsParams + + class CardRetrieveSpendLimitsParams = Lithic::Models::CardRetrieveSpendLimitsParams + + module Cards = Lithic::Models::Cards + + class CardSearchByPanParams = Lithic::Models::CardSearchByPanParams + + class CardShippedWebhookEvent = Lithic::Models::CardShippedWebhookEvent + + class CardSpendLimits = Lithic::Models::CardSpendLimits + + class CardTransactionEnhancedDataCreatedWebhookEvent = Lithic::Models::CardTransactionEnhancedDataCreatedWebhookEvent + + class CardTransactionEnhancedDataUpdatedWebhookEvent = Lithic::Models::CardTransactionEnhancedDataUpdatedWebhookEvent + + class CardTransactionUpdatedWebhookEvent = Lithic::Models::CardTransactionUpdatedWebhookEvent + + class CardUpdatedWebhookEvent = Lithic::Models::CardUpdatedWebhookEvent + + class CardUpdateParams = Lithic::Models::CardUpdateParams + + class CardWebProvisionParams = Lithic::Models::CardWebProvisionParams + + class Carrier = Lithic::Models::Carrier + + class CategoryDetails = Lithic::Models::CategoryDetails + + class ClientAPIStatusParams = Lithic::Models::ClientAPIStatusParams + + module CreditProducts = Lithic::Models::CreditProducts + + class Currency = Lithic::Models::Currency + + class Device = Lithic::Models::Device + + class DigitalCardArtAPI = Lithic::Models::DigitalCardArtAPI + + class DigitalCardArtListParams = Lithic::Models::DigitalCardArtListParams + + class DigitalCardArtRetrieveParams = Lithic::Models::DigitalCardArtRetrieveParams + + class DigitalWalletTokenizationApprovalRequestWebhookEvent = Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent + + class DigitalWalletTokenizationResultWebhookEvent = Lithic::Models::DigitalWalletTokenizationResultWebhookEvent + + class DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent = Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent + + class DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent = Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent + + class DigitalWalletTokenizationUpdatedWebhookEvent = Lithic::Models::DigitalWalletTokenizationUpdatedWebhookEvent + + class Dispute = Lithic::Models::Dispute + + class DisputeCreateParams = Lithic::Models::DisputeCreateParams + + class DisputeDeleteEvidenceParams = Lithic::Models::DisputeDeleteEvidenceParams + + class DisputeDeleteParams = Lithic::Models::DisputeDeleteParams + + class DisputeEvidence = Lithic::Models::DisputeEvidence + + class DisputeEvidenceUploadFailedWebhookEvent = Lithic::Models::DisputeEvidenceUploadFailedWebhookEvent + + class DisputeInitiateEvidenceUploadParams = Lithic::Models::DisputeInitiateEvidenceUploadParams + + class DisputeListEvidencesParams = Lithic::Models::DisputeListEvidencesParams + + class DisputeListParams = Lithic::Models::DisputeListParams + + class DisputeRetrieveEvidenceParams = Lithic::Models::DisputeRetrieveEvidenceParams + + class DisputeRetrieveParams = Lithic::Models::DisputeRetrieveParams + + class DisputesV2ListParams = Lithic::Models::DisputesV2ListParams + + class DisputesV2RetrieveParams = Lithic::Models::DisputesV2RetrieveParams + + class DisputeTransactionCreatedWebhookEvent = Lithic::Models::DisputeTransactionCreatedWebhookEvent + + class DisputeTransactionUpdatedWebhookEvent = Lithic::Models::DisputeTransactionUpdatedWebhookEvent + + class DisputeUpdatedWebhookEvent = Lithic::Models::DisputeUpdatedWebhookEvent + + class DisputeUpdateParams = Lithic::Models::DisputeUpdateParams + + class DisputeV2 = Lithic::Models::DisputeV2 + + class Document = Lithic::Models::Document + + class Event = Lithic::Models::Event + + class EventListAttemptsParams = Lithic::Models::EventListAttemptsParams + + class EventListParams = Lithic::Models::EventListParams + + class EventRetrieveParams = Lithic::Models::EventRetrieveParams + + module Events = Lithic::Models::Events + + class EventSubscription = Lithic::Models::EventSubscription + + class ExternalBankAccount = Lithic::Models::ExternalBankAccount + + class ExternalBankAccountAddress = Lithic::Models::ExternalBankAccountAddress + + class ExternalBankAccountCreatedWebhookEvent = Lithic::Models::ExternalBankAccountCreatedWebhookEvent + + class ExternalBankAccountCreateParams = Lithic::Models::ExternalBankAccountCreateParams + + class ExternalBankAccountListParams = Lithic::Models::ExternalBankAccountListParams + + class ExternalBankAccountPauseParams = Lithic::Models::ExternalBankAccountPauseParams + + class ExternalBankAccountRetrieveParams = Lithic::Models::ExternalBankAccountRetrieveParams + + class ExternalBankAccountRetryMicroDepositsParams = Lithic::Models::ExternalBankAccountRetryMicroDepositsParams + + class ExternalBankAccountRetryPrenoteParams = Lithic::Models::ExternalBankAccountRetryPrenoteParams + + module ExternalBankAccounts = Lithic::Models::ExternalBankAccounts + + class ExternalBankAccountSetVerificationMethodParams = Lithic::Models::ExternalBankAccountSetVerificationMethodParams + + class ExternalBankAccountUnpauseParams = Lithic::Models::ExternalBankAccountUnpauseParams + + class ExternalBankAccountUpdatedWebhookEvent = Lithic::Models::ExternalBankAccountUpdatedWebhookEvent + + class ExternalBankAccountUpdateParams = Lithic::Models::ExternalBankAccountUpdateParams + + class ExternalPayment = Lithic::Models::ExternalPayment + + class ExternalPaymentCancelParams = Lithic::Models::ExternalPaymentCancelParams + + class ExternalPaymentCreatedWebhookEvent = Lithic::Models::ExternalPaymentCreatedWebhookEvent + + class ExternalPaymentCreateParams = Lithic::Models::ExternalPaymentCreateParams + + class ExternalPaymentListParams = Lithic::Models::ExternalPaymentListParams + + class ExternalPaymentReleaseParams = Lithic::Models::ExternalPaymentReleaseParams + + class ExternalPaymentRetrieveParams = Lithic::Models::ExternalPaymentRetrieveParams + + class ExternalPaymentReverseParams = Lithic::Models::ExternalPaymentReverseParams + + class ExternalPaymentSettleParams = Lithic::Models::ExternalPaymentSettleParams + + class ExternalPaymentUpdatedWebhookEvent = Lithic::Models::ExternalPaymentUpdatedWebhookEvent + + class ExternalResource = Lithic::Models::ExternalResource + + module ExternalResourceType = Lithic::Models::ExternalResourceType + + class FinancialAccount = Lithic::Models::FinancialAccount + + class FinancialAccountBalance = Lithic::Models::FinancialAccountBalance + + class FinancialAccountCreatedWebhookEvent = Lithic::Models::FinancialAccountCreatedWebhookEvent + + class FinancialAccountCreateParams = Lithic::Models::FinancialAccountCreateParams + + class FinancialAccountListParams = Lithic::Models::FinancialAccountListParams + + class FinancialAccountRegisterAccountNumberParams = Lithic::Models::FinancialAccountRegisterAccountNumberParams + + class FinancialAccountRetrieveParams = Lithic::Models::FinancialAccountRetrieveParams + + module FinancialAccounts = Lithic::Models::FinancialAccounts + + class FinancialAccountUpdatedWebhookEvent = Lithic::Models::FinancialAccountUpdatedWebhookEvent + + class FinancialAccountUpdateParams = Lithic::Models::FinancialAccountUpdateParams + + class FinancialAccountUpdateStatusParams = Lithic::Models::FinancialAccountUpdateStatusParams + + class FinancialEvent = Lithic::Models::FinancialEvent + + class FinancialTransaction = Lithic::Models::FinancialTransaction + + module Fraud = Lithic::Models::Fraud + + class FundingEvent = Lithic::Models::FundingEvent + + class FundingEventCreatedWebhookEvent = Lithic::Models::FundingEventCreatedWebhookEvent + + class FundingEventListParams = Lithic::Models::FundingEventListParams + + class FundingEventRetrieveDetailsParams = Lithic::Models::FundingEventRetrieveDetailsParams + + class FundingEventRetrieveParams = Lithic::Models::FundingEventRetrieveParams + + class Hold = Lithic::Models::Hold + + class HoldCreateParams = Lithic::Models::HoldCreateParams + + class HoldEvent = Lithic::Models::HoldEvent + + class HoldListParams = Lithic::Models::HoldListParams + + class HoldRetrieveParams = Lithic::Models::HoldRetrieveParams + + class HoldVoidParams = Lithic::Models::HoldVoidParams + + module InstanceFinancialAccountType = Lithic::Models::InstanceFinancialAccountType + + class InternalTransactionAPI = Lithic::Models::InternalTransactionAPI + + class InternalTransactionCreatedWebhookEvent = Lithic::Models::InternalTransactionCreatedWebhookEvent + + class InternalTransactionUpdatedWebhookEvent = Lithic::Models::InternalTransactionUpdatedWebhookEvent + + class KYB = Lithic::Models::KYB + + class KYBBusinessEntity = Lithic::Models::KYBBusinessEntity + + class KYC = Lithic::Models::KYC + + class KYCExempt = Lithic::Models::KYCExempt + + class LoanTapeCreatedWebhookEvent = Lithic::Models::LoanTapeCreatedWebhookEvent + + class LoanTapeUpdatedWebhookEvent = Lithic::Models::LoanTapeUpdatedWebhookEvent + + class ManagementOperationCreatedWebhookEvent = Lithic::Models::ManagementOperationCreatedWebhookEvent + + class ManagementOperationCreateParams = Lithic::Models::ManagementOperationCreateParams + + class ManagementOperationListParams = Lithic::Models::ManagementOperationListParams + + class ManagementOperationRetrieveParams = Lithic::Models::ManagementOperationRetrieveParams + + class ManagementOperationReverseParams = Lithic::Models::ManagementOperationReverseParams + + class ManagementOperationTransaction = Lithic::Models::ManagementOperationTransaction + + class ManagementOperationUpdatedWebhookEvent = Lithic::Models::ManagementOperationUpdatedWebhookEvent + + class Merchant = Lithic::Models::Merchant + + class MessageAttempt = Lithic::Models::MessageAttempt + + class NetworkProgram = Lithic::Models::NetworkProgram + + class NetworkProgramListParams = Lithic::Models::NetworkProgramListParams + + class NetworkProgramRetrieveParams = Lithic::Models::NetworkProgramRetrieveParams + + class NetworkTotal = Lithic::Models::NetworkTotal + + class NetworkTotalCreatedWebhookEvent = Lithic::Models::NetworkTotalCreatedWebhookEvent + + class NetworkTotalUpdatedWebhookEvent = Lithic::Models::NetworkTotalUpdatedWebhookEvent + + class NonPCICard = Lithic::Models::NonPCICard + + module OwnerType = Lithic::Models::OwnerType + + module ParsedWebhookEvent = Lithic::Models::ParsedWebhookEvent + + class Payment = Lithic::Models::Payment + + class PaymentCreateParams = Lithic::Models::PaymentCreateParams + + class PaymentListParams = Lithic::Models::PaymentListParams + + class PaymentRetrieveParams = Lithic::Models::PaymentRetrieveParams + + class PaymentRetryParams = Lithic::Models::PaymentRetryParams + + class PaymentReturnParams = Lithic::Models::PaymentReturnParams + + class PaymentSimulateActionParams = Lithic::Models::PaymentSimulateActionParams + + class PaymentSimulateReceiptParams = Lithic::Models::PaymentSimulateReceiptParams + + class PaymentSimulateReleaseParams = Lithic::Models::PaymentSimulateReleaseParams + + class PaymentSimulateReturnParams = Lithic::Models::PaymentSimulateReturnParams + + class PaymentTransactionCreatedWebhookEvent = Lithic::Models::PaymentTransactionCreatedWebhookEvent + + class PaymentTransactionUpdatedWebhookEvent = Lithic::Models::PaymentTransactionUpdatedWebhookEvent + + class ProvisionResponse = Lithic::Models::ProvisionResponse + + module Reports = Lithic::Models::Reports + + class RequiredDocument = Lithic::Models::RequiredDocument + + class ResponderEndpointCheckStatusParams = Lithic::Models::ResponderEndpointCheckStatusParams + + class ResponderEndpointCreateParams = Lithic::Models::ResponderEndpointCreateParams + + class ResponderEndpointDeleteParams = Lithic::Models::ResponderEndpointDeleteParams + + class ResponderEndpointStatus = Lithic::Models::ResponderEndpointStatus + + class SettlementDetail = Lithic::Models::SettlementDetail + + class SettlementReport = Lithic::Models::SettlementReport + + class SettlementReportUpdatedWebhookEvent = Lithic::Models::SettlementReportUpdatedWebhookEvent + + class SettlementSummaryDetails = Lithic::Models::SettlementSummaryDetails + + class ShippingAddress = Lithic::Models::ShippingAddress + + class SignalsResponse = Lithic::Models::SignalsResponse + + module SpendLimitDuration = Lithic::Models::SpendLimitDuration + + class StatementsCreatedWebhookEvent = Lithic::Models::StatementsCreatedWebhookEvent + + class StatementTotals = Lithic::Models::StatementTotals + + module ThreeDS = Lithic::Models::ThreeDS + + class ThreeDSAuthentication = Lithic::Models::ThreeDSAuthentication + + class ThreeDSAuthenticationApprovalRequestWebhookEvent = Lithic::Models::ThreeDSAuthenticationApprovalRequestWebhookEvent + + class ThreeDSAuthenticationChallengeWebhookEvent = Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent + + class ThreeDSAuthenticationCreatedWebhookEvent = Lithic::Models::ThreeDSAuthenticationCreatedWebhookEvent + + class ThreeDSAuthenticationUpdatedWebhookEvent = Lithic::Models::ThreeDSAuthenticationUpdatedWebhookEvent + + class TokenInfo = Lithic::Models::TokenInfo + + class Tokenization = Lithic::Models::Tokenization + + class TokenizationActivateParams = Lithic::Models::TokenizationActivateParams + + class TokenizationApprovalRequestWebhookEvent = Lithic::Models::TokenizationApprovalRequestWebhookEvent + + class TokenizationDeactivateParams = Lithic::Models::TokenizationDeactivateParams + + class TokenizationDecisioningRetrieveSecretParams = Lithic::Models::TokenizationDecisioningRetrieveSecretParams + + class TokenizationDecisioningRotateSecretParams = Lithic::Models::TokenizationDecisioningRotateSecretParams + + module TokenizationDeclineReason = Lithic::Models::TokenizationDeclineReason + + class TokenizationListParams = Lithic::Models::TokenizationListParams + + class TokenizationPauseParams = Lithic::Models::TokenizationPauseParams + + class TokenizationResendActivationCodeParams = Lithic::Models::TokenizationResendActivationCodeParams + + class TokenizationResultWebhookEvent = Lithic::Models::TokenizationResultWebhookEvent + + class TokenizationRetrieveParams = Lithic::Models::TokenizationRetrieveParams + + class TokenizationRuleResult = Lithic::Models::TokenizationRuleResult + + class TokenizationSecret = Lithic::Models::TokenizationSecret + + class TokenizationSimulateParams = Lithic::Models::TokenizationSimulateParams + + module TokenizationTfaReason = Lithic::Models::TokenizationTfaReason + + class TokenizationTwoFactorAuthenticationCodeSentWebhookEvent = Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent + + class TokenizationTwoFactorAuthenticationCodeWebhookEvent = Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent + + class TokenizationUnpauseParams = Lithic::Models::TokenizationUnpauseParams + + class TokenizationUpdateDigitalCardArtParams = Lithic::Models::TokenizationUpdateDigitalCardArtParams + + class TokenizationUpdatedWebhookEvent = Lithic::Models::TokenizationUpdatedWebhookEvent + + class TokenMetadata = Lithic::Models::TokenMetadata + + class Transaction = Lithic::Models::Transaction + + class TransactionExpireAuthorizationParams = Lithic::Models::TransactionExpireAuthorizationParams + + class TransactionListParams = Lithic::Models::TransactionListParams + + module TransactionMonitoring = Lithic::Models::TransactionMonitoring + + class TransactionRetrieveParams = Lithic::Models::TransactionRetrieveParams + + class TransactionRouteParams = Lithic::Models::TransactionRouteParams + + module Transactions = Lithic::Models::Transactions + + class TransactionSimulateAuthorizationAdviceParams = Lithic::Models::TransactionSimulateAuthorizationAdviceParams + + class TransactionSimulateAuthorizationParams = Lithic::Models::TransactionSimulateAuthorizationParams + + class TransactionSimulateClearingParams = Lithic::Models::TransactionSimulateClearingParams + + class TransactionSimulateCreditAuthorizationAdviceParams = Lithic::Models::TransactionSimulateCreditAuthorizationAdviceParams + + class TransactionSimulateReturnParams = Lithic::Models::TransactionSimulateReturnParams + + class TransactionSimulateReturnReversalParams = Lithic::Models::TransactionSimulateReturnReversalParams + + class TransactionSimulateVoidParams = Lithic::Models::TransactionSimulateVoidParams + + class Transfer = Lithic::Models::Transfer + + class TransferCreateParams = Lithic::Models::TransferCreateParams + + class TransferLimitListParams = Lithic::Models::TransferLimitListParams + + class TransferLimitsResponse = Lithic::Models::TransferLimitsResponse + + module VerificationMethod = Lithic::Models::VerificationMethod + + class WalletDecisioningInfo = Lithic::Models::WalletDecisioningInfo + + class WebhookParsedParams = Lithic::Models::WebhookParsedParams + + class WirePartyDetails = Lithic::Models::WirePartyDetails +end diff --git a/sig/lithic/models/account.rbs b/sig/lithic/models/account.rbs new file mode 100644 index 00000000..526d2509 --- /dev/null +++ b/sig/lithic/models/account.rbs @@ -0,0 +1,210 @@ +module Lithic + module Models + type account = + { + token: String, + created: Time?, + spend_limit: Lithic::Account::SpendLimit, + state: Lithic::Models::Account::state, + account_holder: Lithic::Account::AccountHolder, + auth_rule_tokens: ::Array[String], + cardholder_currency: String, + comment: String, + substatus: Lithic::Models::Account::substatus?, + verification_address: Lithic::Account::VerificationAddress + } + + class Account < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor created: Time? + + attr_accessor spend_limit: Lithic::Account::SpendLimit + + attr_accessor state: Lithic::Models::Account::state + + attr_reader account_holder: Lithic::Account::AccountHolder? + + def account_holder=: ( + Lithic::Account::AccountHolder + ) -> Lithic::Account::AccountHolder + + attr_reader auth_rule_tokens: ::Array[String]? + + def auth_rule_tokens=: (::Array[String]) -> ::Array[String] + + attr_reader cardholder_currency: String? + + def cardholder_currency=: (String) -> String + + attr_reader comment: String? + + def comment=: (String) -> String + + attr_accessor substatus: Lithic::Models::Account::substatus? + + attr_reader verification_address: Lithic::Account::VerificationAddress? + + def verification_address=: ( + Lithic::Account::VerificationAddress + ) -> Lithic::Account::VerificationAddress + + def initialize: ( + token: String, + created: Time?, + spend_limit: Lithic::Account::SpendLimit, + state: Lithic::Models::Account::state, + ?account_holder: Lithic::Account::AccountHolder, + ?auth_rule_tokens: ::Array[String], + ?cardholder_currency: String, + ?comment: String, + ?substatus: Lithic::Models::Account::substatus?, + ?verification_address: Lithic::Account::VerificationAddress + ) -> void + + def to_hash: -> { + token: String, + created: Time?, + spend_limit: Lithic::Account::SpendLimit, + state: Lithic::Models::Account::state, + account_holder: Lithic::Account::AccountHolder, + auth_rule_tokens: ::Array[String], + cardholder_currency: String, + comment: String, + substatus: Lithic::Models::Account::substatus?, + verification_address: Lithic::Account::VerificationAddress + } + + type spend_limit = { daily: Integer, lifetime: Integer, monthly: Integer } + + class SpendLimit < Lithic::Internal::Type::BaseModel + attr_accessor daily: Integer + + attr_accessor lifetime: Integer + + attr_accessor monthly: Integer + + def initialize: ( + daily: Integer, + lifetime: Integer, + monthly: Integer + ) -> void + + def to_hash: -> { daily: Integer, lifetime: Integer, monthly: Integer } + end + + type state = :ACTIVE | :PAUSED | :CLOSED + + module State + extend Lithic::Internal::Type::Enum + + ACTIVE: :ACTIVE + PAUSED: :PAUSED + CLOSED: :CLOSED + + def self?.values: -> ::Array[Lithic::Models::Account::state] + end + + type account_holder = + { + token: String, + business_account_token: String, + email: String, + phone_number: String + } + + class AccountHolder < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor business_account_token: String + + attr_accessor email: String + + attr_accessor phone_number: String + + def initialize: ( + token: String, + business_account_token: String, + email: String, + phone_number: String + ) -> void + + def to_hash: -> { + token: String, + business_account_token: String, + email: String, + phone_number: String + } + end + + type substatus = + :FRAUD_IDENTIFIED + | :SUSPICIOUS_ACTIVITY + | :RISK_VIOLATION + | :END_USER_REQUEST + | :ISSUER_REQUEST + | :NOT_ACTIVE + | :INTERNAL_REVIEW + | :OTHER + + module Substatus + extend Lithic::Internal::Type::Enum + + FRAUD_IDENTIFIED: :FRAUD_IDENTIFIED + SUSPICIOUS_ACTIVITY: :SUSPICIOUS_ACTIVITY + RISK_VIOLATION: :RISK_VIOLATION + END_USER_REQUEST: :END_USER_REQUEST + ISSUER_REQUEST: :ISSUER_REQUEST + NOT_ACTIVE: :NOT_ACTIVE + INTERNAL_REVIEW: :INTERNAL_REVIEW + OTHER: :OTHER + + def self?.values: -> ::Array[Lithic::Models::Account::substatus] + end + + type verification_address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class VerificationAddress < Lithic::Internal::Type::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + end + end + end +end diff --git a/sig/lithic/models/account_activity_list_params.rbs b/sig/lithic/models/account_activity_list_params.rbs new file mode 100644 index 00000000..41c09bb8 --- /dev/null +++ b/sig/lithic/models/account_activity_list_params.rbs @@ -0,0 +1,191 @@ +module Lithic + module Models + type account_activity_list_params = + { + account_token: String, + begin_: Time, + business_account_token: String, + category: Lithic::Models::AccountActivityListParams::category, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::Models::AccountActivityListParams::result, + starting_after: String, + status: Lithic::Models::AccountActivityListParams::status + } + & Lithic::Internal::Type::request_parameters + + class AccountActivityListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader business_account_token: String? + + def business_account_token=: (String) -> String + + attr_reader category: Lithic::Models::AccountActivityListParams::category? + + def category=: ( + Lithic::Models::AccountActivityListParams::category + ) -> Lithic::Models::AccountActivityListParams::category + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader financial_account_token: String? + + def financial_account_token=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader result: Lithic::Models::AccountActivityListParams::result? + + def result=: ( + Lithic::Models::AccountActivityListParams::result + ) -> Lithic::Models::AccountActivityListParams::result + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader status: Lithic::Models::AccountActivityListParams::status? + + def status=: ( + Lithic::Models::AccountActivityListParams::status + ) -> Lithic::Models::AccountActivityListParams::status + + def initialize: ( + ?account_token: String, + ?begin_: Time, + ?business_account_token: String, + ?category: Lithic::Models::AccountActivityListParams::category, + ?end_: Time, + ?ending_before: String, + ?financial_account_token: String, + ?page_size: Integer, + ?result: Lithic::Models::AccountActivityListParams::result, + ?starting_after: String, + ?status: Lithic::Models::AccountActivityListParams::status, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + account_token: String, + begin_: Time, + business_account_token: String, + category: Lithic::Models::AccountActivityListParams::category, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::Models::AccountActivityListParams::result, + starting_after: String, + status: Lithic::Models::AccountActivityListParams::status, + request_options: Lithic::RequestOptions + } + + type category = + :ACH + | :WIRE + | :BALANCE_OR_FUNDING + | :FEE + | :REWARD + | :ADJUSTMENT + | :DERECOGNITION + | :DISPUTE + | :CARD + | :EXTERNAL_ACH + | :EXTERNAL_CHECK + | :EXTERNAL_FEDNOW + | :EXTERNAL_RTP + | :EXTERNAL_TRANSFER + | :EXTERNAL_WIRE + | :MANAGEMENT_ADJUSTMENT + | :MANAGEMENT_DISPUTE + | :MANAGEMENT_FEE + | :MANAGEMENT_REWARD + | :MANAGEMENT_DISBURSEMENT + | :HOLD + | :PROGRAM_FUNDING + + module Category + extend Lithic::Internal::Type::Enum + + ACH: :ACH + WIRE: :WIRE + BALANCE_OR_FUNDING: :BALANCE_OR_FUNDING + FEE: :FEE + REWARD: :REWARD + ADJUSTMENT: :ADJUSTMENT + DERECOGNITION: :DERECOGNITION + DISPUTE: :DISPUTE + CARD: :CARD + EXTERNAL_ACH: :EXTERNAL_ACH + EXTERNAL_CHECK: :EXTERNAL_CHECK + EXTERNAL_FEDNOW: :EXTERNAL_FEDNOW + EXTERNAL_RTP: :EXTERNAL_RTP + EXTERNAL_TRANSFER: :EXTERNAL_TRANSFER + EXTERNAL_WIRE: :EXTERNAL_WIRE + MANAGEMENT_ADJUSTMENT: :MANAGEMENT_ADJUSTMENT + MANAGEMENT_DISPUTE: :MANAGEMENT_DISPUTE + MANAGEMENT_FEE: :MANAGEMENT_FEE + MANAGEMENT_REWARD: :MANAGEMENT_REWARD + MANAGEMENT_DISBURSEMENT: :MANAGEMENT_DISBURSEMENT + HOLD: :HOLD + PROGRAM_FUNDING: :PROGRAM_FUNDING + + def self?.values: -> ::Array[Lithic::Models::AccountActivityListParams::category] + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::AccountActivityListParams::result] + end + + type status = + :DECLINED + | :EXPIRED + | :PENDING + | :RETURNED + | :REVERSED + | :SETTLED + | :VOIDED + + module Status + extend Lithic::Internal::Type::Enum + + DECLINED: :DECLINED + EXPIRED: :EXPIRED + PENDING: :PENDING + RETURNED: :RETURNED + REVERSED: :REVERSED + SETTLED: :SETTLED + VOIDED: :VOIDED + + def self?.values: -> ::Array[Lithic::Models::AccountActivityListParams::status] + end + end + end +end diff --git a/sig/lithic/models/account_activity_list_response.rbs b/sig/lithic/models/account_activity_list_response.rbs new file mode 100644 index 00000000..42c060ef --- /dev/null +++ b/sig/lithic/models/account_activity_list_response.rbs @@ -0,0 +1,240 @@ +module Lithic + module Models + type account_activity_list_response = + Lithic::Models::AccountActivityListResponse::Internal + | Lithic::BookTransferResponse + | Lithic::Models::AccountActivityListResponse::Card + | Lithic::Payment + | Lithic::ExternalPayment + | Lithic::ManagementOperationTransaction + | Lithic::Hold + + module AccountActivityListResponse + extend Lithic::Internal::Type::Union + + type internal = + { + token: String, + category: Lithic::Models::AccountActivityListResponse::Internal::category, + created: Time, + currency: String, + descriptor: String, + events: ::Array[Lithic::FinancialEvent], + family: :INTERNAL, + financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::AccountActivityListResponse::Internal::result, + settled_amount: Integer, + status: Lithic::Models::AccountActivityListResponse::Internal::status, + updated: Time + } + + class Internal < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor category: Lithic::Models::AccountActivityListResponse::Internal::category + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor descriptor: String + + attr_accessor events: ::Array[Lithic::FinancialEvent] + + attr_accessor family: :INTERNAL + + attr_accessor financial_account_token: String + + attr_accessor pending_amount: Integer + + attr_accessor result: Lithic::Models::AccountActivityListResponse::Internal::result + + attr_accessor settled_amount: Integer + + attr_accessor status: Lithic::Models::AccountActivityListResponse::Internal::status + + attr_accessor updated: Time + + def initialize: ( + token: String, + category: Lithic::Models::AccountActivityListResponse::Internal::category, + created: Time, + currency: String, + descriptor: String, + events: ::Array[Lithic::FinancialEvent], + financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::AccountActivityListResponse::Internal::result, + settled_amount: Integer, + status: Lithic::Models::AccountActivityListResponse::Internal::status, + updated: Time, + ?family: :INTERNAL + ) -> void + + def to_hash: -> { + token: String, + category: Lithic::Models::AccountActivityListResponse::Internal::category, + created: Time, + currency: String, + descriptor: String, + events: ::Array[Lithic::FinancialEvent], + family: :INTERNAL, + financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::AccountActivityListResponse::Internal::result, + settled_amount: Integer, + status: Lithic::Models::AccountActivityListResponse::Internal::status, + updated: Time + } + + type category = + :ACH + | :WIRE + | :BALANCE_OR_FUNDING + | :FEE + | :REWARD + | :ADJUSTMENT + | :DERECOGNITION + | :DISPUTE + | :CARD + | :EXTERNAL_ACH + | :EXTERNAL_CHECK + | :EXTERNAL_FEDNOW + | :EXTERNAL_RTP + | :EXTERNAL_TRANSFER + | :EXTERNAL_WIRE + | :MANAGEMENT_ADJUSTMENT + | :MANAGEMENT_DISPUTE + | :MANAGEMENT_FEE + | :MANAGEMENT_REWARD + | :MANAGEMENT_DISBURSEMENT + | :HOLD + | :PROGRAM_FUNDING + + module Category + extend Lithic::Internal::Type::Enum + + ACH: :ACH + WIRE: :WIRE + BALANCE_OR_FUNDING: :BALANCE_OR_FUNDING + FEE: :FEE + REWARD: :REWARD + ADJUSTMENT: :ADJUSTMENT + DERECOGNITION: :DERECOGNITION + DISPUTE: :DISPUTE + CARD: :CARD + EXTERNAL_ACH: :EXTERNAL_ACH + EXTERNAL_CHECK: :EXTERNAL_CHECK + EXTERNAL_FEDNOW: :EXTERNAL_FEDNOW + EXTERNAL_RTP: :EXTERNAL_RTP + EXTERNAL_TRANSFER: :EXTERNAL_TRANSFER + EXTERNAL_WIRE: :EXTERNAL_WIRE + MANAGEMENT_ADJUSTMENT: :MANAGEMENT_ADJUSTMENT + MANAGEMENT_DISPUTE: :MANAGEMENT_DISPUTE + MANAGEMENT_FEE: :MANAGEMENT_FEE + MANAGEMENT_REWARD: :MANAGEMENT_REWARD + MANAGEMENT_DISBURSEMENT: :MANAGEMENT_DISBURSEMENT + HOLD: :HOLD + PROGRAM_FUNDING: :PROGRAM_FUNDING + + def self?.values: -> ::Array[Lithic::Models::AccountActivityListResponse::Internal::category] + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::AccountActivityListResponse::Internal::result] + end + + type status = + :PENDING | :SETTLED | :DECLINED | :REVERSED | :CANCELED | :RETURNED + + module Status + extend Lithic::Internal::Type::Enum + + PENDING: :PENDING + SETTLED: :SETTLED + DECLINED: :DECLINED + REVERSED: :REVERSED + CANCELED: :CANCELED + RETURNED: :RETURNED + + def self?.values: -> ::Array[Lithic::Models::AccountActivityListResponse::Internal::status] + end + end + + type card = + { + token: String, + created: Time, + family: :CARD, + status: Lithic::Models::AccountActivityListResponse::Card::status, + updated: Time + } + + class Card < Lithic::Models::Transaction + def token: -> String + + def token=: (String _) -> String + + def created: -> Time + + def created=: (Time _) -> Time + + def family: -> :CARD + + def family=: (:CARD _) -> :CARD + + def status: -> Lithic::Models::AccountActivityListResponse::Card::status + + def status=: ( + Lithic::Models::AccountActivityListResponse::Card::status _ + ) -> Lithic::Models::AccountActivityListResponse::Card::status + + def updated: -> Time + + def updated=: (Time _) -> Time + + def initialize: ( + token: String, + created: Time, + status: Lithic::Models::AccountActivityListResponse::Card::status, + updated: Time, + ?family: :CARD + ) -> void + + def to_hash: -> { + token: String, + created: Time, + family: :CARD, + status: Lithic::Models::AccountActivityListResponse::Card::status, + updated: Time + } + + type status = + :PENDING | :SETTLED | :DECLINED | :REVERSED | :CANCELED | :RETURNED + + module Status + extend Lithic::Internal::Type::Enum + + PENDING: :PENDING + SETTLED: :SETTLED + DECLINED: :DECLINED + REVERSED: :REVERSED + CANCELED: :CANCELED + RETURNED: :RETURNED + + def self?.values: -> ::Array[Lithic::Models::AccountActivityListResponse::Card::status] + end + end + + def self?.variants: -> ::Array[Lithic::Models::account_activity_list_response] + end + end +end diff --git a/sig/lithic/models/account_activity_retrieve_transaction_params.rbs b/sig/lithic/models/account_activity_retrieve_transaction_params.rbs new file mode 100644 index 00000000..ce7273df --- /dev/null +++ b/sig/lithic/models/account_activity_retrieve_transaction_params.rbs @@ -0,0 +1,23 @@ +module Lithic + module Models + type account_activity_retrieve_transaction_params = + { transaction_token: String } & Lithic::Internal::Type::request_parameters + + class AccountActivityRetrieveTransactionParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor transaction_token: String + + def initialize: ( + transaction_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + transaction_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/account_activity_retrieve_transaction_response.rbs b/sig/lithic/models/account_activity_retrieve_transaction_response.rbs new file mode 100644 index 00000000..fc82c753 --- /dev/null +++ b/sig/lithic/models/account_activity_retrieve_transaction_response.rbs @@ -0,0 +1,240 @@ +module Lithic + module Models + type account_activity_retrieve_transaction_response = + Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal + | Lithic::BookTransferResponse + | Lithic::Models::AccountActivityRetrieveTransactionResponse::Card + | Lithic::Payment + | Lithic::ExternalPayment + | Lithic::ManagementOperationTransaction + | Lithic::Hold + + module AccountActivityRetrieveTransactionResponse + extend Lithic::Internal::Type::Union + + type internal = + { + token: String, + category: Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::category, + created: Time, + currency: String, + descriptor: String, + events: ::Array[Lithic::FinancialEvent], + family: :INTERNAL, + financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::result, + settled_amount: Integer, + status: Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::status, + updated: Time + } + + class Internal < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor category: Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::category + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor descriptor: String + + attr_accessor events: ::Array[Lithic::FinancialEvent] + + attr_accessor family: :INTERNAL + + attr_accessor financial_account_token: String + + attr_accessor pending_amount: Integer + + attr_accessor result: Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::result + + attr_accessor settled_amount: Integer + + attr_accessor status: Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::status + + attr_accessor updated: Time + + def initialize: ( + token: String, + category: Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::category, + created: Time, + currency: String, + descriptor: String, + events: ::Array[Lithic::FinancialEvent], + financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::result, + settled_amount: Integer, + status: Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::status, + updated: Time, + ?family: :INTERNAL + ) -> void + + def to_hash: -> { + token: String, + category: Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::category, + created: Time, + currency: String, + descriptor: String, + events: ::Array[Lithic::FinancialEvent], + family: :INTERNAL, + financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::result, + settled_amount: Integer, + status: Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::status, + updated: Time + } + + type category = + :ACH + | :WIRE + | :BALANCE_OR_FUNDING + | :FEE + | :REWARD + | :ADJUSTMENT + | :DERECOGNITION + | :DISPUTE + | :CARD + | :EXTERNAL_ACH + | :EXTERNAL_CHECK + | :EXTERNAL_FEDNOW + | :EXTERNAL_RTP + | :EXTERNAL_TRANSFER + | :EXTERNAL_WIRE + | :MANAGEMENT_ADJUSTMENT + | :MANAGEMENT_DISPUTE + | :MANAGEMENT_FEE + | :MANAGEMENT_REWARD + | :MANAGEMENT_DISBURSEMENT + | :HOLD + | :PROGRAM_FUNDING + + module Category + extend Lithic::Internal::Type::Enum + + ACH: :ACH + WIRE: :WIRE + BALANCE_OR_FUNDING: :BALANCE_OR_FUNDING + FEE: :FEE + REWARD: :REWARD + ADJUSTMENT: :ADJUSTMENT + DERECOGNITION: :DERECOGNITION + DISPUTE: :DISPUTE + CARD: :CARD + EXTERNAL_ACH: :EXTERNAL_ACH + EXTERNAL_CHECK: :EXTERNAL_CHECK + EXTERNAL_FEDNOW: :EXTERNAL_FEDNOW + EXTERNAL_RTP: :EXTERNAL_RTP + EXTERNAL_TRANSFER: :EXTERNAL_TRANSFER + EXTERNAL_WIRE: :EXTERNAL_WIRE + MANAGEMENT_ADJUSTMENT: :MANAGEMENT_ADJUSTMENT + MANAGEMENT_DISPUTE: :MANAGEMENT_DISPUTE + MANAGEMENT_FEE: :MANAGEMENT_FEE + MANAGEMENT_REWARD: :MANAGEMENT_REWARD + MANAGEMENT_DISBURSEMENT: :MANAGEMENT_DISBURSEMENT + HOLD: :HOLD + PROGRAM_FUNDING: :PROGRAM_FUNDING + + def self?.values: -> ::Array[Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::category] + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::result] + end + + type status = + :PENDING | :SETTLED | :DECLINED | :REVERSED | :CANCELED | :RETURNED + + module Status + extend Lithic::Internal::Type::Enum + + PENDING: :PENDING + SETTLED: :SETTLED + DECLINED: :DECLINED + REVERSED: :REVERSED + CANCELED: :CANCELED + RETURNED: :RETURNED + + def self?.values: -> ::Array[Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::status] + end + end + + type card = + { + token: String, + created: Time, + family: :CARD, + status: Lithic::Models::AccountActivityRetrieveTransactionResponse::Card::status, + updated: Time + } + + class Card < Lithic::Models::Transaction + def token: -> String + + def token=: (String _) -> String + + def created: -> Time + + def created=: (Time _) -> Time + + def family: -> :CARD + + def family=: (:CARD _) -> :CARD + + def status: -> Lithic::Models::AccountActivityRetrieveTransactionResponse::Card::status + + def status=: ( + Lithic::Models::AccountActivityRetrieveTransactionResponse::Card::status _ + ) -> Lithic::Models::AccountActivityRetrieveTransactionResponse::Card::status + + def updated: -> Time + + def updated=: (Time _) -> Time + + def initialize: ( + token: String, + created: Time, + status: Lithic::Models::AccountActivityRetrieveTransactionResponse::Card::status, + updated: Time, + ?family: :CARD + ) -> void + + def to_hash: -> { + token: String, + created: Time, + family: :CARD, + status: Lithic::Models::AccountActivityRetrieveTransactionResponse::Card::status, + updated: Time + } + + type status = + :PENDING | :SETTLED | :DECLINED | :REVERSED | :CANCELED | :RETURNED + + module Status + extend Lithic::Internal::Type::Enum + + PENDING: :PENDING + SETTLED: :SETTLED + DECLINED: :DECLINED + REVERSED: :REVERSED + CANCELED: :CANCELED + RETURNED: :RETURNED + + def self?.values: -> ::Array[Lithic::Models::AccountActivityRetrieveTransactionResponse::Card::status] + end + end + + def self?.variants: -> ::Array[Lithic::Models::account_activity_retrieve_transaction_response] + end + end +end diff --git a/sig/lithic/models/account_financial_account_type.rbs b/sig/lithic/models/account_financial_account_type.rbs new file mode 100644 index 00000000..f22bb056 --- /dev/null +++ b/sig/lithic/models/account_financial_account_type.rbs @@ -0,0 +1,14 @@ +module Lithic + module Models + type account_financial_account_type = :ISSUING | :OPERATING + + module AccountFinancialAccountType + extend Lithic::Internal::Type::Enum + + ISSUING: :ISSUING + OPERATING: :OPERATING + + def self?.values: -> ::Array[Lithic::Models::account_financial_account_type] + end + end +end diff --git a/sig/lithic/models/account_holder.rbs b/sig/lithic/models/account_holder.rbs new file mode 100644 index 00000000..e17ace23 --- /dev/null +++ b/sig/lithic/models/account_holder.rbs @@ -0,0 +1,527 @@ +module Lithic + module Models + type account_holder = + { + token: String, + created: Time, + account_token: String, + beneficial_owner_individuals: ::Array[Lithic::AccountHolder::BeneficialOwnerIndividual], + business_account_token: String, + business_entity: Lithic::AccountHolder::BusinessEntity, + control_person: Lithic::AccountHolder::ControlPerson, + email: String, + exemption_type: Lithic::Models::AccountHolder::exemption_type, + external_id: String, + individual: Lithic::AccountHolder::Individual, + naics_code: String, + nature_of_business: String, + phone_number: String, + required_documents: ::Array[Lithic::RequiredDocument], + status: Lithic::Models::AccountHolder::status, + status_reasons: ::Array[Lithic::Models::AccountHolder::status_reason], + user_type: Lithic::Models::AccountHolder::user_type, + verification_application: Lithic::AccountHolder::VerificationApplication, + website_url: String + } + + class AccountHolder < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor created: Time + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader beneficial_owner_individuals: ::Array[Lithic::AccountHolder::BeneficialOwnerIndividual]? + + def beneficial_owner_individuals=: ( + ::Array[Lithic::AccountHolder::BeneficialOwnerIndividual] + ) -> ::Array[Lithic::AccountHolder::BeneficialOwnerIndividual] + + attr_reader business_account_token: String? + + def business_account_token=: (String) -> String + + attr_reader business_entity: Lithic::AccountHolder::BusinessEntity? + + def business_entity=: ( + Lithic::AccountHolder::BusinessEntity + ) -> Lithic::AccountHolder::BusinessEntity + + attr_reader control_person: Lithic::AccountHolder::ControlPerson? + + def control_person=: ( + Lithic::AccountHolder::ControlPerson + ) -> Lithic::AccountHolder::ControlPerson + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader exemption_type: Lithic::Models::AccountHolder::exemption_type? + + def exemption_type=: ( + Lithic::Models::AccountHolder::exemption_type + ) -> Lithic::Models::AccountHolder::exemption_type + + attr_reader external_id: String? + + def external_id=: (String) -> String + + attr_reader individual: Lithic::AccountHolder::Individual? + + def individual=: ( + Lithic::AccountHolder::Individual + ) -> Lithic::AccountHolder::Individual + + attr_reader naics_code: String? + + def naics_code=: (String) -> String + + attr_reader nature_of_business: String? + + def nature_of_business=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + attr_reader required_documents: ::Array[Lithic::RequiredDocument]? + + def required_documents=: ( + ::Array[Lithic::RequiredDocument] + ) -> ::Array[Lithic::RequiredDocument] + + attr_reader status: Lithic::Models::AccountHolder::status? + + def status=: ( + Lithic::Models::AccountHolder::status + ) -> Lithic::Models::AccountHolder::status + + attr_reader status_reasons: ::Array[Lithic::Models::AccountHolder::status_reason]? + + def status_reasons=: ( + ::Array[Lithic::Models::AccountHolder::status_reason] + ) -> ::Array[Lithic::Models::AccountHolder::status_reason] + + attr_reader user_type: Lithic::Models::AccountHolder::user_type? + + def user_type=: ( + Lithic::Models::AccountHolder::user_type + ) -> Lithic::Models::AccountHolder::user_type + + attr_reader verification_application: Lithic::AccountHolder::VerificationApplication? + + def verification_application=: ( + Lithic::AccountHolder::VerificationApplication + ) -> Lithic::AccountHolder::VerificationApplication + + attr_reader website_url: String? + + def website_url=: (String) -> String + + def initialize: ( + token: String, + created: Time, + ?account_token: String, + ?beneficial_owner_individuals: ::Array[Lithic::AccountHolder::BeneficialOwnerIndividual], + ?business_account_token: String, + ?business_entity: Lithic::AccountHolder::BusinessEntity, + ?control_person: Lithic::AccountHolder::ControlPerson, + ?email: String, + ?exemption_type: Lithic::Models::AccountHolder::exemption_type, + ?external_id: String, + ?individual: Lithic::AccountHolder::Individual, + ?naics_code: String, + ?nature_of_business: String, + ?phone_number: String, + ?required_documents: ::Array[Lithic::RequiredDocument], + ?status: Lithic::Models::AccountHolder::status, + ?status_reasons: ::Array[Lithic::Models::AccountHolder::status_reason], + ?user_type: Lithic::Models::AccountHolder::user_type, + ?verification_application: Lithic::AccountHolder::VerificationApplication, + ?website_url: String + ) -> void + + def to_hash: -> { + token: String, + created: Time, + account_token: String, + beneficial_owner_individuals: ::Array[Lithic::AccountHolder::BeneficialOwnerIndividual], + business_account_token: String, + business_entity: Lithic::AccountHolder::BusinessEntity, + control_person: Lithic::AccountHolder::ControlPerson, + email: String, + exemption_type: Lithic::Models::AccountHolder::exemption_type, + external_id: String, + individual: Lithic::AccountHolder::Individual, + naics_code: String, + nature_of_business: String, + phone_number: String, + required_documents: ::Array[Lithic::RequiredDocument], + status: Lithic::Models::AccountHolder::status, + status_reasons: ::Array[Lithic::Models::AccountHolder::status_reason], + user_type: Lithic::Models::AccountHolder::user_type, + verification_application: Lithic::AccountHolder::VerificationApplication, + website_url: String + } + + type beneficial_owner_individual = + { + address: Lithic::Address, + dob: String, + email: String, + entity_token: String, + first_name: String, + last_name: String, + phone_number: String + } + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + attr_accessor address: Lithic::Address + + attr_accessor dob: String + + attr_accessor email: String + + attr_accessor entity_token: String + + attr_accessor first_name: String + + attr_accessor last_name: String + + attr_accessor phone_number: String + + def initialize: ( + address: Lithic::Address, + dob: String, + email: String, + entity_token: String, + first_name: String, + last_name: String, + phone_number: String + ) -> void + + def to_hash: -> { + address: Lithic::Address, + dob: String, + email: String, + entity_token: String, + first_name: String, + last_name: String, + phone_number: String + } + end + + type business_entity = + { + address: Lithic::Address, + dba_business_name: String, + entity_token: String, + government_id: String, + legal_business_name: String, + phone_numbers: ::Array[String], + parent_company: String + } + + class BusinessEntity < Lithic::Internal::Type::BaseModel + attr_accessor address: Lithic::Address + + attr_accessor dba_business_name: String + + attr_accessor entity_token: String + + attr_accessor government_id: String + + attr_accessor legal_business_name: String + + attr_accessor phone_numbers: ::Array[String] + + attr_reader parent_company: String? + + def parent_company=: (String) -> String + + def initialize: ( + address: Lithic::Address, + dba_business_name: String, + entity_token: String, + government_id: String, + legal_business_name: String, + phone_numbers: ::Array[String], + ?parent_company: String + ) -> void + + def to_hash: -> { + address: Lithic::Address, + dba_business_name: String, + entity_token: String, + government_id: String, + legal_business_name: String, + phone_numbers: ::Array[String], + parent_company: String + } + end + + type control_person = + { + address: Lithic::Address, + dob: String, + email: String, + entity_token: String, + first_name: String, + last_name: String, + phone_number: String + } + + class ControlPerson < Lithic::Internal::Type::BaseModel + attr_accessor address: Lithic::Address + + attr_accessor dob: String + + attr_accessor email: String + + attr_accessor entity_token: String + + attr_accessor first_name: String + + attr_accessor last_name: String + + attr_accessor phone_number: String + + def initialize: ( + address: Lithic::Address, + dob: String, + email: String, + entity_token: String, + first_name: String, + last_name: String, + phone_number: String + ) -> void + + def to_hash: -> { + address: Lithic::Address, + dob: String, + email: String, + entity_token: String, + first_name: String, + last_name: String, + phone_number: String + } + end + + type exemption_type = :AUTHORIZED_USER | :PREPAID_CARD_USER + + module ExemptionType + extend Lithic::Internal::Type::Enum + + AUTHORIZED_USER: :AUTHORIZED_USER + PREPAID_CARD_USER: :PREPAID_CARD_USER + + def self?.values: -> ::Array[Lithic::Models::AccountHolder::exemption_type] + end + + type individual = + { + address: Lithic::Address, + dob: String, + email: String, + entity_token: String, + first_name: String, + last_name: String, + phone_number: String + } + + class Individual < Lithic::Internal::Type::BaseModel + attr_accessor address: Lithic::Address + + attr_accessor dob: String + + attr_accessor email: String + + attr_accessor entity_token: String + + attr_accessor first_name: String + + attr_accessor last_name: String + + attr_accessor phone_number: String + + def initialize: ( + address: Lithic::Address, + dob: String, + email: String, + entity_token: String, + first_name: String, + last_name: String, + phone_number: String + ) -> void + + def to_hash: -> { + address: Lithic::Address, + dob: String, + email: String, + entity_token: String, + first_name: String, + last_name: String, + phone_number: String + } + end + + type status = + :ACCEPTED + | :PENDING_REVIEW + | :PENDING_DOCUMENT + | :PENDING_RESUBMIT + | :REJECTED + + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED: :ACCEPTED + PENDING_REVIEW: :PENDING_REVIEW + PENDING_DOCUMENT: :PENDING_DOCUMENT + PENDING_RESUBMIT: :PENDING_RESUBMIT + REJECTED: :REJECTED + + def self?.values: -> ::Array[Lithic::Models::AccountHolder::status] + end + + type status_reason = + :ADDRESS_VERIFICATION_FAILURE + | :AGE_THRESHOLD_FAILURE + | :COMPLETE_VERIFICATION_FAILURE + | :DOB_VERIFICATION_FAILURE + | :ID_VERIFICATION_FAILURE + | :MAX_DOCUMENT_ATTEMPTS + | :MAX_RESUBMISSION_ATTEMPTS + | :NAME_VERIFICATION_FAILURE + | :OTHER_VERIFICATION_FAILURE + | :RISK_THRESHOLD_FAILURE + | :WATCHLIST_ALERT_FAILURE + + module StatusReason + extend Lithic::Internal::Type::Enum + + ADDRESS_VERIFICATION_FAILURE: :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE: :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE: :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE: :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE: :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS: :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS: :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE: :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE: :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE: :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE: :WATCHLIST_ALERT_FAILURE + + def self?.values: -> ::Array[Lithic::Models::AccountHolder::status_reason] + end + + type user_type = :BUSINESS | :INDIVIDUAL + + module UserType + extend Lithic::Internal::Type::Enum + + BUSINESS: :BUSINESS + INDIVIDUAL: :INDIVIDUAL + + def self?.values: -> ::Array[Lithic::Models::AccountHolder::user_type] + end + + type verification_application = + { + created: Time, + status: Lithic::Models::AccountHolder::VerificationApplication::status, + status_reasons: ::Array[Lithic::Models::AccountHolder::VerificationApplication::status_reason], + updated: Time + } + + class VerificationApplication < Lithic::Internal::Type::BaseModel + attr_reader created: Time? + + def created=: (Time) -> Time + + attr_reader status: Lithic::Models::AccountHolder::VerificationApplication::status? + + def status=: ( + Lithic::Models::AccountHolder::VerificationApplication::status + ) -> Lithic::Models::AccountHolder::VerificationApplication::status + + attr_reader status_reasons: ::Array[Lithic::Models::AccountHolder::VerificationApplication::status_reason]? + + def status_reasons=: ( + ::Array[Lithic::Models::AccountHolder::VerificationApplication::status_reason] + ) -> ::Array[Lithic::Models::AccountHolder::VerificationApplication::status_reason] + + attr_reader updated: Time? + + def updated=: (Time) -> Time + + def initialize: ( + ?created: Time, + ?status: Lithic::Models::AccountHolder::VerificationApplication::status, + ?status_reasons: ::Array[Lithic::Models::AccountHolder::VerificationApplication::status_reason], + ?updated: Time + ) -> void + + def to_hash: -> { + created: Time, + status: Lithic::Models::AccountHolder::VerificationApplication::status, + status_reasons: ::Array[Lithic::Models::AccountHolder::VerificationApplication::status_reason], + updated: Time + } + + type status = + :ACCEPTED + | :PENDING_REVIEW + | :PENDING_DOCUMENT + | :PENDING_RESUBMIT + | :REJECTED + + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED: :ACCEPTED + PENDING_REVIEW: :PENDING_REVIEW + PENDING_DOCUMENT: :PENDING_DOCUMENT + PENDING_RESUBMIT: :PENDING_RESUBMIT + REJECTED: :REJECTED + + def self?.values: -> ::Array[Lithic::Models::AccountHolder::VerificationApplication::status] + end + + type status_reason = + :ADDRESS_VERIFICATION_FAILURE + | :AGE_THRESHOLD_FAILURE + | :COMPLETE_VERIFICATION_FAILURE + | :DOB_VERIFICATION_FAILURE + | :ID_VERIFICATION_FAILURE + | :MAX_DOCUMENT_ATTEMPTS + | :MAX_RESUBMISSION_ATTEMPTS + | :NAME_VERIFICATION_FAILURE + | :OTHER_VERIFICATION_FAILURE + | :RISK_THRESHOLD_FAILURE + | :WATCHLIST_ALERT_FAILURE + + module StatusReason + extend Lithic::Internal::Type::Enum + + ADDRESS_VERIFICATION_FAILURE: :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE: :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE: :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE: :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE: :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS: :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS: :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE: :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE: :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE: :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE: :WATCHLIST_ALERT_FAILURE + + def self?.values: -> ::Array[Lithic::Models::AccountHolder::VerificationApplication::status_reason] + end + end + end + end +end diff --git a/sig/lithic/models/account_holder_create_params.rbs b/sig/lithic/models/account_holder_create_params.rbs new file mode 100644 index 00000000..bcbb4c70 --- /dev/null +++ b/sig/lithic/models/account_holder_create_params.rbs @@ -0,0 +1,289 @@ +module Lithic + module Models + type account_holder_create_params = + { body: Lithic::Models::AccountHolderCreateParams::body } + & Lithic::Internal::Type::request_parameters + + class AccountHolderCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor body: Lithic::Models::AccountHolderCreateParams::body + + def initialize: ( + body: Lithic::Models::AccountHolderCreateParams::body, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + body: Lithic::Models::AccountHolderCreateParams::body, + request_options: Lithic::RequestOptions + } + + type body = + Lithic::KYB + | Lithic::AccountHolderCreateParams::Body::KYBDelegated + | Lithic::KYC + | Lithic::KYCExempt + + module Body + extend Lithic::Internal::Type::Union + + type kyb_delegated = + { + business_entity: Lithic::AccountHolderCreateParams::Body::KYBDelegated::BusinessEntity, + beneficial_owner_individuals: ::Array[Lithic::AccountHolderCreateParams::Body::KYBDelegated::BeneficialOwnerIndividual], + control_person: Lithic::AccountHolderCreateParams::Body::KYBDelegated::ControlPerson, + external_id: String, + naics_code: String, + nature_of_business: String, + tos_timestamp: String, + website_url: String, + workflow: Lithic::Models::AccountHolderCreateParams::Body::KYBDelegated::workflow + } + + class KYBDelegated < Lithic::Internal::Type::BaseModel + attr_accessor business_entity: Lithic::AccountHolderCreateParams::Body::KYBDelegated::BusinessEntity + + attr_reader beneficial_owner_individuals: ::Array[Lithic::AccountHolderCreateParams::Body::KYBDelegated::BeneficialOwnerIndividual]? + + def beneficial_owner_individuals=: ( + ::Array[Lithic::AccountHolderCreateParams::Body::KYBDelegated::BeneficialOwnerIndividual] + ) -> ::Array[Lithic::AccountHolderCreateParams::Body::KYBDelegated::BeneficialOwnerIndividual] + + attr_reader control_person: Lithic::AccountHolderCreateParams::Body::KYBDelegated::ControlPerson? + + def control_person=: ( + Lithic::AccountHolderCreateParams::Body::KYBDelegated::ControlPerson + ) -> Lithic::AccountHolderCreateParams::Body::KYBDelegated::ControlPerson + + attr_reader external_id: String? + + def external_id=: (String) -> String + + attr_reader naics_code: String? + + def naics_code=: (String) -> String + + attr_reader nature_of_business: String? + + def nature_of_business=: (String) -> String + + attr_reader tos_timestamp: String? + + def tos_timestamp=: (String) -> String + + attr_reader website_url: String? + + def website_url=: (String) -> String + + attr_reader workflow: Lithic::Models::AccountHolderCreateParams::Body::KYBDelegated::workflow? + + def workflow=: ( + Lithic::Models::AccountHolderCreateParams::Body::KYBDelegated::workflow + ) -> Lithic::Models::AccountHolderCreateParams::Body::KYBDelegated::workflow + + def initialize: ( + business_entity: Lithic::AccountHolderCreateParams::Body::KYBDelegated::BusinessEntity, + ?beneficial_owner_individuals: ::Array[Lithic::AccountHolderCreateParams::Body::KYBDelegated::BeneficialOwnerIndividual], + ?control_person: Lithic::AccountHolderCreateParams::Body::KYBDelegated::ControlPerson, + ?external_id: String, + ?naics_code: String, + ?nature_of_business: String, + ?tos_timestamp: String, + ?website_url: String, + ?workflow: Lithic::Models::AccountHolderCreateParams::Body::KYBDelegated::workflow + ) -> void + + def to_hash: -> { + business_entity: Lithic::AccountHolderCreateParams::Body::KYBDelegated::BusinessEntity, + beneficial_owner_individuals: ::Array[Lithic::AccountHolderCreateParams::Body::KYBDelegated::BeneficialOwnerIndividual], + control_person: Lithic::AccountHolderCreateParams::Body::KYBDelegated::ControlPerson, + external_id: String, + naics_code: String, + nature_of_business: String, + tos_timestamp: String, + website_url: String, + workflow: Lithic::Models::AccountHolderCreateParams::Body::KYBDelegated::workflow + } + + type business_entity = + { + address: Lithic::Address, + legal_business_name: String, + dba_business_name: String, + government_id: String, + parent_company: String, + phone_numbers: ::Array[String] + } + + class BusinessEntity < Lithic::Internal::Type::BaseModel + attr_accessor address: Lithic::Address + + attr_accessor legal_business_name: String + + attr_reader dba_business_name: String? + + def dba_business_name=: (String) -> String + + attr_reader government_id: String? + + def government_id=: (String) -> String + + attr_reader parent_company: String? + + def parent_company=: (String) -> String + + attr_reader phone_numbers: ::Array[String]? + + def phone_numbers=: (::Array[String]) -> ::Array[String] + + def initialize: ( + address: Lithic::Address, + legal_business_name: String, + ?dba_business_name: String, + ?government_id: String, + ?parent_company: String, + ?phone_numbers: ::Array[String] + ) -> void + + def to_hash: -> { + address: Lithic::Address, + legal_business_name: String, + dba_business_name: String, + government_id: String, + parent_company: String, + phone_numbers: ::Array[String] + } + end + + type beneficial_owner_individual = + { + first_name: String, + last_name: String, + address: Lithic::Address, + dob: String, + email: String, + government_id: String, + phone_number: String + } + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + attr_accessor first_name: String + + attr_accessor last_name: String + + attr_reader address: Lithic::Address? + + def address=: (Lithic::Address) -> Lithic::Address + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader government_id: String? + + def government_id=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + first_name: String, + last_name: String, + ?address: Lithic::Address, + ?dob: String, + ?email: String, + ?government_id: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + first_name: String, + last_name: String, + address: Lithic::Address, + dob: String, + email: String, + government_id: String, + phone_number: String + } + end + + type control_person = + { + first_name: String, + last_name: String, + address: Lithic::Address, + dob: String, + email: String, + government_id: String, + phone_number: String + } + + class ControlPerson < Lithic::Internal::Type::BaseModel + attr_accessor first_name: String + + attr_accessor last_name: String + + attr_reader address: Lithic::Address? + + def address=: (Lithic::Address) -> Lithic::Address + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader government_id: String? + + def government_id=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + first_name: String, + last_name: String, + ?address: Lithic::Address, + ?dob: String, + ?email: String, + ?government_id: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + first_name: String, + last_name: String, + address: Lithic::Address, + dob: String, + email: String, + government_id: String, + phone_number: String + } + end + + type workflow = :KYB_DELEGATED + + module Workflow + extend Lithic::Internal::Type::Enum + + KYB_DELEGATED: :KYB_DELEGATED + + def self?.values: -> ::Array[Lithic::Models::AccountHolderCreateParams::Body::KYBDelegated::workflow] + end + end + + def self?.variants: -> ::Array[Lithic::Models::AccountHolderCreateParams::body] + end + end + end +end diff --git a/sig/lithic/models/account_holder_create_response.rbs b/sig/lithic/models/account_holder_create_response.rbs new file mode 100644 index 00000000..f95948e5 --- /dev/null +++ b/sig/lithic/models/account_holder_create_response.rbs @@ -0,0 +1,134 @@ +module Lithic + module Models + type account_holder_create_response = + { + token: String, + account_token: String, + status: Lithic::Models::AccountHolderCreateResponse::status, + status_reasons: ::Array[Lithic::Models::AccountHolderCreateResponse::status_reason], + created: Time, + external_id: String, + required_documents: ::Array[Lithic::RequiredDocument] + } + + class AccountHolderCreateResponse < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor account_token: String + + attr_accessor status: Lithic::Models::AccountHolderCreateResponse::status + + attr_accessor status_reasons: ::Array[Lithic::Models::AccountHolderCreateResponse::status_reason] + + attr_reader created: Time? + + def created=: (Time) -> Time + + attr_reader external_id: String? + + def external_id=: (String) -> String + + attr_reader required_documents: ::Array[Lithic::RequiredDocument]? + + def required_documents=: ( + ::Array[Lithic::RequiredDocument] + ) -> ::Array[Lithic::RequiredDocument] + + def initialize: ( + token: String, + account_token: String, + status: Lithic::Models::AccountHolderCreateResponse::status, + status_reasons: ::Array[Lithic::Models::AccountHolderCreateResponse::status_reason], + ?created: Time, + ?external_id: String, + ?required_documents: ::Array[Lithic::RequiredDocument] + ) -> void + + def to_hash: -> { + token: String, + account_token: String, + status: Lithic::Models::AccountHolderCreateResponse::status, + status_reasons: ::Array[Lithic::Models::AccountHolderCreateResponse::status_reason], + created: Time, + external_id: String, + required_documents: ::Array[Lithic::RequiredDocument] + } + + type status = + :ACCEPTED + | :PENDING_REVIEW + | :PENDING_DOCUMENT + | :PENDING_RESUBMIT + | :REJECTED + + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED: :ACCEPTED + PENDING_REVIEW: :PENDING_REVIEW + PENDING_DOCUMENT: :PENDING_DOCUMENT + PENDING_RESUBMIT: :PENDING_RESUBMIT + REJECTED: :REJECTED + + def self?.values: -> ::Array[Lithic::Models::AccountHolderCreateResponse::status] + end + + type status_reason = + :ADDRESS_VERIFICATION_FAILURE + | :AGE_THRESHOLD_FAILURE + | :COMPLETE_VERIFICATION_FAILURE + | :DOB_VERIFICATION_FAILURE + | :ID_VERIFICATION_FAILURE + | :MAX_DOCUMENT_ATTEMPTS + | :MAX_RESUBMISSION_ATTEMPTS + | :NAME_VERIFICATION_FAILURE + | :OTHER_VERIFICATION_FAILURE + | :RISK_THRESHOLD_FAILURE + | :WATCHLIST_ALERT_FAILURE + | :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + | :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + | :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + | :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + | :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + | :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + | :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + | :CONTROL_PERSON_ID_VERIFICATION_FAILURE + | :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + | :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + module StatusReason + extend Lithic::Internal::Type::Enum + + ADDRESS_VERIFICATION_FAILURE: :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE: :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE: :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE: :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE: :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS: :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS: :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE: :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE: :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE: :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE: :WATCHLIST_ALERT_FAILURE + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED: :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE: :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED: :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE: :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE: :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE: :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE: :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + CONTROL_PERSON_ID_VERIFICATION_FAILURE: :CONTROL_PERSON_ID_VERIFICATION_FAILURE + CONTROL_PERSON_DOB_VERIFICATION_FAILURE: :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + CONTROL_PERSON_NAME_VERIFICATION_FAILURE: :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + def self?.values: -> ::Array[Lithic::Models::AccountHolderCreateResponse::status_reason] + end + end + end +end diff --git a/sig/lithic/models/account_holder_created_webhook_event.rbs b/sig/lithic/models/account_holder_created_webhook_event.rbs new file mode 100644 index 00000000..3d1a5e66 --- /dev/null +++ b/sig/lithic/models/account_holder_created_webhook_event.rbs @@ -0,0 +1,77 @@ +module Lithic + module Models + type account_holder_created_webhook_event = + { + event_type: :"account_holder.created", + token: String, + account_token: String, + created: Time, + required_documents: ::Array[Lithic::RequiredDocument], + status: Lithic::Models::AccountHolderCreatedWebhookEvent::status, + status_reason: ::Array[String] + } + + class AccountHolderCreatedWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor event_type: :"account_holder.created" + + attr_reader token: String? + + def token=: (String) -> String + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader created: Time? + + def created=: (Time) -> Time + + attr_reader required_documents: ::Array[Lithic::RequiredDocument]? + + def required_documents=: ( + ::Array[Lithic::RequiredDocument] + ) -> ::Array[Lithic::RequiredDocument] + + attr_reader status: Lithic::Models::AccountHolderCreatedWebhookEvent::status? + + def status=: ( + Lithic::Models::AccountHolderCreatedWebhookEvent::status + ) -> Lithic::Models::AccountHolderCreatedWebhookEvent::status + + attr_reader status_reason: ::Array[String]? + + def status_reason=: (::Array[String]) -> ::Array[String] + + def initialize: ( + ?token: String, + ?account_token: String, + ?created: Time, + ?required_documents: ::Array[Lithic::RequiredDocument], + ?status: Lithic::Models::AccountHolderCreatedWebhookEvent::status, + ?status_reason: ::Array[String], + ?event_type: :"account_holder.created" + ) -> void + + def to_hash: -> { + event_type: :"account_holder.created", + token: String, + account_token: String, + created: Time, + required_documents: ::Array[Lithic::RequiredDocument], + status: Lithic::Models::AccountHolderCreatedWebhookEvent::status, + status_reason: ::Array[String] + } + + type status = :ACCEPTED | :PENDING_REVIEW + + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED: :ACCEPTED + PENDING_REVIEW: :PENDING_REVIEW + + def self?.values: -> ::Array[Lithic::Models::AccountHolderCreatedWebhookEvent::status] + end + end + end +end diff --git a/sig/lithic/models/account_holder_document_updated_webhook_event.rbs b/sig/lithic/models/account_holder_document_updated_webhook_event.rbs new file mode 100644 index 00000000..8bfaaf36 --- /dev/null +++ b/sig/lithic/models/account_holder_document_updated_webhook_event.rbs @@ -0,0 +1,219 @@ +module Lithic + module Models + type account_holder_document_updated_webhook_event = + { + event_type: :"account_holder_document.updated", + token: String, + account_holder_token: String, + created: Time, + document_type: Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::document_type, + entity_token: String, + required_document_uploads: ::Array[Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload] + } + + class AccountHolderDocumentUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor event_type: :"account_holder_document.updated" + + attr_reader token: String? + + def token=: (String) -> String + + attr_reader account_holder_token: String? + + def account_holder_token=: (String) -> String + + attr_reader created: Time? + + def created=: (Time) -> Time + + attr_reader document_type: Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::document_type? + + def document_type=: ( + Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::document_type + ) -> Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::document_type + + attr_reader entity_token: String? + + def entity_token=: (String) -> String + + attr_reader required_document_uploads: ::Array[Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload]? + + def required_document_uploads=: ( + ::Array[Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload] + ) -> ::Array[Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload] + + def initialize: ( + ?token: String, + ?account_holder_token: String, + ?created: Time, + ?document_type: Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::document_type, + ?entity_token: String, + ?required_document_uploads: ::Array[Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload], + ?event_type: :"account_holder_document.updated" + ) -> void + + def to_hash: -> { + event_type: :"account_holder_document.updated", + token: String, + account_holder_token: String, + created: Time, + document_type: Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::document_type, + entity_token: String, + required_document_uploads: ::Array[Lithic::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload] + } + + type document_type = + :DRIVERS_LICENSE + | :PASSPORT + | :PASSPORT_CARD + | :EIN_LETTER + | :TAX_RETURN + | :OPERATING_AGREEMENT + | :CERTIFICATE_OF_FORMATION + | :CERTIFICATE_OF_GOOD_STANDING + | :ARTICLES_OF_INCORPORATION + | :ARTICLES_OF_ORGANIZATION + | :BYLAWS + | :GOVERNMENT_BUSINESS_LICENSE + | :PARTNERSHIP_AGREEMENT + | :SS4_FORM + | :BANK_STATEMENT + | :UTILITY_BILL_STATEMENT + | :SSN_CARD + | :ITIN_LETTER + | :FINCEN_BOI_REPORT + + module DocumentType + extend Lithic::Internal::Type::Enum + + DRIVERS_LICENSE: :DRIVERS_LICENSE + PASSPORT: :PASSPORT + PASSPORT_CARD: :PASSPORT_CARD + EIN_LETTER: :EIN_LETTER + TAX_RETURN: :TAX_RETURN + OPERATING_AGREEMENT: :OPERATING_AGREEMENT + CERTIFICATE_OF_FORMATION: :CERTIFICATE_OF_FORMATION + CERTIFICATE_OF_GOOD_STANDING: :CERTIFICATE_OF_GOOD_STANDING + ARTICLES_OF_INCORPORATION: :ARTICLES_OF_INCORPORATION + ARTICLES_OF_ORGANIZATION: :ARTICLES_OF_ORGANIZATION + BYLAWS: :BYLAWS + GOVERNMENT_BUSINESS_LICENSE: :GOVERNMENT_BUSINESS_LICENSE + PARTNERSHIP_AGREEMENT: :PARTNERSHIP_AGREEMENT + SS4_FORM: :SS4_FORM + BANK_STATEMENT: :BANK_STATEMENT + UTILITY_BILL_STATEMENT: :UTILITY_BILL_STATEMENT + SSN_CARD: :SSN_CARD + ITIN_LETTER: :ITIN_LETTER + FINCEN_BOI_REPORT: :FINCEN_BOI_REPORT + + def self?.values: -> ::Array[Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::document_type] + end + + type required_document_upload = + { + token: String, + accepted_entity_status_reasons: ::Array[String], + created: Time, + image_type: Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::image_type, + rejected_entity_status_reasons: ::Array[String], + status: Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::status, + status_reasons: ::Array[String], + updated: Time + } + + class RequiredDocumentUpload < Lithic::Internal::Type::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader accepted_entity_status_reasons: ::Array[String]? + + def accepted_entity_status_reasons=: ( + ::Array[String] + ) -> ::Array[String] + + attr_reader created: Time? + + def created=: (Time) -> Time + + attr_reader image_type: Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::image_type? + + def image_type=: ( + Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::image_type + ) -> Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::image_type + + attr_reader rejected_entity_status_reasons: ::Array[String]? + + def rejected_entity_status_reasons=: ( + ::Array[String] + ) -> ::Array[String] + + attr_reader status: Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::status? + + def status=: ( + Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::status + ) -> Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::status + + attr_reader status_reasons: ::Array[String]? + + def status_reasons=: (::Array[String]) -> ::Array[String] + + attr_reader updated: Time? + + def updated=: (Time) -> Time + + def initialize: ( + ?token: String, + ?accepted_entity_status_reasons: ::Array[String], + ?created: Time, + ?image_type: Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::image_type, + ?rejected_entity_status_reasons: ::Array[String], + ?status: Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::status, + ?status_reasons: ::Array[String], + ?updated: Time + ) -> void + + def to_hash: -> { + token: String, + accepted_entity_status_reasons: ::Array[String], + created: Time, + image_type: Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::image_type, + rejected_entity_status_reasons: ::Array[String], + status: Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::status, + status_reasons: ::Array[String], + updated: Time + } + + type image_type = :FRONT | :BACK + + module ImageType + extend Lithic::Internal::Type::Enum + + FRONT: :FRONT + BACK: :BACK + + def self?.values: -> ::Array[Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::image_type] + end + + type status = + :ACCEPTED + | :REJECTED + | :PENDING_UPLOAD + | :UPLOADED + | :PARTIAL_APPROVAL + + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED: :ACCEPTED + REJECTED: :REJECTED + PENDING_UPLOAD: :PENDING_UPLOAD + UPLOADED: :UPLOADED + PARTIAL_APPROVAL: :PARTIAL_APPROVAL + + def self?.values: -> ::Array[Lithic::Models::AccountHolderDocumentUpdatedWebhookEvent::RequiredDocumentUpload::status] + end + end + end + end +end diff --git a/sig/lithic/models/account_holder_list_documents_params.rbs b/sig/lithic/models/account_holder_list_documents_params.rbs new file mode 100644 index 00000000..9f164415 --- /dev/null +++ b/sig/lithic/models/account_holder_list_documents_params.rbs @@ -0,0 +1,24 @@ +module Lithic + module Models + type account_holder_list_documents_params = + { account_holder_token: String } + & Lithic::Internal::Type::request_parameters + + class AccountHolderListDocumentsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor account_holder_token: String + + def initialize: ( + account_holder_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + account_holder_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/account_holder_list_documents_response.rbs b/sig/lithic/models/account_holder_list_documents_response.rbs new file mode 100644 index 00000000..2821f594 --- /dev/null +++ b/sig/lithic/models/account_holder_list_documents_response.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + type account_holder_list_documents_response = + { data: ::Array[Lithic::Document] } + + class AccountHolderListDocumentsResponse < Lithic::Internal::Type::BaseModel + attr_reader data: ::Array[Lithic::Document]? + + def data=: (::Array[Lithic::Document]) -> ::Array[Lithic::Document] + + def initialize: (?data: ::Array[Lithic::Document]) -> void + + def to_hash: -> { data: ::Array[Lithic::Document] } + end + end +end diff --git a/sig/lithic/models/account_holder_list_params.rbs b/sig/lithic/models/account_holder_list_params.rbs new file mode 100644 index 00000000..701d0091 --- /dev/null +++ b/sig/lithic/models/account_holder_list_params.rbs @@ -0,0 +1,98 @@ +module Lithic + module Models + type account_holder_list_params = + { + begin_: Time, + email: String, + end_: Time, + ending_before: String, + external_id: String, + first_name: String, + last_name: String, + legal_business_name: String, + limit: Integer, + phone_number: String, + starting_after: String + } + & Lithic::Internal::Type::request_parameters + + class AccountHolderListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader external_id: String? + + def external_id=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader legal_business_name: String? + + def legal_business_name=: (String) -> String + + attr_reader limit: Integer? + + def limit=: (Integer) -> Integer + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + ?begin_: Time, + ?email: String, + ?end_: Time, + ?ending_before: String, + ?external_id: String, + ?first_name: String, + ?last_name: String, + ?legal_business_name: String, + ?limit: Integer, + ?phone_number: String, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + begin_: Time, + email: String, + end_: Time, + ending_before: String, + external_id: String, + first_name: String, + last_name: String, + legal_business_name: String, + limit: Integer, + phone_number: String, + starting_after: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/account_holder_retrieve_document_params.rbs b/sig/lithic/models/account_holder_retrieve_document_params.rbs new file mode 100644 index 00000000..c43ad215 --- /dev/null +++ b/sig/lithic/models/account_holder_retrieve_document_params.rbs @@ -0,0 +1,28 @@ +module Lithic + module Models + type account_holder_retrieve_document_params = + { account_holder_token: String, document_token: String } + & Lithic::Internal::Type::request_parameters + + class AccountHolderRetrieveDocumentParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor account_holder_token: String + + attr_accessor document_token: String + + def initialize: ( + account_holder_token: String, + document_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + account_holder_token: String, + document_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/account_holder_retrieve_params.rbs b/sig/lithic/models/account_holder_retrieve_params.rbs new file mode 100644 index 00000000..01a10f5b --- /dev/null +++ b/sig/lithic/models/account_holder_retrieve_params.rbs @@ -0,0 +1,24 @@ +module Lithic + module Models + type account_holder_retrieve_params = + { account_holder_token: String } + & Lithic::Internal::Type::request_parameters + + class AccountHolderRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor account_holder_token: String + + def initialize: ( + account_holder_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + account_holder_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/account_holder_simulate_enrollment_document_review_params.rbs b/sig/lithic/models/account_holder_simulate_enrollment_document_review_params.rbs new file mode 100644 index 00000000..c622084a --- /dev/null +++ b/sig/lithic/models/account_holder_simulate_enrollment_document_review_params.rbs @@ -0,0 +1,91 @@ +module Lithic + module Models + type account_holder_simulate_enrollment_document_review_params = + { + document_upload_token: String, + status: Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::status, + accepted_entity_status_reasons: ::Array[String], + status_reason: Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::status_reason + } + & Lithic::Internal::Type::request_parameters + + class AccountHolderSimulateEnrollmentDocumentReviewParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor document_upload_token: String + + attr_accessor status: Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::status + + attr_reader accepted_entity_status_reasons: ::Array[String]? + + def accepted_entity_status_reasons=: (::Array[String]) -> ::Array[String] + + attr_reader status_reason: Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::status_reason? + + def status_reason=: ( + Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::status_reason + ) -> Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::status_reason + + def initialize: ( + document_upload_token: String, + status: Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::status, + ?accepted_entity_status_reasons: ::Array[String], + ?status_reason: Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::status_reason, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + document_upload_token: String, + status: Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::status, + accepted_entity_status_reasons: ::Array[String], + status_reason: Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::status_reason, + request_options: Lithic::RequestOptions + } + + type status = :UPLOADED | :ACCEPTED | :REJECTED | :PARTIAL_APPROVAL + + module Status + extend Lithic::Internal::Type::Enum + + UPLOADED: :UPLOADED + ACCEPTED: :ACCEPTED + REJECTED: :REJECTED + PARTIAL_APPROVAL: :PARTIAL_APPROVAL + + def self?.values: -> ::Array[Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::status] + end + + type status_reason = + :DOCUMENT_MISSING_REQUIRED_DATA + | :DOCUMENT_UPLOAD_TOO_BLURRY + | :FILE_SIZE_TOO_LARGE + | :INVALID_DOCUMENT_TYPE + | :INVALID_DOCUMENT_UPLOAD + | :INVALID_ENTITY + | :DOCUMENT_EXPIRED + | :DOCUMENT_ISSUED_GREATER_THAN_30_DAYS + | :DOCUMENT_TYPE_NOT_SUPPORTED + | :UNKNOWN_FAILURE_REASON + | :UNKNOWN_ERROR + + module StatusReason + extend Lithic::Internal::Type::Enum + + DOCUMENT_MISSING_REQUIRED_DATA: :DOCUMENT_MISSING_REQUIRED_DATA + DOCUMENT_UPLOAD_TOO_BLURRY: :DOCUMENT_UPLOAD_TOO_BLURRY + FILE_SIZE_TOO_LARGE: :FILE_SIZE_TOO_LARGE + INVALID_DOCUMENT_TYPE: :INVALID_DOCUMENT_TYPE + INVALID_DOCUMENT_UPLOAD: :INVALID_DOCUMENT_UPLOAD + INVALID_ENTITY: :INVALID_ENTITY + DOCUMENT_EXPIRED: :DOCUMENT_EXPIRED + DOCUMENT_ISSUED_GREATER_THAN_30_DAYS: :DOCUMENT_ISSUED_GREATER_THAN_30_DAYS + DOCUMENT_TYPE_NOT_SUPPORTED: :DOCUMENT_TYPE_NOT_SUPPORTED + UNKNOWN_FAILURE_REASON: :UNKNOWN_FAILURE_REASON + UNKNOWN_ERROR: :UNKNOWN_ERROR + + def self?.values: -> ::Array[Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::status_reason] + end + end + end +end diff --git a/sig/lithic/models/account_holder_simulate_enrollment_review_params.rbs b/sig/lithic/models/account_holder_simulate_enrollment_review_params.rbs new file mode 100644 index 00000000..16e2f39c --- /dev/null +++ b/sig/lithic/models/account_holder_simulate_enrollment_review_params.rbs @@ -0,0 +1,101 @@ +module Lithic + module Models + type account_holder_simulate_enrollment_review_params = + { + account_holder_token: String, + status: Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status, + status_reasons: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status_reason] + } + & Lithic::Internal::Type::request_parameters + + class AccountHolderSimulateEnrollmentReviewParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader account_holder_token: String? + + def account_holder_token=: (String) -> String + + attr_reader status: Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status? + + def status=: ( + Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status + ) -> Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status + + attr_reader status_reasons: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status_reason]? + + def status_reasons=: ( + ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status_reason] + ) -> ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status_reason] + + def initialize: ( + ?account_holder_token: String, + ?status: Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status, + ?status_reasons: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status_reason], + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + account_holder_token: String, + status: Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status, + status_reasons: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status_reason], + request_options: Lithic::RequestOptions + } + + type status = :ACCEPTED | :REJECTED | :PENDING_REVIEW + + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED: :ACCEPTED + REJECTED: :REJECTED + PENDING_REVIEW: :PENDING_REVIEW + + def self?.values: -> ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status] + end + + type status_reason = + :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + | :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + | :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + | :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + | :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + | :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + | :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + | :CONTROL_PERSON_ID_VERIFICATION_FAILURE + | :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + | :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + | :BENEFICIAL_OWNER_INDIVIDUAL_DOB_VERIFICATION_FAILURE + | :BENEFICIAL_OWNER_INDIVIDUAL_BLOCKLIST_ALERT_FAILURE + | :BENEFICIAL_OWNER_INDIVIDUAL_ID_VERIFICATION_FAILURE + | :BENEFICIAL_OWNER_INDIVIDUAL_NAME_VERIFICATION_FAILURE + + module StatusReason + extend Lithic::Internal::Type::Enum + + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED: :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE: :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED: :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE: :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE: :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE: :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE: :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + CONTROL_PERSON_ID_VERIFICATION_FAILURE: :CONTROL_PERSON_ID_VERIFICATION_FAILURE + CONTROL_PERSON_DOB_VERIFICATION_FAILURE: :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + CONTROL_PERSON_NAME_VERIFICATION_FAILURE: :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + BENEFICIAL_OWNER_INDIVIDUAL_DOB_VERIFICATION_FAILURE: :BENEFICIAL_OWNER_INDIVIDUAL_DOB_VERIFICATION_FAILURE + BENEFICIAL_OWNER_INDIVIDUAL_BLOCKLIST_ALERT_FAILURE: :BENEFICIAL_OWNER_INDIVIDUAL_BLOCKLIST_ALERT_FAILURE + BENEFICIAL_OWNER_INDIVIDUAL_ID_VERIFICATION_FAILURE: :BENEFICIAL_OWNER_INDIVIDUAL_ID_VERIFICATION_FAILURE + BENEFICIAL_OWNER_INDIVIDUAL_NAME_VERIFICATION_FAILURE: :BENEFICIAL_OWNER_INDIVIDUAL_NAME_VERIFICATION_FAILURE + + def self?.values: -> ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status_reason] + end + end + end +end diff --git a/sig/lithic/models/account_holder_simulate_enrollment_review_response.rbs b/sig/lithic/models/account_holder_simulate_enrollment_review_response.rbs new file mode 100644 index 00000000..1eb000a5 --- /dev/null +++ b/sig/lithic/models/account_holder_simulate_enrollment_review_response.rbs @@ -0,0 +1,674 @@ +module Lithic + module Models + type account_holder_simulate_enrollment_review_response = + { + token: String, + account_token: String, + beneficial_owner_individuals: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual], + business_account_token: String?, + business_entity: Lithic::KYBBusinessEntity, + control_person: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson, + created: Time, + email: String, + exemption_type: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::exemption_type?, + external_id: String?, + individual: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual, + naics_code: String?, + nature_of_business: String, + phone_number: String, + required_documents: ::Array[Lithic::RequiredDocument], + status: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::status, + status_reasons: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::status_reason], + user_type: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::user_type, + verification_application: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication, + website_url: String + } + + class AccountHolderSimulateEnrollmentReviewResponse < Lithic::Internal::Type::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader beneficial_owner_individuals: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual]? + + def beneficial_owner_individuals=: ( + ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual] + ) -> ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual] + + attr_accessor business_account_token: String? + + attr_reader business_entity: Lithic::KYBBusinessEntity? + + def business_entity=: ( + Lithic::KYBBusinessEntity + ) -> Lithic::KYBBusinessEntity + + attr_reader control_person: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson? + + def control_person=: ( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson + ) -> Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson + + attr_reader created: Time? + + def created=: (Time) -> Time + + attr_reader email: String? + + def email=: (String) -> String + + attr_accessor exemption_type: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::exemption_type? + + attr_accessor external_id: String? + + attr_reader individual: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual? + + def individual=: ( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual + ) -> Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual + + attr_accessor naics_code: String? + + attr_reader nature_of_business: String? + + def nature_of_business=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + attr_reader required_documents: ::Array[Lithic::RequiredDocument]? + + def required_documents=: ( + ::Array[Lithic::RequiredDocument] + ) -> ::Array[Lithic::RequiredDocument] + + attr_reader status: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::status? + + def status=: ( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::status + ) -> Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::status + + attr_reader status_reasons: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::status_reason]? + + def status_reasons=: ( + ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::status_reason] + ) -> ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::status_reason] + + attr_reader user_type: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::user_type? + + def user_type=: ( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::user_type + ) -> Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::user_type + + attr_reader verification_application: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication? + + def verification_application=: ( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication + ) -> Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication + + attr_reader website_url: String? + + def website_url=: (String) -> String + + def initialize: ( + ?token: String, + ?account_token: String, + ?beneficial_owner_individuals: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual], + ?business_account_token: String?, + ?business_entity: Lithic::KYBBusinessEntity, + ?control_person: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson, + ?created: Time, + ?email: String, + ?exemption_type: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::exemption_type?, + ?external_id: String?, + ?individual: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual, + ?naics_code: String?, + ?nature_of_business: String, + ?phone_number: String, + ?required_documents: ::Array[Lithic::RequiredDocument], + ?status: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::status, + ?status_reasons: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::status_reason], + ?user_type: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::user_type, + ?verification_application: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication, + ?website_url: String + ) -> void + + def to_hash: -> { + token: String, + account_token: String, + beneficial_owner_individuals: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual], + business_account_token: String?, + business_entity: Lithic::KYBBusinessEntity, + control_person: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson, + created: Time, + email: String, + exemption_type: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::exemption_type?, + external_id: String?, + individual: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual, + naics_code: String?, + nature_of_business: String, + phone_number: String, + required_documents: ::Array[Lithic::RequiredDocument], + status: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::status, + status_reasons: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::status_reason], + user_type: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::user_type, + verification_application: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication, + website_url: String + } + + type beneficial_owner_individual = + { + address: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + attr_reader address: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::Address? + + def address=: ( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::Address + ) -> Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::Address + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + ?address: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::Address, + ?dob: String, + ?email: String, + ?first_name: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + address: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::Internal::Type::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + end + end + + type control_person = + { + address: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class ControlPerson < Lithic::Internal::Type::BaseModel + attr_reader address: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::Address? + + def address=: ( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::Address + ) -> Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::Address + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + ?address: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::Address, + ?dob: String, + ?email: String, + ?first_name: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + address: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::Internal::Type::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + end + end + + type exemption_type = :AUTHORIZED_USER | :PREPAID_CARD_USER + + module ExemptionType + extend Lithic::Internal::Type::Enum + + AUTHORIZED_USER: :AUTHORIZED_USER + PREPAID_CARD_USER: :PREPAID_CARD_USER + + def self?.values: -> ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::exemption_type] + end + + type individual = + { + address: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class Individual < Lithic::Internal::Type::BaseModel + attr_reader address: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::Address? + + def address=: ( + Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::Address + ) -> Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::Address + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + ?address: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::Address, + ?dob: String, + ?email: String, + ?first_name: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + address: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::Internal::Type::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + end + end + + type status = + :ACCEPTED | :PENDING_DOCUMENT | :PENDING_RESUBMIT | :REJECTED + + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED: :ACCEPTED + PENDING_DOCUMENT: :PENDING_DOCUMENT + PENDING_RESUBMIT: :PENDING_RESUBMIT + REJECTED: :REJECTED + + def self?.values: -> ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::status] + end + + type status_reason = + :ADDRESS_VERIFICATION_FAILURE + | :AGE_THRESHOLD_FAILURE + | :COMPLETE_VERIFICATION_FAILURE + | :DOB_VERIFICATION_FAILURE + | :ID_VERIFICATION_FAILURE + | :MAX_DOCUMENT_ATTEMPTS + | :MAX_RESUBMISSION_ATTEMPTS + | :NAME_VERIFICATION_FAILURE + | :OTHER_VERIFICATION_FAILURE + | :RISK_THRESHOLD_FAILURE + | :WATCHLIST_ALERT_FAILURE + | :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + | :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + | :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + | :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + | :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + | :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + | :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + | :CONTROL_PERSON_ID_VERIFICATION_FAILURE + | :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + | :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + module StatusReason + extend Lithic::Internal::Type::Enum + + ADDRESS_VERIFICATION_FAILURE: :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE: :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE: :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE: :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE: :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS: :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS: :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE: :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE: :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE: :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE: :WATCHLIST_ALERT_FAILURE + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED: :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE: :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED: :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE: :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE: :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE: :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE: :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + CONTROL_PERSON_ID_VERIFICATION_FAILURE: :CONTROL_PERSON_ID_VERIFICATION_FAILURE + CONTROL_PERSON_DOB_VERIFICATION_FAILURE: :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + CONTROL_PERSON_NAME_VERIFICATION_FAILURE: :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + def self?.values: -> ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::status_reason] + end + + type user_type = :BUSINESS | :INDIVIDUAL + + module UserType + extend Lithic::Internal::Type::Enum + + BUSINESS: :BUSINESS + INDIVIDUAL: :INDIVIDUAL + + def self?.values: -> ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::user_type] + end + + type verification_application = + { + created: Time, + status: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::status, + status_reasons: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::status_reason], + updated: Time, + ky_passed_at: Time + } + + class VerificationApplication < Lithic::Internal::Type::BaseModel + attr_accessor created: Time + + attr_accessor status: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::status + + attr_accessor status_reasons: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::status_reason] + + attr_accessor updated: Time + + attr_reader ky_passed_at: Time? + + def ky_passed_at=: (Time) -> Time + + def initialize: ( + created: Time, + status: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::status, + status_reasons: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::status_reason], + updated: Time, + ?ky_passed_at: Time + ) -> void + + def to_hash: -> { + created: Time, + status: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::status, + status_reasons: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::status_reason], + updated: Time, + ky_passed_at: Time + } + + type status = + :ACCEPTED | :PENDING_DOCUMENT | :PENDING_RESUBMIT | :REJECTED + + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED: :ACCEPTED + PENDING_DOCUMENT: :PENDING_DOCUMENT + PENDING_RESUBMIT: :PENDING_RESUBMIT + REJECTED: :REJECTED + + def self?.values: -> ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::status] + end + + type status_reason = + :ADDRESS_VERIFICATION_FAILURE + | :AGE_THRESHOLD_FAILURE + | :COMPLETE_VERIFICATION_FAILURE + | :DOB_VERIFICATION_FAILURE + | :ID_VERIFICATION_FAILURE + | :MAX_DOCUMENT_ATTEMPTS + | :MAX_RESUBMISSION_ATTEMPTS + | :NAME_VERIFICATION_FAILURE + | :OTHER_VERIFICATION_FAILURE + | :RISK_THRESHOLD_FAILURE + | :WATCHLIST_ALERT_FAILURE + | :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + | :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + | :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + | :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + | :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + | :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + | :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + | :CONTROL_PERSON_ID_VERIFICATION_FAILURE + | :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + | :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + module StatusReason + extend Lithic::Internal::Type::Enum + + ADDRESS_VERIFICATION_FAILURE: :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE: :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE: :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE: :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE: :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS: :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS: :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE: :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE: :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE: :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE: :WATCHLIST_ALERT_FAILURE + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED: :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE: :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED: :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE: :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE: :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE: :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE: :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + CONTROL_PERSON_ID_VERIFICATION_FAILURE: :CONTROL_PERSON_ID_VERIFICATION_FAILURE + CONTROL_PERSON_DOB_VERIFICATION_FAILURE: :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + CONTROL_PERSON_NAME_VERIFICATION_FAILURE: :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + def self?.values: -> ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication::status_reason] + end + end + end + end +end diff --git a/sig/lithic/models/account_holder_update_params.rbs b/sig/lithic/models/account_holder_update_params.rbs new file mode 100644 index 00000000..ecbcea50 --- /dev/null +++ b/sig/lithic/models/account_holder_update_params.rbs @@ -0,0 +1,455 @@ +module Lithic + module Models + type account_holder_update_params = + { + account_holder_token: String, + body: Lithic::Models::AccountHolderUpdateParams::body + } + & Lithic::Internal::Type::request_parameters + + class AccountHolderUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor account_holder_token: String + + attr_accessor body: Lithic::Models::AccountHolderUpdateParams::body + + def initialize: ( + account_holder_token: String, + body: Lithic::Models::AccountHolderUpdateParams::body, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + account_holder_token: String, + body: Lithic::Models::AccountHolderUpdateParams::body, + request_options: Lithic::RequestOptions + } + + type body = + Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest + | Lithic::AccountHolderUpdateParams::Body::KYCPatchRequest + | Lithic::AccountHolderUpdateParams::Body::PatchRequest + + module Body + extend Lithic::Internal::Type::Union + + type kyb_patch_request = + { + beneficial_owner_individuals: ::Array[Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::BeneficialOwnerIndividual], + business_entity: Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::BusinessEntity, + control_person: Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::ControlPerson, + external_id: String, + naics_code: String, + nature_of_business: String, + website_url: String + } + + class KYBPatchRequest < Lithic::Internal::Type::BaseModel + attr_reader beneficial_owner_individuals: ::Array[Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::BeneficialOwnerIndividual]? + + def beneficial_owner_individuals=: ( + ::Array[Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::BeneficialOwnerIndividual] + ) -> ::Array[Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::BeneficialOwnerIndividual] + + attr_reader business_entity: Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::BusinessEntity? + + def business_entity=: ( + Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::BusinessEntity + ) -> Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::BusinessEntity + + attr_reader control_person: Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::ControlPerson? + + def control_person=: ( + Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::ControlPerson + ) -> Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::ControlPerson + + attr_reader external_id: String? + + def external_id=: (String) -> String + + attr_reader naics_code: String? + + def naics_code=: (String) -> String + + attr_reader nature_of_business: String? + + def nature_of_business=: (String) -> String + + attr_reader website_url: String? + + def website_url=: (String) -> String + + def initialize: ( + ?beneficial_owner_individuals: ::Array[Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::BeneficialOwnerIndividual], + ?business_entity: Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::BusinessEntity, + ?control_person: Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::ControlPerson, + ?external_id: String, + ?naics_code: String, + ?nature_of_business: String, + ?website_url: String + ) -> void + + def to_hash: -> { + beneficial_owner_individuals: ::Array[Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::BeneficialOwnerIndividual], + business_entity: Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::BusinessEntity, + control_person: Lithic::AccountHolderUpdateParams::Body::KYBPatchRequest::ControlPerson, + external_id: String, + naics_code: String, + nature_of_business: String, + website_url: String + } + + type beneficial_owner_individual = + { + entity_token: String, + address: Lithic::AddressUpdate, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + attr_accessor entity_token: String + + attr_reader address: Lithic::AddressUpdate? + + def address=: (Lithic::AddressUpdate) -> Lithic::AddressUpdate + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + attr_reader government_id: String? + + def government_id=: (String) -> String + + def initialize: ( + entity_token: String, + ?address: Lithic::AddressUpdate, + ?dob: String, + ?email: String, + ?first_name: String, + ?government_id: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + entity_token: String, + address: Lithic::AddressUpdate, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + end + + type business_entity = + { + entity_token: String, + address: Lithic::AddressUpdate, + dba_business_name: String, + government_id: String, + legal_business_name: String, + parent_company: String, + phone_numbers: ::Array[String] + } + + class BusinessEntity < Lithic::Internal::Type::BaseModel + attr_accessor entity_token: String + + attr_reader address: Lithic::AddressUpdate? + + def address=: (Lithic::AddressUpdate) -> Lithic::AddressUpdate + + attr_reader dba_business_name: String? + + def dba_business_name=: (String) -> String + + attr_reader government_id: String? + + def government_id=: (String) -> String + + attr_reader legal_business_name: String? + + def legal_business_name=: (String) -> String + + attr_reader parent_company: String? + + def parent_company=: (String) -> String + + attr_reader phone_numbers: ::Array[String]? + + def phone_numbers=: (::Array[String]) -> ::Array[String] + + def initialize: ( + entity_token: String, + ?address: Lithic::AddressUpdate, + ?dba_business_name: String, + ?government_id: String, + ?legal_business_name: String, + ?parent_company: String, + ?phone_numbers: ::Array[String] + ) -> void + + def to_hash: -> { + entity_token: String, + address: Lithic::AddressUpdate, + dba_business_name: String, + government_id: String, + legal_business_name: String, + parent_company: String, + phone_numbers: ::Array[String] + } + end + + type control_person = + { + entity_token: String, + address: Lithic::AddressUpdate, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class ControlPerson < Lithic::Internal::Type::BaseModel + attr_accessor entity_token: String + + attr_reader address: Lithic::AddressUpdate? + + def address=: (Lithic::AddressUpdate) -> Lithic::AddressUpdate + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + attr_reader government_id: String? + + def government_id=: (String) -> String + + def initialize: ( + entity_token: String, + ?address: Lithic::AddressUpdate, + ?dob: String, + ?email: String, + ?first_name: String, + ?government_id: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + entity_token: String, + address: Lithic::AddressUpdate, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + end + end + + type kyc_patch_request = + { + external_id: String, + individual: Lithic::AccountHolderUpdateParams::Body::KYCPatchRequest::Individual + } + + class KYCPatchRequest < Lithic::Internal::Type::BaseModel + attr_reader external_id: String? + + def external_id=: (String) -> String + + attr_reader individual: Lithic::AccountHolderUpdateParams::Body::KYCPatchRequest::Individual? + + def individual=: ( + Lithic::AccountHolderUpdateParams::Body::KYCPatchRequest::Individual + ) -> Lithic::AccountHolderUpdateParams::Body::KYCPatchRequest::Individual + + def initialize: ( + ?external_id: String, + ?individual: Lithic::AccountHolderUpdateParams::Body::KYCPatchRequest::Individual + ) -> void + + def to_hash: -> { + external_id: String, + individual: Lithic::AccountHolderUpdateParams::Body::KYCPatchRequest::Individual + } + + type individual = + { + entity_token: String, + address: Lithic::AddressUpdate, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class Individual < Lithic::Internal::Type::BaseModel + attr_accessor entity_token: String + + attr_reader address: Lithic::AddressUpdate? + + def address=: (Lithic::AddressUpdate) -> Lithic::AddressUpdate + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + attr_reader government_id: String? + + def government_id=: (String) -> String + + def initialize: ( + entity_token: String, + ?address: Lithic::AddressUpdate, + ?dob: String, + ?email: String, + ?first_name: String, + ?government_id: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + entity_token: String, + address: Lithic::AddressUpdate, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + end + end + + type patch_request = + { + address: Lithic::AddressUpdate, + business_account_token: String, + email: String, + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String + } + + class PatchRequest < Lithic::Internal::Type::BaseModel + attr_reader address: Lithic::AddressUpdate? + + def address=: (Lithic::AddressUpdate) -> Lithic::AddressUpdate + + attr_reader business_account_token: String? + + def business_account_token=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader legal_business_name: String? + + def legal_business_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + ?address: Lithic::AddressUpdate, + ?business_account_token: String, + ?email: String, + ?first_name: String, + ?last_name: String, + ?legal_business_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + address: Lithic::AddressUpdate, + business_account_token: String, + email: String, + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String + } + end + + def self?.variants: -> ::Array[Lithic::Models::AccountHolderUpdateParams::body] + end + end + end +end diff --git a/sig/lithic/models/account_holder_update_response.rbs b/sig/lithic/models/account_holder_update_response.rbs new file mode 100644 index 00000000..c75427eb --- /dev/null +++ b/sig/lithic/models/account_holder_update_response.rbs @@ -0,0 +1,804 @@ +module Lithic + module Models + type account_holder_update_response = + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse + | Lithic::Models::AccountHolderUpdateResponse::PatchResponse + + module AccountHolderUpdateResponse + extend Lithic::Internal::Type::Union + + type kybkyc_patch_response = + { + token: String, + account_token: String, + beneficial_owner_individuals: ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual], + business_account_token: String?, + business_entity: Lithic::KYBBusinessEntity, + control_person: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson, + created: Time, + email: String, + exemption_type: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::exemption_type, + external_id: String, + individual: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual, + naics_code: String, + nature_of_business: String, + phone_number: String, + required_documents: ::Array[Lithic::RequiredDocument], + status: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::status, + status_reasons: ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::status_reason], + user_type: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::user_type, + verification_application: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication, + website_url: String + } + + class KYBKYCPatchResponse < Lithic::Internal::Type::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader beneficial_owner_individuals: ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual]? + + def beneficial_owner_individuals=: ( + ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual] + ) -> ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual] + + attr_accessor business_account_token: String? + + attr_reader business_entity: Lithic::KYBBusinessEntity? + + def business_entity=: ( + Lithic::KYBBusinessEntity + ) -> Lithic::KYBBusinessEntity + + attr_reader control_person: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson? + + def control_person=: ( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson + ) -> Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson + + attr_reader created: Time? + + def created=: (Time) -> Time + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader exemption_type: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::exemption_type? + + def exemption_type=: ( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::exemption_type + ) -> Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::exemption_type + + attr_reader external_id: String? + + def external_id=: (String) -> String + + attr_reader individual: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual? + + def individual=: ( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual + ) -> Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual + + attr_reader naics_code: String? + + def naics_code=: (String) -> String + + attr_reader nature_of_business: String? + + def nature_of_business=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + attr_reader required_documents: ::Array[Lithic::RequiredDocument]? + + def required_documents=: ( + ::Array[Lithic::RequiredDocument] + ) -> ::Array[Lithic::RequiredDocument] + + attr_reader status: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::status? + + def status=: ( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::status + ) -> Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::status + + attr_reader status_reasons: ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::status_reason]? + + def status_reasons=: ( + ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::status_reason] + ) -> ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::status_reason] + + attr_reader user_type: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::user_type? + + def user_type=: ( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::user_type + ) -> Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::user_type + + attr_reader verification_application: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication? + + def verification_application=: ( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication + ) -> Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication + + attr_reader website_url: String? + + def website_url=: (String) -> String + + def initialize: ( + ?token: String, + ?account_token: String, + ?beneficial_owner_individuals: ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual], + ?business_account_token: String?, + ?business_entity: Lithic::KYBBusinessEntity, + ?control_person: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson, + ?created: Time, + ?email: String, + ?exemption_type: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::exemption_type, + ?external_id: String, + ?individual: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual, + ?naics_code: String, + ?nature_of_business: String, + ?phone_number: String, + ?required_documents: ::Array[Lithic::RequiredDocument], + ?status: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::status, + ?status_reasons: ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::status_reason], + ?user_type: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::user_type, + ?verification_application: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication, + ?website_url: String + ) -> void + + def to_hash: -> { + token: String, + account_token: String, + beneficial_owner_individuals: ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual], + business_account_token: String?, + business_entity: Lithic::KYBBusinessEntity, + control_person: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson, + created: Time, + email: String, + exemption_type: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::exemption_type, + external_id: String, + individual: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual, + naics_code: String, + nature_of_business: String, + phone_number: String, + required_documents: ::Array[Lithic::RequiredDocument], + status: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::status, + status_reasons: ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::status_reason], + user_type: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::user_type, + verification_application: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication, + website_url: String + } + + type beneficial_owner_individual = + { + address: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + attr_reader address: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::Address? + + def address=: ( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::Address + ) -> Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::Address + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + ?address: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::Address, + ?dob: String, + ?email: String, + ?first_name: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + address: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::BeneficialOwnerIndividual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::Internal::Type::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + end + end + + type control_person = + { + address: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class ControlPerson < Lithic::Internal::Type::BaseModel + attr_reader address: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::Address? + + def address=: ( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::Address + ) -> Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::Address + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + ?address: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::Address, + ?dob: String, + ?email: String, + ?first_name: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + address: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::ControlPerson::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::Internal::Type::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + end + end + + type exemption_type = :AUTHORIZED_USER | :PREPAID_CARD_USER + + module ExemptionType + extend Lithic::Internal::Type::Enum + + AUTHORIZED_USER: :AUTHORIZED_USER + PREPAID_CARD_USER: :PREPAID_CARD_USER + + def self?.values: -> ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::exemption_type] + end + + type individual = + { + address: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class Individual < Lithic::Internal::Type::BaseModel + attr_reader address: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::Address? + + def address=: ( + Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::Address + ) -> Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::Address + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + ?address: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::Address, + ?dob: String, + ?email: String, + ?first_name: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + address: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::Individual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::Internal::Type::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + end + end + + type status = + :ACCEPTED | :PENDING_DOCUMENT | :PENDING_RESUBMIT | :REJECTED + + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED: :ACCEPTED + PENDING_DOCUMENT: :PENDING_DOCUMENT + PENDING_RESUBMIT: :PENDING_RESUBMIT + REJECTED: :REJECTED + + def self?.values: -> ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::status] + end + + type status_reason = + :ADDRESS_VERIFICATION_FAILURE + | :AGE_THRESHOLD_FAILURE + | :COMPLETE_VERIFICATION_FAILURE + | :DOB_VERIFICATION_FAILURE + | :ID_VERIFICATION_FAILURE + | :MAX_DOCUMENT_ATTEMPTS + | :MAX_RESUBMISSION_ATTEMPTS + | :NAME_VERIFICATION_FAILURE + | :OTHER_VERIFICATION_FAILURE + | :RISK_THRESHOLD_FAILURE + | :WATCHLIST_ALERT_FAILURE + | :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + | :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + | :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + | :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + | :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + | :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + | :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + | :CONTROL_PERSON_ID_VERIFICATION_FAILURE + | :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + | :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + module StatusReason + extend Lithic::Internal::Type::Enum + + ADDRESS_VERIFICATION_FAILURE: :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE: :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE: :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE: :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE: :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS: :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS: :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE: :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE: :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE: :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE: :WATCHLIST_ALERT_FAILURE + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED: :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE: :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED: :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE: :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE: :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE: :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE: :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + CONTROL_PERSON_ID_VERIFICATION_FAILURE: :CONTROL_PERSON_ID_VERIFICATION_FAILURE + CONTROL_PERSON_DOB_VERIFICATION_FAILURE: :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + CONTROL_PERSON_NAME_VERIFICATION_FAILURE: :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + def self?.values: -> ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::status_reason] + end + + type user_type = :BUSINESS | :INDIVIDUAL + + module UserType + extend Lithic::Internal::Type::Enum + + BUSINESS: :BUSINESS + INDIVIDUAL: :INDIVIDUAL + + def self?.values: -> ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::user_type] + end + + type verification_application = + { + created: Time, + status: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::status, + status_reasons: ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::status_reason], + updated: Time, + ky_passed_at: Time + } + + class VerificationApplication < Lithic::Internal::Type::BaseModel + attr_accessor created: Time + + attr_accessor status: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::status + + attr_accessor status_reasons: ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::status_reason] + + attr_accessor updated: Time + + attr_reader ky_passed_at: Time? + + def ky_passed_at=: (Time) -> Time + + def initialize: ( + created: Time, + status: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::status, + status_reasons: ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::status_reason], + updated: Time, + ?ky_passed_at: Time + ) -> void + + def to_hash: -> { + created: Time, + status: Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::status, + status_reasons: ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::status_reason], + updated: Time, + ky_passed_at: Time + } + + type status = + :ACCEPTED | :PENDING_DOCUMENT | :PENDING_RESUBMIT | :REJECTED + + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED: :ACCEPTED + PENDING_DOCUMENT: :PENDING_DOCUMENT + PENDING_RESUBMIT: :PENDING_RESUBMIT + REJECTED: :REJECTED + + def self?.values: -> ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::status] + end + + type status_reason = + :ADDRESS_VERIFICATION_FAILURE + | :AGE_THRESHOLD_FAILURE + | :COMPLETE_VERIFICATION_FAILURE + | :DOB_VERIFICATION_FAILURE + | :ID_VERIFICATION_FAILURE + | :MAX_DOCUMENT_ATTEMPTS + | :MAX_RESUBMISSION_ATTEMPTS + | :NAME_VERIFICATION_FAILURE + | :OTHER_VERIFICATION_FAILURE + | :RISK_THRESHOLD_FAILURE + | :WATCHLIST_ALERT_FAILURE + | :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + | :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + | :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + | :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + | :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + | :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + | :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + | :CONTROL_PERSON_ID_VERIFICATION_FAILURE + | :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + | :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + module StatusReason + extend Lithic::Internal::Type::Enum + + ADDRESS_VERIFICATION_FAILURE: :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE: :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE: :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE: :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE: :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS: :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS: :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE: :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE: :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE: :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE: :WATCHLIST_ALERT_FAILURE + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED: :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE: :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED: :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE: :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE: :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE: :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE: :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + CONTROL_PERSON_ID_VERIFICATION_FAILURE: :CONTROL_PERSON_ID_VERIFICATION_FAILURE + CONTROL_PERSON_DOB_VERIFICATION_FAILURE: :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + CONTROL_PERSON_NAME_VERIFICATION_FAILURE: :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + def self?.values: -> ::Array[Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse::VerificationApplication::status_reason] + end + end + end + + type patch_response = + { + token: String, + address: Lithic::Models::AccountHolderUpdateResponse::PatchResponse::Address, + business_account_token: String?, + email: String, + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String + } + + class PatchResponse < Lithic::Internal::Type::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader address: Lithic::Models::AccountHolderUpdateResponse::PatchResponse::Address? + + def address=: ( + Lithic::Models::AccountHolderUpdateResponse::PatchResponse::Address + ) -> Lithic::Models::AccountHolderUpdateResponse::PatchResponse::Address + + attr_accessor business_account_token: String? + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader legal_business_name: String? + + def legal_business_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + ?token: String, + ?address: Lithic::Models::AccountHolderUpdateResponse::PatchResponse::Address, + ?business_account_token: String?, + ?email: String, + ?first_name: String, + ?last_name: String, + ?legal_business_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + token: String, + address: Lithic::Models::AccountHolderUpdateResponse::PatchResponse::Address, + business_account_token: String?, + email: String, + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String + } + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::Internal::Type::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + end + end + + def self?.variants: -> ::Array[Lithic::Models::account_holder_update_response] + end + end +end diff --git a/sig/lithic/models/account_holder_updated_webhook_event.rbs b/sig/lithic/models/account_holder_updated_webhook_event.rbs new file mode 100644 index 00000000..51ba8a50 --- /dev/null +++ b/sig/lithic/models/account_holder_updated_webhook_event.rbs @@ -0,0 +1,585 @@ +module Lithic + module Models + type account_holder_updated_webhook_event = + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload + | Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload + | Lithic::AccountHolderUpdatedWebhookEvent::LegacyPayload + + module AccountHolderUpdatedWebhookEvent + extend Lithic::Internal::Type::Union + + type kyb_payload = + { + token: String, + update_request: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest, + event_type: Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::event_type, + external_id: String, + naics_code: String, + nature_of_business: String, + website_url: String + } + + class KYBPayload < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor update_request: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest + + attr_reader event_type: Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::event_type? + + def event_type=: ( + Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::event_type + ) -> Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::event_type + + attr_reader external_id: String? + + def external_id=: (String) -> String + + attr_reader naics_code: String? + + def naics_code=: (String) -> String + + attr_reader nature_of_business: String? + + def nature_of_business=: (String) -> String + + attr_reader website_url: String? + + def website_url=: (String) -> String + + def initialize: ( + token: String, + update_request: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest, + ?event_type: Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::event_type, + ?external_id: String, + ?naics_code: String, + ?nature_of_business: String, + ?website_url: String + ) -> void + + def to_hash: -> { + token: String, + update_request: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest, + event_type: Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::event_type, + external_id: String, + naics_code: String, + nature_of_business: String, + website_url: String + } + + type update_request = + { + beneficial_owner_individuals: ::Array[Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual], + business_entity: Lithic::KYBBusinessEntity, + control_person: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson + } + + class UpdateRequest < Lithic::Internal::Type::BaseModel + attr_reader beneficial_owner_individuals: ::Array[Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual]? + + def beneficial_owner_individuals=: ( + ::Array[Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual] + ) -> ::Array[Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual] + + attr_reader business_entity: Lithic::KYBBusinessEntity? + + def business_entity=: ( + Lithic::KYBBusinessEntity + ) -> Lithic::KYBBusinessEntity + + attr_reader control_person: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson? + + def control_person=: ( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson + ) -> Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson + + def initialize: ( + ?beneficial_owner_individuals: ::Array[Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual], + ?business_entity: Lithic::KYBBusinessEntity, + ?control_person: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson + ) -> void + + def to_hash: -> { + beneficial_owner_individuals: ::Array[Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual], + business_entity: Lithic::KYBBusinessEntity, + control_person: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson + } + + type beneficial_owner_individual = + { + address: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + attr_reader address: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address? + + def address=: ( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address + ) -> Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + ?address: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address, + ?dob: String, + ?email: String, + ?first_name: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + address: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::Internal::Type::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + end + end + + type control_person = + { + address: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class ControlPerson < Lithic::Internal::Type::BaseModel + attr_reader address: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address? + + def address=: ( + Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address + ) -> Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + ?address: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address, + ?dob: String, + ?email: String, + ?first_name: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + address: Lithic::AccountHolderUpdatedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::Internal::Type::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + end + end + end + + type event_type = :"account_holder.updated" + + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_UPDATED: :"account_holder.updated" + + def self?.values: -> ::Array[Lithic::Models::AccountHolderUpdatedWebhookEvent::KYBPayload::event_type] + end + end + + type kyc_payload = + { + token: String, + update_request: Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest, + event_type: Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::event_type, + external_id: String + } + + class KYCPayload < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor update_request: Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest + + attr_reader event_type: Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::event_type? + + def event_type=: ( + Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::event_type + ) -> Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::event_type + + attr_reader external_id: String? + + def external_id=: (String) -> String + + def initialize: ( + token: String, + update_request: Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest, + ?event_type: Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::event_type, + ?external_id: String + ) -> void + + def to_hash: -> { + token: String, + update_request: Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest, + event_type: Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::event_type, + external_id: String + } + + type update_request = + { + individual: Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual + } + + class UpdateRequest < Lithic::Internal::Type::BaseModel + attr_reader individual: Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual? + + def individual=: ( + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual + ) -> Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual + + def initialize: ( + ?individual: Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual + ) -> void + + def to_hash: -> { + individual: Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual + } + + type individual = + { + address: Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class Individual < Lithic::Internal::Type::BaseModel + attr_reader address: Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address? + + def address=: ( + Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address + ) -> Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + ?address: Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address, + ?dob: String, + ?email: String, + ?first_name: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + address: Lithic::AccountHolderUpdatedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::Internal::Type::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + end + end + end + + type event_type = :"account_holder.updated" + + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_UPDATED: :"account_holder.updated" + + def self?.values: -> ::Array[Lithic::Models::AccountHolderUpdatedWebhookEvent::KYCPayload::event_type] + end + end + + type legacy_payload = + { + token: String, + business_account_token: String?, + created: Time, + email: String, + event_type: Lithic::Models::AccountHolderUpdatedWebhookEvent::LegacyPayload::event_type, + external_id: String?, + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String + } + + class LegacyPayload < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor business_account_token: String? + + attr_reader created: Time? + + def created=: (Time) -> Time + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader event_type: Lithic::Models::AccountHolderUpdatedWebhookEvent::LegacyPayload::event_type? + + def event_type=: ( + Lithic::Models::AccountHolderUpdatedWebhookEvent::LegacyPayload::event_type + ) -> Lithic::Models::AccountHolderUpdatedWebhookEvent::LegacyPayload::event_type + + attr_accessor external_id: String? + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader legal_business_name: String? + + def legal_business_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + token: String, + ?business_account_token: String?, + ?created: Time, + ?email: String, + ?event_type: Lithic::Models::AccountHolderUpdatedWebhookEvent::LegacyPayload::event_type, + ?external_id: String?, + ?first_name: String, + ?last_name: String, + ?legal_business_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + token: String, + business_account_token: String?, + created: Time, + email: String, + event_type: Lithic::Models::AccountHolderUpdatedWebhookEvent::LegacyPayload::event_type, + external_id: String?, + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String + } + + type event_type = :"account_holder.updated" + + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_UPDATED: :"account_holder.updated" + + def self?.values: -> ::Array[Lithic::Models::AccountHolderUpdatedWebhookEvent::LegacyPayload::event_type] + end + end + + def self?.variants: -> ::Array[Lithic::Models::account_holder_updated_webhook_event] + end + end +end diff --git a/sig/lithic/models/account_holder_upload_document_params.rbs b/sig/lithic/models/account_holder_upload_document_params.rbs new file mode 100644 index 00000000..a371b7cc --- /dev/null +++ b/sig/lithic/models/account_holder_upload_document_params.rbs @@ -0,0 +1,83 @@ +module Lithic + module Models + type account_holder_upload_document_params = + { + account_holder_token: String, + document_type: Lithic::Models::AccountHolderUploadDocumentParams::document_type, + entity_token: String + } + & Lithic::Internal::Type::request_parameters + + class AccountHolderUploadDocumentParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor account_holder_token: String + + attr_accessor document_type: Lithic::Models::AccountHolderUploadDocumentParams::document_type + + attr_accessor entity_token: String + + def initialize: ( + account_holder_token: String, + document_type: Lithic::Models::AccountHolderUploadDocumentParams::document_type, + entity_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + account_holder_token: String, + document_type: Lithic::Models::AccountHolderUploadDocumentParams::document_type, + entity_token: String, + request_options: Lithic::RequestOptions + } + + type document_type = + :EIN_LETTER + | :TAX_RETURN + | :OPERATING_AGREEMENT + | :CERTIFICATE_OF_FORMATION + | :DRIVERS_LICENSE + | :PASSPORT + | :PASSPORT_CARD + | :CERTIFICATE_OF_GOOD_STANDING + | :ARTICLES_OF_INCORPORATION + | :ARTICLES_OF_ORGANIZATION + | :BYLAWS + | :GOVERNMENT_BUSINESS_LICENSE + | :PARTNERSHIP_AGREEMENT + | :SS4_FORM + | :BANK_STATEMENT + | :UTILITY_BILL_STATEMENT + | :SSN_CARD + | :ITIN_LETTER + | :FINCEN_BOI_REPORT + + module DocumentType + extend Lithic::Internal::Type::Enum + + EIN_LETTER: :EIN_LETTER + TAX_RETURN: :TAX_RETURN + OPERATING_AGREEMENT: :OPERATING_AGREEMENT + CERTIFICATE_OF_FORMATION: :CERTIFICATE_OF_FORMATION + DRIVERS_LICENSE: :DRIVERS_LICENSE + PASSPORT: :PASSPORT + PASSPORT_CARD: :PASSPORT_CARD + CERTIFICATE_OF_GOOD_STANDING: :CERTIFICATE_OF_GOOD_STANDING + ARTICLES_OF_INCORPORATION: :ARTICLES_OF_INCORPORATION + ARTICLES_OF_ORGANIZATION: :ARTICLES_OF_ORGANIZATION + BYLAWS: :BYLAWS + GOVERNMENT_BUSINESS_LICENSE: :GOVERNMENT_BUSINESS_LICENSE + PARTNERSHIP_AGREEMENT: :PARTNERSHIP_AGREEMENT + SS4_FORM: :SS4_FORM + BANK_STATEMENT: :BANK_STATEMENT + UTILITY_BILL_STATEMENT: :UTILITY_BILL_STATEMENT + SSN_CARD: :SSN_CARD + ITIN_LETTER: :ITIN_LETTER + FINCEN_BOI_REPORT: :FINCEN_BOI_REPORT + + def self?.values: -> ::Array[Lithic::Models::AccountHolderUploadDocumentParams::document_type] + end + end + end +end diff --git a/sig/lithic/models/account_holder_verification_webhook_event.rbs b/sig/lithic/models/account_holder_verification_webhook_event.rbs new file mode 100644 index 00000000..998a344d --- /dev/null +++ b/sig/lithic/models/account_holder_verification_webhook_event.rbs @@ -0,0 +1,69 @@ +module Lithic + module Models + type account_holder_verification_webhook_event = + { + event_type: :"account_holder.verification", + token: String, + account_token: String, + created: Time, + status: Lithic::Models::AccountHolderVerificationWebhookEvent::status, + status_reasons: ::Array[String] + } + + class AccountHolderVerificationWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor event_type: :"account_holder.verification" + + attr_reader token: String? + + def token=: (String) -> String + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader created: Time? + + def created=: (Time) -> Time + + attr_reader status: Lithic::Models::AccountHolderVerificationWebhookEvent::status? + + def status=: ( + Lithic::Models::AccountHolderVerificationWebhookEvent::status + ) -> Lithic::Models::AccountHolderVerificationWebhookEvent::status + + attr_reader status_reasons: ::Array[String]? + + def status_reasons=: (::Array[String]) -> ::Array[String] + + def initialize: ( + ?token: String, + ?account_token: String, + ?created: Time, + ?status: Lithic::Models::AccountHolderVerificationWebhookEvent::status, + ?status_reasons: ::Array[String], + ?event_type: :"account_holder.verification" + ) -> void + + def to_hash: -> { + event_type: :"account_holder.verification", + token: String, + account_token: String, + created: Time, + status: Lithic::Models::AccountHolderVerificationWebhookEvent::status, + status_reasons: ::Array[String] + } + + type status = :ACCEPTED | :PENDING_REVIEW | :REJECTED + + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED: :ACCEPTED + PENDING_REVIEW: :PENDING_REVIEW + REJECTED: :REJECTED + + def self?.values: -> ::Array[Lithic::Models::AccountHolderVerificationWebhookEvent::status] + end + end + end +end diff --git a/sig/lithic/models/account_holders/account_holder_entity.rbs b/sig/lithic/models/account_holders/account_holder_entity.rbs new file mode 100644 index 00000000..d33135d2 --- /dev/null +++ b/sig/lithic/models/account_holders/account_holder_entity.rbs @@ -0,0 +1,126 @@ +module Lithic + module Models + class AccountHolderEntity = AccountHolders::AccountHolderEntity + + module AccountHolders + type account_holder_entity = + { + token: String, + account_holder_token: String, + address: Lithic::AccountHolders::AccountHolderEntity::Address, + dob: String?, + email: String?, + first_name: String?, + last_name: String?, + phone_number: String?, + status: Lithic::Models::AccountHolders::AccountHolderEntity::status, + type: Lithic::Models::TransactionMonitoring::entity_type + } + + class AccountHolderEntity < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor account_holder_token: String + + attr_accessor address: Lithic::AccountHolders::AccountHolderEntity::Address + + attr_accessor dob: String? + + attr_accessor email: String? + + attr_accessor first_name: String? + + attr_accessor last_name: String? + + attr_accessor phone_number: String? + + attr_accessor status: Lithic::Models::AccountHolders::AccountHolderEntity::status + + attr_accessor type: Lithic::Models::TransactionMonitoring::entity_type + + def initialize: ( + token: String, + account_holder_token: String, + address: Lithic::AccountHolders::AccountHolderEntity::Address, + dob: String?, + email: String?, + first_name: String?, + last_name: String?, + phone_number: String?, + status: Lithic::Models::AccountHolders::AccountHolderEntity::status, + type: Lithic::Models::TransactionMonitoring::entity_type + ) -> void + + def to_hash: -> { + token: String, + account_holder_token: String, + address: Lithic::AccountHolders::AccountHolderEntity::Address, + dob: String?, + email: String?, + first_name: String?, + last_name: String?, + phone_number: String?, + status: Lithic::Models::AccountHolders::AccountHolderEntity::status, + type: Lithic::Models::TransactionMonitoring::entity_type + } + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::Internal::Type::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + end + + type status = :ACCEPTED | :INACTIVE | :PENDING_REVIEW | :REJECTED + + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED: :ACCEPTED + INACTIVE: :INACTIVE + PENDING_REVIEW: :PENDING_REVIEW + REJECTED: :REJECTED + + def self?.values: -> ::Array[Lithic::Models::AccountHolders::AccountHolderEntity::status] + end + end + end + end +end diff --git a/sig/lithic/models/account_holders/entity_create_params.rbs b/sig/lithic/models/account_holders/entity_create_params.rbs new file mode 100644 index 00000000..31186092 --- /dev/null +++ b/sig/lithic/models/account_holders/entity_create_params.rbs @@ -0,0 +1,112 @@ +module Lithic + module Models + module AccountHolders + type entity_create_params = + { + account_holder_token: String, + address: Lithic::AccountHolders::EntityCreateParams::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String, + type: Lithic::Models::TransactionMonitoring::entity_type + } + & Lithic::Internal::Type::request_parameters + + class EntityCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor account_holder_token: String + + attr_accessor address: Lithic::AccountHolders::EntityCreateParams::Address + + attr_accessor dob: String + + attr_accessor email: String + + attr_accessor first_name: String + + attr_accessor government_id: String + + attr_accessor last_name: String + + attr_accessor phone_number: String + + attr_accessor type: Lithic::Models::TransactionMonitoring::entity_type + + def initialize: ( + account_holder_token: String, + address: Lithic::AccountHolders::EntityCreateParams::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String, + type: Lithic::Models::TransactionMonitoring::entity_type, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + account_holder_token: String, + address: Lithic::AccountHolders::EntityCreateParams::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String, + type: Lithic::Models::TransactionMonitoring::entity_type, + request_options: Lithic::RequestOptions + } + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::Internal::Type::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + end + end + end + end +end diff --git a/sig/lithic/models/account_holders/entity_create_response.rbs b/sig/lithic/models/account_holders/entity_create_response.rbs new file mode 100644 index 00000000..05f91bc1 --- /dev/null +++ b/sig/lithic/models/account_holders/entity_create_response.rbs @@ -0,0 +1,117 @@ +module Lithic + module Models + module AccountHolders + type entity_create_response = + { + token: String, + account_holder_token: String, + created: Time, + required_documents: ::Array[Lithic::RequiredDocument], + status: Lithic::Models::AccountHolders::EntityCreateResponse::status, + status_reasons: ::Array[Lithic::Models::AccountHolders::EntityCreateResponse::status_reason] + } + + class EntityCreateResponse < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor account_holder_token: String + + attr_accessor created: Time + + attr_accessor required_documents: ::Array[Lithic::RequiredDocument] + + attr_accessor status: Lithic::Models::AccountHolders::EntityCreateResponse::status + + attr_accessor status_reasons: ::Array[Lithic::Models::AccountHolders::EntityCreateResponse::status_reason] + + def initialize: ( + token: String, + account_holder_token: String, + created: Time, + required_documents: ::Array[Lithic::RequiredDocument], + status: Lithic::Models::AccountHolders::EntityCreateResponse::status, + status_reasons: ::Array[Lithic::Models::AccountHolders::EntityCreateResponse::status_reason] + ) -> void + + def to_hash: -> { + token: String, + account_holder_token: String, + created: Time, + required_documents: ::Array[Lithic::RequiredDocument], + status: Lithic::Models::AccountHolders::EntityCreateResponse::status, + status_reasons: ::Array[Lithic::Models::AccountHolders::EntityCreateResponse::status_reason] + } + + type status = :ACCEPTED | :INACTIVE | :PENDING_REVIEW | :REJECTED + + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED: :ACCEPTED + INACTIVE: :INACTIVE + PENDING_REVIEW: :PENDING_REVIEW + REJECTED: :REJECTED + + def self?.values: -> ::Array[Lithic::Models::AccountHolders::EntityCreateResponse::status] + end + + type status_reason = + :ADDRESS_VERIFICATION_FAILURE + | :AGE_THRESHOLD_FAILURE + | :COMPLETE_VERIFICATION_FAILURE + | :DOB_VERIFICATION_FAILURE + | :ID_VERIFICATION_FAILURE + | :MAX_DOCUMENT_ATTEMPTS + | :MAX_RESUBMISSION_ATTEMPTS + | :NAME_VERIFICATION_FAILURE + | :OTHER_VERIFICATION_FAILURE + | :RISK_THRESHOLD_FAILURE + | :WATCHLIST_ALERT_FAILURE + | :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + | :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + | :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + | :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + | :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + | :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + | :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + | :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + | :CONTROL_PERSON_ID_VERIFICATION_FAILURE + | :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + | :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + module StatusReason + extend Lithic::Internal::Type::Enum + + ADDRESS_VERIFICATION_FAILURE: :ADDRESS_VERIFICATION_FAILURE + AGE_THRESHOLD_FAILURE: :AGE_THRESHOLD_FAILURE + COMPLETE_VERIFICATION_FAILURE: :COMPLETE_VERIFICATION_FAILURE + DOB_VERIFICATION_FAILURE: :DOB_VERIFICATION_FAILURE + ID_VERIFICATION_FAILURE: :ID_VERIFICATION_FAILURE + MAX_DOCUMENT_ATTEMPTS: :MAX_DOCUMENT_ATTEMPTS + MAX_RESUBMISSION_ATTEMPTS: :MAX_RESUBMISSION_ATTEMPTS + NAME_VERIFICATION_FAILURE: :NAME_VERIFICATION_FAILURE + OTHER_VERIFICATION_FAILURE: :OTHER_VERIFICATION_FAILURE + RISK_THRESHOLD_FAILURE: :RISK_THRESHOLD_FAILURE + WATCHLIST_ALERT_FAILURE: :WATCHLIST_ALERT_FAILURE + PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_ID_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_ADDRESS_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE: :PRIMARY_BUSINESS_ENTITY_NAME_VERIFICATION_FAILURE + PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED: :PRIMARY_BUSINESS_ENTITY_BUSINESS_OFFICERS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE: :PRIMARY_BUSINESS_ENTITY_SOS_FILING_INACTIVE + PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED: :PRIMARY_BUSINESS_ENTITY_SOS_NOT_MATCHED + PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE: :PRIMARY_BUSINESS_ENTITY_CMRA_FAILURE + PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE: :PRIMARY_BUSINESS_ENTITY_WATCHLIST_FAILURE + PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE: :PRIMARY_BUSINESS_ENTITY_REGISTERED_AGENT_FAILURE + CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE: :CONTROL_PERSON_BLOCKLIST_ALERT_FAILURE + CONTROL_PERSON_ID_VERIFICATION_FAILURE: :CONTROL_PERSON_ID_VERIFICATION_FAILURE + CONTROL_PERSON_DOB_VERIFICATION_FAILURE: :CONTROL_PERSON_DOB_VERIFICATION_FAILURE + CONTROL_PERSON_NAME_VERIFICATION_FAILURE: :CONTROL_PERSON_NAME_VERIFICATION_FAILURE + + def self?.values: -> ::Array[Lithic::Models::AccountHolders::EntityCreateResponse::status_reason] + end + end + end + end +end diff --git a/sig/lithic/models/account_holders/entity_delete_params.rbs b/sig/lithic/models/account_holders/entity_delete_params.rbs new file mode 100644 index 00000000..1433b667 --- /dev/null +++ b/sig/lithic/models/account_holders/entity_delete_params.rbs @@ -0,0 +1,30 @@ +module Lithic + module Models + module AccountHolders + type entity_delete_params = + { account_holder_token: String, entity_token: String } + & Lithic::Internal::Type::request_parameters + + class EntityDeleteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor account_holder_token: String + + attr_accessor entity_token: String + + def initialize: ( + account_holder_token: String, + entity_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + account_holder_token: String, + entity_token: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/account_list_params.rbs b/sig/lithic/models/account_list_params.rbs new file mode 100644 index 00000000..54bf85e1 --- /dev/null +++ b/sig/lithic/models/account_list_params.rbs @@ -0,0 +1,56 @@ +module Lithic + module Models + type account_list_params = + { + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String + } + & Lithic::Internal::Type::request_parameters + + class AccountListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/account_retrieve_params.rbs b/sig/lithic/models/account_retrieve_params.rbs new file mode 100644 index 00000000..255ece02 --- /dev/null +++ b/sig/lithic/models/account_retrieve_params.rbs @@ -0,0 +1,23 @@ +module Lithic + module Models + type account_retrieve_params = + { account_token: String } & Lithic::Internal::Type::request_parameters + + class AccountRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor account_token: String + + def initialize: ( + account_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + account_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/account_retrieve_signals_params.rbs b/sig/lithic/models/account_retrieve_signals_params.rbs new file mode 100644 index 00000000..8fae3d84 --- /dev/null +++ b/sig/lithic/models/account_retrieve_signals_params.rbs @@ -0,0 +1,23 @@ +module Lithic + module Models + type account_retrieve_signals_params = + { account_token: String } & Lithic::Internal::Type::request_parameters + + class AccountRetrieveSignalsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor account_token: String + + def initialize: ( + account_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + account_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/account_retrieve_spend_limits_params.rbs b/sig/lithic/models/account_retrieve_spend_limits_params.rbs new file mode 100644 index 00000000..b8054863 --- /dev/null +++ b/sig/lithic/models/account_retrieve_spend_limits_params.rbs @@ -0,0 +1,23 @@ +module Lithic + module Models + type account_retrieve_spend_limits_params = + { account_token: String } & Lithic::Internal::Type::request_parameters + + class AccountRetrieveSpendLimitsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor account_token: String + + def initialize: ( + account_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + account_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/account_spend_limits.rbs b/sig/lithic/models/account_spend_limits.rbs new file mode 100644 index 00000000..15d57c39 --- /dev/null +++ b/sig/lithic/models/account_spend_limits.rbs @@ -0,0 +1,112 @@ +module Lithic + module Models + type account_spend_limits = + { + available_spend_limit: Lithic::AccountSpendLimits::AvailableSpendLimit, + spend_limit: Lithic::AccountSpendLimits::SpendLimit, + spend_velocity: Lithic::AccountSpendLimits::SpendVelocity + } + + class AccountSpendLimits < Lithic::Internal::Type::BaseModel + attr_accessor available_spend_limit: Lithic::AccountSpendLimits::AvailableSpendLimit + + attr_reader spend_limit: Lithic::AccountSpendLimits::SpendLimit? + + def spend_limit=: ( + Lithic::AccountSpendLimits::SpendLimit + ) -> Lithic::AccountSpendLimits::SpendLimit + + attr_reader spend_velocity: Lithic::AccountSpendLimits::SpendVelocity? + + def spend_velocity=: ( + Lithic::AccountSpendLimits::SpendVelocity + ) -> Lithic::AccountSpendLimits::SpendVelocity + + def initialize: ( + available_spend_limit: Lithic::AccountSpendLimits::AvailableSpendLimit, + ?spend_limit: Lithic::AccountSpendLimits::SpendLimit, + ?spend_velocity: Lithic::AccountSpendLimits::SpendVelocity + ) -> void + + def to_hash: -> { + available_spend_limit: Lithic::AccountSpendLimits::AvailableSpendLimit, + spend_limit: Lithic::AccountSpendLimits::SpendLimit, + spend_velocity: Lithic::AccountSpendLimits::SpendVelocity + } + + type available_spend_limit = + { daily: Integer, lifetime: Integer, monthly: Integer } + + class AvailableSpendLimit < Lithic::Internal::Type::BaseModel + attr_reader daily: Integer? + + def daily=: (Integer) -> Integer + + attr_reader lifetime: Integer? + + def lifetime=: (Integer) -> Integer + + attr_reader monthly: Integer? + + def monthly=: (Integer) -> Integer + + def initialize: ( + ?daily: Integer, + ?lifetime: Integer, + ?monthly: Integer + ) -> void + + def to_hash: -> { daily: Integer, lifetime: Integer, monthly: Integer } + end + + type spend_limit = { daily: Integer, lifetime: Integer, monthly: Integer } + + class SpendLimit < Lithic::Internal::Type::BaseModel + attr_reader daily: Integer? + + def daily=: (Integer) -> Integer + + attr_reader lifetime: Integer? + + def lifetime=: (Integer) -> Integer + + attr_reader monthly: Integer? + + def monthly=: (Integer) -> Integer + + def initialize: ( + ?daily: Integer, + ?lifetime: Integer, + ?monthly: Integer + ) -> void + + def to_hash: -> { daily: Integer, lifetime: Integer, monthly: Integer } + end + + type spend_velocity = + { daily: Integer, lifetime: Integer, monthly: Integer } + + class SpendVelocity < Lithic::Internal::Type::BaseModel + attr_reader daily: Integer? + + def daily=: (Integer) -> Integer + + attr_reader lifetime: Integer? + + def lifetime=: (Integer) -> Integer + + attr_reader monthly: Integer? + + def monthly=: (Integer) -> Integer + + def initialize: ( + ?daily: Integer, + ?lifetime: Integer, + ?monthly: Integer + ) -> void + + def to_hash: -> { daily: Integer, lifetime: Integer, monthly: Integer } + end + end + end +end diff --git a/sig/lithic/models/account_update_params.rbs b/sig/lithic/models/account_update_params.rbs new file mode 100644 index 00000000..f49c446d --- /dev/null +++ b/sig/lithic/models/account_update_params.rbs @@ -0,0 +1,168 @@ +module Lithic + module Models + type account_update_params = + { + account_token: String, + comment: String, + daily_spend_limit: Integer, + lifetime_spend_limit: Integer, + monthly_spend_limit: Integer, + state: Lithic::Models::AccountUpdateParams::state, + substatus: Lithic::Models::AccountUpdateParams::substatus?, + verification_address: Lithic::AccountUpdateParams::VerificationAddress + } + & Lithic::Internal::Type::request_parameters + + class AccountUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor account_token: String + + attr_reader comment: String? + + def comment=: (String) -> String + + attr_reader daily_spend_limit: Integer? + + def daily_spend_limit=: (Integer) -> Integer + + attr_reader lifetime_spend_limit: Integer? + + def lifetime_spend_limit=: (Integer) -> Integer + + attr_reader monthly_spend_limit: Integer? + + def monthly_spend_limit=: (Integer) -> Integer + + attr_reader state: Lithic::Models::AccountUpdateParams::state? + + def state=: ( + Lithic::Models::AccountUpdateParams::state + ) -> Lithic::Models::AccountUpdateParams::state + + attr_accessor substatus: Lithic::Models::AccountUpdateParams::substatus? + + attr_reader verification_address: Lithic::AccountUpdateParams::VerificationAddress? + + def verification_address=: ( + Lithic::AccountUpdateParams::VerificationAddress + ) -> Lithic::AccountUpdateParams::VerificationAddress + + def initialize: ( + account_token: String, + ?comment: String, + ?daily_spend_limit: Integer, + ?lifetime_spend_limit: Integer, + ?monthly_spend_limit: Integer, + ?state: Lithic::Models::AccountUpdateParams::state, + ?substatus: Lithic::Models::AccountUpdateParams::substatus?, + ?verification_address: Lithic::AccountUpdateParams::VerificationAddress, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + account_token: String, + comment: String, + daily_spend_limit: Integer, + lifetime_spend_limit: Integer, + monthly_spend_limit: Integer, + state: Lithic::Models::AccountUpdateParams::state, + substatus: Lithic::Models::AccountUpdateParams::substatus?, + verification_address: Lithic::AccountUpdateParams::VerificationAddress, + request_options: Lithic::RequestOptions + } + + type state = :ACTIVE | :PAUSED | :CLOSED + + module State + extend Lithic::Internal::Type::Enum + + ACTIVE: :ACTIVE + PAUSED: :PAUSED + CLOSED: :CLOSED + + def self?.values: -> ::Array[Lithic::Models::AccountUpdateParams::state] + end + + type substatus = + :FRAUD_IDENTIFIED + | :SUSPICIOUS_ACTIVITY + | :RISK_VIOLATION + | :END_USER_REQUEST + | :ISSUER_REQUEST + | :NOT_ACTIVE + | :INTERNAL_REVIEW + | :OTHER + + module Substatus + extend Lithic::Internal::Type::Enum + + FRAUD_IDENTIFIED: :FRAUD_IDENTIFIED + SUSPICIOUS_ACTIVITY: :SUSPICIOUS_ACTIVITY + RISK_VIOLATION: :RISK_VIOLATION + END_USER_REQUEST: :END_USER_REQUEST + ISSUER_REQUEST: :ISSUER_REQUEST + NOT_ACTIVE: :NOT_ACTIVE + INTERNAL_REVIEW: :INTERNAL_REVIEW + OTHER: :OTHER + + def self?.values: -> ::Array[Lithic::Models::AccountUpdateParams::substatus] + end + + type verification_address = + { + :address1 => String, + :address2 => String, + city: String, + country: String, + postal_code: String, + state: String + } + + class VerificationAddress < Lithic::Internal::Type::BaseModel + attr_reader address1: String? + + def address1=: (String) -> String + + attr_reader address2: String? + + def address2=: (String) -> String + + attr_reader city: String? + + def city=: (String) -> String + + attr_reader country: String? + + def country=: (String) -> String + + attr_reader postal_code: String? + + def postal_code=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + def initialize: ( + ?address1: String, + ?address2: String, + ?city: String, + ?country: String, + ?postal_code: String, + ?state: String + ) -> void + + def to_hash: -> { + :address1 => String, + :address2 => String, + city: String, + country: String, + postal_code: String, + state: String + } + end + end + end +end diff --git a/sig/lithic/models/address.rbs b/sig/lithic/models/address.rbs new file mode 100644 index 00000000..d6d54fd6 --- /dev/null +++ b/sig/lithic/models/address.rbs @@ -0,0 +1,47 @@ +module Lithic + module Models + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::Internal::Type::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + end + end +end diff --git a/sig/lithic/models/address_update.rbs b/sig/lithic/models/address_update.rbs new file mode 100644 index 00000000..a16d8182 --- /dev/null +++ b/sig/lithic/models/address_update.rbs @@ -0,0 +1,57 @@ +module Lithic + module Models + type address_update = + { + :address1 => String, + :address2 => String, + city: String, + country: String, + postal_code: String, + state: String + } + + class AddressUpdate < Lithic::Internal::Type::BaseModel + attr_reader address1: String? + + def address1=: (String) -> String + + attr_reader address2: String? + + def address2=: (String) -> String + + attr_reader city: String? + + def city=: (String) -> String + + attr_reader country: String? + + def country=: (String) -> String + + attr_reader postal_code: String? + + def postal_code=: (String) -> String + + attr_reader state: String? + + def state=: (String) -> String + + def initialize: ( + ?address1: String, + ?address2: String, + ?city: String, + ?country: String, + ?postal_code: String, + ?state: String + ) -> void + + def to_hash: -> { + :address1 => String, + :address2 => String, + city: String, + country: String, + postal_code: String, + state: String + } + end + end +end diff --git a/sig/lithic/models/api_status.rbs b/sig/lithic/models/api_status.rbs new file mode 100644 index 00000000..5d3247cd --- /dev/null +++ b/sig/lithic/models/api_status.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type api_status = { message: String } + + class APIStatus < Lithic::Internal::Type::BaseModel + attr_reader message: String? + + def message=: (String) -> String + + def initialize: (?message: String) -> void + + def to_hash: -> { message: String } + end + end +end diff --git a/sig/lithic/models/auth_rules/auth_rule.rbs b/sig/lithic/models/auth_rules/auth_rule.rbs new file mode 100644 index 00000000..51d9757b --- /dev/null +++ b/sig/lithic/models/auth_rules/auth_rule.rbs @@ -0,0 +1,234 @@ +module Lithic + module Models + class AuthRule = AuthRules::AuthRule + + module AuthRules + type auth_rule = + { + token: String, + account_tokens: ::Array[String], + business_account_tokens: ::Array[String], + card_tokens: ::Array[String], + current_version: Lithic::AuthRules::AuthRule::CurrentVersion?, + draft_version: Lithic::AuthRules::AuthRule::DraftVersion?, + event_stream: Lithic::Models::AuthRules::event_stream, + lithic_managed: bool, + name: String?, + program_level: bool, + state: Lithic::Models::AuthRules::AuthRule::state, + type: Lithic::Models::AuthRules::AuthRule::type_, + excluded_account_tokens: ::Array[String], + excluded_business_account_tokens: ::Array[String], + excluded_card_tokens: ::Array[String] + } + + class AuthRule < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor account_tokens: ::Array[String] + + attr_accessor business_account_tokens: ::Array[String] + + attr_accessor card_tokens: ::Array[String] + + attr_accessor current_version: Lithic::AuthRules::AuthRule::CurrentVersion? + + attr_accessor draft_version: Lithic::AuthRules::AuthRule::DraftVersion? + + attr_accessor event_stream: Lithic::Models::AuthRules::event_stream + + attr_accessor lithic_managed: bool + + attr_accessor name: String? + + attr_accessor program_level: bool + + attr_accessor state: Lithic::Models::AuthRules::AuthRule::state + + attr_accessor type: Lithic::Models::AuthRules::AuthRule::type_ + + attr_reader excluded_account_tokens: ::Array[String]? + + def excluded_account_tokens=: (::Array[String]) -> ::Array[String] + + attr_reader excluded_business_account_tokens: ::Array[String]? + + def excluded_business_account_tokens=: ( + ::Array[String] + ) -> ::Array[String] + + attr_reader excluded_card_tokens: ::Array[String]? + + def excluded_card_tokens=: (::Array[String]) -> ::Array[String] + + def initialize: ( + token: String, + account_tokens: ::Array[String], + business_account_tokens: ::Array[String], + card_tokens: ::Array[String], + current_version: Lithic::AuthRules::AuthRule::CurrentVersion?, + draft_version: Lithic::AuthRules::AuthRule::DraftVersion?, + event_stream: Lithic::Models::AuthRules::event_stream, + lithic_managed: bool, + name: String?, + program_level: bool, + state: Lithic::Models::AuthRules::AuthRule::state, + type: Lithic::Models::AuthRules::AuthRule::type_, + ?excluded_account_tokens: ::Array[String], + ?excluded_business_account_tokens: ::Array[String], + ?excluded_card_tokens: ::Array[String] + ) -> void + + def to_hash: -> { + token: String, + account_tokens: ::Array[String], + business_account_tokens: ::Array[String], + card_tokens: ::Array[String], + current_version: Lithic::AuthRules::AuthRule::CurrentVersion?, + draft_version: Lithic::AuthRules::AuthRule::DraftVersion?, + event_stream: Lithic::Models::AuthRules::event_stream, + lithic_managed: bool, + name: String?, + program_level: bool, + state: Lithic::Models::AuthRules::AuthRule::state, + type: Lithic::Models::AuthRules::AuthRule::type_, + excluded_account_tokens: ::Array[String], + excluded_business_account_tokens: ::Array[String], + excluded_card_tokens: ::Array[String] + } + + type current_version = + { + parameters: Lithic::Models::AuthRules::AuthRule::CurrentVersion::parameters, + version: Integer + } + + class CurrentVersion < Lithic::Internal::Type::BaseModel + attr_accessor parameters: Lithic::Models::AuthRules::AuthRule::CurrentVersion::parameters + + attr_accessor version: Integer + + def initialize: ( + parameters: Lithic::Models::AuthRules::AuthRule::CurrentVersion::parameters, + version: Integer + ) -> void + + def to_hash: -> { + parameters: Lithic::Models::AuthRules::AuthRule::CurrentVersion::parameters, + version: Integer + } + + type parameters = + Lithic::AuthRules::ConditionalBlockParameters + | Lithic::AuthRules::VelocityLimitParams + | Lithic::AuthRules::MerchantLockParameters + | Lithic::AuthRules::Conditional3DSActionParameters + | Lithic::AuthRules::ConditionalAuthorizationActionParameters + | Lithic::AuthRules::ConditionalACHActionParameters + | Lithic::AuthRules::ConditionalTokenizationActionParameters + | Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters + | Lithic::AuthRules::TypescriptCodeParameters + | Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters + + module Parameters + extend Lithic::Internal::Type::Union + + def self?.variants: -> ::Array[Lithic::Models::AuthRules::AuthRule::CurrentVersion::parameters] + end + end + + type draft_version = + { + error: String?, + parameters: Lithic::Models::AuthRules::AuthRule::DraftVersion::parameters, + state: Lithic::Models::AuthRules::AuthRule::DraftVersion::state, + version: Integer + } + + class DraftVersion < Lithic::Internal::Type::BaseModel + attr_accessor error: String? + + attr_accessor parameters: Lithic::Models::AuthRules::AuthRule::DraftVersion::parameters + + attr_accessor state: Lithic::Models::AuthRules::AuthRule::DraftVersion::state + + attr_accessor version: Integer + + def initialize: ( + error: String?, + parameters: Lithic::Models::AuthRules::AuthRule::DraftVersion::parameters, + state: Lithic::Models::AuthRules::AuthRule::DraftVersion::state, + version: Integer + ) -> void + + def to_hash: -> { + error: String?, + parameters: Lithic::Models::AuthRules::AuthRule::DraftVersion::parameters, + state: Lithic::Models::AuthRules::AuthRule::DraftVersion::state, + version: Integer + } + + type parameters = + Lithic::AuthRules::ConditionalBlockParameters + | Lithic::AuthRules::VelocityLimitParams + | Lithic::AuthRules::MerchantLockParameters + | Lithic::AuthRules::Conditional3DSActionParameters + | Lithic::AuthRules::ConditionalAuthorizationActionParameters + | Lithic::AuthRules::ConditionalACHActionParameters + | Lithic::AuthRules::ConditionalTokenizationActionParameters + | Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters + | Lithic::AuthRules::TypescriptCodeParameters + | Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters + + module Parameters + extend Lithic::Internal::Type::Union + + def self?.variants: -> ::Array[Lithic::Models::AuthRules::AuthRule::DraftVersion::parameters] + end + + type state = :PENDING | :SHADOWING | :ERROR + + module State + extend Lithic::Internal::Type::Enum + + PENDING: :PENDING + SHADOWING: :SHADOWING + ERROR: :ERROR + + def self?.values: -> ::Array[Lithic::Models::AuthRules::AuthRule::DraftVersion::state] + end + end + + type state = :ACTIVE | :INACTIVE + + module State + extend Lithic::Internal::Type::Enum + + ACTIVE: :ACTIVE + INACTIVE: :INACTIVE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::AuthRule::state] + end + + type type_ = + :CONDITIONAL_BLOCK + | :VELOCITY_LIMIT + | :MERCHANT_LOCK + | :CONDITIONAL_ACTION + | :TYPESCRIPT_CODE + + module Type + extend Lithic::Internal::Type::Enum + + CONDITIONAL_BLOCK: :CONDITIONAL_BLOCK + VELOCITY_LIMIT: :VELOCITY_LIMIT + MERCHANT_LOCK: :MERCHANT_LOCK + CONDITIONAL_ACTION: :CONDITIONAL_ACTION + TYPESCRIPT_CODE: :TYPESCRIPT_CODE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::AuthRule::type_] + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/auth_rule_condition.rbs b/sig/lithic/models/auth_rules/auth_rule_condition.rbs new file mode 100644 index 00000000..89722681 --- /dev/null +++ b/sig/lithic/models/auth_rules/auth_rule_condition.rbs @@ -0,0 +1,34 @@ +module Lithic + module Models + class AuthRuleCondition = AuthRules::AuthRuleCondition + + module AuthRules + type auth_rule_condition = + { + attribute: Lithic::Models::AuthRules::conditional_attribute, + operation: Lithic::Models::AuthRules::conditional_operation, + value: Lithic::Models::AuthRules::conditional_value + } + + class AuthRuleCondition < Lithic::Internal::Type::BaseModel + attr_accessor attribute: Lithic::Models::AuthRules::conditional_attribute + + attr_accessor operation: Lithic::Models::AuthRules::conditional_operation + + attr_accessor value: Lithic::Models::AuthRules::conditional_value + + def initialize: ( + attribute: Lithic::Models::AuthRules::conditional_attribute, + operation: Lithic::Models::AuthRules::conditional_operation, + value: Lithic::Models::AuthRules::conditional_value + ) -> void + + def to_hash: -> { + attribute: Lithic::Models::AuthRules::conditional_attribute, + operation: Lithic::Models::AuthRules::conditional_operation, + value: Lithic::Models::AuthRules::conditional_value + } + end + end + end +end diff --git a/sig/lithic/models/auth_rules/auth_rule_version.rbs b/sig/lithic/models/auth_rules/auth_rule_version.rbs new file mode 100644 index 00000000..0798d789 --- /dev/null +++ b/sig/lithic/models/auth_rules/auth_rule_version.rbs @@ -0,0 +1,69 @@ +module Lithic + module Models + class AuthRuleVersion = AuthRules::AuthRuleVersion + + module AuthRules + type auth_rule_version = + { + created: Time, + parameters: Lithic::Models::AuthRules::AuthRuleVersion::parameters, + state: Lithic::Models::AuthRules::AuthRuleVersion::state, + version: Integer + } + + class AuthRuleVersion < Lithic::Internal::Type::BaseModel + attr_accessor created: Time + + attr_accessor parameters: Lithic::Models::AuthRules::AuthRuleVersion::parameters + + attr_accessor state: Lithic::Models::AuthRules::AuthRuleVersion::state + + attr_accessor version: Integer + + def initialize: ( + created: Time, + parameters: Lithic::Models::AuthRules::AuthRuleVersion::parameters, + state: Lithic::Models::AuthRules::AuthRuleVersion::state, + version: Integer + ) -> void + + def to_hash: -> { + created: Time, + parameters: Lithic::Models::AuthRules::AuthRuleVersion::parameters, + state: Lithic::Models::AuthRules::AuthRuleVersion::state, + version: Integer + } + + type parameters = + Lithic::AuthRules::ConditionalBlockParameters + | Lithic::AuthRules::VelocityLimitParams + | Lithic::AuthRules::MerchantLockParameters + | Lithic::AuthRules::Conditional3DSActionParameters + | Lithic::AuthRules::ConditionalAuthorizationActionParameters + | Lithic::AuthRules::ConditionalACHActionParameters + | Lithic::AuthRules::ConditionalTokenizationActionParameters + | Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters + | Lithic::AuthRules::TypescriptCodeParameters + | Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters + + module Parameters + extend Lithic::Internal::Type::Union + + def self?.variants: -> ::Array[Lithic::Models::AuthRules::AuthRuleVersion::parameters] + end + + type state = :ACTIVE | :SHADOW | :INACTIVE + + module State + extend Lithic::Internal::Type::Enum + + ACTIVE: :ACTIVE + SHADOW: :SHADOW + INACTIVE: :INACTIVE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::AuthRuleVersion::state] + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/backtest_stats.rbs b/sig/lithic/models/auth_rules/backtest_stats.rbs new file mode 100644 index 00000000..fea4a65a --- /dev/null +++ b/sig/lithic/models/auth_rules/backtest_stats.rbs @@ -0,0 +1,106 @@ +module Lithic + module Models + module AuthRules + type backtest_stats = + { + approved: Integer, + challenged: Integer, + declined: Integer, + examples: ::Array[Lithic::AuthRules::BacktestStats::Example], + version: Integer + } + + class BacktestStats < Lithic::Internal::Type::BaseModel + attr_reader approved: Integer? + + def approved=: (Integer) -> Integer + + attr_reader challenged: Integer? + + def challenged=: (Integer) -> Integer + + attr_reader declined: Integer? + + def declined=: (Integer) -> Integer + + attr_reader examples: ::Array[Lithic::AuthRules::BacktestStats::Example]? + + def examples=: ( + ::Array[Lithic::AuthRules::BacktestStats::Example] + ) -> ::Array[Lithic::AuthRules::BacktestStats::Example] + + attr_reader version: Integer? + + def version=: (Integer) -> Integer + + def initialize: ( + ?approved: Integer, + ?challenged: Integer, + ?declined: Integer, + ?examples: ::Array[Lithic::AuthRules::BacktestStats::Example], + ?version: Integer + ) -> void + + def to_hash: -> { + approved: Integer, + challenged: Integer, + declined: Integer, + examples: ::Array[Lithic::AuthRules::BacktestStats::Example], + version: Integer + } + + type example = + { + decision: Lithic::Models::AuthRules::BacktestStats::Example::decision, + event_token: String, + timestamp: Time, + transaction_token: String? + } + + class Example < Lithic::Internal::Type::BaseModel + attr_reader decision: Lithic::Models::AuthRules::BacktestStats::Example::decision? + + def decision=: ( + Lithic::Models::AuthRules::BacktestStats::Example::decision + ) -> Lithic::Models::AuthRules::BacktestStats::Example::decision + + attr_reader event_token: String? + + def event_token=: (String) -> String + + attr_reader timestamp: Time? + + def timestamp=: (Time) -> Time + + attr_accessor transaction_token: String? + + def initialize: ( + ?decision: Lithic::Models::AuthRules::BacktestStats::Example::decision, + ?event_token: String, + ?timestamp: Time, + ?transaction_token: String? + ) -> void + + def to_hash: -> { + decision: Lithic::Models::AuthRules::BacktestStats::Example::decision, + event_token: String, + timestamp: Time, + transaction_token: String? + } + + type decision = :APPROVED | :DECLINED | :CHALLENGED + + module Decision + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + CHALLENGED: :CHALLENGED + + def self?.values: -> ::Array[Lithic::Models::AuthRules::BacktestStats::Example::decision] + end + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/card_transaction_update_action.rbs b/sig/lithic/models/auth_rules/card_transaction_update_action.rbs new file mode 100644 index 00000000..70f2af02 --- /dev/null +++ b/sig/lithic/models/auth_rules/card_transaction_update_action.rbs @@ -0,0 +1,100 @@ +module Lithic + module Models + module AuthRules + type card_transaction_update_action = + Lithic::AuthRules::CardTransactionUpdateAction::TagAction + | Lithic::AuthRules::CardTransactionUpdateAction::CreateCaseAction + + module CardTransactionUpdateAction + extend Lithic::Internal::Type::Union + + type tag_action = + { + key: String, + type: Lithic::Models::AuthRules::CardTransactionUpdateAction::TagAction::type_, + value: String + } + + class TagAction < Lithic::Internal::Type::BaseModel + attr_accessor key: String + + attr_accessor type: Lithic::Models::AuthRules::CardTransactionUpdateAction::TagAction::type_ + + attr_accessor value: String + + def initialize: ( + key: String, + type: Lithic::Models::AuthRules::CardTransactionUpdateAction::TagAction::type_, + value: String + ) -> void + + def to_hash: -> { + key: String, + type: Lithic::Models::AuthRules::CardTransactionUpdateAction::TagAction::type_, + value: String + } + + type type_ = :TAG + + module Type + extend Lithic::Internal::Type::Enum + + TAG: :TAG + + def self?.values: -> ::Array[Lithic::Models::AuthRules::CardTransactionUpdateAction::TagAction::type_] + end + end + + type create_case_action = + { + queue_token: String, + scope: Lithic::Models::AuthRules::CardTransactionUpdateAction::CreateCaseAction::scope, + type: Lithic::Models::AuthRules::CardTransactionUpdateAction::CreateCaseAction::type_ + } + + class CreateCaseAction < Lithic::Internal::Type::BaseModel + attr_accessor queue_token: String + + attr_accessor scope: Lithic::Models::AuthRules::CardTransactionUpdateAction::CreateCaseAction::scope + + attr_accessor type: Lithic::Models::AuthRules::CardTransactionUpdateAction::CreateCaseAction::type_ + + def initialize: ( + queue_token: String, + scope: Lithic::Models::AuthRules::CardTransactionUpdateAction::CreateCaseAction::scope, + type: Lithic::Models::AuthRules::CardTransactionUpdateAction::CreateCaseAction::type_ + ) -> void + + def to_hash: -> { + queue_token: String, + scope: Lithic::Models::AuthRules::CardTransactionUpdateAction::CreateCaseAction::scope, + type: Lithic::Models::AuthRules::CardTransactionUpdateAction::CreateCaseAction::type_ + } + + type scope = :CARD | :ACCOUNT + + module Scope + extend Lithic::Internal::Type::Enum + + CARD: :CARD + ACCOUNT: :ACCOUNT + + def self?.values: -> ::Array[Lithic::Models::AuthRules::CardTransactionUpdateAction::CreateCaseAction::scope] + end + + type type_ = :CREATE_CASE + + module Type + extend Lithic::Internal::Type::Enum + + CREATE_CASE: :CREATE_CASE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::CardTransactionUpdateAction::CreateCaseAction::type_] + end + end + + def self?.variants: -> ::Array[Lithic::Models::AuthRules::card_transaction_update_action] + end + end + end +end diff --git a/sig/lithic/models/auth_rules/conditional_3ds_action_parameters.rbs b/sig/lithic/models/auth_rules/conditional_3ds_action_parameters.rbs new file mode 100644 index 00000000..4d676309 --- /dev/null +++ b/sig/lithic/models/auth_rules/conditional_3ds_action_parameters.rbs @@ -0,0 +1,92 @@ +module Lithic + module Models + module AuthRules + type conditional3_ds_action_parameters = + { + action: Lithic::Models::AuthRules::Conditional3DSActionParameters::action, + conditions: ::Array[Lithic::AuthRules::Conditional3DSActionParameters::Condition] + } + + class Conditional3DSActionParameters < Lithic::Internal::Type::BaseModel + attr_accessor action: Lithic::Models::AuthRules::Conditional3DSActionParameters::action + + attr_accessor conditions: ::Array[Lithic::AuthRules::Conditional3DSActionParameters::Condition] + + def initialize: ( + action: Lithic::Models::AuthRules::Conditional3DSActionParameters::action, + conditions: ::Array[Lithic::AuthRules::Conditional3DSActionParameters::Condition] + ) -> void + + def to_hash: -> { + action: Lithic::Models::AuthRules::Conditional3DSActionParameters::action, + conditions: ::Array[Lithic::AuthRules::Conditional3DSActionParameters::Condition] + } + + type action = :DECLINE | :CHALLENGE + + module Action + extend Lithic::Internal::Type::Enum + + DECLINE: :DECLINE + CHALLENGE: :CHALLENGE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::Conditional3DSActionParameters::action] + end + + type condition = + { + attribute: Lithic::Models::AuthRules::Conditional3DSActionParameters::Condition::attribute, + operation: Lithic::Models::AuthRules::conditional_operation, + value: Lithic::Models::AuthRules::conditional_value + } + + class Condition < Lithic::Internal::Type::BaseModel + attr_accessor attribute: Lithic::Models::AuthRules::Conditional3DSActionParameters::Condition::attribute + + attr_accessor operation: Lithic::Models::AuthRules::conditional_operation + + attr_accessor value: Lithic::Models::AuthRules::conditional_value + + def initialize: ( + attribute: Lithic::Models::AuthRules::Conditional3DSActionParameters::Condition::attribute, + operation: Lithic::Models::AuthRules::conditional_operation, + value: Lithic::Models::AuthRules::conditional_value + ) -> void + + def to_hash: -> { + attribute: Lithic::Models::AuthRules::Conditional3DSActionParameters::Condition::attribute, + operation: Lithic::Models::AuthRules::conditional_operation, + value: Lithic::Models::AuthRules::conditional_value + } + + type attribute = + :MCC + | :COUNTRY + | :CURRENCY + | :MERCHANT_ID + | :DESCRIPTOR + | :TRANSACTION_AMOUNT + | :RISK_SCORE + | :MESSAGE_CATEGORY + | :ADDRESS_MATCH + + module Attribute + extend Lithic::Internal::Type::Enum + + MCC: :MCC + COUNTRY: :COUNTRY + CURRENCY: :CURRENCY + MERCHANT_ID: :MERCHANT_ID + DESCRIPTOR: :DESCRIPTOR + TRANSACTION_AMOUNT: :TRANSACTION_AMOUNT + RISK_SCORE: :RISK_SCORE + MESSAGE_CATEGORY: :MESSAGE_CATEGORY + ADDRESS_MATCH: :ADDRESS_MATCH + + def self?.values: -> ::Array[Lithic::Models::AuthRules::Conditional3DSActionParameters::Condition::attribute] + end + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/conditional_ach_action_parameters.rbs b/sig/lithic/models/auth_rules/conditional_ach_action_parameters.rbs new file mode 100644 index 00000000..73541612 --- /dev/null +++ b/sig/lithic/models/auth_rules/conditional_ach_action_parameters.rbs @@ -0,0 +1,293 @@ +module Lithic + module Models + module AuthRules + type conditional_ach_action_parameters = + { + action: Lithic::Models::AuthRules::ConditionalACHActionParameters::action, + conditions: ::Array[Lithic::AuthRules::ConditionalACHActionParameters::Condition] + } + + class ConditionalACHActionParameters < Lithic::Internal::Type::BaseModel + attr_accessor action: Lithic::Models::AuthRules::ConditionalACHActionParameters::action + + attr_accessor conditions: ::Array[Lithic::AuthRules::ConditionalACHActionParameters::Condition] + + def initialize: ( + action: Lithic::Models::AuthRules::ConditionalACHActionParameters::action, + conditions: ::Array[Lithic::AuthRules::ConditionalACHActionParameters::Condition] + ) -> void + + def to_hash: -> { + action: Lithic::Models::AuthRules::ConditionalACHActionParameters::action, + conditions: ::Array[Lithic::AuthRules::ConditionalACHActionParameters::Condition] + } + + type action = + Lithic::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH + | Lithic::AuthRules::ConditionalACHActionParameters::Action::ReturnAction + + module Action + extend Lithic::Internal::Type::Union + + type approve_action_ach = + { + type: Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH::type_ + } + + class ApproveActionACH < Lithic::Internal::Type::BaseModel + attr_accessor type: Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH::type_ + + def initialize: ( + type: Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH::type_ + ) -> void + + def to_hash: -> { + type: Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH::type_ + } + + type type_ = :APPROVE + + module Type + extend Lithic::Internal::Type::Enum + + APPROVE: :APPROVE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ApproveActionACH::type_] + end + end + + type return_action = + { + code: Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::code, + type: Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::type_ + } + + class ReturnAction < Lithic::Internal::Type::BaseModel + attr_accessor code: Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::code + + attr_accessor type: Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::type_ + + def initialize: ( + code: Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::code, + type: Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::type_ + ) -> void + + def to_hash: -> { + code: Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::code, + type: Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::type_ + } + + type code = + :R01 + | :R02 + | :R03 + | :R04 + | :R05 + | :R06 + | :R07 + | :R08 + | :R09 + | :R10 + | :R11 + | :R12 + | :R13 + | :R14 + | :R15 + | :R16 + | :R17 + | :R18 + | :R19 + | :R20 + | :R21 + | :R22 + | :R23 + | :R24 + | :R25 + | :R26 + | :R27 + | :R28 + | :R29 + | :R30 + | :R31 + | :R32 + | :R33 + | :R34 + | :R35 + | :R36 + | :R37 + | :R38 + | :R39 + | :R40 + | :R41 + | :R42 + | :R43 + | :R44 + | :R45 + | :R46 + | :R47 + | :R50 + | :R51 + | :R52 + | :R53 + | :R61 + | :R62 + | :R67 + | :R68 + | :R69 + | :R70 + | :R71 + | :R72 + | :R73 + | :R74 + | :R75 + | :R76 + | :R77 + | :R80 + | :R81 + | :R82 + | :R83 + | :R84 + | :R85 + + module Code + extend Lithic::Internal::Type::Enum + + R01: :R01 + R02: :R02 + R03: :R03 + R04: :R04 + R05: :R05 + R06: :R06 + R07: :R07 + R08: :R08 + R09: :R09 + R10: :R10 + R11: :R11 + R12: :R12 + R13: :R13 + R14: :R14 + R15: :R15 + R16: :R16 + R17: :R17 + R18: :R18 + R19: :R19 + R20: :R20 + R21: :R21 + R22: :R22 + R23: :R23 + R24: :R24 + R25: :R25 + R26: :R26 + R27: :R27 + R28: :R28 + R29: :R29 + R30: :R30 + R31: :R31 + R32: :R32 + R33: :R33 + R34: :R34 + R35: :R35 + R36: :R36 + R37: :R37 + R38: :R38 + R39: :R39 + R40: :R40 + R41: :R41 + R42: :R42 + R43: :R43 + R44: :R44 + R45: :R45 + R46: :R46 + R47: :R47 + R50: :R50 + R51: :R51 + R52: :R52 + R53: :R53 + R61: :R61 + R62: :R62 + R67: :R67 + R68: :R68 + R69: :R69 + R70: :R70 + R71: :R71 + R72: :R72 + R73: :R73 + R74: :R74 + R75: :R75 + R76: :R76 + R77: :R77 + R80: :R80 + R81: :R81 + R82: :R82 + R83: :R83 + R84: :R84 + R85: :R85 + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::code] + end + + type type_ = :RETURN + + module Type + extend Lithic::Internal::Type::Enum + + RETURN: :RETURN + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ConditionalACHActionParameters::Action::ReturnAction::type_] + end + end + + def self?.variants: -> ::Array[Lithic::Models::AuthRules::ConditionalACHActionParameters::action] + end + + type condition = + { + attribute: Lithic::Models::AuthRules::ConditionalACHActionParameters::Condition::attribute, + operation: Lithic::Models::AuthRules::conditional_operation, + value: Lithic::Models::AuthRules::conditional_value + } + + class Condition < Lithic::Internal::Type::BaseModel + attr_accessor attribute: Lithic::Models::AuthRules::ConditionalACHActionParameters::Condition::attribute + + attr_accessor operation: Lithic::Models::AuthRules::conditional_operation + + attr_accessor value: Lithic::Models::AuthRules::conditional_value + + def initialize: ( + attribute: Lithic::Models::AuthRules::ConditionalACHActionParameters::Condition::attribute, + operation: Lithic::Models::AuthRules::conditional_operation, + value: Lithic::Models::AuthRules::conditional_value + ) -> void + + def to_hash: -> { + attribute: Lithic::Models::AuthRules::ConditionalACHActionParameters::Condition::attribute, + operation: Lithic::Models::AuthRules::conditional_operation, + value: Lithic::Models::AuthRules::conditional_value + } + + type attribute = + :COMPANY_NAME + | :COMPANY_ID + | :TIMESTAMP + | :TRANSACTION_AMOUNT + | :SEC_CODE + | :MEMO + + module Attribute + extend Lithic::Internal::Type::Enum + + COMPANY_NAME: :COMPANY_NAME + COMPANY_ID: :COMPANY_ID + TIMESTAMP: :TIMESTAMP + TRANSACTION_AMOUNT: :TRANSACTION_AMOUNT + SEC_CODE: :SEC_CODE + MEMO: :MEMO + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ConditionalACHActionParameters::Condition::attribute] + end + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/conditional_attribute.rbs b/sig/lithic/models/auth_rules/conditional_attribute.rbs new file mode 100644 index 00000000..7eb61818 --- /dev/null +++ b/sig/lithic/models/auth_rules/conditional_attribute.rbs @@ -0,0 +1,48 @@ +module Lithic + module Models + module AuthRules + type conditional_attribute = + :MCC + | :COUNTRY + | :CURRENCY + | :MERCHANT_ID + | :DESCRIPTOR + | :LIABILITY_SHIFT + | :PAN_ENTRY_MODE + | :TRANSACTION_AMOUNT + | :RISK_SCORE + | :CARD_TRANSACTION_COUNT_15M + | :CARD_TRANSACTION_COUNT_1H + | :CARD_TRANSACTION_COUNT_24H + | :CARD_STATE + | :PIN_ENTERED + | :PIN_STATUS + | :WALLET_TYPE + | :ADDRESS_MATCH + + module ConditionalAttribute + extend Lithic::Internal::Type::Enum + + MCC: :MCC + COUNTRY: :COUNTRY + CURRENCY: :CURRENCY + MERCHANT_ID: :MERCHANT_ID + DESCRIPTOR: :DESCRIPTOR + LIABILITY_SHIFT: :LIABILITY_SHIFT + PAN_ENTRY_MODE: :PAN_ENTRY_MODE + TRANSACTION_AMOUNT: :TRANSACTION_AMOUNT + RISK_SCORE: :RISK_SCORE + CARD_TRANSACTION_COUNT_15_M: :CARD_TRANSACTION_COUNT_15M + CARD_TRANSACTION_COUNT_1_H: :CARD_TRANSACTION_COUNT_1H + CARD_TRANSACTION_COUNT_24_H: :CARD_TRANSACTION_COUNT_24H + CARD_STATE: :CARD_STATE + PIN_ENTERED: :PIN_ENTERED + PIN_STATUS: :PIN_STATUS + WALLET_TYPE: :WALLET_TYPE + ADDRESS_MATCH: :ADDRESS_MATCH + + def self?.values: -> ::Array[Lithic::Models::AuthRules::conditional_attribute] + end + end + end +end diff --git a/sig/lithic/models/auth_rules/conditional_authorization_action_parameters.rbs b/sig/lithic/models/auth_rules/conditional_authorization_action_parameters.rbs new file mode 100644 index 00000000..c19412e0 --- /dev/null +++ b/sig/lithic/models/auth_rules/conditional_authorization_action_parameters.rbs @@ -0,0 +1,238 @@ +module Lithic + module Models + module AuthRules + type conditional_authorization_action_parameters = + { + action: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::action, + conditions: ::Array[Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition] + } + + class ConditionalAuthorizationActionParameters < Lithic::Internal::Type::BaseModel + attr_accessor action: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::action + + attr_accessor conditions: ::Array[Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition] + + def initialize: ( + action: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::action, + conditions: ::Array[Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition] + ) -> void + + def to_hash: -> { + action: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::action, + conditions: ::Array[Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition] + } + + type action = :DECLINE | :CHALLENGE + + module Action + extend Lithic::Internal::Type::Enum + + DECLINE: :DECLINE + CHALLENGE: :CHALLENGE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::action] + end + + type condition = + { + attribute: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::attribute, + operation: Lithic::Models::AuthRules::conditional_operation, + value: Lithic::Models::AuthRules::conditional_value, + parameters: Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters + } + + class Condition < Lithic::Internal::Type::BaseModel + attr_accessor attribute: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::attribute + + attr_accessor operation: Lithic::Models::AuthRules::conditional_operation + + attr_accessor value: Lithic::Models::AuthRules::conditional_value + + attr_reader parameters: Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters? + + def parameters=: ( + Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters + ) -> Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters + + def initialize: ( + attribute: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::attribute, + operation: Lithic::Models::AuthRules::conditional_operation, + value: Lithic::Models::AuthRules::conditional_value, + ?parameters: Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters + ) -> void + + def to_hash: -> { + attribute: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::attribute, + operation: Lithic::Models::AuthRules::conditional_operation, + value: Lithic::Models::AuthRules::conditional_value, + parameters: Lithic::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters + } + + type attribute = + :MCC + | :COUNTRY + | :CURRENCY + | :MERCHANT_ID + | :DESCRIPTOR + | :LIABILITY_SHIFT + | :PAN_ENTRY_MODE + | :TRANSACTION_AMOUNT + | :CASH_AMOUNT + | :RISK_SCORE + | :CARD_TRANSACTION_COUNT_15M + | :CARD_TRANSACTION_COUNT_1H + | :CARD_TRANSACTION_COUNT_24H + | :CARD_DECLINE_COUNT_15M + | :CARD_DECLINE_COUNT_1H + | :CARD_DECLINE_COUNT_24H + | :CARD_STATE + | :PIN_ENTERED + | :PIN_STATUS + | :WALLET_TYPE + | :TRANSACTION_INITIATOR + | :ADDRESS_MATCH + | :SERVICE_LOCATION_STATE + | :SERVICE_LOCATION_POSTAL_CODE + | :CARD_AGE + | :ACCOUNT_AGE + | :AMOUNT_Z_SCORE + | :AVG_TRANSACTION_AMOUNT + | :STDEV_TRANSACTION_AMOUNT + | :IS_NEW_COUNTRY + | :IS_NEW_MCC + | :IS_FIRST_TRANSACTION + | :CONSECUTIVE_DECLINES + | :TIME_SINCE_LAST_TRANSACTION + | :DISTINCT_COUNTRY_COUNT + | :IS_NEW_MERCHANT + | :THREE_DS_SUCCESS_RATE + | :TRAVEL_SPEED + | :DISTANCE_FROM_LAST_TRANSACTION + + module Attribute + extend Lithic::Internal::Type::Enum + + MCC: :MCC + COUNTRY: :COUNTRY + CURRENCY: :CURRENCY + MERCHANT_ID: :MERCHANT_ID + DESCRIPTOR: :DESCRIPTOR + LIABILITY_SHIFT: :LIABILITY_SHIFT + PAN_ENTRY_MODE: :PAN_ENTRY_MODE + TRANSACTION_AMOUNT: :TRANSACTION_AMOUNT + CASH_AMOUNT: :CASH_AMOUNT + RISK_SCORE: :RISK_SCORE + CARD_TRANSACTION_COUNT_15_M: :CARD_TRANSACTION_COUNT_15M + CARD_TRANSACTION_COUNT_1_H: :CARD_TRANSACTION_COUNT_1H + CARD_TRANSACTION_COUNT_24_H: :CARD_TRANSACTION_COUNT_24H + CARD_DECLINE_COUNT_15_M: :CARD_DECLINE_COUNT_15M + CARD_DECLINE_COUNT_1_H: :CARD_DECLINE_COUNT_1H + CARD_DECLINE_COUNT_24_H: :CARD_DECLINE_COUNT_24H + CARD_STATE: :CARD_STATE + PIN_ENTERED: :PIN_ENTERED + PIN_STATUS: :PIN_STATUS + WALLET_TYPE: :WALLET_TYPE + TRANSACTION_INITIATOR: :TRANSACTION_INITIATOR + ADDRESS_MATCH: :ADDRESS_MATCH + SERVICE_LOCATION_STATE: :SERVICE_LOCATION_STATE + SERVICE_LOCATION_POSTAL_CODE: :SERVICE_LOCATION_POSTAL_CODE + CARD_AGE: :CARD_AGE + ACCOUNT_AGE: :ACCOUNT_AGE + AMOUNT_Z_SCORE: :AMOUNT_Z_SCORE + AVG_TRANSACTION_AMOUNT: :AVG_TRANSACTION_AMOUNT + STDEV_TRANSACTION_AMOUNT: :STDEV_TRANSACTION_AMOUNT + IS_NEW_COUNTRY: :IS_NEW_COUNTRY + IS_NEW_MCC: :IS_NEW_MCC + IS_FIRST_TRANSACTION: :IS_FIRST_TRANSACTION + CONSECUTIVE_DECLINES: :CONSECUTIVE_DECLINES + TIME_SINCE_LAST_TRANSACTION: :TIME_SINCE_LAST_TRANSACTION + DISTINCT_COUNTRY_COUNT: :DISTINCT_COUNTRY_COUNT + IS_NEW_MERCHANT: :IS_NEW_MERCHANT + THREE_DS_SUCCESS_RATE: :THREE_DS_SUCCESS_RATE + TRAVEL_SPEED: :TRAVEL_SPEED + DISTANCE_FROM_LAST_TRANSACTION: :DISTANCE_FROM_LAST_TRANSACTION + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::attribute] + end + + type parameters = + { + interval: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::interval, + scope: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::scope, + unit: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::unit + } + + class Parameters < Lithic::Internal::Type::BaseModel + attr_reader interval: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::interval? + + def interval=: ( + Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::interval + ) -> Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::interval + + attr_reader scope: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::scope? + + def scope=: ( + Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::scope + ) -> Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::scope + + attr_reader unit: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::unit? + + def unit=: ( + Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::unit + ) -> Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::unit + + def initialize: ( + ?interval: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::interval, + ?scope: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::scope, + ?unit: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::unit + ) -> void + + def to_hash: -> { + interval: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::interval, + scope: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::scope, + unit: Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::unit + } + + type interval = :LIFETIME | :"7D" | :"30D" | :"90D" + + module Interval + extend Lithic::Internal::Type::Enum + + LIFETIME: :LIFETIME + INTERVAL_7_D: :"7D" + INTERVAL_30_D: :"30D" + INTERVAL_90_D: :"90D" + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::interval] + end + + type scope = :CARD | :ACCOUNT | :BUSINESS_ACCOUNT + + module Scope + extend Lithic::Internal::Type::Enum + + CARD: :CARD + ACCOUNT: :ACCOUNT + BUSINESS_ACCOUNT: :BUSINESS_ACCOUNT + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::scope] + end + + type unit = :MPH | :KPH | :MILES | :KILOMETERS + + module Unit + extend Lithic::Internal::Type::Enum + + MPH: :MPH + KPH: :KPH + MILES: :MILES + KILOMETERS: :KILOMETERS + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ConditionalAuthorizationActionParameters::Condition::Parameters::unit] + end + end + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/conditional_authorization_adjustment_parameters.rbs b/sig/lithic/models/auth_rules/conditional_authorization_adjustment_parameters.rbs new file mode 100644 index 00000000..0a353c6b --- /dev/null +++ b/sig/lithic/models/auth_rules/conditional_authorization_adjustment_parameters.rbs @@ -0,0 +1,276 @@ +module Lithic + module Models + module AuthRules + type conditional_authorization_adjustment_parameters = + { + action: Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action, + conditions: ::Array[Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition] + } + + class ConditionalAuthorizationAdjustmentParameters < Lithic::Internal::Type::BaseModel + attr_accessor action: Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action + + attr_accessor conditions: ::Array[Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition] + + def initialize: ( + action: Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action, + conditions: ::Array[Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition] + ) -> void + + def to_hash: -> { + action: Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action, + conditions: ::Array[Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition] + } + + type action = + { + mode: Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::mode, + type: Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::type_, + value: Integer + } + + class Action < Lithic::Internal::Type::BaseModel + attr_accessor mode: Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::mode + + attr_accessor type: Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::type_ + + attr_accessor value: Integer + + def initialize: ( + mode: Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::mode, + type: Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::type_, + value: Integer + ) -> void + + def to_hash: -> { + mode: Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::mode, + type: Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::type_, + value: Integer + } + + type mode = :REPLACE_WITH_AMOUNT | :ADD_PERCENTAGE | :ADD_AMOUNT + + module Mode + extend Lithic::Internal::Type::Enum + + REPLACE_WITH_AMOUNT: :REPLACE_WITH_AMOUNT + ADD_PERCENTAGE: :ADD_PERCENTAGE + ADD_AMOUNT: :ADD_AMOUNT + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::mode] + end + + type type_ = :HOLD_ADJUSTMENT + + module Type + extend Lithic::Internal::Type::Enum + + HOLD_ADJUSTMENT: :HOLD_ADJUSTMENT + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Action::type_] + end + end + + type condition = + { + attribute: Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::attribute, + operation: Lithic::Models::AuthRules::conditional_operation, + value: Lithic::Models::AuthRules::conditional_value, + parameters: Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters + } + + class Condition < Lithic::Internal::Type::BaseModel + attr_accessor attribute: Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::attribute + + attr_accessor operation: Lithic::Models::AuthRules::conditional_operation + + attr_accessor value: Lithic::Models::AuthRules::conditional_value + + attr_reader parameters: Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters? + + def parameters=: ( + Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters + ) -> Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters + + def initialize: ( + attribute: Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::attribute, + operation: Lithic::Models::AuthRules::conditional_operation, + value: Lithic::Models::AuthRules::conditional_value, + ?parameters: Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters + ) -> void + + def to_hash: -> { + attribute: Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::attribute, + operation: Lithic::Models::AuthRules::conditional_operation, + value: Lithic::Models::AuthRules::conditional_value, + parameters: Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters + } + + type attribute = + :MCC + | :COUNTRY + | :CURRENCY + | :MERCHANT_ID + | :DESCRIPTOR + | :LIABILITY_SHIFT + | :PAN_ENTRY_MODE + | :TRANSACTION_AMOUNT + | :CASH_AMOUNT + | :RISK_SCORE + | :CARD_TRANSACTION_COUNT_15M + | :CARD_TRANSACTION_COUNT_1H + | :CARD_TRANSACTION_COUNT_24H + | :CARD_DECLINE_COUNT_15M + | :CARD_DECLINE_COUNT_1H + | :CARD_DECLINE_COUNT_24H + | :CARD_STATE + | :PIN_ENTERED + | :PIN_STATUS + | :WALLET_TYPE + | :TRANSACTION_INITIATOR + | :ADDRESS_MATCH + | :SERVICE_LOCATION_STATE + | :SERVICE_LOCATION_POSTAL_CODE + | :CARD_AGE + | :ACCOUNT_AGE + | :AMOUNT_Z_SCORE + | :AVG_TRANSACTION_AMOUNT + | :STDEV_TRANSACTION_AMOUNT + | :IS_NEW_COUNTRY + | :IS_NEW_MCC + | :IS_FIRST_TRANSACTION + | :CONSECUTIVE_DECLINES + | :TIME_SINCE_LAST_TRANSACTION + | :DISTINCT_COUNTRY_COUNT + | :IS_NEW_MERCHANT + | :THREE_DS_SUCCESS_RATE + | :TRAVEL_SPEED + | :DISTANCE_FROM_LAST_TRANSACTION + + module Attribute + extend Lithic::Internal::Type::Enum + + MCC: :MCC + COUNTRY: :COUNTRY + CURRENCY: :CURRENCY + MERCHANT_ID: :MERCHANT_ID + DESCRIPTOR: :DESCRIPTOR + LIABILITY_SHIFT: :LIABILITY_SHIFT + PAN_ENTRY_MODE: :PAN_ENTRY_MODE + TRANSACTION_AMOUNT: :TRANSACTION_AMOUNT + CASH_AMOUNT: :CASH_AMOUNT + RISK_SCORE: :RISK_SCORE + CARD_TRANSACTION_COUNT_15_M: :CARD_TRANSACTION_COUNT_15M + CARD_TRANSACTION_COUNT_1_H: :CARD_TRANSACTION_COUNT_1H + CARD_TRANSACTION_COUNT_24_H: :CARD_TRANSACTION_COUNT_24H + CARD_DECLINE_COUNT_15_M: :CARD_DECLINE_COUNT_15M + CARD_DECLINE_COUNT_1_H: :CARD_DECLINE_COUNT_1H + CARD_DECLINE_COUNT_24_H: :CARD_DECLINE_COUNT_24H + CARD_STATE: :CARD_STATE + PIN_ENTERED: :PIN_ENTERED + PIN_STATUS: :PIN_STATUS + WALLET_TYPE: :WALLET_TYPE + TRANSACTION_INITIATOR: :TRANSACTION_INITIATOR + ADDRESS_MATCH: :ADDRESS_MATCH + SERVICE_LOCATION_STATE: :SERVICE_LOCATION_STATE + SERVICE_LOCATION_POSTAL_CODE: :SERVICE_LOCATION_POSTAL_CODE + CARD_AGE: :CARD_AGE + ACCOUNT_AGE: :ACCOUNT_AGE + AMOUNT_Z_SCORE: :AMOUNT_Z_SCORE + AVG_TRANSACTION_AMOUNT: :AVG_TRANSACTION_AMOUNT + STDEV_TRANSACTION_AMOUNT: :STDEV_TRANSACTION_AMOUNT + IS_NEW_COUNTRY: :IS_NEW_COUNTRY + IS_NEW_MCC: :IS_NEW_MCC + IS_FIRST_TRANSACTION: :IS_FIRST_TRANSACTION + CONSECUTIVE_DECLINES: :CONSECUTIVE_DECLINES + TIME_SINCE_LAST_TRANSACTION: :TIME_SINCE_LAST_TRANSACTION + DISTINCT_COUNTRY_COUNT: :DISTINCT_COUNTRY_COUNT + IS_NEW_MERCHANT: :IS_NEW_MERCHANT + THREE_DS_SUCCESS_RATE: :THREE_DS_SUCCESS_RATE + TRAVEL_SPEED: :TRAVEL_SPEED + DISTANCE_FROM_LAST_TRANSACTION: :DISTANCE_FROM_LAST_TRANSACTION + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::attribute] + end + + type parameters = + { + interval: Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::interval, + scope: Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::scope, + unit: Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::unit + } + + class Parameters < Lithic::Internal::Type::BaseModel + attr_reader interval: Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::interval? + + def interval=: ( + Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::interval + ) -> Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::interval + + attr_reader scope: Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::scope? + + def scope=: ( + Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::scope + ) -> Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::scope + + attr_reader unit: Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::unit? + + def unit=: ( + Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::unit + ) -> Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::unit + + def initialize: ( + ?interval: Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::interval, + ?scope: Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::scope, + ?unit: Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::unit + ) -> void + + def to_hash: -> { + interval: Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::interval, + scope: Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::scope, + unit: Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::unit + } + + type interval = :LIFETIME | :"7D" | :"30D" | :"90D" + + module Interval + extend Lithic::Internal::Type::Enum + + LIFETIME: :LIFETIME + INTERVAL_7_D: :"7D" + INTERVAL_30_D: :"30D" + INTERVAL_90_D: :"90D" + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::interval] + end + + type scope = :CARD | :ACCOUNT | :BUSINESS_ACCOUNT + + module Scope + extend Lithic::Internal::Type::Enum + + CARD: :CARD + ACCOUNT: :ACCOUNT + BUSINESS_ACCOUNT: :BUSINESS_ACCOUNT + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::scope] + end + + type unit = :MPH | :KPH | :MILES | :KILOMETERS + + module Unit + extend Lithic::Internal::Type::Enum + + MPH: :MPH + KPH: :KPH + MILES: :MILES + KILOMETERS: :KILOMETERS + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ConditionalAuthorizationAdjustmentParameters::Condition::Parameters::unit] + end + end + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/conditional_block_parameters.rbs b/sig/lithic/models/auth_rules/conditional_block_parameters.rbs new file mode 100644 index 00000000..cb29896f --- /dev/null +++ b/sig/lithic/models/auth_rules/conditional_block_parameters.rbs @@ -0,0 +1,20 @@ +module Lithic + module Models + module AuthRules + type conditional_block_parameters = + { conditions: ::Array[Lithic::AuthRules::AuthRuleCondition] } + + class ConditionalBlockParameters < Lithic::Internal::Type::BaseModel + attr_accessor conditions: ::Array[Lithic::AuthRules::AuthRuleCondition] + + def initialize: ( + conditions: ::Array[Lithic::AuthRules::AuthRuleCondition] + ) -> void + + def to_hash: -> { + conditions: ::Array[Lithic::AuthRules::AuthRuleCondition] + } + end + end + end +end diff --git a/sig/lithic/models/auth_rules/conditional_card_transaction_update_action_parameters.rbs b/sig/lithic/models/auth_rules/conditional_card_transaction_update_action_parameters.rbs new file mode 100644 index 00000000..9766a2d3 --- /dev/null +++ b/sig/lithic/models/auth_rules/conditional_card_transaction_update_action_parameters.rbs @@ -0,0 +1,225 @@ +module Lithic + module Models + module AuthRules + type conditional_card_transaction_update_action_parameters = + { + action: Lithic::Models::AuthRules::card_transaction_update_action, + conditions: ::Array[Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition] + } + + class ConditionalCardTransactionUpdateActionParameters < Lithic::Internal::Type::BaseModel + attr_accessor action: Lithic::Models::AuthRules::card_transaction_update_action + + attr_accessor conditions: ::Array[Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition] + + def initialize: ( + action: Lithic::Models::AuthRules::card_transaction_update_action, + conditions: ::Array[Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition] + ) -> void + + def to_hash: -> { + action: Lithic::Models::AuthRules::card_transaction_update_action, + conditions: ::Array[Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition] + } + + type condition = + { + attribute: Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::attribute, + operation: Lithic::Models::AuthRules::conditional_operation, + value: Lithic::Models::AuthRules::conditional_value, + parameters: Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters + } + + class Condition < Lithic::Internal::Type::BaseModel + attr_accessor attribute: Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::attribute + + attr_accessor operation: Lithic::Models::AuthRules::conditional_operation + + attr_accessor value: Lithic::Models::AuthRules::conditional_value + + attr_reader parameters: Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters? + + def parameters=: ( + Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters + ) -> Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters + + def initialize: ( + attribute: Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::attribute, + operation: Lithic::Models::AuthRules::conditional_operation, + value: Lithic::Models::AuthRules::conditional_value, + ?parameters: Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters + ) -> void + + def to_hash: -> { + attribute: Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::attribute, + operation: Lithic::Models::AuthRules::conditional_operation, + value: Lithic::Models::AuthRules::conditional_value, + parameters: Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters + } + + type attribute = + :MCC + | :COUNTRY + | :CURRENCY + | :MERCHANT_ID + | :DESCRIPTOR + | :TRANSACTION_AMOUNT + | :RISK_SCORE + | :TRANSACTION_STATUS + | :LAST_EVENT_TYPE + | :LIABILITY_SHIFT + | :PAN_ENTRY_MODE + | :WALLET_TYPE + | :CARD_AGE + | :ACCOUNT_AGE + | :SPEND_VELOCITY_COUNT + | :SPEND_VELOCITY_AMOUNT + | :AMOUNT_Z_SCORE + | :AVG_TRANSACTION_AMOUNT + | :STDEV_TRANSACTION_AMOUNT + | :IS_NEW_COUNTRY + | :IS_NEW_MCC + | :IS_FIRST_TRANSACTION + | :CONSECUTIVE_DECLINES + | :TIME_SINCE_LAST_TRANSACTION + | :DISTINCT_COUNTRY_COUNT + | :IS_NEW_MERCHANT + | :THREE_DS_SUCCESS_RATE + | :TRAVEL_SPEED + | :DISTANCE_FROM_LAST_TRANSACTION + + module Attribute + extend Lithic::Internal::Type::Enum + + MCC: :MCC + COUNTRY: :COUNTRY + CURRENCY: :CURRENCY + MERCHANT_ID: :MERCHANT_ID + DESCRIPTOR: :DESCRIPTOR + TRANSACTION_AMOUNT: :TRANSACTION_AMOUNT + RISK_SCORE: :RISK_SCORE + TRANSACTION_STATUS: :TRANSACTION_STATUS + LAST_EVENT_TYPE: :LAST_EVENT_TYPE + LIABILITY_SHIFT: :LIABILITY_SHIFT + PAN_ENTRY_MODE: :PAN_ENTRY_MODE + WALLET_TYPE: :WALLET_TYPE + CARD_AGE: :CARD_AGE + ACCOUNT_AGE: :ACCOUNT_AGE + SPEND_VELOCITY_COUNT: :SPEND_VELOCITY_COUNT + SPEND_VELOCITY_AMOUNT: :SPEND_VELOCITY_AMOUNT + AMOUNT_Z_SCORE: :AMOUNT_Z_SCORE + AVG_TRANSACTION_AMOUNT: :AVG_TRANSACTION_AMOUNT + STDEV_TRANSACTION_AMOUNT: :STDEV_TRANSACTION_AMOUNT + IS_NEW_COUNTRY: :IS_NEW_COUNTRY + IS_NEW_MCC: :IS_NEW_MCC + IS_FIRST_TRANSACTION: :IS_FIRST_TRANSACTION + CONSECUTIVE_DECLINES: :CONSECUTIVE_DECLINES + TIME_SINCE_LAST_TRANSACTION: :TIME_SINCE_LAST_TRANSACTION + DISTINCT_COUNTRY_COUNT: :DISTINCT_COUNTRY_COUNT + IS_NEW_MERCHANT: :IS_NEW_MERCHANT + THREE_DS_SUCCESS_RATE: :THREE_DS_SUCCESS_RATE + TRAVEL_SPEED: :TRAVEL_SPEED + DISTANCE_FROM_LAST_TRANSACTION: :DISTANCE_FROM_LAST_TRANSACTION + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::attribute] + end + + type parameters = + { + filters: Lithic::AuthRules::SpendVelocityFilters, + interval: Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::interval, + period: Lithic::Models::AuthRules::velocity_limit_period, + scope: Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::scope, + unit: Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::unit + } + + class Parameters < Lithic::Internal::Type::BaseModel + attr_reader filters: Lithic::AuthRules::SpendVelocityFilters? + + def filters=: ( + Lithic::AuthRules::SpendVelocityFilters + ) -> Lithic::AuthRules::SpendVelocityFilters + + attr_reader interval: Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::interval? + + def interval=: ( + Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::interval + ) -> Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::interval + + attr_reader period: Lithic::Models::AuthRules::velocity_limit_period? + + def period=: ( + Lithic::Models::AuthRules::velocity_limit_period + ) -> Lithic::Models::AuthRules::velocity_limit_period + + attr_reader scope: Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::scope? + + def scope=: ( + Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::scope + ) -> Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::scope + + attr_reader unit: Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::unit? + + def unit=: ( + Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::unit + ) -> Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::unit + + def initialize: ( + ?filters: Lithic::AuthRules::SpendVelocityFilters, + ?interval: Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::interval, + ?period: Lithic::Models::AuthRules::velocity_limit_period, + ?scope: Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::scope, + ?unit: Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::unit + ) -> void + + def to_hash: -> { + filters: Lithic::AuthRules::SpendVelocityFilters, + interval: Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::interval, + period: Lithic::Models::AuthRules::velocity_limit_period, + scope: Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::scope, + unit: Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::unit + } + + type interval = :LIFETIME | :"7D" | :"30D" | :"90D" + + module Interval + extend Lithic::Internal::Type::Enum + + LIFETIME: :LIFETIME + INTERVAL_7_D: :"7D" + INTERVAL_30_D: :"30D" + INTERVAL_90_D: :"90D" + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::interval] + end + + type scope = :CARD | :ACCOUNT | :GLOBAL + + module Scope + extend Lithic::Internal::Type::Enum + + CARD: :CARD + ACCOUNT: :ACCOUNT + GLOBAL: :GLOBAL + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::scope] + end + + type unit = :MPH | :KPH | :MILES | :KILOMETERS + + module Unit + extend Lithic::Internal::Type::Enum + + MPH: :MPH + KPH: :KPH + MILES: :MILES + KILOMETERS: :KILOMETERS + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ConditionalCardTransactionUpdateActionParameters::Condition::Parameters::unit] + end + end + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/conditional_operation.rbs b/sig/lithic/models/auth_rules/conditional_operation.rbs new file mode 100644 index 00000000..c1280caa --- /dev/null +++ b/sig/lithic/models/auth_rules/conditional_operation.rbs @@ -0,0 +1,44 @@ +module Lithic + module Models + module AuthRules + type conditional_operation = + :IS_ONE_OF + | :IS_NOT_ONE_OF + | :MATCHES + | :DOES_NOT_MATCH + | :IS_EQUAL_TO + | :IS_NOT_EQUAL_TO + | :IS_GREATER_THAN + | :IS_GREATER_THAN_OR_EQUAL_TO + | :IS_LESS_THAN + | :IS_LESS_THAN_OR_EQUAL_TO + | :IS_AFTER + | :IS_BEFORE + | :CONTAINS_ANY + | :CONTAINS_ALL + | :CONTAINS_NONE + + module ConditionalOperation + extend Lithic::Internal::Type::Enum + + IS_ONE_OF: :IS_ONE_OF + IS_NOT_ONE_OF: :IS_NOT_ONE_OF + MATCHES: :MATCHES + DOES_NOT_MATCH: :DOES_NOT_MATCH + IS_EQUAL_TO: :IS_EQUAL_TO + IS_NOT_EQUAL_TO: :IS_NOT_EQUAL_TO + IS_GREATER_THAN: :IS_GREATER_THAN + IS_GREATER_THAN_OR_EQUAL_TO: :IS_GREATER_THAN_OR_EQUAL_TO + IS_LESS_THAN: :IS_LESS_THAN + IS_LESS_THAN_OR_EQUAL_TO: :IS_LESS_THAN_OR_EQUAL_TO + IS_AFTER: :IS_AFTER + IS_BEFORE: :IS_BEFORE + CONTAINS_ANY: :CONTAINS_ANY + CONTAINS_ALL: :CONTAINS_ALL + CONTAINS_NONE: :CONTAINS_NONE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::conditional_operation] + end + end + end +end diff --git a/sig/lithic/models/auth_rules/conditional_tokenization_action_parameters.rbs b/sig/lithic/models/auth_rules/conditional_tokenization_action_parameters.rbs new file mode 100644 index 00000000..375a15d4 --- /dev/null +++ b/sig/lithic/models/auth_rules/conditional_tokenization_action_parameters.rbs @@ -0,0 +1,241 @@ +module Lithic + module Models + module AuthRules + type conditional_tokenization_action_parameters = + { + action: Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::action, + conditions: ::Array[Lithic::AuthRules::ConditionalTokenizationActionParameters::Condition] + } + + class ConditionalTokenizationActionParameters < Lithic::Internal::Type::BaseModel + attr_accessor action: Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::action + + attr_accessor conditions: ::Array[Lithic::AuthRules::ConditionalTokenizationActionParameters::Condition] + + def initialize: ( + action: Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::action, + conditions: ::Array[Lithic::AuthRules::ConditionalTokenizationActionParameters::Condition] + ) -> void + + def to_hash: -> { + action: Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::action, + conditions: ::Array[Lithic::AuthRules::ConditionalTokenizationActionParameters::Condition] + } + + type action = + Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization + | Lithic::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction + + module Action + extend Lithic::Internal::Type::Union + + type decline_action_tokenization = + { + type: Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::type_, + reason: Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::reason + } + + class DeclineActionTokenization < Lithic::Internal::Type::BaseModel + attr_accessor type: Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::type_ + + attr_reader reason: Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::reason? + + def reason=: ( + Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::reason + ) -> Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::reason + + def initialize: ( + type: Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::type_, + ?reason: Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::reason + ) -> void + + def to_hash: -> { + type: Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::type_, + reason: Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::reason + } + + type type_ = :DECLINE + + module Type + extend Lithic::Internal::Type::Enum + + DECLINE: :DECLINE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::type_] + end + + type reason = + :ACCOUNT_SCORE_1 + | :DEVICE_SCORE_1 + | :ALL_WALLET_DECLINE_REASONS_PRESENT + | :WALLET_RECOMMENDED_DECISION_RED + | :CVC_MISMATCH + | :CARD_EXPIRY_MONTH_MISMATCH + | :CARD_EXPIRY_YEAR_MISMATCH + | :CARD_INVALID_STATE + | :CUSTOMER_RED_PATH + | :INVALID_CUSTOMER_RESPONSE + | :NETWORK_FAILURE + | :GENERIC_DECLINE + | :DIGITAL_CARD_ART_REQUIRED + + module Reason + extend Lithic::Internal::Type::Enum + + ACCOUNT_SCORE_1: :ACCOUNT_SCORE_1 + DEVICE_SCORE_1: :DEVICE_SCORE_1 + ALL_WALLET_DECLINE_REASONS_PRESENT: :ALL_WALLET_DECLINE_REASONS_PRESENT + WALLET_RECOMMENDED_DECISION_RED: :WALLET_RECOMMENDED_DECISION_RED + CVC_MISMATCH: :CVC_MISMATCH + CARD_EXPIRY_MONTH_MISMATCH: :CARD_EXPIRY_MONTH_MISMATCH + CARD_EXPIRY_YEAR_MISMATCH: :CARD_EXPIRY_YEAR_MISMATCH + CARD_INVALID_STATE: :CARD_INVALID_STATE + CUSTOMER_RED_PATH: :CUSTOMER_RED_PATH + INVALID_CUSTOMER_RESPONSE: :INVALID_CUSTOMER_RESPONSE + NETWORK_FAILURE: :NETWORK_FAILURE + GENERIC_DECLINE: :GENERIC_DECLINE + DIGITAL_CARD_ART_REQUIRED: :DIGITAL_CARD_ART_REQUIRED + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::DeclineActionTokenization::reason] + end + end + + type require_tfa_action = + { + type: Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::type_, + reason: Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::reason + } + + class RequireTfaAction < Lithic::Internal::Type::BaseModel + attr_accessor type: Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::type_ + + attr_reader reason: Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::reason? + + def reason=: ( + Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::reason + ) -> Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::reason + + def initialize: ( + type: Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::type_, + ?reason: Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::reason + ) -> void + + def to_hash: -> { + type: Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::type_, + reason: Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::reason + } + + type type_ = :REQUIRE_TFA + + module Type + extend Lithic::Internal::Type::Enum + + REQUIRE_TFA: :REQUIRE_TFA + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::type_] + end + + type reason = + :WALLET_RECOMMENDED_TFA + | :SUSPICIOUS_ACTIVITY + | :DEVICE_RECENTLY_LOST + | :TOO_MANY_RECENT_ATTEMPTS + | :TOO_MANY_RECENT_TOKENS + | :TOO_MANY_DIFFERENT_CARDHOLDERS + | :OUTSIDE_HOME_TERRITORY + | :HAS_SUSPENDED_TOKENS + | :HIGH_RISK + | :ACCOUNT_SCORE_LOW + | :DEVICE_SCORE_LOW + | :CARD_STATE_TFA + | :HARDCODED_TFA + | :CUSTOMER_RULE_TFA + | :DEVICE_HOST_CARD_EMULATION + + module Reason + extend Lithic::Internal::Type::Enum + + WALLET_RECOMMENDED_TFA: :WALLET_RECOMMENDED_TFA + SUSPICIOUS_ACTIVITY: :SUSPICIOUS_ACTIVITY + DEVICE_RECENTLY_LOST: :DEVICE_RECENTLY_LOST + TOO_MANY_RECENT_ATTEMPTS: :TOO_MANY_RECENT_ATTEMPTS + TOO_MANY_RECENT_TOKENS: :TOO_MANY_RECENT_TOKENS + TOO_MANY_DIFFERENT_CARDHOLDERS: :TOO_MANY_DIFFERENT_CARDHOLDERS + OUTSIDE_HOME_TERRITORY: :OUTSIDE_HOME_TERRITORY + HAS_SUSPENDED_TOKENS: :HAS_SUSPENDED_TOKENS + HIGH_RISK: :HIGH_RISK + ACCOUNT_SCORE_LOW: :ACCOUNT_SCORE_LOW + DEVICE_SCORE_LOW: :DEVICE_SCORE_LOW + CARD_STATE_TFA: :CARD_STATE_TFA + HARDCODED_TFA: :HARDCODED_TFA + CUSTOMER_RULE_TFA: :CUSTOMER_RULE_TFA + DEVICE_HOST_CARD_EMULATION: :DEVICE_HOST_CARD_EMULATION + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Action::RequireTfaAction::reason] + end + end + + def self?.variants: -> ::Array[Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::action] + end + + type condition = + { + attribute: Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Condition::attribute, + operation: Lithic::Models::AuthRules::conditional_operation, + value: Lithic::Models::AuthRules::conditional_value + } + + class Condition < Lithic::Internal::Type::BaseModel + attr_accessor attribute: Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Condition::attribute + + attr_accessor operation: Lithic::Models::AuthRules::conditional_operation + + attr_accessor value: Lithic::Models::AuthRules::conditional_value + + def initialize: ( + attribute: Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Condition::attribute, + operation: Lithic::Models::AuthRules::conditional_operation, + value: Lithic::Models::AuthRules::conditional_value + ) -> void + + def to_hash: -> { + attribute: Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Condition::attribute, + operation: Lithic::Models::AuthRules::conditional_operation, + value: Lithic::Models::AuthRules::conditional_value + } + + type attribute = + :TIMESTAMP + | :TOKENIZATION_CHANNEL + | :TOKENIZATION_SOURCE + | :TOKEN_REQUESTOR_NAME + | :WALLET_ACCOUNT_SCORE + | :WALLET_DEVICE_SCORE + | :WALLET_RECOMMENDED_DECISION + | :WALLET_RECOMMENDATION_REASONS + | :TOKEN_REQUESTOR_ID + | :WALLET_TOKEN_STATUS + | :CARD_STATE + + module Attribute + extend Lithic::Internal::Type::Enum + + TIMESTAMP: :TIMESTAMP + TOKENIZATION_CHANNEL: :TOKENIZATION_CHANNEL + TOKENIZATION_SOURCE: :TOKENIZATION_SOURCE + TOKEN_REQUESTOR_NAME: :TOKEN_REQUESTOR_NAME + WALLET_ACCOUNT_SCORE: :WALLET_ACCOUNT_SCORE + WALLET_DEVICE_SCORE: :WALLET_DEVICE_SCORE + WALLET_RECOMMENDED_DECISION: :WALLET_RECOMMENDED_DECISION + WALLET_RECOMMENDATION_REASONS: :WALLET_RECOMMENDATION_REASONS + TOKEN_REQUESTOR_ID: :TOKEN_REQUESTOR_ID + WALLET_TOKEN_STATUS: :WALLET_TOKEN_STATUS + CARD_STATE: :CARD_STATE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ConditionalTokenizationActionParameters::Condition::attribute] + end + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/conditional_value.rbs b/sig/lithic/models/auth_rules/conditional_value.rbs new file mode 100644 index 00000000..ff6319ee --- /dev/null +++ b/sig/lithic/models/auth_rules/conditional_value.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + module AuthRules + type conditional_value = String | Integer | Float | ::Array[String] | Time + + module ConditionalValue + extend Lithic::Internal::Type::Union + + def self?.variants: -> ::Array[Lithic::Models::AuthRules::conditional_value] + + StringArray: Lithic::Internal::Type::Converter + end + end + end +end diff --git a/sig/lithic/models/auth_rules/event_stream.rbs b/sig/lithic/models/auth_rules/event_stream.rbs new file mode 100644 index 00000000..60b698c5 --- /dev/null +++ b/sig/lithic/models/auth_rules/event_stream.rbs @@ -0,0 +1,26 @@ +module Lithic + module Models + module AuthRules + type event_stream = + :AUTHORIZATION + | :THREE_DS_AUTHENTICATION + | :TOKENIZATION + | :ACH_CREDIT_RECEIPT + | :ACH_DEBIT_RECEIPT + | :CARD_TRANSACTION_UPDATE + + module EventStream + extend Lithic::Internal::Type::Enum + + AUTHORIZATION: :AUTHORIZATION + THREE_DS_AUTHENTICATION: :THREE_DS_AUTHENTICATION + TOKENIZATION: :TOKENIZATION + ACH_CREDIT_RECEIPT: :ACH_CREDIT_RECEIPT + ACH_DEBIT_RECEIPT: :ACH_DEBIT_RECEIPT + CARD_TRANSACTION_UPDATE: :CARD_TRANSACTION_UPDATE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::event_stream] + end + end + end +end diff --git a/sig/lithic/models/auth_rules/merchant_lock_parameters.rbs b/sig/lithic/models/auth_rules/merchant_lock_parameters.rbs new file mode 100644 index 00000000..2e9dcef0 --- /dev/null +++ b/sig/lithic/models/auth_rules/merchant_lock_parameters.rbs @@ -0,0 +1,51 @@ +module Lithic + module Models + module AuthRules + type merchant_lock_parameters = + { + merchants: ::Array[Lithic::AuthRules::MerchantLockParameters::Merchant] + } + + class MerchantLockParameters < Lithic::Internal::Type::BaseModel + attr_accessor merchants: ::Array[Lithic::AuthRules::MerchantLockParameters::Merchant] + + def initialize: ( + merchants: ::Array[Lithic::AuthRules::MerchantLockParameters::Merchant] + ) -> void + + def to_hash: -> { + merchants: ::Array[Lithic::AuthRules::MerchantLockParameters::Merchant] + } + + type merchant = + { comment: String, descriptor: String, merchant_id: String } + + class Merchant < Lithic::Internal::Type::BaseModel + attr_reader comment: String? + + def comment=: (String) -> String + + attr_reader descriptor: String? + + def descriptor=: (String) -> String + + attr_reader merchant_id: String? + + def merchant_id=: (String) -> String + + def initialize: ( + ?comment: String, + ?descriptor: String, + ?merchant_id: String + ) -> void + + def to_hash: -> { + comment: String, + descriptor: String, + merchant_id: String + } + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/report_stats.rbs b/sig/lithic/models/auth_rules/report_stats.rbs new file mode 100644 index 00000000..f2080b06 --- /dev/null +++ b/sig/lithic/models/auth_rules/report_stats.rbs @@ -0,0 +1,660 @@ +module Lithic + module Models + module AuthRules + type report_stats = + { + action_counts: ::Hash[Symbol, Integer], + examples: ::Array[Lithic::AuthRules::ReportStats::Example], + state: Lithic::Models::AuthRules::ReportStats::state, + version: Integer + } + + class ReportStats < Lithic::Internal::Type::BaseModel + attr_accessor action_counts: ::Hash[Symbol, Integer] + + attr_accessor examples: ::Array[Lithic::AuthRules::ReportStats::Example] + + attr_accessor state: Lithic::Models::AuthRules::ReportStats::state + + attr_accessor version: Integer + + def initialize: ( + action_counts: ::Hash[Symbol, Integer], + examples: ::Array[Lithic::AuthRules::ReportStats::Example], + state: Lithic::Models::AuthRules::ReportStats::state, + version: Integer + ) -> void + + def to_hash: -> { + action_counts: ::Hash[Symbol, Integer], + examples: ::Array[Lithic::AuthRules::ReportStats::Example], + state: Lithic::Models::AuthRules::ReportStats::state, + version: Integer + } + + type example = + { + actions: ::Array[Lithic::Models::AuthRules::ReportStats::Example::action], + event_token: String, + timestamp: Time, + transaction_token: String? + } + + class Example < Lithic::Internal::Type::BaseModel + attr_accessor actions: ::Array[Lithic::Models::AuthRules::ReportStats::Example::action] + + attr_accessor event_token: String + + attr_accessor timestamp: Time + + attr_accessor transaction_token: String? + + def initialize: ( + actions: ::Array[Lithic::Models::AuthRules::ReportStats::Example::action], + event_token: String, + timestamp: Time, + ?transaction_token: String? + ) -> void + + def to_hash: -> { + actions: ::Array[Lithic::Models::AuthRules::ReportStats::Example::action], + event_token: String, + timestamp: Time, + transaction_token: String? + } + + type action = + Lithic::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization + | Lithic::AuthRules::ReportStats::Example::Action::ChallengeActionAuthorization + | Lithic::AuthRules::ReportStats::Example::Action::ResultAuthentication3DSAction + | Lithic::AuthRules::ReportStats::Example::Action::DeclineActionTokenization + | Lithic::AuthRules::ReportStats::Example::Action::RequireTfaAction + | Lithic::AuthRules::ReportStats::Example::Action::ApproveActionACH + | Lithic::AuthRules::ReportStats::Example::Action::ReturnAction + + module Action + extend Lithic::Internal::Type::Union + + type decline_action_authorization = + { + code: Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::code, + type: Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::type_ + } + + class DeclineActionAuthorization < Lithic::Internal::Type::BaseModel + attr_accessor code: Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::code + + attr_accessor type: Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::type_ + + def initialize: ( + code: Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::code, + type: Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::type_ + ) -> void + + def to_hash: -> { + code: Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::code, + type: Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::type_ + } + + type code = + :ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED + | :ACCOUNT_DELINQUENT + | :ACCOUNT_INACTIVE + | :ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED + | :ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED + | :ACCOUNT_PAUSED + | :ACCOUNT_UNDER_REVIEW + | :ADDRESS_INCORRECT + | :APPROVED + | :AUTH_RULE_ALLOWED_COUNTRY + | :AUTH_RULE_ALLOWED_MCC + | :AUTH_RULE_BLOCKED_COUNTRY + | :AUTH_RULE_BLOCKED_MCC + | :AUTH_RULE + | :CARD_CLOSED + | :CARD_CRYPTOGRAM_VALIDATION_FAILURE + | :CARD_EXPIRED + | :CARD_EXPIRY_DATE_INCORRECT + | :CARD_INVALID + | :CARD_NOT_ACTIVATED + | :CARD_PAUSED + | :CARD_PIN_INCORRECT + | :CARD_RESTRICTED + | :CARD_SECURITY_CODE_INCORRECT + | :CARD_SPEND_LIMIT_EXCEEDED + | :CONTACT_CARD_ISSUER + | :CUSTOMER_ASA_TIMEOUT + | :CUSTOM_ASA_RESULT + | :DECLINED + | :DO_NOT_HONOR + | :DRIVER_NUMBER_INVALID + | :FORMAT_ERROR + | :INSUFFICIENT_FUNDING_SOURCE_BALANCE + | :INSUFFICIENT_FUNDS + | :LITHIC_SYSTEM_ERROR + | :LITHIC_SYSTEM_RATE_LIMIT + | :MALFORMED_ASA_RESPONSE + | :MERCHANT_INVALID + | :MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE + | :MERCHANT_NOT_PERMITTED + | :OVER_REVERSAL_ATTEMPTED + | :PIN_BLOCKED + | :PROGRAM_CARD_SPEND_LIMIT_EXCEEDED + | :PROGRAM_SUSPENDED + | :PROGRAM_USAGE_RESTRICTION + | :REVERSAL_UNMATCHED + | :SECURITY_VIOLATION + | :SINGLE_USE_CARD_REATTEMPTED + | :SUSPECTED_FRAUD + | :TRANSACTION_INVALID + | :TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL + | :TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER + | :TRANSACTION_PREVIOUSLY_COMPLETED + | :UNAUTHORIZED_MERCHANT + | :VEHICLE_NUMBER_INVALID + | :CARDHOLDER_CHALLENGED + | :CARDHOLDER_CHALLENGE_FAILED + + module Code + extend Lithic::Internal::Type::Enum + + ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED: :ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED + ACCOUNT_DELINQUENT: :ACCOUNT_DELINQUENT + ACCOUNT_INACTIVE: :ACCOUNT_INACTIVE + ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED: :ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED + ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED: :ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED + ACCOUNT_PAUSED: :ACCOUNT_PAUSED + ACCOUNT_UNDER_REVIEW: :ACCOUNT_UNDER_REVIEW + ADDRESS_INCORRECT: :ADDRESS_INCORRECT + APPROVED: :APPROVED + AUTH_RULE_ALLOWED_COUNTRY: :AUTH_RULE_ALLOWED_COUNTRY + AUTH_RULE_ALLOWED_MCC: :AUTH_RULE_ALLOWED_MCC + AUTH_RULE_BLOCKED_COUNTRY: :AUTH_RULE_BLOCKED_COUNTRY + AUTH_RULE_BLOCKED_MCC: :AUTH_RULE_BLOCKED_MCC + AUTH_RULE: :AUTH_RULE + CARD_CLOSED: :CARD_CLOSED + CARD_CRYPTOGRAM_VALIDATION_FAILURE: :CARD_CRYPTOGRAM_VALIDATION_FAILURE + CARD_EXPIRED: :CARD_EXPIRED + CARD_EXPIRY_DATE_INCORRECT: :CARD_EXPIRY_DATE_INCORRECT + CARD_INVALID: :CARD_INVALID + CARD_NOT_ACTIVATED: :CARD_NOT_ACTIVATED + CARD_PAUSED: :CARD_PAUSED + CARD_PIN_INCORRECT: :CARD_PIN_INCORRECT + CARD_RESTRICTED: :CARD_RESTRICTED + CARD_SECURITY_CODE_INCORRECT: :CARD_SECURITY_CODE_INCORRECT + CARD_SPEND_LIMIT_EXCEEDED: :CARD_SPEND_LIMIT_EXCEEDED + CONTACT_CARD_ISSUER: :CONTACT_CARD_ISSUER + CUSTOMER_ASA_TIMEOUT: :CUSTOMER_ASA_TIMEOUT + CUSTOM_ASA_RESULT: :CUSTOM_ASA_RESULT + DECLINED: :DECLINED + DO_NOT_HONOR: :DO_NOT_HONOR + DRIVER_NUMBER_INVALID: :DRIVER_NUMBER_INVALID + FORMAT_ERROR: :FORMAT_ERROR + INSUFFICIENT_FUNDING_SOURCE_BALANCE: :INSUFFICIENT_FUNDING_SOURCE_BALANCE + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + LITHIC_SYSTEM_ERROR: :LITHIC_SYSTEM_ERROR + LITHIC_SYSTEM_RATE_LIMIT: :LITHIC_SYSTEM_RATE_LIMIT + MALFORMED_ASA_RESPONSE: :MALFORMED_ASA_RESPONSE + MERCHANT_INVALID: :MERCHANT_INVALID + MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE: :MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE + MERCHANT_NOT_PERMITTED: :MERCHANT_NOT_PERMITTED + OVER_REVERSAL_ATTEMPTED: :OVER_REVERSAL_ATTEMPTED + PIN_BLOCKED: :PIN_BLOCKED + PROGRAM_CARD_SPEND_LIMIT_EXCEEDED: :PROGRAM_CARD_SPEND_LIMIT_EXCEEDED + PROGRAM_SUSPENDED: :PROGRAM_SUSPENDED + PROGRAM_USAGE_RESTRICTION: :PROGRAM_USAGE_RESTRICTION + REVERSAL_UNMATCHED: :REVERSAL_UNMATCHED + SECURITY_VIOLATION: :SECURITY_VIOLATION + SINGLE_USE_CARD_REATTEMPTED: :SINGLE_USE_CARD_REATTEMPTED + SUSPECTED_FRAUD: :SUSPECTED_FRAUD + TRANSACTION_INVALID: :TRANSACTION_INVALID + TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL: :TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL + TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER: :TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER + TRANSACTION_PREVIOUSLY_COMPLETED: :TRANSACTION_PREVIOUSLY_COMPLETED + UNAUTHORIZED_MERCHANT: :UNAUTHORIZED_MERCHANT + VEHICLE_NUMBER_INVALID: :VEHICLE_NUMBER_INVALID + CARDHOLDER_CHALLENGED: :CARDHOLDER_CHALLENGED + CARDHOLDER_CHALLENGE_FAILED: :CARDHOLDER_CHALLENGE_FAILED + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::code] + end + + type type_ = :DECLINE + + module Type + extend Lithic::Internal::Type::Enum + + DECLINE: :DECLINE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionAuthorization::type_] + end + end + + type challenge_action_authorization = + { + type: Lithic::Models::AuthRules::ReportStats::Example::Action::ChallengeActionAuthorization::type_ + } + + class ChallengeActionAuthorization < Lithic::Internal::Type::BaseModel + attr_accessor type: Lithic::Models::AuthRules::ReportStats::Example::Action::ChallengeActionAuthorization::type_ + + def initialize: ( + type: Lithic::Models::AuthRules::ReportStats::Example::Action::ChallengeActionAuthorization::type_ + ) -> void + + def to_hash: -> { + type: Lithic::Models::AuthRules::ReportStats::Example::Action::ChallengeActionAuthorization::type_ + } + + type type_ = :CHALLENGE + + module Type + extend Lithic::Internal::Type::Enum + + CHALLENGE: :CHALLENGE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ReportStats::Example::Action::ChallengeActionAuthorization::type_] + end + end + + type result_authentication3_ds_action = + { + type: Lithic::Models::AuthRules::ReportStats::Example::Action::ResultAuthentication3DSAction::type_ + } + + class ResultAuthentication3DSAction < Lithic::Internal::Type::BaseModel + attr_accessor type: Lithic::Models::AuthRules::ReportStats::Example::Action::ResultAuthentication3DSAction::type_ + + def initialize: ( + type: Lithic::Models::AuthRules::ReportStats::Example::Action::ResultAuthentication3DSAction::type_ + ) -> void + + def to_hash: -> { + type: Lithic::Models::AuthRules::ReportStats::Example::Action::ResultAuthentication3DSAction::type_ + } + + type type_ = :DECLINE | :CHALLENGE + + module Type + extend Lithic::Internal::Type::Enum + + DECLINE: :DECLINE + CHALLENGE: :CHALLENGE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ReportStats::Example::Action::ResultAuthentication3DSAction::type_] + end + end + + type decline_action_tokenization = + { + type: Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::type_, + reason: Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::reason + } + + class DeclineActionTokenization < Lithic::Internal::Type::BaseModel + attr_accessor type: Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::type_ + + attr_reader reason: Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::reason? + + def reason=: ( + Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::reason + ) -> Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::reason + + def initialize: ( + type: Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::type_, + ?reason: Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::reason + ) -> void + + def to_hash: -> { + type: Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::type_, + reason: Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::reason + } + + type type_ = :DECLINE + + module Type + extend Lithic::Internal::Type::Enum + + DECLINE: :DECLINE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::type_] + end + + type reason = + :ACCOUNT_SCORE_1 + | :DEVICE_SCORE_1 + | :ALL_WALLET_DECLINE_REASONS_PRESENT + | :WALLET_RECOMMENDED_DECISION_RED + | :CVC_MISMATCH + | :CARD_EXPIRY_MONTH_MISMATCH + | :CARD_EXPIRY_YEAR_MISMATCH + | :CARD_INVALID_STATE + | :CUSTOMER_RED_PATH + | :INVALID_CUSTOMER_RESPONSE + | :NETWORK_FAILURE + | :GENERIC_DECLINE + | :DIGITAL_CARD_ART_REQUIRED + + module Reason + extend Lithic::Internal::Type::Enum + + ACCOUNT_SCORE_1: :ACCOUNT_SCORE_1 + DEVICE_SCORE_1: :DEVICE_SCORE_1 + ALL_WALLET_DECLINE_REASONS_PRESENT: :ALL_WALLET_DECLINE_REASONS_PRESENT + WALLET_RECOMMENDED_DECISION_RED: :WALLET_RECOMMENDED_DECISION_RED + CVC_MISMATCH: :CVC_MISMATCH + CARD_EXPIRY_MONTH_MISMATCH: :CARD_EXPIRY_MONTH_MISMATCH + CARD_EXPIRY_YEAR_MISMATCH: :CARD_EXPIRY_YEAR_MISMATCH + CARD_INVALID_STATE: :CARD_INVALID_STATE + CUSTOMER_RED_PATH: :CUSTOMER_RED_PATH + INVALID_CUSTOMER_RESPONSE: :INVALID_CUSTOMER_RESPONSE + NETWORK_FAILURE: :NETWORK_FAILURE + GENERIC_DECLINE: :GENERIC_DECLINE + DIGITAL_CARD_ART_REQUIRED: :DIGITAL_CARD_ART_REQUIRED + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ReportStats::Example::Action::DeclineActionTokenization::reason] + end + end + + type require_tfa_action = + { + type: Lithic::Models::AuthRules::ReportStats::Example::Action::RequireTfaAction::type_, + reason: Lithic::Models::AuthRules::ReportStats::Example::Action::RequireTfaAction::reason + } + + class RequireTfaAction < Lithic::Internal::Type::BaseModel + attr_accessor type: Lithic::Models::AuthRules::ReportStats::Example::Action::RequireTfaAction::type_ + + attr_reader reason: Lithic::Models::AuthRules::ReportStats::Example::Action::RequireTfaAction::reason? + + def reason=: ( + Lithic::Models::AuthRules::ReportStats::Example::Action::RequireTfaAction::reason + ) -> Lithic::Models::AuthRules::ReportStats::Example::Action::RequireTfaAction::reason + + def initialize: ( + type: Lithic::Models::AuthRules::ReportStats::Example::Action::RequireTfaAction::type_, + ?reason: Lithic::Models::AuthRules::ReportStats::Example::Action::RequireTfaAction::reason + ) -> void + + def to_hash: -> { + type: Lithic::Models::AuthRules::ReportStats::Example::Action::RequireTfaAction::type_, + reason: Lithic::Models::AuthRules::ReportStats::Example::Action::RequireTfaAction::reason + } + + type type_ = :REQUIRE_TFA + + module Type + extend Lithic::Internal::Type::Enum + + REQUIRE_TFA: :REQUIRE_TFA + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ReportStats::Example::Action::RequireTfaAction::type_] + end + + type reason = + :WALLET_RECOMMENDED_TFA + | :SUSPICIOUS_ACTIVITY + | :DEVICE_RECENTLY_LOST + | :TOO_MANY_RECENT_ATTEMPTS + | :TOO_MANY_RECENT_TOKENS + | :TOO_MANY_DIFFERENT_CARDHOLDERS + | :OUTSIDE_HOME_TERRITORY + | :HAS_SUSPENDED_TOKENS + | :HIGH_RISK + | :ACCOUNT_SCORE_LOW + | :DEVICE_SCORE_LOW + | :CARD_STATE_TFA + | :HARDCODED_TFA + | :CUSTOMER_RULE_TFA + | :DEVICE_HOST_CARD_EMULATION + + module Reason + extend Lithic::Internal::Type::Enum + + WALLET_RECOMMENDED_TFA: :WALLET_RECOMMENDED_TFA + SUSPICIOUS_ACTIVITY: :SUSPICIOUS_ACTIVITY + DEVICE_RECENTLY_LOST: :DEVICE_RECENTLY_LOST + TOO_MANY_RECENT_ATTEMPTS: :TOO_MANY_RECENT_ATTEMPTS + TOO_MANY_RECENT_TOKENS: :TOO_MANY_RECENT_TOKENS + TOO_MANY_DIFFERENT_CARDHOLDERS: :TOO_MANY_DIFFERENT_CARDHOLDERS + OUTSIDE_HOME_TERRITORY: :OUTSIDE_HOME_TERRITORY + HAS_SUSPENDED_TOKENS: :HAS_SUSPENDED_TOKENS + HIGH_RISK: :HIGH_RISK + ACCOUNT_SCORE_LOW: :ACCOUNT_SCORE_LOW + DEVICE_SCORE_LOW: :DEVICE_SCORE_LOW + CARD_STATE_TFA: :CARD_STATE_TFA + HARDCODED_TFA: :HARDCODED_TFA + CUSTOMER_RULE_TFA: :CUSTOMER_RULE_TFA + DEVICE_HOST_CARD_EMULATION: :DEVICE_HOST_CARD_EMULATION + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ReportStats::Example::Action::RequireTfaAction::reason] + end + end + + type approve_action_ach = + { + type: Lithic::Models::AuthRules::ReportStats::Example::Action::ApproveActionACH::type_ + } + + class ApproveActionACH < Lithic::Internal::Type::BaseModel + attr_accessor type: Lithic::Models::AuthRules::ReportStats::Example::Action::ApproveActionACH::type_ + + def initialize: ( + type: Lithic::Models::AuthRules::ReportStats::Example::Action::ApproveActionACH::type_ + ) -> void + + def to_hash: -> { + type: Lithic::Models::AuthRules::ReportStats::Example::Action::ApproveActionACH::type_ + } + + type type_ = :APPROVE + + module Type + extend Lithic::Internal::Type::Enum + + APPROVE: :APPROVE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ReportStats::Example::Action::ApproveActionACH::type_] + end + end + + type return_action = + { + code: Lithic::Models::AuthRules::ReportStats::Example::Action::ReturnAction::code, + type: Lithic::Models::AuthRules::ReportStats::Example::Action::ReturnAction::type_ + } + + class ReturnAction < Lithic::Internal::Type::BaseModel + attr_accessor code: Lithic::Models::AuthRules::ReportStats::Example::Action::ReturnAction::code + + attr_accessor type: Lithic::Models::AuthRules::ReportStats::Example::Action::ReturnAction::type_ + + def initialize: ( + code: Lithic::Models::AuthRules::ReportStats::Example::Action::ReturnAction::code, + type: Lithic::Models::AuthRules::ReportStats::Example::Action::ReturnAction::type_ + ) -> void + + def to_hash: -> { + code: Lithic::Models::AuthRules::ReportStats::Example::Action::ReturnAction::code, + type: Lithic::Models::AuthRules::ReportStats::Example::Action::ReturnAction::type_ + } + + type code = + :R01 + | :R02 + | :R03 + | :R04 + | :R05 + | :R06 + | :R07 + | :R08 + | :R09 + | :R10 + | :R11 + | :R12 + | :R13 + | :R14 + | :R15 + | :R16 + | :R17 + | :R18 + | :R19 + | :R20 + | :R21 + | :R22 + | :R23 + | :R24 + | :R25 + | :R26 + | :R27 + | :R28 + | :R29 + | :R30 + | :R31 + | :R32 + | :R33 + | :R34 + | :R35 + | :R36 + | :R37 + | :R38 + | :R39 + | :R40 + | :R41 + | :R42 + | :R43 + | :R44 + | :R45 + | :R46 + | :R47 + | :R50 + | :R51 + | :R52 + | :R53 + | :R61 + | :R62 + | :R67 + | :R68 + | :R69 + | :R70 + | :R71 + | :R72 + | :R73 + | :R74 + | :R75 + | :R76 + | :R77 + | :R80 + | :R81 + | :R82 + | :R83 + | :R84 + | :R85 + + module Code + extend Lithic::Internal::Type::Enum + + R01: :R01 + R02: :R02 + R03: :R03 + R04: :R04 + R05: :R05 + R06: :R06 + R07: :R07 + R08: :R08 + R09: :R09 + R10: :R10 + R11: :R11 + R12: :R12 + R13: :R13 + R14: :R14 + R15: :R15 + R16: :R16 + R17: :R17 + R18: :R18 + R19: :R19 + R20: :R20 + R21: :R21 + R22: :R22 + R23: :R23 + R24: :R24 + R25: :R25 + R26: :R26 + R27: :R27 + R28: :R28 + R29: :R29 + R30: :R30 + R31: :R31 + R32: :R32 + R33: :R33 + R34: :R34 + R35: :R35 + R36: :R36 + R37: :R37 + R38: :R38 + R39: :R39 + R40: :R40 + R41: :R41 + R42: :R42 + R43: :R43 + R44: :R44 + R45: :R45 + R46: :R46 + R47: :R47 + R50: :R50 + R51: :R51 + R52: :R52 + R53: :R53 + R61: :R61 + R62: :R62 + R67: :R67 + R68: :R68 + R69: :R69 + R70: :R70 + R71: :R71 + R72: :R72 + R73: :R73 + R74: :R74 + R75: :R75 + R76: :R76 + R77: :R77 + R80: :R80 + R81: :R81 + R82: :R82 + R83: :R83 + R84: :R84 + R85: :R85 + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ReportStats::Example::Action::ReturnAction::code] + end + + type type_ = :RETURN + + module Type + extend Lithic::Internal::Type::Enum + + RETURN: :RETURN + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ReportStats::Example::Action::ReturnAction::type_] + end + end + + def self?.variants: -> ::Array[Lithic::Models::AuthRules::ReportStats::Example::action] + end + end + + type state = :ACTIVE | :SHADOW | :INACTIVE + + module State + extend Lithic::Internal::Type::Enum + + ACTIVE: :ACTIVE + SHADOW: :SHADOW + INACTIVE: :INACTIVE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::ReportStats::state] + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/rule_feature.rbs b/sig/lithic/models/auth_rules/rule_feature.rbs new file mode 100644 index 00000000..84337048 --- /dev/null +++ b/sig/lithic/models/auth_rules/rule_feature.rbs @@ -0,0 +1,231 @@ +module Lithic + module Models + module AuthRules + type rule_feature = + Lithic::AuthRules::RuleFeature::AuthorizationFeature + | Lithic::AuthRules::RuleFeature::AuthenticationFeature + | Lithic::AuthRules::RuleFeature::TokenizationFeature + | Lithic::AuthRules::RuleFeature::ACHReceiptFeature + | Lithic::AuthRules::RuleFeature::CardTransactionFeature + | Lithic::AuthRules::RuleFeature::CardFeature + | Lithic::AuthRules::RuleFeature::AccountHolderFeature + | Lithic::AuthRules::RuleFeature::IPMetadataFeature + | Lithic::AuthRules::RuleFeature::SpendVelocityFeature + | Lithic::AuthRules::RuleFeature::TransactionHistorySignalsFeature + + module RuleFeature + extend Lithic::Internal::Type::Union + + type authorization_feature = { type: :AUTHORIZATION, name: String } + + class AuthorizationFeature < Lithic::Internal::Type::BaseModel + attr_accessor type: :AUTHORIZATION + + attr_reader name: String? + + def name=: (String) -> String + + def initialize: (?name: String, ?type: :AUTHORIZATION) -> void + + def to_hash: -> { type: :AUTHORIZATION, name: String } + end + + type authentication_feature = { type: :AUTHENTICATION, name: String } + + class AuthenticationFeature < Lithic::Internal::Type::BaseModel + attr_accessor type: :AUTHENTICATION + + attr_reader name: String? + + def name=: (String) -> String + + def initialize: (?name: String, ?type: :AUTHENTICATION) -> void + + def to_hash: -> { type: :AUTHENTICATION, name: String } + end + + type tokenization_feature = { type: :TOKENIZATION, name: String } + + class TokenizationFeature < Lithic::Internal::Type::BaseModel + attr_accessor type: :TOKENIZATION + + attr_reader name: String? + + def name=: (String) -> String + + def initialize: (?name: String, ?type: :TOKENIZATION) -> void + + def to_hash: -> { type: :TOKENIZATION, name: String } + end + + type ach_receipt_feature = { type: :ACH_RECEIPT, name: String } + + class ACHReceiptFeature < Lithic::Internal::Type::BaseModel + attr_accessor type: :ACH_RECEIPT + + attr_reader name: String? + + def name=: (String) -> String + + def initialize: (?name: String, ?type: :ACH_RECEIPT) -> void + + def to_hash: -> { type: :ACH_RECEIPT, name: String } + end + + type card_transaction_feature = + { type: :CARD_TRANSACTION, name: String } + + class CardTransactionFeature < Lithic::Internal::Type::BaseModel + attr_accessor type: :CARD_TRANSACTION + + attr_reader name: String? + + def name=: (String) -> String + + def initialize: (?name: String, ?type: :CARD_TRANSACTION) -> void + + def to_hash: -> { type: :CARD_TRANSACTION, name: String } + end + + type card_feature = { type: :CARD, name: String } + + class CardFeature < Lithic::Internal::Type::BaseModel + attr_accessor type: :CARD + + attr_reader name: String? + + def name=: (String) -> String + + def initialize: (?name: String, ?type: :CARD) -> void + + def to_hash: -> { type: :CARD, name: String } + end + + type account_holder_feature = { type: :ACCOUNT_HOLDER, name: String } + + class AccountHolderFeature < Lithic::Internal::Type::BaseModel + attr_accessor type: :ACCOUNT_HOLDER + + attr_reader name: String? + + def name=: (String) -> String + + def initialize: (?name: String, ?type: :ACCOUNT_HOLDER) -> void + + def to_hash: -> { type: :ACCOUNT_HOLDER, name: String } + end + + type ip_metadata_feature = { type: :IP_METADATA, name: String } + + class IPMetadataFeature < Lithic::Internal::Type::BaseModel + attr_accessor type: :IP_METADATA + + attr_reader name: String? + + def name=: (String) -> String + + def initialize: (?name: String, ?type: :IP_METADATA) -> void + + def to_hash: -> { type: :IP_METADATA, name: String } + end + + type spend_velocity_feature = + { + period: Lithic::Models::AuthRules::velocity_limit_period, + scope: Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature::scope, + type: :SPEND_VELOCITY, + filters: Lithic::AuthRules::VelocityLimitFilters, + name: String + } + + class SpendVelocityFeature < Lithic::Internal::Type::BaseModel + attr_accessor period: Lithic::Models::AuthRules::velocity_limit_period + + attr_accessor scope: Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature::scope + + attr_accessor type: :SPEND_VELOCITY + + attr_reader filters: Lithic::AuthRules::VelocityLimitFilters? + + def filters=: ( + Lithic::AuthRules::VelocityLimitFilters + ) -> Lithic::AuthRules::VelocityLimitFilters + + attr_reader name: String? + + def name=: (String) -> String + + def initialize: ( + period: Lithic::Models::AuthRules::velocity_limit_period, + scope: Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature::scope, + ?filters: Lithic::AuthRules::VelocityLimitFilters, + ?name: String, + ?type: :SPEND_VELOCITY + ) -> void + + def to_hash: -> { + period: Lithic::Models::AuthRules::velocity_limit_period, + scope: Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature::scope, + type: :SPEND_VELOCITY, + filters: Lithic::AuthRules::VelocityLimitFilters, + name: String + } + + type scope = :CARD | :ACCOUNT + + module Scope + extend Lithic::Internal::Type::Enum + + CARD: :CARD + ACCOUNT: :ACCOUNT + + def self?.values: -> ::Array[Lithic::Models::AuthRules::RuleFeature::SpendVelocityFeature::scope] + end + end + + type transaction_history_signals_feature = + { + scope: Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature::scope, + type: :TRANSACTION_HISTORY_SIGNALS, + name: String + } + + class TransactionHistorySignalsFeature < Lithic::Internal::Type::BaseModel + attr_accessor scope: Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature::scope + + attr_accessor type: :TRANSACTION_HISTORY_SIGNALS + + attr_reader name: String? + + def name=: (String) -> String + + def initialize: ( + scope: Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature::scope, + ?name: String, + ?type: :TRANSACTION_HISTORY_SIGNALS + ) -> void + + def to_hash: -> { + scope: Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature::scope, + type: :TRANSACTION_HISTORY_SIGNALS, + name: String + } + + type scope = :CARD | :ACCOUNT | :BUSINESS_ACCOUNT + + module Scope + extend Lithic::Internal::Type::Enum + + CARD: :CARD + ACCOUNT: :ACCOUNT + BUSINESS_ACCOUNT: :BUSINESS_ACCOUNT + + def self?.values: -> ::Array[Lithic::Models::AuthRules::RuleFeature::TransactionHistorySignalsFeature::scope] + end + end + + def self?.variants: -> ::Array[Lithic::Models::AuthRules::rule_feature] + end + end + end +end diff --git a/sig/lithic/models/auth_rules/spend_velocity_filters.rbs b/sig/lithic/models/auth_rules/spend_velocity_filters.rbs new file mode 100644 index 00000000..195aa6b2 --- /dev/null +++ b/sig/lithic/models/auth_rules/spend_velocity_filters.rbs @@ -0,0 +1,35 @@ +module Lithic + module Models + module AuthRules + type spend_velocity_filters = + { + exclude_tags: ::Hash[Symbol, String]?, + include_tags: ::Hash[Symbol, String]? + } + + class SpendVelocityFilters < Lithic::Models::AuthRules::VelocityLimitFilters + def exclude_tags: -> ::Hash[Symbol, String]? + + def exclude_tags=: ( + ::Hash[Symbol, String]? _ + ) -> ::Hash[Symbol, String]? + + def include_tags: -> ::Hash[Symbol, String]? + + def include_tags=: ( + ::Hash[Symbol, String]? _ + ) -> ::Hash[Symbol, String]? + + def initialize: ( + ?exclude_tags: ::Hash[Symbol, String]?, + ?include_tags: ::Hash[Symbol, String]? + ) -> void + + def to_hash: -> { + exclude_tags: ::Hash[Symbol, String]?, + include_tags: ::Hash[Symbol, String]? + } + end + end + end +end diff --git a/sig/lithic/models/auth_rules/typescript_code_parameters.rbs b/sig/lithic/models/auth_rules/typescript_code_parameters.rbs new file mode 100644 index 00000000..15e19926 --- /dev/null +++ b/sig/lithic/models/auth_rules/typescript_code_parameters.rbs @@ -0,0 +1,27 @@ +module Lithic + module Models + module AuthRules + type typescript_code_parameters = + { + code: String, + features: ::Array[Lithic::Models::AuthRules::rule_feature] + } + + class TypescriptCodeParameters < Lithic::Internal::Type::BaseModel + attr_accessor code: String + + attr_accessor features: ::Array[Lithic::Models::AuthRules::rule_feature] + + def initialize: ( + code: String, + features: ::Array[Lithic::Models::AuthRules::rule_feature] + ) -> void + + def to_hash: -> { + code: String, + features: ::Array[Lithic::Models::AuthRules::rule_feature] + } + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2/backtest_create_params.rbs b/sig/lithic/models/auth_rules/v2/backtest_create_params.rbs new file mode 100644 index 00000000..e641d5b1 --- /dev/null +++ b/sig/lithic/models/auth_rules/v2/backtest_create_params.rbs @@ -0,0 +1,40 @@ +module Lithic + module Models + module AuthRules + module V2 + type backtest_create_params = + { auth_rule_token: String, end_: Time, start: Time } + & Lithic::Internal::Type::request_parameters + + class BacktestCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor auth_rule_token: String + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader start: Time? + + def start=: (Time) -> Time + + def initialize: ( + auth_rule_token: String, + ?end_: Time, + ?start: Time, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + auth_rule_token: String, + end_: Time, + start: Time, + request_options: Lithic::RequestOptions + } + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2/backtest_create_response.rbs b/sig/lithic/models/auth_rules/v2/backtest_create_response.rbs new file mode 100644 index 00000000..cfca516c --- /dev/null +++ b/sig/lithic/models/auth_rules/v2/backtest_create_response.rbs @@ -0,0 +1,19 @@ +module Lithic + module Models + module AuthRules + module V2 + type backtest_create_response = { backtest_token: String } + + class BacktestCreateResponse < Lithic::Internal::Type::BaseModel + attr_reader backtest_token: String? + + def backtest_token=: (String) -> String + + def initialize: (?backtest_token: String) -> void + + def to_hash: -> { backtest_token: String } + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2/backtest_results.rbs b/sig/lithic/models/auth_rules/v2/backtest_results.rbs new file mode 100644 index 00000000..ac44fcaf --- /dev/null +++ b/sig/lithic/models/auth_rules/v2/backtest_results.rbs @@ -0,0 +1,68 @@ +module Lithic + module Models + module AuthRules + module V2 + type backtest_results = + { + backtest_token: String, + results: Lithic::AuthRules::V2::BacktestResults::Results, + simulation_parameters: Lithic::AuthRules::V2::BacktestResults::SimulationParameters + } + + class BacktestResults < Lithic::Internal::Type::BaseModel + attr_accessor backtest_token: String + + attr_accessor results: Lithic::AuthRules::V2::BacktestResults::Results + + attr_accessor simulation_parameters: Lithic::AuthRules::V2::BacktestResults::SimulationParameters + + def initialize: ( + backtest_token: String, + results: Lithic::AuthRules::V2::BacktestResults::Results, + simulation_parameters: Lithic::AuthRules::V2::BacktestResults::SimulationParameters + ) -> void + + def to_hash: -> { + backtest_token: String, + results: Lithic::AuthRules::V2::BacktestResults::Results, + simulation_parameters: Lithic::AuthRules::V2::BacktestResults::SimulationParameters + } + + type results = + { + current_version: Lithic::AuthRules::BacktestStats?, + draft_version: Lithic::AuthRules::BacktestStats? + } + + class Results < Lithic::Internal::Type::BaseModel + attr_accessor current_version: Lithic::AuthRules::BacktestStats? + + attr_accessor draft_version: Lithic::AuthRules::BacktestStats? + + def initialize: ( + ?current_version: Lithic::AuthRules::BacktestStats?, + ?draft_version: Lithic::AuthRules::BacktestStats? + ) -> void + + def to_hash: -> { + current_version: Lithic::AuthRules::BacktestStats?, + draft_version: Lithic::AuthRules::BacktestStats? + } + end + + type simulation_parameters = { end_: Time, start: Time } + + class SimulationParameters < Lithic::Internal::Type::BaseModel + attr_accessor end_: Time + + attr_accessor start: Time + + def initialize: (end_: Time, start: Time) -> void + + def to_hash: -> { end_: Time, start: Time } + end + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2/backtest_retrieve_params.rbs b/sig/lithic/models/auth_rules/v2/backtest_retrieve_params.rbs new file mode 100644 index 00000000..d6f417fe --- /dev/null +++ b/sig/lithic/models/auth_rules/v2/backtest_retrieve_params.rbs @@ -0,0 +1,32 @@ +module Lithic + module Models + module AuthRules + module V2 + type backtest_retrieve_params = + { auth_rule_token: String, auth_rule_backtest_token: String } + & Lithic::Internal::Type::request_parameters + + class BacktestRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor auth_rule_token: String + + attr_accessor auth_rule_backtest_token: String + + def initialize: ( + auth_rule_token: String, + auth_rule_backtest_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + auth_rule_token: String, + auth_rule_backtest_token: String, + request_options: Lithic::RequestOptions + } + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_create_params.rbs b/sig/lithic/models/auth_rules/v2_create_params.rbs new file mode 100644 index 00000000..1a8c1ee4 --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_create_params.rbs @@ -0,0 +1,303 @@ +module Lithic + module Models + module AuthRules + type v2_create_params = + { body: Lithic::Models::AuthRules::V2CreateParams::body } + & Lithic::Internal::Type::request_parameters + + class V2CreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor body: Lithic::Models::AuthRules::V2CreateParams::body + + def initialize: ( + body: Lithic::Models::AuthRules::V2CreateParams::body, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + body: Lithic::Models::AuthRules::V2CreateParams::body, + request_options: Lithic::RequestOptions + } + + type body = + Lithic::AuthRules::V2CreateParams::Body::AccountLevelRule + | Lithic::AuthRules::V2CreateParams::Body::CardLevelRule + | Lithic::AuthRules::V2CreateParams::Body::ProgramLevelRule + + module Body + extend Lithic::Internal::Type::Union + + type account_level_rule = + { + parameters: Lithic::Models::AuthRules::V2CreateParams::Body::AccountLevelRule::parameters, + type: Lithic::Models::AuthRules::V2CreateParams::Body::AccountLevelRule::type_, + account_tokens: ::Array[String], + business_account_tokens: ::Array[String], + event_stream: Lithic::Models::AuthRules::event_stream, + name: String? + } + + class AccountLevelRule < Lithic::Internal::Type::BaseModel + attr_accessor parameters: Lithic::Models::AuthRules::V2CreateParams::Body::AccountLevelRule::parameters + + attr_accessor type: Lithic::Models::AuthRules::V2CreateParams::Body::AccountLevelRule::type_ + + attr_reader account_tokens: ::Array[String]? + + def account_tokens=: (::Array[String]) -> ::Array[String] + + attr_reader business_account_tokens: ::Array[String]? + + def business_account_tokens=: (::Array[String]) -> ::Array[String] + + attr_reader event_stream: Lithic::Models::AuthRules::event_stream? + + def event_stream=: ( + Lithic::Models::AuthRules::event_stream + ) -> Lithic::Models::AuthRules::event_stream + + attr_accessor name: String? + + def initialize: ( + parameters: Lithic::Models::AuthRules::V2CreateParams::Body::AccountLevelRule::parameters, + type: Lithic::Models::AuthRules::V2CreateParams::Body::AccountLevelRule::type_, + ?account_tokens: ::Array[String], + ?business_account_tokens: ::Array[String], + ?event_stream: Lithic::Models::AuthRules::event_stream, + ?name: String? + ) -> void + + def to_hash: -> { + parameters: Lithic::Models::AuthRules::V2CreateParams::Body::AccountLevelRule::parameters, + type: Lithic::Models::AuthRules::V2CreateParams::Body::AccountLevelRule::type_, + account_tokens: ::Array[String], + business_account_tokens: ::Array[String], + event_stream: Lithic::Models::AuthRules::event_stream, + name: String? + } + + type parameters = + Lithic::AuthRules::ConditionalBlockParameters + | Lithic::AuthRules::VelocityLimitParams + | Lithic::AuthRules::MerchantLockParameters + | Lithic::AuthRules::Conditional3DSActionParameters + | Lithic::AuthRules::ConditionalAuthorizationActionParameters + | Lithic::AuthRules::ConditionalACHActionParameters + | Lithic::AuthRules::ConditionalTokenizationActionParameters + | Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters + | Lithic::AuthRules::TypescriptCodeParameters + | Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters + + module Parameters + extend Lithic::Internal::Type::Union + + def self?.variants: -> ::Array[Lithic::Models::AuthRules::V2CreateParams::Body::AccountLevelRule::parameters] + end + + type type_ = + :CONDITIONAL_BLOCK + | :VELOCITY_LIMIT + | :MERCHANT_LOCK + | :CONDITIONAL_ACTION + | :TYPESCRIPT_CODE + + module Type + extend Lithic::Internal::Type::Enum + + CONDITIONAL_BLOCK: :CONDITIONAL_BLOCK + VELOCITY_LIMIT: :VELOCITY_LIMIT + MERCHANT_LOCK: :MERCHANT_LOCK + CONDITIONAL_ACTION: :CONDITIONAL_ACTION + TYPESCRIPT_CODE: :TYPESCRIPT_CODE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2CreateParams::Body::AccountLevelRule::type_] + end + end + + type card_level_rule = + { + card_tokens: ::Array[String], + parameters: Lithic::Models::AuthRules::V2CreateParams::Body::CardLevelRule::parameters, + type: Lithic::Models::AuthRules::V2CreateParams::Body::CardLevelRule::type_, + event_stream: Lithic::Models::AuthRules::event_stream, + name: String? + } + + class CardLevelRule < Lithic::Internal::Type::BaseModel + attr_accessor card_tokens: ::Array[String] + + attr_accessor parameters: Lithic::Models::AuthRules::V2CreateParams::Body::CardLevelRule::parameters + + attr_accessor type: Lithic::Models::AuthRules::V2CreateParams::Body::CardLevelRule::type_ + + attr_reader event_stream: Lithic::Models::AuthRules::event_stream? + + def event_stream=: ( + Lithic::Models::AuthRules::event_stream + ) -> Lithic::Models::AuthRules::event_stream + + attr_accessor name: String? + + def initialize: ( + card_tokens: ::Array[String], + parameters: Lithic::Models::AuthRules::V2CreateParams::Body::CardLevelRule::parameters, + type: Lithic::Models::AuthRules::V2CreateParams::Body::CardLevelRule::type_, + ?event_stream: Lithic::Models::AuthRules::event_stream, + ?name: String? + ) -> void + + def to_hash: -> { + card_tokens: ::Array[String], + parameters: Lithic::Models::AuthRules::V2CreateParams::Body::CardLevelRule::parameters, + type: Lithic::Models::AuthRules::V2CreateParams::Body::CardLevelRule::type_, + event_stream: Lithic::Models::AuthRules::event_stream, + name: String? + } + + type parameters = + Lithic::AuthRules::ConditionalBlockParameters + | Lithic::AuthRules::VelocityLimitParams + | Lithic::AuthRules::MerchantLockParameters + | Lithic::AuthRules::Conditional3DSActionParameters + | Lithic::AuthRules::ConditionalAuthorizationActionParameters + | Lithic::AuthRules::ConditionalACHActionParameters + | Lithic::AuthRules::ConditionalTokenizationActionParameters + | Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters + | Lithic::AuthRules::TypescriptCodeParameters + | Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters + + module Parameters + extend Lithic::Internal::Type::Union + + def self?.variants: -> ::Array[Lithic::Models::AuthRules::V2CreateParams::Body::CardLevelRule::parameters] + end + + type type_ = + :CONDITIONAL_BLOCK + | :VELOCITY_LIMIT + | :MERCHANT_LOCK + | :CONDITIONAL_ACTION + | :TYPESCRIPT_CODE + + module Type + extend Lithic::Internal::Type::Enum + + CONDITIONAL_BLOCK: :CONDITIONAL_BLOCK + VELOCITY_LIMIT: :VELOCITY_LIMIT + MERCHANT_LOCK: :MERCHANT_LOCK + CONDITIONAL_ACTION: :CONDITIONAL_ACTION + TYPESCRIPT_CODE: :TYPESCRIPT_CODE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2CreateParams::Body::CardLevelRule::type_] + end + end + + type program_level_rule = + { + parameters: Lithic::Models::AuthRules::V2CreateParams::Body::ProgramLevelRule::parameters, + program_level: bool, + type: Lithic::Models::AuthRules::V2CreateParams::Body::ProgramLevelRule::type_, + event_stream: Lithic::Models::AuthRules::event_stream, + excluded_account_tokens: ::Array[String], + excluded_business_account_tokens: ::Array[String], + excluded_card_tokens: ::Array[String], + name: String? + } + + class ProgramLevelRule < Lithic::Internal::Type::BaseModel + attr_accessor parameters: Lithic::Models::AuthRules::V2CreateParams::Body::ProgramLevelRule::parameters + + attr_accessor program_level: bool + + attr_accessor type: Lithic::Models::AuthRules::V2CreateParams::Body::ProgramLevelRule::type_ + + attr_reader event_stream: Lithic::Models::AuthRules::event_stream? + + def event_stream=: ( + Lithic::Models::AuthRules::event_stream + ) -> Lithic::Models::AuthRules::event_stream + + attr_reader excluded_account_tokens: ::Array[String]? + + def excluded_account_tokens=: (::Array[String]) -> ::Array[String] + + attr_reader excluded_business_account_tokens: ::Array[String]? + + def excluded_business_account_tokens=: ( + ::Array[String] + ) -> ::Array[String] + + attr_reader excluded_card_tokens: ::Array[String]? + + def excluded_card_tokens=: (::Array[String]) -> ::Array[String] + + attr_accessor name: String? + + def initialize: ( + parameters: Lithic::Models::AuthRules::V2CreateParams::Body::ProgramLevelRule::parameters, + program_level: bool, + type: Lithic::Models::AuthRules::V2CreateParams::Body::ProgramLevelRule::type_, + ?event_stream: Lithic::Models::AuthRules::event_stream, + ?excluded_account_tokens: ::Array[String], + ?excluded_business_account_tokens: ::Array[String], + ?excluded_card_tokens: ::Array[String], + ?name: String? + ) -> void + + def to_hash: -> { + parameters: Lithic::Models::AuthRules::V2CreateParams::Body::ProgramLevelRule::parameters, + program_level: bool, + type: Lithic::Models::AuthRules::V2CreateParams::Body::ProgramLevelRule::type_, + event_stream: Lithic::Models::AuthRules::event_stream, + excluded_account_tokens: ::Array[String], + excluded_business_account_tokens: ::Array[String], + excluded_card_tokens: ::Array[String], + name: String? + } + + type parameters = + Lithic::AuthRules::ConditionalBlockParameters + | Lithic::AuthRules::VelocityLimitParams + | Lithic::AuthRules::MerchantLockParameters + | Lithic::AuthRules::Conditional3DSActionParameters + | Lithic::AuthRules::ConditionalAuthorizationActionParameters + | Lithic::AuthRules::ConditionalACHActionParameters + | Lithic::AuthRules::ConditionalTokenizationActionParameters + | Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters + | Lithic::AuthRules::TypescriptCodeParameters + | Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters + + module Parameters + extend Lithic::Internal::Type::Union + + def self?.variants: -> ::Array[Lithic::Models::AuthRules::V2CreateParams::Body::ProgramLevelRule::parameters] + end + + type type_ = + :CONDITIONAL_BLOCK + | :VELOCITY_LIMIT + | :MERCHANT_LOCK + | :CONDITIONAL_ACTION + | :TYPESCRIPT_CODE + + module Type + extend Lithic::Internal::Type::Enum + + CONDITIONAL_BLOCK: :CONDITIONAL_BLOCK + VELOCITY_LIMIT: :VELOCITY_LIMIT + MERCHANT_LOCK: :MERCHANT_LOCK + CONDITIONAL_ACTION: :CONDITIONAL_ACTION + TYPESCRIPT_CODE: :TYPESCRIPT_CODE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2CreateParams::Body::ProgramLevelRule::type_] + end + end + + def self?.variants: -> ::Array[Lithic::Models::AuthRules::V2CreateParams::body] + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_delete_params.rbs b/sig/lithic/models/auth_rules/v2_delete_params.rbs new file mode 100644 index 00000000..4cb925c1 --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_delete_params.rbs @@ -0,0 +1,25 @@ +module Lithic + module Models + module AuthRules + type v2_delete_params = + { auth_rule_token: String } & Lithic::Internal::Type::request_parameters + + class V2DeleteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor auth_rule_token: String + + def initialize: ( + auth_rule_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + auth_rule_token: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_draft_params.rbs b/sig/lithic/models/auth_rules/v2_draft_params.rbs new file mode 100644 index 00000000..4398a1bf --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_draft_params.rbs @@ -0,0 +1,51 @@ +module Lithic + module Models + module AuthRules + type v2_draft_params = + { + auth_rule_token: String, + parameters: Lithic::Models::AuthRules::V2DraftParams::parameters? + } + & Lithic::Internal::Type::request_parameters + + class V2DraftParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor auth_rule_token: String + + attr_accessor parameters: Lithic::Models::AuthRules::V2DraftParams::parameters? + + def initialize: ( + auth_rule_token: String, + ?parameters: Lithic::Models::AuthRules::V2DraftParams::parameters?, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + auth_rule_token: String, + parameters: Lithic::Models::AuthRules::V2DraftParams::parameters?, + request_options: Lithic::RequestOptions + } + + type parameters = + Lithic::AuthRules::ConditionalBlockParameters + | Lithic::AuthRules::VelocityLimitParams + | Lithic::AuthRules::MerchantLockParameters + | Lithic::AuthRules::Conditional3DSActionParameters + | Lithic::AuthRules::ConditionalAuthorizationActionParameters + | Lithic::AuthRules::ConditionalACHActionParameters + | Lithic::AuthRules::ConditionalTokenizationActionParameters + | Lithic::AuthRules::ConditionalCardTransactionUpdateActionParameters + | Lithic::AuthRules::TypescriptCodeParameters + | Lithic::AuthRules::ConditionalAuthorizationAdjustmentParameters + + module Parameters + extend Lithic::Internal::Type::Union + + def self?.variants: -> ::Array[Lithic::Models::AuthRules::V2DraftParams::parameters] + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_list_params.rbs b/sig/lithic/models/auth_rules/v2_list_params.rbs new file mode 100644 index 00000000..26f5d807 --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_list_params.rbs @@ -0,0 +1,106 @@ +module Lithic + module Models + module AuthRules + type v2_list_params = + { + account_token: String, + business_account_token: String, + card_token: String, + ending_before: String, + event_stream: Lithic::Models::AuthRules::event_stream, + event_streams: ::Array[Lithic::Models::AuthRules::event_stream], + page_size: Integer, + scope: Lithic::Models::AuthRules::V2ListParams::scope, + starting_after: String + } + & Lithic::Internal::Type::request_parameters + + class V2ListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader business_account_token: String? + + def business_account_token=: (String) -> String + + attr_reader card_token: String? + + def card_token=: (String) -> String + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader event_stream: Lithic::Models::AuthRules::event_stream? + + def event_stream=: ( + Lithic::Models::AuthRules::event_stream + ) -> Lithic::Models::AuthRules::event_stream + + attr_reader event_streams: ::Array[Lithic::Models::AuthRules::event_stream]? + + def event_streams=: ( + ::Array[Lithic::Models::AuthRules::event_stream] + ) -> ::Array[Lithic::Models::AuthRules::event_stream] + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader scope: Lithic::Models::AuthRules::V2ListParams::scope? + + def scope=: ( + Lithic::Models::AuthRules::V2ListParams::scope + ) -> Lithic::Models::AuthRules::V2ListParams::scope + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + ?account_token: String, + ?business_account_token: String, + ?card_token: String, + ?ending_before: String, + ?event_stream: Lithic::Models::AuthRules::event_stream, + ?event_streams: ::Array[Lithic::Models::AuthRules::event_stream], + ?page_size: Integer, + ?scope: Lithic::Models::AuthRules::V2ListParams::scope, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + account_token: String, + business_account_token: String, + card_token: String, + ending_before: String, + event_stream: Lithic::Models::AuthRules::event_stream, + event_streams: ::Array[Lithic::Models::AuthRules::event_stream], + page_size: Integer, + scope: Lithic::Models::AuthRules::V2ListParams::scope, + starting_after: String, + request_options: Lithic::RequestOptions + } + + type scope = :PROGRAM | :ACCOUNT | :BUSINESS_ACCOUNT | :CARD | :ANY + + module Scope + extend Lithic::Internal::Type::Enum + + PROGRAM: :PROGRAM + ACCOUNT: :ACCOUNT + BUSINESS_ACCOUNT: :BUSINESS_ACCOUNT + CARD: :CARD + ANY: :ANY + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2ListParams::scope] + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_list_results_params.rbs b/sig/lithic/models/auth_rules/v2_list_results_params.rbs new file mode 100644 index 00000000..b323743e --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_list_results_params.rbs @@ -0,0 +1,79 @@ +module Lithic + module Models + module AuthRules + type v2_list_results_params = + { + auth_rule_token: String, + begin_: Time, + end_: Time, + ending_before: String, + event_token: String, + has_actions: bool, + page_size: Integer, + starting_after: String + } + & Lithic::Internal::Type::request_parameters + + class V2ListResultsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader auth_rule_token: String? + + def auth_rule_token=: (String) -> String + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader event_token: String? + + def event_token=: (String) -> String + + attr_reader has_actions: bool? + + def has_actions=: (bool) -> bool + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + ?auth_rule_token: String, + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?event_token: String, + ?has_actions: bool, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + auth_rule_token: String, + begin_: Time, + end_: Time, + ending_before: String, + event_token: String, + has_actions: bool, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_list_results_response.rbs b/sig/lithic/models/auth_rules/v2_list_results_response.rbs new file mode 100644 index 00000000..7d3a0fd0 --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_list_results_response.rbs @@ -0,0 +1,943 @@ +module Lithic + module Models + module AuthRules + type v2_list_results_response = + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult + | Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult + | Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult + | Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult + + module V2ListResultsResponse + extend Lithic::Internal::Type::Union + + type authorization_result = + { + token: String, + actions: ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::action], + auth_rule_token: String, + evaluation_time: Time, + event_stream: :AUTHORIZATION, + event_token: String, + mode: Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::mode, + rule_version: Integer, + transaction_token: String? + } + + class AuthorizationResult < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor actions: ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::action] + + attr_accessor auth_rule_token: String + + attr_accessor evaluation_time: Time + + attr_accessor event_stream: :AUTHORIZATION + + attr_accessor event_token: String + + attr_accessor mode: Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::mode + + attr_accessor rule_version: Integer + + attr_accessor transaction_token: String? + + def initialize: ( + token: String, + actions: ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::action], + auth_rule_token: String, + evaluation_time: Time, + event_token: String, + mode: Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::mode, + rule_version: Integer, + transaction_token: String?, + ?event_stream: :AUTHORIZATION + ) -> void + + def to_hash: -> { + token: String, + actions: ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::action], + auth_rule_token: String, + evaluation_time: Time, + event_stream: :AUTHORIZATION, + event_token: String, + mode: Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::mode, + rule_version: Integer, + transaction_token: String? + } + + type action = + Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization + | Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::ChallengeActionAuthorization + + module Action + extend Lithic::Internal::Type::Union + + type decline_action_authorization = + { + code: Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::code, + type: Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::type_, + explanation: String + } + + class DeclineActionAuthorization < Lithic::Internal::Type::BaseModel + attr_accessor code: Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::code + + attr_accessor type: Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::type_ + + attr_reader explanation: String? + + def explanation=: (String) -> String + + def initialize: ( + code: Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::code, + type: Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::type_, + ?explanation: String + ) -> void + + def to_hash: -> { + code: Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::code, + type: Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::type_, + explanation: String + } + + type code = + :ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED + | :ACCOUNT_DELINQUENT + | :ACCOUNT_INACTIVE + | :ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED + | :ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED + | :ACCOUNT_PAUSED + | :ACCOUNT_UNDER_REVIEW + | :ADDRESS_INCORRECT + | :APPROVED + | :AUTH_RULE_ALLOWED_COUNTRY + | :AUTH_RULE_ALLOWED_MCC + | :AUTH_RULE_BLOCKED_COUNTRY + | :AUTH_RULE_BLOCKED_MCC + | :AUTH_RULE + | :CARD_CLOSED + | :CARD_CRYPTOGRAM_VALIDATION_FAILURE + | :CARD_EXPIRED + | :CARD_EXPIRY_DATE_INCORRECT + | :CARD_INVALID + | :CARD_NOT_ACTIVATED + | :CARD_PAUSED + | :CARD_PIN_INCORRECT + | :CARD_RESTRICTED + | :CARD_SECURITY_CODE_INCORRECT + | :CARD_SPEND_LIMIT_EXCEEDED + | :CONTACT_CARD_ISSUER + | :CUSTOMER_ASA_TIMEOUT + | :CUSTOM_ASA_RESULT + | :DECLINED + | :DO_NOT_HONOR + | :DRIVER_NUMBER_INVALID + | :FORMAT_ERROR + | :INSUFFICIENT_FUNDING_SOURCE_BALANCE + | :INSUFFICIENT_FUNDS + | :LITHIC_SYSTEM_ERROR + | :LITHIC_SYSTEM_RATE_LIMIT + | :MALFORMED_ASA_RESPONSE + | :MERCHANT_INVALID + | :MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE + | :MERCHANT_NOT_PERMITTED + | :OVER_REVERSAL_ATTEMPTED + | :PIN_BLOCKED + | :PROGRAM_CARD_SPEND_LIMIT_EXCEEDED + | :PROGRAM_SUSPENDED + | :PROGRAM_USAGE_RESTRICTION + | :REVERSAL_UNMATCHED + | :SECURITY_VIOLATION + | :SINGLE_USE_CARD_REATTEMPTED + | :SUSPECTED_FRAUD + | :TRANSACTION_INVALID + | :TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL + | :TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER + | :TRANSACTION_PREVIOUSLY_COMPLETED + | :UNAUTHORIZED_MERCHANT + | :VEHICLE_NUMBER_INVALID + | :CARDHOLDER_CHALLENGED + | :CARDHOLDER_CHALLENGE_FAILED + + module Code + extend Lithic::Internal::Type::Enum + + ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED: :ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED + ACCOUNT_DELINQUENT: :ACCOUNT_DELINQUENT + ACCOUNT_INACTIVE: :ACCOUNT_INACTIVE + ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED: :ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED + ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED: :ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED + ACCOUNT_PAUSED: :ACCOUNT_PAUSED + ACCOUNT_UNDER_REVIEW: :ACCOUNT_UNDER_REVIEW + ADDRESS_INCORRECT: :ADDRESS_INCORRECT + APPROVED: :APPROVED + AUTH_RULE_ALLOWED_COUNTRY: :AUTH_RULE_ALLOWED_COUNTRY + AUTH_RULE_ALLOWED_MCC: :AUTH_RULE_ALLOWED_MCC + AUTH_RULE_BLOCKED_COUNTRY: :AUTH_RULE_BLOCKED_COUNTRY + AUTH_RULE_BLOCKED_MCC: :AUTH_RULE_BLOCKED_MCC + AUTH_RULE: :AUTH_RULE + CARD_CLOSED: :CARD_CLOSED + CARD_CRYPTOGRAM_VALIDATION_FAILURE: :CARD_CRYPTOGRAM_VALIDATION_FAILURE + CARD_EXPIRED: :CARD_EXPIRED + CARD_EXPIRY_DATE_INCORRECT: :CARD_EXPIRY_DATE_INCORRECT + CARD_INVALID: :CARD_INVALID + CARD_NOT_ACTIVATED: :CARD_NOT_ACTIVATED + CARD_PAUSED: :CARD_PAUSED + CARD_PIN_INCORRECT: :CARD_PIN_INCORRECT + CARD_RESTRICTED: :CARD_RESTRICTED + CARD_SECURITY_CODE_INCORRECT: :CARD_SECURITY_CODE_INCORRECT + CARD_SPEND_LIMIT_EXCEEDED: :CARD_SPEND_LIMIT_EXCEEDED + CONTACT_CARD_ISSUER: :CONTACT_CARD_ISSUER + CUSTOMER_ASA_TIMEOUT: :CUSTOMER_ASA_TIMEOUT + CUSTOM_ASA_RESULT: :CUSTOM_ASA_RESULT + DECLINED: :DECLINED + DO_NOT_HONOR: :DO_NOT_HONOR + DRIVER_NUMBER_INVALID: :DRIVER_NUMBER_INVALID + FORMAT_ERROR: :FORMAT_ERROR + INSUFFICIENT_FUNDING_SOURCE_BALANCE: :INSUFFICIENT_FUNDING_SOURCE_BALANCE + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + LITHIC_SYSTEM_ERROR: :LITHIC_SYSTEM_ERROR + LITHIC_SYSTEM_RATE_LIMIT: :LITHIC_SYSTEM_RATE_LIMIT + MALFORMED_ASA_RESPONSE: :MALFORMED_ASA_RESPONSE + MERCHANT_INVALID: :MERCHANT_INVALID + MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE: :MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE + MERCHANT_NOT_PERMITTED: :MERCHANT_NOT_PERMITTED + OVER_REVERSAL_ATTEMPTED: :OVER_REVERSAL_ATTEMPTED + PIN_BLOCKED: :PIN_BLOCKED + PROGRAM_CARD_SPEND_LIMIT_EXCEEDED: :PROGRAM_CARD_SPEND_LIMIT_EXCEEDED + PROGRAM_SUSPENDED: :PROGRAM_SUSPENDED + PROGRAM_USAGE_RESTRICTION: :PROGRAM_USAGE_RESTRICTION + REVERSAL_UNMATCHED: :REVERSAL_UNMATCHED + SECURITY_VIOLATION: :SECURITY_VIOLATION + SINGLE_USE_CARD_REATTEMPTED: :SINGLE_USE_CARD_REATTEMPTED + SUSPECTED_FRAUD: :SUSPECTED_FRAUD + TRANSACTION_INVALID: :TRANSACTION_INVALID + TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL: :TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL + TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER: :TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER + TRANSACTION_PREVIOUSLY_COMPLETED: :TRANSACTION_PREVIOUSLY_COMPLETED + UNAUTHORIZED_MERCHANT: :UNAUTHORIZED_MERCHANT + VEHICLE_NUMBER_INVALID: :VEHICLE_NUMBER_INVALID + CARDHOLDER_CHALLENGED: :CARDHOLDER_CHALLENGED + CARDHOLDER_CHALLENGE_FAILED: :CARDHOLDER_CHALLENGE_FAILED + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::code] + end + + type type_ = :DECLINE + + module Type + extend Lithic::Internal::Type::Enum + + DECLINE: :DECLINE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::DeclineActionAuthorization::type_] + end + end + + type challenge_action_authorization = + { + type: Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::ChallengeActionAuthorization::type_, + explanation: String + } + + class ChallengeActionAuthorization < Lithic::Internal::Type::BaseModel + attr_accessor type: Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::ChallengeActionAuthorization::type_ + + attr_reader explanation: String? + + def explanation=: (String) -> String + + def initialize: ( + type: Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::ChallengeActionAuthorization::type_, + ?explanation: String + ) -> void + + def to_hash: -> { + type: Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::ChallengeActionAuthorization::type_, + explanation: String + } + + type type_ = :CHALLENGE + + module Type + extend Lithic::Internal::Type::Enum + + CHALLENGE: :CHALLENGE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::Action::ChallengeActionAuthorization::type_] + end + end + + def self?.variants: -> ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::action] + end + + type mode = :ACTIVE | :INACTIVE + + module Mode + extend Lithic::Internal::Type::Enum + + ACTIVE: :ACTIVE + INACTIVE: :INACTIVE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult::mode] + end + end + + type authentication3_ds_result = + { + token: String, + actions: ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Action], + auth_rule_token: String, + evaluation_time: Time, + event_stream: :THREE_DS_AUTHENTICATION, + event_token: String, + mode: Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::mode, + rule_version: Integer, + transaction_token: String? + } + + class Authentication3DSResult < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor actions: ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Action] + + attr_accessor auth_rule_token: String + + attr_accessor evaluation_time: Time + + attr_accessor event_stream: :THREE_DS_AUTHENTICATION + + attr_accessor event_token: String + + attr_accessor mode: Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::mode + + attr_accessor rule_version: Integer + + attr_accessor transaction_token: String? + + def initialize: ( + token: String, + actions: ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Action], + auth_rule_token: String, + evaluation_time: Time, + event_token: String, + mode: Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::mode, + rule_version: Integer, + transaction_token: String?, + ?event_stream: :THREE_DS_AUTHENTICATION + ) -> void + + def to_hash: -> { + token: String, + actions: ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Action], + auth_rule_token: String, + evaluation_time: Time, + event_stream: :THREE_DS_AUTHENTICATION, + event_token: String, + mode: Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::mode, + rule_version: Integer, + transaction_token: String? + } + + type action = + { + type: Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Action::type_, + explanation: String + } + + class Action < Lithic::Internal::Type::BaseModel + attr_accessor type: Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Action::type_ + + attr_reader explanation: String? + + def explanation=: (String) -> String + + def initialize: ( + type: Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Action::type_, + ?explanation: String + ) -> void + + def to_hash: -> { + type: Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Action::type_, + explanation: String + } + + type type_ = :DECLINE | :CHALLENGE + + module Type + extend Lithic::Internal::Type::Enum + + DECLINE: :DECLINE + CHALLENGE: :CHALLENGE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::Action::type_] + end + end + + type mode = :ACTIVE | :INACTIVE + + module Mode + extend Lithic::Internal::Type::Enum + + ACTIVE: :ACTIVE + INACTIVE: :INACTIVE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult::mode] + end + end + + type tokenization_result = + { + token: String, + actions: ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::action], + auth_rule_token: String, + evaluation_time: Time, + event_stream: :TOKENIZATION, + event_token: String, + mode: Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::mode, + rule_version: Integer, + transaction_token: String? + } + + class TokenizationResult < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor actions: ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::action] + + attr_accessor auth_rule_token: String + + attr_accessor evaluation_time: Time + + attr_accessor event_stream: :TOKENIZATION + + attr_accessor event_token: String + + attr_accessor mode: Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::mode + + attr_accessor rule_version: Integer + + attr_accessor transaction_token: String? + + def initialize: ( + token: String, + actions: ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::action], + auth_rule_token: String, + evaluation_time: Time, + event_token: String, + mode: Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::mode, + rule_version: Integer, + transaction_token: String?, + ?event_stream: :TOKENIZATION + ) -> void + + def to_hash: -> { + token: String, + actions: ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::action], + auth_rule_token: String, + evaluation_time: Time, + event_stream: :TOKENIZATION, + event_token: String, + mode: Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::mode, + rule_version: Integer, + transaction_token: String? + } + + type action = + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization + | Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction + + module Action + extend Lithic::Internal::Type::Union + + type decline_action_tokenization = + { + type: Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::type_, + explanation: String, + reason: Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::reason + } + + class DeclineActionTokenization < Lithic::Internal::Type::BaseModel + attr_accessor type: Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::type_ + + attr_reader explanation: String? + + def explanation=: (String) -> String + + attr_reader reason: Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::reason? + + def reason=: ( + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::reason + ) -> Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::reason + + def initialize: ( + type: Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::type_, + ?explanation: String, + ?reason: Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::reason + ) -> void + + def to_hash: -> { + type: Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::type_, + explanation: String, + reason: Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::reason + } + + type type_ = :DECLINE + + module Type + extend Lithic::Internal::Type::Enum + + DECLINE: :DECLINE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::type_] + end + + type reason = + :ACCOUNT_SCORE_1 + | :DEVICE_SCORE_1 + | :ALL_WALLET_DECLINE_REASONS_PRESENT + | :WALLET_RECOMMENDED_DECISION_RED + | :CVC_MISMATCH + | :CARD_EXPIRY_MONTH_MISMATCH + | :CARD_EXPIRY_YEAR_MISMATCH + | :CARD_INVALID_STATE + | :CUSTOMER_RED_PATH + | :INVALID_CUSTOMER_RESPONSE + | :NETWORK_FAILURE + | :GENERIC_DECLINE + | :DIGITAL_CARD_ART_REQUIRED + + module Reason + extend Lithic::Internal::Type::Enum + + ACCOUNT_SCORE_1: :ACCOUNT_SCORE_1 + DEVICE_SCORE_1: :DEVICE_SCORE_1 + ALL_WALLET_DECLINE_REASONS_PRESENT: :ALL_WALLET_DECLINE_REASONS_PRESENT + WALLET_RECOMMENDED_DECISION_RED: :WALLET_RECOMMENDED_DECISION_RED + CVC_MISMATCH: :CVC_MISMATCH + CARD_EXPIRY_MONTH_MISMATCH: :CARD_EXPIRY_MONTH_MISMATCH + CARD_EXPIRY_YEAR_MISMATCH: :CARD_EXPIRY_YEAR_MISMATCH + CARD_INVALID_STATE: :CARD_INVALID_STATE + CUSTOMER_RED_PATH: :CUSTOMER_RED_PATH + INVALID_CUSTOMER_RESPONSE: :INVALID_CUSTOMER_RESPONSE + NETWORK_FAILURE: :NETWORK_FAILURE + GENERIC_DECLINE: :GENERIC_DECLINE + DIGITAL_CARD_ART_REQUIRED: :DIGITAL_CARD_ART_REQUIRED + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::DeclineActionTokenization::reason] + end + end + + type require_tfa_action = + { + type: Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::type_, + explanation: String, + reason: Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::reason + } + + class RequireTfaAction < Lithic::Internal::Type::BaseModel + attr_accessor type: Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::type_ + + attr_reader explanation: String? + + def explanation=: (String) -> String + + attr_reader reason: Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::reason? + + def reason=: ( + Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::reason + ) -> Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::reason + + def initialize: ( + type: Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::type_, + ?explanation: String, + ?reason: Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::reason + ) -> void + + def to_hash: -> { + type: Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::type_, + explanation: String, + reason: Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::reason + } + + type type_ = :REQUIRE_TFA + + module Type + extend Lithic::Internal::Type::Enum + + REQUIRE_TFA: :REQUIRE_TFA + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::type_] + end + + type reason = + :WALLET_RECOMMENDED_TFA + | :SUSPICIOUS_ACTIVITY + | :DEVICE_RECENTLY_LOST + | :TOO_MANY_RECENT_ATTEMPTS + | :TOO_MANY_RECENT_TOKENS + | :TOO_MANY_DIFFERENT_CARDHOLDERS + | :OUTSIDE_HOME_TERRITORY + | :HAS_SUSPENDED_TOKENS + | :HIGH_RISK + | :ACCOUNT_SCORE_LOW + | :DEVICE_SCORE_LOW + | :CARD_STATE_TFA + | :HARDCODED_TFA + | :CUSTOMER_RULE_TFA + | :DEVICE_HOST_CARD_EMULATION + + module Reason + extend Lithic::Internal::Type::Enum + + WALLET_RECOMMENDED_TFA: :WALLET_RECOMMENDED_TFA + SUSPICIOUS_ACTIVITY: :SUSPICIOUS_ACTIVITY + DEVICE_RECENTLY_LOST: :DEVICE_RECENTLY_LOST + TOO_MANY_RECENT_ATTEMPTS: :TOO_MANY_RECENT_ATTEMPTS + TOO_MANY_RECENT_TOKENS: :TOO_MANY_RECENT_TOKENS + TOO_MANY_DIFFERENT_CARDHOLDERS: :TOO_MANY_DIFFERENT_CARDHOLDERS + OUTSIDE_HOME_TERRITORY: :OUTSIDE_HOME_TERRITORY + HAS_SUSPENDED_TOKENS: :HAS_SUSPENDED_TOKENS + HIGH_RISK: :HIGH_RISK + ACCOUNT_SCORE_LOW: :ACCOUNT_SCORE_LOW + DEVICE_SCORE_LOW: :DEVICE_SCORE_LOW + CARD_STATE_TFA: :CARD_STATE_TFA + HARDCODED_TFA: :HARDCODED_TFA + CUSTOMER_RULE_TFA: :CUSTOMER_RULE_TFA + DEVICE_HOST_CARD_EMULATION: :DEVICE_HOST_CARD_EMULATION + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::Action::RequireTfaAction::reason] + end + end + + def self?.variants: -> ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::action] + end + + type mode = :ACTIVE | :INACTIVE + + module Mode + extend Lithic::Internal::Type::Enum + + ACTIVE: :ACTIVE + INACTIVE: :INACTIVE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult::mode] + end + end + + type ach_result = + { + token: String, + actions: ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::action], + auth_rule_token: String, + evaluation_time: Time, + event_stream: Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::event_stream, + event_token: String, + mode: Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::mode, + rule_version: Integer, + transaction_token: String? + } + + class ACHResult < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor actions: ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::action] + + attr_accessor auth_rule_token: String + + attr_accessor evaluation_time: Time + + attr_accessor event_stream: Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::event_stream + + attr_accessor event_token: String + + attr_accessor mode: Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::mode + + attr_accessor rule_version: Integer + + attr_accessor transaction_token: String? + + def initialize: ( + token: String, + actions: ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::action], + auth_rule_token: String, + evaluation_time: Time, + event_stream: Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::event_stream, + event_token: String, + mode: Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::mode, + rule_version: Integer, + transaction_token: String? + ) -> void + + def to_hash: -> { + token: String, + actions: ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::action], + auth_rule_token: String, + evaluation_time: Time, + event_stream: Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::event_stream, + event_token: String, + mode: Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::mode, + rule_version: Integer, + transaction_token: String? + } + + type action = + Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ApproveActionACH + | Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction + + module Action + extend Lithic::Internal::Type::Union + + type approve_action_ach = + { + type: Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ApproveActionACH::type_, + explanation: String + } + + class ApproveActionACH < Lithic::Internal::Type::BaseModel + attr_accessor type: Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ApproveActionACH::type_ + + attr_reader explanation: String? + + def explanation=: (String) -> String + + def initialize: ( + type: Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ApproveActionACH::type_, + ?explanation: String + ) -> void + + def to_hash: -> { + type: Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ApproveActionACH::type_, + explanation: String + } + + type type_ = :APPROVE + + module Type + extend Lithic::Internal::Type::Enum + + APPROVE: :APPROVE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ApproveActionACH::type_] + end + end + + type return_action = + { + code: Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::code, + type: Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::type_, + explanation: String + } + + class ReturnAction < Lithic::Internal::Type::BaseModel + attr_accessor code: Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::code + + attr_accessor type: Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::type_ + + attr_reader explanation: String? + + def explanation=: (String) -> String + + def initialize: ( + code: Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::code, + type: Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::type_, + ?explanation: String + ) -> void + + def to_hash: -> { + code: Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::code, + type: Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::type_, + explanation: String + } + + type code = + :R01 + | :R02 + | :R03 + | :R04 + | :R05 + | :R06 + | :R07 + | :R08 + | :R09 + | :R10 + | :R11 + | :R12 + | :R13 + | :R14 + | :R15 + | :R16 + | :R17 + | :R18 + | :R19 + | :R20 + | :R21 + | :R22 + | :R23 + | :R24 + | :R25 + | :R26 + | :R27 + | :R28 + | :R29 + | :R30 + | :R31 + | :R32 + | :R33 + | :R34 + | :R35 + | :R36 + | :R37 + | :R38 + | :R39 + | :R40 + | :R41 + | :R42 + | :R43 + | :R44 + | :R45 + | :R46 + | :R47 + | :R50 + | :R51 + | :R52 + | :R53 + | :R61 + | :R62 + | :R67 + | :R68 + | :R69 + | :R70 + | :R71 + | :R72 + | :R73 + | :R74 + | :R75 + | :R76 + | :R77 + | :R80 + | :R81 + | :R82 + | :R83 + | :R84 + | :R85 + + module Code + extend Lithic::Internal::Type::Enum + + R01: :R01 + R02: :R02 + R03: :R03 + R04: :R04 + R05: :R05 + R06: :R06 + R07: :R07 + R08: :R08 + R09: :R09 + R10: :R10 + R11: :R11 + R12: :R12 + R13: :R13 + R14: :R14 + R15: :R15 + R16: :R16 + R17: :R17 + R18: :R18 + R19: :R19 + R20: :R20 + R21: :R21 + R22: :R22 + R23: :R23 + R24: :R24 + R25: :R25 + R26: :R26 + R27: :R27 + R28: :R28 + R29: :R29 + R30: :R30 + R31: :R31 + R32: :R32 + R33: :R33 + R34: :R34 + R35: :R35 + R36: :R36 + R37: :R37 + R38: :R38 + R39: :R39 + R40: :R40 + R41: :R41 + R42: :R42 + R43: :R43 + R44: :R44 + R45: :R45 + R46: :R46 + R47: :R47 + R50: :R50 + R51: :R51 + R52: :R52 + R53: :R53 + R61: :R61 + R62: :R62 + R67: :R67 + R68: :R68 + R69: :R69 + R70: :R70 + R71: :R71 + R72: :R72 + R73: :R73 + R74: :R74 + R75: :R75 + R76: :R76 + R77: :R77 + R80: :R80 + R81: :R81 + R82: :R82 + R83: :R83 + R84: :R84 + R85: :R85 + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::code] + end + + type type_ = :RETURN + + module Type + extend Lithic::Internal::Type::Enum + + RETURN: :RETURN + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::Action::ReturnAction::type_] + end + end + + def self?.variants: -> ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::action] + end + + type event_stream = :ACH_CREDIT_RECEIPT | :ACH_DEBIT_RECEIPT + + module EventStream + extend Lithic::Internal::Type::Enum + + ACH_CREDIT_RECEIPT: :ACH_CREDIT_RECEIPT + ACH_DEBIT_RECEIPT: :ACH_DEBIT_RECEIPT + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::event_stream] + end + + type mode = :ACTIVE | :INACTIVE + + module Mode + extend Lithic::Internal::Type::Enum + + ACTIVE: :ACTIVE + INACTIVE: :INACTIVE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult::mode] + end + end + + def self?.variants: -> ::Array[Lithic::Models::AuthRules::v2_list_results_response] + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_list_versions_params.rbs b/sig/lithic/models/auth_rules/v2_list_versions_params.rbs new file mode 100644 index 00000000..b561f2a4 --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_list_versions_params.rbs @@ -0,0 +1,25 @@ +module Lithic + module Models + module AuthRules + type v2_list_versions_params = + { auth_rule_token: String } & Lithic::Internal::Type::request_parameters + + class V2ListVersionsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor auth_rule_token: String + + def initialize: ( + auth_rule_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + auth_rule_token: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_list_versions_response.rbs b/sig/lithic/models/auth_rules/v2_list_versions_response.rbs new file mode 100644 index 00000000..d1cc0bf0 --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_list_versions_response.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + module AuthRules + type v2_list_versions_response = + { data: ::Array[Lithic::AuthRules::AuthRuleVersion] } + + class V2ListVersionsResponse < Lithic::Internal::Type::BaseModel + attr_accessor data: ::Array[Lithic::AuthRules::AuthRuleVersion] + + def initialize: ( + data: ::Array[Lithic::AuthRules::AuthRuleVersion] + ) -> void + + def to_hash: -> { data: ::Array[Lithic::AuthRules::AuthRuleVersion] } + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_promote_params.rbs b/sig/lithic/models/auth_rules/v2_promote_params.rbs new file mode 100644 index 00000000..aa01079f --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_promote_params.rbs @@ -0,0 +1,25 @@ +module Lithic + module Models + module AuthRules + type v2_promote_params = + { auth_rule_token: String } & Lithic::Internal::Type::request_parameters + + class V2PromoteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor auth_rule_token: String + + def initialize: ( + auth_rule_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + auth_rule_token: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_retrieve_features_params.rbs b/sig/lithic/models/auth_rules/v2_retrieve_features_params.rbs new file mode 100644 index 00000000..0a90aa1d --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_retrieve_features_params.rbs @@ -0,0 +1,38 @@ +module Lithic + module Models + module AuthRules + type v2_retrieve_features_params = + { auth_rule_token: String, account_token: String, card_token: String } + & Lithic::Internal::Type::request_parameters + + class V2RetrieveFeaturesParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor auth_rule_token: String + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader card_token: String? + + def card_token=: (String) -> String + + def initialize: ( + auth_rule_token: String, + ?account_token: String, + ?card_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + auth_rule_token: String, + account_token: String, + card_token: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_retrieve_features_response.rbs b/sig/lithic/models/auth_rules/v2_retrieve_features_response.rbs new file mode 100644 index 00000000..c6d6c903 --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_retrieve_features_response.rbs @@ -0,0 +1,82 @@ +module Lithic + module Models + module AuthRules + type v2_retrieve_features_response = + { + evaluated: Time, + features: ::Array[Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature] + } + + class V2RetrieveFeaturesResponse < Lithic::Internal::Type::BaseModel + attr_accessor evaluated: Time + + attr_accessor features: ::Array[Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature] + + def initialize: ( + evaluated: Time, + features: ::Array[Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature] + ) -> void + + def to_hash: -> { + evaluated: Time, + features: ::Array[Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature] + } + + type feature = + { + filters: Lithic::AuthRules::VelocityLimitFilters, + period: Lithic::Models::AuthRules::velocity_limit_period, + scope: Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::scope, + value: Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Value + } + + class Feature < Lithic::Internal::Type::BaseModel + attr_accessor filters: Lithic::AuthRules::VelocityLimitFilters + + attr_accessor period: Lithic::Models::AuthRules::velocity_limit_period + + attr_accessor scope: Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::scope + + attr_accessor value: Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Value + + def initialize: ( + filters: Lithic::AuthRules::VelocityLimitFilters, + period: Lithic::Models::AuthRules::velocity_limit_period, + scope: Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::scope, + value: Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Value + ) -> void + + def to_hash: -> { + filters: Lithic::AuthRules::VelocityLimitFilters, + period: Lithic::Models::AuthRules::velocity_limit_period, + scope: Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::scope, + value: Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::Value + } + + type scope = :CARD | :ACCOUNT + + module Scope + extend Lithic::Internal::Type::Enum + + CARD: :CARD + ACCOUNT: :ACCOUNT + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature::scope] + end + + type value = { amount: Integer, count: Integer } + + class Value < Lithic::Internal::Type::BaseModel + attr_accessor amount: Integer + + attr_accessor count: Integer + + def initialize: (amount: Integer, count: Integer) -> void + + def to_hash: -> { amount: Integer, count: Integer } + end + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_retrieve_params.rbs b/sig/lithic/models/auth_rules/v2_retrieve_params.rbs new file mode 100644 index 00000000..ab04e4ed --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_retrieve_params.rbs @@ -0,0 +1,25 @@ +module Lithic + module Models + module AuthRules + type v2_retrieve_params = + { auth_rule_token: String } & Lithic::Internal::Type::request_parameters + + class V2RetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor auth_rule_token: String + + def initialize: ( + auth_rule_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + auth_rule_token: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_retrieve_report_params.rbs b/sig/lithic/models/auth_rules/v2_retrieve_report_params.rbs new file mode 100644 index 00000000..7a8f3738 --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_retrieve_report_params.rbs @@ -0,0 +1,34 @@ +module Lithic + module Models + module AuthRules + type v2_retrieve_report_params = + { auth_rule_token: String, begin_: Date, end_: Date } + & Lithic::Internal::Type::request_parameters + + class V2RetrieveReportParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor auth_rule_token: String + + attr_accessor begin_: Date + + attr_accessor end_: Date + + def initialize: ( + auth_rule_token: String, + begin_: Date, + end_: Date, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + auth_rule_token: String, + begin_: Date, + end_: Date, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_retrieve_report_response.rbs b/sig/lithic/models/auth_rules/v2_retrieve_report_response.rbs new file mode 100644 index 00000000..73c53506 --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_retrieve_report_response.rbs @@ -0,0 +1,56 @@ +module Lithic + module Models + module AuthRules + type v2_retrieve_report_response = + { + auth_rule_token: String, + begin_: Date, + daily_statistics: ::Array[Lithic::Models::AuthRules::V2RetrieveReportResponse::DailyStatistic], + end_: Date + } + + class V2RetrieveReportResponse < Lithic::Internal::Type::BaseModel + attr_accessor auth_rule_token: String + + attr_accessor begin_: Date + + attr_accessor daily_statistics: ::Array[Lithic::Models::AuthRules::V2RetrieveReportResponse::DailyStatistic] + + attr_accessor end_: Date + + def initialize: ( + auth_rule_token: String, + begin_: Date, + daily_statistics: ::Array[Lithic::Models::AuthRules::V2RetrieveReportResponse::DailyStatistic], + end_: Date + ) -> void + + def to_hash: -> { + auth_rule_token: String, + begin_: Date, + daily_statistics: ::Array[Lithic::Models::AuthRules::V2RetrieveReportResponse::DailyStatistic], + end_: Date + } + + type daily_statistic = + { date: Date, versions: ::Array[Lithic::AuthRules::ReportStats] } + + class DailyStatistic < Lithic::Internal::Type::BaseModel + attr_accessor date: Date + + attr_accessor versions: ::Array[Lithic::AuthRules::ReportStats] + + def initialize: ( + date: Date, + versions: ::Array[Lithic::AuthRules::ReportStats] + ) -> void + + def to_hash: -> { + date: Date, + versions: ::Array[Lithic::AuthRules::ReportStats] + } + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/v2_update_params.rbs b/sig/lithic/models/auth_rules/v2_update_params.rbs new file mode 100644 index 00000000..55c971a5 --- /dev/null +++ b/sig/lithic/models/auth_rules/v2_update_params.rbs @@ -0,0 +1,203 @@ +module Lithic + module Models + module AuthRules + type v2_update_params = + { + auth_rule_token: String, + body: Lithic::Models::AuthRules::V2UpdateParams::body + } + & Lithic::Internal::Type::request_parameters + + class V2UpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor auth_rule_token: String + + attr_accessor body: Lithic::Models::AuthRules::V2UpdateParams::body + + def initialize: ( + auth_rule_token: String, + body: Lithic::Models::AuthRules::V2UpdateParams::body, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + auth_rule_token: String, + body: Lithic::Models::AuthRules::V2UpdateParams::body, + request_options: Lithic::RequestOptions + } + + type body = + Lithic::AuthRules::V2UpdateParams::Body::AccountLevelRule + | Lithic::AuthRules::V2UpdateParams::Body::CardLevelRule + | Lithic::AuthRules::V2UpdateParams::Body::ProgramLevelRule + + module Body + extend Lithic::Internal::Type::Union + + type account_level_rule = + { + account_tokens: ::Array[String], + business_account_tokens: ::Array[String], + name: String?, + state: Lithic::Models::AuthRules::V2UpdateParams::Body::AccountLevelRule::state + } + + class AccountLevelRule < Lithic::Internal::Type::BaseModel + attr_reader account_tokens: ::Array[String]? + + def account_tokens=: (::Array[String]) -> ::Array[String] + + attr_reader business_account_tokens: ::Array[String]? + + def business_account_tokens=: (::Array[String]) -> ::Array[String] + + attr_accessor name: String? + + attr_reader state: Lithic::Models::AuthRules::V2UpdateParams::Body::AccountLevelRule::state? + + def state=: ( + Lithic::Models::AuthRules::V2UpdateParams::Body::AccountLevelRule::state + ) -> Lithic::Models::AuthRules::V2UpdateParams::Body::AccountLevelRule::state + + def initialize: ( + ?account_tokens: ::Array[String], + ?business_account_tokens: ::Array[String], + ?name: String?, + ?state: Lithic::Models::AuthRules::V2UpdateParams::Body::AccountLevelRule::state + ) -> void + + def to_hash: -> { + account_tokens: ::Array[String], + business_account_tokens: ::Array[String], + name: String?, + state: Lithic::Models::AuthRules::V2UpdateParams::Body::AccountLevelRule::state + } + + type state = :INACTIVE + + module State + extend Lithic::Internal::Type::Enum + + INACTIVE: :INACTIVE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2UpdateParams::Body::AccountLevelRule::state] + end + end + + type card_level_rule = + { + card_tokens: ::Array[String], + name: String?, + state: Lithic::Models::AuthRules::V2UpdateParams::Body::CardLevelRule::state + } + + class CardLevelRule < Lithic::Internal::Type::BaseModel + attr_reader card_tokens: ::Array[String]? + + def card_tokens=: (::Array[String]) -> ::Array[String] + + attr_accessor name: String? + + attr_reader state: Lithic::Models::AuthRules::V2UpdateParams::Body::CardLevelRule::state? + + def state=: ( + Lithic::Models::AuthRules::V2UpdateParams::Body::CardLevelRule::state + ) -> Lithic::Models::AuthRules::V2UpdateParams::Body::CardLevelRule::state + + def initialize: ( + ?card_tokens: ::Array[String], + ?name: String?, + ?state: Lithic::Models::AuthRules::V2UpdateParams::Body::CardLevelRule::state + ) -> void + + def to_hash: -> { + card_tokens: ::Array[String], + name: String?, + state: Lithic::Models::AuthRules::V2UpdateParams::Body::CardLevelRule::state + } + + type state = :INACTIVE + + module State + extend Lithic::Internal::Type::Enum + + INACTIVE: :INACTIVE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2UpdateParams::Body::CardLevelRule::state] + end + end + + type program_level_rule = + { + excluded_account_tokens: ::Array[String], + excluded_business_account_tokens: ::Array[String], + excluded_card_tokens: ::Array[String], + name: String?, + program_level: bool, + state: Lithic::Models::AuthRules::V2UpdateParams::Body::ProgramLevelRule::state + } + + class ProgramLevelRule < Lithic::Internal::Type::BaseModel + attr_reader excluded_account_tokens: ::Array[String]? + + def excluded_account_tokens=: (::Array[String]) -> ::Array[String] + + attr_reader excluded_business_account_tokens: ::Array[String]? + + def excluded_business_account_tokens=: ( + ::Array[String] + ) -> ::Array[String] + + attr_reader excluded_card_tokens: ::Array[String]? + + def excluded_card_tokens=: (::Array[String]) -> ::Array[String] + + attr_accessor name: String? + + attr_reader program_level: bool? + + def program_level=: (bool) -> bool + + attr_reader state: Lithic::Models::AuthRules::V2UpdateParams::Body::ProgramLevelRule::state? + + def state=: ( + Lithic::Models::AuthRules::V2UpdateParams::Body::ProgramLevelRule::state + ) -> Lithic::Models::AuthRules::V2UpdateParams::Body::ProgramLevelRule::state + + def initialize: ( + ?excluded_account_tokens: ::Array[String], + ?excluded_business_account_tokens: ::Array[String], + ?excluded_card_tokens: ::Array[String], + ?name: String?, + ?program_level: bool, + ?state: Lithic::Models::AuthRules::V2UpdateParams::Body::ProgramLevelRule::state + ) -> void + + def to_hash: -> { + excluded_account_tokens: ::Array[String], + excluded_business_account_tokens: ::Array[String], + excluded_card_tokens: ::Array[String], + name: String?, + program_level: bool, + state: Lithic::Models::AuthRules::V2UpdateParams::Body::ProgramLevelRule::state + } + + type state = :INACTIVE + + module State + extend Lithic::Internal::Type::Enum + + INACTIVE: :INACTIVE + + def self?.values: -> ::Array[Lithic::Models::AuthRules::V2UpdateParams::Body::ProgramLevelRule::state] + end + end + + def self?.variants: -> ::Array[Lithic::Models::AuthRules::V2UpdateParams::body] + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/velocity_limit_filters.rbs b/sig/lithic/models/auth_rules/velocity_limit_filters.rbs new file mode 100644 index 00000000..844b5d5d --- /dev/null +++ b/sig/lithic/models/auth_rules/velocity_limit_filters.rbs @@ -0,0 +1,81 @@ +module Lithic + module Models + module AuthRules + type velocity_limit_filters = + { + exclude_countries: ::Array[String]?, + exclude_mccs: ::Array[String]?, + include_countries: ::Array[String]?, + include_mccs: ::Array[String]?, + include_pan_entry_modes: ::Array[Lithic::Models::AuthRules::VelocityLimitFilters::include_pan_entry_mode]? + } + + class VelocityLimitFilters < Lithic::Internal::Type::BaseModel + attr_accessor exclude_countries: ::Array[String]? + + attr_accessor exclude_mccs: ::Array[String]? + + attr_accessor include_countries: ::Array[String]? + + attr_accessor include_mccs: ::Array[String]? + + attr_accessor include_pan_entry_modes: ::Array[Lithic::Models::AuthRules::VelocityLimitFilters::include_pan_entry_mode]? + + def initialize: ( + ?exclude_countries: ::Array[String]?, + ?exclude_mccs: ::Array[String]?, + ?include_countries: ::Array[String]?, + ?include_mccs: ::Array[String]?, + ?include_pan_entry_modes: ::Array[Lithic::Models::AuthRules::VelocityLimitFilters::include_pan_entry_mode]? + ) -> void + + def to_hash: -> { + exclude_countries: ::Array[String]?, + exclude_mccs: ::Array[String]?, + include_countries: ::Array[String]?, + include_mccs: ::Array[String]?, + include_pan_entry_modes: ::Array[Lithic::Models::AuthRules::VelocityLimitFilters::include_pan_entry_mode]? + } + + type include_pan_entry_mode = + :AUTO_ENTRY + | :BAR_CODE + | :CONTACTLESS + | :CREDENTIAL_ON_FILE + | :ECOMMERCE + | :ERROR_KEYED + | :ERROR_MAGNETIC_STRIPE + | :ICC + | :KEY_ENTERED + | :MAGNETIC_STRIPE + | :MANUAL + | :OCR + | :SECURE_CARDLESS + | :UNSPECIFIED + | :UNKNOWN + + module IncludePanEntryMode + extend Lithic::Internal::Type::Enum + + AUTO_ENTRY: :AUTO_ENTRY + BAR_CODE: :BAR_CODE + CONTACTLESS: :CONTACTLESS + CREDENTIAL_ON_FILE: :CREDENTIAL_ON_FILE + ECOMMERCE: :ECOMMERCE + ERROR_KEYED: :ERROR_KEYED + ERROR_MAGNETIC_STRIPE: :ERROR_MAGNETIC_STRIPE + ICC: :ICC + KEY_ENTERED: :KEY_ENTERED + MAGNETIC_STRIPE: :MAGNETIC_STRIPE + MANUAL: :MANUAL + OCR: :OCR + SECURE_CARDLESS: :SECURE_CARDLESS + UNSPECIFIED: :UNSPECIFIED + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::AuthRules::VelocityLimitFilters::include_pan_entry_mode] + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/velocity_limit_params.rbs b/sig/lithic/models/auth_rules/velocity_limit_params.rbs new file mode 100644 index 00000000..cd93489d --- /dev/null +++ b/sig/lithic/models/auth_rules/velocity_limit_params.rbs @@ -0,0 +1,57 @@ +module Lithic + module Models + module AuthRules + type velocity_limit_params = + { + period: Lithic::Models::AuthRules::velocity_limit_period, + scope: Lithic::Models::AuthRules::VelocityLimitParams::scope, + filters: Lithic::AuthRules::VelocityLimitFilters, + limit_amount: Integer?, + limit_count: Integer? + } + + class VelocityLimitParams < Lithic::Internal::Type::BaseModel + attr_accessor period: Lithic::Models::AuthRules::velocity_limit_period + + attr_accessor scope: Lithic::Models::AuthRules::VelocityLimitParams::scope + + attr_reader filters: Lithic::AuthRules::VelocityLimitFilters? + + def filters=: ( + Lithic::AuthRules::VelocityLimitFilters + ) -> Lithic::AuthRules::VelocityLimitFilters + + attr_accessor limit_amount: Integer? + + attr_accessor limit_count: Integer? + + def initialize: ( + period: Lithic::Models::AuthRules::velocity_limit_period, + scope: Lithic::Models::AuthRules::VelocityLimitParams::scope, + ?filters: Lithic::AuthRules::VelocityLimitFilters, + ?limit_amount: Integer?, + ?limit_count: Integer? + ) -> void + + def to_hash: -> { + period: Lithic::Models::AuthRules::velocity_limit_period, + scope: Lithic::Models::AuthRules::VelocityLimitParams::scope, + filters: Lithic::AuthRules::VelocityLimitFilters, + limit_amount: Integer?, + limit_count: Integer? + } + + type scope = :CARD | :ACCOUNT + + module Scope + extend Lithic::Internal::Type::Enum + + CARD: :CARD + ACCOUNT: :ACCOUNT + + def self?.values: -> ::Array[Lithic::Models::AuthRules::VelocityLimitParams::scope] + end + end + end + end +end diff --git a/sig/lithic/models/auth_rules/velocity_limit_period.rbs b/sig/lithic/models/auth_rules/velocity_limit_period.rbs new file mode 100644 index 00000000..8d5ed671 --- /dev/null +++ b/sig/lithic/models/auth_rules/velocity_limit_period.rbs @@ -0,0 +1,91 @@ +module Lithic + module Models + module AuthRules + type velocity_limit_period = + Lithic::AuthRules::VelocityLimitPeriod::TrailingWindowObject + | Lithic::AuthRules::VelocityLimitPeriod::FixedWindowDay + | Lithic::AuthRules::VelocityLimitPeriod::FixedWindowWeek + | Lithic::AuthRules::VelocityLimitPeriod::FixedWindowMonth + | Lithic::AuthRules::VelocityLimitPeriod::FixedWindowYear + + module VelocityLimitPeriod + extend Lithic::Internal::Type::Union + + type trailing_window_object = { duration: Integer, type: :CUSTOM } + + class TrailingWindowObject < Lithic::Internal::Type::BaseModel + attr_accessor duration: Integer + + attr_accessor type: :CUSTOM + + def initialize: (duration: Integer, ?type: :CUSTOM) -> void + + def to_hash: -> { duration: Integer, type: :CUSTOM } + end + + type fixed_window_day = { type: :DAY } + + class FixedWindowDay < Lithic::Internal::Type::BaseModel + attr_accessor type: :DAY + + def initialize: (?type: :DAY) -> void + + def to_hash: -> { type: :DAY } + end + + type fixed_window_week = { type: :WEEK, day_of_week: Integer } + + class FixedWindowWeek < Lithic::Internal::Type::BaseModel + attr_accessor type: :WEEK + + attr_reader day_of_week: Integer? + + def day_of_week=: (Integer) -> Integer + + def initialize: (?day_of_week: Integer, ?type: :WEEK) -> void + + def to_hash: -> { type: :WEEK, day_of_week: Integer } + end + + type fixed_window_month = { type: :MONTH, day_of_month: Integer } + + class FixedWindowMonth < Lithic::Internal::Type::BaseModel + attr_accessor type: :MONTH + + attr_reader day_of_month: Integer? + + def day_of_month=: (Integer) -> Integer + + def initialize: (?day_of_month: Integer, ?type: :MONTH) -> void + + def to_hash: -> { type: :MONTH, day_of_month: Integer } + end + + type fixed_window_year = + { type: :YEAR, day_of_month: Integer, month: Integer } + + class FixedWindowYear < Lithic::Internal::Type::BaseModel + attr_accessor type: :YEAR + + attr_reader day_of_month: Integer? + + def day_of_month=: (Integer) -> Integer + + attr_reader month: Integer? + + def month=: (Integer) -> Integer + + def initialize: ( + ?day_of_month: Integer, + ?month: Integer, + ?type: :YEAR + ) -> void + + def to_hash: -> { type: :YEAR, day_of_month: Integer, month: Integer } + end + + def self?.variants: -> ::Array[Lithic::Models::AuthRules::velocity_limit_period] + end + end + end +end diff --git a/sig/lithic/models/auth_rules_backtest_report_created_webhook_event.rbs b/sig/lithic/models/auth_rules_backtest_report_created_webhook_event.rbs new file mode 100644 index 00000000..8a19ae16 --- /dev/null +++ b/sig/lithic/models/auth_rules_backtest_report_created_webhook_event.rbs @@ -0,0 +1,20 @@ +module Lithic + module Models + type auth_rules_backtest_report_created_webhook_event = + { event_type: :"auth_rules.backtest_report.created" } + + class AuthRulesBacktestReportCreatedWebhookEvent < Lithic::Models::AuthRules::V2::BacktestResults + def event_type: -> :"auth_rules.backtest_report.created" + + def event_type=: ( + :"auth_rules.backtest_report.created" _ + ) -> :"auth_rules.backtest_report.created" + + def initialize: ( + ?event_type: :"auth_rules.backtest_report.created" + ) -> void + + def to_hash: -> { event_type: :"auth_rules.backtest_report.created" } + end + end +end diff --git a/sig/lithic/models/auth_stream_enrollment_retrieve_secret_params.rbs b/sig/lithic/models/auth_stream_enrollment_retrieve_secret_params.rbs new file mode 100644 index 00000000..4c72b5b0 --- /dev/null +++ b/sig/lithic/models/auth_stream_enrollment_retrieve_secret_params.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type auth_stream_enrollment_retrieve_secret_params = + { } & Lithic::Internal::Type::request_parameters + + class AuthStreamEnrollmentRetrieveSecretParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> { request_options: Lithic::RequestOptions } + end + end +end diff --git a/sig/lithic/models/auth_stream_enrollment_rotate_secret_params.rbs b/sig/lithic/models/auth_stream_enrollment_rotate_secret_params.rbs new file mode 100644 index 00000000..eb9f9114 --- /dev/null +++ b/sig/lithic/models/auth_stream_enrollment_rotate_secret_params.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type auth_stream_enrollment_rotate_secret_params = + { } & Lithic::Internal::Type::request_parameters + + class AuthStreamEnrollmentRotateSecretParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> { request_options: Lithic::RequestOptions } + end + end +end diff --git a/sig/lithic/models/auth_stream_secret.rbs b/sig/lithic/models/auth_stream_secret.rbs new file mode 100644 index 00000000..f88c20ab --- /dev/null +++ b/sig/lithic/models/auth_stream_secret.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type auth_stream_secret = { secret: String } + + class AuthStreamSecret < Lithic::Internal::Type::BaseModel + attr_reader secret: String? + + def secret=: (String) -> String + + def initialize: (?secret: String) -> void + + def to_hash: -> { secret: String } + end + end +end diff --git a/sig/lithic/models/balance.rbs b/sig/lithic/models/balance.rbs new file mode 100644 index 00000000..c48d0ced --- /dev/null +++ b/sig/lithic/models/balance.rbs @@ -0,0 +1,86 @@ +module Lithic + module Models + type balance = + { + available_amount: Integer, + created: Time, + currency: String, + financial_account_token: String, + financial_account_type: Lithic::Models::Balance::financial_account_type, + last_transaction_event_token: String?, + last_transaction_token: String?, + pending_amount: Integer, + total_amount: Integer, + updated: Time + } + + class Balance < Lithic::Internal::Type::BaseModel + attr_accessor available_amount: Integer + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor financial_account_token: String + + attr_accessor financial_account_type: Lithic::Models::Balance::financial_account_type + + attr_accessor last_transaction_event_token: String? + + attr_accessor last_transaction_token: String? + + attr_accessor pending_amount: Integer + + attr_accessor total_amount: Integer + + attr_accessor updated: Time + + def initialize: ( + available_amount: Integer, + created: Time, + currency: String, + financial_account_token: String, + financial_account_type: Lithic::Models::Balance::financial_account_type, + last_transaction_event_token: String?, + last_transaction_token: String?, + pending_amount: Integer, + total_amount: Integer, + updated: Time + ) -> void + + def to_hash: -> { + available_amount: Integer, + created: Time, + currency: String, + financial_account_token: String, + financial_account_type: Lithic::Models::Balance::financial_account_type, + last_transaction_event_token: String?, + last_transaction_token: String?, + pending_amount: Integer, + total_amount: Integer, + updated: Time + } + + type financial_account_type = + :CARD + | :ISSUING + | :OPERATING + | :PROGRAM_RECEIVABLES + | :RESERVE + | :SECURITY + + module FinancialAccountType + extend Lithic::Internal::Type::Enum + + CARD: :CARD + ISSUING: :ISSUING + OPERATING: :OPERATING + PROGRAM_RECEIVABLES: :PROGRAM_RECEIVABLES + RESERVE: :RESERVE + SECURITY: :SECURITY + + def self?.values: -> ::Array[Lithic::Models::Balance::financial_account_type] + end + end + end +end diff --git a/sig/lithic/models/balance_list_params.rbs b/sig/lithic/models/balance_list_params.rbs new file mode 100644 index 00000000..b4a34046 --- /dev/null +++ b/sig/lithic/models/balance_list_params.rbs @@ -0,0 +1,64 @@ +module Lithic + module Models + type balance_list_params = + { + account_token: String, + balance_date: Time, + business_account_token: String, + financial_account_type: Lithic::Models::BalanceListParams::financial_account_type + } + & Lithic::Internal::Type::request_parameters + + class BalanceListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader balance_date: Time? + + def balance_date=: (Time) -> Time + + attr_reader business_account_token: String? + + def business_account_token=: (String) -> String + + attr_reader financial_account_type: Lithic::Models::BalanceListParams::financial_account_type? + + def financial_account_type=: ( + Lithic::Models::BalanceListParams::financial_account_type + ) -> Lithic::Models::BalanceListParams::financial_account_type + + def initialize: ( + ?account_token: String, + ?balance_date: Time, + ?business_account_token: String, + ?financial_account_type: Lithic::Models::BalanceListParams::financial_account_type, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + account_token: String, + balance_date: Time, + business_account_token: String, + financial_account_type: Lithic::Models::BalanceListParams::financial_account_type, + request_options: Lithic::RequestOptions + } + + type financial_account_type = :ISSUING | :OPERATING | :RESERVE | :SECURITY + + module FinancialAccountType + extend Lithic::Internal::Type::Enum + + ISSUING: :ISSUING + OPERATING: :OPERATING + RESERVE: :RESERVE + SECURITY: :SECURITY + + def self?.values: -> ::Array[Lithic::Models::BalanceListParams::financial_account_type] + end + end + end +end diff --git a/sig/lithic/models/balance_updated_webhook_event.rbs b/sig/lithic/models/balance_updated_webhook_event.rbs new file mode 100644 index 00000000..06f87b68 --- /dev/null +++ b/sig/lithic/models/balance_updated_webhook_event.rbs @@ -0,0 +1,25 @@ +module Lithic + module Models + type balance_updated_webhook_event = + { + data: ::Array[Lithic::FinancialAccountBalance], + event_type: :"balance.updated" + } + + class BalanceUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor data: ::Array[Lithic::FinancialAccountBalance] + + attr_accessor event_type: :"balance.updated" + + def initialize: ( + data: ::Array[Lithic::FinancialAccountBalance], + ?event_type: :"balance.updated" + ) -> void + + def to_hash: -> { + data: ::Array[Lithic::FinancialAccountBalance], + event_type: :"balance.updated" + } + end + end +end diff --git a/sig/lithic/models/book_transfer_create_params.rbs b/sig/lithic/models/book_transfer_create_params.rbs new file mode 100644 index 00000000..34ae9c8e --- /dev/null +++ b/sig/lithic/models/book_transfer_create_params.rbs @@ -0,0 +1,205 @@ +module Lithic + module Models + type book_transfer_create_params = + { + amount: Integer, + category: Lithic::Models::BookTransferCreateParams::category, + from_financial_account_token: String, + subtype: String, + to_financial_account_token: String, + type: Lithic::Models::BookTransferCreateParams::type_, + token: String, + external_id: String, + hold_token: String, + memo: String, + on_closed_account: Lithic::Models::BookTransferCreateParams::on_closed_account + } + & Lithic::Internal::Type::request_parameters + + class BookTransferCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor amount: Integer + + attr_accessor category: Lithic::Models::BookTransferCreateParams::category + + attr_accessor from_financial_account_token: String + + attr_accessor subtype: String + + attr_accessor to_financial_account_token: String + + attr_accessor type: Lithic::Models::BookTransferCreateParams::type_ + + attr_reader token: String? + + def token=: (String) -> String + + attr_reader external_id: String? + + def external_id=: (String) -> String + + attr_reader hold_token: String? + + def hold_token=: (String) -> String + + attr_reader memo: String? + + def memo=: (String) -> String + + attr_reader on_closed_account: Lithic::Models::BookTransferCreateParams::on_closed_account? + + def on_closed_account=: ( + Lithic::Models::BookTransferCreateParams::on_closed_account + ) -> Lithic::Models::BookTransferCreateParams::on_closed_account + + def initialize: ( + amount: Integer, + category: Lithic::Models::BookTransferCreateParams::category, + from_financial_account_token: String, + subtype: String, + to_financial_account_token: String, + type: Lithic::Models::BookTransferCreateParams::type_, + ?token: String, + ?external_id: String, + ?hold_token: String, + ?memo: String, + ?on_closed_account: Lithic::Models::BookTransferCreateParams::on_closed_account, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + amount: Integer, + category: Lithic::Models::BookTransferCreateParams::category, + from_financial_account_token: String, + subtype: String, + to_financial_account_token: String, + type: Lithic::Models::BookTransferCreateParams::type_, + token: String, + external_id: String, + hold_token: String, + memo: String, + on_closed_account: Lithic::Models::BookTransferCreateParams::on_closed_account, + request_options: Lithic::RequestOptions + } + + type category = + :ADJUSTMENT + | :BALANCE_OR_FUNDING + | :DERECOGNITION + | :DISPUTE + | :FEE + | :INTERNAL + | :REWARD + | :PROGRAM_FUNDING + | :TRANSFER + + module Category + extend Lithic::Internal::Type::Enum + + ADJUSTMENT: :ADJUSTMENT + BALANCE_OR_FUNDING: :BALANCE_OR_FUNDING + DERECOGNITION: :DERECOGNITION + DISPUTE: :DISPUTE + FEE: :FEE + INTERNAL: :INTERNAL + REWARD: :REWARD + PROGRAM_FUNDING: :PROGRAM_FUNDING + TRANSFER: :TRANSFER + + def self?.values: -> ::Array[Lithic::Models::BookTransferCreateParams::category] + end + + type type_ = + :ATM_BALANCE_INQUIRY + | :ATM_WITHDRAWAL + | :ATM_DECLINE + | :INTERNATIONAL_ATM_WITHDRAWAL + | :INACTIVITY + | :STATEMENT + | :MONTHLY + | :QUARTERLY + | :ANNUAL + | :CUSTOMER_SERVICE + | :ACCOUNT_MAINTENANCE + | :ACCOUNT_ACTIVATION + | :ACCOUNT_CLOSURE + | :CARD_REPLACEMENT + | :CARD_DELIVERY + | :CARD_CREATE + | :CURRENCY_CONVERSION + | :INTEREST + | :LATE_PAYMENT + | :BILL_PAYMENT + | :CASH_BACK + | :ACCOUNT_TO_ACCOUNT + | :CARD_TO_CARD + | :DISBURSE + | :BILLING_ERROR + | :LOSS_WRITE_OFF + | :EXPIRED_CARD + | :EARLY_DERECOGNITION + | :ESCHEATMENT + | :INACTIVITY_FEE_DOWN + | :PROVISIONAL_CREDIT + | :DISPUTE_WON + | :SERVICE + | :TRANSFER + | :COLLECTION + + module Type + extend Lithic::Internal::Type::Enum + + ATM_BALANCE_INQUIRY: :ATM_BALANCE_INQUIRY + ATM_WITHDRAWAL: :ATM_WITHDRAWAL + ATM_DECLINE: :ATM_DECLINE + INTERNATIONAL_ATM_WITHDRAWAL: :INTERNATIONAL_ATM_WITHDRAWAL + INACTIVITY: :INACTIVITY + STATEMENT: :STATEMENT + MONTHLY: :MONTHLY + QUARTERLY: :QUARTERLY + ANNUAL: :ANNUAL + CUSTOMER_SERVICE: :CUSTOMER_SERVICE + ACCOUNT_MAINTENANCE: :ACCOUNT_MAINTENANCE + ACCOUNT_ACTIVATION: :ACCOUNT_ACTIVATION + ACCOUNT_CLOSURE: :ACCOUNT_CLOSURE + CARD_REPLACEMENT: :CARD_REPLACEMENT + CARD_DELIVERY: :CARD_DELIVERY + CARD_CREATE: :CARD_CREATE + CURRENCY_CONVERSION: :CURRENCY_CONVERSION + INTEREST: :INTEREST + LATE_PAYMENT: :LATE_PAYMENT + BILL_PAYMENT: :BILL_PAYMENT + CASH_BACK: :CASH_BACK + ACCOUNT_TO_ACCOUNT: :ACCOUNT_TO_ACCOUNT + CARD_TO_CARD: :CARD_TO_CARD + DISBURSE: :DISBURSE + BILLING_ERROR: :BILLING_ERROR + LOSS_WRITE_OFF: :LOSS_WRITE_OFF + EXPIRED_CARD: :EXPIRED_CARD + EARLY_DERECOGNITION: :EARLY_DERECOGNITION + ESCHEATMENT: :ESCHEATMENT + INACTIVITY_FEE_DOWN: :INACTIVITY_FEE_DOWN + PROVISIONAL_CREDIT: :PROVISIONAL_CREDIT + DISPUTE_WON: :DISPUTE_WON + SERVICE: :SERVICE + TRANSFER: :TRANSFER + COLLECTION: :COLLECTION + + def self?.values: -> ::Array[Lithic::Models::BookTransferCreateParams::type_] + end + + type on_closed_account = :FAIL | :USE_SUSPENSE + + module OnClosedAccount + extend Lithic::Internal::Type::Enum + + FAIL: :FAIL + USE_SUSPENSE: :USE_SUSPENSE + + def self?.values: -> ::Array[Lithic::Models::BookTransferCreateParams::on_closed_account] + end + end + end +end diff --git a/sig/lithic/models/book_transfer_list_params.rbs b/sig/lithic/models/book_transfer_list_params.rbs new file mode 100644 index 00000000..c1ffc309 --- /dev/null +++ b/sig/lithic/models/book_transfer_list_params.rbs @@ -0,0 +1,153 @@ +module Lithic + module Models + type book_transfer_list_params = + { + account_token: String, + begin_: Time, + business_account_token: String, + category: Lithic::Models::BookTransferListParams::category, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::Models::BookTransferListParams::result, + starting_after: String, + status: Lithic::Models::BookTransferListParams::status + } + & Lithic::Internal::Type::request_parameters + + class BookTransferListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader business_account_token: String? + + def business_account_token=: (String) -> String + + attr_reader category: Lithic::Models::BookTransferListParams::category? + + def category=: ( + Lithic::Models::BookTransferListParams::category + ) -> Lithic::Models::BookTransferListParams::category + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader financial_account_token: String? + + def financial_account_token=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader result: Lithic::Models::BookTransferListParams::result? + + def result=: ( + Lithic::Models::BookTransferListParams::result + ) -> Lithic::Models::BookTransferListParams::result + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader status: Lithic::Models::BookTransferListParams::status? + + def status=: ( + Lithic::Models::BookTransferListParams::status + ) -> Lithic::Models::BookTransferListParams::status + + def initialize: ( + ?account_token: String, + ?begin_: Time, + ?business_account_token: String, + ?category: Lithic::Models::BookTransferListParams::category, + ?end_: Time, + ?ending_before: String, + ?financial_account_token: String, + ?page_size: Integer, + ?result: Lithic::Models::BookTransferListParams::result, + ?starting_after: String, + ?status: Lithic::Models::BookTransferListParams::status, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + account_token: String, + begin_: Time, + business_account_token: String, + category: Lithic::Models::BookTransferListParams::category, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::Models::BookTransferListParams::result, + starting_after: String, + status: Lithic::Models::BookTransferListParams::status, + request_options: Lithic::RequestOptions + } + + type category = + :ADJUSTMENT + | :BALANCE_OR_FUNDING + | :DERECOGNITION + | :DISPUTE + | :FEE + | :INTERNAL + | :REWARD + | :PROGRAM_FUNDING + | :TRANSFER + + module Category + extend Lithic::Internal::Type::Enum + + ADJUSTMENT: :ADJUSTMENT + BALANCE_OR_FUNDING: :BALANCE_OR_FUNDING + DERECOGNITION: :DERECOGNITION + DISPUTE: :DISPUTE + FEE: :FEE + INTERNAL: :INTERNAL + REWARD: :REWARD + PROGRAM_FUNDING: :PROGRAM_FUNDING + TRANSFER: :TRANSFER + + def self?.values: -> ::Array[Lithic::Models::BookTransferListParams::category] + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::BookTransferListParams::result] + end + + type status = :DECLINED | :SETTLED + + module Status + extend Lithic::Internal::Type::Enum + + DECLINED: :DECLINED + SETTLED: :SETTLED + + def self?.values: -> ::Array[Lithic::Models::BookTransferListParams::status] + end + end + end +end diff --git a/sig/lithic/models/book_transfer_response.rbs b/sig/lithic/models/book_transfer_response.rbs new file mode 100644 index 00000000..760bcd97 --- /dev/null +++ b/sig/lithic/models/book_transfer_response.rbs @@ -0,0 +1,329 @@ +module Lithic + module Models + type book_transfer_response = + { + token: String, + category: Lithic::Models::BookTransferResponse::category, + created: Time, + currency: String, + events: ::Array[Lithic::BookTransferResponse::Event], + family: :TRANSFER, + from_financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::BookTransferResponse::result, + settled_amount: Integer, + status: Lithic::Models::BookTransferResponse::status, + to_financial_account_token: String, + updated: Time, + external_id: String?, + external_resource: Lithic::ExternalResource?, + transaction_series: Lithic::BookTransferResponse::TransactionSeries? + } + + class BookTransferResponse < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor category: Lithic::Models::BookTransferResponse::category + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor events: ::Array[Lithic::BookTransferResponse::Event] + + attr_accessor family: :TRANSFER + + attr_accessor from_financial_account_token: String + + attr_accessor pending_amount: Integer + + attr_accessor result: Lithic::Models::BookTransferResponse::result + + attr_accessor settled_amount: Integer + + attr_accessor status: Lithic::Models::BookTransferResponse::status + + attr_accessor to_financial_account_token: String + + attr_accessor updated: Time + + attr_accessor external_id: String? + + attr_accessor external_resource: Lithic::ExternalResource? + + attr_accessor transaction_series: Lithic::BookTransferResponse::TransactionSeries? + + def initialize: ( + token: String, + category: Lithic::Models::BookTransferResponse::category, + created: Time, + currency: String, + events: ::Array[Lithic::BookTransferResponse::Event], + from_financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::BookTransferResponse::result, + settled_amount: Integer, + status: Lithic::Models::BookTransferResponse::status, + to_financial_account_token: String, + updated: Time, + ?external_id: String?, + ?external_resource: Lithic::ExternalResource?, + ?transaction_series: Lithic::BookTransferResponse::TransactionSeries?, + ?family: :TRANSFER + ) -> void + + def to_hash: -> { + token: String, + category: Lithic::Models::BookTransferResponse::category, + created: Time, + currency: String, + events: ::Array[Lithic::BookTransferResponse::Event], + family: :TRANSFER, + from_financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::BookTransferResponse::result, + settled_amount: Integer, + status: Lithic::Models::BookTransferResponse::status, + to_financial_account_token: String, + updated: Time, + external_id: String?, + external_resource: Lithic::ExternalResource?, + transaction_series: Lithic::BookTransferResponse::TransactionSeries? + } + + type category = + :ADJUSTMENT + | :BALANCE_OR_FUNDING + | :DERECOGNITION + | :DISPUTE + | :FEE + | :INTERNAL + | :REWARD + | :PROGRAM_FUNDING + | :TRANSFER + + module Category + extend Lithic::Internal::Type::Enum + + ADJUSTMENT: :ADJUSTMENT + BALANCE_OR_FUNDING: :BALANCE_OR_FUNDING + DERECOGNITION: :DERECOGNITION + DISPUTE: :DISPUTE + FEE: :FEE + INTERNAL: :INTERNAL + REWARD: :REWARD + PROGRAM_FUNDING: :PROGRAM_FUNDING + TRANSFER: :TRANSFER + + def self?.values: -> ::Array[Lithic::Models::BookTransferResponse::category] + end + + type event = + { + token: String, + amount: Integer, + created: Time, + detailed_results: ::Array[Lithic::Models::BookTransferResponse::Event::detailed_result], + memo: String, + result: Lithic::Models::BookTransferResponse::Event::result, + subtype: String, + type: Lithic::Models::BookTransferResponse::Event::type_ + } + + class Event < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor amount: Integer + + attr_accessor created: Time + + attr_accessor detailed_results: ::Array[Lithic::Models::BookTransferResponse::Event::detailed_result] + + attr_accessor memo: String + + attr_accessor result: Lithic::Models::BookTransferResponse::Event::result + + attr_accessor subtype: String + + attr_accessor type: Lithic::Models::BookTransferResponse::Event::type_ + + def initialize: ( + token: String, + amount: Integer, + created: Time, + detailed_results: ::Array[Lithic::Models::BookTransferResponse::Event::detailed_result], + memo: String, + result: Lithic::Models::BookTransferResponse::Event::result, + subtype: String, + type: Lithic::Models::BookTransferResponse::Event::type_ + ) -> void + + def to_hash: -> { + token: String, + amount: Integer, + created: Time, + detailed_results: ::Array[Lithic::Models::BookTransferResponse::Event::detailed_result], + memo: String, + result: Lithic::Models::BookTransferResponse::Event::result, + subtype: String, + type: Lithic::Models::BookTransferResponse::Event::type_ + } + + type detailed_result = :APPROVED | :FUNDS_INSUFFICIENT + + module DetailedResult + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + FUNDS_INSUFFICIENT: :FUNDS_INSUFFICIENT + + def self?.values: -> ::Array[Lithic::Models::BookTransferResponse::Event::detailed_result] + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::BookTransferResponse::Event::result] + end + + type type_ = + :ATM_BALANCE_INQUIRY + | :ATM_WITHDRAWAL + | :ATM_DECLINE + | :INTERNATIONAL_ATM_WITHDRAWAL + | :INACTIVITY + | :STATEMENT + | :MONTHLY + | :QUARTERLY + | :ANNUAL + | :CUSTOMER_SERVICE + | :ACCOUNT_MAINTENANCE + | :ACCOUNT_ACTIVATION + | :ACCOUNT_CLOSURE + | :CARD_REPLACEMENT + | :CARD_DELIVERY + | :CARD_CREATE + | :CURRENCY_CONVERSION + | :INTEREST + | :LATE_PAYMENT + | :BILL_PAYMENT + | :CASH_BACK + | :ACCOUNT_TO_ACCOUNT + | :CARD_TO_CARD + | :DISBURSE + | :BILLING_ERROR + | :LOSS_WRITE_OFF + | :EXPIRED_CARD + | :EARLY_DERECOGNITION + | :ESCHEATMENT + | :INACTIVITY_FEE_DOWN + | :PROVISIONAL_CREDIT + | :DISPUTE_WON + | :SERVICE + | :TRANSFER + | :COLLECTION + + module Type + extend Lithic::Internal::Type::Enum + + ATM_BALANCE_INQUIRY: :ATM_BALANCE_INQUIRY + ATM_WITHDRAWAL: :ATM_WITHDRAWAL + ATM_DECLINE: :ATM_DECLINE + INTERNATIONAL_ATM_WITHDRAWAL: :INTERNATIONAL_ATM_WITHDRAWAL + INACTIVITY: :INACTIVITY + STATEMENT: :STATEMENT + MONTHLY: :MONTHLY + QUARTERLY: :QUARTERLY + ANNUAL: :ANNUAL + CUSTOMER_SERVICE: :CUSTOMER_SERVICE + ACCOUNT_MAINTENANCE: :ACCOUNT_MAINTENANCE + ACCOUNT_ACTIVATION: :ACCOUNT_ACTIVATION + ACCOUNT_CLOSURE: :ACCOUNT_CLOSURE + CARD_REPLACEMENT: :CARD_REPLACEMENT + CARD_DELIVERY: :CARD_DELIVERY + CARD_CREATE: :CARD_CREATE + CURRENCY_CONVERSION: :CURRENCY_CONVERSION + INTEREST: :INTEREST + LATE_PAYMENT: :LATE_PAYMENT + BILL_PAYMENT: :BILL_PAYMENT + CASH_BACK: :CASH_BACK + ACCOUNT_TO_ACCOUNT: :ACCOUNT_TO_ACCOUNT + CARD_TO_CARD: :CARD_TO_CARD + DISBURSE: :DISBURSE + BILLING_ERROR: :BILLING_ERROR + LOSS_WRITE_OFF: :LOSS_WRITE_OFF + EXPIRED_CARD: :EXPIRED_CARD + EARLY_DERECOGNITION: :EARLY_DERECOGNITION + ESCHEATMENT: :ESCHEATMENT + INACTIVITY_FEE_DOWN: :INACTIVITY_FEE_DOWN + PROVISIONAL_CREDIT: :PROVISIONAL_CREDIT + DISPUTE_WON: :DISPUTE_WON + SERVICE: :SERVICE + TRANSFER: :TRANSFER + COLLECTION: :COLLECTION + + def self?.values: -> ::Array[Lithic::Models::BookTransferResponse::Event::type_] + end + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::BookTransferResponse::result] + end + + type status = + :PENDING | :SETTLED | :DECLINED | :REVERSED | :CANCELED | :RETURNED + + module Status + extend Lithic::Internal::Type::Enum + + PENDING: :PENDING + SETTLED: :SETTLED + DECLINED: :DECLINED + REVERSED: :REVERSED + CANCELED: :CANCELED + RETURNED: :RETURNED + + def self?.values: -> ::Array[Lithic::Models::BookTransferResponse::status] + end + + type transaction_series = + { + related_transaction_event_token: String?, + related_transaction_token: String?, + type: String + } + + class TransactionSeries < Lithic::Internal::Type::BaseModel + attr_accessor related_transaction_event_token: String? + + attr_accessor related_transaction_token: String? + + attr_accessor type: String + + def initialize: ( + related_transaction_event_token: String?, + related_transaction_token: String?, + type: String + ) -> void + + def to_hash: -> { + related_transaction_event_token: String?, + related_transaction_token: String?, + type: String + } + end + end + end +end diff --git a/sig/lithic/models/book_transfer_retrieve_params.rbs b/sig/lithic/models/book_transfer_retrieve_params.rbs new file mode 100644 index 00000000..941bb938 --- /dev/null +++ b/sig/lithic/models/book_transfer_retrieve_params.rbs @@ -0,0 +1,24 @@ +module Lithic + module Models + type book_transfer_retrieve_params = + { book_transfer_token: String } + & Lithic::Internal::Type::request_parameters + + class BookTransferRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor book_transfer_token: String + + def initialize: ( + book_transfer_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + book_transfer_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/book_transfer_retry_params.rbs b/sig/lithic/models/book_transfer_retry_params.rbs new file mode 100644 index 00000000..4491e1ab --- /dev/null +++ b/sig/lithic/models/book_transfer_retry_params.rbs @@ -0,0 +1,28 @@ +module Lithic + module Models + type book_transfer_retry_params = + { book_transfer_token: String, retry_token: String } + & Lithic::Internal::Type::request_parameters + + class BookTransferRetryParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor book_transfer_token: String + + attr_accessor retry_token: String + + def initialize: ( + book_transfer_token: String, + retry_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + book_transfer_token: String, + retry_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/book_transfer_reverse_params.rbs b/sig/lithic/models/book_transfer_reverse_params.rbs new file mode 100644 index 00000000..11294ab7 --- /dev/null +++ b/sig/lithic/models/book_transfer_reverse_params.rbs @@ -0,0 +1,30 @@ +module Lithic + module Models + type book_transfer_reverse_params = + { book_transfer_token: String, memo: String } + & Lithic::Internal::Type::request_parameters + + class BookTransferReverseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor book_transfer_token: String + + attr_reader memo: String? + + def memo=: (String) -> String + + def initialize: ( + book_transfer_token: String, + ?memo: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + book_transfer_token: String, + memo: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/book_transfer_transaction_created_webhook_event.rbs b/sig/lithic/models/book_transfer_transaction_created_webhook_event.rbs new file mode 100644 index 00000000..064be529 --- /dev/null +++ b/sig/lithic/models/book_transfer_transaction_created_webhook_event.rbs @@ -0,0 +1,20 @@ +module Lithic + module Models + type book_transfer_transaction_created_webhook_event = + { event_type: :"book_transfer_transaction.created" } + + class BookTransferTransactionCreatedWebhookEvent < Lithic::Models::BookTransferResponse + def event_type: -> :"book_transfer_transaction.created" + + def event_type=: ( + :"book_transfer_transaction.created" _ + ) -> :"book_transfer_transaction.created" + + def initialize: ( + ?event_type: :"book_transfer_transaction.created" + ) -> void + + def to_hash: -> { event_type: :"book_transfer_transaction.created" } + end + end +end diff --git a/sig/lithic/models/book_transfer_transaction_updated_webhook_event.rbs b/sig/lithic/models/book_transfer_transaction_updated_webhook_event.rbs new file mode 100644 index 00000000..40577f02 --- /dev/null +++ b/sig/lithic/models/book_transfer_transaction_updated_webhook_event.rbs @@ -0,0 +1,20 @@ +module Lithic + module Models + type book_transfer_transaction_updated_webhook_event = + { event_type: :"book_transfer_transaction.updated" } + + class BookTransferTransactionUpdatedWebhookEvent < Lithic::Models::BookTransferResponse + def event_type: -> :"book_transfer_transaction.updated" + + def event_type=: ( + :"book_transfer_transaction.updated" _ + ) -> :"book_transfer_transaction.updated" + + def initialize: ( + ?event_type: :"book_transfer_transaction.updated" + ) -> void + + def to_hash: -> { event_type: :"book_transfer_transaction.updated" } + end + end +end diff --git a/sig/lithic/models/card.rbs b/sig/lithic/models/card.rbs new file mode 100644 index 00000000..bec3fba6 --- /dev/null +++ b/sig/lithic/models/card.rbs @@ -0,0 +1,19 @@ +module Lithic + module Models + type card = { cvv: String, pan: String } + + class Card < Lithic::Models::NonPCICard + def cvv: -> String? + + def cvv=: (String _) -> String + + def pan: -> String? + + def pan=: (String _) -> String + + def initialize: (?cvv: String, ?pan: String) -> void + + def to_hash: -> { cvv: String, pan: String } + end + end +end diff --git a/sig/lithic/models/card_authorization.rbs b/sig/lithic/models/card_authorization.rbs new file mode 100644 index 00000000..3e3653d1 --- /dev/null +++ b/sig/lithic/models/card_authorization.rbs @@ -0,0 +1,1112 @@ +module Lithic + module Models + type card_authorization = + { + token: String, + acquirer_fee: Integer, + amount: Integer, + amounts: Lithic::CardAuthorization::Amounts, + authorization_amount: Integer, + avs: Lithic::CardAuthorization::Avs, + card: Lithic::CardAuthorization::Card, + cardholder_currency: String, + cash_amount: Integer, + created: Time, + merchant: Lithic::CardAuthorization::Merchant, + merchant_amount: Integer, + merchant_currency: String, + name_validation: Lithic::CardAuthorization::NameValidation?, + service_location: Lithic::CardAuthorization::ServiceLocation?, + settled_amount: Integer, + status: Lithic::Models::CardAuthorization::status, + transaction_initiator: Lithic::Models::CardAuthorization::transaction_initiator, + account_type: Lithic::Models::CardAuthorization::account_type, + cardholder_authentication: Lithic::CardholderAuthentication, + cashback: Integer, + conversion_rate: Float, + event_token: String, + fleet_info: Lithic::CardAuthorization::FleetInfo?, + latest_challenge: Lithic::CardAuthorization::LatestChallenge, + network: Lithic::Models::CardAuthorization::network, + network_risk_score: Integer?, + network_specific_data: Lithic::CardAuthorization::NetworkSpecificData?, + pos: Lithic::CardAuthorization::Pos, + token_info: Lithic::TokenInfo?, + ttl: Time + } + + class CardAuthorization < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor acquirer_fee: Integer + + attr_accessor amount: Integer + + attr_accessor amounts: Lithic::CardAuthorization::Amounts + + attr_accessor authorization_amount: Integer + + attr_accessor avs: Lithic::CardAuthorization::Avs + + attr_accessor card: Lithic::CardAuthorization::Card + + attr_accessor cardholder_currency: String + + attr_accessor cash_amount: Integer + + attr_accessor created: Time + + attr_accessor merchant: Lithic::CardAuthorization::Merchant + + attr_accessor merchant_amount: Integer + + attr_accessor merchant_currency: String + + attr_accessor name_validation: Lithic::CardAuthorization::NameValidation? + + attr_accessor service_location: Lithic::CardAuthorization::ServiceLocation? + + attr_accessor settled_amount: Integer + + attr_accessor status: Lithic::Models::CardAuthorization::status + + attr_accessor transaction_initiator: Lithic::Models::CardAuthorization::transaction_initiator + + attr_reader account_type: Lithic::Models::CardAuthorization::account_type? + + def account_type=: ( + Lithic::Models::CardAuthorization::account_type + ) -> Lithic::Models::CardAuthorization::account_type + + attr_reader cardholder_authentication: Lithic::CardholderAuthentication? + + def cardholder_authentication=: ( + Lithic::CardholderAuthentication + ) -> Lithic::CardholderAuthentication + + attr_reader cashback: Integer? + + def cashback=: (Integer) -> Integer + + attr_reader conversion_rate: Float? + + def conversion_rate=: (Float) -> Float + + attr_reader event_token: String? + + def event_token=: (String) -> String + + attr_accessor fleet_info: Lithic::CardAuthorization::FleetInfo? + + attr_reader latest_challenge: Lithic::CardAuthorization::LatestChallenge? + + def latest_challenge=: ( + Lithic::CardAuthorization::LatestChallenge + ) -> Lithic::CardAuthorization::LatestChallenge + + attr_reader network: Lithic::Models::CardAuthorization::network? + + def network=: ( + Lithic::Models::CardAuthorization::network + ) -> Lithic::Models::CardAuthorization::network + + attr_accessor network_risk_score: Integer? + + attr_accessor network_specific_data: Lithic::CardAuthorization::NetworkSpecificData? + + attr_reader pos: Lithic::CardAuthorization::Pos? + + def pos=: ( + Lithic::CardAuthorization::Pos + ) -> Lithic::CardAuthorization::Pos + + attr_accessor token_info: Lithic::TokenInfo? + + attr_reader ttl: Time? + + def ttl=: (Time) -> Time + + def initialize: ( + token: String, + acquirer_fee: Integer, + amount: Integer, + amounts: Lithic::CardAuthorization::Amounts, + authorization_amount: Integer, + avs: Lithic::CardAuthorization::Avs, + card: Lithic::CardAuthorization::Card, + cardholder_currency: String, + cash_amount: Integer, + created: Time, + merchant: Lithic::CardAuthorization::Merchant, + merchant_amount: Integer, + merchant_currency: String, + name_validation: Lithic::CardAuthorization::NameValidation?, + service_location: Lithic::CardAuthorization::ServiceLocation?, + settled_amount: Integer, + status: Lithic::Models::CardAuthorization::status, + transaction_initiator: Lithic::Models::CardAuthorization::transaction_initiator, + ?account_type: Lithic::Models::CardAuthorization::account_type, + ?cardholder_authentication: Lithic::CardholderAuthentication, + ?cashback: Integer, + ?conversion_rate: Float, + ?event_token: String, + ?fleet_info: Lithic::CardAuthorization::FleetInfo?, + ?latest_challenge: Lithic::CardAuthorization::LatestChallenge, + ?network: Lithic::Models::CardAuthorization::network, + ?network_risk_score: Integer?, + ?network_specific_data: Lithic::CardAuthorization::NetworkSpecificData?, + ?pos: Lithic::CardAuthorization::Pos, + ?token_info: Lithic::TokenInfo?, + ?ttl: Time + ) -> void + + def to_hash: -> { + token: String, + acquirer_fee: Integer, + amount: Integer, + amounts: Lithic::CardAuthorization::Amounts, + authorization_amount: Integer, + avs: Lithic::CardAuthorization::Avs, + card: Lithic::CardAuthorization::Card, + cardholder_currency: String, + cash_amount: Integer, + created: Time, + merchant: Lithic::CardAuthorization::Merchant, + merchant_amount: Integer, + merchant_currency: String, + name_validation: Lithic::CardAuthorization::NameValidation?, + service_location: Lithic::CardAuthorization::ServiceLocation?, + settled_amount: Integer, + status: Lithic::Models::CardAuthorization::status, + transaction_initiator: Lithic::Models::CardAuthorization::transaction_initiator, + account_type: Lithic::Models::CardAuthorization::account_type, + cardholder_authentication: Lithic::CardholderAuthentication, + cashback: Integer, + conversion_rate: Float, + event_token: String, + fleet_info: Lithic::CardAuthorization::FleetInfo?, + latest_challenge: Lithic::CardAuthorization::LatestChallenge, + network: Lithic::Models::CardAuthorization::network, + network_risk_score: Integer?, + network_specific_data: Lithic::CardAuthorization::NetworkSpecificData?, + pos: Lithic::CardAuthorization::Pos, + token_info: Lithic::TokenInfo?, + ttl: Time + } + + type amounts = + { + cardholder: Lithic::CardAuthorization::Amounts::Cardholder, + hold: Lithic::CardAuthorization::Amounts::Hold?, + merchant: Lithic::CardAuthorization::Amounts::Merchant, + settlement: Lithic::CardAuthorization::Amounts::Settlement? + } + + class Amounts < Lithic::Internal::Type::BaseModel + attr_accessor cardholder: Lithic::CardAuthorization::Amounts::Cardholder + + attr_accessor hold: Lithic::CardAuthorization::Amounts::Hold? + + attr_accessor merchant: Lithic::CardAuthorization::Amounts::Merchant + + attr_accessor settlement: Lithic::CardAuthorization::Amounts::Settlement? + + def initialize: ( + cardholder: Lithic::CardAuthorization::Amounts::Cardholder, + hold: Lithic::CardAuthorization::Amounts::Hold?, + merchant: Lithic::CardAuthorization::Amounts::Merchant, + settlement: Lithic::CardAuthorization::Amounts::Settlement? + ) -> void + + def to_hash: -> { + cardholder: Lithic::CardAuthorization::Amounts::Cardholder, + hold: Lithic::CardAuthorization::Amounts::Hold?, + merchant: Lithic::CardAuthorization::Amounts::Merchant, + settlement: Lithic::CardAuthorization::Amounts::Settlement? + } + + type cardholder = + { amount: Integer, conversion_rate: String, currency: String } + + class Cardholder < Lithic::Internal::Type::BaseModel + attr_accessor amount: Integer + + attr_accessor conversion_rate: String + + attr_accessor currency: String + + def initialize: ( + amount: Integer, + conversion_rate: String, + currency: String + ) -> void + + def to_hash: -> { + amount: Integer, + conversion_rate: String, + currency: String + } + end + + type hold = { amount: Integer, currency: String } + + class Hold < Lithic::Internal::Type::BaseModel + attr_accessor amount: Integer + + attr_accessor currency: String + + def initialize: (amount: Integer, currency: String) -> void + + def to_hash: -> { amount: Integer, currency: String } + end + + type merchant = { amount: Integer, currency: String } + + class Merchant < Lithic::Internal::Type::BaseModel + attr_accessor amount: Integer + + attr_accessor currency: String + + def initialize: (amount: Integer, currency: String) -> void + + def to_hash: -> { amount: Integer, currency: String } + end + + type settlement = { amount: Integer, currency: String } + + class Settlement < Lithic::Internal::Type::BaseModel + attr_accessor amount: Integer + + attr_accessor currency: String + + def initialize: (amount: Integer, currency: String) -> void + + def to_hash: -> { amount: Integer, currency: String } + end + end + + type avs = + { + address: String, + address_on_file_match: Lithic::Models::CardAuthorization::Avs::address_on_file_match, + zipcode: String + } + + class Avs < Lithic::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor address_on_file_match: Lithic::Models::CardAuthorization::Avs::address_on_file_match + + attr_accessor zipcode: String + + def initialize: ( + address: String, + address_on_file_match: Lithic::Models::CardAuthorization::Avs::address_on_file_match, + zipcode: String + ) -> void + + def to_hash: -> { + address: String, + address_on_file_match: Lithic::Models::CardAuthorization::Avs::address_on_file_match, + zipcode: String + } + + type address_on_file_match = + :MATCH + | :MATCH_ADDRESS_ONLY + | :MATCH_ZIP_ONLY + | :MISMATCH + | :NOT_PRESENT + + module AddressOnFileMatch + extend Lithic::Internal::Type::Enum + + MATCH: :MATCH + MATCH_ADDRESS_ONLY: :MATCH_ADDRESS_ONLY + MATCH_ZIP_ONLY: :MATCH_ZIP_ONLY + MISMATCH: :MISMATCH + NOT_PRESENT: :NOT_PRESENT + + def self?.values: -> ::Array[Lithic::Models::CardAuthorization::Avs::address_on_file_match] + end + end + + type card = + { + token: String, + last_four: String, + memo: String, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::CardAuthorization::Card::spend_limit_duration, + state: Lithic::Models::CardAuthorization::Card::state, + type: Lithic::Models::CardAuthorization::Card::type_ + } + + class Card < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor last_four: String + + attr_accessor memo: String + + attr_accessor spend_limit: Integer + + attr_accessor spend_limit_duration: Lithic::Models::CardAuthorization::Card::spend_limit_duration + + attr_accessor state: Lithic::Models::CardAuthorization::Card::state + + attr_accessor type: Lithic::Models::CardAuthorization::Card::type_ + + def initialize: ( + token: String, + last_four: String, + memo: String, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::CardAuthorization::Card::spend_limit_duration, + state: Lithic::Models::CardAuthorization::Card::state, + type: Lithic::Models::CardAuthorization::Card::type_ + ) -> void + + def to_hash: -> { + token: String, + last_four: String, + memo: String, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::CardAuthorization::Card::spend_limit_duration, + state: Lithic::Models::CardAuthorization::Card::state, + type: Lithic::Models::CardAuthorization::Card::type_ + } + + type spend_limit_duration = + :ANNUALLY | :FOREVER | :MONTHLY | :TRANSACTION + + module SpendLimitDuration + extend Lithic::Internal::Type::Enum + + ANNUALLY: :ANNUALLY + FOREVER: :FOREVER + MONTHLY: :MONTHLY + TRANSACTION: :TRANSACTION + + def self?.values: -> ::Array[Lithic::Models::CardAuthorization::Card::spend_limit_duration] + end + + type state = + :CLOSED | :OPEN | :PAUSED | :PENDING_ACTIVATION | :PENDING_FULFILLMENT + + module State + extend Lithic::Internal::Type::Enum + + CLOSED: :CLOSED + OPEN: :OPEN + PAUSED: :PAUSED + PENDING_ACTIVATION: :PENDING_ACTIVATION + PENDING_FULFILLMENT: :PENDING_FULFILLMENT + + def self?.values: -> ::Array[Lithic::Models::CardAuthorization::Card::state] + end + + type type_ = + :SINGLE_USE + | :MERCHANT_LOCKED + | :UNLOCKED + | :PHYSICAL + | :DIGITAL_WALLET + | :VIRTUAL + + module Type + extend Lithic::Internal::Type::Enum + + SINGLE_USE: :SINGLE_USE + MERCHANT_LOCKED: :MERCHANT_LOCKED + UNLOCKED: :UNLOCKED + PHYSICAL: :PHYSICAL + DIGITAL_WALLET: :DIGITAL_WALLET + VIRTUAL: :VIRTUAL + + def self?.values: -> ::Array[Lithic::Models::CardAuthorization::Card::type_] + end + end + + type merchant = + { phone_number: String?, postal_code: String?, street_address: String? } + + class Merchant < Lithic::Models::Merchant + def phone_number: -> String? + + def phone_number=: (String? _) -> String? + + def postal_code: -> String? + + def postal_code=: (String? _) -> String? + + def street_address: -> String? + + def street_address=: (String? _) -> String? + + def initialize: ( + phone_number: String?, + postal_code: String?, + street_address: String? + ) -> void + + def to_hash: -> { + phone_number: String?, + postal_code: String?, + street_address: String? + } + end + + type name_validation = + { + name: Lithic::CardAuthorization::NameValidation::Name, + name_on_file_match: Lithic::CardAuthorization::NameValidation::NameOnFileMatch + } + + class NameValidation < Lithic::Internal::Type::BaseModel + attr_accessor name: Lithic::CardAuthorization::NameValidation::Name + + attr_accessor name_on_file_match: Lithic::CardAuthorization::NameValidation::NameOnFileMatch + + def initialize: ( + name: Lithic::CardAuthorization::NameValidation::Name, + name_on_file_match: Lithic::CardAuthorization::NameValidation::NameOnFileMatch + ) -> void + + def to_hash: -> { + name: Lithic::CardAuthorization::NameValidation::Name, + name_on_file_match: Lithic::CardAuthorization::NameValidation::NameOnFileMatch + } + + type name_ = { first: String, last: String, middle: String? } + + class Name < Lithic::Internal::Type::BaseModel + attr_accessor first: String + + attr_accessor last: String + + attr_accessor middle: String? + + def initialize: (first: String, last: String, middle: String?) -> void + + def to_hash: -> { first: String, last: String, middle: String? } + end + + type name_on_file_match = + { + full_name: Lithic::Models::CardAuthorization::NameValidation::NameOnFileMatch::full_name + } + + class NameOnFileMatch < Lithic::Internal::Type::BaseModel + attr_accessor full_name: Lithic::Models::CardAuthorization::NameValidation::NameOnFileMatch::full_name + + def initialize: ( + full_name: Lithic::Models::CardAuthorization::NameValidation::NameOnFileMatch::full_name + ) -> void + + def to_hash: -> { + full_name: Lithic::Models::CardAuthorization::NameValidation::NameOnFileMatch::full_name + } + + type full_name = :MATCH | :PARTIAL_MATCH | :NO_MATCH | :UNVERIFIED + + module FullName + extend Lithic::Internal::Type::Enum + + MATCH: :MATCH + PARTIAL_MATCH: :PARTIAL_MATCH + NO_MATCH: :NO_MATCH + UNVERIFIED: :UNVERIFIED + + def self?.values: -> ::Array[Lithic::Models::CardAuthorization::NameValidation::NameOnFileMatch::full_name] + end + end + end + + type service_location = + { + city: String?, + country: String?, + postal_code: String?, + state: String?, + street_address: String? + } + + class ServiceLocation < Lithic::Internal::Type::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + attr_accessor street_address: String? + + def initialize: ( + city: String?, + country: String?, + postal_code: String?, + state: String?, + street_address: String? + ) -> void + + def to_hash: -> { + city: String?, + country: String?, + postal_code: String?, + state: String?, + street_address: String? + } + end + + type status = + :AUTHORIZATION + | :CREDIT_AUTHORIZATION + | :FINANCIAL_AUTHORIZATION + | :FINANCIAL_CREDIT_AUTHORIZATION + | :BALANCE_INQUIRY + + module Status + extend Lithic::Internal::Type::Enum + + AUTHORIZATION: :AUTHORIZATION + CREDIT_AUTHORIZATION: :CREDIT_AUTHORIZATION + FINANCIAL_AUTHORIZATION: :FINANCIAL_AUTHORIZATION + FINANCIAL_CREDIT_AUTHORIZATION: :FINANCIAL_CREDIT_AUTHORIZATION + BALANCE_INQUIRY: :BALANCE_INQUIRY + + def self?.values: -> ::Array[Lithic::Models::CardAuthorization::status] + end + + type transaction_initiator = :CARDHOLDER | :MERCHANT | :UNKNOWN + + module TransactionInitiator + extend Lithic::Internal::Type::Enum + + CARDHOLDER: :CARDHOLDER + MERCHANT: :MERCHANT + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::CardAuthorization::transaction_initiator] + end + + type account_type = :CHECKING | :SAVINGS + + module AccountType + extend Lithic::Internal::Type::Enum + + CHECKING: :CHECKING + SAVINGS: :SAVINGS + + def self?.values: -> ::Array[Lithic::Models::CardAuthorization::account_type] + end + + type fleet_info = + { + fleet_prompt_code: Lithic::Models::CardAuthorization::FleetInfo::fleet_prompt_code, + fleet_restriction_code: Lithic::Models::CardAuthorization::FleetInfo::fleet_restriction_code, + driver_number: String?, + vehicle_number: String? + } + + class FleetInfo < Lithic::Internal::Type::BaseModel + attr_accessor fleet_prompt_code: Lithic::Models::CardAuthorization::FleetInfo::fleet_prompt_code + + attr_accessor fleet_restriction_code: Lithic::Models::CardAuthorization::FleetInfo::fleet_restriction_code + + attr_accessor driver_number: String? + + attr_accessor vehicle_number: String? + + def initialize: ( + fleet_prompt_code: Lithic::Models::CardAuthorization::FleetInfo::fleet_prompt_code, + fleet_restriction_code: Lithic::Models::CardAuthorization::FleetInfo::fleet_restriction_code, + ?driver_number: String?, + ?vehicle_number: String? + ) -> void + + def to_hash: -> { + fleet_prompt_code: Lithic::Models::CardAuthorization::FleetInfo::fleet_prompt_code, + fleet_restriction_code: Lithic::Models::CardAuthorization::FleetInfo::fleet_restriction_code, + driver_number: String?, + vehicle_number: String? + } + + type fleet_prompt_code = :NO_PROMPT | :VEHICLE_NUMBER | :DRIVER_NUMBER + + module FleetPromptCode + extend Lithic::Internal::Type::Enum + + NO_PROMPT: :NO_PROMPT + VEHICLE_NUMBER: :VEHICLE_NUMBER + DRIVER_NUMBER: :DRIVER_NUMBER + + def self?.values: -> ::Array[Lithic::Models::CardAuthorization::FleetInfo::fleet_prompt_code] + end + + type fleet_restriction_code = :NO_RESTRICTIONS | :FUEL_ONLY + + module FleetRestrictionCode + extend Lithic::Internal::Type::Enum + + NO_RESTRICTIONS: :NO_RESTRICTIONS + FUEL_ONLY: :FUEL_ONLY + + def self?.values: -> ::Array[Lithic::Models::CardAuthorization::FleetInfo::fleet_restriction_code] + end + end + + type latest_challenge = + { + completed_at: Time?, + created: Time, + method_: Lithic::Models::CardAuthorization::LatestChallenge::method_, + phone_number: String?, + status: Lithic::Models::CardAuthorization::LatestChallenge::status + } + + class LatestChallenge < Lithic::Internal::Type::BaseModel + attr_accessor completed_at: Time? + + attr_accessor created: Time + + attr_accessor method_: Lithic::Models::CardAuthorization::LatestChallenge::method_ + + attr_accessor phone_number: String? + + attr_accessor status: Lithic::Models::CardAuthorization::LatestChallenge::status + + def initialize: ( + completed_at: Time?, + created: Time, + method_: Lithic::Models::CardAuthorization::LatestChallenge::method_, + phone_number: String?, + status: Lithic::Models::CardAuthorization::LatestChallenge::status + ) -> void + + def to_hash: -> { + completed_at: Time?, + created: Time, + method_: Lithic::Models::CardAuthorization::LatestChallenge::method_, + phone_number: String?, + status: Lithic::Models::CardAuthorization::LatestChallenge::status + } + + type method_ = :SMS | :OUT_OF_BAND + + module Method + extend Lithic::Internal::Type::Enum + + SMS: :SMS + OUT_OF_BAND: :OUT_OF_BAND + + def self?.values: -> ::Array[Lithic::Models::CardAuthorization::LatestChallenge::method_] + end + + type status = :COMPLETED | :DECLINED | :PENDING | :EXPIRED | :ERROR + + module Status + extend Lithic::Internal::Type::Enum + + COMPLETED: :COMPLETED + DECLINED: :DECLINED + PENDING: :PENDING + EXPIRED: :EXPIRED + ERROR: :ERROR + + def self?.values: -> ::Array[Lithic::Models::CardAuthorization::LatestChallenge::status] + end + end + + type network = + :AMEX | :INTERLINK | :MAESTRO | :MASTERCARD | :UNKNOWN | :VISA + + module Network + extend Lithic::Internal::Type::Enum + + AMEX: :AMEX + INTERLINK: :INTERLINK + MAESTRO: :MAESTRO + MASTERCARD: :MASTERCARD + UNKNOWN: :UNKNOWN + VISA: :VISA + + def self?.values: -> ::Array[Lithic::Models::CardAuthorization::network] + end + + type network_specific_data = + { + mastercard: Lithic::CardAuthorization::NetworkSpecificData::Mastercard?, + visa: Lithic::CardAuthorization::NetworkSpecificData::Visa? + } + + class NetworkSpecificData < Lithic::Internal::Type::BaseModel + attr_accessor mastercard: Lithic::CardAuthorization::NetworkSpecificData::Mastercard? + + attr_accessor visa: Lithic::CardAuthorization::NetworkSpecificData::Visa? + + def initialize: ( + ?mastercard: Lithic::CardAuthorization::NetworkSpecificData::Mastercard?, + ?visa: Lithic::CardAuthorization::NetworkSpecificData::Visa? + ) -> void + + def to_hash: -> { + mastercard: Lithic::CardAuthorization::NetworkSpecificData::Mastercard?, + visa: Lithic::CardAuthorization::NetworkSpecificData::Visa? + } + + type mastercard = + { + ecommerce_security_level_indicator: String?, + on_behalf_service_result: ::Array[Lithic::CardAuthorization::NetworkSpecificData::Mastercard::OnBehalfServiceResult]?, + transaction_type_identifier: String? + } + + class Mastercard < Lithic::Internal::Type::BaseModel + attr_accessor ecommerce_security_level_indicator: String? + + attr_accessor on_behalf_service_result: ::Array[Lithic::CardAuthorization::NetworkSpecificData::Mastercard::OnBehalfServiceResult]? + + attr_accessor transaction_type_identifier: String? + + def initialize: ( + ?ecommerce_security_level_indicator: String?, + ?on_behalf_service_result: ::Array[Lithic::CardAuthorization::NetworkSpecificData::Mastercard::OnBehalfServiceResult]?, + ?transaction_type_identifier: String? + ) -> void + + def to_hash: -> { + ecommerce_security_level_indicator: String?, + on_behalf_service_result: ::Array[Lithic::CardAuthorization::NetworkSpecificData::Mastercard::OnBehalfServiceResult]?, + transaction_type_identifier: String? + } + + type on_behalf_service_result = + { :result_1 => String, :result_2 => String, service: String } + + class OnBehalfServiceResult < Lithic::Internal::Type::BaseModel + attr_accessor result_1: String + + attr_accessor result_2: String + + attr_accessor service: String + + def initialize: ( + result_1: String, + result_2: String, + service: String + ) -> void + + def to_hash: -> { + :result_1 => String, + :result_2 => String, + service: String + } + end + end + + type visa = { business_application_identifier: String? } + + class Visa < Lithic::Internal::Type::BaseModel + attr_accessor business_application_identifier: String? + + def initialize: (?business_application_identifier: String?) -> void + + def to_hash: -> { business_application_identifier: String? } + end + end + + type pos = + { + entry_mode: Lithic::CardAuthorization::Pos::EntryMode, + terminal: Lithic::CardAuthorization::Pos::Terminal + } + + class Pos < Lithic::Internal::Type::BaseModel + attr_reader entry_mode: Lithic::CardAuthorization::Pos::EntryMode? + + def entry_mode=: ( + Lithic::CardAuthorization::Pos::EntryMode + ) -> Lithic::CardAuthorization::Pos::EntryMode + + attr_reader terminal: Lithic::CardAuthorization::Pos::Terminal? + + def terminal=: ( + Lithic::CardAuthorization::Pos::Terminal + ) -> Lithic::CardAuthorization::Pos::Terminal + + def initialize: ( + ?entry_mode: Lithic::CardAuthorization::Pos::EntryMode, + ?terminal: Lithic::CardAuthorization::Pos::Terminal + ) -> void + + def to_hash: -> { + entry_mode: Lithic::CardAuthorization::Pos::EntryMode, + terminal: Lithic::CardAuthorization::Pos::Terminal + } + + type entry_mode = + { + card: Lithic::Models::CardAuthorization::Pos::EntryMode::card, + cardholder: Lithic::Models::CardAuthorization::Pos::EntryMode::cardholder, + pan: Lithic::Models::CardAuthorization::Pos::EntryMode::pan, + pin_entered: bool + } + + class EntryMode < Lithic::Internal::Type::BaseModel + attr_reader card: Lithic::Models::CardAuthorization::Pos::EntryMode::card? + + def card=: ( + Lithic::Models::CardAuthorization::Pos::EntryMode::card + ) -> Lithic::Models::CardAuthorization::Pos::EntryMode::card + + attr_reader cardholder: Lithic::Models::CardAuthorization::Pos::EntryMode::cardholder? + + def cardholder=: ( + Lithic::Models::CardAuthorization::Pos::EntryMode::cardholder + ) -> Lithic::Models::CardAuthorization::Pos::EntryMode::cardholder + + attr_reader pan: Lithic::Models::CardAuthorization::Pos::EntryMode::pan? + + def pan=: ( + Lithic::Models::CardAuthorization::Pos::EntryMode::pan + ) -> Lithic::Models::CardAuthorization::Pos::EntryMode::pan + + attr_reader pin_entered: bool? + + def pin_entered=: (bool) -> bool + + def initialize: ( + ?card: Lithic::Models::CardAuthorization::Pos::EntryMode::card, + ?cardholder: Lithic::Models::CardAuthorization::Pos::EntryMode::cardholder, + ?pan: Lithic::Models::CardAuthorization::Pos::EntryMode::pan, + ?pin_entered: bool + ) -> void + + def to_hash: -> { + card: Lithic::Models::CardAuthorization::Pos::EntryMode::card, + cardholder: Lithic::Models::CardAuthorization::Pos::EntryMode::cardholder, + pan: Lithic::Models::CardAuthorization::Pos::EntryMode::pan, + pin_entered: bool + } + + type card = :PRESENT | :NOT_PRESENT | :UNKNOWN + + module Card + extend Lithic::Internal::Type::Enum + + PRESENT: :PRESENT + NOT_PRESENT: :NOT_PRESENT + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::CardAuthorization::Pos::EntryMode::card] + end + + type cardholder = + :DEFERRED_BILLING + | :ELECTRONIC_ORDER + | :INSTALLMENT + | :MAIL_ORDER + | :NOT_PRESENT + | :PRESENT + | :REOCCURRING + | :TELEPHONE_ORDER + | :UNKNOWN + + module Cardholder + extend Lithic::Internal::Type::Enum + + DEFERRED_BILLING: :DEFERRED_BILLING + ELECTRONIC_ORDER: :ELECTRONIC_ORDER + INSTALLMENT: :INSTALLMENT + MAIL_ORDER: :MAIL_ORDER + NOT_PRESENT: :NOT_PRESENT + PRESENT: :PRESENT + REOCCURRING: :REOCCURRING + TELEPHONE_ORDER: :TELEPHONE_ORDER + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::CardAuthorization::Pos::EntryMode::cardholder] + end + + type pan = + :AUTO_ENTRY + | :BAR_CODE + | :CONTACTLESS + | :ECOMMERCE + | :ERROR_KEYED + | :ERROR_MAGNETIC_STRIPE + | :ICC + | :KEY_ENTERED + | :MAGNETIC_STRIPE + | :MANUAL + | :OCR + | :SECURE_CARDLESS + | :UNSPECIFIED + | :UNKNOWN + | :CREDENTIAL_ON_FILE + + module Pan + extend Lithic::Internal::Type::Enum + + AUTO_ENTRY: :AUTO_ENTRY + BAR_CODE: :BAR_CODE + CONTACTLESS: :CONTACTLESS + ECOMMERCE: :ECOMMERCE + ERROR_KEYED: :ERROR_KEYED + ERROR_MAGNETIC_STRIPE: :ERROR_MAGNETIC_STRIPE + ICC: :ICC + KEY_ENTERED: :KEY_ENTERED + MAGNETIC_STRIPE: :MAGNETIC_STRIPE + MANUAL: :MANUAL + OCR: :OCR + SECURE_CARDLESS: :SECURE_CARDLESS + UNSPECIFIED: :UNSPECIFIED + UNKNOWN: :UNKNOWN + CREDENTIAL_ON_FILE: :CREDENTIAL_ON_FILE + + def self?.values: -> ::Array[Lithic::Models::CardAuthorization::Pos::EntryMode::pan] + end + end + + type terminal = + { + attended: bool, + card_retention_capable: bool, + on_premise: bool, + operator: Lithic::Models::CardAuthorization::Pos::Terminal::operator, + partial_approval_capable: bool, + pin_capability: Lithic::Models::CardAuthorization::Pos::Terminal::pin_capability, + type: Lithic::Models::CardAuthorization::Pos::Terminal::type_, + acceptor_terminal_id: String? + } + + class Terminal < Lithic::Internal::Type::BaseModel + attr_accessor attended: bool + + attr_accessor card_retention_capable: bool + + attr_accessor on_premise: bool + + attr_accessor operator: Lithic::Models::CardAuthorization::Pos::Terminal::operator + + attr_accessor partial_approval_capable: bool + + attr_accessor pin_capability: Lithic::Models::CardAuthorization::Pos::Terminal::pin_capability + + attr_accessor type: Lithic::Models::CardAuthorization::Pos::Terminal::type_ + + attr_accessor acceptor_terminal_id: String? + + def initialize: ( + attended: bool, + card_retention_capable: bool, + on_premise: bool, + operator: Lithic::Models::CardAuthorization::Pos::Terminal::operator, + partial_approval_capable: bool, + pin_capability: Lithic::Models::CardAuthorization::Pos::Terminal::pin_capability, + type: Lithic::Models::CardAuthorization::Pos::Terminal::type_, + ?acceptor_terminal_id: String? + ) -> void + + def to_hash: -> { + attended: bool, + card_retention_capable: bool, + on_premise: bool, + operator: Lithic::Models::CardAuthorization::Pos::Terminal::operator, + partial_approval_capable: bool, + pin_capability: Lithic::Models::CardAuthorization::Pos::Terminal::pin_capability, + type: Lithic::Models::CardAuthorization::Pos::Terminal::type_, + acceptor_terminal_id: String? + } + + type operator = + :ADMINISTRATIVE | :CARDHOLDER | :CARD_ACCEPTOR | :UNKNOWN + + module Operator + extend Lithic::Internal::Type::Enum + + ADMINISTRATIVE: :ADMINISTRATIVE + CARDHOLDER: :CARDHOLDER + CARD_ACCEPTOR: :CARD_ACCEPTOR + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::CardAuthorization::Pos::Terminal::operator] + end + + type pin_capability = + :CAPABLE | :INOPERATIVE | :NOT_CAPABLE | :UNSPECIFIED + + module PinCapability + extend Lithic::Internal::Type::Enum + + CAPABLE: :CAPABLE + INOPERATIVE: :INOPERATIVE + NOT_CAPABLE: :NOT_CAPABLE + UNSPECIFIED: :UNSPECIFIED + + def self?.values: -> ::Array[Lithic::Models::CardAuthorization::Pos::Terminal::pin_capability] + end + + type type_ = + :ADMINISTRATIVE + | :ATM + | :AUTHORIZATION + | :COUPON_MACHINE + | :DIAL_TERMINAL + | :ECOMMERCE + | :ECR + | :FUEL_MACHINE + | :HOME_TERMINAL + | :MICR + | :OFF_PREMISE + | :PAYMENT + | :PDA + | :PHONE + | :POINT + | :POS_TERMINAL + | :PUBLIC_UTILITY + | :SELF_SERVICE + | :TELEVISION + | :TELLER + | :TRAVELERS_CHECK_MACHINE + | :VENDING + | :VOICE + | :UNKNOWN + + module Type + extend Lithic::Internal::Type::Enum + + ADMINISTRATIVE: :ADMINISTRATIVE + ATM: :ATM + AUTHORIZATION: :AUTHORIZATION + COUPON_MACHINE: :COUPON_MACHINE + DIAL_TERMINAL: :DIAL_TERMINAL + ECOMMERCE: :ECOMMERCE + ECR: :ECR + FUEL_MACHINE: :FUEL_MACHINE + HOME_TERMINAL: :HOME_TERMINAL + MICR: :MICR + OFF_PREMISE: :OFF_PREMISE + PAYMENT: :PAYMENT + PDA: :PDA + PHONE: :PHONE + POINT: :POINT + POS_TERMINAL: :POS_TERMINAL + PUBLIC_UTILITY: :PUBLIC_UTILITY + SELF_SERVICE: :SELF_SERVICE + TELEVISION: :TELEVISION + TELLER: :TELLER + TRAVELERS_CHECK_MACHINE: :TRAVELERS_CHECK_MACHINE + VENDING: :VENDING + VOICE: :VOICE + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::CardAuthorization::Pos::Terminal::type_] + end + end + end + end + end +end diff --git a/sig/lithic/models/card_authorization_approval_request_webhook_event.rbs b/sig/lithic/models/card_authorization_approval_request_webhook_event.rbs new file mode 100644 index 00000000..24c3206c --- /dev/null +++ b/sig/lithic/models/card_authorization_approval_request_webhook_event.rbs @@ -0,0 +1,20 @@ +module Lithic + module Models + type card_authorization_approval_request_webhook_event = + { event_type: :"card_authorization.approval_request" } + + class CardAuthorizationApprovalRequestWebhookEvent < Lithic::Models::CardAuthorization + def event_type: -> :"card_authorization.approval_request" + + def event_type=: ( + :"card_authorization.approval_request" _ + ) -> :"card_authorization.approval_request" + + def initialize: ( + ?event_type: :"card_authorization.approval_request" + ) -> void + + def to_hash: -> { event_type: :"card_authorization.approval_request" } + end + end +end diff --git a/sig/lithic/models/card_authorization_challenge_response_params.rbs b/sig/lithic/models/card_authorization_challenge_response_params.rbs new file mode 100644 index 00000000..deb6c307 --- /dev/null +++ b/sig/lithic/models/card_authorization_challenge_response_params.rbs @@ -0,0 +1,42 @@ +module Lithic + module Models + type card_authorization_challenge_response_params = + { + event_token: String, + response: Lithic::Models::CardAuthorizationChallengeResponseParams::response + } + & Lithic::Internal::Type::request_parameters + + class CardAuthorizationChallengeResponseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor event_token: String + + attr_accessor response: Lithic::Models::CardAuthorizationChallengeResponseParams::response + + def initialize: ( + event_token: String, + response: Lithic::Models::CardAuthorizationChallengeResponseParams::response, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + event_token: String, + response: Lithic::Models::CardAuthorizationChallengeResponseParams::response, + request_options: Lithic::RequestOptions + } + + type response = :APPROVE | :DECLINE + + module Response + extend Lithic::Internal::Type::Enum + + APPROVE: :APPROVE + DECLINE: :DECLINE + + def self?.values: -> ::Array[Lithic::Models::CardAuthorizationChallengeResponseParams::response] + end + end + end +end diff --git a/sig/lithic/models/card_authorization_challenge_response_webhook_event.rbs b/sig/lithic/models/card_authorization_challenge_response_webhook_event.rbs new file mode 100644 index 00000000..2d43f57a --- /dev/null +++ b/sig/lithic/models/card_authorization_challenge_response_webhook_event.rbs @@ -0,0 +1,77 @@ +module Lithic + module Models + type card_authorization_challenge_response_webhook_event = + { + card_token: String?, + challenge_method: Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent::challenge_method, + completed: Time?, + created: Time, + event_token: String, + event_type: :"card_authorization.challenge_response", + response: Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent::response, + transaction_token: String? + } + + class CardAuthorizationChallengeResponseWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor card_token: String? + + attr_accessor challenge_method: Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent::challenge_method + + attr_accessor completed: Time? + + attr_accessor created: Time + + attr_accessor event_token: String + + attr_accessor event_type: :"card_authorization.challenge_response" + + attr_accessor response: Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent::response + + attr_accessor transaction_token: String? + + def initialize: ( + card_token: String?, + challenge_method: Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent::challenge_method, + completed: Time?, + created: Time, + event_token: String, + response: Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent::response, + transaction_token: String?, + ?event_type: :"card_authorization.challenge_response" + ) -> void + + def to_hash: -> { + card_token: String?, + challenge_method: Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent::challenge_method, + completed: Time?, + created: Time, + event_token: String, + event_type: :"card_authorization.challenge_response", + response: Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent::response, + transaction_token: String? + } + + type challenge_method = :SMS | :OUT_OF_BAND + + module ChallengeMethod + extend Lithic::Internal::Type::Enum + + SMS: :SMS + OUT_OF_BAND: :OUT_OF_BAND + + def self?.values: -> ::Array[Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent::challenge_method] + end + + type response = :APPROVE | :DECLINE + + module Response + extend Lithic::Internal::Type::Enum + + APPROVE: :APPROVE + DECLINE: :DECLINE + + def self?.values: -> ::Array[Lithic::Models::CardAuthorizationChallengeResponseWebhookEvent::response] + end + end + end +end diff --git a/sig/lithic/models/card_authorization_challenge_webhook_event.rbs b/sig/lithic/models/card_authorization_challenge_webhook_event.rbs new file mode 100644 index 00000000..add10ecc --- /dev/null +++ b/sig/lithic/models/card_authorization_challenge_webhook_event.rbs @@ -0,0 +1,53 @@ +module Lithic + module Models + type card_authorization_challenge_webhook_event = + { + authorization: Lithic::CardAuthorization, + challenge: Lithic::CardAuthorizationChallengeWebhookEvent::Challenge, + event_type: :"card_authorization.challenge" + } + + class CardAuthorizationChallengeWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor authorization: Lithic::CardAuthorization + + attr_accessor challenge: Lithic::CardAuthorizationChallengeWebhookEvent::Challenge + + attr_accessor event_type: :"card_authorization.challenge" + + def initialize: ( + authorization: Lithic::CardAuthorization, + challenge: Lithic::CardAuthorizationChallengeWebhookEvent::Challenge, + ?event_type: :"card_authorization.challenge" + ) -> void + + def to_hash: -> { + authorization: Lithic::CardAuthorization, + challenge: Lithic::CardAuthorizationChallengeWebhookEvent::Challenge, + event_type: :"card_authorization.challenge" + } + + type challenge = + { event_token: String, expiry_time: Time, start_time: Time } + + class Challenge < Lithic::Internal::Type::BaseModel + attr_accessor event_token: String + + attr_accessor expiry_time: Time + + attr_accessor start_time: Time + + def initialize: ( + event_token: String, + expiry_time: Time, + start_time: Time + ) -> void + + def to_hash: -> { + event_token: String, + expiry_time: Time, + start_time: Time + } + end + end + end +end diff --git a/sig/lithic/models/card_bulk_order.rbs b/sig/lithic/models/card_bulk_order.rbs new file mode 100644 index 00000000..364e85f8 --- /dev/null +++ b/sig/lithic/models/card_bulk_order.rbs @@ -0,0 +1,80 @@ +module Lithic + module Models + type card_bulk_order = + { + token: String, + card_tokens: ::Array[String], + created: Time, + customer_product_id: String?, + shipping_address: top, + shipping_method: Lithic::Models::CardBulkOrder::shipping_method, + status: Lithic::Models::CardBulkOrder::status, + updated: Time + } + + class CardBulkOrder < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor card_tokens: ::Array[String] + + attr_accessor created: Time + + attr_accessor customer_product_id: String? + + attr_accessor shipping_address: top + + attr_accessor shipping_method: Lithic::Models::CardBulkOrder::shipping_method + + attr_accessor status: Lithic::Models::CardBulkOrder::status + + attr_accessor updated: Time + + def initialize: ( + token: String, + card_tokens: ::Array[String], + created: Time, + customer_product_id: String?, + shipping_address: top, + shipping_method: Lithic::Models::CardBulkOrder::shipping_method, + status: Lithic::Models::CardBulkOrder::status, + updated: Time + ) -> void + + def to_hash: -> { + token: String, + card_tokens: ::Array[String], + created: Time, + customer_product_id: String?, + shipping_address: top, + shipping_method: Lithic::Models::CardBulkOrder::shipping_method, + status: Lithic::Models::CardBulkOrder::status, + updated: Time + } + + type shipping_method = + :BULK_EXPEDITED | :BULK_PRIORITY | :BULK_2_DAY | :BULK_EXPRESS + + module ShippingMethod + extend Lithic::Internal::Type::Enum + + BULK_EXPEDITED: :BULK_EXPEDITED + BULK_PRIORITY: :BULK_PRIORITY + BULK_2_DAY: :BULK_2_DAY + BULK_EXPRESS: :BULK_EXPRESS + + def self?.values: -> ::Array[Lithic::Models::CardBulkOrder::shipping_method] + end + + type status = :OPEN | :LOCKED + + module Status + extend Lithic::Internal::Type::Enum + + OPEN: :OPEN + LOCKED: :LOCKED + + def self?.values: -> ::Array[Lithic::Models::CardBulkOrder::status] + end + end + end +end diff --git a/sig/lithic/models/card_bulk_order_create_params.rbs b/sig/lithic/models/card_bulk_order_create_params.rbs new file mode 100644 index 00000000..33361ef6 --- /dev/null +++ b/sig/lithic/models/card_bulk_order_create_params.rbs @@ -0,0 +1,50 @@ +module Lithic + module Models + type card_bulk_order_create_params = + { + customer_product_id: String, + shipping_address: top, + shipping_method: Lithic::Models::CardBulkOrderCreateParams::shipping_method + } + & Lithic::Internal::Type::request_parameters + + class CardBulkOrderCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor customer_product_id: String + + attr_accessor shipping_address: top + + attr_accessor shipping_method: Lithic::Models::CardBulkOrderCreateParams::shipping_method + + def initialize: ( + customer_product_id: String, + shipping_address: top, + shipping_method: Lithic::Models::CardBulkOrderCreateParams::shipping_method, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + customer_product_id: String, + shipping_address: top, + shipping_method: Lithic::Models::CardBulkOrderCreateParams::shipping_method, + request_options: Lithic::RequestOptions + } + + type shipping_method = + :BULK_EXPEDITED | :BULK_PRIORITY | :BULK_2_DAY | :BULK_EXPRESS + + module ShippingMethod + extend Lithic::Internal::Type::Enum + + BULK_EXPEDITED: :BULK_EXPEDITED + BULK_PRIORITY: :BULK_PRIORITY + BULK_2_DAY: :BULK_2_DAY + BULK_EXPRESS: :BULK_EXPRESS + + def self?.values: -> ::Array[Lithic::Models::CardBulkOrderCreateParams::shipping_method] + end + end + end +end diff --git a/sig/lithic/models/card_bulk_order_list_params.rbs b/sig/lithic/models/card_bulk_order_list_params.rbs new file mode 100644 index 00000000..6f488fa4 --- /dev/null +++ b/sig/lithic/models/card_bulk_order_list_params.rbs @@ -0,0 +1,56 @@ +module Lithic + module Models + type card_bulk_order_list_params = + { + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String + } + & Lithic::Internal::Type::request_parameters + + class CardBulkOrderListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/card_bulk_order_retrieve_params.rbs b/sig/lithic/models/card_bulk_order_retrieve_params.rbs new file mode 100644 index 00000000..9ea27acd --- /dev/null +++ b/sig/lithic/models/card_bulk_order_retrieve_params.rbs @@ -0,0 +1,23 @@ +module Lithic + module Models + type card_bulk_order_retrieve_params = + { bulk_order_token: String } & Lithic::Internal::Type::request_parameters + + class CardBulkOrderRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor bulk_order_token: String + + def initialize: ( + bulk_order_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + bulk_order_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/card_bulk_order_update_params.rbs b/sig/lithic/models/card_bulk_order_update_params.rbs new file mode 100644 index 00000000..d3f63555 --- /dev/null +++ b/sig/lithic/models/card_bulk_order_update_params.rbs @@ -0,0 +1,41 @@ +module Lithic + module Models + type card_bulk_order_update_params = + { + bulk_order_token: String, + status: Lithic::Models::CardBulkOrderUpdateParams::status + } + & Lithic::Internal::Type::request_parameters + + class CardBulkOrderUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor bulk_order_token: String + + attr_accessor status: Lithic::Models::CardBulkOrderUpdateParams::status + + def initialize: ( + bulk_order_token: String, + status: Lithic::Models::CardBulkOrderUpdateParams::status, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + bulk_order_token: String, + status: Lithic::Models::CardBulkOrderUpdateParams::status, + request_options: Lithic::RequestOptions + } + + type status = :LOCKED + + module Status + extend Lithic::Internal::Type::Enum + + LOCKED: :LOCKED + + def self?.values: -> ::Array[Lithic::Models::CardBulkOrderUpdateParams::status] + end + end + end +end diff --git a/sig/lithic/models/card_convert_physical_params.rbs b/sig/lithic/models/card_convert_physical_params.rbs new file mode 100644 index 00000000..9ca4dcd1 --- /dev/null +++ b/sig/lithic/models/card_convert_physical_params.rbs @@ -0,0 +1,77 @@ +module Lithic + module Models + type card_convert_physical_params = + { + card_token: String, + shipping_address: Lithic::ShippingAddress, + carrier: Lithic::Carrier, + product_id: String, + shipping_method: Lithic::Models::CardConvertPhysicalParams::shipping_method + } + & Lithic::Internal::Type::request_parameters + + class CardConvertPhysicalParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor card_token: String + + attr_accessor shipping_address: Lithic::ShippingAddress + + attr_reader carrier: Lithic::Carrier? + + def carrier=: (Lithic::Carrier) -> Lithic::Carrier + + attr_reader product_id: String? + + def product_id=: (String) -> String + + attr_reader shipping_method: Lithic::Models::CardConvertPhysicalParams::shipping_method? + + def shipping_method=: ( + Lithic::Models::CardConvertPhysicalParams::shipping_method + ) -> Lithic::Models::CardConvertPhysicalParams::shipping_method + + def initialize: ( + card_token: String, + shipping_address: Lithic::ShippingAddress, + ?carrier: Lithic::Carrier, + ?product_id: String, + ?shipping_method: Lithic::Models::CardConvertPhysicalParams::shipping_method, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + card_token: String, + shipping_address: Lithic::ShippingAddress, + carrier: Lithic::Carrier, + product_id: String, + shipping_method: Lithic::Models::CardConvertPhysicalParams::shipping_method, + request_options: Lithic::RequestOptions + } + + type shipping_method = + :"2_DAY" + | :BULK + | :EXPEDITED + | :EXPRESS + | :PRIORITY + | :STANDARD + | :STANDARD_WITH_TRACKING + + module ShippingMethod + extend Lithic::Internal::Type::Enum + + SHIPPING_METHOD_2_DAY: :"2_DAY" + BULK: :BULK + EXPEDITED: :EXPEDITED + EXPRESS: :EXPRESS + PRIORITY: :PRIORITY + STANDARD: :STANDARD + STANDARD_WITH_TRACKING: :STANDARD_WITH_TRACKING + + def self?.values: -> ::Array[Lithic::Models::CardConvertPhysicalParams::shipping_method] + end + end + end +end diff --git a/sig/lithic/models/card_converted_webhook_event.rbs b/sig/lithic/models/card_converted_webhook_event.rbs new file mode 100644 index 00000000..c14d7313 --- /dev/null +++ b/sig/lithic/models/card_converted_webhook_event.rbs @@ -0,0 +1,19 @@ +module Lithic + module Models + type card_converted_webhook_event = + { card_token: String, event_type: :"card.converted" } + + class CardConvertedWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor card_token: String + + attr_accessor event_type: :"card.converted" + + def initialize: ( + card_token: String, + ?event_type: :"card.converted" + ) -> void + + def to_hash: -> { card_token: String, event_type: :"card.converted" } + end + end +end diff --git a/sig/lithic/models/card_create_params.rbs b/sig/lithic/models/card_create_params.rbs new file mode 100644 index 00000000..8c90958e --- /dev/null +++ b/sig/lithic/models/card_create_params.rbs @@ -0,0 +1,262 @@ +module Lithic + module Models + type card_create_params = + { + type: Lithic::Models::CardCreateParams::type_, + account_token: String, + bulk_order_token: String, + card_program_token: String, + carrier: Lithic::Carrier, + digital_card_art_token: String, + exp_month: String, + exp_year: String, + memo: String, + pin: String, + product_id: String, + replacement_account_token: String, + replacement_comment: String, + replacement_for: String, + replacement_substatus: Lithic::Models::CardCreateParams::replacement_substatus, + shipping_address: Lithic::ShippingAddress, + shipping_method: Lithic::Models::CardCreateParams::shipping_method, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::spend_limit_duration, + state: Lithic::Models::CardCreateParams::state, + idempotency_key: String + } + & Lithic::Internal::Type::request_parameters + + class CardCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor type: Lithic::Models::CardCreateParams::type_ + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader bulk_order_token: String? + + def bulk_order_token=: (String) -> String + + attr_reader card_program_token: String? + + def card_program_token=: (String) -> String + + attr_reader carrier: Lithic::Carrier? + + def carrier=: (Lithic::Carrier) -> Lithic::Carrier + + attr_reader digital_card_art_token: String? + + def digital_card_art_token=: (String) -> String + + attr_reader exp_month: String? + + def exp_month=: (String) -> String + + attr_reader exp_year: String? + + def exp_year=: (String) -> String + + attr_reader memo: String? + + def memo=: (String) -> String + + attr_reader pin: String? + + def pin=: (String) -> String + + attr_reader product_id: String? + + def product_id=: (String) -> String + + attr_reader replacement_account_token: String? + + def replacement_account_token=: (String) -> String + + attr_reader replacement_comment: String? + + def replacement_comment=: (String) -> String + + attr_reader replacement_for: String? + + def replacement_for=: (String) -> String + + attr_reader replacement_substatus: Lithic::Models::CardCreateParams::replacement_substatus? + + def replacement_substatus=: ( + Lithic::Models::CardCreateParams::replacement_substatus + ) -> Lithic::Models::CardCreateParams::replacement_substatus + + attr_reader shipping_address: Lithic::ShippingAddress? + + def shipping_address=: ( + Lithic::ShippingAddress + ) -> Lithic::ShippingAddress + + attr_reader shipping_method: Lithic::Models::CardCreateParams::shipping_method? + + def shipping_method=: ( + Lithic::Models::CardCreateParams::shipping_method + ) -> Lithic::Models::CardCreateParams::shipping_method + + attr_reader spend_limit: Integer? + + def spend_limit=: (Integer) -> Integer + + attr_reader spend_limit_duration: Lithic::Models::spend_limit_duration? + + def spend_limit_duration=: ( + Lithic::Models::spend_limit_duration + ) -> Lithic::Models::spend_limit_duration + + attr_reader state: Lithic::Models::CardCreateParams::state? + + def state=: ( + Lithic::Models::CardCreateParams::state + ) -> Lithic::Models::CardCreateParams::state + + attr_reader idempotency_key: String? + + def idempotency_key=: (String) -> String + + def initialize: ( + type: Lithic::Models::CardCreateParams::type_, + ?account_token: String, + ?bulk_order_token: String, + ?card_program_token: String, + ?carrier: Lithic::Carrier, + ?digital_card_art_token: String, + ?exp_month: String, + ?exp_year: String, + ?memo: String, + ?pin: String, + ?product_id: String, + ?replacement_account_token: String, + ?replacement_comment: String, + ?replacement_for: String, + ?replacement_substatus: Lithic::Models::CardCreateParams::replacement_substatus, + ?shipping_address: Lithic::ShippingAddress, + ?shipping_method: Lithic::Models::CardCreateParams::shipping_method, + ?spend_limit: Integer, + ?spend_limit_duration: Lithic::Models::spend_limit_duration, + ?state: Lithic::Models::CardCreateParams::state, + ?idempotency_key: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + type: Lithic::Models::CardCreateParams::type_, + account_token: String, + bulk_order_token: String, + card_program_token: String, + carrier: Lithic::Carrier, + digital_card_art_token: String, + exp_month: String, + exp_year: String, + memo: String, + pin: String, + product_id: String, + replacement_account_token: String, + replacement_comment: String, + replacement_for: String, + replacement_substatus: Lithic::Models::CardCreateParams::replacement_substatus, + shipping_address: Lithic::ShippingAddress, + shipping_method: Lithic::Models::CardCreateParams::shipping_method, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::spend_limit_duration, + state: Lithic::Models::CardCreateParams::state, + idempotency_key: String, + request_options: Lithic::RequestOptions + } + + type type_ = + :MERCHANT_LOCKED + | :PHYSICAL + | :SINGLE_USE + | :VIRTUAL + | :UNLOCKED + | :DIGITAL_WALLET + + module Type + extend Lithic::Internal::Type::Enum + + MERCHANT_LOCKED: :MERCHANT_LOCKED + PHYSICAL: :PHYSICAL + SINGLE_USE: :SINGLE_USE + VIRTUAL: :VIRTUAL + UNLOCKED: :UNLOCKED + DIGITAL_WALLET: :DIGITAL_WALLET + + def self?.values: -> ::Array[Lithic::Models::CardCreateParams::type_] + end + + type replacement_substatus = + :LOST + | :COMPROMISED + | :DAMAGED + | :END_USER_REQUEST + | :ISSUER_REQUEST + | :NOT_ACTIVE + | :SUSPICIOUS_ACTIVITY + | :INTERNAL_REVIEW + | :EXPIRED + | :UNDELIVERABLE + | :OTHER + + module ReplacementSubstatus + extend Lithic::Internal::Type::Enum + + LOST: :LOST + COMPROMISED: :COMPROMISED + DAMAGED: :DAMAGED + END_USER_REQUEST: :END_USER_REQUEST + ISSUER_REQUEST: :ISSUER_REQUEST + NOT_ACTIVE: :NOT_ACTIVE + SUSPICIOUS_ACTIVITY: :SUSPICIOUS_ACTIVITY + INTERNAL_REVIEW: :INTERNAL_REVIEW + EXPIRED: :EXPIRED + UNDELIVERABLE: :UNDELIVERABLE + OTHER: :OTHER + + def self?.values: -> ::Array[Lithic::Models::CardCreateParams::replacement_substatus] + end + + type shipping_method = + :"2_DAY" + | :BULK + | :EXPEDITED + | :EXPRESS + | :PRIORITY + | :STANDARD + | :STANDARD_WITH_TRACKING + + module ShippingMethod + extend Lithic::Internal::Type::Enum + + SHIPPING_METHOD_2_DAY: :"2_DAY" + BULK: :BULK + EXPEDITED: :EXPEDITED + EXPRESS: :EXPRESS + PRIORITY: :PRIORITY + STANDARD: :STANDARD + STANDARD_WITH_TRACKING: :STANDARD_WITH_TRACKING + + def self?.values: -> ::Array[Lithic::Models::CardCreateParams::shipping_method] + end + + type state = :OPEN | :PAUSED + + module State + extend Lithic::Internal::Type::Enum + + OPEN: :OPEN + PAUSED: :PAUSED + + def self?.values: -> ::Array[Lithic::Models::CardCreateParams::state] + end + end + end +end diff --git a/sig/lithic/models/card_created_webhook_event.rbs b/sig/lithic/models/card_created_webhook_event.rbs new file mode 100644 index 00000000..f14db820 --- /dev/null +++ b/sig/lithic/models/card_created_webhook_event.rbs @@ -0,0 +1,30 @@ +module Lithic + module Models + type card_created_webhook_event = + { + card_token: String, + event_type: :"card.created", + replacement_for: String? + } + + class CardCreatedWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor card_token: String + + attr_accessor event_type: :"card.created" + + attr_accessor replacement_for: String? + + def initialize: ( + card_token: String, + ?replacement_for: String?, + ?event_type: :"card.created" + ) -> void + + def to_hash: -> { + card_token: String, + event_type: :"card.created", + replacement_for: String? + } + end + end +end diff --git a/sig/lithic/models/card_embed_params.rbs b/sig/lithic/models/card_embed_params.rbs new file mode 100644 index 00000000..b3243a66 --- /dev/null +++ b/sig/lithic/models/card_embed_params.rbs @@ -0,0 +1,28 @@ +module Lithic + module Models + type card_embed_params = + { embed_request: String, hmac: String } + & Lithic::Internal::Type::request_parameters + + class CardEmbedParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor embed_request: String + + attr_accessor hmac: String + + def initialize: ( + embed_request: String, + hmac: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + embed_request: String, + hmac: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/card_embed_response.rbs b/sig/lithic/models/card_embed_response.rbs new file mode 100644 index 00000000..f171664d --- /dev/null +++ b/sig/lithic/models/card_embed_response.rbs @@ -0,0 +1,5 @@ +module Lithic + module Models + class CardEmbedResponse = String + end +end diff --git a/sig/lithic/models/card_list_params.rbs b/sig/lithic/models/card_list_params.rbs new file mode 100644 index 00000000..ec7f20ee --- /dev/null +++ b/sig/lithic/models/card_list_params.rbs @@ -0,0 +1,94 @@ +module Lithic + module Models + type card_list_params = + { + account_token: String, + begin_: Time, + end_: Time, + ending_before: String, + memo: String, + page_size: Integer, + starting_after: String, + state: Lithic::Models::CardListParams::state + } + & Lithic::Internal::Type::request_parameters + + class CardListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader memo: String? + + def memo=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader state: Lithic::Models::CardListParams::state? + + def state=: ( + Lithic::Models::CardListParams::state + ) -> Lithic::Models::CardListParams::state + + def initialize: ( + ?account_token: String, + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?memo: String, + ?page_size: Integer, + ?starting_after: String, + ?state: Lithic::Models::CardListParams::state, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + account_token: String, + begin_: Time, + end_: Time, + ending_before: String, + memo: String, + page_size: Integer, + starting_after: String, + state: Lithic::Models::CardListParams::state, + request_options: Lithic::RequestOptions + } + + type state = + :CLOSED | :OPEN | :PAUSED | :PENDING_ACTIVATION | :PENDING_FULFILLMENT + + module State + extend Lithic::Internal::Type::Enum + + CLOSED: :CLOSED + OPEN: :OPEN + PAUSED: :PAUSED + PENDING_ACTIVATION: :PENDING_ACTIVATION + PENDING_FULFILLMENT: :PENDING_FULFILLMENT + + def self?.values: -> ::Array[Lithic::Models::CardListParams::state] + end + end + end +end diff --git a/sig/lithic/models/card_program.rbs b/sig/lithic/models/card_program.rbs new file mode 100644 index 00000000..96b832a6 --- /dev/null +++ b/sig/lithic/models/card_program.rbs @@ -0,0 +1,57 @@ +module Lithic + module Models + type card_program = + { + token: String, + account_level_management_enabled: bool, + created: Time, + name: String, + pan_range_end: String, + pan_range_start: String, + cardholder_currency: String?, + settlement_currencies: ::Array[String] + } + + class CardProgram < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor account_level_management_enabled: bool + + attr_accessor created: Time + + attr_accessor name: String + + attr_accessor pan_range_end: String + + attr_accessor pan_range_start: String + + attr_accessor cardholder_currency: String? + + attr_reader settlement_currencies: ::Array[String]? + + def settlement_currencies=: (::Array[String]) -> ::Array[String] + + def initialize: ( + token: String, + account_level_management_enabled: bool, + created: Time, + name: String, + pan_range_end: String, + pan_range_start: String, + ?cardholder_currency: String?, + ?settlement_currencies: ::Array[String] + ) -> void + + def to_hash: -> { + token: String, + account_level_management_enabled: bool, + created: Time, + name: String, + pan_range_end: String, + pan_range_start: String, + cardholder_currency: String?, + settlement_currencies: ::Array[String] + } + end + end +end diff --git a/sig/lithic/models/card_program_list_params.rbs b/sig/lithic/models/card_program_list_params.rbs new file mode 100644 index 00000000..9271545c --- /dev/null +++ b/sig/lithic/models/card_program_list_params.rbs @@ -0,0 +1,38 @@ +module Lithic + module Models + type card_program_list_params = + { ending_before: String, page_size: Integer, starting_after: String } + & Lithic::Internal::Type::request_parameters + + class CardProgramListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/card_program_retrieve_params.rbs b/sig/lithic/models/card_program_retrieve_params.rbs new file mode 100644 index 00000000..ac093556 --- /dev/null +++ b/sig/lithic/models/card_program_retrieve_params.rbs @@ -0,0 +1,24 @@ +module Lithic + module Models + type card_program_retrieve_params = + { card_program_token: String } + & Lithic::Internal::Type::request_parameters + + class CardProgramRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor card_program_token: String + + def initialize: ( + card_program_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + card_program_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/card_provision_params.rbs b/sig/lithic/models/card_provision_params.rbs new file mode 100644 index 00000000..b0bb5e8f --- /dev/null +++ b/sig/lithic/models/card_provision_params.rbs @@ -0,0 +1,82 @@ +module Lithic + module Models + type card_provision_params = + { + card_token: String, + certificate: String, + client_device_id: String, + client_wallet_account_id: String, + digital_wallet: Lithic::Models::CardProvisionParams::digital_wallet, + nonce: String, + nonce_signature: String + } + & Lithic::Internal::Type::request_parameters + + class CardProvisionParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor card_token: String + + attr_reader certificate: String? + + def certificate=: (String) -> String + + attr_reader client_device_id: String? + + def client_device_id=: (String) -> String + + attr_reader client_wallet_account_id: String? + + def client_wallet_account_id=: (String) -> String + + attr_reader digital_wallet: Lithic::Models::CardProvisionParams::digital_wallet? + + def digital_wallet=: ( + Lithic::Models::CardProvisionParams::digital_wallet + ) -> Lithic::Models::CardProvisionParams::digital_wallet + + attr_reader nonce: String? + + def nonce=: (String) -> String + + attr_reader nonce_signature: String? + + def nonce_signature=: (String) -> String + + def initialize: ( + card_token: String, + ?certificate: String, + ?client_device_id: String, + ?client_wallet_account_id: String, + ?digital_wallet: Lithic::Models::CardProvisionParams::digital_wallet, + ?nonce: String, + ?nonce_signature: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + card_token: String, + certificate: String, + client_device_id: String, + client_wallet_account_id: String, + digital_wallet: Lithic::Models::CardProvisionParams::digital_wallet, + nonce: String, + nonce_signature: String, + request_options: Lithic::RequestOptions + } + + type digital_wallet = :APPLE_PAY | :GOOGLE_PAY | :SAMSUNG_PAY + + module DigitalWallet + extend Lithic::Internal::Type::Enum + + APPLE_PAY: :APPLE_PAY + GOOGLE_PAY: :GOOGLE_PAY + SAMSUNG_PAY: :SAMSUNG_PAY + + def self?.values: -> ::Array[Lithic::Models::CardProvisionParams::digital_wallet] + end + end + end +end diff --git a/sig/lithic/models/card_provision_response.rbs b/sig/lithic/models/card_provision_response.rbs new file mode 100644 index 00000000..1726fa1c --- /dev/null +++ b/sig/lithic/models/card_provision_response.rbs @@ -0,0 +1,32 @@ +module Lithic + module Models + type card_provision_response = + { + provisioning_payload: Lithic::Models::CardProvisionResponse::provisioning_payload + } + + class CardProvisionResponse < Lithic::Internal::Type::BaseModel + attr_reader provisioning_payload: Lithic::Models::CardProvisionResponse::provisioning_payload? + + def provisioning_payload=: ( + Lithic::Models::CardProvisionResponse::provisioning_payload + ) -> Lithic::Models::CardProvisionResponse::provisioning_payload + + def initialize: ( + ?provisioning_payload: Lithic::Models::CardProvisionResponse::provisioning_payload + ) -> void + + def to_hash: -> { + provisioning_payload: Lithic::Models::CardProvisionResponse::provisioning_payload + } + + type provisioning_payload = String | Lithic::ProvisionResponse + + module ProvisioningPayload + extend Lithic::Internal::Type::Union + + def self?.variants: -> ::Array[Lithic::Models::CardProvisionResponse::provisioning_payload] + end + end + end +end diff --git a/sig/lithic/models/card_reissue_params.rbs b/sig/lithic/models/card_reissue_params.rbs new file mode 100644 index 00000000..d4529ab0 --- /dev/null +++ b/sig/lithic/models/card_reissue_params.rbs @@ -0,0 +1,81 @@ +module Lithic + module Models + type card_reissue_params = + { + card_token: String, + carrier: Lithic::Carrier, + product_id: String, + shipping_address: Lithic::ShippingAddress, + shipping_method: Lithic::Models::CardReissueParams::shipping_method + } + & Lithic::Internal::Type::request_parameters + + class CardReissueParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor card_token: String + + attr_reader carrier: Lithic::Carrier? + + def carrier=: (Lithic::Carrier) -> Lithic::Carrier + + attr_reader product_id: String? + + def product_id=: (String) -> String + + attr_reader shipping_address: Lithic::ShippingAddress? + + def shipping_address=: ( + Lithic::ShippingAddress + ) -> Lithic::ShippingAddress + + attr_reader shipping_method: Lithic::Models::CardReissueParams::shipping_method? + + def shipping_method=: ( + Lithic::Models::CardReissueParams::shipping_method + ) -> Lithic::Models::CardReissueParams::shipping_method + + def initialize: ( + card_token: String, + ?carrier: Lithic::Carrier, + ?product_id: String, + ?shipping_address: Lithic::ShippingAddress, + ?shipping_method: Lithic::Models::CardReissueParams::shipping_method, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + card_token: String, + carrier: Lithic::Carrier, + product_id: String, + shipping_address: Lithic::ShippingAddress, + shipping_method: Lithic::Models::CardReissueParams::shipping_method, + request_options: Lithic::RequestOptions + } + + type shipping_method = + :"2_DAY" + | :BULK + | :EXPEDITED + | :EXPRESS + | :PRIORITY + | :STANDARD + | :STANDARD_WITH_TRACKING + + module ShippingMethod + extend Lithic::Internal::Type::Enum + + SHIPPING_METHOD_2_DAY: :"2_DAY" + BULK: :BULK + EXPEDITED: :EXPEDITED + EXPRESS: :EXPRESS + PRIORITY: :PRIORITY + STANDARD: :STANDARD + STANDARD_WITH_TRACKING: :STANDARD_WITH_TRACKING + + def self?.values: -> ::Array[Lithic::Models::CardReissueParams::shipping_method] + end + end + end +end diff --git a/sig/lithic/models/card_reissued_webhook_event.rbs b/sig/lithic/models/card_reissued_webhook_event.rbs new file mode 100644 index 00000000..67836f80 --- /dev/null +++ b/sig/lithic/models/card_reissued_webhook_event.rbs @@ -0,0 +1,21 @@ +module Lithic + module Models + type card_reissued_webhook_event = + { event_type: :"card.reissued", card_token: String } + + class CardReissuedWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor event_type: :"card.reissued" + + attr_reader card_token: String? + + def card_token=: (String) -> String + + def initialize: ( + ?card_token: String, + ?event_type: :"card.reissued" + ) -> void + + def to_hash: -> { event_type: :"card.reissued", card_token: String } + end + end +end diff --git a/sig/lithic/models/card_renew_params.rbs b/sig/lithic/models/card_renew_params.rbs new file mode 100644 index 00000000..aeadd193 --- /dev/null +++ b/sig/lithic/models/card_renew_params.rbs @@ -0,0 +1,91 @@ +module Lithic + module Models + type card_renew_params = + { + card_token: String, + shipping_address: Lithic::ShippingAddress, + carrier: Lithic::Carrier, + exp_month: String, + exp_year: String, + product_id: String, + shipping_method: Lithic::Models::CardRenewParams::shipping_method + } + & Lithic::Internal::Type::request_parameters + + class CardRenewParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor card_token: String + + attr_accessor shipping_address: Lithic::ShippingAddress + + attr_reader carrier: Lithic::Carrier? + + def carrier=: (Lithic::Carrier) -> Lithic::Carrier + + attr_reader exp_month: String? + + def exp_month=: (String) -> String + + attr_reader exp_year: String? + + def exp_year=: (String) -> String + + attr_reader product_id: String? + + def product_id=: (String) -> String + + attr_reader shipping_method: Lithic::Models::CardRenewParams::shipping_method? + + def shipping_method=: ( + Lithic::Models::CardRenewParams::shipping_method + ) -> Lithic::Models::CardRenewParams::shipping_method + + def initialize: ( + card_token: String, + shipping_address: Lithic::ShippingAddress, + ?carrier: Lithic::Carrier, + ?exp_month: String, + ?exp_year: String, + ?product_id: String, + ?shipping_method: Lithic::Models::CardRenewParams::shipping_method, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + card_token: String, + shipping_address: Lithic::ShippingAddress, + carrier: Lithic::Carrier, + exp_month: String, + exp_year: String, + product_id: String, + shipping_method: Lithic::Models::CardRenewParams::shipping_method, + request_options: Lithic::RequestOptions + } + + type shipping_method = + :"2_DAY" + | :BULK + | :EXPEDITED + | :EXPRESS + | :PRIORITY + | :STANDARD + | :STANDARD_WITH_TRACKING + + module ShippingMethod + extend Lithic::Internal::Type::Enum + + SHIPPING_METHOD_2_DAY: :"2_DAY" + BULK: :BULK + EXPEDITED: :EXPEDITED + EXPRESS: :EXPRESS + PRIORITY: :PRIORITY + STANDARD: :STANDARD + STANDARD_WITH_TRACKING: :STANDARD_WITH_TRACKING + + def self?.values: -> ::Array[Lithic::Models::CardRenewParams::shipping_method] + end + end + end +end diff --git a/sig/lithic/models/card_renewed_webhook_event.rbs b/sig/lithic/models/card_renewed_webhook_event.rbs new file mode 100644 index 00000000..927d18c2 --- /dev/null +++ b/sig/lithic/models/card_renewed_webhook_event.rbs @@ -0,0 +1,55 @@ +module Lithic + module Models + type card_renewed_webhook_event = + { + event_type: :"card.renewed", + card_token: String, + exp_month: String, + exp_year: String, + previous_exp_month: String, + previous_exp_year: String + } + + class CardRenewedWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor event_type: :"card.renewed" + + attr_reader card_token: String? + + def card_token=: (String) -> String + + attr_reader exp_month: String? + + def exp_month=: (String) -> String + + attr_reader exp_year: String? + + def exp_year=: (String) -> String + + attr_reader previous_exp_month: String? + + def previous_exp_month=: (String) -> String + + attr_reader previous_exp_year: String? + + def previous_exp_year=: (String) -> String + + def initialize: ( + ?card_token: String, + ?exp_month: String, + ?exp_year: String, + ?previous_exp_month: String, + ?previous_exp_year: String, + ?event_type: :"card.renewed" + ) -> void + + def to_hash: -> { + event_type: :"card.renewed", + card_token: String, + exp_month: String, + exp_year: String, + previous_exp_month: String, + previous_exp_year: String + } + end + end +end diff --git a/sig/lithic/models/card_retrieve_params.rbs b/sig/lithic/models/card_retrieve_params.rbs new file mode 100644 index 00000000..742754a6 --- /dev/null +++ b/sig/lithic/models/card_retrieve_params.rbs @@ -0,0 +1,23 @@ +module Lithic + module Models + type card_retrieve_params = + { card_token: String } & Lithic::Internal::Type::request_parameters + + class CardRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor card_token: String + + def initialize: ( + card_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + card_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/card_retrieve_signals_params.rbs b/sig/lithic/models/card_retrieve_signals_params.rbs new file mode 100644 index 00000000..d801feaf --- /dev/null +++ b/sig/lithic/models/card_retrieve_signals_params.rbs @@ -0,0 +1,23 @@ +module Lithic + module Models + type card_retrieve_signals_params = + { card_token: String } & Lithic::Internal::Type::request_parameters + + class CardRetrieveSignalsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor card_token: String + + def initialize: ( + card_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + card_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/card_retrieve_spend_limits_params.rbs b/sig/lithic/models/card_retrieve_spend_limits_params.rbs new file mode 100644 index 00000000..e9cc96a4 --- /dev/null +++ b/sig/lithic/models/card_retrieve_spend_limits_params.rbs @@ -0,0 +1,23 @@ +module Lithic + module Models + type card_retrieve_spend_limits_params = + { card_token: String } & Lithic::Internal::Type::request_parameters + + class CardRetrieveSpendLimitsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor card_token: String + + def initialize: ( + card_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + card_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/card_search_by_pan_params.rbs b/sig/lithic/models/card_search_by_pan_params.rbs new file mode 100644 index 00000000..ae73feae --- /dev/null +++ b/sig/lithic/models/card_search_by_pan_params.rbs @@ -0,0 +1,20 @@ +module Lithic + module Models + type card_search_by_pan_params = + { pan: String } & Lithic::Internal::Type::request_parameters + + class CardSearchByPanParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor pan: String + + def initialize: ( + pan: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { pan: String, request_options: Lithic::RequestOptions } + end + end +end diff --git a/sig/lithic/models/card_shipped_webhook_event.rbs b/sig/lithic/models/card_shipped_webhook_event.rbs new file mode 100644 index 00000000..25a9e73c --- /dev/null +++ b/sig/lithic/models/card_shipped_webhook_event.rbs @@ -0,0 +1,71 @@ +module Lithic + module Models + type card_shipped_webhook_event = + { + bulk_order_token: String?, + card_token: String, + event_type: :"card.shipped", + shipping_method: Lithic::Models::CardShippedWebhookEvent::shipping_method, + tracking_number: String? + } + + class CardShippedWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor bulk_order_token: String? + + attr_accessor card_token: String + + attr_accessor event_type: :"card.shipped" + + attr_accessor shipping_method: Lithic::Models::CardShippedWebhookEvent::shipping_method + + attr_accessor tracking_number: String? + + def initialize: ( + bulk_order_token: String?, + card_token: String, + shipping_method: Lithic::Models::CardShippedWebhookEvent::shipping_method, + tracking_number: String?, + ?event_type: :"card.shipped" + ) -> void + + def to_hash: -> { + bulk_order_token: String?, + card_token: String, + event_type: :"card.shipped", + shipping_method: Lithic::Models::CardShippedWebhookEvent::shipping_method, + tracking_number: String? + } + + type shipping_method = + :"Ex-US expedited with tracking" + | :"Ex-US standard with tracking" + | :"Ex-US standard without tracking" + | :"FedEx 2 days" + | :"FedEx express" + | :"FedEx overnight" + | :"USPS priority" + | :"USPS with tracking" + | :"USPS without tracking envelope" + | :"USPS without tracking envelope non-machine" + | :"USPS without tracking flat" + + module ShippingMethod + extend Lithic::Internal::Type::Enum + + EX_US_EXPEDITED_WITH_TRACKING: :"Ex-US expedited with tracking" + EX_US_STANDARD_WITH_TRACKING: :"Ex-US standard with tracking" + EX_US_STANDARD_WITHOUT_TRACKING: :"Ex-US standard without tracking" + FED_EX_2_DAYS: :"FedEx 2 days" + FED_EX_EXPRESS: :"FedEx express" + FED_EX_OVERNIGHT: :"FedEx overnight" + USPS_PRIORITY: :"USPS priority" + USPS_WITH_TRACKING: :"USPS with tracking" + USPS_WITHOUT_TRACKING_ENVELOPE: :"USPS without tracking envelope" + USPS_WITHOUT_TRACKING_ENVELOPE_NON_MACHINE: :"USPS without tracking envelope non-machine" + USPS_WITHOUT_TRACKING_FLAT: :"USPS without tracking flat" + + def self?.values: -> ::Array[Lithic::Models::CardShippedWebhookEvent::shipping_method] + end + end + end +end diff --git a/sig/lithic/models/card_spend_limits.rbs b/sig/lithic/models/card_spend_limits.rbs new file mode 100644 index 00000000..be641c0f --- /dev/null +++ b/sig/lithic/models/card_spend_limits.rbs @@ -0,0 +1,125 @@ +module Lithic + module Models + type card_spend_limits = + { + available_spend_limit: Lithic::CardSpendLimits::AvailableSpendLimit, + spend_limit: Lithic::CardSpendLimits::SpendLimit, + spend_velocity: Lithic::CardSpendLimits::SpendVelocity + } + + class CardSpendLimits < Lithic::Internal::Type::BaseModel + attr_accessor available_spend_limit: Lithic::CardSpendLimits::AvailableSpendLimit + + attr_reader spend_limit: Lithic::CardSpendLimits::SpendLimit? + + def spend_limit=: ( + Lithic::CardSpendLimits::SpendLimit + ) -> Lithic::CardSpendLimits::SpendLimit + + attr_reader spend_velocity: Lithic::CardSpendLimits::SpendVelocity? + + def spend_velocity=: ( + Lithic::CardSpendLimits::SpendVelocity + ) -> Lithic::CardSpendLimits::SpendVelocity + + def initialize: ( + available_spend_limit: Lithic::CardSpendLimits::AvailableSpendLimit, + ?spend_limit: Lithic::CardSpendLimits::SpendLimit, + ?spend_velocity: Lithic::CardSpendLimits::SpendVelocity + ) -> void + + def to_hash: -> { + available_spend_limit: Lithic::CardSpendLimits::AvailableSpendLimit, + spend_limit: Lithic::CardSpendLimits::SpendLimit, + spend_velocity: Lithic::CardSpendLimits::SpendVelocity + } + + type available_spend_limit = + { annually: Integer, forever: Integer, monthly: Integer } + + class AvailableSpendLimit < Lithic::Internal::Type::BaseModel + attr_reader annually: Integer? + + def annually=: (Integer) -> Integer + + attr_reader forever: Integer? + + def forever=: (Integer) -> Integer + + attr_reader monthly: Integer? + + def monthly=: (Integer) -> Integer + + def initialize: ( + ?annually: Integer, + ?forever: Integer, + ?monthly: Integer + ) -> void + + def to_hash: -> { + annually: Integer, + forever: Integer, + monthly: Integer + } + end + + type spend_limit = + { annually: Integer, forever: Integer, monthly: Integer } + + class SpendLimit < Lithic::Internal::Type::BaseModel + attr_reader annually: Integer? + + def annually=: (Integer) -> Integer + + attr_reader forever: Integer? + + def forever=: (Integer) -> Integer + + attr_reader monthly: Integer? + + def monthly=: (Integer) -> Integer + + def initialize: ( + ?annually: Integer, + ?forever: Integer, + ?monthly: Integer + ) -> void + + def to_hash: -> { + annually: Integer, + forever: Integer, + monthly: Integer + } + end + + type spend_velocity = + { annually: Integer, forever: Integer, monthly: Integer } + + class SpendVelocity < Lithic::Internal::Type::BaseModel + attr_reader annually: Integer? + + def annually=: (Integer) -> Integer + + attr_reader forever: Integer? + + def forever=: (Integer) -> Integer + + attr_reader monthly: Integer? + + def monthly=: (Integer) -> Integer + + def initialize: ( + ?annually: Integer, + ?forever: Integer, + ?monthly: Integer + ) -> void + + def to_hash: -> { + annually: Integer, + forever: Integer, + monthly: Integer + } + end + end + end +end diff --git a/sig/lithic/models/card_transaction_enhanced_data_created_webhook_event.rbs b/sig/lithic/models/card_transaction_enhanced_data_created_webhook_event.rbs new file mode 100644 index 00000000..d3124b15 --- /dev/null +++ b/sig/lithic/models/card_transaction_enhanced_data_created_webhook_event.rbs @@ -0,0 +1,20 @@ +module Lithic + module Models + type card_transaction_enhanced_data_created_webhook_event = + { event_type: :"card_transaction.enhanced_data.created" } + + class CardTransactionEnhancedDataCreatedWebhookEvent < Lithic::Models::Transactions::Events::EnhancedData + def event_type: -> :"card_transaction.enhanced_data.created" + + def event_type=: ( + :"card_transaction.enhanced_data.created" _ + ) -> :"card_transaction.enhanced_data.created" + + def initialize: ( + ?event_type: :"card_transaction.enhanced_data.created" + ) -> void + + def to_hash: -> { event_type: :"card_transaction.enhanced_data.created" } + end + end +end diff --git a/sig/lithic/models/card_transaction_enhanced_data_updated_webhook_event.rbs b/sig/lithic/models/card_transaction_enhanced_data_updated_webhook_event.rbs new file mode 100644 index 00000000..2948d8dd --- /dev/null +++ b/sig/lithic/models/card_transaction_enhanced_data_updated_webhook_event.rbs @@ -0,0 +1,20 @@ +module Lithic + module Models + type card_transaction_enhanced_data_updated_webhook_event = + { event_type: :"card_transaction.enhanced_data.updated" } + + class CardTransactionEnhancedDataUpdatedWebhookEvent < Lithic::Models::Transactions::Events::EnhancedData + def event_type: -> :"card_transaction.enhanced_data.updated" + + def event_type=: ( + :"card_transaction.enhanced_data.updated" _ + ) -> :"card_transaction.enhanced_data.updated" + + def initialize: ( + ?event_type: :"card_transaction.enhanced_data.updated" + ) -> void + + def to_hash: -> { event_type: :"card_transaction.enhanced_data.updated" } + end + end +end diff --git a/sig/lithic/models/card_transaction_updated_webhook_event.rbs b/sig/lithic/models/card_transaction_updated_webhook_event.rbs new file mode 100644 index 00000000..2b9b9ec9 --- /dev/null +++ b/sig/lithic/models/card_transaction_updated_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type card_transaction_updated_webhook_event = + { event_type: :"card_transaction.updated" } + + class CardTransactionUpdatedWebhookEvent < Lithic::Models::Transaction + def event_type: -> :"card_transaction.updated" + + def event_type=: ( + :"card_transaction.updated" _ + ) -> :"card_transaction.updated" + + def initialize: (?event_type: :"card_transaction.updated") -> void + + def to_hash: -> { event_type: :"card_transaction.updated" } + end + end +end diff --git a/sig/lithic/models/card_update_params.rbs b/sig/lithic/models/card_update_params.rbs new file mode 100644 index 00000000..082ea872 --- /dev/null +++ b/sig/lithic/models/card_update_params.rbs @@ -0,0 +1,157 @@ +module Lithic + module Models + type card_update_params = + { + card_token: String, + comment: String, + digital_card_art_token: String, + memo: String, + network_program_token: String, + pin: String, + pin_status: Lithic::Models::CardUpdateParams::pin_status, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::spend_limit_duration, + state: Lithic::Models::CardUpdateParams::state, + substatus: Lithic::Models::CardUpdateParams::substatus + } + & Lithic::Internal::Type::request_parameters + + class CardUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor card_token: String + + attr_reader comment: String? + + def comment=: (String) -> String + + attr_reader digital_card_art_token: String? + + def digital_card_art_token=: (String) -> String + + attr_reader memo: String? + + def memo=: (String) -> String + + attr_reader network_program_token: String? + + def network_program_token=: (String) -> String + + attr_reader pin: String? + + def pin=: (String) -> String + + attr_reader pin_status: Lithic::Models::CardUpdateParams::pin_status? + + def pin_status=: ( + Lithic::Models::CardUpdateParams::pin_status + ) -> Lithic::Models::CardUpdateParams::pin_status + + attr_reader spend_limit: Integer? + + def spend_limit=: (Integer) -> Integer + + attr_reader spend_limit_duration: Lithic::Models::spend_limit_duration? + + def spend_limit_duration=: ( + Lithic::Models::spend_limit_duration + ) -> Lithic::Models::spend_limit_duration + + attr_reader state: Lithic::Models::CardUpdateParams::state? + + def state=: ( + Lithic::Models::CardUpdateParams::state + ) -> Lithic::Models::CardUpdateParams::state + + attr_reader substatus: Lithic::Models::CardUpdateParams::substatus? + + def substatus=: ( + Lithic::Models::CardUpdateParams::substatus + ) -> Lithic::Models::CardUpdateParams::substatus + + def initialize: ( + card_token: String, + ?comment: String, + ?digital_card_art_token: String, + ?memo: String, + ?network_program_token: String, + ?pin: String, + ?pin_status: Lithic::Models::CardUpdateParams::pin_status, + ?spend_limit: Integer, + ?spend_limit_duration: Lithic::Models::spend_limit_duration, + ?state: Lithic::Models::CardUpdateParams::state, + ?substatus: Lithic::Models::CardUpdateParams::substatus, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + card_token: String, + comment: String, + digital_card_art_token: String, + memo: String, + network_program_token: String, + pin: String, + pin_status: Lithic::Models::CardUpdateParams::pin_status, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::spend_limit_duration, + state: Lithic::Models::CardUpdateParams::state, + substatus: Lithic::Models::CardUpdateParams::substatus, + request_options: Lithic::RequestOptions + } + + type pin_status = :OK + + module PinStatus + extend Lithic::Internal::Type::Enum + + OK: :OK + + def self?.values: -> ::Array[Lithic::Models::CardUpdateParams::pin_status] + end + + type state = :CLOSED | :OPEN | :PAUSED + + module State + extend Lithic::Internal::Type::Enum + + CLOSED: :CLOSED + OPEN: :OPEN + PAUSED: :PAUSED + + def self?.values: -> ::Array[Lithic::Models::CardUpdateParams::state] + end + + type substatus = + :LOST + | :COMPROMISED + | :DAMAGED + | :END_USER_REQUEST + | :ISSUER_REQUEST + | :NOT_ACTIVE + | :SUSPICIOUS_ACTIVITY + | :INTERNAL_REVIEW + | :EXPIRED + | :UNDELIVERABLE + | :OTHER + + module Substatus + extend Lithic::Internal::Type::Enum + + LOST: :LOST + COMPROMISED: :COMPROMISED + DAMAGED: :DAMAGED + END_USER_REQUEST: :END_USER_REQUEST + ISSUER_REQUEST: :ISSUER_REQUEST + NOT_ACTIVE: :NOT_ACTIVE + SUSPICIOUS_ACTIVITY: :SUSPICIOUS_ACTIVITY + INTERNAL_REVIEW: :INTERNAL_REVIEW + EXPIRED: :EXPIRED + UNDELIVERABLE: :UNDELIVERABLE + OTHER: :OTHER + + def self?.values: -> ::Array[Lithic::Models::CardUpdateParams::substatus] + end + end + end +end diff --git a/sig/lithic/models/card_updated_webhook_event.rbs b/sig/lithic/models/card_updated_webhook_event.rbs new file mode 100644 index 00000000..ec768914 --- /dev/null +++ b/sig/lithic/models/card_updated_webhook_event.rbs @@ -0,0 +1,35 @@ +module Lithic + module Models + type card_updated_webhook_event = + { + card_token: String, + event_type: :"card.updated", + previous_fields: top, + state: String + } + + class CardUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor card_token: String + + attr_accessor event_type: :"card.updated" + + attr_accessor previous_fields: top + + attr_accessor state: String + + def initialize: ( + card_token: String, + previous_fields: top, + state: String, + ?event_type: :"card.updated" + ) -> void + + def to_hash: -> { + card_token: String, + event_type: :"card.updated", + previous_fields: top, + state: String + } + end + end +end diff --git a/sig/lithic/models/card_web_provision_params.rbs b/sig/lithic/models/card_web_provision_params.rbs new file mode 100644 index 00000000..f76beedd --- /dev/null +++ b/sig/lithic/models/card_web_provision_params.rbs @@ -0,0 +1,67 @@ +module Lithic + module Models + type card_web_provision_params = + { + card_token: String, + client_device_id: String, + client_wallet_account_id: String, + digital_wallet: Lithic::Models::CardWebProvisionParams::digital_wallet, + server_session_id: String + } + & Lithic::Internal::Type::request_parameters + + class CardWebProvisionParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor card_token: String + + attr_reader client_device_id: String? + + def client_device_id=: (String) -> String + + attr_reader client_wallet_account_id: String? + + def client_wallet_account_id=: (String) -> String + + attr_reader digital_wallet: Lithic::Models::CardWebProvisionParams::digital_wallet? + + def digital_wallet=: ( + Lithic::Models::CardWebProvisionParams::digital_wallet + ) -> Lithic::Models::CardWebProvisionParams::digital_wallet + + attr_reader server_session_id: String? + + def server_session_id=: (String) -> String + + def initialize: ( + card_token: String, + ?client_device_id: String, + ?client_wallet_account_id: String, + ?digital_wallet: Lithic::Models::CardWebProvisionParams::digital_wallet, + ?server_session_id: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + card_token: String, + client_device_id: String, + client_wallet_account_id: String, + digital_wallet: Lithic::Models::CardWebProvisionParams::digital_wallet, + server_session_id: String, + request_options: Lithic::RequestOptions + } + + type digital_wallet = :APPLE_PAY | :GOOGLE_PAY + + module DigitalWallet + extend Lithic::Internal::Type::Enum + + APPLE_PAY: :APPLE_PAY + GOOGLE_PAY: :GOOGLE_PAY + + def self?.values: -> ::Array[Lithic::Models::CardWebProvisionParams::digital_wallet] + end + end + end +end diff --git a/sig/lithic/models/card_web_provision_response.rbs b/sig/lithic/models/card_web_provision_response.rbs new file mode 100644 index 00000000..2f4fa578 --- /dev/null +++ b/sig/lithic/models/card_web_provision_response.rbs @@ -0,0 +1,106 @@ +module Lithic + module Models + type card_web_provision_response = + Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse + | Lithic::Models::CardWebProvisionResponse::GoogleWebPushProvisioningResponse + + module CardWebProvisionResponse + extend Lithic::Internal::Type::Union + + type apple_web_push_provisioning_response = + { + jws: Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws, + state: String + } + + class AppleWebPushProvisioningResponse < Lithic::Internal::Type::BaseModel + attr_accessor jws: Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws + + attr_accessor state: String + + def initialize: ( + jws: Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws, + state: String + ) -> void + + def to_hash: -> { + jws: Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws, + state: String + } + + type jws = + { + header: Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws::Header, + payload: String, + protected: String, + signature: String + } + + class Jws < Lithic::Internal::Type::BaseModel + attr_reader header: Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws::Header? + + def header=: ( + Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws::Header + ) -> Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws::Header + + attr_reader payload: String? + + def payload=: (String) -> String + + attr_reader protected: String? + + def protected=: (String) -> String + + attr_reader signature: String? + + def signature=: (String) -> String + + def initialize: ( + ?header: Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws::Header, + ?payload: String, + ?protected: String, + ?signature: String + ) -> void + + def to_hash: -> { + header: Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse::Jws::Header, + payload: String, + protected: String, + signature: String + } + + type header = { kid: String } + + class Header < Lithic::Internal::Type::BaseModel + attr_reader kid: String? + + def kid=: (String) -> String + + def initialize: (?kid: String) -> void + + def to_hash: -> { kid: String } + end + end + end + + type google_web_push_provisioning_response = + { google_opc: String, tsp_opc: String } + + class GoogleWebPushProvisioningResponse < Lithic::Internal::Type::BaseModel + attr_reader google_opc: String? + + def google_opc=: (String) -> String + + attr_reader tsp_opc: String? + + def tsp_opc=: (String) -> String + + def initialize: (?google_opc: String, ?tsp_opc: String) -> void + + def to_hash: -> { google_opc: String, tsp_opc: String } + end + + def self?.variants: -> ::Array[Lithic::Models::card_web_provision_response] + end + end +end diff --git a/sig/lithic/models/cardholder_authentication.rbs b/sig/lithic/models/cardholder_authentication.rbs new file mode 100644 index 00000000..062f4c47 --- /dev/null +++ b/sig/lithic/models/cardholder_authentication.rbs @@ -0,0 +1,98 @@ +module Lithic + module Models + type cardholder_authentication = + { + authentication_method: Lithic::Models::CardholderAuthentication::authentication_method, + authentication_result: Lithic::Models::CardholderAuthentication::authentication_result, + decision_made_by: Lithic::Models::CardholderAuthentication::decision_made_by, + liability_shift: Lithic::Models::CardholderAuthentication::liability_shift, + three_ds_authentication_token: String? + } + + class CardholderAuthentication < Lithic::Internal::Type::BaseModel + attr_accessor authentication_method: Lithic::Models::CardholderAuthentication::authentication_method + + attr_accessor authentication_result: Lithic::Models::CardholderAuthentication::authentication_result + + attr_accessor decision_made_by: Lithic::Models::CardholderAuthentication::decision_made_by + + attr_accessor liability_shift: Lithic::Models::CardholderAuthentication::liability_shift + + attr_accessor three_ds_authentication_token: String? + + def initialize: ( + authentication_method: Lithic::Models::CardholderAuthentication::authentication_method, + authentication_result: Lithic::Models::CardholderAuthentication::authentication_result, + decision_made_by: Lithic::Models::CardholderAuthentication::decision_made_by, + liability_shift: Lithic::Models::CardholderAuthentication::liability_shift, + three_ds_authentication_token: String? + ) -> void + + def to_hash: -> { + authentication_method: Lithic::Models::CardholderAuthentication::authentication_method, + authentication_result: Lithic::Models::CardholderAuthentication::authentication_result, + decision_made_by: Lithic::Models::CardholderAuthentication::decision_made_by, + liability_shift: Lithic::Models::CardholderAuthentication::liability_shift, + three_ds_authentication_token: String? + } + + type authentication_method = :FRICTIONLESS | :CHALLENGE | :NONE + + module AuthenticationMethod + extend Lithic::Internal::Type::Enum + + FRICTIONLESS: :FRICTIONLESS + CHALLENGE: :CHALLENGE + NONE: :NONE + + def self?.values: -> ::Array[Lithic::Models::CardholderAuthentication::authentication_method] + end + + type authentication_result = :ATTEMPTS | :DECLINE | :NONE | :SUCCESS + + module AuthenticationResult + extend Lithic::Internal::Type::Enum + + ATTEMPTS: :ATTEMPTS + DECLINE: :DECLINE + NONE: :NONE + SUCCESS: :SUCCESS + + def self?.values: -> ::Array[Lithic::Models::CardholderAuthentication::authentication_result] + end + + type decision_made_by = + :CUSTOMER_RULES + | :CUSTOMER_ENDPOINT + | :LITHIC_DEFAULT + | :LITHIC_RULES + | :NETWORK + | :UNKNOWN + + module DecisionMadeBy + extend Lithic::Internal::Type::Enum + + CUSTOMER_RULES: :CUSTOMER_RULES + CUSTOMER_ENDPOINT: :CUSTOMER_ENDPOINT + LITHIC_DEFAULT: :LITHIC_DEFAULT + LITHIC_RULES: :LITHIC_RULES + NETWORK: :NETWORK + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::CardholderAuthentication::decision_made_by] + end + + type liability_shift = :"3DS_AUTHENTICATED" | :TOKEN_AUTHENTICATED | :NONE + + module LiabilityShift + extend Lithic::Internal::Type::Enum + + LIABILITY_SHIFT_3DS_AUTHENTICATED: :"3DS_AUTHENTICATED" + TOKEN_AUTHENTICATED: :TOKEN_AUTHENTICATED + NONE: :NONE + + def self?.values: -> ::Array[Lithic::Models::CardholderAuthentication::liability_shift] + end + end + end +end diff --git a/sig/lithic/models/cards/balance_list_params.rbs b/sig/lithic/models/cards/balance_list_params.rbs new file mode 100644 index 00000000..84eb6a99 --- /dev/null +++ b/sig/lithic/models/cards/balance_list_params.rbs @@ -0,0 +1,42 @@ +module Lithic + module Models + module Cards + type balance_list_params = + { + card_token: String, + balance_date: Time, + last_transaction_event_token: String + } + & Lithic::Internal::Type::request_parameters + + class BalanceListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor card_token: String + + attr_reader balance_date: Time? + + def balance_date=: (Time) -> Time + + attr_reader last_transaction_event_token: String? + + def last_transaction_event_token=: (String) -> String + + def initialize: ( + card_token: String, + ?balance_date: Time, + ?last_transaction_event_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + card_token: String, + balance_date: Time, + last_transaction_event_token: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/cards/financial_transaction_list_params.rbs b/sig/lithic/models/cards/financial_transaction_list_params.rbs new file mode 100644 index 00000000..057c32e4 --- /dev/null +++ b/sig/lithic/models/cards/financial_transaction_list_params.rbs @@ -0,0 +1,121 @@ +module Lithic + module Models + module Cards + type financial_transaction_list_params = + { + card_token: String, + begin_: Time, + category: Lithic::Models::Cards::FinancialTransactionListParams::category, + end_: Time, + ending_before: String, + result: Lithic::Models::Cards::FinancialTransactionListParams::result, + starting_after: String, + status: Lithic::Models::Cards::FinancialTransactionListParams::status + } + & Lithic::Internal::Type::request_parameters + + class FinancialTransactionListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor card_token: String + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader category: Lithic::Models::Cards::FinancialTransactionListParams::category? + + def category=: ( + Lithic::Models::Cards::FinancialTransactionListParams::category + ) -> Lithic::Models::Cards::FinancialTransactionListParams::category + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader result: Lithic::Models::Cards::FinancialTransactionListParams::result? + + def result=: ( + Lithic::Models::Cards::FinancialTransactionListParams::result + ) -> Lithic::Models::Cards::FinancialTransactionListParams::result + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader status: Lithic::Models::Cards::FinancialTransactionListParams::status? + + def status=: ( + Lithic::Models::Cards::FinancialTransactionListParams::status + ) -> Lithic::Models::Cards::FinancialTransactionListParams::status + + def initialize: ( + card_token: String, + ?begin_: Time, + ?category: Lithic::Models::Cards::FinancialTransactionListParams::category, + ?end_: Time, + ?ending_before: String, + ?result: Lithic::Models::Cards::FinancialTransactionListParams::result, + ?starting_after: String, + ?status: Lithic::Models::Cards::FinancialTransactionListParams::status, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + card_token: String, + begin_: Time, + category: Lithic::Models::Cards::FinancialTransactionListParams::category, + end_: Time, + ending_before: String, + result: Lithic::Models::Cards::FinancialTransactionListParams::result, + starting_after: String, + status: Lithic::Models::Cards::FinancialTransactionListParams::status, + request_options: Lithic::RequestOptions + } + + type category = :CARD | :TRANSFER + + module Category + extend Lithic::Internal::Type::Enum + + CARD: :CARD + TRANSFER: :TRANSFER + + def self?.values: -> ::Array[Lithic::Models::Cards::FinancialTransactionListParams::category] + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::Cards::FinancialTransactionListParams::result] + end + + type status = + :DECLINED | :EXPIRED | :PENDING | :RETURNED | :SETTLED | :VOIDED + + module Status + extend Lithic::Internal::Type::Enum + + DECLINED: :DECLINED + EXPIRED: :EXPIRED + PENDING: :PENDING + RETURNED: :RETURNED + SETTLED: :SETTLED + VOIDED: :VOIDED + + def self?.values: -> ::Array[Lithic::Models::Cards::FinancialTransactionListParams::status] + end + end + end + end +end diff --git a/sig/lithic/models/cards/financial_transaction_retrieve_params.rbs b/sig/lithic/models/cards/financial_transaction_retrieve_params.rbs new file mode 100644 index 00000000..4ec37044 --- /dev/null +++ b/sig/lithic/models/cards/financial_transaction_retrieve_params.rbs @@ -0,0 +1,30 @@ +module Lithic + module Models + module Cards + type financial_transaction_retrieve_params = + { card_token: String, financial_transaction_token: String } + & Lithic::Internal::Type::request_parameters + + class FinancialTransactionRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor card_token: String + + attr_accessor financial_transaction_token: String + + def initialize: ( + card_token: String, + financial_transaction_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + card_token: String, + financial_transaction_token: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/carrier.rbs b/sig/lithic/models/carrier.rbs new file mode 100644 index 00000000..d224bac9 --- /dev/null +++ b/sig/lithic/models/carrier.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type carrier = { qr_code_url: String } + + class Carrier < Lithic::Internal::Type::BaseModel + attr_reader qr_code_url: String? + + def qr_code_url=: (String) -> String + + def initialize: (?qr_code_url: String) -> void + + def to_hash: -> { qr_code_url: String } + end + end +end diff --git a/sig/lithic/models/category_details.rbs b/sig/lithic/models/category_details.rbs new file mode 100644 index 00000000..36a6d750 --- /dev/null +++ b/sig/lithic/models/category_details.rbs @@ -0,0 +1,26 @@ +module Lithic + module Models + type category_details = + { balance_transfers: String, cash_advances: String, purchases: String } + + class CategoryDetails < Lithic::Internal::Type::BaseModel + attr_accessor balance_transfers: String + + attr_accessor cash_advances: String + + attr_accessor purchases: String + + def initialize: ( + balance_transfers: String, + cash_advances: String, + purchases: String + ) -> void + + def to_hash: -> { + balance_transfers: String, + cash_advances: String, + purchases: String + } + end + end +end diff --git a/sig/lithic/models/client_api_status_params.rbs b/sig/lithic/models/client_api_status_params.rbs new file mode 100644 index 00000000..176bed32 --- /dev/null +++ b/sig/lithic/models/client_api_status_params.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type client_api_status_params = + { } & Lithic::Internal::Type::request_parameters + + class ClientAPIStatusParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> { request_options: Lithic::RequestOptions } + end + end +end diff --git a/sig/lithic/models/credit_products/extended_credit.rbs b/sig/lithic/models/credit_products/extended_credit.rbs new file mode 100644 index 00000000..51005ff8 --- /dev/null +++ b/sig/lithic/models/credit_products/extended_credit.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + module CreditProducts + type credit_products_extended_credit = { credit_extended: Integer } + + class CreditProductsExtendedCredit < Lithic::Internal::Type::BaseModel + attr_accessor credit_extended: Integer + + def initialize: (credit_extended: Integer) -> void + + def to_hash: -> { credit_extended: Integer } + end + end + end +end diff --git a/sig/lithic/models/credit_products/extended_credit_retrieve_params.rbs b/sig/lithic/models/credit_products/extended_credit_retrieve_params.rbs new file mode 100644 index 00000000..784119ff --- /dev/null +++ b/sig/lithic/models/credit_products/extended_credit_retrieve_params.rbs @@ -0,0 +1,26 @@ +module Lithic + module Models + module CreditProducts + type extended_credit_retrieve_params = + { credit_product_token: String } + & Lithic::Internal::Type::request_parameters + + class ExtendedCreditRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor credit_product_token: String + + def initialize: ( + credit_product_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + credit_product_token: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/credit_products/prime_rate_create_params.rbs b/sig/lithic/models/credit_products/prime_rate_create_params.rbs new file mode 100644 index 00000000..8e9875ce --- /dev/null +++ b/sig/lithic/models/credit_products/prime_rate_create_params.rbs @@ -0,0 +1,34 @@ +module Lithic + module Models + module CreditProducts + type prime_rate_create_params = + { credit_product_token: String, effective_date: Date, rate: String } + & Lithic::Internal::Type::request_parameters + + class PrimeRateCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor credit_product_token: String + + attr_accessor effective_date: Date + + attr_accessor rate: String + + def initialize: ( + credit_product_token: String, + effective_date: Date, + rate: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + credit_product_token: String, + effective_date: Date, + rate: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/credit_products/prime_rate_retrieve_params.rbs b/sig/lithic/models/credit_products/prime_rate_retrieve_params.rbs new file mode 100644 index 00000000..e4dd4987 --- /dev/null +++ b/sig/lithic/models/credit_products/prime_rate_retrieve_params.rbs @@ -0,0 +1,42 @@ +module Lithic + module Models + module CreditProducts + type prime_rate_retrieve_params = + { + credit_product_token: String, + ending_before: Date, + starting_after: Date + } + & Lithic::Internal::Type::request_parameters + + class PrimeRateRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor credit_product_token: String + + attr_reader ending_before: Date? + + def ending_before=: (Date) -> Date + + attr_reader starting_after: Date? + + def starting_after=: (Date) -> Date + + def initialize: ( + credit_product_token: String, + ?ending_before: Date, + ?starting_after: Date, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + credit_product_token: String, + ending_before: Date, + starting_after: Date, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/credit_products/prime_rate_retrieve_response.rbs b/sig/lithic/models/credit_products/prime_rate_retrieve_response.rbs new file mode 100644 index 00000000..87437e45 --- /dev/null +++ b/sig/lithic/models/credit_products/prime_rate_retrieve_response.rbs @@ -0,0 +1,39 @@ +module Lithic + module Models + module CreditProducts + type prime_rate_retrieve_response = + { + data: ::Array[Lithic::Models::CreditProducts::PrimeRateRetrieveResponse::Data], + has_more: bool + } + + class PrimeRateRetrieveResponse < Lithic::Internal::Type::BaseModel + attr_accessor data: ::Array[Lithic::Models::CreditProducts::PrimeRateRetrieveResponse::Data] + + attr_accessor has_more: bool + + def initialize: ( + data: ::Array[Lithic::Models::CreditProducts::PrimeRateRetrieveResponse::Data], + has_more: bool + ) -> void + + def to_hash: -> { + data: ::Array[Lithic::Models::CreditProducts::PrimeRateRetrieveResponse::Data], + has_more: bool + } + + type data = { effective_date: Date, rate: String } + + class Data < Lithic::Internal::Type::BaseModel + attr_accessor effective_date: Date + + attr_accessor rate: String + + def initialize: (effective_date: Date, rate: String) -> void + + def to_hash: -> { effective_date: Date, rate: String } + end + end + end + end +end diff --git a/sig/lithic/models/currency.rbs b/sig/lithic/models/currency.rbs new file mode 100644 index 00000000..b7788818 --- /dev/null +++ b/sig/lithic/models/currency.rbs @@ -0,0 +1,5 @@ +module Lithic + module Models + class Currency = String + end +end diff --git a/sig/lithic/models/device.rbs b/sig/lithic/models/device.rbs new file mode 100644 index 00000000..5ae2b6b8 --- /dev/null +++ b/sig/lithic/models/device.rbs @@ -0,0 +1,21 @@ +module Lithic + module Models + type device = { imei: String?, ip_address: String?, location: String? } + + class Device < Lithic::Internal::Type::BaseModel + attr_accessor imei: String? + + attr_accessor ip_address: String? + + attr_accessor location: String? + + def initialize: ( + imei: String?, + ip_address: String?, + location: String? + ) -> void + + def to_hash: -> { imei: String?, ip_address: String?, location: String? } + end + end +end diff --git a/sig/lithic/models/digital_card_art.rbs b/sig/lithic/models/digital_card_art.rbs new file mode 100644 index 00000000..5c6ba096 --- /dev/null +++ b/sig/lithic/models/digital_card_art.rbs @@ -0,0 +1,63 @@ +module Lithic + module Models + type digital_card_art_api = + { + token: String, + card_program_token: String, + created: Time, + description: String, + is_enabled: bool, + network: Lithic::Models::DigitalCardArtAPI::network, + is_card_program_default: bool + } + + class DigitalCardArtAPI < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor card_program_token: String + + attr_accessor created: Time + + attr_accessor description: String + + attr_accessor is_enabled: bool + + attr_accessor network: Lithic::Models::DigitalCardArtAPI::network + + attr_reader is_card_program_default: bool? + + def is_card_program_default=: (bool) -> bool + + def initialize: ( + token: String, + card_program_token: String, + created: Time, + description: String, + is_enabled: bool, + network: Lithic::Models::DigitalCardArtAPI::network, + ?is_card_program_default: bool + ) -> void + + def to_hash: -> { + token: String, + card_program_token: String, + created: Time, + description: String, + is_enabled: bool, + network: Lithic::Models::DigitalCardArtAPI::network, + is_card_program_default: bool + } + + type network = :MASTERCARD | :VISA + + module Network + extend Lithic::Internal::Type::Enum + + MASTERCARD: :MASTERCARD + VISA: :VISA + + def self?.values: -> ::Array[Lithic::Models::DigitalCardArtAPI::network] + end + end + end +end diff --git a/sig/lithic/models/digital_card_art_list_params.rbs b/sig/lithic/models/digital_card_art_list_params.rbs new file mode 100644 index 00000000..5b3c4bc3 --- /dev/null +++ b/sig/lithic/models/digital_card_art_list_params.rbs @@ -0,0 +1,38 @@ +module Lithic + module Models + type digital_card_art_list_params = + { ending_before: String, page_size: Integer, starting_after: String } + & Lithic::Internal::Type::request_parameters + + class DigitalCardArtListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/digital_card_art_retrieve_params.rbs b/sig/lithic/models/digital_card_art_retrieve_params.rbs new file mode 100644 index 00000000..1e730bc0 --- /dev/null +++ b/sig/lithic/models/digital_card_art_retrieve_params.rbs @@ -0,0 +1,24 @@ +module Lithic + module Models + type digital_card_art_retrieve_params = + { digital_card_art_token: String } + & Lithic::Internal::Type::request_parameters + + class DigitalCardArtRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor digital_card_art_token: String + + def initialize: ( + digital_card_art_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + digital_card_art_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/digital_wallet_tokenization_approval_request_webhook_event.rbs b/sig/lithic/models/digital_wallet_tokenization_approval_request_webhook_event.rbs new file mode 100644 index 00000000..95ccc906 --- /dev/null +++ b/sig/lithic/models/digital_wallet_tokenization_approval_request_webhook_event.rbs @@ -0,0 +1,219 @@ +module Lithic + module Models + type digital_wallet_tokenization_approval_request_webhook_event = + { + account_token: String, + card_token: String, + created: Time, + digital_wallet_token_metadata: Lithic::TokenMetadata, + event_type: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::event_type, + issuer_decision: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::issuer_decision, + tokenization_channel: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::tokenization_channel, + tokenization_token: String, + wallet_decisioning_info: Lithic::WalletDecisioningInfo, + customer_tokenization_decision: Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision?, + device: Lithic::Device, + rule_results: ::Array[Lithic::TokenizationRuleResult], + tokenization_decline_reasons: ::Array[Lithic::Models::tokenization_decline_reason], + tokenization_source: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::tokenization_source, + tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason] + } + + class DigitalWalletTokenizationApprovalRequestWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor account_token: String + + attr_accessor card_token: String + + attr_accessor created: Time + + attr_accessor digital_wallet_token_metadata: Lithic::TokenMetadata + + attr_accessor event_type: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::event_type + + attr_accessor issuer_decision: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::issuer_decision + + attr_accessor tokenization_channel: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::tokenization_channel + + attr_accessor tokenization_token: String + + attr_accessor wallet_decisioning_info: Lithic::WalletDecisioningInfo + + attr_accessor customer_tokenization_decision: Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision? + + attr_reader device: Lithic::Device? + + def device=: (Lithic::Device) -> Lithic::Device + + attr_reader rule_results: ::Array[Lithic::TokenizationRuleResult]? + + def rule_results=: ( + ::Array[Lithic::TokenizationRuleResult] + ) -> ::Array[Lithic::TokenizationRuleResult] + + attr_reader tokenization_decline_reasons: ::Array[Lithic::Models::tokenization_decline_reason]? + + def tokenization_decline_reasons=: ( + ::Array[Lithic::Models::tokenization_decline_reason] + ) -> ::Array[Lithic::Models::tokenization_decline_reason] + + attr_reader tokenization_source: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::tokenization_source? + + def tokenization_source=: ( + Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::tokenization_source + ) -> Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::tokenization_source + + attr_reader tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason]? + + def tokenization_tfa_reasons=: ( + ::Array[Lithic::Models::tokenization_tfa_reason] + ) -> ::Array[Lithic::Models::tokenization_tfa_reason] + + def initialize: ( + account_token: String, + card_token: String, + created: Time, + digital_wallet_token_metadata: Lithic::TokenMetadata, + event_type: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::event_type, + issuer_decision: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::issuer_decision, + tokenization_channel: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::tokenization_channel, + tokenization_token: String, + wallet_decisioning_info: Lithic::WalletDecisioningInfo, + ?customer_tokenization_decision: Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision?, + ?device: Lithic::Device, + ?rule_results: ::Array[Lithic::TokenizationRuleResult], + ?tokenization_decline_reasons: ::Array[Lithic::Models::tokenization_decline_reason], + ?tokenization_source: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::tokenization_source, + ?tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason] + ) -> void + + def to_hash: -> { + account_token: String, + card_token: String, + created: Time, + digital_wallet_token_metadata: Lithic::TokenMetadata, + event_type: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::event_type, + issuer_decision: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::issuer_decision, + tokenization_channel: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::tokenization_channel, + tokenization_token: String, + wallet_decisioning_info: Lithic::WalletDecisioningInfo, + customer_tokenization_decision: Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision?, + device: Lithic::Device, + rule_results: ::Array[Lithic::TokenizationRuleResult], + tokenization_decline_reasons: ::Array[Lithic::Models::tokenization_decline_reason], + tokenization_source: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::tokenization_source, + tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason] + } + + type event_type = :"digital_wallet.tokenization_approval_request" + + module EventType + extend Lithic::Internal::Type::Enum + + DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST: :"digital_wallet.tokenization_approval_request" + + def self?.values: -> ::Array[Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::event_type] + end + + type issuer_decision = :APPROVED | :DENIED | :VERIFICATION_REQUIRED + + module IssuerDecision + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DENIED: :DENIED + VERIFICATION_REQUIRED: :VERIFICATION_REQUIRED + + def self?.values: -> ::Array[Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::issuer_decision] + end + + type tokenization_channel = :DIGITAL_WALLET | :MERCHANT + + module TokenizationChannel + extend Lithic::Internal::Type::Enum + + DIGITAL_WALLET: :DIGITAL_WALLET + MERCHANT: :MERCHANT + + def self?.values: -> ::Array[Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::tokenization_channel] + end + + type customer_tokenization_decision = + { + outcome: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::outcome, + responder_url: String, + latency: String, + response_code: String + } + + class CustomerTokenizationDecision < Lithic::Internal::Type::BaseModel + attr_accessor outcome: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::outcome + + attr_accessor responder_url: String + + attr_reader latency: String? + + def latency=: (String) -> String + + attr_reader response_code: String? + + def response_code=: (String) -> String + + def initialize: ( + outcome: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::outcome, + responder_url: String, + ?latency: String, + ?response_code: String + ) -> void + + def to_hash: -> { + outcome: Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::outcome, + responder_url: String, + latency: String, + response_code: String + } + + type outcome = + :APPROVED + | :DECLINED + | :ERROR + | :INVALID_RESPONSE + | :REQUIRE_ADDITIONAL_AUTHENTICATION + | :TIMEOUT + + module Outcome + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + ERROR: :ERROR + INVALID_RESPONSE: :INVALID_RESPONSE + REQUIRE_ADDITIONAL_AUTHENTICATION: :REQUIRE_ADDITIONAL_AUTHENTICATION + TIMEOUT: :TIMEOUT + + def self?.values: -> ::Array[Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::outcome] + end + end + + type tokenization_source = + :ACCOUNT_ON_FILE + | :CONTACTLESS_TAP + | :MANUAL_PROVISION + | :PUSH_PROVISION + | :TOKEN + | :UNKNOWN + + module TokenizationSource + extend Lithic::Internal::Type::Enum + + ACCOUNT_ON_FILE: :ACCOUNT_ON_FILE + CONTACTLESS_TAP: :CONTACTLESS_TAP + MANUAL_PROVISION: :MANUAL_PROVISION + PUSH_PROVISION: :PUSH_PROVISION + TOKEN: :TOKEN + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::DigitalWalletTokenizationApprovalRequestWebhookEvent::tokenization_source] + end + end + end +end diff --git a/sig/lithic/models/digital_wallet_tokenization_result_webhook_event.rbs b/sig/lithic/models/digital_wallet_tokenization_result_webhook_event.rbs new file mode 100644 index 00000000..75fb9f5d --- /dev/null +++ b/sig/lithic/models/digital_wallet_tokenization_result_webhook_event.rbs @@ -0,0 +1,133 @@ +module Lithic + module Models + type digital_wallet_tokenization_result_webhook_event = + { + account_token: String, + card_token: String, + created: Time, + event_type: :"digital_wallet.tokenization_result", + tokenization_result_details: Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails, + tokenization_token: String + } + + class DigitalWalletTokenizationResultWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor account_token: String + + attr_accessor card_token: String + + attr_accessor created: Time + + attr_accessor event_type: :"digital_wallet.tokenization_result" + + attr_accessor tokenization_result_details: Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails + + attr_accessor tokenization_token: String + + def initialize: ( + account_token: String, + card_token: String, + created: Time, + tokenization_result_details: Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails, + tokenization_token: String, + ?event_type: :"digital_wallet.tokenization_result" + ) -> void + + def to_hash: -> { + account_token: String, + card_token: String, + created: Time, + event_type: :"digital_wallet.tokenization_result", + tokenization_result_details: Lithic::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails, + tokenization_token: String + } + + type tokenization_result_details = + { + issuer_decision: String, + tokenization_decline_reasons: ::Array[Lithic::Models::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::tokenization_decline_reason], + customer_decision: String?, + rule_results: ::Array[Lithic::TokenizationRuleResult], + token_activated_date_time: Time?, + tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason], + wallet_decision: String? + } + + class TokenizationResultDetails < Lithic::Internal::Type::BaseModel + attr_accessor issuer_decision: String + + attr_accessor tokenization_decline_reasons: ::Array[Lithic::Models::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::tokenization_decline_reason] + + attr_accessor customer_decision: String? + + attr_reader rule_results: ::Array[Lithic::TokenizationRuleResult]? + + def rule_results=: ( + ::Array[Lithic::TokenizationRuleResult] + ) -> ::Array[Lithic::TokenizationRuleResult] + + attr_accessor token_activated_date_time: Time? + + attr_reader tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason]? + + def tokenization_tfa_reasons=: ( + ::Array[Lithic::Models::tokenization_tfa_reason] + ) -> ::Array[Lithic::Models::tokenization_tfa_reason] + + attr_accessor wallet_decision: String? + + def initialize: ( + issuer_decision: String, + tokenization_decline_reasons: ::Array[Lithic::Models::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::tokenization_decline_reason], + ?customer_decision: String?, + ?rule_results: ::Array[Lithic::TokenizationRuleResult], + ?token_activated_date_time: Time?, + ?tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason], + ?wallet_decision: String? + ) -> void + + def to_hash: -> { + issuer_decision: String, + tokenization_decline_reasons: ::Array[Lithic::Models::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::tokenization_decline_reason], + customer_decision: String?, + rule_results: ::Array[Lithic::TokenizationRuleResult], + token_activated_date_time: Time?, + tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason], + wallet_decision: String? + } + + type tokenization_decline_reason = + :ACCOUNT_SCORE_1 + | :ALL_WALLET_DECLINE_REASONS_PRESENT + | :CARD_EXPIRY_MONTH_MISMATCH + | :CARD_EXPIRY_YEAR_MISMATCH + | :CARD_INVALID_STATE + | :CUSTOMER_RED_PATH + | :CVC_MISMATCH + | :DEVICE_SCORE_1 + | :GENERIC_DECLINE + | :INVALID_CUSTOMER_RESPONSE + | :NETWORK_FAILURE + | :WALLET_RECOMMENDED_DECISION_RED + + module TokenizationDeclineReason + extend Lithic::Internal::Type::Enum + + ACCOUNT_SCORE_1: :ACCOUNT_SCORE_1 + ALL_WALLET_DECLINE_REASONS_PRESENT: :ALL_WALLET_DECLINE_REASONS_PRESENT + CARD_EXPIRY_MONTH_MISMATCH: :CARD_EXPIRY_MONTH_MISMATCH + CARD_EXPIRY_YEAR_MISMATCH: :CARD_EXPIRY_YEAR_MISMATCH + CARD_INVALID_STATE: :CARD_INVALID_STATE + CUSTOMER_RED_PATH: :CUSTOMER_RED_PATH + CVC_MISMATCH: :CVC_MISMATCH + DEVICE_SCORE_1: :DEVICE_SCORE_1 + GENERIC_DECLINE: :GENERIC_DECLINE + INVALID_CUSTOMER_RESPONSE: :INVALID_CUSTOMER_RESPONSE + NETWORK_FAILURE: :NETWORK_FAILURE + WALLET_RECOMMENDED_DECISION_RED: :WALLET_RECOMMENDED_DECISION_RED + + def self?.values: -> ::Array[Lithic::Models::DigitalWalletTokenizationResultWebhookEvent::TokenizationResultDetails::tokenization_decline_reason] + end + end + end + end +end diff --git a/sig/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_sent_webhook_event.rbs b/sig/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_sent_webhook_event.rbs new file mode 100644 index 00000000..36252a45 --- /dev/null +++ b/sig/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_sent_webhook_event.rbs @@ -0,0 +1,78 @@ +module Lithic + module Models + type digital_wallet_tokenization_two_factor_authentication_code_sent_webhook_event = + { + account_token: String, + activation_method: Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod, + card_token: String, + created: Time, + event_type: :"digital_wallet.tokenization_two_factor_authentication_code_sent", + tokenization_token: String + } + + class DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor account_token: String + + attr_accessor activation_method: Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod + + attr_accessor card_token: String + + attr_accessor created: Time + + attr_accessor event_type: :"digital_wallet.tokenization_two_factor_authentication_code_sent" + + attr_accessor tokenization_token: String + + def initialize: ( + account_token: String, + activation_method: Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod, + card_token: String, + created: Time, + tokenization_token: String, + ?event_type: :"digital_wallet.tokenization_two_factor_authentication_code_sent" + ) -> void + + def to_hash: -> { + account_token: String, + activation_method: Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod, + card_token: String, + created: Time, + event_type: :"digital_wallet.tokenization_two_factor_authentication_code_sent", + tokenization_token: String + } + + type activation_method = + { + type: Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::type_, + value: String + } + + class ActivationMethod < Lithic::Internal::Type::BaseModel + attr_accessor type: Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::type_ + + attr_accessor value: String + + def initialize: ( + type: Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::type_, + value: String + ) -> void + + def to_hash: -> { + type: Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::type_, + value: String + } + + type type_ = :EMAIL_TO_CARDHOLDER_ADDRESS | :TEXT_TO_CARDHOLDER_NUMBER + + module Type + extend Lithic::Internal::Type::Enum + + EMAIL_TO_CARDHOLDER_ADDRESS: :EMAIL_TO_CARDHOLDER_ADDRESS + TEXT_TO_CARDHOLDER_NUMBER: :TEXT_TO_CARDHOLDER_NUMBER + + def self?.values: -> ::Array[Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::type_] + end + end + end + end +end diff --git a/sig/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_webhook_event.rbs b/sig/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_webhook_event.rbs new file mode 100644 index 00000000..359c1202 --- /dev/null +++ b/sig/lithic/models/digital_wallet_tokenization_two_factor_authentication_code_webhook_event.rbs @@ -0,0 +1,83 @@ +module Lithic + module Models + type digital_wallet_tokenization_two_factor_authentication_code_webhook_event = + { + account_token: String, + activation_method: Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod, + authentication_code: String, + card_token: String, + created: Time, + event_type: :"digital_wallet.tokenization_two_factor_authentication_code", + tokenization_token: String + } + + class DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor account_token: String + + attr_accessor activation_method: Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod + + attr_accessor authentication_code: String + + attr_accessor card_token: String + + attr_accessor created: Time + + attr_accessor event_type: :"digital_wallet.tokenization_two_factor_authentication_code" + + attr_accessor tokenization_token: String + + def initialize: ( + account_token: String, + activation_method: Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod, + authentication_code: String, + card_token: String, + created: Time, + tokenization_token: String, + ?event_type: :"digital_wallet.tokenization_two_factor_authentication_code" + ) -> void + + def to_hash: -> { + account_token: String, + activation_method: Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod, + authentication_code: String, + card_token: String, + created: Time, + event_type: :"digital_wallet.tokenization_two_factor_authentication_code", + tokenization_token: String + } + + type activation_method = + { + type: Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::type_, + value: String + } + + class ActivationMethod < Lithic::Internal::Type::BaseModel + attr_accessor type: Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::type_ + + attr_accessor value: String + + def initialize: ( + type: Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::type_, + value: String + ) -> void + + def to_hash: -> { + type: Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::type_, + value: String + } + + type type_ = :EMAIL_TO_CARDHOLDER_ADDRESS | :TEXT_TO_CARDHOLDER_NUMBER + + module Type + extend Lithic::Internal::Type::Enum + + EMAIL_TO_CARDHOLDER_ADDRESS: :EMAIL_TO_CARDHOLDER_ADDRESS + TEXT_TO_CARDHOLDER_NUMBER: :TEXT_TO_CARDHOLDER_NUMBER + + def self?.values: -> ::Array[Lithic::Models::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::type_] + end + end + end + end +end diff --git a/sig/lithic/models/digital_wallet_tokenization_updated_webhook_event.rbs b/sig/lithic/models/digital_wallet_tokenization_updated_webhook_event.rbs new file mode 100644 index 00000000..3efeb386 --- /dev/null +++ b/sig/lithic/models/digital_wallet_tokenization_updated_webhook_event.rbs @@ -0,0 +1,40 @@ +module Lithic + module Models + type digital_wallet_tokenization_updated_webhook_event = + { + account_token: String, + card_token: String, + created: Time, + event_type: :"digital_wallet.tokenization_updated", + tokenization: Lithic::Tokenization + } + + class DigitalWalletTokenizationUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor account_token: String + + attr_accessor card_token: String + + attr_accessor created: Time + + attr_accessor event_type: :"digital_wallet.tokenization_updated" + + attr_accessor tokenization: Lithic::Tokenization + + def initialize: ( + account_token: String, + card_token: String, + created: Time, + tokenization: Lithic::Tokenization, + ?event_type: :"digital_wallet.tokenization_updated" + ) -> void + + def to_hash: -> { + account_token: String, + card_token: String, + created: Time, + event_type: :"digital_wallet.tokenization_updated", + tokenization: Lithic::Tokenization + } + end + end +end diff --git a/sig/lithic/models/dispute.rbs b/sig/lithic/models/dispute.rbs new file mode 100644 index 00000000..cd7c62ac --- /dev/null +++ b/sig/lithic/models/dispute.rbs @@ -0,0 +1,210 @@ +module Lithic + module Models + type dispute = + { + token: String, + amount: Integer, + arbitration_date: Time?, + created: Time, + customer_filed_date: Time?, + customer_note: String?, + network_claim_ids: ::Array[String]?, + network_filed_date: Time?, + network_reason_code: String?, + prearbitration_date: Time?, + primary_claim_id: String?, + reason: Lithic::Models::Dispute::reason, + representment_date: Time?, + resolution_date: Time?, + resolution_note: String?, + resolution_reason: Lithic::Models::Dispute::resolution_reason?, + status: Lithic::Models::Dispute::status, + transaction_token: String + } + + class Dispute < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor amount: Integer + + attr_accessor arbitration_date: Time? + + attr_accessor created: Time + + attr_accessor customer_filed_date: Time? + + attr_accessor customer_note: String? + + attr_accessor network_claim_ids: ::Array[String]? + + attr_accessor network_filed_date: Time? + + attr_accessor network_reason_code: String? + + attr_accessor prearbitration_date: Time? + + attr_accessor primary_claim_id: String? + + attr_accessor reason: Lithic::Models::Dispute::reason + + attr_accessor representment_date: Time? + + attr_accessor resolution_date: Time? + + attr_accessor resolution_note: String? + + attr_accessor resolution_reason: Lithic::Models::Dispute::resolution_reason? + + attr_accessor status: Lithic::Models::Dispute::status + + attr_accessor transaction_token: String + + def initialize: ( + token: String, + amount: Integer, + arbitration_date: Time?, + created: Time, + customer_filed_date: Time?, + customer_note: String?, + network_claim_ids: ::Array[String]?, + network_filed_date: Time?, + network_reason_code: String?, + prearbitration_date: Time?, + primary_claim_id: String?, + reason: Lithic::Models::Dispute::reason, + representment_date: Time?, + resolution_date: Time?, + resolution_note: String?, + resolution_reason: Lithic::Models::Dispute::resolution_reason?, + status: Lithic::Models::Dispute::status, + transaction_token: String + ) -> void + + def to_hash: -> { + token: String, + amount: Integer, + arbitration_date: Time?, + created: Time, + customer_filed_date: Time?, + customer_note: String?, + network_claim_ids: ::Array[String]?, + network_filed_date: Time?, + network_reason_code: String?, + prearbitration_date: Time?, + primary_claim_id: String?, + reason: Lithic::Models::Dispute::reason, + representment_date: Time?, + resolution_date: Time?, + resolution_note: String?, + resolution_reason: Lithic::Models::Dispute::resolution_reason?, + status: Lithic::Models::Dispute::status, + transaction_token: String + } + + type reason = + :ATM_CASH_MISDISPENSE + | :CANCELLED + | :DUPLICATED + | :FRAUD_CARD_NOT_PRESENT + | :FRAUD_CARD_PRESENT + | :FRAUD_OTHER + | :GOODS_SERVICES_NOT_AS_DESCRIBED + | :GOODS_SERVICES_NOT_RECEIVED + | :INCORRECT_AMOUNT + | :MISSING_AUTH + | :OTHER + | :PROCESSING_ERROR + | :RECURRING_TRANSACTION_NOT_CANCELLED + | :REFUND_NOT_PROCESSED + + module Reason + extend Lithic::Internal::Type::Enum + + ATM_CASH_MISDISPENSE: :ATM_CASH_MISDISPENSE + CANCELLED: :CANCELLED + DUPLICATED: :DUPLICATED + FRAUD_CARD_NOT_PRESENT: :FRAUD_CARD_NOT_PRESENT + FRAUD_CARD_PRESENT: :FRAUD_CARD_PRESENT + FRAUD_OTHER: :FRAUD_OTHER + GOODS_SERVICES_NOT_AS_DESCRIBED: :GOODS_SERVICES_NOT_AS_DESCRIBED + GOODS_SERVICES_NOT_RECEIVED: :GOODS_SERVICES_NOT_RECEIVED + INCORRECT_AMOUNT: :INCORRECT_AMOUNT + MISSING_AUTH: :MISSING_AUTH + OTHER: :OTHER + PROCESSING_ERROR: :PROCESSING_ERROR + RECURRING_TRANSACTION_NOT_CANCELLED: :RECURRING_TRANSACTION_NOT_CANCELLED + REFUND_NOT_PROCESSED: :REFUND_NOT_PROCESSED + + def self?.values: -> ::Array[Lithic::Models::Dispute::reason] + end + + type resolution_reason = + :CASE_LOST + | :NETWORK_REJECTED + | :NO_DISPUTE_RIGHTS_3DS + | :NO_DISPUTE_RIGHTS_BELOW_THRESHOLD + | :NO_DISPUTE_RIGHTS_CONTACTLESS + | :NO_DISPUTE_RIGHTS_HYBRID + | :NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS + | :NO_DISPUTE_RIGHTS_OTHER + | :PAST_FILING_DATE + | :PREARBITRATION_REJECTED + | :PROCESSOR_REJECTED_OTHER + | :REFUNDED + | :REFUNDED_AFTER_CHARGEBACK + | :WITHDRAWN + | :WON_ARBITRATION + | :WON_FIRST_CHARGEBACK + | :WON_PREARBITRATION + + module ResolutionReason + extend Lithic::Internal::Type::Enum + + CASE_LOST: :CASE_LOST + NETWORK_REJECTED: :NETWORK_REJECTED + NO_DISPUTE_RIGHTS_3DS: :NO_DISPUTE_RIGHTS_3DS + NO_DISPUTE_RIGHTS_BELOW_THRESHOLD: :NO_DISPUTE_RIGHTS_BELOW_THRESHOLD + NO_DISPUTE_RIGHTS_CONTACTLESS: :NO_DISPUTE_RIGHTS_CONTACTLESS + NO_DISPUTE_RIGHTS_HYBRID: :NO_DISPUTE_RIGHTS_HYBRID + NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS: :NO_DISPUTE_RIGHTS_MAX_CHARGEBACKS + NO_DISPUTE_RIGHTS_OTHER: :NO_DISPUTE_RIGHTS_OTHER + PAST_FILING_DATE: :PAST_FILING_DATE + PREARBITRATION_REJECTED: :PREARBITRATION_REJECTED + PROCESSOR_REJECTED_OTHER: :PROCESSOR_REJECTED_OTHER + REFUNDED: :REFUNDED + REFUNDED_AFTER_CHARGEBACK: :REFUNDED_AFTER_CHARGEBACK + WITHDRAWN: :WITHDRAWN + WON_ARBITRATION: :WON_ARBITRATION + WON_FIRST_CHARGEBACK: :WON_FIRST_CHARGEBACK + WON_PREARBITRATION: :WON_PREARBITRATION + + def self?.values: -> ::Array[Lithic::Models::Dispute::resolution_reason] + end + + type status = + :ARBITRATION + | :CASE_CLOSED + | :CASE_WON + | :NEW + | :PENDING_CUSTOMER + | :PREARBITRATION + | :REPRESENTMENT + | :SUBMITTED + + module Status + extend Lithic::Internal::Type::Enum + + ARBITRATION: :ARBITRATION + CASE_CLOSED: :CASE_CLOSED + CASE_WON: :CASE_WON + NEW: :NEW + PENDING_CUSTOMER: :PENDING_CUSTOMER + PREARBITRATION: :PREARBITRATION + REPRESENTMENT: :REPRESENTMENT + SUBMITTED: :SUBMITTED + + def self?.values: -> ::Array[Lithic::Models::Dispute::status] + end + end + end +end diff --git a/sig/lithic/models/dispute_create_params.rbs b/sig/lithic/models/dispute_create_params.rbs new file mode 100644 index 00000000..14b5ed35 --- /dev/null +++ b/sig/lithic/models/dispute_create_params.rbs @@ -0,0 +1,87 @@ +module Lithic + module Models + type dispute_create_params = + { + amount: Integer, + reason: Lithic::Models::DisputeCreateParams::reason, + transaction_token: String, + customer_filed_date: Time, + customer_note: String + } + & Lithic::Internal::Type::request_parameters + + class DisputeCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor amount: Integer + + attr_accessor reason: Lithic::Models::DisputeCreateParams::reason + + attr_accessor transaction_token: String + + attr_reader customer_filed_date: Time? + + def customer_filed_date=: (Time) -> Time + + attr_reader customer_note: String? + + def customer_note=: (String) -> String + + def initialize: ( + amount: Integer, + reason: Lithic::Models::DisputeCreateParams::reason, + transaction_token: String, + ?customer_filed_date: Time, + ?customer_note: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + amount: Integer, + reason: Lithic::Models::DisputeCreateParams::reason, + transaction_token: String, + customer_filed_date: Time, + customer_note: String, + request_options: Lithic::RequestOptions + } + + type reason = + :ATM_CASH_MISDISPENSE + | :CANCELLED + | :DUPLICATED + | :FRAUD_CARD_NOT_PRESENT + | :FRAUD_CARD_PRESENT + | :FRAUD_OTHER + | :GOODS_SERVICES_NOT_AS_DESCRIBED + | :GOODS_SERVICES_NOT_RECEIVED + | :INCORRECT_AMOUNT + | :MISSING_AUTH + | :OTHER + | :PROCESSING_ERROR + | :RECURRING_TRANSACTION_NOT_CANCELLED + | :REFUND_NOT_PROCESSED + + module Reason + extend Lithic::Internal::Type::Enum + + ATM_CASH_MISDISPENSE: :ATM_CASH_MISDISPENSE + CANCELLED: :CANCELLED + DUPLICATED: :DUPLICATED + FRAUD_CARD_NOT_PRESENT: :FRAUD_CARD_NOT_PRESENT + FRAUD_CARD_PRESENT: :FRAUD_CARD_PRESENT + FRAUD_OTHER: :FRAUD_OTHER + GOODS_SERVICES_NOT_AS_DESCRIBED: :GOODS_SERVICES_NOT_AS_DESCRIBED + GOODS_SERVICES_NOT_RECEIVED: :GOODS_SERVICES_NOT_RECEIVED + INCORRECT_AMOUNT: :INCORRECT_AMOUNT + MISSING_AUTH: :MISSING_AUTH + OTHER: :OTHER + PROCESSING_ERROR: :PROCESSING_ERROR + RECURRING_TRANSACTION_NOT_CANCELLED: :RECURRING_TRANSACTION_NOT_CANCELLED + REFUND_NOT_PROCESSED: :REFUND_NOT_PROCESSED + + def self?.values: -> ::Array[Lithic::Models::DisputeCreateParams::reason] + end + end + end +end diff --git a/sig/lithic/models/dispute_delete_evidence_params.rbs b/sig/lithic/models/dispute_delete_evidence_params.rbs new file mode 100644 index 00000000..6da62dde --- /dev/null +++ b/sig/lithic/models/dispute_delete_evidence_params.rbs @@ -0,0 +1,28 @@ +module Lithic + module Models + type dispute_delete_evidence_params = + { dispute_token: String, evidence_token: String } + & Lithic::Internal::Type::request_parameters + + class DisputeDeleteEvidenceParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor dispute_token: String + + attr_accessor evidence_token: String + + def initialize: ( + dispute_token: String, + evidence_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + dispute_token: String, + evidence_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/dispute_delete_params.rbs b/sig/lithic/models/dispute_delete_params.rbs new file mode 100644 index 00000000..087a43e0 --- /dev/null +++ b/sig/lithic/models/dispute_delete_params.rbs @@ -0,0 +1,23 @@ +module Lithic + module Models + type dispute_delete_params = + { dispute_token: String } & Lithic::Internal::Type::request_parameters + + class DisputeDeleteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor dispute_token: String + + def initialize: ( + dispute_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + dispute_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/dispute_evidence.rbs b/sig/lithic/models/dispute_evidence.rbs new file mode 100644 index 00000000..6fa2c50d --- /dev/null +++ b/sig/lithic/models/dispute_evidence.rbs @@ -0,0 +1,70 @@ +module Lithic + module Models + type dispute_evidence = + { + token: String, + created: Time, + dispute_token: String, + upload_status: Lithic::Models::DisputeEvidence::upload_status, + download_url: String, + filename: String, + upload_url: String + } + + class DisputeEvidence < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor created: Time + + attr_accessor dispute_token: String + + attr_accessor upload_status: Lithic::Models::DisputeEvidence::upload_status + + attr_reader download_url: String? + + def download_url=: (String) -> String + + attr_reader filename: String? + + def filename=: (String) -> String + + attr_reader upload_url: String? + + def upload_url=: (String) -> String + + def initialize: ( + token: String, + created: Time, + dispute_token: String, + upload_status: Lithic::Models::DisputeEvidence::upload_status, + ?download_url: String, + ?filename: String, + ?upload_url: String + ) -> void + + def to_hash: -> { + token: String, + created: Time, + dispute_token: String, + upload_status: Lithic::Models::DisputeEvidence::upload_status, + download_url: String, + filename: String, + upload_url: String + } + + type upload_status = :DELETED | :ERROR | :PENDING | :REJECTED | :UPLOADED + + module UploadStatus + extend Lithic::Internal::Type::Enum + + DELETED: :DELETED + ERROR: :ERROR + PENDING: :PENDING + REJECTED: :REJECTED + UPLOADED: :UPLOADED + + def self?.values: -> ::Array[Lithic::Models::DisputeEvidence::upload_status] + end + end + end +end diff --git a/sig/lithic/models/dispute_evidence_upload_failed_webhook_event.rbs b/sig/lithic/models/dispute_evidence_upload_failed_webhook_event.rbs new file mode 100644 index 00000000..08e1b740 --- /dev/null +++ b/sig/lithic/models/dispute_evidence_upload_failed_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type dispute_evidence_upload_failed_webhook_event = + { event_type: :"dispute_evidence.upload_failed" } + + class DisputeEvidenceUploadFailedWebhookEvent < Lithic::Models::DisputeEvidence + def event_type: -> :"dispute_evidence.upload_failed" + + def event_type=: ( + :"dispute_evidence.upload_failed" _ + ) -> :"dispute_evidence.upload_failed" + + def initialize: (?event_type: :"dispute_evidence.upload_failed") -> void + + def to_hash: -> { event_type: :"dispute_evidence.upload_failed" } + end + end +end diff --git a/sig/lithic/models/dispute_initiate_evidence_upload_params.rbs b/sig/lithic/models/dispute_initiate_evidence_upload_params.rbs new file mode 100644 index 00000000..2503bdae --- /dev/null +++ b/sig/lithic/models/dispute_initiate_evidence_upload_params.rbs @@ -0,0 +1,30 @@ +module Lithic + module Models + type dispute_initiate_evidence_upload_params = + { dispute_token: String, filename: String } + & Lithic::Internal::Type::request_parameters + + class DisputeInitiateEvidenceUploadParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor dispute_token: String + + attr_reader filename: String? + + def filename=: (String) -> String + + def initialize: ( + dispute_token: String, + ?filename: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + dispute_token: String, + filename: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/dispute_list_evidences_params.rbs b/sig/lithic/models/dispute_list_evidences_params.rbs new file mode 100644 index 00000000..97835349 --- /dev/null +++ b/sig/lithic/models/dispute_list_evidences_params.rbs @@ -0,0 +1,61 @@ +module Lithic + module Models + type dispute_list_evidences_params = + { + dispute_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String + } + & Lithic::Internal::Type::request_parameters + + class DisputeListEvidencesParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor dispute_token: String + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + dispute_token: String, + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + dispute_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/dispute_list_params.rbs b/sig/lithic/models/dispute_list_params.rbs new file mode 100644 index 00000000..1c409a92 --- /dev/null +++ b/sig/lithic/models/dispute_list_params.rbs @@ -0,0 +1,97 @@ +module Lithic + module Models + type dispute_list_params = + { + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::Models::DisputeListParams::status, + transaction_tokens: ::Array[String] + } + & Lithic::Internal::Type::request_parameters + + class DisputeListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader status: Lithic::Models::DisputeListParams::status? + + def status=: ( + Lithic::Models::DisputeListParams::status + ) -> Lithic::Models::DisputeListParams::status + + attr_reader transaction_tokens: ::Array[String]? + + def transaction_tokens=: (::Array[String]) -> ::Array[String] + + def initialize: ( + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?status: Lithic::Models::DisputeListParams::status, + ?transaction_tokens: ::Array[String], + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::Models::DisputeListParams::status, + transaction_tokens: ::Array[String], + request_options: Lithic::RequestOptions + } + + type status = + :ARBITRATION + | :CASE_CLOSED + | :CASE_WON + | :NEW + | :PENDING_CUSTOMER + | :PREARBITRATION + | :REPRESENTMENT + | :SUBMITTED + + module Status + extend Lithic::Internal::Type::Enum + + ARBITRATION: :ARBITRATION + CASE_CLOSED: :CASE_CLOSED + CASE_WON: :CASE_WON + NEW: :NEW + PENDING_CUSTOMER: :PENDING_CUSTOMER + PREARBITRATION: :PREARBITRATION + REPRESENTMENT: :REPRESENTMENT + SUBMITTED: :SUBMITTED + + def self?.values: -> ::Array[Lithic::Models::DisputeListParams::status] + end + end + end +end diff --git a/sig/lithic/models/dispute_retrieve_evidence_params.rbs b/sig/lithic/models/dispute_retrieve_evidence_params.rbs new file mode 100644 index 00000000..a0e28e50 --- /dev/null +++ b/sig/lithic/models/dispute_retrieve_evidence_params.rbs @@ -0,0 +1,28 @@ +module Lithic + module Models + type dispute_retrieve_evidence_params = + { dispute_token: String, evidence_token: String } + & Lithic::Internal::Type::request_parameters + + class DisputeRetrieveEvidenceParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor dispute_token: String + + attr_accessor evidence_token: String + + def initialize: ( + dispute_token: String, + evidence_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + dispute_token: String, + evidence_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/dispute_retrieve_params.rbs b/sig/lithic/models/dispute_retrieve_params.rbs new file mode 100644 index 00000000..3227e267 --- /dev/null +++ b/sig/lithic/models/dispute_retrieve_params.rbs @@ -0,0 +1,23 @@ +module Lithic + module Models + type dispute_retrieve_params = + { dispute_token: String } & Lithic::Internal::Type::request_parameters + + class DisputeRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor dispute_token: String + + def initialize: ( + dispute_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + dispute_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/dispute_transaction_created_webhook_event.rbs b/sig/lithic/models/dispute_transaction_created_webhook_event.rbs new file mode 100644 index 00000000..0d240cfd --- /dev/null +++ b/sig/lithic/models/dispute_transaction_created_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type dispute_transaction_created_webhook_event = + { event_type: :"dispute_transaction.created" } + + class DisputeTransactionCreatedWebhookEvent < Lithic::Models::DisputeV2 + def event_type: -> :"dispute_transaction.created" + + def event_type=: ( + :"dispute_transaction.created" _ + ) -> :"dispute_transaction.created" + + def initialize: (?event_type: :"dispute_transaction.created") -> void + + def to_hash: -> { event_type: :"dispute_transaction.created" } + end + end +end diff --git a/sig/lithic/models/dispute_transaction_updated_webhook_event.rbs b/sig/lithic/models/dispute_transaction_updated_webhook_event.rbs new file mode 100644 index 00000000..4083d03b --- /dev/null +++ b/sig/lithic/models/dispute_transaction_updated_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type dispute_transaction_updated_webhook_event = + { event_type: :"dispute_transaction.updated" } + + class DisputeTransactionUpdatedWebhookEvent < Lithic::Models::DisputeV2 + def event_type: -> :"dispute_transaction.updated" + + def event_type=: ( + :"dispute_transaction.updated" _ + ) -> :"dispute_transaction.updated" + + def initialize: (?event_type: :"dispute_transaction.updated") -> void + + def to_hash: -> { event_type: :"dispute_transaction.updated" } + end + end +end diff --git a/sig/lithic/models/dispute_update_params.rbs b/sig/lithic/models/dispute_update_params.rbs new file mode 100644 index 00000000..97cd0c71 --- /dev/null +++ b/sig/lithic/models/dispute_update_params.rbs @@ -0,0 +1,93 @@ +module Lithic + module Models + type dispute_update_params = + { + dispute_token: String, + amount: Integer, + customer_filed_date: Time, + customer_note: String, + reason: Lithic::Models::DisputeUpdateParams::reason + } + & Lithic::Internal::Type::request_parameters + + class DisputeUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor dispute_token: String + + attr_reader amount: Integer? + + def amount=: (Integer) -> Integer + + attr_reader customer_filed_date: Time? + + def customer_filed_date=: (Time) -> Time + + attr_reader customer_note: String? + + def customer_note=: (String) -> String + + attr_reader reason: Lithic::Models::DisputeUpdateParams::reason? + + def reason=: ( + Lithic::Models::DisputeUpdateParams::reason + ) -> Lithic::Models::DisputeUpdateParams::reason + + def initialize: ( + dispute_token: String, + ?amount: Integer, + ?customer_filed_date: Time, + ?customer_note: String, + ?reason: Lithic::Models::DisputeUpdateParams::reason, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + dispute_token: String, + amount: Integer, + customer_filed_date: Time, + customer_note: String, + reason: Lithic::Models::DisputeUpdateParams::reason, + request_options: Lithic::RequestOptions + } + + type reason = + :ATM_CASH_MISDISPENSE + | :CANCELLED + | :DUPLICATED + | :FRAUD_CARD_NOT_PRESENT + | :FRAUD_CARD_PRESENT + | :FRAUD_OTHER + | :GOODS_SERVICES_NOT_AS_DESCRIBED + | :GOODS_SERVICES_NOT_RECEIVED + | :INCORRECT_AMOUNT + | :MISSING_AUTH + | :OTHER + | :PROCESSING_ERROR + | :RECURRING_TRANSACTION_NOT_CANCELLED + | :REFUND_NOT_PROCESSED + + module Reason + extend Lithic::Internal::Type::Enum + + ATM_CASH_MISDISPENSE: :ATM_CASH_MISDISPENSE + CANCELLED: :CANCELLED + DUPLICATED: :DUPLICATED + FRAUD_CARD_NOT_PRESENT: :FRAUD_CARD_NOT_PRESENT + FRAUD_CARD_PRESENT: :FRAUD_CARD_PRESENT + FRAUD_OTHER: :FRAUD_OTHER + GOODS_SERVICES_NOT_AS_DESCRIBED: :GOODS_SERVICES_NOT_AS_DESCRIBED + GOODS_SERVICES_NOT_RECEIVED: :GOODS_SERVICES_NOT_RECEIVED + INCORRECT_AMOUNT: :INCORRECT_AMOUNT + MISSING_AUTH: :MISSING_AUTH + OTHER: :OTHER + PROCESSING_ERROR: :PROCESSING_ERROR + RECURRING_TRANSACTION_NOT_CANCELLED: :RECURRING_TRANSACTION_NOT_CANCELLED + REFUND_NOT_PROCESSED: :REFUND_NOT_PROCESSED + + def self?.values: -> ::Array[Lithic::Models::DisputeUpdateParams::reason] + end + end + end +end diff --git a/sig/lithic/models/dispute_updated_webhook_event.rbs b/sig/lithic/models/dispute_updated_webhook_event.rbs new file mode 100644 index 00000000..3c3cc55f --- /dev/null +++ b/sig/lithic/models/dispute_updated_webhook_event.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type dispute_updated_webhook_event = { event_type: :"dispute.updated" } + + class DisputeUpdatedWebhookEvent < Lithic::Models::Dispute + def event_type: -> :"dispute.updated" + + def event_type=: (:"dispute.updated" _) -> :"dispute.updated" + + def initialize: (?event_type: :"dispute.updated") -> void + + def to_hash: -> { event_type: :"dispute.updated" } + end + end +end diff --git a/sig/lithic/models/dispute_v2.rbs b/sig/lithic/models/dispute_v2.rbs new file mode 100644 index 00000000..836a7b7b --- /dev/null +++ b/sig/lithic/models/dispute_v2.rbs @@ -0,0 +1,438 @@ +module Lithic + module Models + type dispute_v2 = + { + token: String, + account_token: String, + card_token: String, + case_id: String?, + created: Time, + currency: String, + disposition: Lithic::Models::DisputeV2::disposition?, + events: ::Array[Lithic::DisputeV2::Event], + liability_allocation: Lithic::DisputeV2::LiabilityAllocation, + merchant: Lithic::Merchant, + network: Lithic::Models::DisputeV2::network, + status: Lithic::Models::DisputeV2::status?, + transaction_series: Lithic::DisputeV2::TransactionSeries?, + updated: Time + } + + class DisputeV2 < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor account_token: String + + attr_accessor card_token: String + + attr_accessor case_id: String? + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor disposition: Lithic::Models::DisputeV2::disposition? + + attr_accessor events: ::Array[Lithic::DisputeV2::Event] + + attr_accessor liability_allocation: Lithic::DisputeV2::LiabilityAllocation + + attr_accessor merchant: Lithic::Merchant + + attr_accessor network: Lithic::Models::DisputeV2::network + + attr_accessor status: Lithic::Models::DisputeV2::status? + + attr_accessor transaction_series: Lithic::DisputeV2::TransactionSeries? + + attr_accessor updated: Time + + def initialize: ( + token: String, + account_token: String, + card_token: String, + case_id: String?, + created: Time, + currency: String, + disposition: Lithic::Models::DisputeV2::disposition?, + events: ::Array[Lithic::DisputeV2::Event], + liability_allocation: Lithic::DisputeV2::LiabilityAllocation, + merchant: Lithic::Merchant, + network: Lithic::Models::DisputeV2::network, + status: Lithic::Models::DisputeV2::status?, + transaction_series: Lithic::DisputeV2::TransactionSeries?, + updated: Time + ) -> void + + def to_hash: -> { + token: String, + account_token: String, + card_token: String, + case_id: String?, + created: Time, + currency: String, + disposition: Lithic::Models::DisputeV2::disposition?, + events: ::Array[Lithic::DisputeV2::Event], + liability_allocation: Lithic::DisputeV2::LiabilityAllocation, + merchant: Lithic::Merchant, + network: Lithic::Models::DisputeV2::network, + status: Lithic::Models::DisputeV2::status?, + transaction_series: Lithic::DisputeV2::TransactionSeries?, + updated: Time + } + + type disposition = :WON | :LOST | :PARTIALLY_WON | :WITHDRAWN | :DENIED + + module Disposition + extend Lithic::Internal::Type::Enum + + WON: :WON + LOST: :LOST + PARTIALLY_WON: :PARTIALLY_WON + WITHDRAWN: :WITHDRAWN + DENIED: :DENIED + + def self?.values: -> ::Array[Lithic::Models::DisputeV2::disposition] + end + + type event = + { + token: String, + created: Time, + data: Lithic::Models::DisputeV2::Event::data, + type: Lithic::Models::DisputeV2::Event::type_ + } + + class Event < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor created: Time + + attr_accessor data: Lithic::Models::DisputeV2::Event::data + + attr_accessor type: Lithic::Models::DisputeV2::Event::type_ + + def initialize: ( + token: String, + created: Time, + data: Lithic::Models::DisputeV2::Event::data, + type: Lithic::Models::DisputeV2::Event::type_ + ) -> void + + def to_hash: -> { + token: String, + created: Time, + data: Lithic::Models::DisputeV2::Event::data, + type: Lithic::Models::DisputeV2::Event::type_ + } + + type data = + Lithic::DisputeV2::Event::Data::Workflow + | Lithic::DisputeV2::Event::Data::Financial + | Lithic::DisputeV2::Event::Data::CardholderLiability + + module Data + extend Lithic::Internal::Type::Union + + type workflow = + { + action: Lithic::Models::DisputeV2::Event::Data::Workflow::action, + amount: Integer?, + disposition: Lithic::Models::DisputeV2::Event::Data::Workflow::disposition?, + reason: String?, + stage: Lithic::Models::DisputeV2::Event::Data::Workflow::stage, + type: :WORKFLOW + } + + class Workflow < Lithic::Internal::Type::BaseModel + attr_accessor action: Lithic::Models::DisputeV2::Event::Data::Workflow::action + + attr_accessor amount: Integer? + + attr_accessor disposition: Lithic::Models::DisputeV2::Event::Data::Workflow::disposition? + + attr_accessor reason: String? + + attr_accessor stage: Lithic::Models::DisputeV2::Event::Data::Workflow::stage + + attr_accessor type: :WORKFLOW + + def initialize: ( + action: Lithic::Models::DisputeV2::Event::Data::Workflow::action, + amount: Integer?, + disposition: Lithic::Models::DisputeV2::Event::Data::Workflow::disposition?, + reason: String?, + stage: Lithic::Models::DisputeV2::Event::Data::Workflow::stage, + ?type: :WORKFLOW + ) -> void + + def to_hash: -> { + action: Lithic::Models::DisputeV2::Event::Data::Workflow::action, + amount: Integer?, + disposition: Lithic::Models::DisputeV2::Event::Data::Workflow::disposition?, + reason: String?, + stage: Lithic::Models::DisputeV2::Event::Data::Workflow::stage, + type: :WORKFLOW + } + + type action = :OPENED | :CLOSED | :REOPENED + + module Action + extend Lithic::Internal::Type::Enum + + OPENED: :OPENED + CLOSED: :CLOSED + REOPENED: :REOPENED + + def self?.values: -> ::Array[Lithic::Models::DisputeV2::Event::Data::Workflow::action] + end + + type disposition = + :WON | :LOST | :PARTIALLY_WON | :WITHDRAWN | :DENIED + + module Disposition + extend Lithic::Internal::Type::Enum + + WON: :WON + LOST: :LOST + PARTIALLY_WON: :PARTIALLY_WON + WITHDRAWN: :WITHDRAWN + DENIED: :DENIED + + def self?.values: -> ::Array[Lithic::Models::DisputeV2::Event::Data::Workflow::disposition] + end + + type stage = :CLAIM + + module Stage + extend Lithic::Internal::Type::Enum + + CLAIM: :CLAIM + + def self?.values: -> ::Array[Lithic::Models::DisputeV2::Event::Data::Workflow::stage] + end + end + + type financial = + { + amount: Integer, + polarity: Lithic::Models::DisputeV2::Event::Data::Financial::polarity, + stage: Lithic::Models::DisputeV2::Event::Data::Financial::stage, + type: :FINANCIAL + } + + class Financial < Lithic::Internal::Type::BaseModel + attr_accessor amount: Integer + + attr_accessor polarity: Lithic::Models::DisputeV2::Event::Data::Financial::polarity + + attr_accessor stage: Lithic::Models::DisputeV2::Event::Data::Financial::stage + + attr_accessor type: :FINANCIAL + + def initialize: ( + amount: Integer, + polarity: Lithic::Models::DisputeV2::Event::Data::Financial::polarity, + stage: Lithic::Models::DisputeV2::Event::Data::Financial::stage, + ?type: :FINANCIAL + ) -> void + + def to_hash: -> { + amount: Integer, + polarity: Lithic::Models::DisputeV2::Event::Data::Financial::polarity, + stage: Lithic::Models::DisputeV2::Event::Data::Financial::stage, + type: :FINANCIAL + } + + type polarity = :CREDIT | :DEBIT + + module Polarity + extend Lithic::Internal::Type::Enum + + CREDIT: :CREDIT + DEBIT: :DEBIT + + def self?.values: -> ::Array[Lithic::Models::DisputeV2::Event::Data::Financial::polarity] + end + + type stage = + :CHARGEBACK + | :REPRESENTMENT + | :PREARBITRATION + | :ARBITRATION + | :COLLABORATION + + module Stage + extend Lithic::Internal::Type::Enum + + CHARGEBACK: :CHARGEBACK + REPRESENTMENT: :REPRESENTMENT + PREARBITRATION: :PREARBITRATION + ARBITRATION: :ARBITRATION + COLLABORATION: :COLLABORATION + + def self?.values: -> ::Array[Lithic::Models::DisputeV2::Event::Data::Financial::stage] + end + end + + type cardholder_liability = + { + action: Lithic::Models::DisputeV2::Event::Data::CardholderLiability::action, + amount: Integer, + reason: String, + type: :CARDHOLDER_LIABILITY + } + + class CardholderLiability < Lithic::Internal::Type::BaseModel + attr_accessor action: Lithic::Models::DisputeV2::Event::Data::CardholderLiability::action + + attr_accessor amount: Integer + + attr_accessor reason: String + + attr_accessor type: :CARDHOLDER_LIABILITY + + def initialize: ( + action: Lithic::Models::DisputeV2::Event::Data::CardholderLiability::action, + amount: Integer, + reason: String, + ?type: :CARDHOLDER_LIABILITY + ) -> void + + def to_hash: -> { + action: Lithic::Models::DisputeV2::Event::Data::CardholderLiability::action, + amount: Integer, + reason: String, + type: :CARDHOLDER_LIABILITY + } + + type action = + :PROVISIONAL_CREDIT_GRANTED + | :PROVISIONAL_CREDIT_REVERSED + | :WRITTEN_OFF + + module Action + extend Lithic::Internal::Type::Enum + + PROVISIONAL_CREDIT_GRANTED: :PROVISIONAL_CREDIT_GRANTED + PROVISIONAL_CREDIT_REVERSED: :PROVISIONAL_CREDIT_REVERSED + WRITTEN_OFF: :WRITTEN_OFF + + def self?.values: -> ::Array[Lithic::Models::DisputeV2::Event::Data::CardholderLiability::action] + end + end + + def self?.variants: -> ::Array[Lithic::Models::DisputeV2::Event::data] + end + + type type_ = :WORKFLOW | :FINANCIAL | :CARDHOLDER_LIABILITY + + module Type + extend Lithic::Internal::Type::Enum + + WORKFLOW: :WORKFLOW + FINANCIAL: :FINANCIAL + CARDHOLDER_LIABILITY: :CARDHOLDER_LIABILITY + + def self?.values: -> ::Array[Lithic::Models::DisputeV2::Event::type_] + end + end + + type liability_allocation = + { + denied_amount: Integer, + original_amount: Integer, + recovered_amount: Integer, + remaining_amount: Integer, + written_off_amount: Integer + } + + class LiabilityAllocation < Lithic::Internal::Type::BaseModel + attr_accessor denied_amount: Integer + + attr_accessor original_amount: Integer + + attr_accessor recovered_amount: Integer + + attr_accessor remaining_amount: Integer + + attr_accessor written_off_amount: Integer + + def initialize: ( + denied_amount: Integer, + original_amount: Integer, + recovered_amount: Integer, + remaining_amount: Integer, + written_off_amount: Integer + ) -> void + + def to_hash: -> { + denied_amount: Integer, + original_amount: Integer, + recovered_amount: Integer, + remaining_amount: Integer, + written_off_amount: Integer + } + end + + type network = :VISA | :MASTERCARD + + module Network + extend Lithic::Internal::Type::Enum + + VISA: :VISA + MASTERCARD: :MASTERCARD + + def self?.values: -> ::Array[Lithic::Models::DisputeV2::network] + end + + type status = :OPEN | :CLOSED + + module Status + extend Lithic::Internal::Type::Enum + + OPEN: :OPEN + CLOSED: :CLOSED + + def self?.values: -> ::Array[Lithic::Models::DisputeV2::status] + end + + type transaction_series = + { + related_transaction_event_token: String?, + related_transaction_token: String, + type: Lithic::Models::DisputeV2::TransactionSeries::type_ + } + + class TransactionSeries < Lithic::Internal::Type::BaseModel + attr_accessor related_transaction_event_token: String? + + attr_accessor related_transaction_token: String + + attr_accessor type: Lithic::Models::DisputeV2::TransactionSeries::type_ + + def initialize: ( + related_transaction_event_token: String?, + related_transaction_token: String, + type: Lithic::Models::DisputeV2::TransactionSeries::type_ + ) -> void + + def to_hash: -> { + related_transaction_event_token: String?, + related_transaction_token: String, + type: Lithic::Models::DisputeV2::TransactionSeries::type_ + } + + type type_ = :DISPUTE + + module Type + extend Lithic::Internal::Type::Enum + + DISPUTE: :DISPUTE + + def self?.values: -> ::Array[Lithic::Models::DisputeV2::TransactionSeries::type_] + end + end + end + end +end diff --git a/sig/lithic/models/disputes_v2_list_params.rbs b/sig/lithic/models/disputes_v2_list_params.rbs new file mode 100644 index 00000000..9e1444a9 --- /dev/null +++ b/sig/lithic/models/disputes_v2_list_params.rbs @@ -0,0 +1,77 @@ +module Lithic + module Models + type disputes_v2_list_params = + { + account_token: String, + begin_: Time, + card_token: String, + disputed_transaction_token: String, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String + } + & Lithic::Internal::Type::request_parameters + + class DisputesV2ListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader card_token: String? + + def card_token=: (String) -> String + + attr_reader disputed_transaction_token: String? + + def disputed_transaction_token=: (String) -> String + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + ?account_token: String, + ?begin_: Time, + ?card_token: String, + ?disputed_transaction_token: String, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + account_token: String, + begin_: Time, + card_token: String, + disputed_transaction_token: String, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/disputes_v2_retrieve_params.rbs b/sig/lithic/models/disputes_v2_retrieve_params.rbs new file mode 100644 index 00000000..f1149f49 --- /dev/null +++ b/sig/lithic/models/disputes_v2_retrieve_params.rbs @@ -0,0 +1,23 @@ +module Lithic + module Models + type disputes_v2_retrieve_params = + { dispute_token: String } & Lithic::Internal::Type::request_parameters + + class DisputesV2RetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor dispute_token: String + + def initialize: ( + dispute_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + dispute_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/document.rbs b/sig/lithic/models/document.rbs new file mode 100644 index 00000000..96b05e64 --- /dev/null +++ b/sig/lithic/models/document.rbs @@ -0,0 +1,205 @@ +module Lithic + module Models + type document = + { + token: String, + account_holder_token: String, + document_type: Lithic::Models::Document::document_type, + entity_token: String, + required_document_uploads: ::Array[Lithic::Document::RequiredDocumentUpload] + } + + class Document < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor account_holder_token: String + + attr_accessor document_type: Lithic::Models::Document::document_type + + attr_accessor entity_token: String + + attr_accessor required_document_uploads: ::Array[Lithic::Document::RequiredDocumentUpload] + + def initialize: ( + token: String, + account_holder_token: String, + document_type: Lithic::Models::Document::document_type, + entity_token: String, + required_document_uploads: ::Array[Lithic::Document::RequiredDocumentUpload] + ) -> void + + def to_hash: -> { + token: String, + account_holder_token: String, + document_type: Lithic::Models::Document::document_type, + entity_token: String, + required_document_uploads: ::Array[Lithic::Document::RequiredDocumentUpload] + } + + type document_type = + :DRIVERS_LICENSE + | :PASSPORT + | :PASSPORT_CARD + | :EIN_LETTER + | :TAX_RETURN + | :OPERATING_AGREEMENT + | :CERTIFICATE_OF_FORMATION + | :CERTIFICATE_OF_GOOD_STANDING + | :ARTICLES_OF_INCORPORATION + | :ARTICLES_OF_ORGANIZATION + | :BYLAWS + | :GOVERNMENT_BUSINESS_LICENSE + | :PARTNERSHIP_AGREEMENT + | :SS4_FORM + | :BANK_STATEMENT + | :UTILITY_BILL_STATEMENT + | :SSN_CARD + | :ITIN_LETTER + | :FINCEN_BOI_REPORT + + module DocumentType + extend Lithic::Internal::Type::Enum + + DRIVERS_LICENSE: :DRIVERS_LICENSE + PASSPORT: :PASSPORT + PASSPORT_CARD: :PASSPORT_CARD + EIN_LETTER: :EIN_LETTER + TAX_RETURN: :TAX_RETURN + OPERATING_AGREEMENT: :OPERATING_AGREEMENT + CERTIFICATE_OF_FORMATION: :CERTIFICATE_OF_FORMATION + CERTIFICATE_OF_GOOD_STANDING: :CERTIFICATE_OF_GOOD_STANDING + ARTICLES_OF_INCORPORATION: :ARTICLES_OF_INCORPORATION + ARTICLES_OF_ORGANIZATION: :ARTICLES_OF_ORGANIZATION + BYLAWS: :BYLAWS + GOVERNMENT_BUSINESS_LICENSE: :GOVERNMENT_BUSINESS_LICENSE + PARTNERSHIP_AGREEMENT: :PARTNERSHIP_AGREEMENT + SS4_FORM: :SS4_FORM + BANK_STATEMENT: :BANK_STATEMENT + UTILITY_BILL_STATEMENT: :UTILITY_BILL_STATEMENT + SSN_CARD: :SSN_CARD + ITIN_LETTER: :ITIN_LETTER + FINCEN_BOI_REPORT: :FINCEN_BOI_REPORT + + def self?.values: -> ::Array[Lithic::Models::Document::document_type] + end + + type required_document_upload = + { + token: String, + accepted_entity_status_reasons: ::Array[String], + created: Time, + image_type: Lithic::Models::Document::RequiredDocumentUpload::image_type, + rejected_entity_status_reasons: ::Array[String], + status: Lithic::Models::Document::RequiredDocumentUpload::status, + status_reasons: ::Array[Lithic::Models::Document::RequiredDocumentUpload::status_reason], + updated: Time, + upload_url: String + } + + class RequiredDocumentUpload < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor accepted_entity_status_reasons: ::Array[String] + + attr_accessor created: Time + + attr_accessor image_type: Lithic::Models::Document::RequiredDocumentUpload::image_type + + attr_accessor rejected_entity_status_reasons: ::Array[String] + + attr_accessor status: Lithic::Models::Document::RequiredDocumentUpload::status + + attr_accessor status_reasons: ::Array[Lithic::Models::Document::RequiredDocumentUpload::status_reason] + + attr_accessor updated: Time + + attr_accessor upload_url: String + + def initialize: ( + token: String, + accepted_entity_status_reasons: ::Array[String], + created: Time, + image_type: Lithic::Models::Document::RequiredDocumentUpload::image_type, + rejected_entity_status_reasons: ::Array[String], + status: Lithic::Models::Document::RequiredDocumentUpload::status, + status_reasons: ::Array[Lithic::Models::Document::RequiredDocumentUpload::status_reason], + updated: Time, + upload_url: String + ) -> void + + def to_hash: -> { + token: String, + accepted_entity_status_reasons: ::Array[String], + created: Time, + image_type: Lithic::Models::Document::RequiredDocumentUpload::image_type, + rejected_entity_status_reasons: ::Array[String], + status: Lithic::Models::Document::RequiredDocumentUpload::status, + status_reasons: ::Array[Lithic::Models::Document::RequiredDocumentUpload::status_reason], + updated: Time, + upload_url: String + } + + type image_type = :FRONT | :BACK + + module ImageType + extend Lithic::Internal::Type::Enum + + FRONT: :FRONT + BACK: :BACK + + def self?.values: -> ::Array[Lithic::Models::Document::RequiredDocumentUpload::image_type] + end + + type status = + :ACCEPTED + | :REJECTED + | :PENDING_UPLOAD + | :UPLOADED + | :PARTIAL_APPROVAL + + module Status + extend Lithic::Internal::Type::Enum + + ACCEPTED: :ACCEPTED + REJECTED: :REJECTED + PENDING_UPLOAD: :PENDING_UPLOAD + UPLOADED: :UPLOADED + PARTIAL_APPROVAL: :PARTIAL_APPROVAL + + def self?.values: -> ::Array[Lithic::Models::Document::RequiredDocumentUpload::status] + end + + type status_reason = + :DOCUMENT_MISSING_REQUIRED_DATA + | :DOCUMENT_UPLOAD_TOO_BLURRY + | :FILE_SIZE_TOO_LARGE + | :INVALID_DOCUMENT_TYPE + | :INVALID_DOCUMENT_UPLOAD + | :INVALID_ENTITY + | :DOCUMENT_EXPIRED + | :DOCUMENT_ISSUED_GREATER_THAN_30_DAYS + | :DOCUMENT_TYPE_NOT_SUPPORTED + | :UNKNOWN_FAILURE_REASON + | :UNKNOWN_ERROR + + module StatusReason + extend Lithic::Internal::Type::Enum + + DOCUMENT_MISSING_REQUIRED_DATA: :DOCUMENT_MISSING_REQUIRED_DATA + DOCUMENT_UPLOAD_TOO_BLURRY: :DOCUMENT_UPLOAD_TOO_BLURRY + FILE_SIZE_TOO_LARGE: :FILE_SIZE_TOO_LARGE + INVALID_DOCUMENT_TYPE: :INVALID_DOCUMENT_TYPE + INVALID_DOCUMENT_UPLOAD: :INVALID_DOCUMENT_UPLOAD + INVALID_ENTITY: :INVALID_ENTITY + DOCUMENT_EXPIRED: :DOCUMENT_EXPIRED + DOCUMENT_ISSUED_GREATER_THAN_30_DAYS: :DOCUMENT_ISSUED_GREATER_THAN_30_DAYS + DOCUMENT_TYPE_NOT_SUPPORTED: :DOCUMENT_TYPE_NOT_SUPPORTED + UNKNOWN_FAILURE_REASON: :UNKNOWN_FAILURE_REASON + UNKNOWN_ERROR: :UNKNOWN_ERROR + + def self?.values: -> ::Array[Lithic::Models::Document::RequiredDocumentUpload::status_reason] + end + end + end + end +end diff --git a/sig/lithic/models/event.rbs b/sig/lithic/models/event.rbs new file mode 100644 index 00000000..5950629b --- /dev/null +++ b/sig/lithic/models/event.rbs @@ -0,0 +1,152 @@ +module Lithic + module Models + type event = + { + token: String, + created: Time, + event_type: Lithic::Models::Event::event_type, + payload: ::Hash[Symbol, top] + } + + class Event < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor created: Time + + attr_accessor event_type: Lithic::Models::Event::event_type + + attr_accessor payload: ::Hash[Symbol, top] + + def initialize: ( + token: String, + created: Time, + event_type: Lithic::Models::Event::event_type, + payload: ::Hash[Symbol, top] + ) -> void + + def to_hash: -> { + token: String, + created: Time, + event_type: Lithic::Models::Event::event_type, + payload: ::Hash[Symbol, top] + } + + type event_type = + :"account_holder_document.updated" + | :"account_holder.created" + | :"account_holder.updated" + | :"account_holder.verification" + | :"auth_rules.backtest_report.created" + | :"balance.updated" + | :"book_transfer_transaction.created" + | :"book_transfer_transaction.updated" + | :"card_authorization.challenge" + | :"card_authorization.challenge_response" + | :"card_transaction.enhanced_data.created" + | :"card_transaction.enhanced_data.updated" + | :"card_transaction.updated" + | :"card.converted" + | :"card.created" + | :"card.reissued" + | :"card.renewed" + | :"card.shipped" + | :"card.updated" + | :"digital_wallet.tokenization_result" + | :"digital_wallet.tokenization_two_factor_authentication_code" + | :"digital_wallet.tokenization_two_factor_authentication_code_sent" + | :"digital_wallet.tokenization_updated" + | :"dispute_evidence.upload_failed" + | :"dispute_transaction.created" + | :"dispute_transaction.updated" + | :"dispute.updated" + | :"external_bank_account.created" + | :"external_bank_account.updated" + | :"external_payment.created" + | :"external_payment.updated" + | :"financial_account.created" + | :"financial_account.updated" + | :"funding_event.created" + | :"internal_transaction.created" + | :"internal_transaction.updated" + | :"loan_tape.created" + | :"loan_tape.updated" + | :"management_operation.created" + | :"management_operation.updated" + | :"network_total.created" + | :"network_total.updated" + | :"payment_transaction.created" + | :"payment_transaction.updated" + | :"settlement_report.updated" + | :"statements.created" + | :"three_ds_authentication.challenge" + | :"three_ds_authentication.created" + | :"three_ds_authentication.updated" + | :"tokenization.approval_request" + | :"tokenization.result" + | :"tokenization.two_factor_authentication_code" + | :"tokenization.two_factor_authentication_code_sent" + | :"tokenization.updated" + + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_DOCUMENT_UPDATED: :"account_holder_document.updated" + ACCOUNT_HOLDER_CREATED: :"account_holder.created" + ACCOUNT_HOLDER_UPDATED: :"account_holder.updated" + ACCOUNT_HOLDER_VERIFICATION: :"account_holder.verification" + AUTH_RULES_BACKTEST_REPORT_CREATED: :"auth_rules.backtest_report.created" + BALANCE_UPDATED: :"balance.updated" + BOOK_TRANSFER_TRANSACTION_CREATED: :"book_transfer_transaction.created" + BOOK_TRANSFER_TRANSACTION_UPDATED: :"book_transfer_transaction.updated" + CARD_AUTHORIZATION_CHALLENGE: :"card_authorization.challenge" + CARD_AUTHORIZATION_CHALLENGE_RESPONSE: :"card_authorization.challenge_response" + CARD_TRANSACTION_ENHANCED_DATA_CREATED: :"card_transaction.enhanced_data.created" + CARD_TRANSACTION_ENHANCED_DATA_UPDATED: :"card_transaction.enhanced_data.updated" + CARD_TRANSACTION_UPDATED: :"card_transaction.updated" + CARD_CONVERTED: :"card.converted" + CARD_CREATED: :"card.created" + CARD_REISSUED: :"card.reissued" + CARD_RENEWED: :"card.renewed" + CARD_SHIPPED: :"card.shipped" + CARD_UPDATED: :"card.updated" + DIGITAL_WALLET_TOKENIZATION_RESULT: :"digital_wallet.tokenization_result" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"digital_wallet.tokenization_two_factor_authentication_code" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT: :"digital_wallet.tokenization_two_factor_authentication_code_sent" + DIGITAL_WALLET_TOKENIZATION_UPDATED: :"digital_wallet.tokenization_updated" + DISPUTE_EVIDENCE_UPLOAD_FAILED: :"dispute_evidence.upload_failed" + DISPUTE_TRANSACTION_CREATED: :"dispute_transaction.created" + DISPUTE_TRANSACTION_UPDATED: :"dispute_transaction.updated" + DISPUTE_UPDATED: :"dispute.updated" + EXTERNAL_BANK_ACCOUNT_CREATED: :"external_bank_account.created" + EXTERNAL_BANK_ACCOUNT_UPDATED: :"external_bank_account.updated" + EXTERNAL_PAYMENT_CREATED: :"external_payment.created" + EXTERNAL_PAYMENT_UPDATED: :"external_payment.updated" + FINANCIAL_ACCOUNT_CREATED: :"financial_account.created" + FINANCIAL_ACCOUNT_UPDATED: :"financial_account.updated" + FUNDING_EVENT_CREATED: :"funding_event.created" + INTERNAL_TRANSACTION_CREATED: :"internal_transaction.created" + INTERNAL_TRANSACTION_UPDATED: :"internal_transaction.updated" + LOAN_TAPE_CREATED: :"loan_tape.created" + LOAN_TAPE_UPDATED: :"loan_tape.updated" + MANAGEMENT_OPERATION_CREATED: :"management_operation.created" + MANAGEMENT_OPERATION_UPDATED: :"management_operation.updated" + NETWORK_TOTAL_CREATED: :"network_total.created" + NETWORK_TOTAL_UPDATED: :"network_total.updated" + PAYMENT_TRANSACTION_CREATED: :"payment_transaction.created" + PAYMENT_TRANSACTION_UPDATED: :"payment_transaction.updated" + SETTLEMENT_REPORT_UPDATED: :"settlement_report.updated" + STATEMENTS_CREATED: :"statements.created" + THREE_DS_AUTHENTICATION_CHALLENGE: :"three_ds_authentication.challenge" + THREE_DS_AUTHENTICATION_CREATED: :"three_ds_authentication.created" + THREE_DS_AUTHENTICATION_UPDATED: :"three_ds_authentication.updated" + TOKENIZATION_APPROVAL_REQUEST: :"tokenization.approval_request" + TOKENIZATION_RESULT: :"tokenization.result" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"tokenization.two_factor_authentication_code" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT: :"tokenization.two_factor_authentication_code_sent" + TOKENIZATION_UPDATED: :"tokenization.updated" + + def self?.values: -> ::Array[Lithic::Models::Event::event_type] + end + end + end +end diff --git a/sig/lithic/models/event_list_attempts_params.rbs b/sig/lithic/models/event_list_attempts_params.rbs new file mode 100644 index 00000000..c1b3f623 --- /dev/null +++ b/sig/lithic/models/event_list_attempts_params.rbs @@ -0,0 +1,83 @@ +module Lithic + module Models + type event_list_attempts_params = + { + event_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::Models::EventListAttemptsParams::status + } + & Lithic::Internal::Type::request_parameters + + class EventListAttemptsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor event_token: String + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader status: Lithic::Models::EventListAttemptsParams::status? + + def status=: ( + Lithic::Models::EventListAttemptsParams::status + ) -> Lithic::Models::EventListAttemptsParams::status + + def initialize: ( + event_token: String, + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?status: Lithic::Models::EventListAttemptsParams::status, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + event_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::Models::EventListAttemptsParams::status, + request_options: Lithic::RequestOptions + } + + type status = :FAILED | :PENDING | :SENDING | :SUCCESS + + module Status + extend Lithic::Internal::Type::Enum + + FAILED: :FAILED + PENDING: :PENDING + SENDING: :SENDING + SUCCESS: :SUCCESS + + def self?.values: -> ::Array[Lithic::Models::EventListAttemptsParams::status] + end + end + end +end diff --git a/sig/lithic/models/event_list_params.rbs b/sig/lithic/models/event_list_params.rbs new file mode 100644 index 00000000..91c0c1e0 --- /dev/null +++ b/sig/lithic/models/event_list_params.rbs @@ -0,0 +1,189 @@ +module Lithic + module Models + type event_list_params = + { + begin_: Time, + end_: Time, + ending_before: String, + event_types: ::Array[Lithic::Models::EventListParams::event_type], + page_size: Integer, + starting_after: String, + with_content: bool + } + & Lithic::Internal::Type::request_parameters + + class EventListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader event_types: ::Array[Lithic::Models::EventListParams::event_type]? + + def event_types=: ( + ::Array[Lithic::Models::EventListParams::event_type] + ) -> ::Array[Lithic::Models::EventListParams::event_type] + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader with_content: bool? + + def with_content=: (bool) -> bool + + def initialize: ( + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?event_types: ::Array[Lithic::Models::EventListParams::event_type], + ?page_size: Integer, + ?starting_after: String, + ?with_content: bool, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + begin_: Time, + end_: Time, + ending_before: String, + event_types: ::Array[Lithic::Models::EventListParams::event_type], + page_size: Integer, + starting_after: String, + with_content: bool, + request_options: Lithic::RequestOptions + } + + type event_type = + :"account_holder_document.updated" + | :"account_holder.created" + | :"account_holder.updated" + | :"account_holder.verification" + | :"auth_rules.backtest_report.created" + | :"balance.updated" + | :"book_transfer_transaction.created" + | :"book_transfer_transaction.updated" + | :"card_authorization.challenge" + | :"card_authorization.challenge_response" + | :"card_transaction.enhanced_data.created" + | :"card_transaction.enhanced_data.updated" + | :"card_transaction.updated" + | :"card.converted" + | :"card.created" + | :"card.reissued" + | :"card.renewed" + | :"card.shipped" + | :"card.updated" + | :"digital_wallet.tokenization_result" + | :"digital_wallet.tokenization_two_factor_authentication_code" + | :"digital_wallet.tokenization_two_factor_authentication_code_sent" + | :"digital_wallet.tokenization_updated" + | :"dispute_evidence.upload_failed" + | :"dispute_transaction.created" + | :"dispute_transaction.updated" + | :"dispute.updated" + | :"external_bank_account.created" + | :"external_bank_account.updated" + | :"external_payment.created" + | :"external_payment.updated" + | :"financial_account.created" + | :"financial_account.updated" + | :"funding_event.created" + | :"internal_transaction.created" + | :"internal_transaction.updated" + | :"loan_tape.created" + | :"loan_tape.updated" + | :"management_operation.created" + | :"management_operation.updated" + | :"network_total.created" + | :"network_total.updated" + | :"payment_transaction.created" + | :"payment_transaction.updated" + | :"settlement_report.updated" + | :"statements.created" + | :"three_ds_authentication.challenge" + | :"three_ds_authentication.created" + | :"three_ds_authentication.updated" + | :"tokenization.approval_request" + | :"tokenization.result" + | :"tokenization.two_factor_authentication_code" + | :"tokenization.two_factor_authentication_code_sent" + | :"tokenization.updated" + + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_DOCUMENT_UPDATED: :"account_holder_document.updated" + ACCOUNT_HOLDER_CREATED: :"account_holder.created" + ACCOUNT_HOLDER_UPDATED: :"account_holder.updated" + ACCOUNT_HOLDER_VERIFICATION: :"account_holder.verification" + AUTH_RULES_BACKTEST_REPORT_CREATED: :"auth_rules.backtest_report.created" + BALANCE_UPDATED: :"balance.updated" + BOOK_TRANSFER_TRANSACTION_CREATED: :"book_transfer_transaction.created" + BOOK_TRANSFER_TRANSACTION_UPDATED: :"book_transfer_transaction.updated" + CARD_AUTHORIZATION_CHALLENGE: :"card_authorization.challenge" + CARD_AUTHORIZATION_CHALLENGE_RESPONSE: :"card_authorization.challenge_response" + CARD_TRANSACTION_ENHANCED_DATA_CREATED: :"card_transaction.enhanced_data.created" + CARD_TRANSACTION_ENHANCED_DATA_UPDATED: :"card_transaction.enhanced_data.updated" + CARD_TRANSACTION_UPDATED: :"card_transaction.updated" + CARD_CONVERTED: :"card.converted" + CARD_CREATED: :"card.created" + CARD_REISSUED: :"card.reissued" + CARD_RENEWED: :"card.renewed" + CARD_SHIPPED: :"card.shipped" + CARD_UPDATED: :"card.updated" + DIGITAL_WALLET_TOKENIZATION_RESULT: :"digital_wallet.tokenization_result" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"digital_wallet.tokenization_two_factor_authentication_code" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT: :"digital_wallet.tokenization_two_factor_authentication_code_sent" + DIGITAL_WALLET_TOKENIZATION_UPDATED: :"digital_wallet.tokenization_updated" + DISPUTE_EVIDENCE_UPLOAD_FAILED: :"dispute_evidence.upload_failed" + DISPUTE_TRANSACTION_CREATED: :"dispute_transaction.created" + DISPUTE_TRANSACTION_UPDATED: :"dispute_transaction.updated" + DISPUTE_UPDATED: :"dispute.updated" + EXTERNAL_BANK_ACCOUNT_CREATED: :"external_bank_account.created" + EXTERNAL_BANK_ACCOUNT_UPDATED: :"external_bank_account.updated" + EXTERNAL_PAYMENT_CREATED: :"external_payment.created" + EXTERNAL_PAYMENT_UPDATED: :"external_payment.updated" + FINANCIAL_ACCOUNT_CREATED: :"financial_account.created" + FINANCIAL_ACCOUNT_UPDATED: :"financial_account.updated" + FUNDING_EVENT_CREATED: :"funding_event.created" + INTERNAL_TRANSACTION_CREATED: :"internal_transaction.created" + INTERNAL_TRANSACTION_UPDATED: :"internal_transaction.updated" + LOAN_TAPE_CREATED: :"loan_tape.created" + LOAN_TAPE_UPDATED: :"loan_tape.updated" + MANAGEMENT_OPERATION_CREATED: :"management_operation.created" + MANAGEMENT_OPERATION_UPDATED: :"management_operation.updated" + NETWORK_TOTAL_CREATED: :"network_total.created" + NETWORK_TOTAL_UPDATED: :"network_total.updated" + PAYMENT_TRANSACTION_CREATED: :"payment_transaction.created" + PAYMENT_TRANSACTION_UPDATED: :"payment_transaction.updated" + SETTLEMENT_REPORT_UPDATED: :"settlement_report.updated" + STATEMENTS_CREATED: :"statements.created" + THREE_DS_AUTHENTICATION_CHALLENGE: :"three_ds_authentication.challenge" + THREE_DS_AUTHENTICATION_CREATED: :"three_ds_authentication.created" + THREE_DS_AUTHENTICATION_UPDATED: :"three_ds_authentication.updated" + TOKENIZATION_APPROVAL_REQUEST: :"tokenization.approval_request" + TOKENIZATION_RESULT: :"tokenization.result" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"tokenization.two_factor_authentication_code" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT: :"tokenization.two_factor_authentication_code_sent" + TOKENIZATION_UPDATED: :"tokenization.updated" + + def self?.values: -> ::Array[Lithic::Models::EventListParams::event_type] + end + end + end +end diff --git a/sig/lithic/models/event_retrieve_params.rbs b/sig/lithic/models/event_retrieve_params.rbs new file mode 100644 index 00000000..0a543794 --- /dev/null +++ b/sig/lithic/models/event_retrieve_params.rbs @@ -0,0 +1,23 @@ +module Lithic + module Models + type event_retrieve_params = + { event_token: String } & Lithic::Internal::Type::request_parameters + + class EventRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor event_token: String + + def initialize: ( + event_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + event_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/event_subscription.rbs b/sig/lithic/models/event_subscription.rbs new file mode 100644 index 00000000..377c7fce --- /dev/null +++ b/sig/lithic/models/event_subscription.rbs @@ -0,0 +1,157 @@ +module Lithic + module Models + type event_subscription = + { + token: String, + description: String, + disabled: bool, + url: String, + event_types: ::Array[Lithic::Models::EventSubscription::event_type]? + } + + class EventSubscription < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor description: String + + attr_accessor disabled: bool + + attr_accessor url: String + + attr_accessor event_types: ::Array[Lithic::Models::EventSubscription::event_type]? + + def initialize: ( + token: String, + description: String, + disabled: bool, + url: String, + ?event_types: ::Array[Lithic::Models::EventSubscription::event_type]? + ) -> void + + def to_hash: -> { + token: String, + description: String, + disabled: bool, + url: String, + event_types: ::Array[Lithic::Models::EventSubscription::event_type]? + } + + type event_type = + :"account_holder_document.updated" + | :"account_holder.created" + | :"account_holder.updated" + | :"account_holder.verification" + | :"auth_rules.backtest_report.created" + | :"balance.updated" + | :"book_transfer_transaction.created" + | :"book_transfer_transaction.updated" + | :"card_authorization.challenge" + | :"card_authorization.challenge_response" + | :"card_transaction.enhanced_data.created" + | :"card_transaction.enhanced_data.updated" + | :"card_transaction.updated" + | :"card.converted" + | :"card.created" + | :"card.reissued" + | :"card.renewed" + | :"card.shipped" + | :"card.updated" + | :"digital_wallet.tokenization_result" + | :"digital_wallet.tokenization_two_factor_authentication_code" + | :"digital_wallet.tokenization_two_factor_authentication_code_sent" + | :"digital_wallet.tokenization_updated" + | :"dispute_evidence.upload_failed" + | :"dispute_transaction.created" + | :"dispute_transaction.updated" + | :"dispute.updated" + | :"external_bank_account.created" + | :"external_bank_account.updated" + | :"external_payment.created" + | :"external_payment.updated" + | :"financial_account.created" + | :"financial_account.updated" + | :"funding_event.created" + | :"internal_transaction.created" + | :"internal_transaction.updated" + | :"loan_tape.created" + | :"loan_tape.updated" + | :"management_operation.created" + | :"management_operation.updated" + | :"network_total.created" + | :"network_total.updated" + | :"payment_transaction.created" + | :"payment_transaction.updated" + | :"settlement_report.updated" + | :"statements.created" + | :"three_ds_authentication.challenge" + | :"three_ds_authentication.created" + | :"three_ds_authentication.updated" + | :"tokenization.approval_request" + | :"tokenization.result" + | :"tokenization.two_factor_authentication_code" + | :"tokenization.two_factor_authentication_code_sent" + | :"tokenization.updated" + + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_DOCUMENT_UPDATED: :"account_holder_document.updated" + ACCOUNT_HOLDER_CREATED: :"account_holder.created" + ACCOUNT_HOLDER_UPDATED: :"account_holder.updated" + ACCOUNT_HOLDER_VERIFICATION: :"account_holder.verification" + AUTH_RULES_BACKTEST_REPORT_CREATED: :"auth_rules.backtest_report.created" + BALANCE_UPDATED: :"balance.updated" + BOOK_TRANSFER_TRANSACTION_CREATED: :"book_transfer_transaction.created" + BOOK_TRANSFER_TRANSACTION_UPDATED: :"book_transfer_transaction.updated" + CARD_AUTHORIZATION_CHALLENGE: :"card_authorization.challenge" + CARD_AUTHORIZATION_CHALLENGE_RESPONSE: :"card_authorization.challenge_response" + CARD_TRANSACTION_ENHANCED_DATA_CREATED: :"card_transaction.enhanced_data.created" + CARD_TRANSACTION_ENHANCED_DATA_UPDATED: :"card_transaction.enhanced_data.updated" + CARD_TRANSACTION_UPDATED: :"card_transaction.updated" + CARD_CONVERTED: :"card.converted" + CARD_CREATED: :"card.created" + CARD_REISSUED: :"card.reissued" + CARD_RENEWED: :"card.renewed" + CARD_SHIPPED: :"card.shipped" + CARD_UPDATED: :"card.updated" + DIGITAL_WALLET_TOKENIZATION_RESULT: :"digital_wallet.tokenization_result" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"digital_wallet.tokenization_two_factor_authentication_code" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT: :"digital_wallet.tokenization_two_factor_authentication_code_sent" + DIGITAL_WALLET_TOKENIZATION_UPDATED: :"digital_wallet.tokenization_updated" + DISPUTE_EVIDENCE_UPLOAD_FAILED: :"dispute_evidence.upload_failed" + DISPUTE_TRANSACTION_CREATED: :"dispute_transaction.created" + DISPUTE_TRANSACTION_UPDATED: :"dispute_transaction.updated" + DISPUTE_UPDATED: :"dispute.updated" + EXTERNAL_BANK_ACCOUNT_CREATED: :"external_bank_account.created" + EXTERNAL_BANK_ACCOUNT_UPDATED: :"external_bank_account.updated" + EXTERNAL_PAYMENT_CREATED: :"external_payment.created" + EXTERNAL_PAYMENT_UPDATED: :"external_payment.updated" + FINANCIAL_ACCOUNT_CREATED: :"financial_account.created" + FINANCIAL_ACCOUNT_UPDATED: :"financial_account.updated" + FUNDING_EVENT_CREATED: :"funding_event.created" + INTERNAL_TRANSACTION_CREATED: :"internal_transaction.created" + INTERNAL_TRANSACTION_UPDATED: :"internal_transaction.updated" + LOAN_TAPE_CREATED: :"loan_tape.created" + LOAN_TAPE_UPDATED: :"loan_tape.updated" + MANAGEMENT_OPERATION_CREATED: :"management_operation.created" + MANAGEMENT_OPERATION_UPDATED: :"management_operation.updated" + NETWORK_TOTAL_CREATED: :"network_total.created" + NETWORK_TOTAL_UPDATED: :"network_total.updated" + PAYMENT_TRANSACTION_CREATED: :"payment_transaction.created" + PAYMENT_TRANSACTION_UPDATED: :"payment_transaction.updated" + SETTLEMENT_REPORT_UPDATED: :"settlement_report.updated" + STATEMENTS_CREATED: :"statements.created" + THREE_DS_AUTHENTICATION_CHALLENGE: :"three_ds_authentication.challenge" + THREE_DS_AUTHENTICATION_CREATED: :"three_ds_authentication.created" + THREE_DS_AUTHENTICATION_UPDATED: :"three_ds_authentication.updated" + TOKENIZATION_APPROVAL_REQUEST: :"tokenization.approval_request" + TOKENIZATION_RESULT: :"tokenization.result" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"tokenization.two_factor_authentication_code" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT: :"tokenization.two_factor_authentication_code_sent" + TOKENIZATION_UPDATED: :"tokenization.updated" + + def self?.values: -> ::Array[Lithic::Models::EventSubscription::event_type] + end + end + end +end diff --git a/sig/lithic/models/events/event_subscription_resend_params.rbs b/sig/lithic/models/events/event_subscription_resend_params.rbs new file mode 100644 index 00000000..b479636c --- /dev/null +++ b/sig/lithic/models/events/event_subscription_resend_params.rbs @@ -0,0 +1,30 @@ +module Lithic + module Models + module Events + type event_subscription_resend_params = + { event_token: String, event_subscription_token: String } + & Lithic::Internal::Type::request_parameters + + class EventSubscriptionResendParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor event_token: String + + attr_accessor event_subscription_token: String + + def initialize: ( + event_token: String, + event_subscription_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + event_token: String, + event_subscription_token: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/events/subscription_create_params.rbs b/sig/lithic/models/events/subscription_create_params.rbs new file mode 100644 index 00000000..a35263b3 --- /dev/null +++ b/sig/lithic/models/events/subscription_create_params.rbs @@ -0,0 +1,168 @@ +module Lithic + module Models + module Events + type subscription_create_params = + { + url: String, + description: String, + disabled: bool, + event_types: ::Array[Lithic::Models::Events::SubscriptionCreateParams::event_type] + } + & Lithic::Internal::Type::request_parameters + + class SubscriptionCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor url: String + + attr_reader description: String? + + def description=: (String) -> String + + attr_reader disabled: bool? + + def disabled=: (bool) -> bool + + attr_reader event_types: ::Array[Lithic::Models::Events::SubscriptionCreateParams::event_type]? + + def event_types=: ( + ::Array[Lithic::Models::Events::SubscriptionCreateParams::event_type] + ) -> ::Array[Lithic::Models::Events::SubscriptionCreateParams::event_type] + + def initialize: ( + url: String, + ?description: String, + ?disabled: bool, + ?event_types: ::Array[Lithic::Models::Events::SubscriptionCreateParams::event_type], + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + url: String, + description: String, + disabled: bool, + event_types: ::Array[Lithic::Models::Events::SubscriptionCreateParams::event_type], + request_options: Lithic::RequestOptions + } + + type event_type = + :"account_holder_document.updated" + | :"account_holder.created" + | :"account_holder.updated" + | :"account_holder.verification" + | :"auth_rules.backtest_report.created" + | :"balance.updated" + | :"book_transfer_transaction.created" + | :"book_transfer_transaction.updated" + | :"card_authorization.challenge" + | :"card_authorization.challenge_response" + | :"card_transaction.enhanced_data.created" + | :"card_transaction.enhanced_data.updated" + | :"card_transaction.updated" + | :"card.converted" + | :"card.created" + | :"card.reissued" + | :"card.renewed" + | :"card.shipped" + | :"card.updated" + | :"digital_wallet.tokenization_result" + | :"digital_wallet.tokenization_two_factor_authentication_code" + | :"digital_wallet.tokenization_two_factor_authentication_code_sent" + | :"digital_wallet.tokenization_updated" + | :"dispute_evidence.upload_failed" + | :"dispute_transaction.created" + | :"dispute_transaction.updated" + | :"dispute.updated" + | :"external_bank_account.created" + | :"external_bank_account.updated" + | :"external_payment.created" + | :"external_payment.updated" + | :"financial_account.created" + | :"financial_account.updated" + | :"funding_event.created" + | :"internal_transaction.created" + | :"internal_transaction.updated" + | :"loan_tape.created" + | :"loan_tape.updated" + | :"management_operation.created" + | :"management_operation.updated" + | :"network_total.created" + | :"network_total.updated" + | :"payment_transaction.created" + | :"payment_transaction.updated" + | :"settlement_report.updated" + | :"statements.created" + | :"three_ds_authentication.challenge" + | :"three_ds_authentication.created" + | :"three_ds_authentication.updated" + | :"tokenization.approval_request" + | :"tokenization.result" + | :"tokenization.two_factor_authentication_code" + | :"tokenization.two_factor_authentication_code_sent" + | :"tokenization.updated" + + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_DOCUMENT_UPDATED: :"account_holder_document.updated" + ACCOUNT_HOLDER_CREATED: :"account_holder.created" + ACCOUNT_HOLDER_UPDATED: :"account_holder.updated" + ACCOUNT_HOLDER_VERIFICATION: :"account_holder.verification" + AUTH_RULES_BACKTEST_REPORT_CREATED: :"auth_rules.backtest_report.created" + BALANCE_UPDATED: :"balance.updated" + BOOK_TRANSFER_TRANSACTION_CREATED: :"book_transfer_transaction.created" + BOOK_TRANSFER_TRANSACTION_UPDATED: :"book_transfer_transaction.updated" + CARD_AUTHORIZATION_CHALLENGE: :"card_authorization.challenge" + CARD_AUTHORIZATION_CHALLENGE_RESPONSE: :"card_authorization.challenge_response" + CARD_TRANSACTION_ENHANCED_DATA_CREATED: :"card_transaction.enhanced_data.created" + CARD_TRANSACTION_ENHANCED_DATA_UPDATED: :"card_transaction.enhanced_data.updated" + CARD_TRANSACTION_UPDATED: :"card_transaction.updated" + CARD_CONVERTED: :"card.converted" + CARD_CREATED: :"card.created" + CARD_REISSUED: :"card.reissued" + CARD_RENEWED: :"card.renewed" + CARD_SHIPPED: :"card.shipped" + CARD_UPDATED: :"card.updated" + DIGITAL_WALLET_TOKENIZATION_RESULT: :"digital_wallet.tokenization_result" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"digital_wallet.tokenization_two_factor_authentication_code" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT: :"digital_wallet.tokenization_two_factor_authentication_code_sent" + DIGITAL_WALLET_TOKENIZATION_UPDATED: :"digital_wallet.tokenization_updated" + DISPUTE_EVIDENCE_UPLOAD_FAILED: :"dispute_evidence.upload_failed" + DISPUTE_TRANSACTION_CREATED: :"dispute_transaction.created" + DISPUTE_TRANSACTION_UPDATED: :"dispute_transaction.updated" + DISPUTE_UPDATED: :"dispute.updated" + EXTERNAL_BANK_ACCOUNT_CREATED: :"external_bank_account.created" + EXTERNAL_BANK_ACCOUNT_UPDATED: :"external_bank_account.updated" + EXTERNAL_PAYMENT_CREATED: :"external_payment.created" + EXTERNAL_PAYMENT_UPDATED: :"external_payment.updated" + FINANCIAL_ACCOUNT_CREATED: :"financial_account.created" + FINANCIAL_ACCOUNT_UPDATED: :"financial_account.updated" + FUNDING_EVENT_CREATED: :"funding_event.created" + INTERNAL_TRANSACTION_CREATED: :"internal_transaction.created" + INTERNAL_TRANSACTION_UPDATED: :"internal_transaction.updated" + LOAN_TAPE_CREATED: :"loan_tape.created" + LOAN_TAPE_UPDATED: :"loan_tape.updated" + MANAGEMENT_OPERATION_CREATED: :"management_operation.created" + MANAGEMENT_OPERATION_UPDATED: :"management_operation.updated" + NETWORK_TOTAL_CREATED: :"network_total.created" + NETWORK_TOTAL_UPDATED: :"network_total.updated" + PAYMENT_TRANSACTION_CREATED: :"payment_transaction.created" + PAYMENT_TRANSACTION_UPDATED: :"payment_transaction.updated" + SETTLEMENT_REPORT_UPDATED: :"settlement_report.updated" + STATEMENTS_CREATED: :"statements.created" + THREE_DS_AUTHENTICATION_CHALLENGE: :"three_ds_authentication.challenge" + THREE_DS_AUTHENTICATION_CREATED: :"three_ds_authentication.created" + THREE_DS_AUTHENTICATION_UPDATED: :"three_ds_authentication.updated" + TOKENIZATION_APPROVAL_REQUEST: :"tokenization.approval_request" + TOKENIZATION_RESULT: :"tokenization.result" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"tokenization.two_factor_authentication_code" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT: :"tokenization.two_factor_authentication_code_sent" + TOKENIZATION_UPDATED: :"tokenization.updated" + + def self?.values: -> ::Array[Lithic::Models::Events::SubscriptionCreateParams::event_type] + end + end + end + end +end diff --git a/sig/lithic/models/events/subscription_delete_params.rbs b/sig/lithic/models/events/subscription_delete_params.rbs new file mode 100644 index 00000000..63c424b6 --- /dev/null +++ b/sig/lithic/models/events/subscription_delete_params.rbs @@ -0,0 +1,26 @@ +module Lithic + module Models + module Events + type subscription_delete_params = + { event_subscription_token: String } + & Lithic::Internal::Type::request_parameters + + class SubscriptionDeleteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor event_subscription_token: String + + def initialize: ( + event_subscription_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + event_subscription_token: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/events/subscription_list_attempts_params.rbs b/sig/lithic/models/events/subscription_list_attempts_params.rbs new file mode 100644 index 00000000..4f69ab08 --- /dev/null +++ b/sig/lithic/models/events/subscription_list_attempts_params.rbs @@ -0,0 +1,85 @@ +module Lithic + module Models + module Events + type subscription_list_attempts_params = + { + event_subscription_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::Models::Events::SubscriptionListAttemptsParams::status + } + & Lithic::Internal::Type::request_parameters + + class SubscriptionListAttemptsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor event_subscription_token: String + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader status: Lithic::Models::Events::SubscriptionListAttemptsParams::status? + + def status=: ( + Lithic::Models::Events::SubscriptionListAttemptsParams::status + ) -> Lithic::Models::Events::SubscriptionListAttemptsParams::status + + def initialize: ( + event_subscription_token: String, + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?status: Lithic::Models::Events::SubscriptionListAttemptsParams::status, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + event_subscription_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::Models::Events::SubscriptionListAttemptsParams::status, + request_options: Lithic::RequestOptions + } + + type status = :FAILED | :PENDING | :SENDING | :SUCCESS + + module Status + extend Lithic::Internal::Type::Enum + + FAILED: :FAILED + PENDING: :PENDING + SENDING: :SENDING + SUCCESS: :SUCCESS + + def self?.values: -> ::Array[Lithic::Models::Events::SubscriptionListAttemptsParams::status] + end + end + end + end +end diff --git a/sig/lithic/models/events/subscription_list_params.rbs b/sig/lithic/models/events/subscription_list_params.rbs new file mode 100644 index 00000000..773e2992 --- /dev/null +++ b/sig/lithic/models/events/subscription_list_params.rbs @@ -0,0 +1,40 @@ +module Lithic + module Models + module Events + type subscription_list_params = + { ending_before: String, page_size: Integer, starting_after: String } + & Lithic::Internal::Type::request_parameters + + class SubscriptionListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/events/subscription_recover_params.rbs b/sig/lithic/models/events/subscription_recover_params.rbs new file mode 100644 index 00000000..50d6ceac --- /dev/null +++ b/sig/lithic/models/events/subscription_recover_params.rbs @@ -0,0 +1,38 @@ +module Lithic + module Models + module Events + type subscription_recover_params = + { event_subscription_token: String, begin_: Time, end_: Time } + & Lithic::Internal::Type::request_parameters + + class SubscriptionRecoverParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor event_subscription_token: String + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + def initialize: ( + event_subscription_token: String, + ?begin_: Time, + ?end_: Time, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + event_subscription_token: String, + begin_: Time, + end_: Time, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/events/subscription_replay_missing_params.rbs b/sig/lithic/models/events/subscription_replay_missing_params.rbs new file mode 100644 index 00000000..915f8cb4 --- /dev/null +++ b/sig/lithic/models/events/subscription_replay_missing_params.rbs @@ -0,0 +1,38 @@ +module Lithic + module Models + module Events + type subscription_replay_missing_params = + { event_subscription_token: String, begin_: Time, end_: Time } + & Lithic::Internal::Type::request_parameters + + class SubscriptionReplayMissingParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor event_subscription_token: String + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + def initialize: ( + event_subscription_token: String, + ?begin_: Time, + ?end_: Time, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + event_subscription_token: String, + begin_: Time, + end_: Time, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/events/subscription_retrieve_params.rbs b/sig/lithic/models/events/subscription_retrieve_params.rbs new file mode 100644 index 00000000..6dbf526e --- /dev/null +++ b/sig/lithic/models/events/subscription_retrieve_params.rbs @@ -0,0 +1,26 @@ +module Lithic + module Models + module Events + type subscription_retrieve_params = + { event_subscription_token: String } + & Lithic::Internal::Type::request_parameters + + class SubscriptionRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor event_subscription_token: String + + def initialize: ( + event_subscription_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + event_subscription_token: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/events/subscription_retrieve_secret_params.rbs b/sig/lithic/models/events/subscription_retrieve_secret_params.rbs new file mode 100644 index 00000000..b6d432a4 --- /dev/null +++ b/sig/lithic/models/events/subscription_retrieve_secret_params.rbs @@ -0,0 +1,26 @@ +module Lithic + module Models + module Events + type subscription_retrieve_secret_params = + { event_subscription_token: String } + & Lithic::Internal::Type::request_parameters + + class SubscriptionRetrieveSecretParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor event_subscription_token: String + + def initialize: ( + event_subscription_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + event_subscription_token: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/events/subscription_retrieve_secret_response.rbs b/sig/lithic/models/events/subscription_retrieve_secret_response.rbs new file mode 100644 index 00000000..5ba784e9 --- /dev/null +++ b/sig/lithic/models/events/subscription_retrieve_secret_response.rbs @@ -0,0 +1,17 @@ +module Lithic + module Models + module Events + type subscription_retrieve_secret_response = { secret: String } + + class SubscriptionRetrieveSecretResponse < Lithic::Internal::Type::BaseModel + attr_reader secret: String? + + def secret=: (String) -> String + + def initialize: (?secret: String) -> void + + def to_hash: -> { secret: String } + end + end + end +end diff --git a/sig/lithic/models/events/subscription_rotate_secret_params.rbs b/sig/lithic/models/events/subscription_rotate_secret_params.rbs new file mode 100644 index 00000000..b238bf5c --- /dev/null +++ b/sig/lithic/models/events/subscription_rotate_secret_params.rbs @@ -0,0 +1,26 @@ +module Lithic + module Models + module Events + type subscription_rotate_secret_params = + { event_subscription_token: String } + & Lithic::Internal::Type::request_parameters + + class SubscriptionRotateSecretParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor event_subscription_token: String + + def initialize: ( + event_subscription_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + event_subscription_token: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/events/subscription_send_simulated_example_params.rbs b/sig/lithic/models/events/subscription_send_simulated_example_params.rbs new file mode 100644 index 00000000..2f5dfbd0 --- /dev/null +++ b/sig/lithic/models/events/subscription_send_simulated_example_params.rbs @@ -0,0 +1,154 @@ +module Lithic + module Models + module Events + type subscription_send_simulated_example_params = + { + event_subscription_token: String, + event_type: Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::event_type + } + & Lithic::Internal::Type::request_parameters + + class SubscriptionSendSimulatedExampleParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor event_subscription_token: String + + attr_reader event_type: Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::event_type? + + def event_type=: ( + Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::event_type + ) -> Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::event_type + + def initialize: ( + event_subscription_token: String, + ?event_type: Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::event_type, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + event_subscription_token: String, + event_type: Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::event_type, + request_options: Lithic::RequestOptions + } + + type event_type = + :"account_holder_document.updated" + | :"account_holder.created" + | :"account_holder.updated" + | :"account_holder.verification" + | :"auth_rules.backtest_report.created" + | :"balance.updated" + | :"book_transfer_transaction.created" + | :"book_transfer_transaction.updated" + | :"card_authorization.challenge" + | :"card_authorization.challenge_response" + | :"card_transaction.enhanced_data.created" + | :"card_transaction.enhanced_data.updated" + | :"card_transaction.updated" + | :"card.converted" + | :"card.created" + | :"card.reissued" + | :"card.renewed" + | :"card.shipped" + | :"card.updated" + | :"digital_wallet.tokenization_result" + | :"digital_wallet.tokenization_two_factor_authentication_code" + | :"digital_wallet.tokenization_two_factor_authentication_code_sent" + | :"digital_wallet.tokenization_updated" + | :"dispute_evidence.upload_failed" + | :"dispute_transaction.created" + | :"dispute_transaction.updated" + | :"dispute.updated" + | :"external_bank_account.created" + | :"external_bank_account.updated" + | :"external_payment.created" + | :"external_payment.updated" + | :"financial_account.created" + | :"financial_account.updated" + | :"funding_event.created" + | :"internal_transaction.created" + | :"internal_transaction.updated" + | :"loan_tape.created" + | :"loan_tape.updated" + | :"management_operation.created" + | :"management_operation.updated" + | :"network_total.created" + | :"network_total.updated" + | :"payment_transaction.created" + | :"payment_transaction.updated" + | :"settlement_report.updated" + | :"statements.created" + | :"three_ds_authentication.challenge" + | :"three_ds_authentication.created" + | :"three_ds_authentication.updated" + | :"tokenization.approval_request" + | :"tokenization.result" + | :"tokenization.two_factor_authentication_code" + | :"tokenization.two_factor_authentication_code_sent" + | :"tokenization.updated" + + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_DOCUMENT_UPDATED: :"account_holder_document.updated" + ACCOUNT_HOLDER_CREATED: :"account_holder.created" + ACCOUNT_HOLDER_UPDATED: :"account_holder.updated" + ACCOUNT_HOLDER_VERIFICATION: :"account_holder.verification" + AUTH_RULES_BACKTEST_REPORT_CREATED: :"auth_rules.backtest_report.created" + BALANCE_UPDATED: :"balance.updated" + BOOK_TRANSFER_TRANSACTION_CREATED: :"book_transfer_transaction.created" + BOOK_TRANSFER_TRANSACTION_UPDATED: :"book_transfer_transaction.updated" + CARD_AUTHORIZATION_CHALLENGE: :"card_authorization.challenge" + CARD_AUTHORIZATION_CHALLENGE_RESPONSE: :"card_authorization.challenge_response" + CARD_TRANSACTION_ENHANCED_DATA_CREATED: :"card_transaction.enhanced_data.created" + CARD_TRANSACTION_ENHANCED_DATA_UPDATED: :"card_transaction.enhanced_data.updated" + CARD_TRANSACTION_UPDATED: :"card_transaction.updated" + CARD_CONVERTED: :"card.converted" + CARD_CREATED: :"card.created" + CARD_REISSUED: :"card.reissued" + CARD_RENEWED: :"card.renewed" + CARD_SHIPPED: :"card.shipped" + CARD_UPDATED: :"card.updated" + DIGITAL_WALLET_TOKENIZATION_RESULT: :"digital_wallet.tokenization_result" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"digital_wallet.tokenization_two_factor_authentication_code" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT: :"digital_wallet.tokenization_two_factor_authentication_code_sent" + DIGITAL_WALLET_TOKENIZATION_UPDATED: :"digital_wallet.tokenization_updated" + DISPUTE_EVIDENCE_UPLOAD_FAILED: :"dispute_evidence.upload_failed" + DISPUTE_TRANSACTION_CREATED: :"dispute_transaction.created" + DISPUTE_TRANSACTION_UPDATED: :"dispute_transaction.updated" + DISPUTE_UPDATED: :"dispute.updated" + EXTERNAL_BANK_ACCOUNT_CREATED: :"external_bank_account.created" + EXTERNAL_BANK_ACCOUNT_UPDATED: :"external_bank_account.updated" + EXTERNAL_PAYMENT_CREATED: :"external_payment.created" + EXTERNAL_PAYMENT_UPDATED: :"external_payment.updated" + FINANCIAL_ACCOUNT_CREATED: :"financial_account.created" + FINANCIAL_ACCOUNT_UPDATED: :"financial_account.updated" + FUNDING_EVENT_CREATED: :"funding_event.created" + INTERNAL_TRANSACTION_CREATED: :"internal_transaction.created" + INTERNAL_TRANSACTION_UPDATED: :"internal_transaction.updated" + LOAN_TAPE_CREATED: :"loan_tape.created" + LOAN_TAPE_UPDATED: :"loan_tape.updated" + MANAGEMENT_OPERATION_CREATED: :"management_operation.created" + MANAGEMENT_OPERATION_UPDATED: :"management_operation.updated" + NETWORK_TOTAL_CREATED: :"network_total.created" + NETWORK_TOTAL_UPDATED: :"network_total.updated" + PAYMENT_TRANSACTION_CREATED: :"payment_transaction.created" + PAYMENT_TRANSACTION_UPDATED: :"payment_transaction.updated" + SETTLEMENT_REPORT_UPDATED: :"settlement_report.updated" + STATEMENTS_CREATED: :"statements.created" + THREE_DS_AUTHENTICATION_CHALLENGE: :"three_ds_authentication.challenge" + THREE_DS_AUTHENTICATION_CREATED: :"three_ds_authentication.created" + THREE_DS_AUTHENTICATION_UPDATED: :"three_ds_authentication.updated" + TOKENIZATION_APPROVAL_REQUEST: :"tokenization.approval_request" + TOKENIZATION_RESULT: :"tokenization.result" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"tokenization.two_factor_authentication_code" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT: :"tokenization.two_factor_authentication_code_sent" + TOKENIZATION_UPDATED: :"tokenization.updated" + + def self?.values: -> ::Array[Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::event_type] + end + end + end + end +end diff --git a/sig/lithic/models/events/subscription_update_params.rbs b/sig/lithic/models/events/subscription_update_params.rbs new file mode 100644 index 00000000..ce74dca2 --- /dev/null +++ b/sig/lithic/models/events/subscription_update_params.rbs @@ -0,0 +1,173 @@ +module Lithic + module Models + module Events + type subscription_update_params = + { + event_subscription_token: String, + url: String, + description: String, + disabled: bool, + event_types: ::Array[Lithic::Models::Events::SubscriptionUpdateParams::event_type] + } + & Lithic::Internal::Type::request_parameters + + class SubscriptionUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor event_subscription_token: String + + attr_accessor url: String + + attr_reader description: String? + + def description=: (String) -> String + + attr_reader disabled: bool? + + def disabled=: (bool) -> bool + + attr_reader event_types: ::Array[Lithic::Models::Events::SubscriptionUpdateParams::event_type]? + + def event_types=: ( + ::Array[Lithic::Models::Events::SubscriptionUpdateParams::event_type] + ) -> ::Array[Lithic::Models::Events::SubscriptionUpdateParams::event_type] + + def initialize: ( + event_subscription_token: String, + url: String, + ?description: String, + ?disabled: bool, + ?event_types: ::Array[Lithic::Models::Events::SubscriptionUpdateParams::event_type], + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + event_subscription_token: String, + url: String, + description: String, + disabled: bool, + event_types: ::Array[Lithic::Models::Events::SubscriptionUpdateParams::event_type], + request_options: Lithic::RequestOptions + } + + type event_type = + :"account_holder_document.updated" + | :"account_holder.created" + | :"account_holder.updated" + | :"account_holder.verification" + | :"auth_rules.backtest_report.created" + | :"balance.updated" + | :"book_transfer_transaction.created" + | :"book_transfer_transaction.updated" + | :"card_authorization.challenge" + | :"card_authorization.challenge_response" + | :"card_transaction.enhanced_data.created" + | :"card_transaction.enhanced_data.updated" + | :"card_transaction.updated" + | :"card.converted" + | :"card.created" + | :"card.reissued" + | :"card.renewed" + | :"card.shipped" + | :"card.updated" + | :"digital_wallet.tokenization_result" + | :"digital_wallet.tokenization_two_factor_authentication_code" + | :"digital_wallet.tokenization_two_factor_authentication_code_sent" + | :"digital_wallet.tokenization_updated" + | :"dispute_evidence.upload_failed" + | :"dispute_transaction.created" + | :"dispute_transaction.updated" + | :"dispute.updated" + | :"external_bank_account.created" + | :"external_bank_account.updated" + | :"external_payment.created" + | :"external_payment.updated" + | :"financial_account.created" + | :"financial_account.updated" + | :"funding_event.created" + | :"internal_transaction.created" + | :"internal_transaction.updated" + | :"loan_tape.created" + | :"loan_tape.updated" + | :"management_operation.created" + | :"management_operation.updated" + | :"network_total.created" + | :"network_total.updated" + | :"payment_transaction.created" + | :"payment_transaction.updated" + | :"settlement_report.updated" + | :"statements.created" + | :"three_ds_authentication.challenge" + | :"three_ds_authentication.created" + | :"three_ds_authentication.updated" + | :"tokenization.approval_request" + | :"tokenization.result" + | :"tokenization.two_factor_authentication_code" + | :"tokenization.two_factor_authentication_code_sent" + | :"tokenization.updated" + + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_DOCUMENT_UPDATED: :"account_holder_document.updated" + ACCOUNT_HOLDER_CREATED: :"account_holder.created" + ACCOUNT_HOLDER_UPDATED: :"account_holder.updated" + ACCOUNT_HOLDER_VERIFICATION: :"account_holder.verification" + AUTH_RULES_BACKTEST_REPORT_CREATED: :"auth_rules.backtest_report.created" + BALANCE_UPDATED: :"balance.updated" + BOOK_TRANSFER_TRANSACTION_CREATED: :"book_transfer_transaction.created" + BOOK_TRANSFER_TRANSACTION_UPDATED: :"book_transfer_transaction.updated" + CARD_AUTHORIZATION_CHALLENGE: :"card_authorization.challenge" + CARD_AUTHORIZATION_CHALLENGE_RESPONSE: :"card_authorization.challenge_response" + CARD_TRANSACTION_ENHANCED_DATA_CREATED: :"card_transaction.enhanced_data.created" + CARD_TRANSACTION_ENHANCED_DATA_UPDATED: :"card_transaction.enhanced_data.updated" + CARD_TRANSACTION_UPDATED: :"card_transaction.updated" + CARD_CONVERTED: :"card.converted" + CARD_CREATED: :"card.created" + CARD_REISSUED: :"card.reissued" + CARD_RENEWED: :"card.renewed" + CARD_SHIPPED: :"card.shipped" + CARD_UPDATED: :"card.updated" + DIGITAL_WALLET_TOKENIZATION_RESULT: :"digital_wallet.tokenization_result" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"digital_wallet.tokenization_two_factor_authentication_code" + DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT: :"digital_wallet.tokenization_two_factor_authentication_code_sent" + DIGITAL_WALLET_TOKENIZATION_UPDATED: :"digital_wallet.tokenization_updated" + DISPUTE_EVIDENCE_UPLOAD_FAILED: :"dispute_evidence.upload_failed" + DISPUTE_TRANSACTION_CREATED: :"dispute_transaction.created" + DISPUTE_TRANSACTION_UPDATED: :"dispute_transaction.updated" + DISPUTE_UPDATED: :"dispute.updated" + EXTERNAL_BANK_ACCOUNT_CREATED: :"external_bank_account.created" + EXTERNAL_BANK_ACCOUNT_UPDATED: :"external_bank_account.updated" + EXTERNAL_PAYMENT_CREATED: :"external_payment.created" + EXTERNAL_PAYMENT_UPDATED: :"external_payment.updated" + FINANCIAL_ACCOUNT_CREATED: :"financial_account.created" + FINANCIAL_ACCOUNT_UPDATED: :"financial_account.updated" + FUNDING_EVENT_CREATED: :"funding_event.created" + INTERNAL_TRANSACTION_CREATED: :"internal_transaction.created" + INTERNAL_TRANSACTION_UPDATED: :"internal_transaction.updated" + LOAN_TAPE_CREATED: :"loan_tape.created" + LOAN_TAPE_UPDATED: :"loan_tape.updated" + MANAGEMENT_OPERATION_CREATED: :"management_operation.created" + MANAGEMENT_OPERATION_UPDATED: :"management_operation.updated" + NETWORK_TOTAL_CREATED: :"network_total.created" + NETWORK_TOTAL_UPDATED: :"network_total.updated" + PAYMENT_TRANSACTION_CREATED: :"payment_transaction.created" + PAYMENT_TRANSACTION_UPDATED: :"payment_transaction.updated" + SETTLEMENT_REPORT_UPDATED: :"settlement_report.updated" + STATEMENTS_CREATED: :"statements.created" + THREE_DS_AUTHENTICATION_CHALLENGE: :"three_ds_authentication.challenge" + THREE_DS_AUTHENTICATION_CREATED: :"three_ds_authentication.created" + THREE_DS_AUTHENTICATION_UPDATED: :"three_ds_authentication.updated" + TOKENIZATION_APPROVAL_REQUEST: :"tokenization.approval_request" + TOKENIZATION_RESULT: :"tokenization.result" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE: :"tokenization.two_factor_authentication_code" + TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE_SENT: :"tokenization.two_factor_authentication_code_sent" + TOKENIZATION_UPDATED: :"tokenization.updated" + + def self?.values: -> ::Array[Lithic::Models::Events::SubscriptionUpdateParams::event_type] + end + end + end + end +end diff --git a/sig/lithic/models/external_bank_account.rbs b/sig/lithic/models/external_bank_account.rbs new file mode 100644 index 00000000..a9fd4435 --- /dev/null +++ b/sig/lithic/models/external_bank_account.rbs @@ -0,0 +1,162 @@ +module Lithic + module Models + type external_bank_account = + { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccount::state, + type: Lithic::Models::ExternalBankAccount::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::verification_method, + verification_state: Lithic::Models::ExternalBankAccount::verification_state, + account_token: String?, + address: Lithic::ExternalBankAccountAddress?, + company_id: String?, + dob: Date?, + doing_business_as: String?, + financial_account_token: String?, + name: String?, + user_defined_id: String?, + verification_failed_reason: String? + } + + class ExternalBankAccount < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor country: String + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor last_four: String + + attr_accessor owner: String + + attr_accessor owner_type: Lithic::Models::owner_type + + attr_accessor routing_number: String + + attr_accessor state: Lithic::Models::ExternalBankAccount::state + + attr_accessor type: Lithic::Models::ExternalBankAccount::type_ + + attr_accessor verification_attempts: Integer + + attr_accessor verification_method: Lithic::Models::verification_method + + attr_accessor verification_state: Lithic::Models::ExternalBankAccount::verification_state + + attr_accessor account_token: String? + + attr_accessor address: Lithic::ExternalBankAccountAddress? + + attr_accessor company_id: String? + + attr_accessor dob: Date? + + attr_accessor doing_business_as: String? + + attr_accessor financial_account_token: String? + + attr_accessor name: String? + + attr_accessor user_defined_id: String? + + attr_accessor verification_failed_reason: String? + + def initialize: ( + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccount::state, + type: Lithic::Models::ExternalBankAccount::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::verification_method, + verification_state: Lithic::Models::ExternalBankAccount::verification_state, + ?account_token: String?, + ?address: Lithic::ExternalBankAccountAddress?, + ?company_id: String?, + ?dob: Date?, + ?doing_business_as: String?, + ?financial_account_token: String?, + ?name: String?, + ?user_defined_id: String?, + ?verification_failed_reason: String? + ) -> void + + def to_hash: -> { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccount::state, + type: Lithic::Models::ExternalBankAccount::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::verification_method, + verification_state: Lithic::Models::ExternalBankAccount::verification_state, + account_token: String?, + address: Lithic::ExternalBankAccountAddress?, + company_id: String?, + dob: Date?, + doing_business_as: String?, + financial_account_token: String?, + name: String?, + user_defined_id: String?, + verification_failed_reason: String? + } + + type state = :ENABLED | :CLOSED | :PAUSED + + module State + extend Lithic::Internal::Type::Enum + + ENABLED: :ENABLED + CLOSED: :CLOSED + PAUSED: :PAUSED + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccount::state] + end + + type type_ = :CHECKING | :SAVINGS + + module Type + extend Lithic::Internal::Type::Enum + + CHECKING: :CHECKING + SAVINGS: :SAVINGS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccount::type_] + end + + type verification_state = + :PENDING | :ENABLED | :FAILED_VERIFICATION | :INSUFFICIENT_FUNDS + + module VerificationState + extend Lithic::Internal::Type::Enum + + PENDING: :PENDING + ENABLED: :ENABLED + FAILED_VERIFICATION: :FAILED_VERIFICATION + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccount::verification_state] + end + end + end +end diff --git a/sig/lithic/models/external_bank_account_address.rbs b/sig/lithic/models/external_bank_account_address.rbs new file mode 100644 index 00000000..d8740b9f --- /dev/null +++ b/sig/lithic/models/external_bank_account_address.rbs @@ -0,0 +1,45 @@ +module Lithic + module Models + type external_bank_account_address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String? + } + + class ExternalBankAccountAddress < Lithic::Internal::Type::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_accessor address2: String? + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String? + ) -> void + + def to_hash: -> { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String? + } + end + end +end diff --git a/sig/lithic/models/external_bank_account_create_params.rbs b/sig/lithic/models/external_bank_account_create_params.rbs new file mode 100644 index 00000000..e2a71c20 --- /dev/null +++ b/sig/lithic/models/external_bank_account_create_params.rbs @@ -0,0 +1,389 @@ +module Lithic + module Models + type external_bank_account_create_params = + { body: Lithic::Models::ExternalBankAccountCreateParams::body } + & Lithic::Internal::Type::request_parameters + + class ExternalBankAccountCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor body: Lithic::Models::ExternalBankAccountCreateParams::body + + def initialize: ( + body: Lithic::Models::ExternalBankAccountCreateParams::body, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + body: Lithic::Models::ExternalBankAccountCreateParams::body, + request_options: Lithic::RequestOptions + } + + type body = + Lithic::ExternalBankAccountCreateParams::Body::ExternallyVerified + | Lithic::ExternalBankAccountCreateParams::Body::Unverified + | Lithic::ExternalBankAccountCreateParams::Body::BankVerifiedCreateBankAccountAPIRequest + + module Body + extend Lithic::Internal::Type::Union + + type bank_verified_create_bank_account_api_request = + { + account_number: String, + country: String, + currency: String, + financial_account_token: String, + owner: String, + owner_type: Lithic::Models::owner_type, + routing_number: String, + type: Lithic::Models::ExternalBankAccountCreateParams::Body::BankVerifiedCreateBankAccountAPIRequest::type_, + verification_method: Lithic::Models::verification_method, + account_token: String, + address: Lithic::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + name: String, + user_defined_id: String, + verification_enforcement: bool + } + + class BankVerifiedCreateBankAccountAPIRequest < Lithic::Internal::Type::BaseModel + attr_accessor account_number: String + + attr_accessor country: String + + attr_accessor currency: String + + attr_accessor financial_account_token: String + + attr_accessor owner: String + + attr_accessor owner_type: Lithic::Models::owner_type + + attr_accessor routing_number: String + + attr_accessor type: Lithic::Models::ExternalBankAccountCreateParams::Body::BankVerifiedCreateBankAccountAPIRequest::type_ + + attr_accessor verification_method: Lithic::Models::verification_method + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader address: Lithic::ExternalBankAccountAddress? + + def address=: ( + Lithic::ExternalBankAccountAddress + ) -> Lithic::ExternalBankAccountAddress + + attr_reader company_id: String? + + def company_id=: (String) -> String + + attr_reader dob: Date? + + def dob=: (Date) -> Date + + attr_reader doing_business_as: String? + + def doing_business_as=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader user_defined_id: String? + + def user_defined_id=: (String) -> String + + attr_reader verification_enforcement: bool? + + def verification_enforcement=: (bool) -> bool + + def initialize: ( + account_number: String, + country: String, + currency: String, + financial_account_token: String, + owner: String, + owner_type: Lithic::Models::owner_type, + routing_number: String, + type: Lithic::Models::ExternalBankAccountCreateParams::Body::BankVerifiedCreateBankAccountAPIRequest::type_, + verification_method: Lithic::Models::verification_method, + ?account_token: String, + ?address: Lithic::ExternalBankAccountAddress, + ?company_id: String, + ?dob: Date, + ?doing_business_as: String, + ?name: String, + ?user_defined_id: String, + ?verification_enforcement: bool + ) -> void + + def to_hash: -> { + account_number: String, + country: String, + currency: String, + financial_account_token: String, + owner: String, + owner_type: Lithic::Models::owner_type, + routing_number: String, + type: Lithic::Models::ExternalBankAccountCreateParams::Body::BankVerifiedCreateBankAccountAPIRequest::type_, + verification_method: Lithic::Models::verification_method, + account_token: String, + address: Lithic::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + name: String, + user_defined_id: String, + verification_enforcement: bool + } + + type type_ = :CHECKING | :SAVINGS + + module Type + extend Lithic::Internal::Type::Enum + + CHECKING: :CHECKING + SAVINGS: :SAVINGS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountCreateParams::Body::BankVerifiedCreateBankAccountAPIRequest::type_] + end + end + + type externally_verified = + { + account_number: String, + country: String, + currency: String, + owner: String, + owner_type: Lithic::Models::owner_type, + routing_number: String, + type: Lithic::Models::ExternalBankAccountCreateParams::Body::ExternallyVerified::type_, + verification_method: :EXTERNALLY_VERIFIED, + account_token: String, + address: Lithic::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + name: String, + user_defined_id: String + } + + class ExternallyVerified < Lithic::Internal::Type::BaseModel + attr_accessor account_number: String + + attr_accessor country: String + + attr_accessor currency: String + + attr_accessor owner: String + + attr_accessor owner_type: Lithic::Models::owner_type + + attr_accessor routing_number: String + + attr_accessor type: Lithic::Models::ExternalBankAccountCreateParams::Body::ExternallyVerified::type_ + + attr_accessor verification_method: :EXTERNALLY_VERIFIED + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader address: Lithic::ExternalBankAccountAddress? + + def address=: ( + Lithic::ExternalBankAccountAddress + ) -> Lithic::ExternalBankAccountAddress + + attr_reader company_id: String? + + def company_id=: (String) -> String + + attr_reader dob: Date? + + def dob=: (Date) -> Date + + attr_reader doing_business_as: String? + + def doing_business_as=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader user_defined_id: String? + + def user_defined_id=: (String) -> String + + def initialize: ( + account_number: String, + country: String, + currency: String, + owner: String, + owner_type: Lithic::Models::owner_type, + routing_number: String, + type: Lithic::Models::ExternalBankAccountCreateParams::Body::ExternallyVerified::type_, + ?account_token: String, + ?address: Lithic::ExternalBankAccountAddress, + ?company_id: String, + ?dob: Date, + ?doing_business_as: String, + ?name: String, + ?user_defined_id: String, + ?verification_method: :EXTERNALLY_VERIFIED + ) -> void + + def to_hash: -> { + account_number: String, + country: String, + currency: String, + owner: String, + owner_type: Lithic::Models::owner_type, + routing_number: String, + type: Lithic::Models::ExternalBankAccountCreateParams::Body::ExternallyVerified::type_, + verification_method: :EXTERNALLY_VERIFIED, + account_token: String, + address: Lithic::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + name: String, + user_defined_id: String + } + + type type_ = :CHECKING | :SAVINGS + + module Type + extend Lithic::Internal::Type::Enum + + CHECKING: :CHECKING + SAVINGS: :SAVINGS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountCreateParams::Body::ExternallyVerified::type_] + end + end + + type unverified = + { + account_number: String, + country: String, + currency: String, + owner: String, + owner_type: Lithic::Models::owner_type, + routing_number: String, + type: Lithic::Models::ExternalBankAccountCreateParams::Body::Unverified::type_, + verification_method: :UNVERIFIED, + account_token: String, + address: Lithic::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + name: String, + user_defined_id: String + } + + class Unverified < Lithic::Internal::Type::BaseModel + attr_accessor account_number: String + + attr_accessor country: String + + attr_accessor currency: String + + attr_accessor owner: String + + attr_accessor owner_type: Lithic::Models::owner_type + + attr_accessor routing_number: String + + attr_accessor type: Lithic::Models::ExternalBankAccountCreateParams::Body::Unverified::type_ + + attr_accessor verification_method: :UNVERIFIED + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader address: Lithic::ExternalBankAccountAddress? + + def address=: ( + Lithic::ExternalBankAccountAddress + ) -> Lithic::ExternalBankAccountAddress + + attr_reader company_id: String? + + def company_id=: (String) -> String + + attr_reader dob: Date? + + def dob=: (Date) -> Date + + attr_reader doing_business_as: String? + + def doing_business_as=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader user_defined_id: String? + + def user_defined_id=: (String) -> String + + def initialize: ( + account_number: String, + country: String, + currency: String, + owner: String, + owner_type: Lithic::Models::owner_type, + routing_number: String, + type: Lithic::Models::ExternalBankAccountCreateParams::Body::Unverified::type_, + ?account_token: String, + ?address: Lithic::ExternalBankAccountAddress, + ?company_id: String, + ?dob: Date, + ?doing_business_as: String, + ?name: String, + ?user_defined_id: String, + ?verification_method: :UNVERIFIED + ) -> void + + def to_hash: -> { + account_number: String, + country: String, + currency: String, + owner: String, + owner_type: Lithic::Models::owner_type, + routing_number: String, + type: Lithic::Models::ExternalBankAccountCreateParams::Body::Unverified::type_, + verification_method: :UNVERIFIED, + account_token: String, + address: Lithic::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + name: String, + user_defined_id: String + } + + type type_ = :CHECKING | :SAVINGS + + module Type + extend Lithic::Internal::Type::Enum + + CHECKING: :CHECKING + SAVINGS: :SAVINGS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountCreateParams::Body::Unverified::type_] + end + end + + def self?.variants: -> ::Array[Lithic::Models::ExternalBankAccountCreateParams::body] + end + end + end +end diff --git a/sig/lithic/models/external_bank_account_create_response.rbs b/sig/lithic/models/external_bank_account_create_response.rbs new file mode 100644 index 00000000..8ff3bee8 --- /dev/null +++ b/sig/lithic/models/external_bank_account_create_response.rbs @@ -0,0 +1,186 @@ +module Lithic + module Models + type external_bank_account_create_response = + { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountCreateResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccountCreateResponse::state, + type: Lithic::Models::ExternalBankAccountCreateResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountCreateResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccountCreateResponse::verification_state, + account_token: String?, + address: Lithic::ExternalBankAccountAddress?, + company_id: String?, + dob: Date?, + doing_business_as: String?, + financial_account_token: String?, + name: String?, + user_defined_id: String?, + verification_failed_reason: String? + } + + class ExternalBankAccountCreateResponse < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor country: String + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor last_four: String + + attr_accessor owner: String + + attr_accessor owner_type: Lithic::Models::ExternalBankAccountCreateResponse::owner_type + + attr_accessor routing_number: String + + attr_accessor state: Lithic::Models::ExternalBankAccountCreateResponse::state + + attr_accessor type: Lithic::Models::ExternalBankAccountCreateResponse::type_ + + attr_accessor verification_attempts: Integer + + attr_accessor verification_method: Lithic::Models::ExternalBankAccountCreateResponse::verification_method + + attr_accessor verification_state: Lithic::Models::ExternalBankAccountCreateResponse::verification_state + + attr_accessor account_token: String? + + attr_accessor address: Lithic::ExternalBankAccountAddress? + + attr_accessor company_id: String? + + attr_accessor dob: Date? + + attr_accessor doing_business_as: String? + + attr_accessor financial_account_token: String? + + attr_accessor name: String? + + attr_accessor user_defined_id: String? + + attr_accessor verification_failed_reason: String? + + def initialize: ( + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountCreateResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccountCreateResponse::state, + type: Lithic::Models::ExternalBankAccountCreateResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountCreateResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccountCreateResponse::verification_state, + ?account_token: String?, + ?address: Lithic::ExternalBankAccountAddress?, + ?company_id: String?, + ?dob: Date?, + ?doing_business_as: String?, + ?financial_account_token: String?, + ?name: String?, + ?user_defined_id: String?, + ?verification_failed_reason: String? + ) -> void + + def to_hash: -> { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountCreateResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccountCreateResponse::state, + type: Lithic::Models::ExternalBankAccountCreateResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountCreateResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccountCreateResponse::verification_state, + account_token: String?, + address: Lithic::ExternalBankAccountAddress?, + company_id: String?, + dob: Date?, + doing_business_as: String?, + financial_account_token: String?, + name: String?, + user_defined_id: String?, + verification_failed_reason: String? + } + + type owner_type = :BUSINESS | :INDIVIDUAL + + module OwnerType + extend Lithic::Internal::Type::Enum + + BUSINESS: :BUSINESS + INDIVIDUAL: :INDIVIDUAL + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountCreateResponse::owner_type] + end + + type state = :ENABLED | :CLOSED | :PAUSED + + module State + extend Lithic::Internal::Type::Enum + + ENABLED: :ENABLED + CLOSED: :CLOSED + PAUSED: :PAUSED + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountCreateResponse::state] + end + + type type_ = :CHECKING | :SAVINGS + + module Type + extend Lithic::Internal::Type::Enum + + CHECKING: :CHECKING + SAVINGS: :SAVINGS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountCreateResponse::type_] + end + + type verification_method = :MANUAL | :MICRO_DEPOSIT | :PLAID | :PRENOTE + + module VerificationMethod + extend Lithic::Internal::Type::Enum + + MANUAL: :MANUAL + MICRO_DEPOSIT: :MICRO_DEPOSIT + PLAID: :PLAID + PRENOTE: :PRENOTE + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountCreateResponse::verification_method] + end + + type verification_state = + :PENDING | :ENABLED | :FAILED_VERIFICATION | :INSUFFICIENT_FUNDS + + module VerificationState + extend Lithic::Internal::Type::Enum + + PENDING: :PENDING + ENABLED: :ENABLED + FAILED_VERIFICATION: :FAILED_VERIFICATION + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountCreateResponse::verification_state] + end + end + end +end diff --git a/sig/lithic/models/external_bank_account_created_webhook_event.rbs b/sig/lithic/models/external_bank_account_created_webhook_event.rbs new file mode 100644 index 00000000..1415cfb7 --- /dev/null +++ b/sig/lithic/models/external_bank_account_created_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type external_bank_account_created_webhook_event = + { event_type: :"external_bank_account.created" } + + class ExternalBankAccountCreatedWebhookEvent < Lithic::Models::ExternalBankAccount + def event_type: -> :"external_bank_account.created" + + def event_type=: ( + :"external_bank_account.created" _ + ) -> :"external_bank_account.created" + + def initialize: (?event_type: :"external_bank_account.created") -> void + + def to_hash: -> { event_type: :"external_bank_account.created" } + end + end +end diff --git a/sig/lithic/models/external_bank_account_list_params.rbs b/sig/lithic/models/external_bank_account_list_params.rbs new file mode 100644 index 00000000..e3a30c86 --- /dev/null +++ b/sig/lithic/models/external_bank_account_list_params.rbs @@ -0,0 +1,129 @@ +module Lithic + module Models + type external_bank_account_list_params = + { + account_token: String, + account_types: ::Array[Lithic::Models::ExternalBankAccountListParams::account_type], + countries: ::Array[String], + ending_before: String, + owner_types: ::Array[Lithic::Models::owner_type], + page_size: Integer, + starting_after: String, + states: ::Array[Lithic::Models::ExternalBankAccountListParams::state], + verification_states: ::Array[Lithic::Models::ExternalBankAccountListParams::verification_state] + } + & Lithic::Internal::Type::request_parameters + + class ExternalBankAccountListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader account_types: ::Array[Lithic::Models::ExternalBankAccountListParams::account_type]? + + def account_types=: ( + ::Array[Lithic::Models::ExternalBankAccountListParams::account_type] + ) -> ::Array[Lithic::Models::ExternalBankAccountListParams::account_type] + + attr_reader countries: ::Array[String]? + + def countries=: (::Array[String]) -> ::Array[String] + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader owner_types: ::Array[Lithic::Models::owner_type]? + + def owner_types=: ( + ::Array[Lithic::Models::owner_type] + ) -> ::Array[Lithic::Models::owner_type] + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader states: ::Array[Lithic::Models::ExternalBankAccountListParams::state]? + + def states=: ( + ::Array[Lithic::Models::ExternalBankAccountListParams::state] + ) -> ::Array[Lithic::Models::ExternalBankAccountListParams::state] + + attr_reader verification_states: ::Array[Lithic::Models::ExternalBankAccountListParams::verification_state]? + + def verification_states=: ( + ::Array[Lithic::Models::ExternalBankAccountListParams::verification_state] + ) -> ::Array[Lithic::Models::ExternalBankAccountListParams::verification_state] + + def initialize: ( + ?account_token: String, + ?account_types: ::Array[Lithic::Models::ExternalBankAccountListParams::account_type], + ?countries: ::Array[String], + ?ending_before: String, + ?owner_types: ::Array[Lithic::Models::owner_type], + ?page_size: Integer, + ?starting_after: String, + ?states: ::Array[Lithic::Models::ExternalBankAccountListParams::state], + ?verification_states: ::Array[Lithic::Models::ExternalBankAccountListParams::verification_state], + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + account_token: String, + account_types: ::Array[Lithic::Models::ExternalBankAccountListParams::account_type], + countries: ::Array[String], + ending_before: String, + owner_types: ::Array[Lithic::Models::owner_type], + page_size: Integer, + starting_after: String, + states: ::Array[Lithic::Models::ExternalBankAccountListParams::state], + verification_states: ::Array[Lithic::Models::ExternalBankAccountListParams::verification_state], + request_options: Lithic::RequestOptions + } + + type account_type = :CHECKING | :SAVINGS + + module AccountType + extend Lithic::Internal::Type::Enum + + CHECKING: :CHECKING + SAVINGS: :SAVINGS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountListParams::account_type] + end + + type state = :ENABLED | :CLOSED | :PAUSED + + module State + extend Lithic::Internal::Type::Enum + + ENABLED: :ENABLED + CLOSED: :CLOSED + PAUSED: :PAUSED + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountListParams::state] + end + + type verification_state = + :PENDING | :ENABLED | :FAILED_VERIFICATION | :INSUFFICIENT_FUNDS + + module VerificationState + extend Lithic::Internal::Type::Enum + + PENDING: :PENDING + ENABLED: :ENABLED + FAILED_VERIFICATION: :FAILED_VERIFICATION + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountListParams::verification_state] + end + end + end +end diff --git a/sig/lithic/models/external_bank_account_list_response.rbs b/sig/lithic/models/external_bank_account_list_response.rbs new file mode 100644 index 00000000..9724d5aa --- /dev/null +++ b/sig/lithic/models/external_bank_account_list_response.rbs @@ -0,0 +1,186 @@ +module Lithic + module Models + type external_bank_account_list_response = + { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountListResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccountListResponse::state, + type: Lithic::Models::ExternalBankAccountListResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountListResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccountListResponse::verification_state, + account_token: String?, + address: Lithic::ExternalBankAccountAddress?, + company_id: String?, + dob: Date?, + doing_business_as: String?, + financial_account_token: String?, + name: String?, + user_defined_id: String?, + verification_failed_reason: String? + } + + class ExternalBankAccountListResponse < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor country: String + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor last_four: String + + attr_accessor owner: String + + attr_accessor owner_type: Lithic::Models::ExternalBankAccountListResponse::owner_type + + attr_accessor routing_number: String + + attr_accessor state: Lithic::Models::ExternalBankAccountListResponse::state + + attr_accessor type: Lithic::Models::ExternalBankAccountListResponse::type_ + + attr_accessor verification_attempts: Integer + + attr_accessor verification_method: Lithic::Models::ExternalBankAccountListResponse::verification_method + + attr_accessor verification_state: Lithic::Models::ExternalBankAccountListResponse::verification_state + + attr_accessor account_token: String? + + attr_accessor address: Lithic::ExternalBankAccountAddress? + + attr_accessor company_id: String? + + attr_accessor dob: Date? + + attr_accessor doing_business_as: String? + + attr_accessor financial_account_token: String? + + attr_accessor name: String? + + attr_accessor user_defined_id: String? + + attr_accessor verification_failed_reason: String? + + def initialize: ( + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountListResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccountListResponse::state, + type: Lithic::Models::ExternalBankAccountListResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountListResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccountListResponse::verification_state, + ?account_token: String?, + ?address: Lithic::ExternalBankAccountAddress?, + ?company_id: String?, + ?dob: Date?, + ?doing_business_as: String?, + ?financial_account_token: String?, + ?name: String?, + ?user_defined_id: String?, + ?verification_failed_reason: String? + ) -> void + + def to_hash: -> { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountListResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccountListResponse::state, + type: Lithic::Models::ExternalBankAccountListResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountListResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccountListResponse::verification_state, + account_token: String?, + address: Lithic::ExternalBankAccountAddress?, + company_id: String?, + dob: Date?, + doing_business_as: String?, + financial_account_token: String?, + name: String?, + user_defined_id: String?, + verification_failed_reason: String? + } + + type owner_type = :BUSINESS | :INDIVIDUAL + + module OwnerType + extend Lithic::Internal::Type::Enum + + BUSINESS: :BUSINESS + INDIVIDUAL: :INDIVIDUAL + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountListResponse::owner_type] + end + + type state = :ENABLED | :CLOSED | :PAUSED + + module State + extend Lithic::Internal::Type::Enum + + ENABLED: :ENABLED + CLOSED: :CLOSED + PAUSED: :PAUSED + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountListResponse::state] + end + + type type_ = :CHECKING | :SAVINGS + + module Type + extend Lithic::Internal::Type::Enum + + CHECKING: :CHECKING + SAVINGS: :SAVINGS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountListResponse::type_] + end + + type verification_method = :MANUAL | :MICRO_DEPOSIT | :PLAID | :PRENOTE + + module VerificationMethod + extend Lithic::Internal::Type::Enum + + MANUAL: :MANUAL + MICRO_DEPOSIT: :MICRO_DEPOSIT + PLAID: :PLAID + PRENOTE: :PRENOTE + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountListResponse::verification_method] + end + + type verification_state = + :PENDING | :ENABLED | :FAILED_VERIFICATION | :INSUFFICIENT_FUNDS + + module VerificationState + extend Lithic::Internal::Type::Enum + + PENDING: :PENDING + ENABLED: :ENABLED + FAILED_VERIFICATION: :FAILED_VERIFICATION + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountListResponse::verification_state] + end + end + end +end diff --git a/sig/lithic/models/external_bank_account_pause_params.rbs b/sig/lithic/models/external_bank_account_pause_params.rbs new file mode 100644 index 00000000..69e70bba --- /dev/null +++ b/sig/lithic/models/external_bank_account_pause_params.rbs @@ -0,0 +1,24 @@ +module Lithic + module Models + type external_bank_account_pause_params = + { external_bank_account_token: String } + & Lithic::Internal::Type::request_parameters + + class ExternalBankAccountPauseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor external_bank_account_token: String + + def initialize: ( + external_bank_account_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + external_bank_account_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/external_bank_account_retrieve_params.rbs b/sig/lithic/models/external_bank_account_retrieve_params.rbs new file mode 100644 index 00000000..13c50e6b --- /dev/null +++ b/sig/lithic/models/external_bank_account_retrieve_params.rbs @@ -0,0 +1,24 @@ +module Lithic + module Models + type external_bank_account_retrieve_params = + { external_bank_account_token: String } + & Lithic::Internal::Type::request_parameters + + class ExternalBankAccountRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor external_bank_account_token: String + + def initialize: ( + external_bank_account_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + external_bank_account_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/external_bank_account_retrieve_response.rbs b/sig/lithic/models/external_bank_account_retrieve_response.rbs new file mode 100644 index 00000000..bc4d2af1 --- /dev/null +++ b/sig/lithic/models/external_bank_account_retrieve_response.rbs @@ -0,0 +1,186 @@ +module Lithic + module Models + type external_bank_account_retrieve_response = + { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountRetrieveResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccountRetrieveResponse::state, + type: Lithic::Models::ExternalBankAccountRetrieveResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountRetrieveResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccountRetrieveResponse::verification_state, + account_token: String?, + address: Lithic::ExternalBankAccountAddress?, + company_id: String?, + dob: Date?, + doing_business_as: String?, + financial_account_token: String?, + name: String?, + user_defined_id: String?, + verification_failed_reason: String? + } + + class ExternalBankAccountRetrieveResponse < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor country: String + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor last_four: String + + attr_accessor owner: String + + attr_accessor owner_type: Lithic::Models::ExternalBankAccountRetrieveResponse::owner_type + + attr_accessor routing_number: String + + attr_accessor state: Lithic::Models::ExternalBankAccountRetrieveResponse::state + + attr_accessor type: Lithic::Models::ExternalBankAccountRetrieveResponse::type_ + + attr_accessor verification_attempts: Integer + + attr_accessor verification_method: Lithic::Models::ExternalBankAccountRetrieveResponse::verification_method + + attr_accessor verification_state: Lithic::Models::ExternalBankAccountRetrieveResponse::verification_state + + attr_accessor account_token: String? + + attr_accessor address: Lithic::ExternalBankAccountAddress? + + attr_accessor company_id: String? + + attr_accessor dob: Date? + + attr_accessor doing_business_as: String? + + attr_accessor financial_account_token: String? + + attr_accessor name: String? + + attr_accessor user_defined_id: String? + + attr_accessor verification_failed_reason: String? + + def initialize: ( + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountRetrieveResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccountRetrieveResponse::state, + type: Lithic::Models::ExternalBankAccountRetrieveResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountRetrieveResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccountRetrieveResponse::verification_state, + ?account_token: String?, + ?address: Lithic::ExternalBankAccountAddress?, + ?company_id: String?, + ?dob: Date?, + ?doing_business_as: String?, + ?financial_account_token: String?, + ?name: String?, + ?user_defined_id: String?, + ?verification_failed_reason: String? + ) -> void + + def to_hash: -> { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountRetrieveResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccountRetrieveResponse::state, + type: Lithic::Models::ExternalBankAccountRetrieveResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountRetrieveResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccountRetrieveResponse::verification_state, + account_token: String?, + address: Lithic::ExternalBankAccountAddress?, + company_id: String?, + dob: Date?, + doing_business_as: String?, + financial_account_token: String?, + name: String?, + user_defined_id: String?, + verification_failed_reason: String? + } + + type owner_type = :BUSINESS | :INDIVIDUAL + + module OwnerType + extend Lithic::Internal::Type::Enum + + BUSINESS: :BUSINESS + INDIVIDUAL: :INDIVIDUAL + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountRetrieveResponse::owner_type] + end + + type state = :ENABLED | :CLOSED | :PAUSED + + module State + extend Lithic::Internal::Type::Enum + + ENABLED: :ENABLED + CLOSED: :CLOSED + PAUSED: :PAUSED + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountRetrieveResponse::state] + end + + type type_ = :CHECKING | :SAVINGS + + module Type + extend Lithic::Internal::Type::Enum + + CHECKING: :CHECKING + SAVINGS: :SAVINGS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountRetrieveResponse::type_] + end + + type verification_method = :MANUAL | :MICRO_DEPOSIT | :PLAID | :PRENOTE + + module VerificationMethod + extend Lithic::Internal::Type::Enum + + MANUAL: :MANUAL + MICRO_DEPOSIT: :MICRO_DEPOSIT + PLAID: :PLAID + PRENOTE: :PRENOTE + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountRetrieveResponse::verification_method] + end + + type verification_state = + :PENDING | :ENABLED | :FAILED_VERIFICATION | :INSUFFICIENT_FUNDS + + module VerificationState + extend Lithic::Internal::Type::Enum + + PENDING: :PENDING + ENABLED: :ENABLED + FAILED_VERIFICATION: :FAILED_VERIFICATION + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountRetrieveResponse::verification_state] + end + end + end +end diff --git a/sig/lithic/models/external_bank_account_retry_micro_deposits_params.rbs b/sig/lithic/models/external_bank_account_retry_micro_deposits_params.rbs new file mode 100644 index 00000000..fefdb6eb --- /dev/null +++ b/sig/lithic/models/external_bank_account_retry_micro_deposits_params.rbs @@ -0,0 +1,30 @@ +module Lithic + module Models + type external_bank_account_retry_micro_deposits_params = + { external_bank_account_token: String, financial_account_token: String } + & Lithic::Internal::Type::request_parameters + + class ExternalBankAccountRetryMicroDepositsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor external_bank_account_token: String + + attr_reader financial_account_token: String? + + def financial_account_token=: (String) -> String + + def initialize: ( + external_bank_account_token: String, + ?financial_account_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + external_bank_account_token: String, + financial_account_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/external_bank_account_retry_micro_deposits_response.rbs b/sig/lithic/models/external_bank_account_retry_micro_deposits_response.rbs new file mode 100644 index 00000000..1e29115c --- /dev/null +++ b/sig/lithic/models/external_bank_account_retry_micro_deposits_response.rbs @@ -0,0 +1,186 @@ +module Lithic + module Models + type external_bank_account_retry_micro_deposits_response = + { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::state, + type: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::verification_state, + account_token: String?, + address: Lithic::ExternalBankAccountAddress?, + company_id: String?, + dob: Date?, + doing_business_as: String?, + financial_account_token: String?, + name: String?, + user_defined_id: String?, + verification_failed_reason: String? + } + + class ExternalBankAccountRetryMicroDepositsResponse < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor country: String + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor last_four: String + + attr_accessor owner: String + + attr_accessor owner_type: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::owner_type + + attr_accessor routing_number: String + + attr_accessor state: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::state + + attr_accessor type: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::type_ + + attr_accessor verification_attempts: Integer + + attr_accessor verification_method: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::verification_method + + attr_accessor verification_state: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::verification_state + + attr_accessor account_token: String? + + attr_accessor address: Lithic::ExternalBankAccountAddress? + + attr_accessor company_id: String? + + attr_accessor dob: Date? + + attr_accessor doing_business_as: String? + + attr_accessor financial_account_token: String? + + attr_accessor name: String? + + attr_accessor user_defined_id: String? + + attr_accessor verification_failed_reason: String? + + def initialize: ( + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::state, + type: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::verification_state, + ?account_token: String?, + ?address: Lithic::ExternalBankAccountAddress?, + ?company_id: String?, + ?dob: Date?, + ?doing_business_as: String?, + ?financial_account_token: String?, + ?name: String?, + ?user_defined_id: String?, + ?verification_failed_reason: String? + ) -> void + + def to_hash: -> { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::state, + type: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::verification_state, + account_token: String?, + address: Lithic::ExternalBankAccountAddress?, + company_id: String?, + dob: Date?, + doing_business_as: String?, + financial_account_token: String?, + name: String?, + user_defined_id: String?, + verification_failed_reason: String? + } + + type owner_type = :BUSINESS | :INDIVIDUAL + + module OwnerType + extend Lithic::Internal::Type::Enum + + BUSINESS: :BUSINESS + INDIVIDUAL: :INDIVIDUAL + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::owner_type] + end + + type state = :ENABLED | :CLOSED | :PAUSED + + module State + extend Lithic::Internal::Type::Enum + + ENABLED: :ENABLED + CLOSED: :CLOSED + PAUSED: :PAUSED + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::state] + end + + type type_ = :CHECKING | :SAVINGS + + module Type + extend Lithic::Internal::Type::Enum + + CHECKING: :CHECKING + SAVINGS: :SAVINGS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::type_] + end + + type verification_method = :MANUAL | :MICRO_DEPOSIT | :PLAID | :PRENOTE + + module VerificationMethod + extend Lithic::Internal::Type::Enum + + MANUAL: :MANUAL + MICRO_DEPOSIT: :MICRO_DEPOSIT + PLAID: :PLAID + PRENOTE: :PRENOTE + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::verification_method] + end + + type verification_state = + :PENDING | :ENABLED | :FAILED_VERIFICATION | :INSUFFICIENT_FUNDS + + module VerificationState + extend Lithic::Internal::Type::Enum + + PENDING: :PENDING + ENABLED: :ENABLED + FAILED_VERIFICATION: :FAILED_VERIFICATION + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::verification_state] + end + end + end +end diff --git a/sig/lithic/models/external_bank_account_retry_prenote_params.rbs b/sig/lithic/models/external_bank_account_retry_prenote_params.rbs new file mode 100644 index 00000000..d78814b6 --- /dev/null +++ b/sig/lithic/models/external_bank_account_retry_prenote_params.rbs @@ -0,0 +1,30 @@ +module Lithic + module Models + type external_bank_account_retry_prenote_params = + { external_bank_account_token: String, financial_account_token: String } + & Lithic::Internal::Type::request_parameters + + class ExternalBankAccountRetryPrenoteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor external_bank_account_token: String + + attr_reader financial_account_token: String? + + def financial_account_token=: (String) -> String + + def initialize: ( + external_bank_account_token: String, + ?financial_account_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + external_bank_account_token: String, + financial_account_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/external_bank_account_set_verification_method_params.rbs b/sig/lithic/models/external_bank_account_set_verification_method_params.rbs new file mode 100644 index 00000000..4581fe87 --- /dev/null +++ b/sig/lithic/models/external_bank_account_set_verification_method_params.rbs @@ -0,0 +1,51 @@ +module Lithic + module Models + type external_bank_account_set_verification_method_params = + { + external_bank_account_token: String, + verification_method: Lithic::Models::ExternalBankAccountSetVerificationMethodParams::verification_method, + financial_account_token: String + } + & Lithic::Internal::Type::request_parameters + + class ExternalBankAccountSetVerificationMethodParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor external_bank_account_token: String + + attr_accessor verification_method: Lithic::Models::ExternalBankAccountSetVerificationMethodParams::verification_method + + attr_reader financial_account_token: String? + + def financial_account_token=: (String) -> String + + def initialize: ( + external_bank_account_token: String, + verification_method: Lithic::Models::ExternalBankAccountSetVerificationMethodParams::verification_method, + ?financial_account_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + external_bank_account_token: String, + verification_method: Lithic::Models::ExternalBankAccountSetVerificationMethodParams::verification_method, + financial_account_token: String, + request_options: Lithic::RequestOptions + } + + type verification_method = + :MICRO_DEPOSIT | :PRENOTE | :EXTERNALLY_VERIFIED + + module VerificationMethod + extend Lithic::Internal::Type::Enum + + MICRO_DEPOSIT: :MICRO_DEPOSIT + PRENOTE: :PRENOTE + EXTERNALLY_VERIFIED: :EXTERNALLY_VERIFIED + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountSetVerificationMethodParams::verification_method] + end + end + end +end diff --git a/sig/lithic/models/external_bank_account_unpause_params.rbs b/sig/lithic/models/external_bank_account_unpause_params.rbs new file mode 100644 index 00000000..7a978c80 --- /dev/null +++ b/sig/lithic/models/external_bank_account_unpause_params.rbs @@ -0,0 +1,24 @@ +module Lithic + module Models + type external_bank_account_unpause_params = + { external_bank_account_token: String } + & Lithic::Internal::Type::request_parameters + + class ExternalBankAccountUnpauseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor external_bank_account_token: String + + def initialize: ( + external_bank_account_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + external_bank_account_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/external_bank_account_update_params.rbs b/sig/lithic/models/external_bank_account_update_params.rbs new file mode 100644 index 00000000..a8d94177 --- /dev/null +++ b/sig/lithic/models/external_bank_account_update_params.rbs @@ -0,0 +1,106 @@ +module Lithic + module Models + type external_bank_account_update_params = + { + external_bank_account_token: String, + address: Lithic::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + name: String, + owner: String, + owner_type: Lithic::Models::owner_type, + type: Lithic::Models::ExternalBankAccountUpdateParams::type_, + user_defined_id: String + } + & Lithic::Internal::Type::request_parameters + + class ExternalBankAccountUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor external_bank_account_token: String + + attr_reader address: Lithic::ExternalBankAccountAddress? + + def address=: ( + Lithic::ExternalBankAccountAddress + ) -> Lithic::ExternalBankAccountAddress + + attr_reader company_id: String? + + def company_id=: (String) -> String + + attr_reader dob: Date? + + def dob=: (Date) -> Date + + attr_reader doing_business_as: String? + + def doing_business_as=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader owner: String? + + def owner=: (String) -> String + + attr_reader owner_type: Lithic::Models::owner_type? + + def owner_type=: ( + Lithic::Models::owner_type + ) -> Lithic::Models::owner_type + + attr_reader type: Lithic::Models::ExternalBankAccountUpdateParams::type_? + + def type=: ( + Lithic::Models::ExternalBankAccountUpdateParams::type_ + ) -> Lithic::Models::ExternalBankAccountUpdateParams::type_ + + attr_reader user_defined_id: String? + + def user_defined_id=: (String) -> String + + def initialize: ( + external_bank_account_token: String, + ?address: Lithic::ExternalBankAccountAddress, + ?company_id: String, + ?dob: Date, + ?doing_business_as: String, + ?name: String, + ?owner: String, + ?owner_type: Lithic::Models::owner_type, + ?type: Lithic::Models::ExternalBankAccountUpdateParams::type_, + ?user_defined_id: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + external_bank_account_token: String, + address: Lithic::ExternalBankAccountAddress, + company_id: String, + dob: Date, + doing_business_as: String, + name: String, + owner: String, + owner_type: Lithic::Models::owner_type, + type: Lithic::Models::ExternalBankAccountUpdateParams::type_, + user_defined_id: String, + request_options: Lithic::RequestOptions + } + + type type_ = :CHECKING | :SAVINGS + + module Type + extend Lithic::Internal::Type::Enum + + CHECKING: :CHECKING + SAVINGS: :SAVINGS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountUpdateParams::type_] + end + end + end +end diff --git a/sig/lithic/models/external_bank_account_update_response.rbs b/sig/lithic/models/external_bank_account_update_response.rbs new file mode 100644 index 00000000..ac41f341 --- /dev/null +++ b/sig/lithic/models/external_bank_account_update_response.rbs @@ -0,0 +1,186 @@ +module Lithic + module Models + type external_bank_account_update_response = + { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountUpdateResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccountUpdateResponse::state, + type: Lithic::Models::ExternalBankAccountUpdateResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountUpdateResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccountUpdateResponse::verification_state, + account_token: String?, + address: Lithic::ExternalBankAccountAddress?, + company_id: String?, + dob: Date?, + doing_business_as: String?, + financial_account_token: String?, + name: String?, + user_defined_id: String?, + verification_failed_reason: String? + } + + class ExternalBankAccountUpdateResponse < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor country: String + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor last_four: String + + attr_accessor owner: String + + attr_accessor owner_type: Lithic::Models::ExternalBankAccountUpdateResponse::owner_type + + attr_accessor routing_number: String + + attr_accessor state: Lithic::Models::ExternalBankAccountUpdateResponse::state + + attr_accessor type: Lithic::Models::ExternalBankAccountUpdateResponse::type_ + + attr_accessor verification_attempts: Integer + + attr_accessor verification_method: Lithic::Models::ExternalBankAccountUpdateResponse::verification_method + + attr_accessor verification_state: Lithic::Models::ExternalBankAccountUpdateResponse::verification_state + + attr_accessor account_token: String? + + attr_accessor address: Lithic::ExternalBankAccountAddress? + + attr_accessor company_id: String? + + attr_accessor dob: Date? + + attr_accessor doing_business_as: String? + + attr_accessor financial_account_token: String? + + attr_accessor name: String? + + attr_accessor user_defined_id: String? + + attr_accessor verification_failed_reason: String? + + def initialize: ( + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountUpdateResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccountUpdateResponse::state, + type: Lithic::Models::ExternalBankAccountUpdateResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountUpdateResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccountUpdateResponse::verification_state, + ?account_token: String?, + ?address: Lithic::ExternalBankAccountAddress?, + ?company_id: String?, + ?dob: Date?, + ?doing_business_as: String?, + ?financial_account_token: String?, + ?name: String?, + ?user_defined_id: String?, + ?verification_failed_reason: String? + ) -> void + + def to_hash: -> { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountUpdateResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccountUpdateResponse::state, + type: Lithic::Models::ExternalBankAccountUpdateResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountUpdateResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccountUpdateResponse::verification_state, + account_token: String?, + address: Lithic::ExternalBankAccountAddress?, + company_id: String?, + dob: Date?, + doing_business_as: String?, + financial_account_token: String?, + name: String?, + user_defined_id: String?, + verification_failed_reason: String? + } + + type owner_type = :BUSINESS | :INDIVIDUAL + + module OwnerType + extend Lithic::Internal::Type::Enum + + BUSINESS: :BUSINESS + INDIVIDUAL: :INDIVIDUAL + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountUpdateResponse::owner_type] + end + + type state = :ENABLED | :CLOSED | :PAUSED + + module State + extend Lithic::Internal::Type::Enum + + ENABLED: :ENABLED + CLOSED: :CLOSED + PAUSED: :PAUSED + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountUpdateResponse::state] + end + + type type_ = :CHECKING | :SAVINGS + + module Type + extend Lithic::Internal::Type::Enum + + CHECKING: :CHECKING + SAVINGS: :SAVINGS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountUpdateResponse::type_] + end + + type verification_method = :MANUAL | :MICRO_DEPOSIT | :PLAID | :PRENOTE + + module VerificationMethod + extend Lithic::Internal::Type::Enum + + MANUAL: :MANUAL + MICRO_DEPOSIT: :MICRO_DEPOSIT + PLAID: :PLAID + PRENOTE: :PRENOTE + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountUpdateResponse::verification_method] + end + + type verification_state = + :PENDING | :ENABLED | :FAILED_VERIFICATION | :INSUFFICIENT_FUNDS + + module VerificationState + extend Lithic::Internal::Type::Enum + + PENDING: :PENDING + ENABLED: :ENABLED + FAILED_VERIFICATION: :FAILED_VERIFICATION + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccountUpdateResponse::verification_state] + end + end + end +end diff --git a/sig/lithic/models/external_bank_account_updated_webhook_event.rbs b/sig/lithic/models/external_bank_account_updated_webhook_event.rbs new file mode 100644 index 00000000..54c7e2a7 --- /dev/null +++ b/sig/lithic/models/external_bank_account_updated_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type external_bank_account_updated_webhook_event = + { event_type: :"external_bank_account.updated" } + + class ExternalBankAccountUpdatedWebhookEvent < Lithic::Models::ExternalBankAccount + def event_type: -> :"external_bank_account.updated" + + def event_type=: ( + :"external_bank_account.updated" _ + ) -> :"external_bank_account.updated" + + def initialize: (?event_type: :"external_bank_account.updated") -> void + + def to_hash: -> { event_type: :"external_bank_account.updated" } + end + end +end diff --git a/sig/lithic/models/external_bank_accounts/micro_deposit_create_params.rbs b/sig/lithic/models/external_bank_accounts/micro_deposit_create_params.rbs new file mode 100644 index 00000000..a386f151 --- /dev/null +++ b/sig/lithic/models/external_bank_accounts/micro_deposit_create_params.rbs @@ -0,0 +1,33 @@ +module Lithic + module Models + module ExternalBankAccounts + type micro_deposit_create_params = + { + external_bank_account_token: String, + micro_deposits: ::Array[Integer] + } + & Lithic::Internal::Type::request_parameters + + class MicroDepositCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor external_bank_account_token: String + + attr_accessor micro_deposits: ::Array[Integer] + + def initialize: ( + external_bank_account_token: String, + micro_deposits: ::Array[Integer], + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + external_bank_account_token: String, + micro_deposits: ::Array[Integer], + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/external_bank_accounts/micro_deposit_create_response.rbs b/sig/lithic/models/external_bank_accounts/micro_deposit_create_response.rbs new file mode 100644 index 00000000..51185528 --- /dev/null +++ b/sig/lithic/models/external_bank_accounts/micro_deposit_create_response.rbs @@ -0,0 +1,188 @@ +module Lithic + module Models + module ExternalBankAccounts + type micro_deposit_create_response = + { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::state, + type: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::verification_state, + account_token: String?, + address: Lithic::ExternalBankAccountAddress?, + company_id: String?, + dob: Date?, + doing_business_as: String?, + financial_account_token: String?, + name: String?, + user_defined_id: String?, + verification_failed_reason: String? + } + + class MicroDepositCreateResponse < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor country: String + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor last_four: String + + attr_accessor owner: String + + attr_accessor owner_type: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::owner_type + + attr_accessor routing_number: String + + attr_accessor state: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::state + + attr_accessor type: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::type_ + + attr_accessor verification_attempts: Integer + + attr_accessor verification_method: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::verification_method + + attr_accessor verification_state: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::verification_state + + attr_accessor account_token: String? + + attr_accessor address: Lithic::ExternalBankAccountAddress? + + attr_accessor company_id: String? + + attr_accessor dob: Date? + + attr_accessor doing_business_as: String? + + attr_accessor financial_account_token: String? + + attr_accessor name: String? + + attr_accessor user_defined_id: String? + + attr_accessor verification_failed_reason: String? + + def initialize: ( + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::state, + type: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::verification_state, + ?account_token: String?, + ?address: Lithic::ExternalBankAccountAddress?, + ?company_id: String?, + ?dob: Date?, + ?doing_business_as: String?, + ?financial_account_token: String?, + ?name: String?, + ?user_defined_id: String?, + ?verification_failed_reason: String? + ) -> void + + def to_hash: -> { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::owner_type, + routing_number: String, + state: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::state, + type: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::type_, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::verification_method, + verification_state: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::verification_state, + account_token: String?, + address: Lithic::ExternalBankAccountAddress?, + company_id: String?, + dob: Date?, + doing_business_as: String?, + financial_account_token: String?, + name: String?, + user_defined_id: String?, + verification_failed_reason: String? + } + + type owner_type = :BUSINESS | :INDIVIDUAL + + module OwnerType + extend Lithic::Internal::Type::Enum + + BUSINESS: :BUSINESS + INDIVIDUAL: :INDIVIDUAL + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::owner_type] + end + + type state = :ENABLED | :CLOSED | :PAUSED + + module State + extend Lithic::Internal::Type::Enum + + ENABLED: :ENABLED + CLOSED: :CLOSED + PAUSED: :PAUSED + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::state] + end + + type type_ = :CHECKING | :SAVINGS + + module Type + extend Lithic::Internal::Type::Enum + + CHECKING: :CHECKING + SAVINGS: :SAVINGS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::type_] + end + + type verification_method = :MANUAL | :MICRO_DEPOSIT | :PLAID | :PRENOTE + + module VerificationMethod + extend Lithic::Internal::Type::Enum + + MANUAL: :MANUAL + MICRO_DEPOSIT: :MICRO_DEPOSIT + PLAID: :PLAID + PRENOTE: :PRENOTE + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::verification_method] + end + + type verification_state = + :PENDING | :ENABLED | :FAILED_VERIFICATION | :INSUFFICIENT_FUNDS + + module VerificationState + extend Lithic::Internal::Type::Enum + + PENDING: :PENDING + ENABLED: :ENABLED + FAILED_VERIFICATION: :FAILED_VERIFICATION + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + + def self?.values: -> ::Array[Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::verification_state] + end + end + end + end +end diff --git a/sig/lithic/models/external_payment.rbs b/sig/lithic/models/external_payment.rbs new file mode 100644 index 00000000..8dc7e553 --- /dev/null +++ b/sig/lithic/models/external_payment.rbs @@ -0,0 +1,325 @@ +module Lithic + module Models + type external_payment = + { + token: String, + created: Time, + status: Lithic::Models::ExternalPayment::status, + updated: Time, + category: Lithic::Models::ExternalPayment::category, + currency: String, + events: ::Array[Lithic::ExternalPayment::Event], + family: Lithic::Models::ExternalPayment::family, + financial_account_token: String, + payment_type: Lithic::Models::ExternalPayment::payment_type, + pending_amount: Integer, + result: Lithic::Models::ExternalPayment::result, + settled_amount: Integer, + user_defined_id: String? + } + + class ExternalPayment < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor created: Time + + attr_accessor status: Lithic::Models::ExternalPayment::status + + attr_accessor updated: Time + + attr_reader category: Lithic::Models::ExternalPayment::category? + + def category=: ( + Lithic::Models::ExternalPayment::category + ) -> Lithic::Models::ExternalPayment::category + + attr_reader currency: String? + + def currency=: (String) -> String + + attr_reader events: ::Array[Lithic::ExternalPayment::Event]? + + def events=: ( + ::Array[Lithic::ExternalPayment::Event] + ) -> ::Array[Lithic::ExternalPayment::Event] + + attr_reader family: Lithic::Models::ExternalPayment::family? + + def family=: ( + Lithic::Models::ExternalPayment::family + ) -> Lithic::Models::ExternalPayment::family + + attr_reader financial_account_token: String? + + def financial_account_token=: (String) -> String + + attr_reader payment_type: Lithic::Models::ExternalPayment::payment_type? + + def payment_type=: ( + Lithic::Models::ExternalPayment::payment_type + ) -> Lithic::Models::ExternalPayment::payment_type + + attr_reader pending_amount: Integer? + + def pending_amount=: (Integer) -> Integer + + attr_reader result: Lithic::Models::ExternalPayment::result? + + def result=: ( + Lithic::Models::ExternalPayment::result + ) -> Lithic::Models::ExternalPayment::result + + attr_reader settled_amount: Integer? + + def settled_amount=: (Integer) -> Integer + + attr_accessor user_defined_id: String? + + def initialize: ( + token: String, + created: Time, + status: Lithic::Models::ExternalPayment::status, + updated: Time, + ?category: Lithic::Models::ExternalPayment::category, + ?currency: String, + ?events: ::Array[Lithic::ExternalPayment::Event], + ?family: Lithic::Models::ExternalPayment::family, + ?financial_account_token: String, + ?payment_type: Lithic::Models::ExternalPayment::payment_type, + ?pending_amount: Integer, + ?result: Lithic::Models::ExternalPayment::result, + ?settled_amount: Integer, + ?user_defined_id: String? + ) -> void + + def to_hash: -> { + token: String, + created: Time, + status: Lithic::Models::ExternalPayment::status, + updated: Time, + category: Lithic::Models::ExternalPayment::category, + currency: String, + events: ::Array[Lithic::ExternalPayment::Event], + family: Lithic::Models::ExternalPayment::family, + financial_account_token: String, + payment_type: Lithic::Models::ExternalPayment::payment_type, + pending_amount: Integer, + result: Lithic::Models::ExternalPayment::result, + settled_amount: Integer, + user_defined_id: String? + } + + type status = + :PENDING | :SETTLED | :DECLINED | :REVERSED | :CANCELED | :RETURNED + + module Status + extend Lithic::Internal::Type::Enum + + PENDING: :PENDING + SETTLED: :SETTLED + DECLINED: :DECLINED + REVERSED: :REVERSED + CANCELED: :CANCELED + RETURNED: :RETURNED + + def self?.values: -> ::Array[Lithic::Models::ExternalPayment::status] + end + + type category = + :EXTERNAL_WIRE + | :EXTERNAL_ACH + | :EXTERNAL_CHECK + | :EXTERNAL_FEDNOW + | :EXTERNAL_RTP + | :EXTERNAL_TRANSFER + + module Category + extend Lithic::Internal::Type::Enum + + EXTERNAL_WIRE: :EXTERNAL_WIRE + EXTERNAL_ACH: :EXTERNAL_ACH + EXTERNAL_CHECK: :EXTERNAL_CHECK + EXTERNAL_FEDNOW: :EXTERNAL_FEDNOW + EXTERNAL_RTP: :EXTERNAL_RTP + EXTERNAL_TRANSFER: :EXTERNAL_TRANSFER + + def self?.values: -> ::Array[Lithic::Models::ExternalPayment::category] + end + + type event = + { + token: String, + amount: Integer, + created: Time, + detailed_results: ::Array[Lithic::Models::ExternalPayment::Event::detailed_result], + effective_date: Date, + memo: String, + result: Lithic::Models::ExternalPayment::Event::result, + type: Lithic::Models::ExternalPayment::Event::type_ + } + + class Event < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor amount: Integer + + attr_accessor created: Time + + attr_accessor detailed_results: ::Array[Lithic::Models::ExternalPayment::Event::detailed_result] + + attr_accessor effective_date: Date + + attr_accessor memo: String + + attr_accessor result: Lithic::Models::ExternalPayment::Event::result + + attr_accessor type: Lithic::Models::ExternalPayment::Event::type_ + + def initialize: ( + token: String, + amount: Integer, + created: Time, + detailed_results: ::Array[Lithic::Models::ExternalPayment::Event::detailed_result], + effective_date: Date, + memo: String, + result: Lithic::Models::ExternalPayment::Event::result, + type: Lithic::Models::ExternalPayment::Event::type_ + ) -> void + + def to_hash: -> { + token: String, + amount: Integer, + created: Time, + detailed_results: ::Array[Lithic::Models::ExternalPayment::Event::detailed_result], + effective_date: Date, + memo: String, + result: Lithic::Models::ExternalPayment::Event::result, + type: Lithic::Models::ExternalPayment::Event::type_ + } + + type detailed_result = :APPROVED | :INSUFFICIENT_FUNDS + + module DetailedResult + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + + def self?.values: -> ::Array[Lithic::Models::ExternalPayment::Event::detailed_result] + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::ExternalPayment::Event::result] + end + + type type_ = + :EXTERNAL_WIRE_INITIATED + | :EXTERNAL_WIRE_CANCELED + | :EXTERNAL_WIRE_SETTLED + | :EXTERNAL_WIRE_REVERSED + | :EXTERNAL_WIRE_RELEASED + | :EXTERNAL_ACH_INITIATED + | :EXTERNAL_ACH_CANCELED + | :EXTERNAL_ACH_SETTLED + | :EXTERNAL_ACH_REVERSED + | :EXTERNAL_ACH_RELEASED + | :EXTERNAL_TRANSFER_INITIATED + | :EXTERNAL_TRANSFER_CANCELED + | :EXTERNAL_TRANSFER_SETTLED + | :EXTERNAL_TRANSFER_REVERSED + | :EXTERNAL_TRANSFER_RELEASED + | :EXTERNAL_CHECK_INITIATED + | :EXTERNAL_CHECK_CANCELED + | :EXTERNAL_CHECK_SETTLED + | :EXTERNAL_CHECK_REVERSED + | :EXTERNAL_CHECK_RELEASED + | :EXTERNAL_FEDNOW_INITIATED + | :EXTERNAL_FEDNOW_CANCELED + | :EXTERNAL_FEDNOW_SETTLED + | :EXTERNAL_FEDNOW_REVERSED + | :EXTERNAL_FEDNOW_RELEASED + | :EXTERNAL_RTP_INITIATED + | :EXTERNAL_RTP_CANCELED + | :EXTERNAL_RTP_SETTLED + | :EXTERNAL_RTP_REVERSED + | :EXTERNAL_RTP_RELEASED + + module Type + extend Lithic::Internal::Type::Enum + + EXTERNAL_WIRE_INITIATED: :EXTERNAL_WIRE_INITIATED + EXTERNAL_WIRE_CANCELED: :EXTERNAL_WIRE_CANCELED + EXTERNAL_WIRE_SETTLED: :EXTERNAL_WIRE_SETTLED + EXTERNAL_WIRE_REVERSED: :EXTERNAL_WIRE_REVERSED + EXTERNAL_WIRE_RELEASED: :EXTERNAL_WIRE_RELEASED + EXTERNAL_ACH_INITIATED: :EXTERNAL_ACH_INITIATED + EXTERNAL_ACH_CANCELED: :EXTERNAL_ACH_CANCELED + EXTERNAL_ACH_SETTLED: :EXTERNAL_ACH_SETTLED + EXTERNAL_ACH_REVERSED: :EXTERNAL_ACH_REVERSED + EXTERNAL_ACH_RELEASED: :EXTERNAL_ACH_RELEASED + EXTERNAL_TRANSFER_INITIATED: :EXTERNAL_TRANSFER_INITIATED + EXTERNAL_TRANSFER_CANCELED: :EXTERNAL_TRANSFER_CANCELED + EXTERNAL_TRANSFER_SETTLED: :EXTERNAL_TRANSFER_SETTLED + EXTERNAL_TRANSFER_REVERSED: :EXTERNAL_TRANSFER_REVERSED + EXTERNAL_TRANSFER_RELEASED: :EXTERNAL_TRANSFER_RELEASED + EXTERNAL_CHECK_INITIATED: :EXTERNAL_CHECK_INITIATED + EXTERNAL_CHECK_CANCELED: :EXTERNAL_CHECK_CANCELED + EXTERNAL_CHECK_SETTLED: :EXTERNAL_CHECK_SETTLED + EXTERNAL_CHECK_REVERSED: :EXTERNAL_CHECK_REVERSED + EXTERNAL_CHECK_RELEASED: :EXTERNAL_CHECK_RELEASED + EXTERNAL_FEDNOW_INITIATED: :EXTERNAL_FEDNOW_INITIATED + EXTERNAL_FEDNOW_CANCELED: :EXTERNAL_FEDNOW_CANCELED + EXTERNAL_FEDNOW_SETTLED: :EXTERNAL_FEDNOW_SETTLED + EXTERNAL_FEDNOW_REVERSED: :EXTERNAL_FEDNOW_REVERSED + EXTERNAL_FEDNOW_RELEASED: :EXTERNAL_FEDNOW_RELEASED + EXTERNAL_RTP_INITIATED: :EXTERNAL_RTP_INITIATED + EXTERNAL_RTP_CANCELED: :EXTERNAL_RTP_CANCELED + EXTERNAL_RTP_SETTLED: :EXTERNAL_RTP_SETTLED + EXTERNAL_RTP_REVERSED: :EXTERNAL_RTP_REVERSED + EXTERNAL_RTP_RELEASED: :EXTERNAL_RTP_RELEASED + + def self?.values: -> ::Array[Lithic::Models::ExternalPayment::Event::type_] + end + end + + type family = :EXTERNAL_PAYMENT + + module Family + extend Lithic::Internal::Type::Enum + + EXTERNAL_PAYMENT: :EXTERNAL_PAYMENT + + def self?.values: -> ::Array[Lithic::Models::ExternalPayment::family] + end + + type payment_type = :DEPOSIT | :WITHDRAWAL + + module PaymentType + extend Lithic::Internal::Type::Enum + + DEPOSIT: :DEPOSIT + WITHDRAWAL: :WITHDRAWAL + + def self?.values: -> ::Array[Lithic::Models::ExternalPayment::payment_type] + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::ExternalPayment::result] + end + end + end +end diff --git a/sig/lithic/models/external_payment_cancel_params.rbs b/sig/lithic/models/external_payment_cancel_params.rbs new file mode 100644 index 00000000..2b3b514c --- /dev/null +++ b/sig/lithic/models/external_payment_cancel_params.rbs @@ -0,0 +1,34 @@ +module Lithic + module Models + type external_payment_cancel_params = + { external_payment_token: String, effective_date: Date, memo: String } + & Lithic::Internal::Type::request_parameters + + class ExternalPaymentCancelParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor external_payment_token: String + + attr_accessor effective_date: Date + + attr_reader memo: String? + + def memo=: (String) -> String + + def initialize: ( + external_payment_token: String, + effective_date: Date, + ?memo: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + external_payment_token: String, + effective_date: Date, + memo: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/external_payment_create_params.rbs b/sig/lithic/models/external_payment_create_params.rbs new file mode 100644 index 00000000..a2204135 --- /dev/null +++ b/sig/lithic/models/external_payment_create_params.rbs @@ -0,0 +1,119 @@ +module Lithic + module Models + type external_payment_create_params = + { + amount: Integer, + category: Lithic::Models::ExternalPaymentCreateParams::category, + effective_date: Date, + financial_account_token: String, + payment_type: Lithic::Models::ExternalPaymentCreateParams::payment_type, + token: String, + memo: String, + progress_to: Lithic::Models::ExternalPaymentCreateParams::progress_to, + user_defined_id: String + } + & Lithic::Internal::Type::request_parameters + + class ExternalPaymentCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor amount: Integer + + attr_accessor category: Lithic::Models::ExternalPaymentCreateParams::category + + attr_accessor effective_date: Date + + attr_accessor financial_account_token: String + + attr_accessor payment_type: Lithic::Models::ExternalPaymentCreateParams::payment_type + + attr_reader token: String? + + def token=: (String) -> String + + attr_reader memo: String? + + def memo=: (String) -> String + + attr_reader progress_to: Lithic::Models::ExternalPaymentCreateParams::progress_to? + + def progress_to=: ( + Lithic::Models::ExternalPaymentCreateParams::progress_to + ) -> Lithic::Models::ExternalPaymentCreateParams::progress_to + + attr_reader user_defined_id: String? + + def user_defined_id=: (String) -> String + + def initialize: ( + amount: Integer, + category: Lithic::Models::ExternalPaymentCreateParams::category, + effective_date: Date, + financial_account_token: String, + payment_type: Lithic::Models::ExternalPaymentCreateParams::payment_type, + ?token: String, + ?memo: String, + ?progress_to: Lithic::Models::ExternalPaymentCreateParams::progress_to, + ?user_defined_id: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + amount: Integer, + category: Lithic::Models::ExternalPaymentCreateParams::category, + effective_date: Date, + financial_account_token: String, + payment_type: Lithic::Models::ExternalPaymentCreateParams::payment_type, + token: String, + memo: String, + progress_to: Lithic::Models::ExternalPaymentCreateParams::progress_to, + user_defined_id: String, + request_options: Lithic::RequestOptions + } + + type category = + :EXTERNAL_WIRE + | :EXTERNAL_ACH + | :EXTERNAL_CHECK + | :EXTERNAL_FEDNOW + | :EXTERNAL_RTP + | :EXTERNAL_TRANSFER + + module Category + extend Lithic::Internal::Type::Enum + + EXTERNAL_WIRE: :EXTERNAL_WIRE + EXTERNAL_ACH: :EXTERNAL_ACH + EXTERNAL_CHECK: :EXTERNAL_CHECK + EXTERNAL_FEDNOW: :EXTERNAL_FEDNOW + EXTERNAL_RTP: :EXTERNAL_RTP + EXTERNAL_TRANSFER: :EXTERNAL_TRANSFER + + def self?.values: -> ::Array[Lithic::Models::ExternalPaymentCreateParams::category] + end + + type payment_type = :DEPOSIT | :WITHDRAWAL + + module PaymentType + extend Lithic::Internal::Type::Enum + + DEPOSIT: :DEPOSIT + WITHDRAWAL: :WITHDRAWAL + + def self?.values: -> ::Array[Lithic::Models::ExternalPaymentCreateParams::payment_type] + end + + type progress_to = :SETTLED | :RELEASED + + module ProgressTo + extend Lithic::Internal::Type::Enum + + SETTLED: :SETTLED + RELEASED: :RELEASED + + def self?.values: -> ::Array[Lithic::Models::ExternalPaymentCreateParams::progress_to] + end + end + end +end diff --git a/sig/lithic/models/external_payment_created_webhook_event.rbs b/sig/lithic/models/external_payment_created_webhook_event.rbs new file mode 100644 index 00000000..c03b11b5 --- /dev/null +++ b/sig/lithic/models/external_payment_created_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type external_payment_created_webhook_event = + { event_type: :"external_payment.created" } + + class ExternalPaymentCreatedWebhookEvent < Lithic::Models::ExternalPayment + def event_type: -> :"external_payment.created" + + def event_type=: ( + :"external_payment.created" _ + ) -> :"external_payment.created" + + def initialize: (?event_type: :"external_payment.created") -> void + + def to_hash: -> { event_type: :"external_payment.created" } + end + end +end diff --git a/sig/lithic/models/external_payment_list_params.rbs b/sig/lithic/models/external_payment_list_params.rbs new file mode 100644 index 00000000..43ed0b8f --- /dev/null +++ b/sig/lithic/models/external_payment_list_params.rbs @@ -0,0 +1,145 @@ +module Lithic + module Models + type external_payment_list_params = + { + begin_: Time, + business_account_token: String, + category: Lithic::Models::ExternalPaymentListParams::category, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::Models::ExternalPaymentListParams::result, + starting_after: String, + status: Lithic::Models::ExternalPaymentListParams::status + } + & Lithic::Internal::Type::request_parameters + + class ExternalPaymentListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader business_account_token: String? + + def business_account_token=: (String) -> String + + attr_reader category: Lithic::Models::ExternalPaymentListParams::category? + + def category=: ( + Lithic::Models::ExternalPaymentListParams::category + ) -> Lithic::Models::ExternalPaymentListParams::category + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader financial_account_token: String? + + def financial_account_token=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader result: Lithic::Models::ExternalPaymentListParams::result? + + def result=: ( + Lithic::Models::ExternalPaymentListParams::result + ) -> Lithic::Models::ExternalPaymentListParams::result + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader status: Lithic::Models::ExternalPaymentListParams::status? + + def status=: ( + Lithic::Models::ExternalPaymentListParams::status + ) -> Lithic::Models::ExternalPaymentListParams::status + + def initialize: ( + ?begin_: Time, + ?business_account_token: String, + ?category: Lithic::Models::ExternalPaymentListParams::category, + ?end_: Time, + ?ending_before: String, + ?financial_account_token: String, + ?page_size: Integer, + ?result: Lithic::Models::ExternalPaymentListParams::result, + ?starting_after: String, + ?status: Lithic::Models::ExternalPaymentListParams::status, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + begin_: Time, + business_account_token: String, + category: Lithic::Models::ExternalPaymentListParams::category, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::Models::ExternalPaymentListParams::result, + starting_after: String, + status: Lithic::Models::ExternalPaymentListParams::status, + request_options: Lithic::RequestOptions + } + + type category = + :EXTERNAL_WIRE + | :EXTERNAL_ACH + | :EXTERNAL_CHECK + | :EXTERNAL_FEDNOW + | :EXTERNAL_RTP + | :EXTERNAL_TRANSFER + + module Category + extend Lithic::Internal::Type::Enum + + EXTERNAL_WIRE: :EXTERNAL_WIRE + EXTERNAL_ACH: :EXTERNAL_ACH + EXTERNAL_CHECK: :EXTERNAL_CHECK + EXTERNAL_FEDNOW: :EXTERNAL_FEDNOW + EXTERNAL_RTP: :EXTERNAL_RTP + EXTERNAL_TRANSFER: :EXTERNAL_TRANSFER + + def self?.values: -> ::Array[Lithic::Models::ExternalPaymentListParams::category] + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::ExternalPaymentListParams::result] + end + + type status = + :PENDING | :SETTLED | :DECLINED | :REVERSED | :CANCELED | :RETURNED + + module Status + extend Lithic::Internal::Type::Enum + + PENDING: :PENDING + SETTLED: :SETTLED + DECLINED: :DECLINED + REVERSED: :REVERSED + CANCELED: :CANCELED + RETURNED: :RETURNED + + def self?.values: -> ::Array[Lithic::Models::ExternalPaymentListParams::status] + end + end + end +end diff --git a/sig/lithic/models/external_payment_release_params.rbs b/sig/lithic/models/external_payment_release_params.rbs new file mode 100644 index 00000000..7c0f40c6 --- /dev/null +++ b/sig/lithic/models/external_payment_release_params.rbs @@ -0,0 +1,34 @@ +module Lithic + module Models + type external_payment_release_params = + { external_payment_token: String, effective_date: Date, memo: String } + & Lithic::Internal::Type::request_parameters + + class ExternalPaymentReleaseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor external_payment_token: String + + attr_accessor effective_date: Date + + attr_reader memo: String? + + def memo=: (String) -> String + + def initialize: ( + external_payment_token: String, + effective_date: Date, + ?memo: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + external_payment_token: String, + effective_date: Date, + memo: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/external_payment_retrieve_params.rbs b/sig/lithic/models/external_payment_retrieve_params.rbs new file mode 100644 index 00000000..4c8ea601 --- /dev/null +++ b/sig/lithic/models/external_payment_retrieve_params.rbs @@ -0,0 +1,24 @@ +module Lithic + module Models + type external_payment_retrieve_params = + { external_payment_token: String } + & Lithic::Internal::Type::request_parameters + + class ExternalPaymentRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor external_payment_token: String + + def initialize: ( + external_payment_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + external_payment_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/external_payment_reverse_params.rbs b/sig/lithic/models/external_payment_reverse_params.rbs new file mode 100644 index 00000000..8bdd084a --- /dev/null +++ b/sig/lithic/models/external_payment_reverse_params.rbs @@ -0,0 +1,34 @@ +module Lithic + module Models + type external_payment_reverse_params = + { external_payment_token: String, effective_date: Date, memo: String } + & Lithic::Internal::Type::request_parameters + + class ExternalPaymentReverseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor external_payment_token: String + + attr_accessor effective_date: Date + + attr_reader memo: String? + + def memo=: (String) -> String + + def initialize: ( + external_payment_token: String, + effective_date: Date, + ?memo: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + external_payment_token: String, + effective_date: Date, + memo: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/external_payment_settle_params.rbs b/sig/lithic/models/external_payment_settle_params.rbs new file mode 100644 index 00000000..a8fbd733 --- /dev/null +++ b/sig/lithic/models/external_payment_settle_params.rbs @@ -0,0 +1,58 @@ +module Lithic + module Models + type external_payment_settle_params = + { + external_payment_token: String, + effective_date: Date, + memo: String, + progress_to: Lithic::Models::ExternalPaymentSettleParams::progress_to + } + & Lithic::Internal::Type::request_parameters + + class ExternalPaymentSettleParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor external_payment_token: String + + attr_accessor effective_date: Date + + attr_reader memo: String? + + def memo=: (String) -> String + + attr_reader progress_to: Lithic::Models::ExternalPaymentSettleParams::progress_to? + + def progress_to=: ( + Lithic::Models::ExternalPaymentSettleParams::progress_to + ) -> Lithic::Models::ExternalPaymentSettleParams::progress_to + + def initialize: ( + external_payment_token: String, + effective_date: Date, + ?memo: String, + ?progress_to: Lithic::Models::ExternalPaymentSettleParams::progress_to, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + external_payment_token: String, + effective_date: Date, + memo: String, + progress_to: Lithic::Models::ExternalPaymentSettleParams::progress_to, + request_options: Lithic::RequestOptions + } + + type progress_to = :SETTLED | :RELEASED + + module ProgressTo + extend Lithic::Internal::Type::Enum + + SETTLED: :SETTLED + RELEASED: :RELEASED + + def self?.values: -> ::Array[Lithic::Models::ExternalPaymentSettleParams::progress_to] + end + end + end +end diff --git a/sig/lithic/models/external_payment_updated_webhook_event.rbs b/sig/lithic/models/external_payment_updated_webhook_event.rbs new file mode 100644 index 00000000..d26e5151 --- /dev/null +++ b/sig/lithic/models/external_payment_updated_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type external_payment_updated_webhook_event = + { event_type: :"external_payment.updated" } + + class ExternalPaymentUpdatedWebhookEvent < Lithic::Models::ExternalPayment + def event_type: -> :"external_payment.updated" + + def event_type=: ( + :"external_payment.updated" _ + ) -> :"external_payment.updated" + + def initialize: (?event_type: :"external_payment.updated") -> void + + def to_hash: -> { event_type: :"external_payment.updated" } + end + end +end diff --git a/sig/lithic/models/external_resource.rbs b/sig/lithic/models/external_resource.rbs new file mode 100644 index 00000000..1158a611 --- /dev/null +++ b/sig/lithic/models/external_resource.rbs @@ -0,0 +1,32 @@ +module Lithic + module Models + type external_resource = + { + external_resource_token: String, + external_resource_type: Lithic::Models::external_resource_type, + external_resource_sub_token: String + } + + class ExternalResource < Lithic::Internal::Type::BaseModel + attr_accessor external_resource_token: String + + attr_accessor external_resource_type: Lithic::Models::external_resource_type + + attr_reader external_resource_sub_token: String? + + def external_resource_sub_token=: (String) -> String + + def initialize: ( + external_resource_token: String, + external_resource_type: Lithic::Models::external_resource_type, + ?external_resource_sub_token: String + ) -> void + + def to_hash: -> { + external_resource_token: String, + external_resource_type: Lithic::Models::external_resource_type, + external_resource_sub_token: String + } + end + end +end diff --git a/sig/lithic/models/external_resource_type.rbs b/sig/lithic/models/external_resource_type.rbs new file mode 100644 index 00000000..1fdab9da --- /dev/null +++ b/sig/lithic/models/external_resource_type.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + type external_resource_type = :STATEMENT | :COLLECTION | :DISPUTE | :UNKNOWN + + module ExternalResourceType + extend Lithic::Internal::Type::Enum + + STATEMENT: :STATEMENT + COLLECTION: :COLLECTION + DISPUTE: :DISPUTE + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::external_resource_type] + end + end +end diff --git a/sig/lithic/models/financial_account.rbs b/sig/lithic/models/financial_account.rbs new file mode 100644 index 00000000..60fed134 --- /dev/null +++ b/sig/lithic/models/financial_account.rbs @@ -0,0 +1,194 @@ +module Lithic + module Models + type financial_account = + { + token: String, + account_token: String?, + created: Time, + credit_configuration: Lithic::FinancialAccount::CreditConfiguration?, + is_for_benefit_of: bool, + nickname: String?, + status: Lithic::Models::FinancialAccount::status, + substatus: Lithic::Models::FinancialAccount::substatus?, + type: Lithic::Models::FinancialAccount::type_, + updated: Time, + user_defined_status: String?, + account_number: String?, + routing_number: String? + } + + class FinancialAccount < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor account_token: String? + + attr_accessor created: Time + + attr_accessor credit_configuration: Lithic::FinancialAccount::CreditConfiguration? + + attr_accessor is_for_benefit_of: bool + + attr_accessor nickname: String? + + attr_accessor status: Lithic::Models::FinancialAccount::status + + attr_accessor substatus: Lithic::Models::FinancialAccount::substatus? + + attr_accessor type: Lithic::Models::FinancialAccount::type_ + + attr_accessor updated: Time + + attr_accessor user_defined_status: String? + + attr_accessor account_number: String? + + attr_accessor routing_number: String? + + def initialize: ( + token: String, + account_token: String?, + created: Time, + credit_configuration: Lithic::FinancialAccount::CreditConfiguration?, + is_for_benefit_of: bool, + nickname: String?, + status: Lithic::Models::FinancialAccount::status, + substatus: Lithic::Models::FinancialAccount::substatus?, + type: Lithic::Models::FinancialAccount::type_, + updated: Time, + user_defined_status: String?, + ?account_number: String?, + ?routing_number: String? + ) -> void + + def to_hash: -> { + token: String, + account_token: String?, + created: Time, + credit_configuration: Lithic::FinancialAccount::CreditConfiguration?, + is_for_benefit_of: bool, + nickname: String?, + status: Lithic::Models::FinancialAccount::status, + substatus: Lithic::Models::FinancialAccount::substatus?, + type: Lithic::Models::FinancialAccount::type_, + updated: Time, + user_defined_status: String?, + account_number: String?, + routing_number: String? + } + + type credit_configuration = + { + auto_collection_configuration: Lithic::FinancialAccount::CreditConfiguration::AutoCollectionConfiguration?, + credit_limit: Integer?, + credit_product_token: String?, + external_bank_account_token: String?, + tier: String? + } + + class CreditConfiguration < Lithic::Internal::Type::BaseModel + attr_accessor auto_collection_configuration: Lithic::FinancialAccount::CreditConfiguration::AutoCollectionConfiguration? + + attr_accessor credit_limit: Integer? + + attr_accessor credit_product_token: String? + + attr_accessor external_bank_account_token: String? + + attr_accessor tier: String? + + def initialize: ( + auto_collection_configuration: Lithic::FinancialAccount::CreditConfiguration::AutoCollectionConfiguration?, + credit_limit: Integer?, + credit_product_token: String?, + external_bank_account_token: String?, + tier: String? + ) -> void + + def to_hash: -> { + auto_collection_configuration: Lithic::FinancialAccount::CreditConfiguration::AutoCollectionConfiguration?, + credit_limit: Integer?, + credit_product_token: String?, + external_bank_account_token: String?, + tier: String? + } + + type auto_collection_configuration = { auto_collection_enabled: bool } + + class AutoCollectionConfiguration < Lithic::Internal::Type::BaseModel + attr_accessor auto_collection_enabled: bool + + def initialize: (auto_collection_enabled: bool) -> void + + def to_hash: -> { auto_collection_enabled: bool } + end + end + + type status = :OPEN | :CLOSED | :SUSPENDED | :PENDING + + module Status + extend Lithic::Internal::Type::Enum + + OPEN: :OPEN + CLOSED: :CLOSED + SUSPENDED: :SUSPENDED + PENDING: :PENDING + + def self?.values: -> ::Array[Lithic::Models::FinancialAccount::status] + end + + type substatus = + :CHARGED_OFF_DELINQUENT + | :CHARGED_OFF_FRAUD + | :END_USER_REQUEST + | :BANK_REQUEST + | :DELINQUENT + | :INTEREST_AND_FEES_PAUSED + + module Substatus + extend Lithic::Internal::Type::Enum + + CHARGED_OFF_DELINQUENT: :CHARGED_OFF_DELINQUENT + CHARGED_OFF_FRAUD: :CHARGED_OFF_FRAUD + END_USER_REQUEST: :END_USER_REQUEST + BANK_REQUEST: :BANK_REQUEST + DELINQUENT: :DELINQUENT + INTEREST_AND_FEES_PAUSED: :INTEREST_AND_FEES_PAUSED + + def self?.values: -> ::Array[Lithic::Models::FinancialAccount::substatus] + end + + type type_ = + :ISSUING + | :RESERVE + | :OPERATING + | :CHARGED_OFF_FEES + | :CHARGED_OFF_INTEREST + | :CHARGED_OFF_PRINCIPAL + | :SECURITY + | :PROGRAM_RECEIVABLES + | :COLLECTION + | :PROGRAM_BANK_ACCOUNTS_PAYABLE + | :EARLY_DIRECT_DEPOSIT_FLOAT + | :PROVISIONAL_CREDIT_ACCOUNT + + module Type + extend Lithic::Internal::Type::Enum + + ISSUING: :ISSUING + RESERVE: :RESERVE + OPERATING: :OPERATING + CHARGED_OFF_FEES: :CHARGED_OFF_FEES + CHARGED_OFF_INTEREST: :CHARGED_OFF_INTEREST + CHARGED_OFF_PRINCIPAL: :CHARGED_OFF_PRINCIPAL + SECURITY: :SECURITY + PROGRAM_RECEIVABLES: :PROGRAM_RECEIVABLES + COLLECTION: :COLLECTION + PROGRAM_BANK_ACCOUNTS_PAYABLE: :PROGRAM_BANK_ACCOUNTS_PAYABLE + EARLY_DIRECT_DEPOSIT_FLOAT: :EARLY_DIRECT_DEPOSIT_FLOAT + PROVISIONAL_CREDIT_ACCOUNT: :PROVISIONAL_CREDIT_ACCOUNT + + def self?.values: -> ::Array[Lithic::Models::FinancialAccount::type_] + end + end + end +end diff --git a/sig/lithic/models/financial_account_balance.rbs b/sig/lithic/models/financial_account_balance.rbs new file mode 100644 index 00000000..3d164f75 --- /dev/null +++ b/sig/lithic/models/financial_account_balance.rbs @@ -0,0 +1,78 @@ +module Lithic + module Models + type financial_account_balance = + { + token: String, + available_amount: Integer, + created: Time, + currency: String, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + type: Lithic::Models::FinancialAccountBalance::type_, + updated: Time + } + + class FinancialAccountBalance < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor available_amount: Integer + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor last_transaction_event_token: String + + attr_accessor last_transaction_token: String + + attr_accessor pending_amount: Integer + + attr_accessor total_amount: Integer + + attr_accessor type: Lithic::Models::FinancialAccountBalance::type_ + + attr_accessor updated: Time + + def initialize: ( + token: String, + available_amount: Integer, + created: Time, + currency: String, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + type: Lithic::Models::FinancialAccountBalance::type_, + updated: Time + ) -> void + + def to_hash: -> { + token: String, + available_amount: Integer, + created: Time, + currency: String, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + type: Lithic::Models::FinancialAccountBalance::type_, + updated: Time + } + + type type_ = :ISSUING | :OPERATING | :RESERVE | :SECURITY + + module Type + extend Lithic::Internal::Type::Enum + + ISSUING: :ISSUING + OPERATING: :OPERATING + RESERVE: :RESERVE + SECURITY: :SECURITY + + def self?.values: -> ::Array[Lithic::Models::FinancialAccountBalance::type_] + end + end + end +end diff --git a/sig/lithic/models/financial_account_create_params.rbs b/sig/lithic/models/financial_account_create_params.rbs new file mode 100644 index 00000000..105a539a --- /dev/null +++ b/sig/lithic/models/financial_account_create_params.rbs @@ -0,0 +1,62 @@ +module Lithic + module Models + type financial_account_create_params = + { + nickname: String, + type: Lithic::Models::FinancialAccountCreateParams::type_, + account_token: String, + is_for_benefit_of: bool, + idempotency_key: String + } + & Lithic::Internal::Type::request_parameters + + class FinancialAccountCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor nickname: String + + attr_accessor type: Lithic::Models::FinancialAccountCreateParams::type_ + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader is_for_benefit_of: bool? + + def is_for_benefit_of=: (bool) -> bool + + attr_reader idempotency_key: String? + + def idempotency_key=: (String) -> String + + def initialize: ( + nickname: String, + type: Lithic::Models::FinancialAccountCreateParams::type_, + ?account_token: String, + ?is_for_benefit_of: bool, + ?idempotency_key: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + nickname: String, + type: Lithic::Models::FinancialAccountCreateParams::type_, + account_token: String, + is_for_benefit_of: bool, + idempotency_key: String, + request_options: Lithic::RequestOptions + } + + type type_ = :OPERATING + + module Type + extend Lithic::Internal::Type::Enum + + OPERATING: :OPERATING + + def self?.values: -> ::Array[Lithic::Models::FinancialAccountCreateParams::type_] + end + end + end +end diff --git a/sig/lithic/models/financial_account_created_webhook_event.rbs b/sig/lithic/models/financial_account_created_webhook_event.rbs new file mode 100644 index 00000000..6c63f311 --- /dev/null +++ b/sig/lithic/models/financial_account_created_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type financial_account_created_webhook_event = + { event_type: :"financial_account.created" } + + class FinancialAccountCreatedWebhookEvent < Lithic::Models::FinancialAccount + def event_type: -> :"financial_account.created" + + def event_type=: ( + :"financial_account.created" _ + ) -> :"financial_account.created" + + def initialize: (?event_type: :"financial_account.created") -> void + + def to_hash: -> { event_type: :"financial_account.created" } + end + end +end diff --git a/sig/lithic/models/financial_account_list_params.rbs b/sig/lithic/models/financial_account_list_params.rbs new file mode 100644 index 00000000..78f75425 --- /dev/null +++ b/sig/lithic/models/financial_account_list_params.rbs @@ -0,0 +1,63 @@ +module Lithic + module Models + type financial_account_list_params = + { + account_token: String, + business_account_token: String, + type: Lithic::Models::FinancialAccountListParams::type_ + } + & Lithic::Internal::Type::request_parameters + + class FinancialAccountListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader business_account_token: String? + + def business_account_token=: (String) -> String + + attr_reader type: Lithic::Models::FinancialAccountListParams::type_? + + def type=: ( + Lithic::Models::FinancialAccountListParams::type_ + ) -> Lithic::Models::FinancialAccountListParams::type_ + + def initialize: ( + ?account_token: String, + ?business_account_token: String, + ?type: Lithic::Models::FinancialAccountListParams::type_, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + account_token: String, + business_account_token: String, + type: Lithic::Models::FinancialAccountListParams::type_, + request_options: Lithic::RequestOptions + } + + type type_ = + :ISSUING + | :OPERATING + | :RESERVE + | :SECURITY + | :EARLY_DIRECT_DEPOSIT_FLOAT + + module Type + extend Lithic::Internal::Type::Enum + + ISSUING: :ISSUING + OPERATING: :OPERATING + RESERVE: :RESERVE + SECURITY: :SECURITY + EARLY_DIRECT_DEPOSIT_FLOAT: :EARLY_DIRECT_DEPOSIT_FLOAT + + def self?.values: -> ::Array[Lithic::Models::FinancialAccountListParams::type_] + end + end + end +end diff --git a/sig/lithic/models/financial_account_register_account_number_params.rbs b/sig/lithic/models/financial_account_register_account_number_params.rbs new file mode 100644 index 00000000..e1072ef0 --- /dev/null +++ b/sig/lithic/models/financial_account_register_account_number_params.rbs @@ -0,0 +1,28 @@ +module Lithic + module Models + type financial_account_register_account_number_params = + { financial_account_token: String, account_number: String } + & Lithic::Internal::Type::request_parameters + + class FinancialAccountRegisterAccountNumberParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor financial_account_token: String + + attr_accessor account_number: String + + def initialize: ( + financial_account_token: String, + account_number: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + financial_account_token: String, + account_number: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/financial_account_retrieve_params.rbs b/sig/lithic/models/financial_account_retrieve_params.rbs new file mode 100644 index 00000000..cb7c26bb --- /dev/null +++ b/sig/lithic/models/financial_account_retrieve_params.rbs @@ -0,0 +1,24 @@ +module Lithic + module Models + type financial_account_retrieve_params = + { financial_account_token: String } + & Lithic::Internal::Type::request_parameters + + class FinancialAccountRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor financial_account_token: String + + def initialize: ( + financial_account_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + financial_account_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/financial_account_update_params.rbs b/sig/lithic/models/financial_account_update_params.rbs new file mode 100644 index 00000000..80e817f5 --- /dev/null +++ b/sig/lithic/models/financial_account_update_params.rbs @@ -0,0 +1,30 @@ +module Lithic + module Models + type financial_account_update_params = + { financial_account_token: String, nickname: String } + & Lithic::Internal::Type::request_parameters + + class FinancialAccountUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor financial_account_token: String + + attr_reader nickname: String? + + def nickname=: (String) -> String + + def initialize: ( + financial_account_token: String, + ?nickname: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + financial_account_token: String, + nickname: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/financial_account_update_status_params.rbs b/sig/lithic/models/financial_account_update_status_params.rbs new file mode 100644 index 00000000..173200fc --- /dev/null +++ b/sig/lithic/models/financial_account_update_status_params.rbs @@ -0,0 +1,77 @@ +module Lithic + module Models + type financial_account_update_status_params = + { + financial_account_token: String, + status: Lithic::Models::FinancialAccountUpdateStatusParams::status, + substatus: Lithic::Models::FinancialAccountUpdateStatusParams::substatus?, + user_defined_status: String + } + & Lithic::Internal::Type::request_parameters + + class FinancialAccountUpdateStatusParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor financial_account_token: String + + attr_accessor status: Lithic::Models::FinancialAccountUpdateStatusParams::status + + attr_accessor substatus: Lithic::Models::FinancialAccountUpdateStatusParams::substatus? + + attr_reader user_defined_status: String? + + def user_defined_status=: (String) -> String + + def initialize: ( + financial_account_token: String, + status: Lithic::Models::FinancialAccountUpdateStatusParams::status, + substatus: Lithic::Models::FinancialAccountUpdateStatusParams::substatus?, + ?user_defined_status: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + financial_account_token: String, + status: Lithic::Models::FinancialAccountUpdateStatusParams::status, + substatus: Lithic::Models::FinancialAccountUpdateStatusParams::substatus?, + user_defined_status: String, + request_options: Lithic::RequestOptions + } + + type status = :OPEN | :CLOSED | :SUSPENDED | :PENDING + + module Status + extend Lithic::Internal::Type::Enum + + OPEN: :OPEN + CLOSED: :CLOSED + SUSPENDED: :SUSPENDED + PENDING: :PENDING + + def self?.values: -> ::Array[Lithic::Models::FinancialAccountUpdateStatusParams::status] + end + + type substatus = + :CHARGED_OFF_FRAUD + | :END_USER_REQUEST + | :BANK_REQUEST + | :CHARGED_OFF_DELINQUENT + | :INTEREST_AND_FEES_PAUSED + | :DELINQUENT + + module Substatus + extend Lithic::Internal::Type::Enum + + CHARGED_OFF_FRAUD: :CHARGED_OFF_FRAUD + END_USER_REQUEST: :END_USER_REQUEST + BANK_REQUEST: :BANK_REQUEST + CHARGED_OFF_DELINQUENT: :CHARGED_OFF_DELINQUENT + INTEREST_AND_FEES_PAUSED: :INTEREST_AND_FEES_PAUSED + DELINQUENT: :DELINQUENT + + def self?.values: -> ::Array[Lithic::Models::FinancialAccountUpdateStatusParams::substatus] + end + end + end +end diff --git a/sig/lithic/models/financial_account_updated_webhook_event.rbs b/sig/lithic/models/financial_account_updated_webhook_event.rbs new file mode 100644 index 00000000..acee43b0 --- /dev/null +++ b/sig/lithic/models/financial_account_updated_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type financial_account_updated_webhook_event = + { event_type: :"financial_account.updated" } + + class FinancialAccountUpdatedWebhookEvent < Lithic::Models::FinancialAccount + def event_type: -> :"financial_account.updated" + + def event_type=: ( + :"financial_account.updated" _ + ) -> :"financial_account.updated" + + def initialize: (?event_type: :"financial_account.updated") -> void + + def to_hash: -> { event_type: :"financial_account.updated" } + end + end +end diff --git a/sig/lithic/models/financial_accounts/balance_list_params.rbs b/sig/lithic/models/financial_accounts/balance_list_params.rbs new file mode 100644 index 00000000..c90f8648 --- /dev/null +++ b/sig/lithic/models/financial_accounts/balance_list_params.rbs @@ -0,0 +1,42 @@ +module Lithic + module Models + module FinancialAccounts + type balance_list_params = + { + financial_account_token: String, + balance_date: Time, + last_transaction_event_token: String + } + & Lithic::Internal::Type::request_parameters + + class BalanceListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor financial_account_token: String + + attr_reader balance_date: Time? + + def balance_date=: (Time) -> Time + + attr_reader last_transaction_event_token: String? + + def last_transaction_event_token=: (String) -> String + + def initialize: ( + financial_account_token: String, + ?balance_date: Time, + ?last_transaction_event_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + financial_account_token: String, + balance_date: Time, + last_transaction_event_token: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/category_balances.rbs b/sig/lithic/models/financial_accounts/category_balances.rbs new file mode 100644 index 00000000..93502748 --- /dev/null +++ b/sig/lithic/models/financial_accounts/category_balances.rbs @@ -0,0 +1,24 @@ +module Lithic + module Models + module FinancialAccounts + type category_balances = + { fees: Integer, interest: Integer, principal: Integer } + + class CategoryBalances < Lithic::Internal::Type::BaseModel + attr_accessor fees: Integer + + attr_accessor interest: Integer + + attr_accessor principal: Integer + + def initialize: ( + fees: Integer, + interest: Integer, + principal: Integer + ) -> void + + def to_hash: -> { fees: Integer, interest: Integer, principal: Integer } + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/category_tier.rbs b/sig/lithic/models/financial_accounts/category_tier.rbs new file mode 100644 index 00000000..cecc18f2 --- /dev/null +++ b/sig/lithic/models/financial_accounts/category_tier.rbs @@ -0,0 +1,21 @@ +module Lithic + module Models + module FinancialAccounts + type category_tier = { cap_rate: String, rate: String } + + class CategoryTier < Lithic::Internal::Type::BaseModel + attr_reader cap_rate: String? + + def cap_rate=: (String) -> String + + attr_reader rate: String? + + def rate=: (String) -> String + + def initialize: (?cap_rate: String, ?rate: String) -> void + + def to_hash: -> { cap_rate: String, rate: String } + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/credit_configuration_retrieve_params.rbs b/sig/lithic/models/financial_accounts/credit_configuration_retrieve_params.rbs new file mode 100644 index 00000000..5906415b --- /dev/null +++ b/sig/lithic/models/financial_accounts/credit_configuration_retrieve_params.rbs @@ -0,0 +1,26 @@ +module Lithic + module Models + module FinancialAccounts + type credit_configuration_retrieve_params = + { financial_account_token: String } + & Lithic::Internal::Type::request_parameters + + class CreditConfigurationRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor financial_account_token: String + + def initialize: ( + financial_account_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + financial_account_token: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/credit_configuration_update_params.rbs b/sig/lithic/models/financial_accounts/credit_configuration_update_params.rbs new file mode 100644 index 00000000..cb1dfa08 --- /dev/null +++ b/sig/lithic/models/financial_accounts/credit_configuration_update_params.rbs @@ -0,0 +1,77 @@ +module Lithic + module Models + module FinancialAccounts + type credit_configuration_update_params = + { + financial_account_token: String, + auto_collection_configuration: Lithic::FinancialAccounts::CreditConfigurationUpdateParams::AutoCollectionConfiguration, + credit_limit: Integer, + credit_product_token: String, + external_bank_account_token: String, + tier: String + } + & Lithic::Internal::Type::request_parameters + + class CreditConfigurationUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor financial_account_token: String + + attr_reader auto_collection_configuration: Lithic::FinancialAccounts::CreditConfigurationUpdateParams::AutoCollectionConfiguration? + + def auto_collection_configuration=: ( + Lithic::FinancialAccounts::CreditConfigurationUpdateParams::AutoCollectionConfiguration + ) -> Lithic::FinancialAccounts::CreditConfigurationUpdateParams::AutoCollectionConfiguration + + attr_reader credit_limit: Integer? + + def credit_limit=: (Integer) -> Integer + + attr_reader credit_product_token: String? + + def credit_product_token=: (String) -> String + + attr_reader external_bank_account_token: String? + + def external_bank_account_token=: (String) -> String + + attr_reader tier: String? + + def tier=: (String) -> String + + def initialize: ( + financial_account_token: String, + ?auto_collection_configuration: Lithic::FinancialAccounts::CreditConfigurationUpdateParams::AutoCollectionConfiguration, + ?credit_limit: Integer, + ?credit_product_token: String, + ?external_bank_account_token: String, + ?tier: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + financial_account_token: String, + auto_collection_configuration: Lithic::FinancialAccounts::CreditConfigurationUpdateParams::AutoCollectionConfiguration, + credit_limit: Integer, + credit_product_token: String, + external_bank_account_token: String, + tier: String, + request_options: Lithic::RequestOptions + } + + type auto_collection_configuration = { auto_collection_enabled: bool } + + class AutoCollectionConfiguration < Lithic::Internal::Type::BaseModel + attr_reader auto_collection_enabled: bool? + + def auto_collection_enabled=: (bool) -> bool + + def initialize: (?auto_collection_enabled: bool) -> void + + def to_hash: -> { auto_collection_enabled: bool } + end + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/financial_account_credit_config.rbs b/sig/lithic/models/financial_accounts/financial_account_credit_config.rbs new file mode 100644 index 00000000..d5c6572f --- /dev/null +++ b/sig/lithic/models/financial_accounts/financial_account_credit_config.rbs @@ -0,0 +1,59 @@ +module Lithic + module Models + class FinancialAccountCreditConfig = FinancialAccounts::FinancialAccountCreditConfig + + module FinancialAccounts + type financial_account_credit_config = + { + account_token: String, + auto_collection_configuration: Lithic::FinancialAccounts::FinancialAccountCreditConfig::AutoCollectionConfiguration, + credit_limit: Integer?, + credit_product_token: String?, + external_bank_account_token: String?, + tier: String? + } + + class FinancialAccountCreditConfig < Lithic::Internal::Type::BaseModel + attr_accessor account_token: String + + attr_accessor auto_collection_configuration: Lithic::FinancialAccounts::FinancialAccountCreditConfig::AutoCollectionConfiguration + + attr_accessor credit_limit: Integer? + + attr_accessor credit_product_token: String? + + attr_accessor external_bank_account_token: String? + + attr_accessor tier: String? + + def initialize: ( + account_token: String, + auto_collection_configuration: Lithic::FinancialAccounts::FinancialAccountCreditConfig::AutoCollectionConfiguration, + credit_limit: Integer?, + credit_product_token: String?, + external_bank_account_token: String?, + tier: String? + ) -> void + + def to_hash: -> { + account_token: String, + auto_collection_configuration: Lithic::FinancialAccounts::FinancialAccountCreditConfig::AutoCollectionConfiguration, + credit_limit: Integer?, + credit_product_token: String?, + external_bank_account_token: String?, + tier: String? + } + + type auto_collection_configuration = { auto_collection_enabled: bool } + + class AutoCollectionConfiguration < Lithic::Internal::Type::BaseModel + attr_accessor auto_collection_enabled: bool + + def initialize: (auto_collection_enabled: bool) -> void + + def to_hash: -> { auto_collection_enabled: bool } + end + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/financial_transaction_list_params.rbs b/sig/lithic/models/financial_accounts/financial_transaction_list_params.rbs new file mode 100644 index 00000000..ccca5115 --- /dev/null +++ b/sig/lithic/models/financial_accounts/financial_transaction_list_params.rbs @@ -0,0 +1,123 @@ +module Lithic + module Models + module FinancialAccounts + type financial_transaction_list_params = + { + financial_account_token: String, + begin_: Time, + category: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::category, + end_: Time, + ending_before: String, + result: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::result, + starting_after: String, + status: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::status + } + & Lithic::Internal::Type::request_parameters + + class FinancialTransactionListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor financial_account_token: String + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader category: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::category? + + def category=: ( + Lithic::Models::FinancialAccounts::FinancialTransactionListParams::category + ) -> Lithic::Models::FinancialAccounts::FinancialTransactionListParams::category + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader result: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::result? + + def result=: ( + Lithic::Models::FinancialAccounts::FinancialTransactionListParams::result + ) -> Lithic::Models::FinancialAccounts::FinancialTransactionListParams::result + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader status: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::status? + + def status=: ( + Lithic::Models::FinancialAccounts::FinancialTransactionListParams::status + ) -> Lithic::Models::FinancialAccounts::FinancialTransactionListParams::status + + def initialize: ( + financial_account_token: String, + ?begin_: Time, + ?category: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::category, + ?end_: Time, + ?ending_before: String, + ?result: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::result, + ?starting_after: String, + ?status: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::status, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + financial_account_token: String, + begin_: Time, + category: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::category, + end_: Time, + ending_before: String, + result: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::result, + starting_after: String, + status: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::status, + request_options: Lithic::RequestOptions + } + + type category = :ACH | :CARD | :INTERNAL | :TRANSFER + + module Category + extend Lithic::Internal::Type::Enum + + ACH: :ACH + CARD: :CARD + INTERNAL: :INTERNAL + TRANSFER: :TRANSFER + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::FinancialTransactionListParams::category] + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::FinancialTransactionListParams::result] + end + + type status = + :DECLINED | :EXPIRED | :PENDING | :RETURNED | :SETTLED | :VOIDED + + module Status + extend Lithic::Internal::Type::Enum + + DECLINED: :DECLINED + EXPIRED: :EXPIRED + PENDING: :PENDING + RETURNED: :RETURNED + SETTLED: :SETTLED + VOIDED: :VOIDED + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::FinancialTransactionListParams::status] + end + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/financial_transaction_retrieve_params.rbs b/sig/lithic/models/financial_accounts/financial_transaction_retrieve_params.rbs new file mode 100644 index 00000000..d870ae4f --- /dev/null +++ b/sig/lithic/models/financial_accounts/financial_transaction_retrieve_params.rbs @@ -0,0 +1,30 @@ +module Lithic + module Models + module FinancialAccounts + type financial_transaction_retrieve_params = + { financial_account_token: String, financial_transaction_token: String } + & Lithic::Internal::Type::request_parameters + + class FinancialTransactionRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor financial_account_token: String + + attr_accessor financial_transaction_token: String + + def initialize: ( + financial_account_token: String, + financial_transaction_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + financial_account_token: String, + financial_transaction_token: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/interest_tier_schedule.rbs b/sig/lithic/models/financial_accounts/interest_tier_schedule.rbs new file mode 100644 index 00000000..3e411bd2 --- /dev/null +++ b/sig/lithic/models/financial_accounts/interest_tier_schedule.rbs @@ -0,0 +1,48 @@ +module Lithic + module Models + module FinancialAccounts + type financial_accounts_interest_tier_schedule = + { + credit_product_token: String, + effective_date: Date, + penalty_rates: top, + tier_name: String, + tier_rates: top + } + + class FinancialAccountsInterestTierSchedule < Lithic::Internal::Type::BaseModel + attr_accessor credit_product_token: String + + attr_accessor effective_date: Date + + attr_reader penalty_rates: top? + + def penalty_rates=: (top) -> top + + attr_reader tier_name: String? + + def tier_name=: (String) -> String + + attr_reader tier_rates: top? + + def tier_rates=: (top) -> top + + def initialize: ( + credit_product_token: String, + effective_date: Date, + ?penalty_rates: top, + ?tier_name: String, + ?tier_rates: top + ) -> void + + def to_hash: -> { + credit_product_token: String, + effective_date: Date, + penalty_rates: top, + tier_name: String, + tier_rates: top + } + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/interest_tier_schedule_create_params.rbs b/sig/lithic/models/financial_accounts/interest_tier_schedule_create_params.rbs new file mode 100644 index 00000000..8ec9860b --- /dev/null +++ b/sig/lithic/models/financial_accounts/interest_tier_schedule_create_params.rbs @@ -0,0 +1,28 @@ +module Lithic + module Models + module FinancialAccounts + type interest_tier_schedule_create_params = + { financial_account_token: String } + & Lithic::Internal::Type::request_parameters + + class InterestTierScheduleCreateParams < Lithic::Models::FinancialAccounts::FinancialAccountsInterestTierSchedule + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + def financial_account_token: -> String + + def financial_account_token=: (String _) -> String + + def initialize: ( + financial_account_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + financial_account_token: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/interest_tier_schedule_delete_params.rbs b/sig/lithic/models/financial_accounts/interest_tier_schedule_delete_params.rbs new file mode 100644 index 00000000..e7639b23 --- /dev/null +++ b/sig/lithic/models/financial_accounts/interest_tier_schedule_delete_params.rbs @@ -0,0 +1,30 @@ +module Lithic + module Models + module FinancialAccounts + type interest_tier_schedule_delete_params = + { financial_account_token: String, effective_date: Date } + & Lithic::Internal::Type::request_parameters + + class InterestTierScheduleDeleteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor financial_account_token: String + + attr_accessor effective_date: Date + + def initialize: ( + financial_account_token: String, + effective_date: Date, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + financial_account_token: String, + effective_date: Date, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/interest_tier_schedule_list_params.rbs b/sig/lithic/models/financial_accounts/interest_tier_schedule_list_params.rbs new file mode 100644 index 00000000..42787db8 --- /dev/null +++ b/sig/lithic/models/financial_accounts/interest_tier_schedule_list_params.rbs @@ -0,0 +1,49 @@ +module Lithic + module Models + module FinancialAccounts + type interest_tier_schedule_list_params = + { + financial_account_token: String, + after_date: Date, + before_date: Date, + for_date: Date + } + & Lithic::Internal::Type::request_parameters + + class InterestTierScheduleListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor financial_account_token: String + + attr_reader after_date: Date? + + def after_date=: (Date) -> Date + + attr_reader before_date: Date? + + def before_date=: (Date) -> Date + + attr_reader for_date: Date? + + def for_date=: (Date) -> Date + + def initialize: ( + financial_account_token: String, + ?after_date: Date, + ?before_date: Date, + ?for_date: Date, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + financial_account_token: String, + after_date: Date, + before_date: Date, + for_date: Date, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/interest_tier_schedule_retrieve_params.rbs b/sig/lithic/models/financial_accounts/interest_tier_schedule_retrieve_params.rbs new file mode 100644 index 00000000..631c587d --- /dev/null +++ b/sig/lithic/models/financial_accounts/interest_tier_schedule_retrieve_params.rbs @@ -0,0 +1,30 @@ +module Lithic + module Models + module FinancialAccounts + type interest_tier_schedule_retrieve_params = + { financial_account_token: String, effective_date: Date } + & Lithic::Internal::Type::request_parameters + + class InterestTierScheduleRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor financial_account_token: String + + attr_accessor effective_date: Date + + def initialize: ( + financial_account_token: String, + effective_date: Date, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + financial_account_token: String, + effective_date: Date, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/interest_tier_schedule_update_params.rbs b/sig/lithic/models/financial_accounts/interest_tier_schedule_update_params.rbs new file mode 100644 index 00000000..5eb62670 --- /dev/null +++ b/sig/lithic/models/financial_accounts/interest_tier_schedule_update_params.rbs @@ -0,0 +1,54 @@ +module Lithic + module Models + module FinancialAccounts + type interest_tier_schedule_update_params = + { + financial_account_token: String, + effective_date: Date, + penalty_rates: top, + tier_name: String, + tier_rates: top + } + & Lithic::Internal::Type::request_parameters + + class InterestTierScheduleUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor financial_account_token: String + + attr_accessor effective_date: Date + + attr_reader penalty_rates: top? + + def penalty_rates=: (top) -> top + + attr_reader tier_name: String? + + def tier_name=: (String) -> String + + attr_reader tier_rates: top? + + def tier_rates=: (top) -> top + + def initialize: ( + financial_account_token: String, + effective_date: Date, + ?penalty_rates: top, + ?tier_name: String, + ?tier_rates: top, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + financial_account_token: String, + effective_date: Date, + penalty_rates: top, + tier_name: String, + tier_rates: top, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/loan_tape.rbs b/sig/lithic/models/financial_accounts/loan_tape.rbs new file mode 100644 index 00000000..c008dff6 --- /dev/null +++ b/sig/lithic/models/financial_accounts/loan_tape.rbs @@ -0,0 +1,409 @@ +module Lithic + module Models + module FinancialAccounts + type loan_tape = + { + token: String, + account_standing: Lithic::FinancialAccounts::LoanTape::AccountStanding, + available_credit: Integer, + balances: Lithic::FinancialAccounts::LoanTape::Balances, + created: Time, + credit_limit: Integer, + credit_product_token: String, + date: Date, + day_totals: Lithic::StatementTotals, + ending_balance: Integer, + excess_credits: Integer, + financial_account_token: String, + interest_details: Lithic::FinancialAccounts::LoanTape::InterestDetails?, + minimum_payment_balance: Lithic::FinancialAccounts::LoanTape::MinimumPaymentBalance, + payment_allocation: Lithic::FinancialAccounts::LoanTape::PaymentAllocation, + period_totals: Lithic::StatementTotals, + previous_statement_balance: Lithic::FinancialAccounts::LoanTape::PreviousStatementBalance, + starting_balance: Integer, + updated: Time, + version: Integer, + ytd_totals: Lithic::StatementTotals, + day_of_period: Integer?, + tier: String? + } + + class LoanTape < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor account_standing: Lithic::FinancialAccounts::LoanTape::AccountStanding + + attr_accessor available_credit: Integer + + attr_accessor balances: Lithic::FinancialAccounts::LoanTape::Balances + + attr_accessor created: Time + + attr_accessor credit_limit: Integer + + attr_accessor credit_product_token: String + + attr_accessor date: Date + + attr_accessor day_totals: Lithic::StatementTotals + + attr_accessor ending_balance: Integer + + attr_accessor excess_credits: Integer + + attr_accessor financial_account_token: String + + attr_accessor interest_details: Lithic::FinancialAccounts::LoanTape::InterestDetails? + + attr_accessor minimum_payment_balance: Lithic::FinancialAccounts::LoanTape::MinimumPaymentBalance + + attr_accessor payment_allocation: Lithic::FinancialAccounts::LoanTape::PaymentAllocation + + attr_accessor period_totals: Lithic::StatementTotals + + attr_accessor previous_statement_balance: Lithic::FinancialAccounts::LoanTape::PreviousStatementBalance + + attr_accessor starting_balance: Integer + + attr_accessor updated: Time + + attr_accessor version: Integer + + attr_accessor ytd_totals: Lithic::StatementTotals + + attr_accessor day_of_period: Integer? + + attr_accessor tier: String? + + def initialize: ( + token: String, + account_standing: Lithic::FinancialAccounts::LoanTape::AccountStanding, + available_credit: Integer, + balances: Lithic::FinancialAccounts::LoanTape::Balances, + created: Time, + credit_limit: Integer, + credit_product_token: String, + date: Date, + day_totals: Lithic::StatementTotals, + ending_balance: Integer, + excess_credits: Integer, + financial_account_token: String, + interest_details: Lithic::FinancialAccounts::LoanTape::InterestDetails?, + minimum_payment_balance: Lithic::FinancialAccounts::LoanTape::MinimumPaymentBalance, + payment_allocation: Lithic::FinancialAccounts::LoanTape::PaymentAllocation, + period_totals: Lithic::StatementTotals, + previous_statement_balance: Lithic::FinancialAccounts::LoanTape::PreviousStatementBalance, + starting_balance: Integer, + updated: Time, + version: Integer, + ytd_totals: Lithic::StatementTotals, + ?day_of_period: Integer?, + ?tier: String? + ) -> void + + def to_hash: -> { + token: String, + account_standing: Lithic::FinancialAccounts::LoanTape::AccountStanding, + available_credit: Integer, + balances: Lithic::FinancialAccounts::LoanTape::Balances, + created: Time, + credit_limit: Integer, + credit_product_token: String, + date: Date, + day_totals: Lithic::StatementTotals, + ending_balance: Integer, + excess_credits: Integer, + financial_account_token: String, + interest_details: Lithic::FinancialAccounts::LoanTape::InterestDetails?, + minimum_payment_balance: Lithic::FinancialAccounts::LoanTape::MinimumPaymentBalance, + payment_allocation: Lithic::FinancialAccounts::LoanTape::PaymentAllocation, + period_totals: Lithic::StatementTotals, + previous_statement_balance: Lithic::FinancialAccounts::LoanTape::PreviousStatementBalance, + starting_balance: Integer, + updated: Time, + version: Integer, + ytd_totals: Lithic::StatementTotals, + day_of_period: Integer?, + tier: String? + } + + type account_standing = + { + consecutive_full_payments_made: Integer, + consecutive_minimum_payments_made: Integer, + consecutive_minimum_payments_missed: Integer, + days_past_due: Integer, + financial_account_state: Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState, + has_grace: bool, + period_number: Integer, + period_state: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::period_state + } + + class AccountStanding < Lithic::Internal::Type::BaseModel + attr_accessor consecutive_full_payments_made: Integer + + attr_accessor consecutive_minimum_payments_made: Integer + + attr_accessor consecutive_minimum_payments_missed: Integer + + attr_accessor days_past_due: Integer + + attr_accessor financial_account_state: Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState + + attr_accessor has_grace: bool + + attr_accessor period_number: Integer + + attr_accessor period_state: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::period_state + + def initialize: ( + consecutive_full_payments_made: Integer, + consecutive_minimum_payments_made: Integer, + consecutive_minimum_payments_missed: Integer, + days_past_due: Integer, + financial_account_state: Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState, + has_grace: bool, + period_number: Integer, + period_state: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::period_state + ) -> void + + def to_hash: -> { + consecutive_full_payments_made: Integer, + consecutive_minimum_payments_made: Integer, + consecutive_minimum_payments_missed: Integer, + days_past_due: Integer, + financial_account_state: Lithic::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState, + has_grace: bool, + period_number: Integer, + period_state: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::period_state + } + + type financial_account_state = + { + status: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::status, + substatus: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::substatus? + } + + class FinancialAccountState < Lithic::Internal::Type::BaseModel + attr_accessor status: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::status + + attr_accessor substatus: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::substatus? + + def initialize: ( + status: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::status, + ?substatus: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::substatus? + ) -> void + + def to_hash: -> { + status: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::status, + substatus: Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::substatus? + } + + type status = :OPEN | :CLOSED | :SUSPENDED | :PENDING + + module Status + extend Lithic::Internal::Type::Enum + + OPEN: :OPEN + CLOSED: :CLOSED + SUSPENDED: :SUSPENDED + PENDING: :PENDING + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::status] + end + + type substatus = + :CHARGED_OFF_DELINQUENT + | :CHARGED_OFF_FRAUD + | :END_USER_REQUEST + | :BANK_REQUEST + | :DELINQUENT + | :INTEREST_AND_FEES_PAUSED + + module Substatus + extend Lithic::Internal::Type::Enum + + CHARGED_OFF_DELINQUENT: :CHARGED_OFF_DELINQUENT + CHARGED_OFF_FRAUD: :CHARGED_OFF_FRAUD + END_USER_REQUEST: :END_USER_REQUEST + BANK_REQUEST: :BANK_REQUEST + DELINQUENT: :DELINQUENT + INTEREST_AND_FEES_PAUSED: :INTEREST_AND_FEES_PAUSED + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::FinancialAccountState::substatus] + end + end + + type period_state = :STANDARD | :PROMO | :PENALTY + + module PeriodState + extend Lithic::Internal::Type::Enum + + STANDARD: :STANDARD + PROMO: :PROMO + PENALTY: :PENALTY + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::LoanTape::AccountStanding::period_state] + end + end + + type balances = + { + due: Lithic::FinancialAccounts::CategoryBalances, + next_statement_due: Lithic::FinancialAccounts::CategoryBalances, + past_due: Lithic::FinancialAccounts::CategoryBalances, + past_statements_due: Lithic::FinancialAccounts::CategoryBalances + } + + class Balances < Lithic::Internal::Type::BaseModel + attr_accessor due: Lithic::FinancialAccounts::CategoryBalances + + attr_accessor next_statement_due: Lithic::FinancialAccounts::CategoryBalances + + attr_accessor past_due: Lithic::FinancialAccounts::CategoryBalances + + attr_accessor past_statements_due: Lithic::FinancialAccounts::CategoryBalances + + def initialize: ( + due: Lithic::FinancialAccounts::CategoryBalances, + next_statement_due: Lithic::FinancialAccounts::CategoryBalances, + past_due: Lithic::FinancialAccounts::CategoryBalances, + past_statements_due: Lithic::FinancialAccounts::CategoryBalances + ) -> void + + def to_hash: -> { + due: Lithic::FinancialAccounts::CategoryBalances, + next_statement_due: Lithic::FinancialAccounts::CategoryBalances, + past_due: Lithic::FinancialAccounts::CategoryBalances, + past_statements_due: Lithic::FinancialAccounts::CategoryBalances + } + end + + type interest_details = + { + actual_interest_charged: Integer?, + daily_balance_amounts: Lithic::CategoryDetails, + effective_apr: Lithic::CategoryDetails, + interest_calculation_method: Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::interest_calculation_method, + interest_for_period: Lithic::CategoryDetails, + prime_rate: String?, + minimum_interest_charged: Integer? + } + + class InterestDetails < Lithic::Internal::Type::BaseModel + attr_accessor actual_interest_charged: Integer? + + attr_accessor daily_balance_amounts: Lithic::CategoryDetails + + attr_accessor effective_apr: Lithic::CategoryDetails + + attr_accessor interest_calculation_method: Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::interest_calculation_method + + attr_accessor interest_for_period: Lithic::CategoryDetails + + attr_accessor prime_rate: String? + + attr_accessor minimum_interest_charged: Integer? + + def initialize: ( + actual_interest_charged: Integer?, + daily_balance_amounts: Lithic::CategoryDetails, + effective_apr: Lithic::CategoryDetails, + interest_calculation_method: Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::interest_calculation_method, + interest_for_period: Lithic::CategoryDetails, + prime_rate: String?, + ?minimum_interest_charged: Integer? + ) -> void + + def to_hash: -> { + actual_interest_charged: Integer?, + daily_balance_amounts: Lithic::CategoryDetails, + effective_apr: Lithic::CategoryDetails, + interest_calculation_method: Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::interest_calculation_method, + interest_for_period: Lithic::CategoryDetails, + prime_rate: String?, + minimum_interest_charged: Integer? + } + + type interest_calculation_method = :DAILY | :AVERAGE_DAILY + + module InterestCalculationMethod + extend Lithic::Internal::Type::Enum + + DAILY: :DAILY + AVERAGE_DAILY: :AVERAGE_DAILY + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::LoanTape::InterestDetails::interest_calculation_method] + end + end + + type minimum_payment_balance = { amount: Integer, remaining: Integer } + + class MinimumPaymentBalance < Lithic::Internal::Type::BaseModel + attr_accessor amount: Integer + + attr_accessor remaining: Integer + + def initialize: (amount: Integer, remaining: Integer) -> void + + def to_hash: -> { amount: Integer, remaining: Integer } + end + + type payment_allocation = + { + fee_details: Lithic::CategoryDetails?, + fees: Integer, + interest: Integer, + interest_details: Lithic::CategoryDetails?, + principal: Integer, + principal_details: Lithic::CategoryDetails? + } + + class PaymentAllocation < Lithic::Internal::Type::BaseModel + attr_accessor fee_details: Lithic::CategoryDetails? + + attr_accessor fees: Integer + + attr_accessor interest: Integer + + attr_accessor interest_details: Lithic::CategoryDetails? + + attr_accessor principal: Integer + + attr_accessor principal_details: Lithic::CategoryDetails? + + def initialize: ( + fee_details: Lithic::CategoryDetails?, + fees: Integer, + interest: Integer, + interest_details: Lithic::CategoryDetails?, + principal: Integer, + principal_details: Lithic::CategoryDetails? + ) -> void + + def to_hash: -> { + fee_details: Lithic::CategoryDetails?, + fees: Integer, + interest: Integer, + interest_details: Lithic::CategoryDetails?, + principal: Integer, + principal_details: Lithic::CategoryDetails? + } + end + + type previous_statement_balance = + { amount: Integer, remaining: Integer } + + class PreviousStatementBalance < Lithic::Internal::Type::BaseModel + attr_accessor amount: Integer + + attr_accessor remaining: Integer + + def initialize: (amount: Integer, remaining: Integer) -> void + + def to_hash: -> { amount: Integer, remaining: Integer } + end + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/loan_tape_configuration.rbs b/sig/lithic/models/financial_accounts/loan_tape_configuration.rbs new file mode 100644 index 00000000..e4e1b871 --- /dev/null +++ b/sig/lithic/models/financial_accounts/loan_tape_configuration.rbs @@ -0,0 +1,60 @@ +module Lithic + module Models + module FinancialAccounts + type financial_accounts_loan_tape_configuration = + { + created_at: Time, + financial_account_token: String, + instance_token: String, + updated_at: Time, + credit_product_token: String, + loan_tape_rebuild_configuration: Lithic::FinancialAccounts::LoanTapeRebuildConfiguration, + tier_schedule_changed_at: Time + } + + class FinancialAccountsLoanTapeConfiguration < Lithic::Internal::Type::BaseModel + attr_accessor created_at: Time + + attr_accessor financial_account_token: String + + attr_accessor instance_token: String + + attr_accessor updated_at: Time + + attr_reader credit_product_token: String? + + def credit_product_token=: (String) -> String + + attr_reader loan_tape_rebuild_configuration: Lithic::FinancialAccounts::LoanTapeRebuildConfiguration? + + def loan_tape_rebuild_configuration=: ( + Lithic::FinancialAccounts::LoanTapeRebuildConfiguration + ) -> Lithic::FinancialAccounts::LoanTapeRebuildConfiguration + + attr_reader tier_schedule_changed_at: Time? + + def tier_schedule_changed_at=: (Time) -> Time + + def initialize: ( + created_at: Time, + financial_account_token: String, + instance_token: String, + updated_at: Time, + ?credit_product_token: String, + ?loan_tape_rebuild_configuration: Lithic::FinancialAccounts::LoanTapeRebuildConfiguration, + ?tier_schedule_changed_at: Time + ) -> void + + def to_hash: -> { + created_at: Time, + financial_account_token: String, + instance_token: String, + updated_at: Time, + credit_product_token: String, + loan_tape_rebuild_configuration: Lithic::FinancialAccounts::LoanTapeRebuildConfiguration, + tier_schedule_changed_at: Time + } + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/loan_tape_configuration_retrieve_params.rbs b/sig/lithic/models/financial_accounts/loan_tape_configuration_retrieve_params.rbs new file mode 100644 index 00000000..c332bb65 --- /dev/null +++ b/sig/lithic/models/financial_accounts/loan_tape_configuration_retrieve_params.rbs @@ -0,0 +1,26 @@ +module Lithic + module Models + module FinancialAccounts + type loan_tape_configuration_retrieve_params = + { financial_account_token: String } + & Lithic::Internal::Type::request_parameters + + class LoanTapeConfigurationRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor financial_account_token: String + + def initialize: ( + financial_account_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + financial_account_token: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/loan_tape_list_params.rbs b/sig/lithic/models/financial_accounts/loan_tape_list_params.rbs new file mode 100644 index 00000000..b3929596 --- /dev/null +++ b/sig/lithic/models/financial_accounts/loan_tape_list_params.rbs @@ -0,0 +1,63 @@ +module Lithic + module Models + module FinancialAccounts + type loan_tape_list_params = + { + financial_account_token: String, + begin_: Date, + end_: Date, + ending_before: String, + page_size: Integer, + starting_after: String + } + & Lithic::Internal::Type::request_parameters + + class LoanTapeListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor financial_account_token: String + + attr_reader begin_: Date? + + def begin_=: (Date) -> Date + + attr_reader end_: Date? + + def end_=: (Date) -> Date + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + financial_account_token: String, + ?begin_: Date, + ?end_: Date, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + financial_account_token: String, + begin_: Date, + end_: Date, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/loan_tape_rebuild_configuration.rbs b/sig/lithic/models/financial_accounts/loan_tape_rebuild_configuration.rbs new file mode 100644 index 00000000..defdf24f --- /dev/null +++ b/sig/lithic/models/financial_accounts/loan_tape_rebuild_configuration.rbs @@ -0,0 +1,32 @@ +module Lithic + module Models + module FinancialAccounts + type loan_tape_rebuild_configuration = + { rebuild_needed: bool, last_rebuild: Date, rebuild_from: Date } + + class LoanTapeRebuildConfiguration < Lithic::Internal::Type::BaseModel + attr_accessor rebuild_needed: bool + + attr_reader last_rebuild: Date? + + def last_rebuild=: (Date) -> Date + + attr_reader rebuild_from: Date? + + def rebuild_from=: (Date) -> Date + + def initialize: ( + rebuild_needed: bool, + ?last_rebuild: Date, + ?rebuild_from: Date + ) -> void + + def to_hash: -> { + rebuild_needed: bool, + last_rebuild: Date, + rebuild_from: Date + } + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/loan_tape_retrieve_params.rbs b/sig/lithic/models/financial_accounts/loan_tape_retrieve_params.rbs new file mode 100644 index 00000000..f6a3e993 --- /dev/null +++ b/sig/lithic/models/financial_accounts/loan_tape_retrieve_params.rbs @@ -0,0 +1,30 @@ +module Lithic + module Models + module FinancialAccounts + type loan_tape_retrieve_params = + { financial_account_token: String, loan_tape_token: String } + & Lithic::Internal::Type::request_parameters + + class LoanTapeRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor financial_account_token: String + + attr_accessor loan_tape_token: String + + def initialize: ( + financial_account_token: String, + loan_tape_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + financial_account_token: String, + loan_tape_token: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/statement.rbs b/sig/lithic/models/financial_accounts/statement.rbs new file mode 100644 index 00000000..c9376a14 --- /dev/null +++ b/sig/lithic/models/financial_accounts/statement.rbs @@ -0,0 +1,375 @@ +module Lithic + module Models + module FinancialAccounts + type statement = + { + token: String, + account_standing: Lithic::FinancialAccounts::Statement::AccountStanding, + amount_due: Lithic::FinancialAccounts::Statement::AmountDue, + available_credit: Integer, + created: Time, + credit_limit: Integer, + credit_product_token: String?, + days_in_billing_cycle: Integer, + ending_balance: Integer, + financial_account_token: String, + payment_due_date: Date?, + period_totals: Lithic::StatementTotals, + starting_balance: Integer, + statement_end_date: Date, + statement_start_date: Date, + statement_type: Lithic::Models::FinancialAccounts::Statement::statement_type, + updated: Time, + ytd_totals: Lithic::StatementTotals, + interest_details: Lithic::FinancialAccounts::Statement::InterestDetails?, + next_payment_due_date: Date?, + next_statement_end_date: Date?, + payoff_details: Lithic::FinancialAccounts::Statement::PayoffDetails?, + statement_totals: Lithic::StatementTotals + } + + class Statement < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor account_standing: Lithic::FinancialAccounts::Statement::AccountStanding + + attr_accessor amount_due: Lithic::FinancialAccounts::Statement::AmountDue + + attr_accessor available_credit: Integer + + attr_accessor created: Time + + attr_accessor credit_limit: Integer + + attr_accessor credit_product_token: String? + + attr_accessor days_in_billing_cycle: Integer + + attr_accessor ending_balance: Integer + + attr_accessor financial_account_token: String + + attr_accessor payment_due_date: Date? + + attr_accessor period_totals: Lithic::StatementTotals + + attr_accessor starting_balance: Integer + + attr_accessor statement_end_date: Date + + attr_accessor statement_start_date: Date + + attr_accessor statement_type: Lithic::Models::FinancialAccounts::Statement::statement_type + + attr_accessor updated: Time + + attr_accessor ytd_totals: Lithic::StatementTotals + + attr_accessor interest_details: Lithic::FinancialAccounts::Statement::InterestDetails? + + attr_accessor next_payment_due_date: Date? + + attr_accessor next_statement_end_date: Date? + + attr_accessor payoff_details: Lithic::FinancialAccounts::Statement::PayoffDetails? + + attr_reader statement_totals: Lithic::StatementTotals? + + def statement_totals=: ( + Lithic::StatementTotals + ) -> Lithic::StatementTotals + + def initialize: ( + token: String, + account_standing: Lithic::FinancialAccounts::Statement::AccountStanding, + amount_due: Lithic::FinancialAccounts::Statement::AmountDue, + available_credit: Integer, + created: Time, + credit_limit: Integer, + credit_product_token: String?, + days_in_billing_cycle: Integer, + ending_balance: Integer, + financial_account_token: String, + payment_due_date: Date?, + period_totals: Lithic::StatementTotals, + starting_balance: Integer, + statement_end_date: Date, + statement_start_date: Date, + statement_type: Lithic::Models::FinancialAccounts::Statement::statement_type, + updated: Time, + ytd_totals: Lithic::StatementTotals, + ?interest_details: Lithic::FinancialAccounts::Statement::InterestDetails?, + ?next_payment_due_date: Date?, + ?next_statement_end_date: Date?, + ?payoff_details: Lithic::FinancialAccounts::Statement::PayoffDetails?, + ?statement_totals: Lithic::StatementTotals + ) -> void + + def to_hash: -> { + token: String, + account_standing: Lithic::FinancialAccounts::Statement::AccountStanding, + amount_due: Lithic::FinancialAccounts::Statement::AmountDue, + available_credit: Integer, + created: Time, + credit_limit: Integer, + credit_product_token: String?, + days_in_billing_cycle: Integer, + ending_balance: Integer, + financial_account_token: String, + payment_due_date: Date?, + period_totals: Lithic::StatementTotals, + starting_balance: Integer, + statement_end_date: Date, + statement_start_date: Date, + statement_type: Lithic::Models::FinancialAccounts::Statement::statement_type, + updated: Time, + ytd_totals: Lithic::StatementTotals, + interest_details: Lithic::FinancialAccounts::Statement::InterestDetails?, + next_payment_due_date: Date?, + next_statement_end_date: Date?, + payoff_details: Lithic::FinancialAccounts::Statement::PayoffDetails?, + statement_totals: Lithic::StatementTotals + } + + type account_standing = + { + consecutive_full_payments_made: Integer, + consecutive_minimum_payments_made: Integer, + consecutive_minimum_payments_missed: Integer, + days_past_due: Integer, + financial_account_state: Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState, + has_grace: bool, + period_number: Integer, + period_state: Lithic::Models::FinancialAccounts::Statement::AccountStanding::period_state + } + + class AccountStanding < Lithic::Internal::Type::BaseModel + attr_accessor consecutive_full_payments_made: Integer + + attr_accessor consecutive_minimum_payments_made: Integer + + attr_accessor consecutive_minimum_payments_missed: Integer + + attr_accessor days_past_due: Integer + + attr_accessor financial_account_state: Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState + + attr_accessor has_grace: bool + + attr_accessor period_number: Integer + + attr_accessor period_state: Lithic::Models::FinancialAccounts::Statement::AccountStanding::period_state + + def initialize: ( + consecutive_full_payments_made: Integer, + consecutive_minimum_payments_made: Integer, + consecutive_minimum_payments_missed: Integer, + days_past_due: Integer, + financial_account_state: Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState, + has_grace: bool, + period_number: Integer, + period_state: Lithic::Models::FinancialAccounts::Statement::AccountStanding::period_state + ) -> void + + def to_hash: -> { + consecutive_full_payments_made: Integer, + consecutive_minimum_payments_made: Integer, + consecutive_minimum_payments_missed: Integer, + days_past_due: Integer, + financial_account_state: Lithic::FinancialAccounts::Statement::AccountStanding::FinancialAccountState, + has_grace: bool, + period_number: Integer, + period_state: Lithic::Models::FinancialAccounts::Statement::AccountStanding::period_state + } + + type financial_account_state = + { + status: Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::status, + substatus: Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::substatus? + } + + class FinancialAccountState < Lithic::Internal::Type::BaseModel + attr_accessor status: Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::status + + attr_accessor substatus: Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::substatus? + + def initialize: ( + status: Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::status, + ?substatus: Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::substatus? + ) -> void + + def to_hash: -> { + status: Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::status, + substatus: Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::substatus? + } + + type status = :OPEN | :CLOSED | :SUSPENDED | :PENDING + + module Status + extend Lithic::Internal::Type::Enum + + OPEN: :OPEN + CLOSED: :CLOSED + SUSPENDED: :SUSPENDED + PENDING: :PENDING + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::status] + end + + type substatus = + :CHARGED_OFF_DELINQUENT + | :CHARGED_OFF_FRAUD + | :END_USER_REQUEST + | :BANK_REQUEST + | :DELINQUENT + | :INTEREST_AND_FEES_PAUSED + + module Substatus + extend Lithic::Internal::Type::Enum + + CHARGED_OFF_DELINQUENT: :CHARGED_OFF_DELINQUENT + CHARGED_OFF_FRAUD: :CHARGED_OFF_FRAUD + END_USER_REQUEST: :END_USER_REQUEST + BANK_REQUEST: :BANK_REQUEST + DELINQUENT: :DELINQUENT + INTEREST_AND_FEES_PAUSED: :INTEREST_AND_FEES_PAUSED + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::Statement::AccountStanding::FinancialAccountState::substatus] + end + end + + type period_state = :STANDARD | :PROMO | :PENALTY + + module PeriodState + extend Lithic::Internal::Type::Enum + + STANDARD: :STANDARD + PROMO: :PROMO + PENALTY: :PENALTY + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::Statement::AccountStanding::period_state] + end + end + + type amount_due = { amount: Integer, past_due: Integer } + + class AmountDue < Lithic::Internal::Type::BaseModel + attr_accessor amount: Integer + + attr_accessor past_due: Integer + + def initialize: (amount: Integer, past_due: Integer) -> void + + def to_hash: -> { amount: Integer, past_due: Integer } + end + + type statement_type = :INITIAL | :PERIOD_END | :FINAL + + module StatementType + extend Lithic::Internal::Type::Enum + + INITIAL: :INITIAL + PERIOD_END: :PERIOD_END + FINAL: :FINAL + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::Statement::statement_type] + end + + type interest_details = + { + actual_interest_charged: Integer?, + daily_balance_amounts: Lithic::CategoryDetails, + effective_apr: Lithic::CategoryDetails, + interest_calculation_method: Lithic::Models::FinancialAccounts::Statement::InterestDetails::interest_calculation_method, + interest_for_period: Lithic::CategoryDetails, + prime_rate: String?, + minimum_interest_charged: Integer? + } + + class InterestDetails < Lithic::Internal::Type::BaseModel + attr_accessor actual_interest_charged: Integer? + + attr_accessor daily_balance_amounts: Lithic::CategoryDetails + + attr_accessor effective_apr: Lithic::CategoryDetails + + attr_accessor interest_calculation_method: Lithic::Models::FinancialAccounts::Statement::InterestDetails::interest_calculation_method + + attr_accessor interest_for_period: Lithic::CategoryDetails + + attr_accessor prime_rate: String? + + attr_accessor minimum_interest_charged: Integer? + + def initialize: ( + actual_interest_charged: Integer?, + daily_balance_amounts: Lithic::CategoryDetails, + effective_apr: Lithic::CategoryDetails, + interest_calculation_method: Lithic::Models::FinancialAccounts::Statement::InterestDetails::interest_calculation_method, + interest_for_period: Lithic::CategoryDetails, + prime_rate: String?, + ?minimum_interest_charged: Integer? + ) -> void + + def to_hash: -> { + actual_interest_charged: Integer?, + daily_balance_amounts: Lithic::CategoryDetails, + effective_apr: Lithic::CategoryDetails, + interest_calculation_method: Lithic::Models::FinancialAccounts::Statement::InterestDetails::interest_calculation_method, + interest_for_period: Lithic::CategoryDetails, + prime_rate: String?, + minimum_interest_charged: Integer? + } + + type interest_calculation_method = :DAILY | :AVERAGE_DAILY + + module InterestCalculationMethod + extend Lithic::Internal::Type::Enum + + DAILY: :DAILY + AVERAGE_DAILY: :AVERAGE_DAILY + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::Statement::InterestDetails::interest_calculation_method] + end + end + + type payoff_details = + { + minimum_payment_months: String, + minimum_payment_total: String, + payoff_period_length_months: Integer?, + payoff_period_monthly_payment_amount: Integer?, + payoff_period_payment_total: Integer? + } + + class PayoffDetails < Lithic::Internal::Type::BaseModel + attr_accessor minimum_payment_months: String + + attr_accessor minimum_payment_total: String + + attr_accessor payoff_period_length_months: Integer? + + attr_accessor payoff_period_monthly_payment_amount: Integer? + + attr_accessor payoff_period_payment_total: Integer? + + def initialize: ( + minimum_payment_months: String, + minimum_payment_total: String, + payoff_period_length_months: Integer?, + payoff_period_monthly_payment_amount: Integer?, + payoff_period_payment_total: Integer? + ) -> void + + def to_hash: -> { + minimum_payment_months: String, + minimum_payment_total: String, + payoff_period_length_months: Integer?, + payoff_period_monthly_payment_amount: Integer?, + payoff_period_payment_total: Integer? + } + end + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/statement_list_params.rbs b/sig/lithic/models/financial_accounts/statement_list_params.rbs new file mode 100644 index 00000000..4cdb77d6 --- /dev/null +++ b/sig/lithic/models/financial_accounts/statement_list_params.rbs @@ -0,0 +1,70 @@ +module Lithic + module Models + module FinancialAccounts + type statement_list_params = + { + financial_account_token: String, + begin_: Date, + end_: Date, + ending_before: String, + include_initial_statements: bool, + page_size: Integer, + starting_after: String + } + & Lithic::Internal::Type::request_parameters + + class StatementListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor financial_account_token: String + + attr_reader begin_: Date? + + def begin_=: (Date) -> Date + + attr_reader end_: Date? + + def end_=: (Date) -> Date + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader include_initial_statements: bool? + + def include_initial_statements=: (bool) -> bool + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + financial_account_token: String, + ?begin_: Date, + ?end_: Date, + ?ending_before: String, + ?include_initial_statements: bool, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + financial_account_token: String, + begin_: Date, + end_: Date, + ending_before: String, + include_initial_statements: bool, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/statement_retrieve_params.rbs b/sig/lithic/models/financial_accounts/statement_retrieve_params.rbs new file mode 100644 index 00000000..b01c22e8 --- /dev/null +++ b/sig/lithic/models/financial_accounts/statement_retrieve_params.rbs @@ -0,0 +1,30 @@ +module Lithic + module Models + module FinancialAccounts + type statement_retrieve_params = + { financial_account_token: String, statement_token: String } + & Lithic::Internal::Type::request_parameters + + class StatementRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor financial_account_token: String + + attr_accessor statement_token: String + + def initialize: ( + financial_account_token: String, + statement_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + financial_account_token: String, + statement_token: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/statements.rbs b/sig/lithic/models/financial_accounts/statements.rbs new file mode 100644 index 00000000..426ef672 --- /dev/null +++ b/sig/lithic/models/financial_accounts/statements.rbs @@ -0,0 +1,24 @@ +module Lithic + module Models + module FinancialAccounts + type financial_accounts_statements = + { data: ::Array[Lithic::FinancialAccounts::Statement], has_more: bool } + + class FinancialAccountsStatements < Lithic::Internal::Type::BaseModel + attr_accessor data: ::Array[Lithic::FinancialAccounts::Statement] + + attr_accessor has_more: bool + + def initialize: ( + data: ::Array[Lithic::FinancialAccounts::Statement], + has_more: bool + ) -> void + + def to_hash: -> { + data: ::Array[Lithic::FinancialAccounts::Statement], + has_more: bool + } + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/statements/line_item_list_params.rbs b/sig/lithic/models/financial_accounts/statements/line_item_list_params.rbs new file mode 100644 index 00000000..cba515a8 --- /dev/null +++ b/sig/lithic/models/financial_accounts/statements/line_item_list_params.rbs @@ -0,0 +1,56 @@ +module Lithic + module Models + module FinancialAccounts + module Statements + type line_item_list_params = + { + financial_account_token: String, + statement_token: String, + ending_before: String, + page_size: Integer, + starting_after: String + } + & Lithic::Internal::Type::request_parameters + + class LineItemListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor financial_account_token: String + + attr_accessor statement_token: String + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + financial_account_token: String, + statement_token: String, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + financial_account_token: String, + statement_token: String, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + end + end + end + end +end diff --git a/sig/lithic/models/financial_accounts/statements/statement_line_items.rbs b/sig/lithic/models/financial_accounts/statements/statement_line_items.rbs new file mode 100644 index 00000000..8364a3ec --- /dev/null +++ b/sig/lithic/models/financial_accounts/statements/statement_line_items.rbs @@ -0,0 +1,353 @@ +module Lithic + module Models + module FinancialAccounts + class StatementLineItems = Statements::StatementLineItems + + module Statements + type statement_line_items = + { + data: ::Array[Lithic::FinancialAccounts::Statements::StatementLineItems::Data], + has_more: bool + } + + class StatementLineItems < Lithic::Internal::Type::BaseModel + attr_accessor data: ::Array[Lithic::FinancialAccounts::Statements::StatementLineItems::Data] + + attr_accessor has_more: bool + + def initialize: ( + data: ::Array[Lithic::FinancialAccounts::Statements::StatementLineItems::Data], + has_more: bool + ) -> void + + def to_hash: -> { + data: ::Array[Lithic::FinancialAccounts::Statements::StatementLineItems::Data], + has_more: bool + } + + type data = + { + token: String, + amount: Integer, + category: Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::category, + created: Time, + currency: String, + effective_date: Date, + event_type: Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::event_type, + financial_account_token: String, + financial_transaction_event_token: String, + financial_transaction_token: String, + card_token: String?, + descriptor: String, + event_subtype: String?, + loan_tape_date: Date? + } + + class Data < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor amount: Integer + + attr_accessor category: Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::category + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor effective_date: Date + + attr_accessor event_type: Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::event_type + + attr_accessor financial_account_token: String + + attr_accessor financial_transaction_event_token: String + + attr_accessor financial_transaction_token: String + + attr_accessor card_token: String? + + attr_reader descriptor: String? + + def descriptor=: (String) -> String + + attr_accessor event_subtype: String? + + attr_accessor loan_tape_date: Date? + + def initialize: ( + token: String, + amount: Integer, + category: Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::category, + created: Time, + currency: String, + effective_date: Date, + event_type: Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::event_type, + financial_account_token: String, + financial_transaction_event_token: String, + financial_transaction_token: String, + ?card_token: String?, + ?descriptor: String, + ?event_subtype: String?, + ?loan_tape_date: Date? + ) -> void + + def to_hash: -> { + token: String, + amount: Integer, + category: Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::category, + created: Time, + currency: String, + effective_date: Date, + event_type: Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::event_type, + financial_account_token: String, + financial_transaction_event_token: String, + financial_transaction_token: String, + card_token: String?, + descriptor: String, + event_subtype: String?, + loan_tape_date: Date? + } + + type category = + :ACH + | :WIRE + | :BALANCE_OR_FUNDING + | :FEE + | :REWARD + | :ADJUSTMENT + | :DERECOGNITION + | :DISPUTE + | :CARD + | :EXTERNAL_ACH + | :EXTERNAL_CHECK + | :EXTERNAL_FEDNOW + | :EXTERNAL_RTP + | :EXTERNAL_TRANSFER + | :EXTERNAL_WIRE + | :MANAGEMENT_ADJUSTMENT + | :MANAGEMENT_DISPUTE + | :MANAGEMENT_FEE + | :MANAGEMENT_REWARD + | :MANAGEMENT_DISBURSEMENT + | :HOLD + | :PROGRAM_FUNDING + + module Category + extend Lithic::Internal::Type::Enum + + ACH: :ACH + WIRE: :WIRE + BALANCE_OR_FUNDING: :BALANCE_OR_FUNDING + FEE: :FEE + REWARD: :REWARD + ADJUSTMENT: :ADJUSTMENT + DERECOGNITION: :DERECOGNITION + DISPUTE: :DISPUTE + CARD: :CARD + EXTERNAL_ACH: :EXTERNAL_ACH + EXTERNAL_CHECK: :EXTERNAL_CHECK + EXTERNAL_FEDNOW: :EXTERNAL_FEDNOW + EXTERNAL_RTP: :EXTERNAL_RTP + EXTERNAL_TRANSFER: :EXTERNAL_TRANSFER + EXTERNAL_WIRE: :EXTERNAL_WIRE + MANAGEMENT_ADJUSTMENT: :MANAGEMENT_ADJUSTMENT + MANAGEMENT_DISPUTE: :MANAGEMENT_DISPUTE + MANAGEMENT_FEE: :MANAGEMENT_FEE + MANAGEMENT_REWARD: :MANAGEMENT_REWARD + MANAGEMENT_DISBURSEMENT: :MANAGEMENT_DISBURSEMENT + HOLD: :HOLD + PROGRAM_FUNDING: :PROGRAM_FUNDING + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::category] + end + + type event_type = + :ACH_ORIGINATION_CANCELLED + | :ACH_ORIGINATION_INITIATED + | :ACH_ORIGINATION_PROCESSED + | :ACH_ORIGINATION_RELEASED + | :ACH_ORIGINATION_REJECTED + | :ACH_ORIGINATION_REVIEWED + | :ACH_ORIGINATION_SETTLED + | :ACH_RECEIPT_PROCESSED + | :ACH_RECEIPT_RELEASED + | :ACH_RECEIPT_SETTLED + | :ACH_RETURN_INITIATED + | :ACH_RETURN_PROCESSED + | :ACH_RETURN_REJECTED + | :ACH_RETURN_SETTLED + | :AUTHORIZATION + | :AUTHORIZATION_ADVICE + | :AUTHORIZATION_EXPIRY + | :AUTHORIZATION_REVERSAL + | :BALANCE_INQUIRY + | :BILLING_ERROR + | :BILLING_ERROR_REVERSAL + | :CARD_TO_CARD + | :CASH_BACK + | :CASH_BACK_REVERSAL + | :CLEARING + | :COLLECTION + | :CORRECTION_CREDIT + | :CORRECTION_DEBIT + | :CREDIT_AUTHORIZATION + | :CREDIT_AUTHORIZATION_ADVICE + | :CURRENCY_CONVERSION + | :CURRENCY_CONVERSION_REVERSAL + | :DISPUTE_WON + | :EXTERNAL_ACH_CANCELED + | :EXTERNAL_ACH_INITIATED + | :EXTERNAL_ACH_RELEASED + | :EXTERNAL_ACH_REVERSED + | :EXTERNAL_ACH_SETTLED + | :EXTERNAL_CHECK_CANCELED + | :EXTERNAL_CHECK_INITIATED + | :EXTERNAL_CHECK_RELEASED + | :EXTERNAL_CHECK_REVERSED + | :EXTERNAL_CHECK_SETTLED + | :EXTERNAL_FEDNOW_CANCELED + | :EXTERNAL_FEDNOW_INITIATED + | :EXTERNAL_FEDNOW_RELEASED + | :EXTERNAL_FEDNOW_REVERSED + | :EXTERNAL_FEDNOW_SETTLED + | :EXTERNAL_RTP_CANCELED + | :EXTERNAL_RTP_INITIATED + | :EXTERNAL_RTP_RELEASED + | :EXTERNAL_RTP_REVERSED + | :EXTERNAL_RTP_SETTLED + | :EXTERNAL_TRANSFER_CANCELED + | :EXTERNAL_TRANSFER_INITIATED + | :EXTERNAL_TRANSFER_RELEASED + | :EXTERNAL_TRANSFER_REVERSED + | :EXTERNAL_TRANSFER_SETTLED + | :EXTERNAL_WIRE_CANCELED + | :EXTERNAL_WIRE_INITIATED + | :EXTERNAL_WIRE_RELEASED + | :EXTERNAL_WIRE_REVERSED + | :EXTERNAL_WIRE_SETTLED + | :FINANCIAL_AUTHORIZATION + | :FINANCIAL_CREDIT_AUTHORIZATION + | :INTEREST + | :INTEREST_REVERSAL + | :INTERNAL_ADJUSTMENT + | :LATE_PAYMENT + | :LATE_PAYMENT_REVERSAL + | :LOSS_WRITE_OFF + | :PROVISIONAL_CREDIT + | :PROVISIONAL_CREDIT_REVERSAL + | :SERVICE + | :RETURN + | :RETURN_REVERSAL + | :TRANSFER + | :TRANSFER_INSUFFICIENT_FUNDS + | :RETURNED_PAYMENT + | :RETURNED_PAYMENT_REVERSAL + | :LITHIC_NETWORK_PAYMENT + | :ANNUAL + | :ANNUAL_REVERSAL + | :QUARTERLY + | :QUARTERLY_REVERSAL + | :MONTHLY + | :MONTHLY_REVERSAL + | :ACCOUNT_TO_ACCOUNT + + module EventType + extend Lithic::Internal::Type::Enum + + ACH_ORIGINATION_CANCELLED: :ACH_ORIGINATION_CANCELLED + ACH_ORIGINATION_INITIATED: :ACH_ORIGINATION_INITIATED + ACH_ORIGINATION_PROCESSED: :ACH_ORIGINATION_PROCESSED + ACH_ORIGINATION_RELEASED: :ACH_ORIGINATION_RELEASED + ACH_ORIGINATION_REJECTED: :ACH_ORIGINATION_REJECTED + ACH_ORIGINATION_REVIEWED: :ACH_ORIGINATION_REVIEWED + ACH_ORIGINATION_SETTLED: :ACH_ORIGINATION_SETTLED + ACH_RECEIPT_PROCESSED: :ACH_RECEIPT_PROCESSED + ACH_RECEIPT_RELEASED: :ACH_RECEIPT_RELEASED + ACH_RECEIPT_SETTLED: :ACH_RECEIPT_SETTLED + ACH_RETURN_INITIATED: :ACH_RETURN_INITIATED + ACH_RETURN_PROCESSED: :ACH_RETURN_PROCESSED + ACH_RETURN_REJECTED: :ACH_RETURN_REJECTED + ACH_RETURN_SETTLED: :ACH_RETURN_SETTLED + AUTHORIZATION: :AUTHORIZATION + AUTHORIZATION_ADVICE: :AUTHORIZATION_ADVICE + AUTHORIZATION_EXPIRY: :AUTHORIZATION_EXPIRY + AUTHORIZATION_REVERSAL: :AUTHORIZATION_REVERSAL + BALANCE_INQUIRY: :BALANCE_INQUIRY + BILLING_ERROR: :BILLING_ERROR + BILLING_ERROR_REVERSAL: :BILLING_ERROR_REVERSAL + CARD_TO_CARD: :CARD_TO_CARD + CASH_BACK: :CASH_BACK + CASH_BACK_REVERSAL: :CASH_BACK_REVERSAL + CLEARING: :CLEARING + COLLECTION: :COLLECTION + CORRECTION_CREDIT: :CORRECTION_CREDIT + CORRECTION_DEBIT: :CORRECTION_DEBIT + CREDIT_AUTHORIZATION: :CREDIT_AUTHORIZATION + CREDIT_AUTHORIZATION_ADVICE: :CREDIT_AUTHORIZATION_ADVICE + CURRENCY_CONVERSION: :CURRENCY_CONVERSION + CURRENCY_CONVERSION_REVERSAL: :CURRENCY_CONVERSION_REVERSAL + DISPUTE_WON: :DISPUTE_WON + EXTERNAL_ACH_CANCELED: :EXTERNAL_ACH_CANCELED + EXTERNAL_ACH_INITIATED: :EXTERNAL_ACH_INITIATED + EXTERNAL_ACH_RELEASED: :EXTERNAL_ACH_RELEASED + EXTERNAL_ACH_REVERSED: :EXTERNAL_ACH_REVERSED + EXTERNAL_ACH_SETTLED: :EXTERNAL_ACH_SETTLED + EXTERNAL_CHECK_CANCELED: :EXTERNAL_CHECK_CANCELED + EXTERNAL_CHECK_INITIATED: :EXTERNAL_CHECK_INITIATED + EXTERNAL_CHECK_RELEASED: :EXTERNAL_CHECK_RELEASED + EXTERNAL_CHECK_REVERSED: :EXTERNAL_CHECK_REVERSED + EXTERNAL_CHECK_SETTLED: :EXTERNAL_CHECK_SETTLED + EXTERNAL_FEDNOW_CANCELED: :EXTERNAL_FEDNOW_CANCELED + EXTERNAL_FEDNOW_INITIATED: :EXTERNAL_FEDNOW_INITIATED + EXTERNAL_FEDNOW_RELEASED: :EXTERNAL_FEDNOW_RELEASED + EXTERNAL_FEDNOW_REVERSED: :EXTERNAL_FEDNOW_REVERSED + EXTERNAL_FEDNOW_SETTLED: :EXTERNAL_FEDNOW_SETTLED + EXTERNAL_RTP_CANCELED: :EXTERNAL_RTP_CANCELED + EXTERNAL_RTP_INITIATED: :EXTERNAL_RTP_INITIATED + EXTERNAL_RTP_RELEASED: :EXTERNAL_RTP_RELEASED + EXTERNAL_RTP_REVERSED: :EXTERNAL_RTP_REVERSED + EXTERNAL_RTP_SETTLED: :EXTERNAL_RTP_SETTLED + EXTERNAL_TRANSFER_CANCELED: :EXTERNAL_TRANSFER_CANCELED + EXTERNAL_TRANSFER_INITIATED: :EXTERNAL_TRANSFER_INITIATED + EXTERNAL_TRANSFER_RELEASED: :EXTERNAL_TRANSFER_RELEASED + EXTERNAL_TRANSFER_REVERSED: :EXTERNAL_TRANSFER_REVERSED + EXTERNAL_TRANSFER_SETTLED: :EXTERNAL_TRANSFER_SETTLED + EXTERNAL_WIRE_CANCELED: :EXTERNAL_WIRE_CANCELED + EXTERNAL_WIRE_INITIATED: :EXTERNAL_WIRE_INITIATED + EXTERNAL_WIRE_RELEASED: :EXTERNAL_WIRE_RELEASED + EXTERNAL_WIRE_REVERSED: :EXTERNAL_WIRE_REVERSED + EXTERNAL_WIRE_SETTLED: :EXTERNAL_WIRE_SETTLED + FINANCIAL_AUTHORIZATION: :FINANCIAL_AUTHORIZATION + FINANCIAL_CREDIT_AUTHORIZATION: :FINANCIAL_CREDIT_AUTHORIZATION + INTEREST: :INTEREST + INTEREST_REVERSAL: :INTEREST_REVERSAL + INTERNAL_ADJUSTMENT: :INTERNAL_ADJUSTMENT + LATE_PAYMENT: :LATE_PAYMENT + LATE_PAYMENT_REVERSAL: :LATE_PAYMENT_REVERSAL + LOSS_WRITE_OFF: :LOSS_WRITE_OFF + PROVISIONAL_CREDIT: :PROVISIONAL_CREDIT + PROVISIONAL_CREDIT_REVERSAL: :PROVISIONAL_CREDIT_REVERSAL + SERVICE: :SERVICE + RETURN: :RETURN + RETURN_REVERSAL: :RETURN_REVERSAL + TRANSFER: :TRANSFER + TRANSFER_INSUFFICIENT_FUNDS: :TRANSFER_INSUFFICIENT_FUNDS + RETURNED_PAYMENT: :RETURNED_PAYMENT + RETURNED_PAYMENT_REVERSAL: :RETURNED_PAYMENT_REVERSAL + LITHIC_NETWORK_PAYMENT: :LITHIC_NETWORK_PAYMENT + ANNUAL: :ANNUAL + ANNUAL_REVERSAL: :ANNUAL_REVERSAL + QUARTERLY: :QUARTERLY + QUARTERLY_REVERSAL: :QUARTERLY_REVERSAL + MONTHLY: :MONTHLY + MONTHLY_REVERSAL: :MONTHLY_REVERSAL + ACCOUNT_TO_ACCOUNT: :ACCOUNT_TO_ACCOUNT + + def self?.values: -> ::Array[Lithic::Models::FinancialAccounts::Statements::StatementLineItems::Data::event_type] + end + end + end + end + end + end +end diff --git a/sig/lithic/models/financial_event.rbs b/sig/lithic/models/financial_event.rbs new file mode 100644 index 00000000..6f01f3bd --- /dev/null +++ b/sig/lithic/models/financial_event.rbs @@ -0,0 +1,250 @@ +module Lithic + module Models + type financial_event = + { + token: String, + amount: Integer, + created: Time, + result: Lithic::Models::FinancialEvent::result, + type: Lithic::Models::FinancialEvent::type_ + } + + class FinancialEvent < Lithic::Internal::Type::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader amount: Integer? + + def amount=: (Integer) -> Integer + + attr_reader created: Time? + + def created=: (Time) -> Time + + attr_reader result: Lithic::Models::FinancialEvent::result? + + def result=: ( + Lithic::Models::FinancialEvent::result + ) -> Lithic::Models::FinancialEvent::result + + attr_reader type: Lithic::Models::FinancialEvent::type_? + + def type=: ( + Lithic::Models::FinancialEvent::type_ + ) -> Lithic::Models::FinancialEvent::type_ + + def initialize: ( + ?token: String, + ?amount: Integer, + ?created: Time, + ?result: Lithic::Models::FinancialEvent::result, + ?type: Lithic::Models::FinancialEvent::type_ + ) -> void + + def to_hash: -> { + token: String, + amount: Integer, + created: Time, + result: Lithic::Models::FinancialEvent::result, + type: Lithic::Models::FinancialEvent::type_ + } + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::FinancialEvent::result] + end + + type type_ = + :ACH_ORIGINATION_CANCELLED + | :ACH_ORIGINATION_INITIATED + | :ACH_ORIGINATION_PROCESSED + | :ACH_ORIGINATION_RELEASED + | :ACH_ORIGINATION_REJECTED + | :ACH_ORIGINATION_REVIEWED + | :ACH_ORIGINATION_SETTLED + | :ACH_RECEIPT_PROCESSED + | :ACH_RECEIPT_RELEASED + | :ACH_RECEIPT_SETTLED + | :ACH_RETURN_INITIATED + | :ACH_RETURN_PROCESSED + | :ACH_RETURN_REJECTED + | :ACH_RETURN_SETTLED + | :AUTHORIZATION + | :AUTHORIZATION_ADVICE + | :AUTHORIZATION_EXPIRY + | :AUTHORIZATION_REVERSAL + | :BALANCE_INQUIRY + | :BILLING_ERROR + | :BILLING_ERROR_REVERSAL + | :CARD_TO_CARD + | :CASH_BACK + | :CASH_BACK_REVERSAL + | :CLEARING + | :COLLECTION + | :CORRECTION_CREDIT + | :CORRECTION_DEBIT + | :CREDIT_AUTHORIZATION + | :CREDIT_AUTHORIZATION_ADVICE + | :CURRENCY_CONVERSION + | :CURRENCY_CONVERSION_REVERSAL + | :DISPUTE_WON + | :EXTERNAL_ACH_CANCELED + | :EXTERNAL_ACH_INITIATED + | :EXTERNAL_ACH_RELEASED + | :EXTERNAL_ACH_REVERSED + | :EXTERNAL_ACH_SETTLED + | :EXTERNAL_CHECK_CANCELED + | :EXTERNAL_CHECK_INITIATED + | :EXTERNAL_CHECK_RELEASED + | :EXTERNAL_CHECK_REVERSED + | :EXTERNAL_CHECK_SETTLED + | :EXTERNAL_FEDNOW_CANCELED + | :EXTERNAL_FEDNOW_INITIATED + | :EXTERNAL_FEDNOW_RELEASED + | :EXTERNAL_FEDNOW_REVERSED + | :EXTERNAL_FEDNOW_SETTLED + | :EXTERNAL_RTP_CANCELED + | :EXTERNAL_RTP_INITIATED + | :EXTERNAL_RTP_RELEASED + | :EXTERNAL_RTP_REVERSED + | :EXTERNAL_RTP_SETTLED + | :EXTERNAL_TRANSFER_CANCELED + | :EXTERNAL_TRANSFER_INITIATED + | :EXTERNAL_TRANSFER_RELEASED + | :EXTERNAL_TRANSFER_REVERSED + | :EXTERNAL_TRANSFER_SETTLED + | :EXTERNAL_WIRE_CANCELED + | :EXTERNAL_WIRE_INITIATED + | :EXTERNAL_WIRE_RELEASED + | :EXTERNAL_WIRE_REVERSED + | :EXTERNAL_WIRE_SETTLED + | :FINANCIAL_AUTHORIZATION + | :FINANCIAL_CREDIT_AUTHORIZATION + | :INTEREST + | :INTEREST_REVERSAL + | :INTERNAL_ADJUSTMENT + | :LATE_PAYMENT + | :LATE_PAYMENT_REVERSAL + | :LOSS_WRITE_OFF + | :PROVISIONAL_CREDIT + | :PROVISIONAL_CREDIT_REVERSAL + | :SERVICE + | :RETURN + | :RETURN_REVERSAL + | :TRANSFER + | :TRANSFER_INSUFFICIENT_FUNDS + | :RETURNED_PAYMENT + | :RETURNED_PAYMENT_REVERSAL + | :LITHIC_NETWORK_PAYMENT + | :ANNUAL + | :ANNUAL_REVERSAL + | :QUARTERLY + | :QUARTERLY_REVERSAL + | :MONTHLY + | :MONTHLY_REVERSAL + | :ACCOUNT_TO_ACCOUNT + + module Type + extend Lithic::Internal::Type::Enum + + ACH_ORIGINATION_CANCELLED: :ACH_ORIGINATION_CANCELLED + ACH_ORIGINATION_INITIATED: :ACH_ORIGINATION_INITIATED + ACH_ORIGINATION_PROCESSED: :ACH_ORIGINATION_PROCESSED + ACH_ORIGINATION_RELEASED: :ACH_ORIGINATION_RELEASED + ACH_ORIGINATION_REJECTED: :ACH_ORIGINATION_REJECTED + ACH_ORIGINATION_REVIEWED: :ACH_ORIGINATION_REVIEWED + ACH_ORIGINATION_SETTLED: :ACH_ORIGINATION_SETTLED + ACH_RECEIPT_PROCESSED: :ACH_RECEIPT_PROCESSED + ACH_RECEIPT_RELEASED: :ACH_RECEIPT_RELEASED + ACH_RECEIPT_SETTLED: :ACH_RECEIPT_SETTLED + ACH_RETURN_INITIATED: :ACH_RETURN_INITIATED + ACH_RETURN_PROCESSED: :ACH_RETURN_PROCESSED + ACH_RETURN_REJECTED: :ACH_RETURN_REJECTED + ACH_RETURN_SETTLED: :ACH_RETURN_SETTLED + AUTHORIZATION: :AUTHORIZATION + AUTHORIZATION_ADVICE: :AUTHORIZATION_ADVICE + AUTHORIZATION_EXPIRY: :AUTHORIZATION_EXPIRY + AUTHORIZATION_REVERSAL: :AUTHORIZATION_REVERSAL + BALANCE_INQUIRY: :BALANCE_INQUIRY + BILLING_ERROR: :BILLING_ERROR + BILLING_ERROR_REVERSAL: :BILLING_ERROR_REVERSAL + CARD_TO_CARD: :CARD_TO_CARD + CASH_BACK: :CASH_BACK + CASH_BACK_REVERSAL: :CASH_BACK_REVERSAL + CLEARING: :CLEARING + COLLECTION: :COLLECTION + CORRECTION_CREDIT: :CORRECTION_CREDIT + CORRECTION_DEBIT: :CORRECTION_DEBIT + CREDIT_AUTHORIZATION: :CREDIT_AUTHORIZATION + CREDIT_AUTHORIZATION_ADVICE: :CREDIT_AUTHORIZATION_ADVICE + CURRENCY_CONVERSION: :CURRENCY_CONVERSION + CURRENCY_CONVERSION_REVERSAL: :CURRENCY_CONVERSION_REVERSAL + DISPUTE_WON: :DISPUTE_WON + EXTERNAL_ACH_CANCELED: :EXTERNAL_ACH_CANCELED + EXTERNAL_ACH_INITIATED: :EXTERNAL_ACH_INITIATED + EXTERNAL_ACH_RELEASED: :EXTERNAL_ACH_RELEASED + EXTERNAL_ACH_REVERSED: :EXTERNAL_ACH_REVERSED + EXTERNAL_ACH_SETTLED: :EXTERNAL_ACH_SETTLED + EXTERNAL_CHECK_CANCELED: :EXTERNAL_CHECK_CANCELED + EXTERNAL_CHECK_INITIATED: :EXTERNAL_CHECK_INITIATED + EXTERNAL_CHECK_RELEASED: :EXTERNAL_CHECK_RELEASED + EXTERNAL_CHECK_REVERSED: :EXTERNAL_CHECK_REVERSED + EXTERNAL_CHECK_SETTLED: :EXTERNAL_CHECK_SETTLED + EXTERNAL_FEDNOW_CANCELED: :EXTERNAL_FEDNOW_CANCELED + EXTERNAL_FEDNOW_INITIATED: :EXTERNAL_FEDNOW_INITIATED + EXTERNAL_FEDNOW_RELEASED: :EXTERNAL_FEDNOW_RELEASED + EXTERNAL_FEDNOW_REVERSED: :EXTERNAL_FEDNOW_REVERSED + EXTERNAL_FEDNOW_SETTLED: :EXTERNAL_FEDNOW_SETTLED + EXTERNAL_RTP_CANCELED: :EXTERNAL_RTP_CANCELED + EXTERNAL_RTP_INITIATED: :EXTERNAL_RTP_INITIATED + EXTERNAL_RTP_RELEASED: :EXTERNAL_RTP_RELEASED + EXTERNAL_RTP_REVERSED: :EXTERNAL_RTP_REVERSED + EXTERNAL_RTP_SETTLED: :EXTERNAL_RTP_SETTLED + EXTERNAL_TRANSFER_CANCELED: :EXTERNAL_TRANSFER_CANCELED + EXTERNAL_TRANSFER_INITIATED: :EXTERNAL_TRANSFER_INITIATED + EXTERNAL_TRANSFER_RELEASED: :EXTERNAL_TRANSFER_RELEASED + EXTERNAL_TRANSFER_REVERSED: :EXTERNAL_TRANSFER_REVERSED + EXTERNAL_TRANSFER_SETTLED: :EXTERNAL_TRANSFER_SETTLED + EXTERNAL_WIRE_CANCELED: :EXTERNAL_WIRE_CANCELED + EXTERNAL_WIRE_INITIATED: :EXTERNAL_WIRE_INITIATED + EXTERNAL_WIRE_RELEASED: :EXTERNAL_WIRE_RELEASED + EXTERNAL_WIRE_REVERSED: :EXTERNAL_WIRE_REVERSED + EXTERNAL_WIRE_SETTLED: :EXTERNAL_WIRE_SETTLED + FINANCIAL_AUTHORIZATION: :FINANCIAL_AUTHORIZATION + FINANCIAL_CREDIT_AUTHORIZATION: :FINANCIAL_CREDIT_AUTHORIZATION + INTEREST: :INTEREST + INTEREST_REVERSAL: :INTEREST_REVERSAL + INTERNAL_ADJUSTMENT: :INTERNAL_ADJUSTMENT + LATE_PAYMENT: :LATE_PAYMENT + LATE_PAYMENT_REVERSAL: :LATE_PAYMENT_REVERSAL + LOSS_WRITE_OFF: :LOSS_WRITE_OFF + PROVISIONAL_CREDIT: :PROVISIONAL_CREDIT + PROVISIONAL_CREDIT_REVERSAL: :PROVISIONAL_CREDIT_REVERSAL + SERVICE: :SERVICE + RETURN: :RETURN + RETURN_REVERSAL: :RETURN_REVERSAL + TRANSFER: :TRANSFER + TRANSFER_INSUFFICIENT_FUNDS: :TRANSFER_INSUFFICIENT_FUNDS + RETURNED_PAYMENT: :RETURNED_PAYMENT + RETURNED_PAYMENT_REVERSAL: :RETURNED_PAYMENT_REVERSAL + LITHIC_NETWORK_PAYMENT: :LITHIC_NETWORK_PAYMENT + ANNUAL: :ANNUAL + ANNUAL_REVERSAL: :ANNUAL_REVERSAL + QUARTERLY: :QUARTERLY + QUARTERLY_REVERSAL: :QUARTERLY_REVERSAL + MONTHLY: :MONTHLY + MONTHLY_REVERSAL: :MONTHLY_REVERSAL + ACCOUNT_TO_ACCOUNT: :ACCOUNT_TO_ACCOUNT + + def self?.values: -> ::Array[Lithic::Models::FinancialEvent::type_] + end + end + end +end diff --git a/sig/lithic/models/financial_transaction.rbs b/sig/lithic/models/financial_transaction.rbs new file mode 100644 index 00000000..7d9d4928 --- /dev/null +++ b/sig/lithic/models/financial_transaction.rbs @@ -0,0 +1,110 @@ +module Lithic + module Models + type financial_transaction = + { + token: String, + category: Lithic::Models::FinancialTransaction::category, + created: Time, + currency: String, + descriptor: String, + events: ::Array[Lithic::FinancialEvent], + pending_amount: Integer, + result: Lithic::Models::FinancialTransaction::result, + settled_amount: Integer, + status: Lithic::Models::FinancialTransaction::status, + updated: Time + } + + class FinancialTransaction < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor category: Lithic::Models::FinancialTransaction::category + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor descriptor: String + + attr_accessor events: ::Array[Lithic::FinancialEvent] + + attr_accessor pending_amount: Integer + + attr_accessor result: Lithic::Models::FinancialTransaction::result + + attr_accessor settled_amount: Integer + + attr_accessor status: Lithic::Models::FinancialTransaction::status + + attr_accessor updated: Time + + def initialize: ( + token: String, + category: Lithic::Models::FinancialTransaction::category, + created: Time, + currency: String, + descriptor: String, + events: ::Array[Lithic::FinancialEvent], + pending_amount: Integer, + result: Lithic::Models::FinancialTransaction::result, + settled_amount: Integer, + status: Lithic::Models::FinancialTransaction::status, + updated: Time + ) -> void + + def to_hash: -> { + token: String, + category: Lithic::Models::FinancialTransaction::category, + created: Time, + currency: String, + descriptor: String, + events: ::Array[Lithic::FinancialEvent], + pending_amount: Integer, + result: Lithic::Models::FinancialTransaction::result, + settled_amount: Integer, + status: Lithic::Models::FinancialTransaction::status, + updated: Time + } + + type category = :ACH | :CARD | :INTERNAL | :TRANSFER + + module Category + extend Lithic::Internal::Type::Enum + + ACH: :ACH + CARD: :CARD + INTERNAL: :INTERNAL + TRANSFER: :TRANSFER + + def self?.values: -> ::Array[Lithic::Models::FinancialTransaction::category] + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::FinancialTransaction::result] + end + + type status = + :DECLINED | :EXPIRED | :PENDING | :RETURNED | :SETTLED | :VOIDED + + module Status + extend Lithic::Internal::Type::Enum + + DECLINED: :DECLINED + EXPIRED: :EXPIRED + PENDING: :PENDING + RETURNED: :RETURNED + SETTLED: :SETTLED + VOIDED: :VOIDED + + def self?.values: -> ::Array[Lithic::Models::FinancialTransaction::status] + end + end + end +end diff --git a/sig/lithic/models/fraud/transaction_report_params.rbs b/sig/lithic/models/fraud/transaction_report_params.rbs new file mode 100644 index 00000000..b05f0c5c --- /dev/null +++ b/sig/lithic/models/fraud/transaction_report_params.rbs @@ -0,0 +1,80 @@ +module Lithic + module Models + module Fraud + type transaction_report_params = + { + transaction_token: String, + fraud_status: Lithic::Models::Fraud::TransactionReportParams::fraud_status, + comment: String, + fraud_type: Lithic::Models::Fraud::TransactionReportParams::fraud_type + } + & Lithic::Internal::Type::request_parameters + + class TransactionReportParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor transaction_token: String + + attr_accessor fraud_status: Lithic::Models::Fraud::TransactionReportParams::fraud_status + + attr_reader comment: String? + + def comment=: (String) -> String + + attr_reader fraud_type: Lithic::Models::Fraud::TransactionReportParams::fraud_type? + + def fraud_type=: ( + Lithic::Models::Fraud::TransactionReportParams::fraud_type + ) -> Lithic::Models::Fraud::TransactionReportParams::fraud_type + + def initialize: ( + transaction_token: String, + fraud_status: Lithic::Models::Fraud::TransactionReportParams::fraud_status, + ?comment: String, + ?fraud_type: Lithic::Models::Fraud::TransactionReportParams::fraud_type, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + transaction_token: String, + fraud_status: Lithic::Models::Fraud::TransactionReportParams::fraud_status, + comment: String, + fraud_type: Lithic::Models::Fraud::TransactionReportParams::fraud_type, + request_options: Lithic::RequestOptions + } + + type fraud_status = :SUSPECTED_FRAUD | :FRAUDULENT | :NOT_FRAUDULENT + + module FraudStatus + extend Lithic::Internal::Type::Enum + + SUSPECTED_FRAUD: :SUSPECTED_FRAUD + FRAUDULENT: :FRAUDULENT + NOT_FRAUDULENT: :NOT_FRAUDULENT + + def self?.values: -> ::Array[Lithic::Models::Fraud::TransactionReportParams::fraud_status] + end + + type fraud_type = + :FIRST_PARTY_FRAUD + | :ACCOUNT_TAKEOVER + | :CARD_COMPROMISED + | :IDENTITY_THEFT + | :CARDHOLDER_MANIPULATION + + module FraudType + extend Lithic::Internal::Type::Enum + + FIRST_PARTY_FRAUD: :FIRST_PARTY_FRAUD + ACCOUNT_TAKEOVER: :ACCOUNT_TAKEOVER + CARD_COMPROMISED: :CARD_COMPROMISED + IDENTITY_THEFT: :IDENTITY_THEFT + CARDHOLDER_MANIPULATION: :CARDHOLDER_MANIPULATION + + def self?.values: -> ::Array[Lithic::Models::Fraud::TransactionReportParams::fraud_type] + end + end + end + end +end diff --git a/sig/lithic/models/fraud/transaction_report_response.rbs b/sig/lithic/models/fraud/transaction_report_response.rbs new file mode 100644 index 00000000..907d34b7 --- /dev/null +++ b/sig/lithic/models/fraud/transaction_report_response.rbs @@ -0,0 +1,90 @@ +module Lithic + module Models + module Fraud + type transaction_report_response = + { + fraud_status: Lithic::Models::Fraud::TransactionReportResponse::fraud_status, + transaction_token: String, + comment: String, + created_at: Time, + fraud_type: Lithic::Models::Fraud::TransactionReportResponse::fraud_type, + updated_at: Time + } + + class TransactionReportResponse < Lithic::Internal::Type::BaseModel + attr_accessor fraud_status: Lithic::Models::Fraud::TransactionReportResponse::fraud_status + + attr_accessor transaction_token: String + + attr_reader comment: String? + + def comment=: (String) -> String + + attr_reader created_at: Time? + + def created_at=: (Time) -> Time + + attr_reader fraud_type: Lithic::Models::Fraud::TransactionReportResponse::fraud_type? + + def fraud_type=: ( + Lithic::Models::Fraud::TransactionReportResponse::fraud_type + ) -> Lithic::Models::Fraud::TransactionReportResponse::fraud_type + + attr_reader updated_at: Time? + + def updated_at=: (Time) -> Time + + def initialize: ( + fraud_status: Lithic::Models::Fraud::TransactionReportResponse::fraud_status, + transaction_token: String, + ?comment: String, + ?created_at: Time, + ?fraud_type: Lithic::Models::Fraud::TransactionReportResponse::fraud_type, + ?updated_at: Time + ) -> void + + def to_hash: -> { + fraud_status: Lithic::Models::Fraud::TransactionReportResponse::fraud_status, + transaction_token: String, + comment: String, + created_at: Time, + fraud_type: Lithic::Models::Fraud::TransactionReportResponse::fraud_type, + updated_at: Time + } + + type fraud_status = + :SUSPECTED_FRAUD | :FRAUDULENT | :NOT_FRAUDULENT | :NO_REPORTED_FRAUD + + module FraudStatus + extend Lithic::Internal::Type::Enum + + SUSPECTED_FRAUD: :SUSPECTED_FRAUD + FRAUDULENT: :FRAUDULENT + NOT_FRAUDULENT: :NOT_FRAUDULENT + NO_REPORTED_FRAUD: :NO_REPORTED_FRAUD + + def self?.values: -> ::Array[Lithic::Models::Fraud::TransactionReportResponse::fraud_status] + end + + type fraud_type = + :FIRST_PARTY_FRAUD + | :ACCOUNT_TAKEOVER + | :CARD_COMPROMISED + | :IDENTITY_THEFT + | :CARDHOLDER_MANIPULATION + + module FraudType + extend Lithic::Internal::Type::Enum + + FIRST_PARTY_FRAUD: :FIRST_PARTY_FRAUD + ACCOUNT_TAKEOVER: :ACCOUNT_TAKEOVER + CARD_COMPROMISED: :CARD_COMPROMISED + IDENTITY_THEFT: :IDENTITY_THEFT + CARDHOLDER_MANIPULATION: :CARDHOLDER_MANIPULATION + + def self?.values: -> ::Array[Lithic::Models::Fraud::TransactionReportResponse::fraud_type] + end + end + end + end +end diff --git a/sig/lithic/models/fraud/transaction_retrieve_params.rbs b/sig/lithic/models/fraud/transaction_retrieve_params.rbs new file mode 100644 index 00000000..9d84ca10 --- /dev/null +++ b/sig/lithic/models/fraud/transaction_retrieve_params.rbs @@ -0,0 +1,26 @@ +module Lithic + module Models + module Fraud + type transaction_retrieve_params = + { transaction_token: String } + & Lithic::Internal::Type::request_parameters + + class TransactionRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor transaction_token: String + + def initialize: ( + transaction_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + transaction_token: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/fraud/transaction_retrieve_response.rbs b/sig/lithic/models/fraud/transaction_retrieve_response.rbs new file mode 100644 index 00000000..e7d2996c --- /dev/null +++ b/sig/lithic/models/fraud/transaction_retrieve_response.rbs @@ -0,0 +1,90 @@ +module Lithic + module Models + module Fraud + type transaction_retrieve_response = + { + fraud_status: Lithic::Models::Fraud::TransactionRetrieveResponse::fraud_status, + transaction_token: String, + comment: String, + created_at: Time, + fraud_type: Lithic::Models::Fraud::TransactionRetrieveResponse::fraud_type, + updated_at: Time + } + + class TransactionRetrieveResponse < Lithic::Internal::Type::BaseModel + attr_accessor fraud_status: Lithic::Models::Fraud::TransactionRetrieveResponse::fraud_status + + attr_accessor transaction_token: String + + attr_reader comment: String? + + def comment=: (String) -> String + + attr_reader created_at: Time? + + def created_at=: (Time) -> Time + + attr_reader fraud_type: Lithic::Models::Fraud::TransactionRetrieveResponse::fraud_type? + + def fraud_type=: ( + Lithic::Models::Fraud::TransactionRetrieveResponse::fraud_type + ) -> Lithic::Models::Fraud::TransactionRetrieveResponse::fraud_type + + attr_reader updated_at: Time? + + def updated_at=: (Time) -> Time + + def initialize: ( + fraud_status: Lithic::Models::Fraud::TransactionRetrieveResponse::fraud_status, + transaction_token: String, + ?comment: String, + ?created_at: Time, + ?fraud_type: Lithic::Models::Fraud::TransactionRetrieveResponse::fraud_type, + ?updated_at: Time + ) -> void + + def to_hash: -> { + fraud_status: Lithic::Models::Fraud::TransactionRetrieveResponse::fraud_status, + transaction_token: String, + comment: String, + created_at: Time, + fraud_type: Lithic::Models::Fraud::TransactionRetrieveResponse::fraud_type, + updated_at: Time + } + + type fraud_status = + :SUSPECTED_FRAUD | :FRAUDULENT | :NOT_FRAUDULENT | :NO_REPORTED_FRAUD + + module FraudStatus + extend Lithic::Internal::Type::Enum + + SUSPECTED_FRAUD: :SUSPECTED_FRAUD + FRAUDULENT: :FRAUDULENT + NOT_FRAUDULENT: :NOT_FRAUDULENT + NO_REPORTED_FRAUD: :NO_REPORTED_FRAUD + + def self?.values: -> ::Array[Lithic::Models::Fraud::TransactionRetrieveResponse::fraud_status] + end + + type fraud_type = + :FIRST_PARTY_FRAUD + | :ACCOUNT_TAKEOVER + | :CARD_COMPROMISED + | :IDENTITY_THEFT + | :CARDHOLDER_MANIPULATION + + module FraudType + extend Lithic::Internal::Type::Enum + + FIRST_PARTY_FRAUD: :FIRST_PARTY_FRAUD + ACCOUNT_TAKEOVER: :ACCOUNT_TAKEOVER + CARD_COMPROMISED: :CARD_COMPROMISED + IDENTITY_THEFT: :IDENTITY_THEFT + CARDHOLDER_MANIPULATION: :CARDHOLDER_MANIPULATION + + def self?.values: -> ::Array[Lithic::Models::Fraud::TransactionRetrieveResponse::fraud_type] + end + end + end + end +end diff --git a/sig/lithic/models/funding_event.rbs b/sig/lithic/models/funding_event.rbs new file mode 100644 index 00000000..32167ee6 --- /dev/null +++ b/sig/lithic/models/funding_event.rbs @@ -0,0 +1,85 @@ +module Lithic + module Models + type funding_event = + { + token: String, + collection_resource_type: Lithic::Models::FundingEvent::collection_resource_type, + collection_tokens: ::Array[String], + created: Time, + high_watermark: Time, + network_settlement_summary: ::Array[Lithic::FundingEvent::NetworkSettlementSummary], + previous_high_watermark: Time, + updated: Time + } + + class FundingEvent < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor collection_resource_type: Lithic::Models::FundingEvent::collection_resource_type + + attr_accessor collection_tokens: ::Array[String] + + attr_accessor created: Time + + attr_accessor high_watermark: Time + + attr_accessor network_settlement_summary: ::Array[Lithic::FundingEvent::NetworkSettlementSummary] + + attr_accessor previous_high_watermark: Time + + attr_accessor updated: Time + + def initialize: ( + token: String, + collection_resource_type: Lithic::Models::FundingEvent::collection_resource_type, + collection_tokens: ::Array[String], + created: Time, + high_watermark: Time, + network_settlement_summary: ::Array[Lithic::FundingEvent::NetworkSettlementSummary], + previous_high_watermark: Time, + updated: Time + ) -> void + + def to_hash: -> { + token: String, + collection_resource_type: Lithic::Models::FundingEvent::collection_resource_type, + collection_tokens: ::Array[String], + created: Time, + high_watermark: Time, + network_settlement_summary: ::Array[Lithic::FundingEvent::NetworkSettlementSummary], + previous_high_watermark: Time, + updated: Time + } + + type collection_resource_type = :BOOK_TRANSFER | :PAYMENT + + module CollectionResourceType + extend Lithic::Internal::Type::Enum + + BOOK_TRANSFER: :BOOK_TRANSFER + PAYMENT: :PAYMENT + + def self?.values: -> ::Array[Lithic::Models::FundingEvent::collection_resource_type] + end + + type network_settlement_summary = + { network_settlement_date: Date, settled_gross_amount: Integer } + + class NetworkSettlementSummary < Lithic::Internal::Type::BaseModel + attr_accessor network_settlement_date: Date + + attr_accessor settled_gross_amount: Integer + + def initialize: ( + network_settlement_date: Date, + settled_gross_amount: Integer + ) -> void + + def to_hash: -> { + network_settlement_date: Date, + settled_gross_amount: Integer + } + end + end + end +end diff --git a/sig/lithic/models/funding_event_created_webhook_event.rbs b/sig/lithic/models/funding_event_created_webhook_event.rbs new file mode 100644 index 00000000..732170d8 --- /dev/null +++ b/sig/lithic/models/funding_event_created_webhook_event.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + type funding_event_created_webhook_event = + { event_type: :"funding_event.created" } + + class FundingEventCreatedWebhookEvent < Lithic::Models::FundingEvent + def event_type: -> :"funding_event.created" + + def event_type=: (:"funding_event.created" _) -> :"funding_event.created" + + def initialize: (?event_type: :"funding_event.created") -> void + + def to_hash: -> { event_type: :"funding_event.created" } + end + end +end diff --git a/sig/lithic/models/funding_event_list_params.rbs b/sig/lithic/models/funding_event_list_params.rbs new file mode 100644 index 00000000..99ca5ec1 --- /dev/null +++ b/sig/lithic/models/funding_event_list_params.rbs @@ -0,0 +1,38 @@ +module Lithic + module Models + type funding_event_list_params = + { ending_before: String, page_size: Integer, starting_after: String } + & Lithic::Internal::Type::request_parameters + + class FundingEventListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/funding_event_retrieve_details_params.rbs b/sig/lithic/models/funding_event_retrieve_details_params.rbs new file mode 100644 index 00000000..eee4b684 --- /dev/null +++ b/sig/lithic/models/funding_event_retrieve_details_params.rbs @@ -0,0 +1,24 @@ +module Lithic + module Models + type funding_event_retrieve_details_params = + { funding_event_token: String } + & Lithic::Internal::Type::request_parameters + + class FundingEventRetrieveDetailsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor funding_event_token: String + + def initialize: ( + funding_event_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + funding_event_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/funding_event_retrieve_details_response.rbs b/sig/lithic/models/funding_event_retrieve_details_response.rbs new file mode 100644 index 00000000..83b1f3b4 --- /dev/null +++ b/sig/lithic/models/funding_event_retrieve_details_response.rbs @@ -0,0 +1,30 @@ +module Lithic + module Models + type funding_event_retrieve_details_response = + { + token: String, + settlement_details_url: String, + settlement_summary_url: String + } + + class FundingEventRetrieveDetailsResponse < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor settlement_details_url: String + + attr_accessor settlement_summary_url: String + + def initialize: ( + token: String, + settlement_details_url: String, + settlement_summary_url: String + ) -> void + + def to_hash: -> { + token: String, + settlement_details_url: String, + settlement_summary_url: String + } + end + end +end diff --git a/sig/lithic/models/funding_event_retrieve_params.rbs b/sig/lithic/models/funding_event_retrieve_params.rbs new file mode 100644 index 00000000..078ca03e --- /dev/null +++ b/sig/lithic/models/funding_event_retrieve_params.rbs @@ -0,0 +1,24 @@ +module Lithic + module Models + type funding_event_retrieve_params = + { funding_event_token: String } + & Lithic::Internal::Type::request_parameters + + class FundingEventRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor funding_event_token: String + + def initialize: ( + funding_event_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + funding_event_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/hold.rbs b/sig/lithic/models/hold.rbs new file mode 100644 index 00000000..6cad69bc --- /dev/null +++ b/sig/lithic/models/hold.rbs @@ -0,0 +1,137 @@ +module Lithic + module Models + type hold = + { + token: String, + created: Time, + status: Lithic::Models::Hold::status, + updated: Time, + currency: String, + events: ::Array[Lithic::HoldEvent], + expiration_datetime: Time?, + family: Lithic::Models::Hold::family, + financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::Hold::result, + user_defined_id: String? + } + + class Hold < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor created: Time + + attr_accessor status: Lithic::Models::Hold::status + + attr_accessor updated: Time + + attr_reader currency: String? + + def currency=: (String) -> String + + attr_reader events: ::Array[Lithic::HoldEvent]? + + def events=: (::Array[Lithic::HoldEvent]) -> ::Array[Lithic::HoldEvent] + + attr_accessor expiration_datetime: Time? + + attr_reader family: Lithic::Models::Hold::family? + + def family=: ( + Lithic::Models::Hold::family + ) -> Lithic::Models::Hold::family + + attr_reader financial_account_token: String? + + def financial_account_token=: (String) -> String + + attr_reader pending_amount: Integer? + + def pending_amount=: (Integer) -> Integer + + attr_reader result: Lithic::Models::Hold::result? + + def result=: ( + Lithic::Models::Hold::result + ) -> Lithic::Models::Hold::result + + attr_accessor user_defined_id: String? + + def initialize: ( + token: String, + created: Time, + status: Lithic::Models::Hold::status, + updated: Time, + ?currency: String, + ?events: ::Array[Lithic::HoldEvent], + ?expiration_datetime: Time?, + ?family: Lithic::Models::Hold::family, + ?financial_account_token: String, + ?pending_amount: Integer, + ?result: Lithic::Models::Hold::result, + ?user_defined_id: String? + ) -> void + + def to_hash: -> { + token: String, + created: Time, + status: Lithic::Models::Hold::status, + updated: Time, + currency: String, + events: ::Array[Lithic::HoldEvent], + expiration_datetime: Time?, + family: Lithic::Models::Hold::family, + financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::Hold::result, + user_defined_id: String? + } + + type status = + :PENDING + | :SETTLED + | :EXPIRED + | :VOIDED + | :DECLINED + | :REVERSED + | :CANCELED + | :RETURNED + + module Status + extend Lithic::Internal::Type::Enum + + PENDING: :PENDING + SETTLED: :SETTLED + EXPIRED: :EXPIRED + VOIDED: :VOIDED + DECLINED: :DECLINED + REVERSED: :REVERSED + CANCELED: :CANCELED + RETURNED: :RETURNED + + def self?.values: -> ::Array[Lithic::Models::Hold::status] + end + + type family = :HOLD + + module Family + extend Lithic::Internal::Type::Enum + + HOLD: :HOLD + + def self?.values: -> ::Array[Lithic::Models::Hold::family] + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::Hold::result] + end + end + end +end diff --git a/sig/lithic/models/hold_create_params.rbs b/sig/lithic/models/hold_create_params.rbs new file mode 100644 index 00000000..829d7f61 --- /dev/null +++ b/sig/lithic/models/hold_create_params.rbs @@ -0,0 +1,57 @@ +module Lithic + module Models + type hold_create_params = + { + financial_account_token: String, + amount: Integer, + token: String, + expiration_datetime: Time, + memo: String?, + user_defined_id: String + } + & Lithic::Internal::Type::request_parameters + + class HoldCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor financial_account_token: String + + attr_accessor amount: Integer + + attr_reader token: String? + + def token=: (String) -> String + + attr_reader expiration_datetime: Time? + + def expiration_datetime=: (Time) -> Time + + attr_accessor memo: String? + + attr_reader user_defined_id: String? + + def user_defined_id=: (String) -> String + + def initialize: ( + financial_account_token: String, + amount: Integer, + ?token: String, + ?expiration_datetime: Time, + ?memo: String?, + ?user_defined_id: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + financial_account_token: String, + amount: Integer, + token: String, + expiration_datetime: Time, + memo: String?, + user_defined_id: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/hold_event.rbs b/sig/lithic/models/hold_event.rbs new file mode 100644 index 00000000..46a50e0f --- /dev/null +++ b/sig/lithic/models/hold_event.rbs @@ -0,0 +1,91 @@ +module Lithic + module Models + type hold_event = + { + token: String, + amount: Integer, + created: Time, + detailed_results: ::Array[Lithic::Models::HoldEvent::detailed_result], + memo: String?, + result: Lithic::Models::HoldEvent::result, + settling_transaction_token: String?, + type: Lithic::Models::HoldEvent::type_ + } + + class HoldEvent < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor amount: Integer + + attr_accessor created: Time + + attr_accessor detailed_results: ::Array[Lithic::Models::HoldEvent::detailed_result] + + attr_accessor memo: String? + + attr_accessor result: Lithic::Models::HoldEvent::result + + attr_accessor settling_transaction_token: String? + + attr_accessor type: Lithic::Models::HoldEvent::type_ + + def initialize: ( + token: String, + amount: Integer, + created: Time, + detailed_results: ::Array[Lithic::Models::HoldEvent::detailed_result], + memo: String?, + result: Lithic::Models::HoldEvent::result, + settling_transaction_token: String?, + type: Lithic::Models::HoldEvent::type_ + ) -> void + + def to_hash: -> { + token: String, + amount: Integer, + created: Time, + detailed_results: ::Array[Lithic::Models::HoldEvent::detailed_result], + memo: String?, + result: Lithic::Models::HoldEvent::result, + settling_transaction_token: String?, + type: Lithic::Models::HoldEvent::type_ + } + + type detailed_result = :APPROVED | :INSUFFICIENT_FUNDS + + module DetailedResult + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + + def self?.values: -> ::Array[Lithic::Models::HoldEvent::detailed_result] + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::HoldEvent::result] + end + + type type_ = + :HOLD_INITIATED | :HOLD_VOIDED | :HOLD_EXPIRED | :HOLD_SETTLED + + module Type + extend Lithic::Internal::Type::Enum + + HOLD_INITIATED: :HOLD_INITIATED + HOLD_VOIDED: :HOLD_VOIDED + HOLD_EXPIRED: :HOLD_EXPIRED + HOLD_SETTLED: :HOLD_SETTLED + + def self?.values: -> ::Array[Lithic::Models::HoldEvent::type_] + end + end + end +end diff --git a/sig/lithic/models/hold_list_params.rbs b/sig/lithic/models/hold_list_params.rbs new file mode 100644 index 00000000..b8f95641 --- /dev/null +++ b/sig/lithic/models/hold_list_params.rbs @@ -0,0 +1,83 @@ +module Lithic + module Models + type hold_list_params = + { + financial_account_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::Models::HoldListParams::status + } + & Lithic::Internal::Type::request_parameters + + class HoldListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor financial_account_token: String + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader status: Lithic::Models::HoldListParams::status? + + def status=: ( + Lithic::Models::HoldListParams::status + ) -> Lithic::Models::HoldListParams::status + + def initialize: ( + financial_account_token: String, + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?status: Lithic::Models::HoldListParams::status, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + financial_account_token: String, + begin_: Time, + end_: Time, + ending_before: String, + page_size: Integer, + starting_after: String, + status: Lithic::Models::HoldListParams::status, + request_options: Lithic::RequestOptions + } + + type status = :PENDING | :SETTLED | :EXPIRED | :VOIDED + + module Status + extend Lithic::Internal::Type::Enum + + PENDING: :PENDING + SETTLED: :SETTLED + EXPIRED: :EXPIRED + VOIDED: :VOIDED + + def self?.values: -> ::Array[Lithic::Models::HoldListParams::status] + end + end + end +end diff --git a/sig/lithic/models/hold_retrieve_params.rbs b/sig/lithic/models/hold_retrieve_params.rbs new file mode 100644 index 00000000..0792505e --- /dev/null +++ b/sig/lithic/models/hold_retrieve_params.rbs @@ -0,0 +1,23 @@ +module Lithic + module Models + type hold_retrieve_params = + { hold_token: String } & Lithic::Internal::Type::request_parameters + + class HoldRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor hold_token: String + + def initialize: ( + hold_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + hold_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/hold_void_params.rbs b/sig/lithic/models/hold_void_params.rbs new file mode 100644 index 00000000..c788a86f --- /dev/null +++ b/sig/lithic/models/hold_void_params.rbs @@ -0,0 +1,28 @@ +module Lithic + module Models + type hold_void_params = + { hold_token: String, memo: String? } + & Lithic::Internal::Type::request_parameters + + class HoldVoidParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor hold_token: String + + attr_accessor memo: String? + + def initialize: ( + hold_token: String, + ?memo: String?, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + hold_token: String, + memo: String?, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/instance_financial_account_type.rbs b/sig/lithic/models/instance_financial_account_type.rbs new file mode 100644 index 00000000..8f01f0e1 --- /dev/null +++ b/sig/lithic/models/instance_financial_account_type.rbs @@ -0,0 +1,36 @@ +module Lithic + module Models + type instance_financial_account_type = + :ISSUING + | :RESERVE + | :OPERATING + | :CHARGED_OFF_FEES + | :CHARGED_OFF_INTEREST + | :CHARGED_OFF_PRINCIPAL + | :SECURITY + | :PROGRAM_RECEIVABLES + | :COLLECTION + | :PROGRAM_BANK_ACCOUNTS_PAYABLE + | :EARLY_DIRECT_DEPOSIT_FLOAT + | :PROVISIONAL_CREDIT_ACCOUNT + + module InstanceFinancialAccountType + extend Lithic::Internal::Type::Enum + + ISSUING: :ISSUING + RESERVE: :RESERVE + OPERATING: :OPERATING + CHARGED_OFF_FEES: :CHARGED_OFF_FEES + CHARGED_OFF_INTEREST: :CHARGED_OFF_INTEREST + CHARGED_OFF_PRINCIPAL: :CHARGED_OFF_PRINCIPAL + SECURITY: :SECURITY + PROGRAM_RECEIVABLES: :PROGRAM_RECEIVABLES + COLLECTION: :COLLECTION + PROGRAM_BANK_ACCOUNTS_PAYABLE: :PROGRAM_BANK_ACCOUNTS_PAYABLE + EARLY_DIRECT_DEPOSIT_FLOAT: :EARLY_DIRECT_DEPOSIT_FLOAT + PROVISIONAL_CREDIT_ACCOUNT: :PROVISIONAL_CREDIT_ACCOUNT + + def self?.values: -> ::Array[Lithic::Models::instance_financial_account_type] + end + end +end diff --git a/sig/lithic/models/internal_transaction.rbs b/sig/lithic/models/internal_transaction.rbs new file mode 100644 index 00000000..d59aed2a --- /dev/null +++ b/sig/lithic/models/internal_transaction.rbs @@ -0,0 +1,165 @@ +module Lithic + module Models + type internal_transaction_api = + { + token: String, + category: Lithic::Models::InternalTransactionAPI::category, + created: Time, + currency: String, + descriptor: String, + events: ::Array[Lithic::InternalTransactionAPI::Event], + pending_amount: Integer, + result: Lithic::Models::InternalTransactionAPI::result, + settled_amount: Integer, + status: Lithic::Models::InternalTransactionAPI::status, + updated: Time + } + + class InternalTransactionAPI < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor category: Lithic::Models::InternalTransactionAPI::category + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor descriptor: String + + attr_accessor events: ::Array[Lithic::InternalTransactionAPI::Event] + + attr_accessor pending_amount: Integer + + attr_accessor result: Lithic::Models::InternalTransactionAPI::result + + attr_accessor settled_amount: Integer + + attr_accessor status: Lithic::Models::InternalTransactionAPI::status + + attr_accessor updated: Time + + def initialize: ( + token: String, + category: Lithic::Models::InternalTransactionAPI::category, + created: Time, + currency: String, + descriptor: String, + events: ::Array[Lithic::InternalTransactionAPI::Event], + pending_amount: Integer, + result: Lithic::Models::InternalTransactionAPI::result, + settled_amount: Integer, + status: Lithic::Models::InternalTransactionAPI::status, + updated: Time + ) -> void + + def to_hash: -> { + token: String, + category: Lithic::Models::InternalTransactionAPI::category, + created: Time, + currency: String, + descriptor: String, + events: ::Array[Lithic::InternalTransactionAPI::Event], + pending_amount: Integer, + result: Lithic::Models::InternalTransactionAPI::result, + settled_amount: Integer, + status: Lithic::Models::InternalTransactionAPI::status, + updated: Time + } + + type category = :INTERNAL + + module Category + extend Lithic::Internal::Type::Enum + + INTERNAL: :INTERNAL + + def self?.values: -> ::Array[Lithic::Models::InternalTransactionAPI::category] + end + + type event = + { + token: String, + amount: Integer, + created: Time, + result: Lithic::Models::InternalTransactionAPI::Event::result, + type: Lithic::Models::InternalTransactionAPI::Event::type_ + } + + class Event < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor amount: Integer + + attr_accessor created: Time + + attr_accessor result: Lithic::Models::InternalTransactionAPI::Event::result + + attr_accessor type: Lithic::Models::InternalTransactionAPI::Event::type_ + + def initialize: ( + token: String, + amount: Integer, + created: Time, + result: Lithic::Models::InternalTransactionAPI::Event::result, + type: Lithic::Models::InternalTransactionAPI::Event::type_ + ) -> void + + def to_hash: -> { + token: String, + amount: Integer, + created: Time, + result: Lithic::Models::InternalTransactionAPI::Event::result, + type: Lithic::Models::InternalTransactionAPI::Event::type_ + } + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::InternalTransactionAPI::Event::result] + end + + type type_ = :INTERNAL_ADJUSTMENT + + module Type + extend Lithic::Internal::Type::Enum + + INTERNAL_ADJUSTMENT: :INTERNAL_ADJUSTMENT + + def self?.values: -> ::Array[Lithic::Models::InternalTransactionAPI::Event::type_] + end + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::InternalTransactionAPI::result] + end + + type status = + :PENDING | :SETTLED | :DECLINED | :REVERSED | :CANCELED | :RETURNED + + module Status + extend Lithic::Internal::Type::Enum + + PENDING: :PENDING + SETTLED: :SETTLED + DECLINED: :DECLINED + REVERSED: :REVERSED + CANCELED: :CANCELED + RETURNED: :RETURNED + + def self?.values: -> ::Array[Lithic::Models::InternalTransactionAPI::status] + end + end + end +end diff --git a/sig/lithic/models/internal_transaction_created_webhook_event.rbs b/sig/lithic/models/internal_transaction_created_webhook_event.rbs new file mode 100644 index 00000000..20e6061d --- /dev/null +++ b/sig/lithic/models/internal_transaction_created_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type internal_transaction_created_webhook_event = + { event_type: :"internal_transaction.created" } + + class InternalTransactionCreatedWebhookEvent < Lithic::Models::InternalTransactionAPI + def event_type: -> :"internal_transaction.created" + + def event_type=: ( + :"internal_transaction.created" _ + ) -> :"internal_transaction.created" + + def initialize: (?event_type: :"internal_transaction.created") -> void + + def to_hash: -> { event_type: :"internal_transaction.created" } + end + end +end diff --git a/sig/lithic/models/internal_transaction_updated_webhook_event.rbs b/sig/lithic/models/internal_transaction_updated_webhook_event.rbs new file mode 100644 index 00000000..45bc3e5b --- /dev/null +++ b/sig/lithic/models/internal_transaction_updated_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type internal_transaction_updated_webhook_event = + { event_type: :"internal_transaction.updated" } + + class InternalTransactionUpdatedWebhookEvent < Lithic::Models::InternalTransactionAPI + def event_type: -> :"internal_transaction.updated" + + def event_type=: ( + :"internal_transaction.updated" _ + ) -> :"internal_transaction.updated" + + def initialize: (?event_type: :"internal_transaction.updated") -> void + + def to_hash: -> { event_type: :"internal_transaction.updated" } + end + end +end diff --git a/sig/lithic/models/kyb.rbs b/sig/lithic/models/kyb.rbs new file mode 100644 index 00000000..fd8d69e7 --- /dev/null +++ b/sig/lithic/models/kyb.rbs @@ -0,0 +1,228 @@ +module Lithic + module Models + type kyb = + { + beneficial_owner_individuals: ::Array[Lithic::KYB::BeneficialOwnerIndividual], + business_entity: Lithic::KYB::BusinessEntity, + control_person: Lithic::KYB::ControlPerson, + nature_of_business: String, + tos_timestamp: String, + workflow: Lithic::Models::KYB::workflow, + external_id: String, + kyb_passed_timestamp: String, + naics_code: String, + website_url: String + } + + class KYB < Lithic::Internal::Type::BaseModel + attr_accessor beneficial_owner_individuals: ::Array[Lithic::KYB::BeneficialOwnerIndividual] + + attr_accessor business_entity: Lithic::KYB::BusinessEntity + + attr_accessor control_person: Lithic::KYB::ControlPerson + + attr_accessor nature_of_business: String + + attr_accessor tos_timestamp: String + + attr_accessor workflow: Lithic::Models::KYB::workflow + + attr_reader external_id: String? + + def external_id=: (String) -> String + + attr_reader kyb_passed_timestamp: String? + + def kyb_passed_timestamp=: (String) -> String + + attr_reader naics_code: String? + + def naics_code=: (String) -> String + + attr_reader website_url: String? + + def website_url=: (String) -> String + + def initialize: ( + beneficial_owner_individuals: ::Array[Lithic::KYB::BeneficialOwnerIndividual], + business_entity: Lithic::KYB::BusinessEntity, + control_person: Lithic::KYB::ControlPerson, + nature_of_business: String, + tos_timestamp: String, + workflow: Lithic::Models::KYB::workflow, + ?external_id: String, + ?kyb_passed_timestamp: String, + ?naics_code: String, + ?website_url: String + ) -> void + + def to_hash: -> { + beneficial_owner_individuals: ::Array[Lithic::KYB::BeneficialOwnerIndividual], + business_entity: Lithic::KYB::BusinessEntity, + control_person: Lithic::KYB::ControlPerson, + nature_of_business: String, + tos_timestamp: String, + workflow: Lithic::Models::KYB::workflow, + external_id: String, + kyb_passed_timestamp: String, + naics_code: String, + website_url: String + } + + type beneficial_owner_individual = + { + address: Lithic::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + attr_accessor address: Lithic::Address + + attr_accessor dob: String + + attr_accessor email: String + + attr_accessor first_name: String + + attr_accessor government_id: String + + attr_accessor last_name: String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + address: Lithic::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + address: Lithic::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + end + + type business_entity = + { + address: Lithic::Address, + government_id: String, + legal_business_name: String, + phone_numbers: ::Array[String], + dba_business_name: String, + parent_company: String + } + + class BusinessEntity < Lithic::Internal::Type::BaseModel + attr_accessor address: Lithic::Address + + attr_accessor government_id: String + + attr_accessor legal_business_name: String + + attr_accessor phone_numbers: ::Array[String] + + attr_reader dba_business_name: String? + + def dba_business_name=: (String) -> String + + attr_reader parent_company: String? + + def parent_company=: (String) -> String + + def initialize: ( + address: Lithic::Address, + government_id: String, + legal_business_name: String, + phone_numbers: ::Array[String], + ?dba_business_name: String, + ?parent_company: String + ) -> void + + def to_hash: -> { + address: Lithic::Address, + government_id: String, + legal_business_name: String, + phone_numbers: ::Array[String], + dba_business_name: String, + parent_company: String + } + end + + type control_person = + { + address: Lithic::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class ControlPerson < Lithic::Internal::Type::BaseModel + attr_accessor address: Lithic::Address + + attr_accessor dob: String + + attr_accessor email: String + + attr_accessor first_name: String + + attr_accessor government_id: String + + attr_accessor last_name: String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + address: Lithic::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + address: Lithic::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + end + + type workflow = :KYB_BASIC | :KYB_BYO + + module Workflow + extend Lithic::Internal::Type::Enum + + KYB_BASIC: :KYB_BASIC + KYB_BYO: :KYB_BYO + + def self?.values: -> ::Array[Lithic::Models::KYB::workflow] + end + end + end +end diff --git a/sig/lithic/models/kyb_business_entity.rbs b/sig/lithic/models/kyb_business_entity.rbs new file mode 100644 index 00000000..fecce586 --- /dev/null +++ b/sig/lithic/models/kyb_business_entity.rbs @@ -0,0 +1,91 @@ +module Lithic + module Models + type kyb_business_entity = + { + address: Lithic::KYBBusinessEntity::Address, + government_id: String, + legal_business_name: String, + phone_numbers: ::Array[String], + dba_business_name: String, + parent_company: String? + } + + class KYBBusinessEntity < Lithic::Internal::Type::BaseModel + attr_accessor address: Lithic::KYBBusinessEntity::Address + + attr_accessor government_id: String + + attr_accessor legal_business_name: String + + attr_accessor phone_numbers: ::Array[String] + + attr_reader dba_business_name: String? + + def dba_business_name=: (String) -> String + + attr_accessor parent_company: String? + + def initialize: ( + address: Lithic::KYBBusinessEntity::Address, + government_id: String, + legal_business_name: String, + phone_numbers: ::Array[String], + ?dba_business_name: String, + ?parent_company: String? + ) -> void + + def to_hash: -> { + address: Lithic::KYBBusinessEntity::Address, + government_id: String, + legal_business_name: String, + phone_numbers: ::Array[String], + dba_business_name: String, + parent_company: String? + } + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::Internal::Type::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + end + end + end +end diff --git a/sig/lithic/models/kyc.rbs b/sig/lithic/models/kyc.rbs new file mode 100644 index 00000000..78550500 --- /dev/null +++ b/sig/lithic/models/kyc.rbs @@ -0,0 +1,102 @@ +module Lithic + module Models + type kyc = + { + individual: Lithic::KYC::Individual, + tos_timestamp: String, + workflow: Lithic::Models::KYC::workflow, + external_id: String, + kyc_passed_timestamp: String + } + + class KYC < Lithic::Internal::Type::BaseModel + attr_accessor individual: Lithic::KYC::Individual + + attr_accessor tos_timestamp: String + + attr_accessor workflow: Lithic::Models::KYC::workflow + + attr_reader external_id: String? + + def external_id=: (String) -> String + + attr_reader kyc_passed_timestamp: String? + + def kyc_passed_timestamp=: (String) -> String + + def initialize: ( + individual: Lithic::KYC::Individual, + tos_timestamp: String, + workflow: Lithic::Models::KYC::workflow, + ?external_id: String, + ?kyc_passed_timestamp: String + ) -> void + + def to_hash: -> { + individual: Lithic::KYC::Individual, + tos_timestamp: String, + workflow: Lithic::Models::KYC::workflow, + external_id: String, + kyc_passed_timestamp: String + } + + type individual = + { + address: Lithic::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class Individual < Lithic::Internal::Type::BaseModel + attr_accessor address: Lithic::Address + + attr_accessor dob: String + + attr_accessor email: String + + attr_accessor first_name: String + + attr_accessor government_id: String + + attr_accessor last_name: String + + attr_accessor phone_number: String + + def initialize: ( + address: Lithic::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + ) -> void + + def to_hash: -> { + address: Lithic::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + end + + type workflow = :KYC_BASIC | :KYC_BYO + + module Workflow + extend Lithic::Internal::Type::Enum + + KYC_BASIC: :KYC_BASIC + KYC_BYO: :KYC_BYO + + def self?.values: -> ::Array[Lithic::Models::KYC::workflow] + end + end + end +end diff --git a/sig/lithic/models/kyc_exempt.rbs b/sig/lithic/models/kyc_exempt.rbs new file mode 100644 index 00000000..6bbd1a19 --- /dev/null +++ b/sig/lithic/models/kyc_exempt.rbs @@ -0,0 +1,85 @@ +module Lithic + module Models + type kyc_exempt = + { + address: Lithic::Address, + email: String, + first_name: String, + kyc_exemption_type: Lithic::Models::KYCExempt::kyc_exemption_type, + last_name: String, + phone_number: String, + workflow: Lithic::Models::KYCExempt::workflow, + business_account_token: String, + external_id: String + } + + class KYCExempt < Lithic::Internal::Type::BaseModel + attr_accessor address: Lithic::Address + + attr_accessor email: String + + attr_accessor first_name: String + + attr_accessor kyc_exemption_type: Lithic::Models::KYCExempt::kyc_exemption_type + + attr_accessor last_name: String + + attr_accessor phone_number: String + + attr_accessor workflow: Lithic::Models::KYCExempt::workflow + + attr_reader business_account_token: String? + + def business_account_token=: (String) -> String + + attr_reader external_id: String? + + def external_id=: (String) -> String + + def initialize: ( + address: Lithic::Address, + email: String, + first_name: String, + kyc_exemption_type: Lithic::Models::KYCExempt::kyc_exemption_type, + last_name: String, + phone_number: String, + workflow: Lithic::Models::KYCExempt::workflow, + ?business_account_token: String, + ?external_id: String + ) -> void + + def to_hash: -> { + address: Lithic::Address, + email: String, + first_name: String, + kyc_exemption_type: Lithic::Models::KYCExempt::kyc_exemption_type, + last_name: String, + phone_number: String, + workflow: Lithic::Models::KYCExempt::workflow, + business_account_token: String, + external_id: String + } + + type kyc_exemption_type = :AUTHORIZED_USER | :PREPAID_CARD_USER + + module KYCExemptionType + extend Lithic::Internal::Type::Enum + + AUTHORIZED_USER: :AUTHORIZED_USER + PREPAID_CARD_USER: :PREPAID_CARD_USER + + def self?.values: -> ::Array[Lithic::Models::KYCExempt::kyc_exemption_type] + end + + type workflow = :KYC_EXEMPT + + module Workflow + extend Lithic::Internal::Type::Enum + + KYC_EXEMPT: :KYC_EXEMPT + + def self?.values: -> ::Array[Lithic::Models::KYCExempt::workflow] + end + end + end +end diff --git a/sig/lithic/models/loan_tape_created_webhook_event.rbs b/sig/lithic/models/loan_tape_created_webhook_event.rbs new file mode 100644 index 00000000..d172f3b9 --- /dev/null +++ b/sig/lithic/models/loan_tape_created_webhook_event.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type loan_tape_created_webhook_event = { event_type: :"loan_tape.created" } + + class LoanTapeCreatedWebhookEvent < Lithic::Models::FinancialAccounts::LoanTape + def event_type: -> :"loan_tape.created" + + def event_type=: (:"loan_tape.created" _) -> :"loan_tape.created" + + def initialize: (?event_type: :"loan_tape.created") -> void + + def to_hash: -> { event_type: :"loan_tape.created" } + end + end +end diff --git a/sig/lithic/models/loan_tape_updated_webhook_event.rbs b/sig/lithic/models/loan_tape_updated_webhook_event.rbs new file mode 100644 index 00000000..48116fb0 --- /dev/null +++ b/sig/lithic/models/loan_tape_updated_webhook_event.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type loan_tape_updated_webhook_event = { event_type: :"loan_tape.updated" } + + class LoanTapeUpdatedWebhookEvent < Lithic::Models::FinancialAccounts::LoanTape + def event_type: -> :"loan_tape.updated" + + def event_type=: (:"loan_tape.updated" _) -> :"loan_tape.updated" + + def initialize: (?event_type: :"loan_tape.updated") -> void + + def to_hash: -> { event_type: :"loan_tape.updated" } + end + end +end diff --git a/sig/lithic/models/management_operation_create_params.rbs b/sig/lithic/models/management_operation_create_params.rbs new file mode 100644 index 00000000..3863796c --- /dev/null +++ b/sig/lithic/models/management_operation_create_params.rbs @@ -0,0 +1,188 @@ +module Lithic + module Models + type management_operation_create_params = + { + amount: Integer, + category: Lithic::Models::ManagementOperationCreateParams::category, + direction: Lithic::Models::ManagementOperationCreateParams::direction, + effective_date: Date, + event_type: Lithic::Models::ManagementOperationCreateParams::event_type, + financial_account_token: String, + token: String, + memo: String, + on_closed_account: Lithic::Models::ManagementOperationCreateParams::on_closed_account, + subtype: String, + user_defined_id: String + } + & Lithic::Internal::Type::request_parameters + + class ManagementOperationCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor amount: Integer + + attr_accessor category: Lithic::Models::ManagementOperationCreateParams::category + + attr_accessor direction: Lithic::Models::ManagementOperationCreateParams::direction + + attr_accessor effective_date: Date + + attr_accessor event_type: Lithic::Models::ManagementOperationCreateParams::event_type + + attr_accessor financial_account_token: String + + attr_reader token: String? + + def token=: (String) -> String + + attr_reader memo: String? + + def memo=: (String) -> String + + attr_reader on_closed_account: Lithic::Models::ManagementOperationCreateParams::on_closed_account? + + def on_closed_account=: ( + Lithic::Models::ManagementOperationCreateParams::on_closed_account + ) -> Lithic::Models::ManagementOperationCreateParams::on_closed_account + + attr_reader subtype: String? + + def subtype=: (String) -> String + + attr_reader user_defined_id: String? + + def user_defined_id=: (String) -> String + + def initialize: ( + amount: Integer, + category: Lithic::Models::ManagementOperationCreateParams::category, + direction: Lithic::Models::ManagementOperationCreateParams::direction, + effective_date: Date, + event_type: Lithic::Models::ManagementOperationCreateParams::event_type, + financial_account_token: String, + ?token: String, + ?memo: String, + ?on_closed_account: Lithic::Models::ManagementOperationCreateParams::on_closed_account, + ?subtype: String, + ?user_defined_id: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + amount: Integer, + category: Lithic::Models::ManagementOperationCreateParams::category, + direction: Lithic::Models::ManagementOperationCreateParams::direction, + effective_date: Date, + event_type: Lithic::Models::ManagementOperationCreateParams::event_type, + financial_account_token: String, + token: String, + memo: String, + on_closed_account: Lithic::Models::ManagementOperationCreateParams::on_closed_account, + subtype: String, + user_defined_id: String, + request_options: Lithic::RequestOptions + } + + type category = + :MANAGEMENT_FEE + | :MANAGEMENT_DISPUTE + | :MANAGEMENT_REWARD + | :MANAGEMENT_ADJUSTMENT + | :MANAGEMENT_DISBURSEMENT + + module Category + extend Lithic::Internal::Type::Enum + + MANAGEMENT_FEE: :MANAGEMENT_FEE + MANAGEMENT_DISPUTE: :MANAGEMENT_DISPUTE + MANAGEMENT_REWARD: :MANAGEMENT_REWARD + MANAGEMENT_ADJUSTMENT: :MANAGEMENT_ADJUSTMENT + MANAGEMENT_DISBURSEMENT: :MANAGEMENT_DISBURSEMENT + + def self?.values: -> ::Array[Lithic::Models::ManagementOperationCreateParams::category] + end + + type direction = :CREDIT | :DEBIT + + module Direction + extend Lithic::Internal::Type::Enum + + CREDIT: :CREDIT + DEBIT: :DEBIT + + def self?.values: -> ::Array[Lithic::Models::ManagementOperationCreateParams::direction] + end + + type event_type = + :LOSS_WRITE_OFF + | :CASH_BACK + | :CASH_BACK_REVERSAL + | :CURRENCY_CONVERSION + | :CURRENCY_CONVERSION_REVERSAL + | :INTEREST + | :INTEREST_REVERSAL + | :LATE_PAYMENT + | :LATE_PAYMENT_REVERSAL + | :BILLING_ERROR + | :BILLING_ERROR_REVERSAL + | :PROVISIONAL_CREDIT + | :PROVISIONAL_CREDIT_REVERSAL + | :RETURNED_PAYMENT + | :RETURNED_PAYMENT_REVERSAL + | :DISPUTE_WON + | :DISPUTE_WON_REVERSAL + | :DISBURSE + | :DISBURSE_REVERSAL + | :ANNUAL + | :ANNUAL_REVERSAL + | :QUARTERLY + | :QUARTERLY_REVERSAL + | :MONTHLY + | :MONTHLY_REVERSAL + + module EventType + extend Lithic::Internal::Type::Enum + + LOSS_WRITE_OFF: :LOSS_WRITE_OFF + CASH_BACK: :CASH_BACK + CASH_BACK_REVERSAL: :CASH_BACK_REVERSAL + CURRENCY_CONVERSION: :CURRENCY_CONVERSION + CURRENCY_CONVERSION_REVERSAL: :CURRENCY_CONVERSION_REVERSAL + INTEREST: :INTEREST + INTEREST_REVERSAL: :INTEREST_REVERSAL + LATE_PAYMENT: :LATE_PAYMENT + LATE_PAYMENT_REVERSAL: :LATE_PAYMENT_REVERSAL + BILLING_ERROR: :BILLING_ERROR + BILLING_ERROR_REVERSAL: :BILLING_ERROR_REVERSAL + PROVISIONAL_CREDIT: :PROVISIONAL_CREDIT + PROVISIONAL_CREDIT_REVERSAL: :PROVISIONAL_CREDIT_REVERSAL + RETURNED_PAYMENT: :RETURNED_PAYMENT + RETURNED_PAYMENT_REVERSAL: :RETURNED_PAYMENT_REVERSAL + DISPUTE_WON: :DISPUTE_WON + DISPUTE_WON_REVERSAL: :DISPUTE_WON_REVERSAL + DISBURSE: :DISBURSE + DISBURSE_REVERSAL: :DISBURSE_REVERSAL + ANNUAL: :ANNUAL + ANNUAL_REVERSAL: :ANNUAL_REVERSAL + QUARTERLY: :QUARTERLY + QUARTERLY_REVERSAL: :QUARTERLY_REVERSAL + MONTHLY: :MONTHLY + MONTHLY_REVERSAL: :MONTHLY_REVERSAL + + def self?.values: -> ::Array[Lithic::Models::ManagementOperationCreateParams::event_type] + end + + type on_closed_account = :FAIL | :USE_SUSPENSE + + module OnClosedAccount + extend Lithic::Internal::Type::Enum + + FAIL: :FAIL + USE_SUSPENSE: :USE_SUSPENSE + + def self?.values: -> ::Array[Lithic::Models::ManagementOperationCreateParams::on_closed_account] + end + end + end +end diff --git a/sig/lithic/models/management_operation_created_webhook_event.rbs b/sig/lithic/models/management_operation_created_webhook_event.rbs new file mode 100644 index 00000000..c07f1dcb --- /dev/null +++ b/sig/lithic/models/management_operation_created_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type management_operation_created_webhook_event = + { event_type: :"management_operation.created" } + + class ManagementOperationCreatedWebhookEvent < Lithic::Models::ManagementOperationTransaction + def event_type: -> :"management_operation.created" + + def event_type=: ( + :"management_operation.created" _ + ) -> :"management_operation.created" + + def initialize: (?event_type: :"management_operation.created") -> void + + def to_hash: -> { event_type: :"management_operation.created" } + end + end +end diff --git a/sig/lithic/models/management_operation_list_params.rbs b/sig/lithic/models/management_operation_list_params.rbs new file mode 100644 index 00000000..cb2091da --- /dev/null +++ b/sig/lithic/models/management_operation_list_params.rbs @@ -0,0 +1,123 @@ +module Lithic + module Models + type management_operation_list_params = + { + begin_: Time, + business_account_token: String, + category: Lithic::Models::ManagementOperationListParams::category, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + starting_after: String, + status: Lithic::Models::ManagementOperationListParams::status + } + & Lithic::Internal::Type::request_parameters + + class ManagementOperationListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader business_account_token: String? + + def business_account_token=: (String) -> String + + attr_reader category: Lithic::Models::ManagementOperationListParams::category? + + def category=: ( + Lithic::Models::ManagementOperationListParams::category + ) -> Lithic::Models::ManagementOperationListParams::category + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader financial_account_token: String? + + def financial_account_token=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader status: Lithic::Models::ManagementOperationListParams::status? + + def status=: ( + Lithic::Models::ManagementOperationListParams::status + ) -> Lithic::Models::ManagementOperationListParams::status + + def initialize: ( + ?begin_: Time, + ?business_account_token: String, + ?category: Lithic::Models::ManagementOperationListParams::category, + ?end_: Time, + ?ending_before: String, + ?financial_account_token: String, + ?page_size: Integer, + ?starting_after: String, + ?status: Lithic::Models::ManagementOperationListParams::status, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + begin_: Time, + business_account_token: String, + category: Lithic::Models::ManagementOperationListParams::category, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + starting_after: String, + status: Lithic::Models::ManagementOperationListParams::status, + request_options: Lithic::RequestOptions + } + + type category = + :MANAGEMENT_FEE + | :MANAGEMENT_DISPUTE + | :MANAGEMENT_REWARD + | :MANAGEMENT_ADJUSTMENT + | :MANAGEMENT_DISBURSEMENT + + module Category + extend Lithic::Internal::Type::Enum + + MANAGEMENT_FEE: :MANAGEMENT_FEE + MANAGEMENT_DISPUTE: :MANAGEMENT_DISPUTE + MANAGEMENT_REWARD: :MANAGEMENT_REWARD + MANAGEMENT_ADJUSTMENT: :MANAGEMENT_ADJUSTMENT + MANAGEMENT_DISBURSEMENT: :MANAGEMENT_DISBURSEMENT + + def self?.values: -> ::Array[Lithic::Models::ManagementOperationListParams::category] + end + + type status = + :PENDING | :SETTLED | :DECLINED | :REVERSED | :CANCELED | :RETURNED + + module Status + extend Lithic::Internal::Type::Enum + + PENDING: :PENDING + SETTLED: :SETTLED + DECLINED: :DECLINED + REVERSED: :REVERSED + CANCELED: :CANCELED + RETURNED: :RETURNED + + def self?.values: -> ::Array[Lithic::Models::ManagementOperationListParams::status] + end + end + end +end diff --git a/sig/lithic/models/management_operation_retrieve_params.rbs b/sig/lithic/models/management_operation_retrieve_params.rbs new file mode 100644 index 00000000..c6385cae --- /dev/null +++ b/sig/lithic/models/management_operation_retrieve_params.rbs @@ -0,0 +1,24 @@ +module Lithic + module Models + type management_operation_retrieve_params = + { management_operation_token: String } + & Lithic::Internal::Type::request_parameters + + class ManagementOperationRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor management_operation_token: String + + def initialize: ( + management_operation_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + management_operation_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/management_operation_reverse_params.rbs b/sig/lithic/models/management_operation_reverse_params.rbs new file mode 100644 index 00000000..ecea4188 --- /dev/null +++ b/sig/lithic/models/management_operation_reverse_params.rbs @@ -0,0 +1,34 @@ +module Lithic + module Models + type management_operation_reverse_params = + { management_operation_token: String, effective_date: Date, memo: String } + & Lithic::Internal::Type::request_parameters + + class ManagementOperationReverseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor management_operation_token: String + + attr_accessor effective_date: Date + + attr_reader memo: String? + + def memo=: (String) -> String + + def initialize: ( + management_operation_token: String, + effective_date: Date, + ?memo: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + management_operation_token: String, + effective_date: Date, + memo: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/management_operation_transaction.rbs b/sig/lithic/models/management_operation_transaction.rbs new file mode 100644 index 00000000..c00b9577 --- /dev/null +++ b/sig/lithic/models/management_operation_transaction.rbs @@ -0,0 +1,355 @@ +module Lithic + module Models + type management_operation_transaction = + { + token: String, + created: Time, + status: Lithic::Models::ManagementOperationTransaction::status, + updated: Time, + category: Lithic::Models::ManagementOperationTransaction::category, + currency: String, + direction: Lithic::Models::ManagementOperationTransaction::direction, + events: ::Array[Lithic::ManagementOperationTransaction::Event], + external_resource: Lithic::ExternalResource?, + family: Lithic::Models::ManagementOperationTransaction::family, + financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::ManagementOperationTransaction::result, + settled_amount: Integer, + transaction_series: Lithic::ManagementOperationTransaction::TransactionSeries?, + user_defined_id: String? + } + + class ManagementOperationTransaction < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor created: Time + + attr_accessor status: Lithic::Models::ManagementOperationTransaction::status + + attr_accessor updated: Time + + attr_reader category: Lithic::Models::ManagementOperationTransaction::category? + + def category=: ( + Lithic::Models::ManagementOperationTransaction::category + ) -> Lithic::Models::ManagementOperationTransaction::category + + attr_reader currency: String? + + def currency=: (String) -> String + + attr_reader direction: Lithic::Models::ManagementOperationTransaction::direction? + + def direction=: ( + Lithic::Models::ManagementOperationTransaction::direction + ) -> Lithic::Models::ManagementOperationTransaction::direction + + attr_reader events: ::Array[Lithic::ManagementOperationTransaction::Event]? + + def events=: ( + ::Array[Lithic::ManagementOperationTransaction::Event] + ) -> ::Array[Lithic::ManagementOperationTransaction::Event] + + attr_accessor external_resource: Lithic::ExternalResource? + + attr_reader family: Lithic::Models::ManagementOperationTransaction::family? + + def family=: ( + Lithic::Models::ManagementOperationTransaction::family + ) -> Lithic::Models::ManagementOperationTransaction::family + + attr_reader financial_account_token: String? + + def financial_account_token=: (String) -> String + + attr_reader pending_amount: Integer? + + def pending_amount=: (Integer) -> Integer + + attr_reader result: Lithic::Models::ManagementOperationTransaction::result? + + def result=: ( + Lithic::Models::ManagementOperationTransaction::result + ) -> Lithic::Models::ManagementOperationTransaction::result + + attr_reader settled_amount: Integer? + + def settled_amount=: (Integer) -> Integer + + attr_accessor transaction_series: Lithic::ManagementOperationTransaction::TransactionSeries? + + attr_accessor user_defined_id: String? + + def initialize: ( + token: String, + created: Time, + status: Lithic::Models::ManagementOperationTransaction::status, + updated: Time, + ?category: Lithic::Models::ManagementOperationTransaction::category, + ?currency: String, + ?direction: Lithic::Models::ManagementOperationTransaction::direction, + ?events: ::Array[Lithic::ManagementOperationTransaction::Event], + ?external_resource: Lithic::ExternalResource?, + ?family: Lithic::Models::ManagementOperationTransaction::family, + ?financial_account_token: String, + ?pending_amount: Integer, + ?result: Lithic::Models::ManagementOperationTransaction::result, + ?settled_amount: Integer, + ?transaction_series: Lithic::ManagementOperationTransaction::TransactionSeries?, + ?user_defined_id: String? + ) -> void + + def to_hash: -> { + token: String, + created: Time, + status: Lithic::Models::ManagementOperationTransaction::status, + updated: Time, + category: Lithic::Models::ManagementOperationTransaction::category, + currency: String, + direction: Lithic::Models::ManagementOperationTransaction::direction, + events: ::Array[Lithic::ManagementOperationTransaction::Event], + external_resource: Lithic::ExternalResource?, + family: Lithic::Models::ManagementOperationTransaction::family, + financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::ManagementOperationTransaction::result, + settled_amount: Integer, + transaction_series: Lithic::ManagementOperationTransaction::TransactionSeries?, + user_defined_id: String? + } + + type status = + :PENDING | :SETTLED | :DECLINED | :REVERSED | :CANCELED | :RETURNED + + module Status + extend Lithic::Internal::Type::Enum + + PENDING: :PENDING + SETTLED: :SETTLED + DECLINED: :DECLINED + REVERSED: :REVERSED + CANCELED: :CANCELED + RETURNED: :RETURNED + + def self?.values: -> ::Array[Lithic::Models::ManagementOperationTransaction::status] + end + + type category = + :MANAGEMENT_FEE + | :MANAGEMENT_DISPUTE + | :MANAGEMENT_REWARD + | :MANAGEMENT_ADJUSTMENT + | :MANAGEMENT_DISBURSEMENT + + module Category + extend Lithic::Internal::Type::Enum + + MANAGEMENT_FEE: :MANAGEMENT_FEE + MANAGEMENT_DISPUTE: :MANAGEMENT_DISPUTE + MANAGEMENT_REWARD: :MANAGEMENT_REWARD + MANAGEMENT_ADJUSTMENT: :MANAGEMENT_ADJUSTMENT + MANAGEMENT_DISBURSEMENT: :MANAGEMENT_DISBURSEMENT + + def self?.values: -> ::Array[Lithic::Models::ManagementOperationTransaction::category] + end + + type direction = :CREDIT | :DEBIT + + module Direction + extend Lithic::Internal::Type::Enum + + CREDIT: :CREDIT + DEBIT: :DEBIT + + def self?.values: -> ::Array[Lithic::Models::ManagementOperationTransaction::direction] + end + + type event = + { + token: String, + amount: Integer, + created: Time, + detailed_results: ::Array[Lithic::Models::ManagementOperationTransaction::Event::detailed_result], + effective_date: Date, + memo: String, + result: Lithic::Models::ManagementOperationTransaction::Event::result, + type: Lithic::Models::ManagementOperationTransaction::Event::type_, + subtype: String? + } + + class Event < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor amount: Integer + + attr_accessor created: Time + + attr_accessor detailed_results: ::Array[Lithic::Models::ManagementOperationTransaction::Event::detailed_result] + + attr_accessor effective_date: Date + + attr_accessor memo: String + + attr_accessor result: Lithic::Models::ManagementOperationTransaction::Event::result + + attr_accessor type: Lithic::Models::ManagementOperationTransaction::Event::type_ + + attr_accessor subtype: String? + + def initialize: ( + token: String, + amount: Integer, + created: Time, + detailed_results: ::Array[Lithic::Models::ManagementOperationTransaction::Event::detailed_result], + effective_date: Date, + memo: String, + result: Lithic::Models::ManagementOperationTransaction::Event::result, + type: Lithic::Models::ManagementOperationTransaction::Event::type_, + ?subtype: String? + ) -> void + + def to_hash: -> { + token: String, + amount: Integer, + created: Time, + detailed_results: ::Array[Lithic::Models::ManagementOperationTransaction::Event::detailed_result], + effective_date: Date, + memo: String, + result: Lithic::Models::ManagementOperationTransaction::Event::result, + type: Lithic::Models::ManagementOperationTransaction::Event::type_, + subtype: String? + } + + type detailed_result = :APPROVED | :INSUFFICIENT_FUNDS + + module DetailedResult + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + + def self?.values: -> ::Array[Lithic::Models::ManagementOperationTransaction::Event::detailed_result] + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::ManagementOperationTransaction::Event::result] + end + + type type_ = + :LOSS_WRITE_OFF + | :CASH_BACK + | :CASH_BACK_REVERSAL + | :CURRENCY_CONVERSION + | :CURRENCY_CONVERSION_REVERSAL + | :INTEREST + | :INTEREST_REVERSAL + | :LATE_PAYMENT + | :LATE_PAYMENT_REVERSAL + | :BILLING_ERROR + | :BILLING_ERROR_REVERSAL + | :PROVISIONAL_CREDIT + | :PROVISIONAL_CREDIT_REVERSAL + | :RETURNED_PAYMENT + | :RETURNED_PAYMENT_REVERSAL + | :DISPUTE_WON + | :DISPUTE_WON_REVERSAL + | :DISBURSE + | :DISBURSE_REVERSAL + | :ANNUAL + | :ANNUAL_REVERSAL + | :QUARTERLY + | :QUARTERLY_REVERSAL + | :MONTHLY + | :MONTHLY_REVERSAL + + module Type + extend Lithic::Internal::Type::Enum + + LOSS_WRITE_OFF: :LOSS_WRITE_OFF + CASH_BACK: :CASH_BACK + CASH_BACK_REVERSAL: :CASH_BACK_REVERSAL + CURRENCY_CONVERSION: :CURRENCY_CONVERSION + CURRENCY_CONVERSION_REVERSAL: :CURRENCY_CONVERSION_REVERSAL + INTEREST: :INTEREST + INTEREST_REVERSAL: :INTEREST_REVERSAL + LATE_PAYMENT: :LATE_PAYMENT + LATE_PAYMENT_REVERSAL: :LATE_PAYMENT_REVERSAL + BILLING_ERROR: :BILLING_ERROR + BILLING_ERROR_REVERSAL: :BILLING_ERROR_REVERSAL + PROVISIONAL_CREDIT: :PROVISIONAL_CREDIT + PROVISIONAL_CREDIT_REVERSAL: :PROVISIONAL_CREDIT_REVERSAL + RETURNED_PAYMENT: :RETURNED_PAYMENT + RETURNED_PAYMENT_REVERSAL: :RETURNED_PAYMENT_REVERSAL + DISPUTE_WON: :DISPUTE_WON + DISPUTE_WON_REVERSAL: :DISPUTE_WON_REVERSAL + DISBURSE: :DISBURSE + DISBURSE_REVERSAL: :DISBURSE_REVERSAL + ANNUAL: :ANNUAL + ANNUAL_REVERSAL: :ANNUAL_REVERSAL + QUARTERLY: :QUARTERLY + QUARTERLY_REVERSAL: :QUARTERLY_REVERSAL + MONTHLY: :MONTHLY + MONTHLY_REVERSAL: :MONTHLY_REVERSAL + + def self?.values: -> ::Array[Lithic::Models::ManagementOperationTransaction::Event::type_] + end + end + + type family = :MANAGEMENT_OPERATION + + module Family + extend Lithic::Internal::Type::Enum + + MANAGEMENT_OPERATION: :MANAGEMENT_OPERATION + + def self?.values: -> ::Array[Lithic::Models::ManagementOperationTransaction::family] + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::ManagementOperationTransaction::result] + end + + type transaction_series = + { + related_transaction_event_token: String?, + related_transaction_token: String?, + type: String + } + + class TransactionSeries < Lithic::Internal::Type::BaseModel + attr_accessor related_transaction_event_token: String? + + attr_accessor related_transaction_token: String? + + attr_accessor type: String + + def initialize: ( + related_transaction_event_token: String?, + related_transaction_token: String?, + type: String + ) -> void + + def to_hash: -> { + related_transaction_event_token: String?, + related_transaction_token: String?, + type: String + } + end + end + end +end diff --git a/sig/lithic/models/management_operation_updated_webhook_event.rbs b/sig/lithic/models/management_operation_updated_webhook_event.rbs new file mode 100644 index 00000000..bad1acfd --- /dev/null +++ b/sig/lithic/models/management_operation_updated_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type management_operation_updated_webhook_event = + { event_type: :"management_operation.updated" } + + class ManagementOperationUpdatedWebhookEvent < Lithic::Models::ManagementOperationTransaction + def event_type: -> :"management_operation.updated" + + def event_type=: ( + :"management_operation.updated" _ + ) -> :"management_operation.updated" + + def initialize: (?event_type: :"management_operation.updated") -> void + + def to_hash: -> { event_type: :"management_operation.updated" } + end + end +end diff --git a/sig/lithic/models/merchant.rbs b/sig/lithic/models/merchant.rbs new file mode 100644 index 00000000..ea97b352 --- /dev/null +++ b/sig/lithic/models/merchant.rbs @@ -0,0 +1,50 @@ +module Lithic + module Models + type merchant = + { + acceptor_id: String, + acquiring_institution_id: String, + city: String, + country: String, + descriptor: String, + mcc: String, + state: String + } + + class Merchant < Lithic::Internal::Type::BaseModel + attr_accessor acceptor_id: String + + attr_accessor acquiring_institution_id: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor descriptor: String + + attr_accessor mcc: String + + attr_accessor state: String + + def initialize: ( + acceptor_id: String, + acquiring_institution_id: String, + city: String, + country: String, + descriptor: String, + mcc: String, + state: String + ) -> void + + def to_hash: -> { + acceptor_id: String, + acquiring_institution_id: String, + city: String, + country: String, + descriptor: String, + mcc: String, + state: String + } + end + end +end diff --git a/sig/lithic/models/message_attempt.rbs b/sig/lithic/models/message_attempt.rbs new file mode 100644 index 00000000..c6eee60f --- /dev/null +++ b/sig/lithic/models/message_attempt.rbs @@ -0,0 +1,68 @@ +module Lithic + module Models + type message_attempt = + { + token: String, + created: Time, + event_subscription_token: String, + event_token: String, + response: String, + response_status_code: Integer, + status: Lithic::Models::MessageAttempt::status, + url: String + } + + class MessageAttempt < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor created: Time + + attr_accessor event_subscription_token: String + + attr_accessor event_token: String + + attr_accessor response: String + + attr_accessor response_status_code: Integer + + attr_accessor status: Lithic::Models::MessageAttempt::status + + attr_accessor url: String + + def initialize: ( + token: String, + created: Time, + event_subscription_token: String, + event_token: String, + response: String, + response_status_code: Integer, + status: Lithic::Models::MessageAttempt::status, + url: String + ) -> void + + def to_hash: -> { + token: String, + created: Time, + event_subscription_token: String, + event_token: String, + response: String, + response_status_code: Integer, + status: Lithic::Models::MessageAttempt::status, + url: String + } + + type status = :FAILED | :PENDING | :SENDING | :SUCCESS + + module Status + extend Lithic::Internal::Type::Enum + + FAILED: :FAILED + PENDING: :PENDING + SENDING: :SENDING + SUCCESS: :SUCCESS + + def self?.values: -> ::Array[Lithic::Models::MessageAttempt::status] + end + end + end +end diff --git a/sig/lithic/models/network_program.rbs b/sig/lithic/models/network_program.rbs new file mode 100644 index 00000000..680670ef --- /dev/null +++ b/sig/lithic/models/network_program.rbs @@ -0,0 +1,35 @@ +module Lithic + module Models + type network_program = + { + token: String, + default_product_code: String, + name: String, + registered_program_identification_number: String + } + + class NetworkProgram < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor default_product_code: String + + attr_accessor name: String + + attr_accessor registered_program_identification_number: String + + def initialize: ( + token: String, + default_product_code: String, + name: String, + registered_program_identification_number: String + ) -> void + + def to_hash: -> { + token: String, + default_product_code: String, + name: String, + registered_program_identification_number: String + } + end + end +end diff --git a/sig/lithic/models/network_program_list_params.rbs b/sig/lithic/models/network_program_list_params.rbs new file mode 100644 index 00000000..226627a5 --- /dev/null +++ b/sig/lithic/models/network_program_list_params.rbs @@ -0,0 +1,38 @@ +module Lithic + module Models + type network_program_list_params = + { begin_: Time, end_: Time, page_size: Integer } + & Lithic::Internal::Type::request_parameters + + class NetworkProgramListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + def initialize: ( + ?begin_: Time, + ?end_: Time, + ?page_size: Integer, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + begin_: Time, + end_: Time, + page_size: Integer, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/network_program_retrieve_params.rbs b/sig/lithic/models/network_program_retrieve_params.rbs new file mode 100644 index 00000000..ee068d28 --- /dev/null +++ b/sig/lithic/models/network_program_retrieve_params.rbs @@ -0,0 +1,24 @@ +module Lithic + module Models + type network_program_retrieve_params = + { network_program_token: String } + & Lithic::Internal::Type::request_parameters + + class NetworkProgramRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor network_program_token: String + + def initialize: ( + network_program_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + network_program_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/network_total.rbs b/sig/lithic/models/network_total.rbs new file mode 100644 index 00000000..54b224b8 --- /dev/null +++ b/sig/lithic/models/network_total.rbs @@ -0,0 +1,125 @@ +module Lithic + module Models + type network_total = + { + token: String, + amounts: Lithic::NetworkTotal::Amounts, + created: Time, + currency: String, + institution_id: String, + is_complete: bool, + network: Lithic::Models::NetworkTotal::network, + report_date: Date, + settlement_institution_id: String, + settlement_service: String, + updated: Time, + cycle: Integer + } + + class NetworkTotal < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor amounts: Lithic::NetworkTotal::Amounts + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor institution_id: String + + attr_accessor is_complete: bool + + attr_accessor network: Lithic::Models::NetworkTotal::network + + attr_accessor report_date: Date + + attr_accessor settlement_institution_id: String + + attr_accessor settlement_service: String + + attr_accessor updated: Time + + attr_reader cycle: Integer? + + def cycle=: (Integer) -> Integer + + def initialize: ( + token: String, + amounts: Lithic::NetworkTotal::Amounts, + created: Time, + currency: String, + institution_id: String, + is_complete: bool, + network: Lithic::Models::NetworkTotal::network, + report_date: Date, + settlement_institution_id: String, + settlement_service: String, + updated: Time, + ?cycle: Integer + ) -> void + + def to_hash: -> { + token: String, + amounts: Lithic::NetworkTotal::Amounts, + created: Time, + currency: String, + institution_id: String, + is_complete: bool, + network: Lithic::Models::NetworkTotal::network, + report_date: Date, + settlement_institution_id: String, + settlement_service: String, + updated: Time, + cycle: Integer + } + + type amounts = + { + gross_settlement: Integer, + interchange_fees: Integer, + net_settlement: Integer, + visa_charges: Integer + } + + class Amounts < Lithic::Internal::Type::BaseModel + attr_accessor gross_settlement: Integer + + attr_accessor interchange_fees: Integer + + attr_accessor net_settlement: Integer + + attr_reader visa_charges: Integer? + + def visa_charges=: (Integer) -> Integer + + def initialize: ( + gross_settlement: Integer, + interchange_fees: Integer, + net_settlement: Integer, + ?visa_charges: Integer + ) -> void + + def to_hash: -> { + gross_settlement: Integer, + interchange_fees: Integer, + net_settlement: Integer, + visa_charges: Integer + } + end + + type network = :AMEX | :VISA | :MASTERCARD | :MAESTRO | :INTERLINK + + module Network + extend Lithic::Internal::Type::Enum + + AMEX: :AMEX + VISA: :VISA + MASTERCARD: :MASTERCARD + MAESTRO: :MAESTRO + INTERLINK: :INTERLINK + + def self?.values: -> ::Array[Lithic::Models::NetworkTotal::network] + end + end + end +end diff --git a/sig/lithic/models/network_total_created_webhook_event.rbs b/sig/lithic/models/network_total_created_webhook_event.rbs new file mode 100644 index 00000000..bb7818a4 --- /dev/null +++ b/sig/lithic/models/network_total_created_webhook_event.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + type network_total_created_webhook_event = + { event_type: :"network_total.created" } + + class NetworkTotalCreatedWebhookEvent < Lithic::Models::NetworkTotal + def event_type: -> :"network_total.created" + + def event_type=: (:"network_total.created" _) -> :"network_total.created" + + def initialize: (?event_type: :"network_total.created") -> void + + def to_hash: -> { event_type: :"network_total.created" } + end + end +end diff --git a/sig/lithic/models/network_total_updated_webhook_event.rbs b/sig/lithic/models/network_total_updated_webhook_event.rbs new file mode 100644 index 00000000..552b76fa --- /dev/null +++ b/sig/lithic/models/network_total_updated_webhook_event.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + type network_total_updated_webhook_event = + { event_type: :"network_total.updated" } + + class NetworkTotalUpdatedWebhookEvent < Lithic::Models::NetworkTotal + def event_type: -> :"network_total.updated" + + def event_type=: (:"network_total.updated" _) -> :"network_total.updated" + + def initialize: (?event_type: :"network_total.updated") -> void + + def to_hash: -> { event_type: :"network_total.updated" } + end + end +end diff --git a/sig/lithic/models/non_pci_card.rbs b/sig/lithic/models/non_pci_card.rbs new file mode 100644 index 00000000..590ed5b0 --- /dev/null +++ b/sig/lithic/models/non_pci_card.rbs @@ -0,0 +1,307 @@ +module Lithic + module Models + type non_pci_card = + { + token: String, + account_token: String, + card_program_token: String, + created: Time, + funding: Lithic::NonPCICard::Funding?, + last_four: String, + pin_status: Lithic::Models::NonPCICard::pin_status, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::spend_limit_duration, + state: Lithic::Models::NonPCICard::state, + type: Lithic::Models::NonPCICard::type_, + auth_rule_tokens: ::Array[String], + bulk_order_token: String?, + cardholder_currency: String, + comment: String, + digital_card_art_token: String?, + exp_month: String, + exp_year: String, + hostname: String, + memo: String, + network_program_token: String?, + pending_commands: ::Array[String], + product_id: String?, + replacement_for: String?, + substatus: Lithic::Models::NonPCICard::substatus? + } + + class NonPCICard < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor account_token: String + + attr_accessor card_program_token: String + + attr_accessor created: Time + + attr_accessor funding: Lithic::NonPCICard::Funding? + + attr_accessor last_four: String + + attr_accessor pin_status: Lithic::Models::NonPCICard::pin_status + + attr_accessor spend_limit: Integer + + attr_accessor spend_limit_duration: Lithic::Models::spend_limit_duration + + attr_accessor state: Lithic::Models::NonPCICard::state + + attr_accessor type: Lithic::Models::NonPCICard::type_ + + attr_reader auth_rule_tokens: ::Array[String]? + + def auth_rule_tokens=: (::Array[String]) -> ::Array[String] + + attr_accessor bulk_order_token: String? + + attr_reader cardholder_currency: String? + + def cardholder_currency=: (String) -> String + + attr_reader comment: String? + + def comment=: (String) -> String + + attr_accessor digital_card_art_token: String? + + attr_reader exp_month: String? + + def exp_month=: (String) -> String + + attr_reader exp_year: String? + + def exp_year=: (String) -> String + + attr_reader hostname: String? + + def hostname=: (String) -> String + + attr_reader memo: String? + + def memo=: (String) -> String + + attr_accessor network_program_token: String? + + attr_reader pending_commands: ::Array[String]? + + def pending_commands=: (::Array[String]) -> ::Array[String] + + attr_accessor product_id: String? + + attr_accessor replacement_for: String? + + attr_accessor substatus: Lithic::Models::NonPCICard::substatus? + + def initialize: ( + token: String, + account_token: String, + card_program_token: String, + created: Time, + funding: Lithic::NonPCICard::Funding?, + last_four: String, + pin_status: Lithic::Models::NonPCICard::pin_status, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::spend_limit_duration, + state: Lithic::Models::NonPCICard::state, + type: Lithic::Models::NonPCICard::type_, + ?auth_rule_tokens: ::Array[String], + ?bulk_order_token: String?, + ?cardholder_currency: String, + ?comment: String, + ?digital_card_art_token: String?, + ?exp_month: String, + ?exp_year: String, + ?hostname: String, + ?memo: String, + ?network_program_token: String?, + ?pending_commands: ::Array[String], + ?product_id: String?, + ?replacement_for: String?, + ?substatus: Lithic::Models::NonPCICard::substatus? + ) -> void + + def to_hash: -> { + token: String, + account_token: String, + card_program_token: String, + created: Time, + funding: Lithic::NonPCICard::Funding?, + last_four: String, + pin_status: Lithic::Models::NonPCICard::pin_status, + spend_limit: Integer, + spend_limit_duration: Lithic::Models::spend_limit_duration, + state: Lithic::Models::NonPCICard::state, + type: Lithic::Models::NonPCICard::type_, + auth_rule_tokens: ::Array[String], + bulk_order_token: String?, + cardholder_currency: String, + comment: String, + digital_card_art_token: String?, + exp_month: String, + exp_year: String, + hostname: String, + memo: String, + network_program_token: String?, + pending_commands: ::Array[String], + product_id: String?, + replacement_for: String?, + substatus: Lithic::Models::NonPCICard::substatus? + } + + type funding = + { + token: String, + created: Time, + last_four: String, + state: Lithic::Models::NonPCICard::Funding::state, + type: Lithic::Models::NonPCICard::Funding::type_, + account_name: String, + nickname: String? + } + + class Funding < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor created: Time + + attr_accessor last_four: String + + attr_accessor state: Lithic::Models::NonPCICard::Funding::state + + attr_accessor type: Lithic::Models::NonPCICard::Funding::type_ + + attr_reader account_name: String? + + def account_name=: (String) -> String + + attr_accessor nickname: String? + + def initialize: ( + token: String, + created: Time, + last_four: String, + state: Lithic::Models::NonPCICard::Funding::state, + type: Lithic::Models::NonPCICard::Funding::type_, + ?account_name: String, + ?nickname: String? + ) -> void + + def to_hash: -> { + token: String, + created: Time, + last_four: String, + state: Lithic::Models::NonPCICard::Funding::state, + type: Lithic::Models::NonPCICard::Funding::type_, + account_name: String, + nickname: String? + } + + type state = :DELETED | :ENABLED | :PENDING + + module State + extend Lithic::Internal::Type::Enum + + DELETED: :DELETED + ENABLED: :ENABLED + PENDING: :PENDING + + def self?.values: -> ::Array[Lithic::Models::NonPCICard::Funding::state] + end + + type type_ = :DEPOSITORY_CHECKING | :DEPOSITORY_SAVINGS + + module Type + extend Lithic::Internal::Type::Enum + + DEPOSITORY_CHECKING: :DEPOSITORY_CHECKING + DEPOSITORY_SAVINGS: :DEPOSITORY_SAVINGS + + def self?.values: -> ::Array[Lithic::Models::NonPCICard::Funding::type_] + end + end + + type pin_status = :OK | :BLOCKED | :NOT_SET + + module PinStatus + extend Lithic::Internal::Type::Enum + + OK: :OK + BLOCKED: :BLOCKED + NOT_SET: :NOT_SET + + def self?.values: -> ::Array[Lithic::Models::NonPCICard::pin_status] + end + + type state = + :CLOSED | :OPEN | :PAUSED | :PENDING_ACTIVATION | :PENDING_FULFILLMENT + + module State + extend Lithic::Internal::Type::Enum + + CLOSED: :CLOSED + OPEN: :OPEN + PAUSED: :PAUSED + PENDING_ACTIVATION: :PENDING_ACTIVATION + PENDING_FULFILLMENT: :PENDING_FULFILLMENT + + def self?.values: -> ::Array[Lithic::Models::NonPCICard::state] + end + + type type_ = + :MERCHANT_LOCKED + | :PHYSICAL + | :SINGLE_USE + | :VIRTUAL + | :UNLOCKED + | :DIGITAL_WALLET + + module Type + extend Lithic::Internal::Type::Enum + + MERCHANT_LOCKED: :MERCHANT_LOCKED + PHYSICAL: :PHYSICAL + SINGLE_USE: :SINGLE_USE + VIRTUAL: :VIRTUAL + UNLOCKED: :UNLOCKED + DIGITAL_WALLET: :DIGITAL_WALLET + + def self?.values: -> ::Array[Lithic::Models::NonPCICard::type_] + end + + type substatus = + :LOST + | :COMPROMISED + | :DAMAGED + | :END_USER_REQUEST + | :ISSUER_REQUEST + | :NOT_ACTIVE + | :SUSPICIOUS_ACTIVITY + | :INTERNAL_REVIEW + | :EXPIRED + | :UNDELIVERABLE + | :OTHER + + module Substatus + extend Lithic::Internal::Type::Enum + + LOST: :LOST + COMPROMISED: :COMPROMISED + DAMAGED: :DAMAGED + END_USER_REQUEST: :END_USER_REQUEST + ISSUER_REQUEST: :ISSUER_REQUEST + NOT_ACTIVE: :NOT_ACTIVE + SUSPICIOUS_ACTIVITY: :SUSPICIOUS_ACTIVITY + INTERNAL_REVIEW: :INTERNAL_REVIEW + EXPIRED: :EXPIRED + UNDELIVERABLE: :UNDELIVERABLE + OTHER: :OTHER + + def self?.values: -> ::Array[Lithic::Models::NonPCICard::substatus] + end + end + end +end diff --git a/sig/lithic/models/owner_type.rbs b/sig/lithic/models/owner_type.rbs new file mode 100644 index 00000000..e3aeff70 --- /dev/null +++ b/sig/lithic/models/owner_type.rbs @@ -0,0 +1,14 @@ +module Lithic + module Models + type owner_type = :INDIVIDUAL | :BUSINESS + + module OwnerType + extend Lithic::Internal::Type::Enum + + INDIVIDUAL: :INDIVIDUAL + BUSINESS: :BUSINESS + + def self?.values: -> ::Array[Lithic::Models::owner_type] + end + end +end diff --git a/sig/lithic/models/parsed_webhook_event.rbs b/sig/lithic/models/parsed_webhook_event.rbs new file mode 100644 index 00000000..0698e0f9 --- /dev/null +++ b/sig/lithic/models/parsed_webhook_event.rbs @@ -0,0 +1,641 @@ +module Lithic + module Models + type parsed_webhook_event = + Lithic::AccountHolderCreatedWebhookEvent + | Lithic::ParsedWebhookEvent::KYBPayload + | Lithic::ParsedWebhookEvent::KYCPayload + | Lithic::ParsedWebhookEvent::LegacyPayload + | Lithic::AccountHolderVerificationWebhookEvent + | Lithic::AccountHolderDocumentUpdatedWebhookEvent + | Lithic::CardAuthorizationApprovalRequestWebhookEvent + | Lithic::CardAuthorizationChallengeWebhookEvent + | Lithic::CardAuthorizationChallengeResponseWebhookEvent + | Lithic::AuthRulesBacktestReportCreatedWebhookEvent + | Lithic::BalanceUpdatedWebhookEvent + | Lithic::BookTransferTransactionCreatedWebhookEvent + | Lithic::BookTransferTransactionUpdatedWebhookEvent + | Lithic::CardCreatedWebhookEvent + | Lithic::CardConvertedWebhookEvent + | Lithic::CardRenewedWebhookEvent + | Lithic::CardReissuedWebhookEvent + | Lithic::CardShippedWebhookEvent + | Lithic::CardUpdatedWebhookEvent + | Lithic::CardTransactionUpdatedWebhookEvent + | Lithic::CardTransactionEnhancedDataCreatedWebhookEvent + | Lithic::CardTransactionEnhancedDataUpdatedWebhookEvent + | Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent + | Lithic::DigitalWalletTokenizationResultWebhookEvent + | Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent + | Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent + | Lithic::DigitalWalletTokenizationUpdatedWebhookEvent + | Lithic::DisputeUpdatedWebhookEvent + | Lithic::DisputeEvidenceUploadFailedWebhookEvent + | Lithic::ExternalBankAccountCreatedWebhookEvent + | Lithic::ExternalBankAccountUpdatedWebhookEvent + | Lithic::ExternalPaymentCreatedWebhookEvent + | Lithic::ExternalPaymentUpdatedWebhookEvent + | Lithic::FinancialAccountCreatedWebhookEvent + | Lithic::FinancialAccountUpdatedWebhookEvent + | Lithic::FundingEventCreatedWebhookEvent + | Lithic::LoanTapeCreatedWebhookEvent + | Lithic::LoanTapeUpdatedWebhookEvent + | Lithic::ManagementOperationCreatedWebhookEvent + | Lithic::ManagementOperationUpdatedWebhookEvent + | Lithic::InternalTransactionCreatedWebhookEvent + | Lithic::InternalTransactionUpdatedWebhookEvent + | Lithic::NetworkTotalCreatedWebhookEvent + | Lithic::NetworkTotalUpdatedWebhookEvent + | Lithic::PaymentTransactionCreatedWebhookEvent + | Lithic::PaymentTransactionUpdatedWebhookEvent + | Lithic::SettlementReportUpdatedWebhookEvent + | Lithic::StatementsCreatedWebhookEvent + | Lithic::ThreeDSAuthenticationCreatedWebhookEvent + | Lithic::ThreeDSAuthenticationUpdatedWebhookEvent + | Lithic::ThreeDSAuthenticationChallengeWebhookEvent + | Lithic::TokenizationApprovalRequestWebhookEvent + | Lithic::TokenizationResultWebhookEvent + | Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent + | Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent + | Lithic::TokenizationUpdatedWebhookEvent + | Lithic::ThreeDSAuthenticationApprovalRequestWebhookEvent + | Lithic::DisputeTransactionCreatedWebhookEvent + | Lithic::DisputeTransactionUpdatedWebhookEvent + + module ParsedWebhookEvent + extend Lithic::Internal::Type::Union + + type kyb_payload = + { + token: String, + update_request: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest, + event_type: Lithic::Models::ParsedWebhookEvent::KYBPayload::event_type, + external_id: String, + naics_code: String, + nature_of_business: String, + website_url: String + } + + class KYBPayload < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor update_request: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest + + attr_reader event_type: Lithic::Models::ParsedWebhookEvent::KYBPayload::event_type? + + def event_type=: ( + Lithic::Models::ParsedWebhookEvent::KYBPayload::event_type + ) -> Lithic::Models::ParsedWebhookEvent::KYBPayload::event_type + + attr_reader external_id: String? + + def external_id=: (String) -> String + + attr_reader naics_code: String? + + def naics_code=: (String) -> String + + attr_reader nature_of_business: String? + + def nature_of_business=: (String) -> String + + attr_reader website_url: String? + + def website_url=: (String) -> String + + def initialize: ( + token: String, + update_request: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest, + ?event_type: Lithic::Models::ParsedWebhookEvent::KYBPayload::event_type, + ?external_id: String, + ?naics_code: String, + ?nature_of_business: String, + ?website_url: String + ) -> void + + def to_hash: -> { + token: String, + update_request: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest, + event_type: Lithic::Models::ParsedWebhookEvent::KYBPayload::event_type, + external_id: String, + naics_code: String, + nature_of_business: String, + website_url: String + } + + type update_request = + { + beneficial_owner_individuals: ::Array[Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual], + business_entity: Lithic::KYBBusinessEntity, + control_person: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson + } + + class UpdateRequest < Lithic::Internal::Type::BaseModel + attr_reader beneficial_owner_individuals: ::Array[Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual]? + + def beneficial_owner_individuals=: ( + ::Array[Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual] + ) -> ::Array[Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual] + + attr_reader business_entity: Lithic::KYBBusinessEntity? + + def business_entity=: ( + Lithic::KYBBusinessEntity + ) -> Lithic::KYBBusinessEntity + + attr_reader control_person: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson? + + def control_person=: ( + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson + ) -> Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson + + def initialize: ( + ?beneficial_owner_individuals: ::Array[Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual], + ?business_entity: Lithic::KYBBusinessEntity, + ?control_person: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson + ) -> void + + def to_hash: -> { + beneficial_owner_individuals: ::Array[Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual], + business_entity: Lithic::KYBBusinessEntity, + control_person: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson + } + + type beneficial_owner_individual = + { + address: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class BeneficialOwnerIndividual < Lithic::Internal::Type::BaseModel + attr_reader address: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address? + + def address=: ( + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address + ) -> Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + ?address: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address, + ?dob: String, + ?email: String, + ?first_name: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + address: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::BeneficialOwnerIndividual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::Internal::Type::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + end + end + + type control_person = + { + address: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class ControlPerson < Lithic::Internal::Type::BaseModel + attr_reader address: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address? + + def address=: ( + Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address + ) -> Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + ?address: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address, + ?dob: String, + ?email: String, + ?first_name: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + address: Lithic::ParsedWebhookEvent::KYBPayload::UpdateRequest::ControlPerson::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::Internal::Type::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + end + end + end + + type event_type = :"account_holder.updated" + + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_UPDATED: :"account_holder.updated" + + def self?.values: -> ::Array[Lithic::Models::ParsedWebhookEvent::KYBPayload::event_type] + end + end + + type kyc_payload = + { + token: String, + update_request: Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest, + event_type: Lithic::Models::ParsedWebhookEvent::KYCPayload::event_type, + external_id: String + } + + class KYCPayload < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor update_request: Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest + + attr_reader event_type: Lithic::Models::ParsedWebhookEvent::KYCPayload::event_type? + + def event_type=: ( + Lithic::Models::ParsedWebhookEvent::KYCPayload::event_type + ) -> Lithic::Models::ParsedWebhookEvent::KYCPayload::event_type + + attr_reader external_id: String? + + def external_id=: (String) -> String + + def initialize: ( + token: String, + update_request: Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest, + ?event_type: Lithic::Models::ParsedWebhookEvent::KYCPayload::event_type, + ?external_id: String + ) -> void + + def to_hash: -> { + token: String, + update_request: Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest, + event_type: Lithic::Models::ParsedWebhookEvent::KYCPayload::event_type, + external_id: String + } + + type update_request = + { + individual: Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual + } + + class UpdateRequest < Lithic::Internal::Type::BaseModel + attr_reader individual: Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual? + + def individual=: ( + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual + ) -> Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual + + def initialize: ( + ?individual: Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual + ) -> void + + def to_hash: -> { + individual: Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual + } + + type individual = + { + address: Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + class Individual < Lithic::Internal::Type::BaseModel + attr_reader address: Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address? + + def address=: ( + Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address + ) -> Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address + + attr_reader dob: String? + + def dob=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + ?address: Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address, + ?dob: String, + ?email: String, + ?first_name: String, + ?last_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + address: Lithic::ParsedWebhookEvent::KYCPayload::UpdateRequest::Individual::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String + } + + type address = + { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + + class Address < Lithic::Internal::Type::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + postal_code: String, + state: String, + ?address2: String + ) -> void + + def to_hash: -> { + :address1 => String, + city: String, + country: String, + postal_code: String, + state: String, + :address2 => String + } + end + end + end + + type event_type = :"account_holder.updated" + + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_UPDATED: :"account_holder.updated" + + def self?.values: -> ::Array[Lithic::Models::ParsedWebhookEvent::KYCPayload::event_type] + end + end + + type legacy_payload = + { + token: String, + business_account_token: String?, + created: Time, + email: String, + event_type: Lithic::Models::ParsedWebhookEvent::LegacyPayload::event_type, + external_id: String?, + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String + } + + class LegacyPayload < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor business_account_token: String? + + attr_reader created: Time? + + def created=: (Time) -> Time + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader event_type: Lithic::Models::ParsedWebhookEvent::LegacyPayload::event_type? + + def event_type=: ( + Lithic::Models::ParsedWebhookEvent::LegacyPayload::event_type + ) -> Lithic::Models::ParsedWebhookEvent::LegacyPayload::event_type + + attr_accessor external_id: String? + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader legal_business_name: String? + + def legal_business_name=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + token: String, + ?business_account_token: String?, + ?created: Time, + ?email: String, + ?event_type: Lithic::Models::ParsedWebhookEvent::LegacyPayload::event_type, + ?external_id: String?, + ?first_name: String, + ?last_name: String, + ?legal_business_name: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + token: String, + business_account_token: String?, + created: Time, + email: String, + event_type: Lithic::Models::ParsedWebhookEvent::LegacyPayload::event_type, + external_id: String?, + first_name: String, + last_name: String, + legal_business_name: String, + phone_number: String + } + + type event_type = :"account_holder.updated" + + module EventType + extend Lithic::Internal::Type::Enum + + ACCOUNT_HOLDER_UPDATED: :"account_holder.updated" + + def self?.values: -> ::Array[Lithic::Models::ParsedWebhookEvent::LegacyPayload::event_type] + end + end + + def self?.variants: -> ::Array[Lithic::Models::parsed_webhook_event] + end + end +end diff --git a/sig/lithic/models/payment.rbs b/sig/lithic/models/payment.rbs new file mode 100644 index 00000000..23882360 --- /dev/null +++ b/sig/lithic/models/payment.rbs @@ -0,0 +1,578 @@ +module Lithic + module Models + type payment = + { + token: String, + category: Lithic::Models::Payment::category, + created: Time, + descriptor: String, + direction: Lithic::Models::Payment::direction, + events: ::Array[Lithic::Payment::Event], + family: :PAYMENT, + financial_account_token: String, + method_: Lithic::Models::Payment::method_, + method_attributes: Lithic::Models::Payment::method_attributes, + pending_amount: Integer, + related_account_tokens: Lithic::Payment::RelatedAccountTokens?, + result: Lithic::Models::Payment::result, + settled_amount: Integer, + source: Lithic::Models::Payment::source, + status: Lithic::Models::Payment::status, + updated: Time, + currency: String, + expected_release_date: Date?, + external_bank_account_token: String?, + tags: ::Hash[Symbol, String], + type: Lithic::Models::Payment::type_, + user_defined_id: String? + } + + class Payment < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor category: Lithic::Models::Payment::category + + attr_accessor created: Time + + attr_accessor descriptor: String + + attr_accessor direction: Lithic::Models::Payment::direction + + attr_accessor events: ::Array[Lithic::Payment::Event] + + attr_accessor family: :PAYMENT + + attr_accessor financial_account_token: String + + attr_accessor method_: Lithic::Models::Payment::method_ + + attr_accessor method_attributes: Lithic::Models::Payment::method_attributes + + attr_accessor pending_amount: Integer + + attr_accessor related_account_tokens: Lithic::Payment::RelatedAccountTokens? + + attr_accessor result: Lithic::Models::Payment::result + + attr_accessor settled_amount: Integer + + attr_accessor source: Lithic::Models::Payment::source + + attr_accessor status: Lithic::Models::Payment::status + + attr_accessor updated: Time + + attr_reader currency: String? + + def currency=: (String) -> String + + attr_accessor expected_release_date: Date? + + attr_accessor external_bank_account_token: String? + + attr_reader tags: ::Hash[Symbol, String]? + + def tags=: (::Hash[Symbol, String]) -> ::Hash[Symbol, String] + + attr_reader type: Lithic::Models::Payment::type_? + + def type=: ( + Lithic::Models::Payment::type_ + ) -> Lithic::Models::Payment::type_ + + attr_accessor user_defined_id: String? + + def initialize: ( + token: String, + category: Lithic::Models::Payment::category, + created: Time, + descriptor: String, + direction: Lithic::Models::Payment::direction, + events: ::Array[Lithic::Payment::Event], + financial_account_token: String, + method_: Lithic::Models::Payment::method_, + method_attributes: Lithic::Models::Payment::method_attributes, + pending_amount: Integer, + related_account_tokens: Lithic::Payment::RelatedAccountTokens?, + result: Lithic::Models::Payment::result, + settled_amount: Integer, + source: Lithic::Models::Payment::source, + status: Lithic::Models::Payment::status, + updated: Time, + ?currency: String, + ?expected_release_date: Date?, + ?external_bank_account_token: String?, + ?tags: ::Hash[Symbol, String], + ?type: Lithic::Models::Payment::type_, + ?user_defined_id: String?, + ?family: :PAYMENT + ) -> void + + def to_hash: -> { + token: String, + category: Lithic::Models::Payment::category, + created: Time, + descriptor: String, + direction: Lithic::Models::Payment::direction, + events: ::Array[Lithic::Payment::Event], + family: :PAYMENT, + financial_account_token: String, + method_: Lithic::Models::Payment::method_, + method_attributes: Lithic::Models::Payment::method_attributes, + pending_amount: Integer, + related_account_tokens: Lithic::Payment::RelatedAccountTokens?, + result: Lithic::Models::Payment::result, + settled_amount: Integer, + source: Lithic::Models::Payment::source, + status: Lithic::Models::Payment::status, + updated: Time, + currency: String, + expected_release_date: Date?, + external_bank_account_token: String?, + tags: ::Hash[Symbol, String], + type: Lithic::Models::Payment::type_, + user_defined_id: String? + } + + type category = + :ACH + | :WIRE + | :BALANCE_OR_FUNDING + | :FEE + | :REWARD + | :ADJUSTMENT + | :DERECOGNITION + | :DISPUTE + | :CARD + | :EXTERNAL_ACH + | :EXTERNAL_CHECK + | :EXTERNAL_FEDNOW + | :EXTERNAL_RTP + | :EXTERNAL_TRANSFER + | :EXTERNAL_WIRE + | :MANAGEMENT_ADJUSTMENT + | :MANAGEMENT_DISPUTE + | :MANAGEMENT_FEE + | :MANAGEMENT_REWARD + | :MANAGEMENT_DISBURSEMENT + | :HOLD + | :PROGRAM_FUNDING + + module Category + extend Lithic::Internal::Type::Enum + + ACH: :ACH + WIRE: :WIRE + BALANCE_OR_FUNDING: :BALANCE_OR_FUNDING + FEE: :FEE + REWARD: :REWARD + ADJUSTMENT: :ADJUSTMENT + DERECOGNITION: :DERECOGNITION + DISPUTE: :DISPUTE + CARD: :CARD + EXTERNAL_ACH: :EXTERNAL_ACH + EXTERNAL_CHECK: :EXTERNAL_CHECK + EXTERNAL_FEDNOW: :EXTERNAL_FEDNOW + EXTERNAL_RTP: :EXTERNAL_RTP + EXTERNAL_TRANSFER: :EXTERNAL_TRANSFER + EXTERNAL_WIRE: :EXTERNAL_WIRE + MANAGEMENT_ADJUSTMENT: :MANAGEMENT_ADJUSTMENT + MANAGEMENT_DISPUTE: :MANAGEMENT_DISPUTE + MANAGEMENT_FEE: :MANAGEMENT_FEE + MANAGEMENT_REWARD: :MANAGEMENT_REWARD + MANAGEMENT_DISBURSEMENT: :MANAGEMENT_DISBURSEMENT + HOLD: :HOLD + PROGRAM_FUNDING: :PROGRAM_FUNDING + + def self?.values: -> ::Array[Lithic::Models::Payment::category] + end + + type direction = :CREDIT | :DEBIT + + module Direction + extend Lithic::Internal::Type::Enum + + CREDIT: :CREDIT + DEBIT: :DEBIT + + def self?.values: -> ::Array[Lithic::Models::Payment::direction] + end + + type event = + { + token: String, + amount: Integer, + created: Time, + result: Lithic::Models::Payment::Event::result, + type: Lithic::Models::Payment::Event::type_, + detailed_results: ::Array[Lithic::Models::Payment::Event::detailed_result], + external_id: String? + } + + class Event < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor amount: Integer + + attr_accessor created: Time + + attr_accessor result: Lithic::Models::Payment::Event::result + + attr_accessor type: Lithic::Models::Payment::Event::type_ + + attr_reader detailed_results: ::Array[Lithic::Models::Payment::Event::detailed_result]? + + def detailed_results=: ( + ::Array[Lithic::Models::Payment::Event::detailed_result] + ) -> ::Array[Lithic::Models::Payment::Event::detailed_result] + + attr_accessor external_id: String? + + def initialize: ( + token: String, + amount: Integer, + created: Time, + result: Lithic::Models::Payment::Event::result, + type: Lithic::Models::Payment::Event::type_, + ?detailed_results: ::Array[Lithic::Models::Payment::Event::detailed_result], + ?external_id: String? + ) -> void + + def to_hash: -> { + token: String, + amount: Integer, + created: Time, + result: Lithic::Models::Payment::Event::result, + type: Lithic::Models::Payment::Event::type_, + detailed_results: ::Array[Lithic::Models::Payment::Event::detailed_result], + external_id: String? + } + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::Payment::Event::result] + end + + type type_ = + :ACH_ORIGINATION_CANCELLED + | :ACH_ORIGINATION_INITIATED + | :ACH_ORIGINATION_PROCESSED + | :ACH_ORIGINATION_REJECTED + | :ACH_ORIGINATION_RELEASED + | :ACH_ORIGINATION_REVIEWED + | :ACH_ORIGINATION_SETTLED + | :ACH_RECEIPT_PROCESSED + | :ACH_RECEIPT_RELEASED + | :ACH_RECEIPT_RELEASED_EARLY + | :ACH_RECEIPT_SETTLED + | :ACH_RETURN_INITIATED + | :ACH_RETURN_PROCESSED + | :ACH_RETURN_REJECTED + | :ACH_RETURN_SETTLED + | :WIRE_TRANSFER_INBOUND_RECEIVED + | :WIRE_TRANSFER_INBOUND_SETTLED + | :WIRE_TRANSFER_INBOUND_BLOCKED + | :WIRE_RETURN_OUTBOUND_INITIATED + | :WIRE_RETURN_OUTBOUND_SENT + | :WIRE_RETURN_OUTBOUND_SETTLED + | :WIRE_RETURN_OUTBOUND_REJECTED + + module Type + extend Lithic::Internal::Type::Enum + + ACH_ORIGINATION_CANCELLED: :ACH_ORIGINATION_CANCELLED + ACH_ORIGINATION_INITIATED: :ACH_ORIGINATION_INITIATED + ACH_ORIGINATION_PROCESSED: :ACH_ORIGINATION_PROCESSED + ACH_ORIGINATION_REJECTED: :ACH_ORIGINATION_REJECTED + ACH_ORIGINATION_RELEASED: :ACH_ORIGINATION_RELEASED + ACH_ORIGINATION_REVIEWED: :ACH_ORIGINATION_REVIEWED + ACH_ORIGINATION_SETTLED: :ACH_ORIGINATION_SETTLED + ACH_RECEIPT_PROCESSED: :ACH_RECEIPT_PROCESSED + ACH_RECEIPT_RELEASED: :ACH_RECEIPT_RELEASED + ACH_RECEIPT_RELEASED_EARLY: :ACH_RECEIPT_RELEASED_EARLY + ACH_RECEIPT_SETTLED: :ACH_RECEIPT_SETTLED + ACH_RETURN_INITIATED: :ACH_RETURN_INITIATED + ACH_RETURN_PROCESSED: :ACH_RETURN_PROCESSED + ACH_RETURN_REJECTED: :ACH_RETURN_REJECTED + ACH_RETURN_SETTLED: :ACH_RETURN_SETTLED + WIRE_TRANSFER_INBOUND_RECEIVED: :WIRE_TRANSFER_INBOUND_RECEIVED + WIRE_TRANSFER_INBOUND_SETTLED: :WIRE_TRANSFER_INBOUND_SETTLED + WIRE_TRANSFER_INBOUND_BLOCKED: :WIRE_TRANSFER_INBOUND_BLOCKED + WIRE_RETURN_OUTBOUND_INITIATED: :WIRE_RETURN_OUTBOUND_INITIATED + WIRE_RETURN_OUTBOUND_SENT: :WIRE_RETURN_OUTBOUND_SENT + WIRE_RETURN_OUTBOUND_SETTLED: :WIRE_RETURN_OUTBOUND_SETTLED + WIRE_RETURN_OUTBOUND_REJECTED: :WIRE_RETURN_OUTBOUND_REJECTED + + def self?.values: -> ::Array[Lithic::Models::Payment::Event::type_] + end + + type detailed_result = + :APPROVED + | :DECLINED + | :FUNDS_INSUFFICIENT + | :ACCOUNT_INVALID + | :PROGRAM_TRANSACTION_LIMIT_EXCEEDED + | :PROGRAM_DAILY_LIMIT_EXCEEDED + | :PROGRAM_MONTHLY_LIMIT_EXCEEDED + + module DetailedResult + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + FUNDS_INSUFFICIENT: :FUNDS_INSUFFICIENT + ACCOUNT_INVALID: :ACCOUNT_INVALID + PROGRAM_TRANSACTION_LIMIT_EXCEEDED: :PROGRAM_TRANSACTION_LIMIT_EXCEEDED + PROGRAM_DAILY_LIMIT_EXCEEDED: :PROGRAM_DAILY_LIMIT_EXCEEDED + PROGRAM_MONTHLY_LIMIT_EXCEEDED: :PROGRAM_MONTHLY_LIMIT_EXCEEDED + + def self?.values: -> ::Array[Lithic::Models::Payment::Event::detailed_result] + end + end + + type method_ = :ACH_NEXT_DAY | :ACH_SAME_DAY | :WIRE + + module Method + extend Lithic::Internal::Type::Enum + + ACH_NEXT_DAY: :ACH_NEXT_DAY + ACH_SAME_DAY: :ACH_SAME_DAY + WIRE: :WIRE + + def self?.values: -> ::Array[Lithic::Models::Payment::method_] + end + + type method_attributes = + Lithic::Payment::MethodAttributes::ACHMethodAttributes + | Lithic::Payment::MethodAttributes::WireMethodAttributes + + module MethodAttributes + extend Lithic::Internal::Type::Union + + type ach_method_attributes = + { + sec_code: Lithic::Models::Payment::MethodAttributes::ACHMethodAttributes::sec_code, + ach_hold_period: Integer?, + addenda: String?, + company_id: String?, + override_company_name: String?, + receipt_routing_number: String?, + retries: Integer?, + return_reason_code: String?, + trace_numbers: ::Array[String] + } + + class ACHMethodAttributes < Lithic::Internal::Type::BaseModel + attr_accessor sec_code: Lithic::Models::Payment::MethodAttributes::ACHMethodAttributes::sec_code + + attr_accessor ach_hold_period: Integer? + + attr_accessor addenda: String? + + attr_accessor company_id: String? + + attr_accessor override_company_name: String? + + attr_accessor receipt_routing_number: String? + + attr_accessor retries: Integer? + + attr_accessor return_reason_code: String? + + attr_reader trace_numbers: ::Array[String]? + + def trace_numbers=: (::Array[String]) -> ::Array[String] + + def initialize: ( + sec_code: Lithic::Models::Payment::MethodAttributes::ACHMethodAttributes::sec_code, + ?ach_hold_period: Integer?, + ?addenda: String?, + ?company_id: String?, + ?override_company_name: String?, + ?receipt_routing_number: String?, + ?retries: Integer?, + ?return_reason_code: String?, + ?trace_numbers: ::Array[String] + ) -> void + + def to_hash: -> { + sec_code: Lithic::Models::Payment::MethodAttributes::ACHMethodAttributes::sec_code, + ach_hold_period: Integer?, + addenda: String?, + company_id: String?, + override_company_name: String?, + receipt_routing_number: String?, + retries: Integer?, + return_reason_code: String?, + trace_numbers: ::Array[String] + } + + type sec_code = :CCD | :PPD | :WEB | :TEL | :CIE | :CTX + + module SecCode + extend Lithic::Internal::Type::Enum + + CCD: :CCD + PPD: :PPD + WEB: :WEB + TEL: :TEL + CIE: :CIE + CTX: :CTX + + def self?.values: -> ::Array[Lithic::Models::Payment::MethodAttributes::ACHMethodAttributes::sec_code] + end + end + + type wire_method_attributes = + { + wire_message_type: String?, + wire_network: Lithic::Models::Payment::MethodAttributes::WireMethodAttributes::wire_network, + creditor: Lithic::WirePartyDetails, + debtor: Lithic::WirePartyDetails, + message_id: String?, + remittance_information: String? + } + + class WireMethodAttributes < Lithic::Internal::Type::BaseModel + attr_accessor wire_message_type: String? + + attr_accessor wire_network: Lithic::Models::Payment::MethodAttributes::WireMethodAttributes::wire_network + + attr_reader creditor: Lithic::WirePartyDetails? + + def creditor=: (Lithic::WirePartyDetails) -> Lithic::WirePartyDetails + + attr_reader debtor: Lithic::WirePartyDetails? + + def debtor=: (Lithic::WirePartyDetails) -> Lithic::WirePartyDetails + + attr_accessor message_id: String? + + attr_accessor remittance_information: String? + + def initialize: ( + wire_message_type: String?, + wire_network: Lithic::Models::Payment::MethodAttributes::WireMethodAttributes::wire_network, + ?creditor: Lithic::WirePartyDetails, + ?debtor: Lithic::WirePartyDetails, + ?message_id: String?, + ?remittance_information: String? + ) -> void + + def to_hash: -> { + wire_message_type: String?, + wire_network: Lithic::Models::Payment::MethodAttributes::WireMethodAttributes::wire_network, + creditor: Lithic::WirePartyDetails, + debtor: Lithic::WirePartyDetails, + message_id: String?, + remittance_information: String? + } + + type wire_network = :FEDWIRE | :SWIFT + + module WireNetwork + extend Lithic::Internal::Type::Enum + + FEDWIRE: :FEDWIRE + SWIFT: :SWIFT + + def self?.values: -> ::Array[Lithic::Models::Payment::MethodAttributes::WireMethodAttributes::wire_network] + end + end + + def self?.variants: -> ::Array[Lithic::Models::Payment::method_attributes] + end + + type related_account_tokens = + { account_token: String?, business_account_token: String? } + + class RelatedAccountTokens < Lithic::Internal::Type::BaseModel + attr_accessor account_token: String? + + attr_accessor business_account_token: String? + + def initialize: ( + account_token: String?, + business_account_token: String? + ) -> void + + def to_hash: -> { + account_token: String?, + business_account_token: String? + } + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::Payment::result] + end + + type source = :LITHIC | :EXTERNAL | :CUSTOMER + + module Source + extend Lithic::Internal::Type::Enum + + LITHIC: :LITHIC + EXTERNAL: :EXTERNAL + CUSTOMER: :CUSTOMER + + def self?.values: -> ::Array[Lithic::Models::Payment::source] + end + + type status = + :PENDING | :SETTLED | :DECLINED | :REVERSED | :CANCELED | :RETURNED + + module Status + extend Lithic::Internal::Type::Enum + + PENDING: :PENDING + SETTLED: :SETTLED + DECLINED: :DECLINED + REVERSED: :REVERSED + CANCELED: :CANCELED + RETURNED: :RETURNED + + def self?.values: -> ::Array[Lithic::Models::Payment::status] + end + + type type_ = + :ORIGINATION_CREDIT + | :ORIGINATION_DEBIT + | :RECEIPT_CREDIT + | :RECEIPT_DEBIT + | :WIRE_INBOUND_PAYMENT + | :WIRE_INBOUND_ADMIN + | :WIRE_OUTBOUND_PAYMENT + | :WIRE_OUTBOUND_ADMIN + | :WIRE_INBOUND_DRAWDOWN_REQUEST + + module Type + extend Lithic::Internal::Type::Enum + + ORIGINATION_CREDIT: :ORIGINATION_CREDIT + ORIGINATION_DEBIT: :ORIGINATION_DEBIT + RECEIPT_CREDIT: :RECEIPT_CREDIT + RECEIPT_DEBIT: :RECEIPT_DEBIT + WIRE_INBOUND_PAYMENT: :WIRE_INBOUND_PAYMENT + WIRE_INBOUND_ADMIN: :WIRE_INBOUND_ADMIN + WIRE_OUTBOUND_PAYMENT: :WIRE_OUTBOUND_PAYMENT + WIRE_OUTBOUND_ADMIN: :WIRE_OUTBOUND_ADMIN + WIRE_INBOUND_DRAWDOWN_REQUEST: :WIRE_INBOUND_DRAWDOWN_REQUEST + + def self?.values: -> ::Array[Lithic::Models::Payment::type_] + end + end + end +end diff --git a/sig/lithic/models/payment_create_params.rbs b/sig/lithic/models/payment_create_params.rbs new file mode 100644 index 00000000..2865c918 --- /dev/null +++ b/sig/lithic/models/payment_create_params.rbs @@ -0,0 +1,159 @@ +module Lithic + module Models + type payment_create_params = + { + amount: Integer, + external_bank_account_token: String, + financial_account_token: String, + method_: Lithic::Models::PaymentCreateParams::method_, + method_attributes: Lithic::PaymentCreateParams::MethodAttributes, + type: Lithic::Models::PaymentCreateParams::type_, + token: String, + hold: Lithic::PaymentCreateParams::Hold, + memo: String, + user_defined_id: String + } + & Lithic::Internal::Type::request_parameters + + class PaymentCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor amount: Integer + + attr_accessor external_bank_account_token: String + + attr_accessor financial_account_token: String + + attr_accessor method_: Lithic::Models::PaymentCreateParams::method_ + + attr_accessor method_attributes: Lithic::PaymentCreateParams::MethodAttributes + + attr_accessor type: Lithic::Models::PaymentCreateParams::type_ + + attr_reader token: String? + + def token=: (String) -> String + + attr_reader hold: Lithic::PaymentCreateParams::Hold? + + def hold=: ( + Lithic::PaymentCreateParams::Hold + ) -> Lithic::PaymentCreateParams::Hold + + attr_reader memo: String? + + def memo=: (String) -> String + + attr_reader user_defined_id: String? + + def user_defined_id=: (String) -> String + + def initialize: ( + amount: Integer, + external_bank_account_token: String, + financial_account_token: String, + method_: Lithic::Models::PaymentCreateParams::method_, + method_attributes: Lithic::PaymentCreateParams::MethodAttributes, + type: Lithic::Models::PaymentCreateParams::type_, + ?token: String, + ?hold: Lithic::PaymentCreateParams::Hold, + ?memo: String, + ?user_defined_id: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + amount: Integer, + external_bank_account_token: String, + financial_account_token: String, + method_: Lithic::Models::PaymentCreateParams::method_, + method_attributes: Lithic::PaymentCreateParams::MethodAttributes, + type: Lithic::Models::PaymentCreateParams::type_, + token: String, + hold: Lithic::PaymentCreateParams::Hold, + memo: String, + user_defined_id: String, + request_options: Lithic::RequestOptions + } + + type method_ = :ACH_NEXT_DAY | :ACH_SAME_DAY + + module Method + extend Lithic::Internal::Type::Enum + + ACH_NEXT_DAY: :ACH_NEXT_DAY + ACH_SAME_DAY: :ACH_SAME_DAY + + def self?.values: -> ::Array[Lithic::Models::PaymentCreateParams::method_] + end + + type method_attributes = + { + sec_code: Lithic::Models::PaymentCreateParams::MethodAttributes::sec_code, + ach_hold_period: Integer, + addenda: String?, + override_company_name: String? + } + + class MethodAttributes < Lithic::Internal::Type::BaseModel + attr_accessor sec_code: Lithic::Models::PaymentCreateParams::MethodAttributes::sec_code + + attr_reader ach_hold_period: Integer? + + def ach_hold_period=: (Integer) -> Integer + + attr_accessor addenda: String? + + attr_accessor override_company_name: String? + + def initialize: ( + sec_code: Lithic::Models::PaymentCreateParams::MethodAttributes::sec_code, + ?ach_hold_period: Integer, + ?addenda: String?, + ?override_company_name: String? + ) -> void + + def to_hash: -> { + sec_code: Lithic::Models::PaymentCreateParams::MethodAttributes::sec_code, + ach_hold_period: Integer, + addenda: String?, + override_company_name: String? + } + + type sec_code = :CCD | :PPD | :WEB + + module SecCode + extend Lithic::Internal::Type::Enum + + CCD: :CCD + PPD: :PPD + WEB: :WEB + + def self?.values: -> ::Array[Lithic::Models::PaymentCreateParams::MethodAttributes::sec_code] + end + end + + type type_ = :COLLECTION | :PAYMENT + + module Type + extend Lithic::Internal::Type::Enum + + COLLECTION: :COLLECTION + PAYMENT: :PAYMENT + + def self?.values: -> ::Array[Lithic::Models::PaymentCreateParams::type_] + end + + type hold = { token: String } + + class Hold < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + def initialize: (token: String) -> void + + def to_hash: -> { token: String } + end + end + end +end diff --git a/sig/lithic/models/payment_create_response.rbs b/sig/lithic/models/payment_create_response.rbs new file mode 100644 index 00000000..43380aca --- /dev/null +++ b/sig/lithic/models/payment_create_response.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type payment_create_response = { balance: Lithic::Balance } + + class PaymentCreateResponse < Lithic::Models::Payment + def balance: -> Lithic::Balance? + + def balance=: (Lithic::Balance _) -> Lithic::Balance + + def initialize: (?balance: Lithic::Balance) -> void + + def to_hash: -> { balance: Lithic::Balance } + end + end +end diff --git a/sig/lithic/models/payment_list_params.rbs b/sig/lithic/models/payment_list_params.rbs new file mode 100644 index 00000000..9d68c6f9 --- /dev/null +++ b/sig/lithic/models/payment_list_params.rbs @@ -0,0 +1,138 @@ +module Lithic + module Models + type payment_list_params = + { + account_token: String, + begin_: Time, + business_account_token: String, + category: Lithic::Models::PaymentListParams::category, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::Models::PaymentListParams::result, + starting_after: String, + status: Lithic::Models::PaymentListParams::status + } + & Lithic::Internal::Type::request_parameters + + class PaymentListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader business_account_token: String? + + def business_account_token=: (String) -> String + + attr_reader category: Lithic::Models::PaymentListParams::category? + + def category=: ( + Lithic::Models::PaymentListParams::category + ) -> Lithic::Models::PaymentListParams::category + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader financial_account_token: String? + + def financial_account_token=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader result: Lithic::Models::PaymentListParams::result? + + def result=: ( + Lithic::Models::PaymentListParams::result + ) -> Lithic::Models::PaymentListParams::result + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader status: Lithic::Models::PaymentListParams::status? + + def status=: ( + Lithic::Models::PaymentListParams::status + ) -> Lithic::Models::PaymentListParams::status + + def initialize: ( + ?account_token: String, + ?begin_: Time, + ?business_account_token: String, + ?category: Lithic::Models::PaymentListParams::category, + ?end_: Time, + ?ending_before: String, + ?financial_account_token: String, + ?page_size: Integer, + ?result: Lithic::Models::PaymentListParams::result, + ?starting_after: String, + ?status: Lithic::Models::PaymentListParams::status, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + account_token: String, + begin_: Time, + business_account_token: String, + category: Lithic::Models::PaymentListParams::category, + end_: Time, + ending_before: String, + financial_account_token: String, + page_size: Integer, + result: Lithic::Models::PaymentListParams::result, + starting_after: String, + status: Lithic::Models::PaymentListParams::status, + request_options: Lithic::RequestOptions + } + + type category = :ACH + + module Category + extend Lithic::Internal::Type::Enum + + ACH: :ACH + + def self?.values: -> ::Array[Lithic::Models::PaymentListParams::category] + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::PaymentListParams::result] + end + + type status = :DECLINED | :PENDING | :RETURNED | :SETTLED + + module Status + extend Lithic::Internal::Type::Enum + + DECLINED: :DECLINED + PENDING: :PENDING + RETURNED: :RETURNED + SETTLED: :SETTLED + + def self?.values: -> ::Array[Lithic::Models::PaymentListParams::status] + end + end + end +end diff --git a/sig/lithic/models/payment_retrieve_params.rbs b/sig/lithic/models/payment_retrieve_params.rbs new file mode 100644 index 00000000..87f61fc2 --- /dev/null +++ b/sig/lithic/models/payment_retrieve_params.rbs @@ -0,0 +1,23 @@ +module Lithic + module Models + type payment_retrieve_params = + { payment_token: String } & Lithic::Internal::Type::request_parameters + + class PaymentRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor payment_token: String + + def initialize: ( + payment_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + payment_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/payment_retry_params.rbs b/sig/lithic/models/payment_retry_params.rbs new file mode 100644 index 00000000..f81b9afc --- /dev/null +++ b/sig/lithic/models/payment_retry_params.rbs @@ -0,0 +1,23 @@ +module Lithic + module Models + type payment_retry_params = + { payment_token: String } & Lithic::Internal::Type::request_parameters + + class PaymentRetryParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor payment_token: String + + def initialize: ( + payment_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + payment_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/payment_retry_response.rbs b/sig/lithic/models/payment_retry_response.rbs new file mode 100644 index 00000000..c7b2a5ec --- /dev/null +++ b/sig/lithic/models/payment_retry_response.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type payment_retry_response = { balance: Lithic::Balance } + + class PaymentRetryResponse < Lithic::Models::Payment + def balance: -> Lithic::Balance? + + def balance=: (Lithic::Balance _) -> Lithic::Balance + + def initialize: (?balance: Lithic::Balance) -> void + + def to_hash: -> { balance: Lithic::Balance } + end + end +end diff --git a/sig/lithic/models/payment_return_params.rbs b/sig/lithic/models/payment_return_params.rbs new file mode 100644 index 00000000..b9c6575b --- /dev/null +++ b/sig/lithic/models/payment_return_params.rbs @@ -0,0 +1,51 @@ +module Lithic + module Models + type payment_return_params = + { + payment_token: String, + financial_account_token: String, + return_reason_code: String, + addenda: String?, + date_of_death: Date?, + memo: String? + } + & Lithic::Internal::Type::request_parameters + + class PaymentReturnParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor payment_token: String + + attr_accessor financial_account_token: String + + attr_accessor return_reason_code: String + + attr_accessor addenda: String? + + attr_accessor date_of_death: Date? + + attr_accessor memo: String? + + def initialize: ( + payment_token: String, + financial_account_token: String, + return_reason_code: String, + ?addenda: String?, + ?date_of_death: Date?, + ?memo: String?, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + payment_token: String, + financial_account_token: String, + return_reason_code: String, + addenda: String?, + date_of_death: Date?, + memo: String?, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/payment_simulate_action_params.rbs b/sig/lithic/models/payment_simulate_action_params.rbs new file mode 100644 index 00000000..c1823c6d --- /dev/null +++ b/sig/lithic/models/payment_simulate_action_params.rbs @@ -0,0 +1,105 @@ +module Lithic + module Models + type payment_simulate_action_params = + { + payment_token: String, + event_type: Lithic::Models::PaymentSimulateActionParams::event_type, + date_of_death: Date, + decline_reason: Lithic::Models::PaymentSimulateActionParams::decline_reason, + return_addenda: String, + return_reason_code: String + } + & Lithic::Internal::Type::request_parameters + + class PaymentSimulateActionParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor payment_token: String + + attr_accessor event_type: Lithic::Models::PaymentSimulateActionParams::event_type + + attr_reader date_of_death: Date? + + def date_of_death=: (Date) -> Date + + attr_reader decline_reason: Lithic::Models::PaymentSimulateActionParams::decline_reason? + + def decline_reason=: ( + Lithic::Models::PaymentSimulateActionParams::decline_reason + ) -> Lithic::Models::PaymentSimulateActionParams::decline_reason + + attr_reader return_addenda: String? + + def return_addenda=: (String) -> String + + attr_reader return_reason_code: String? + + def return_reason_code=: (String) -> String + + def initialize: ( + payment_token: String, + event_type: Lithic::Models::PaymentSimulateActionParams::event_type, + ?date_of_death: Date, + ?decline_reason: Lithic::Models::PaymentSimulateActionParams::decline_reason, + ?return_addenda: String, + ?return_reason_code: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + payment_token: String, + event_type: Lithic::Models::PaymentSimulateActionParams::event_type, + date_of_death: Date, + decline_reason: Lithic::Models::PaymentSimulateActionParams::decline_reason, + return_addenda: String, + return_reason_code: String, + request_options: Lithic::RequestOptions + } + + type event_type = + :ACH_ORIGINATION_REVIEWED + | :ACH_ORIGINATION_RELEASED + | :ACH_ORIGINATION_PROCESSED + | :ACH_ORIGINATION_SETTLED + | :ACH_RECEIPT_SETTLED + | :ACH_RECEIPT_RELEASED + | :ACH_RECEIPT_RELEASED_EARLY + | :ACH_RETURN_INITIATED + | :ACH_RETURN_PROCESSED + | :ACH_RETURN_SETTLED + + module EventType + extend Lithic::Internal::Type::Enum + + ACH_ORIGINATION_REVIEWED: :ACH_ORIGINATION_REVIEWED + ACH_ORIGINATION_RELEASED: :ACH_ORIGINATION_RELEASED + ACH_ORIGINATION_PROCESSED: :ACH_ORIGINATION_PROCESSED + ACH_ORIGINATION_SETTLED: :ACH_ORIGINATION_SETTLED + ACH_RECEIPT_SETTLED: :ACH_RECEIPT_SETTLED + ACH_RECEIPT_RELEASED: :ACH_RECEIPT_RELEASED + ACH_RECEIPT_RELEASED_EARLY: :ACH_RECEIPT_RELEASED_EARLY + ACH_RETURN_INITIATED: :ACH_RETURN_INITIATED + ACH_RETURN_PROCESSED: :ACH_RETURN_PROCESSED + ACH_RETURN_SETTLED: :ACH_RETURN_SETTLED + + def self?.values: -> ::Array[Lithic::Models::PaymentSimulateActionParams::event_type] + end + + type decline_reason = + :PROGRAM_TRANSACTION_LIMIT_EXCEEDED + | :PROGRAM_DAILY_LIMIT_EXCEEDED + | :PROGRAM_MONTHLY_LIMIT_EXCEEDED + + module DeclineReason + extend Lithic::Internal::Type::Enum + + PROGRAM_TRANSACTION_LIMIT_EXCEEDED: :PROGRAM_TRANSACTION_LIMIT_EXCEEDED + PROGRAM_DAILY_LIMIT_EXCEEDED: :PROGRAM_DAILY_LIMIT_EXCEEDED + PROGRAM_MONTHLY_LIMIT_EXCEEDED: :PROGRAM_MONTHLY_LIMIT_EXCEEDED + + def self?.values: -> ::Array[Lithic::Models::PaymentSimulateActionParams::decline_reason] + end + end + end +end diff --git a/sig/lithic/models/payment_simulate_action_response.rbs b/sig/lithic/models/payment_simulate_action_response.rbs new file mode 100644 index 00000000..e34d6c31 --- /dev/null +++ b/sig/lithic/models/payment_simulate_action_response.rbs @@ -0,0 +1,41 @@ +module Lithic + module Models + type payment_simulate_action_response = + { + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateActionResponse::result, + transaction_event_token: String + } + + class PaymentSimulateActionResponse < Lithic::Internal::Type::BaseModel + attr_accessor debugging_request_id: String + + attr_accessor result: Lithic::Models::PaymentSimulateActionResponse::result + + attr_accessor transaction_event_token: String + + def initialize: ( + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateActionResponse::result, + transaction_event_token: String + ) -> void + + def to_hash: -> { + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateActionResponse::result, + transaction_event_token: String + } + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::PaymentSimulateActionResponse::result] + end + end + end +end diff --git a/sig/lithic/models/payment_simulate_receipt_params.rbs b/sig/lithic/models/payment_simulate_receipt_params.rbs new file mode 100644 index 00000000..317fa8b9 --- /dev/null +++ b/sig/lithic/models/payment_simulate_receipt_params.rbs @@ -0,0 +1,59 @@ +module Lithic + module Models + type payment_simulate_receipt_params = + { + token: String, + amount: Integer, + financial_account_token: String, + receipt_type: Lithic::Models::PaymentSimulateReceiptParams::receipt_type, + memo: String + } + & Lithic::Internal::Type::request_parameters + + class PaymentSimulateReceiptParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor token: String + + attr_accessor amount: Integer + + attr_accessor financial_account_token: String + + attr_accessor receipt_type: Lithic::Models::PaymentSimulateReceiptParams::receipt_type + + attr_reader memo: String? + + def memo=: (String) -> String + + def initialize: ( + token: String, + amount: Integer, + financial_account_token: String, + receipt_type: Lithic::Models::PaymentSimulateReceiptParams::receipt_type, + ?memo: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + token: String, + amount: Integer, + financial_account_token: String, + receipt_type: Lithic::Models::PaymentSimulateReceiptParams::receipt_type, + memo: String, + request_options: Lithic::RequestOptions + } + + type receipt_type = :RECEIPT_CREDIT | :RECEIPT_DEBIT + + module ReceiptType + extend Lithic::Internal::Type::Enum + + RECEIPT_CREDIT: :RECEIPT_CREDIT + RECEIPT_DEBIT: :RECEIPT_DEBIT + + def self?.values: -> ::Array[Lithic::Models::PaymentSimulateReceiptParams::receipt_type] + end + end + end +end diff --git a/sig/lithic/models/payment_simulate_receipt_response.rbs b/sig/lithic/models/payment_simulate_receipt_response.rbs new file mode 100644 index 00000000..53bac05f --- /dev/null +++ b/sig/lithic/models/payment_simulate_receipt_response.rbs @@ -0,0 +1,41 @@ +module Lithic + module Models + type payment_simulate_receipt_response = + { + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateReceiptResponse::result, + transaction_event_token: String + } + + class PaymentSimulateReceiptResponse < Lithic::Internal::Type::BaseModel + attr_accessor debugging_request_id: String + + attr_accessor result: Lithic::Models::PaymentSimulateReceiptResponse::result + + attr_accessor transaction_event_token: String + + def initialize: ( + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateReceiptResponse::result, + transaction_event_token: String + ) -> void + + def to_hash: -> { + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateReceiptResponse::result, + transaction_event_token: String + } + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::PaymentSimulateReceiptResponse::result] + end + end + end +end diff --git a/sig/lithic/models/payment_simulate_release_params.rbs b/sig/lithic/models/payment_simulate_release_params.rbs new file mode 100644 index 00000000..5882ff63 --- /dev/null +++ b/sig/lithic/models/payment_simulate_release_params.rbs @@ -0,0 +1,23 @@ +module Lithic + module Models + type payment_simulate_release_params = + { payment_token: String } & Lithic::Internal::Type::request_parameters + + class PaymentSimulateReleaseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor payment_token: String + + def initialize: ( + payment_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + payment_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/payment_simulate_release_response.rbs b/sig/lithic/models/payment_simulate_release_response.rbs new file mode 100644 index 00000000..855fc193 --- /dev/null +++ b/sig/lithic/models/payment_simulate_release_response.rbs @@ -0,0 +1,41 @@ +module Lithic + module Models + type payment_simulate_release_response = + { + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateReleaseResponse::result, + transaction_event_token: String + } + + class PaymentSimulateReleaseResponse < Lithic::Internal::Type::BaseModel + attr_accessor debugging_request_id: String + + attr_accessor result: Lithic::Models::PaymentSimulateReleaseResponse::result + + attr_accessor transaction_event_token: String + + def initialize: ( + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateReleaseResponse::result, + transaction_event_token: String + ) -> void + + def to_hash: -> { + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateReleaseResponse::result, + transaction_event_token: String + } + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::PaymentSimulateReleaseResponse::result] + end + end + end +end diff --git a/sig/lithic/models/payment_simulate_return_params.rbs b/sig/lithic/models/payment_simulate_return_params.rbs new file mode 100644 index 00000000..eb2b6384 --- /dev/null +++ b/sig/lithic/models/payment_simulate_return_params.rbs @@ -0,0 +1,30 @@ +module Lithic + module Models + type payment_simulate_return_params = + { payment_token: String, return_reason_code: String } + & Lithic::Internal::Type::request_parameters + + class PaymentSimulateReturnParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor payment_token: String + + attr_reader return_reason_code: String? + + def return_reason_code=: (String) -> String + + def initialize: ( + payment_token: String, + ?return_reason_code: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + payment_token: String, + return_reason_code: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/payment_simulate_return_response.rbs b/sig/lithic/models/payment_simulate_return_response.rbs new file mode 100644 index 00000000..9587a38c --- /dev/null +++ b/sig/lithic/models/payment_simulate_return_response.rbs @@ -0,0 +1,41 @@ +module Lithic + module Models + type payment_simulate_return_response = + { + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateReturnResponse::result, + transaction_event_token: String + } + + class PaymentSimulateReturnResponse < Lithic::Internal::Type::BaseModel + attr_accessor debugging_request_id: String + + attr_accessor result: Lithic::Models::PaymentSimulateReturnResponse::result + + attr_accessor transaction_event_token: String + + def initialize: ( + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateReturnResponse::result, + transaction_event_token: String + ) -> void + + def to_hash: -> { + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateReturnResponse::result, + transaction_event_token: String + } + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::PaymentSimulateReturnResponse::result] + end + end + end +end diff --git a/sig/lithic/models/payment_transaction_created_webhook_event.rbs b/sig/lithic/models/payment_transaction_created_webhook_event.rbs new file mode 100644 index 00000000..2c754cf8 --- /dev/null +++ b/sig/lithic/models/payment_transaction_created_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type payment_transaction_created_webhook_event = + { event_type: :"payment_transaction.created" } + + class PaymentTransactionCreatedWebhookEvent < Lithic::Models::Payment + def event_type: -> :"payment_transaction.created" + + def event_type=: ( + :"payment_transaction.created" _ + ) -> :"payment_transaction.created" + + def initialize: (?event_type: :"payment_transaction.created") -> void + + def to_hash: -> { event_type: :"payment_transaction.created" } + end + end +end diff --git a/sig/lithic/models/payment_transaction_updated_webhook_event.rbs b/sig/lithic/models/payment_transaction_updated_webhook_event.rbs new file mode 100644 index 00000000..eef7f4db --- /dev/null +++ b/sig/lithic/models/payment_transaction_updated_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type payment_transaction_updated_webhook_event = + { event_type: :"payment_transaction.updated" } + + class PaymentTransactionUpdatedWebhookEvent < Lithic::Models::Payment + def event_type: -> :"payment_transaction.updated" + + def event_type=: ( + :"payment_transaction.updated" _ + ) -> :"payment_transaction.updated" + + def initialize: (?event_type: :"payment_transaction.updated") -> void + + def to_hash: -> { event_type: :"payment_transaction.updated" } + end + end +end diff --git a/sig/lithic/models/provision_response.rbs b/sig/lithic/models/provision_response.rbs new file mode 100644 index 00000000..65adf97a --- /dev/null +++ b/sig/lithic/models/provision_response.rbs @@ -0,0 +1,36 @@ +module Lithic + module Models + type provision_response = + { + activation_data: String, + encrypted_data: String, + ephemeral_public_key: String + } + + class ProvisionResponse < Lithic::Internal::Type::BaseModel + attr_reader activation_data: String? + + def activation_data=: (String) -> String + + attr_reader encrypted_data: String? + + def encrypted_data=: (String) -> String + + attr_reader ephemeral_public_key: String? + + def ephemeral_public_key=: (String) -> String + + def initialize: ( + ?activation_data: String, + ?encrypted_data: String, + ?ephemeral_public_key: String + ) -> void + + def to_hash: -> { + activation_data: String, + encrypted_data: String, + ephemeral_public_key: String + } + end + end +end diff --git a/sig/lithic/models/reports/settlement/network_total_list_params.rbs b/sig/lithic/models/reports/settlement/network_total_list_params.rbs new file mode 100644 index 00000000..2a1a8365 --- /dev/null +++ b/sig/lithic/models/reports/settlement/network_total_list_params.rbs @@ -0,0 +1,118 @@ +module Lithic + module Models + module Reports + module Settlement + type network_total_list_params = + { + begin_: Time, + end_: Time, + ending_before: String, + institution_id: String, + network: Lithic::Models::Reports::Settlement::NetworkTotalListParams::network, + page_size: Integer, + report_date: Date, + report_date_begin: Date, + report_date_end: Date, + settlement_institution_id: String, + starting_after: String + } + & Lithic::Internal::Type::request_parameters + + class NetworkTotalListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader institution_id: String? + + def institution_id=: (String) -> String + + attr_reader network: Lithic::Models::Reports::Settlement::NetworkTotalListParams::network? + + def network=: ( + Lithic::Models::Reports::Settlement::NetworkTotalListParams::network + ) -> Lithic::Models::Reports::Settlement::NetworkTotalListParams::network + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader report_date: Date? + + def report_date=: (Date) -> Date + + attr_reader report_date_begin: Date? + + def report_date_begin=: (Date) -> Date + + attr_reader report_date_end: Date? + + def report_date_end=: (Date) -> Date + + attr_reader settlement_institution_id: String? + + def settlement_institution_id=: (String) -> String + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?institution_id: String, + ?network: Lithic::Models::Reports::Settlement::NetworkTotalListParams::network, + ?page_size: Integer, + ?report_date: Date, + ?report_date_begin: Date, + ?report_date_end: Date, + ?settlement_institution_id: String, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + begin_: Time, + end_: Time, + ending_before: String, + institution_id: String, + network: Lithic::Models::Reports::Settlement::NetworkTotalListParams::network, + page_size: Integer, + report_date: Date, + report_date_begin: Date, + report_date_end: Date, + settlement_institution_id: String, + starting_after: String, + request_options: Lithic::RequestOptions + } + + type network = :AMEX | :VISA | :MASTERCARD | :MAESTRO | :INTERLINK + + module Network + extend Lithic::Internal::Type::Enum + + AMEX: :AMEX + VISA: :VISA + MASTERCARD: :MASTERCARD + MAESTRO: :MAESTRO + INTERLINK: :INTERLINK + + def self?.values: -> ::Array[Lithic::Models::Reports::Settlement::NetworkTotalListParams::network] + end + end + end + end + end +end diff --git a/sig/lithic/models/reports/settlement/network_total_retrieve_params.rbs b/sig/lithic/models/reports/settlement/network_total_retrieve_params.rbs new file mode 100644 index 00000000..6e983b6e --- /dev/null +++ b/sig/lithic/models/reports/settlement/network_total_retrieve_params.rbs @@ -0,0 +1,27 @@ +module Lithic + module Models + module Reports + module Settlement + type network_total_retrieve_params = + { token: String } & Lithic::Internal::Type::request_parameters + + class NetworkTotalRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor token: String + + def initialize: ( + token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + token: String, + request_options: Lithic::RequestOptions + } + end + end + end + end +end diff --git a/sig/lithic/models/reports/settlement_list_details_params.rbs b/sig/lithic/models/reports/settlement_list_details_params.rbs new file mode 100644 index 00000000..03aaf0e7 --- /dev/null +++ b/sig/lithic/models/reports/settlement_list_details_params.rbs @@ -0,0 +1,49 @@ +module Lithic + module Models + module Reports + type settlement_list_details_params = + { + report_date: Date, + ending_before: String, + page_size: Integer, + starting_after: String + } + & Lithic::Internal::Type::request_parameters + + class SettlementListDetailsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor report_date: Date + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + report_date: Date, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + report_date: Date, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/reports/settlement_summary_params.rbs b/sig/lithic/models/reports/settlement_summary_params.rbs new file mode 100644 index 00000000..01e7a144 --- /dev/null +++ b/sig/lithic/models/reports/settlement_summary_params.rbs @@ -0,0 +1,25 @@ +module Lithic + module Models + module Reports + type settlement_summary_params = + { report_date: Date } & Lithic::Internal::Type::request_parameters + + class SettlementSummaryParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor report_date: Date + + def initialize: ( + report_date: Date, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + report_date: Date, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/required_document.rbs b/sig/lithic/models/required_document.rbs new file mode 100644 index 00000000..03a64a5d --- /dev/null +++ b/sig/lithic/models/required_document.rbs @@ -0,0 +1,30 @@ +module Lithic + module Models + type required_document = + { + entity_token: String, + status_reasons: ::Array[String], + valid_documents: ::Array[String] + } + + class RequiredDocument < Lithic::Internal::Type::BaseModel + attr_accessor entity_token: String + + attr_accessor status_reasons: ::Array[String] + + attr_accessor valid_documents: ::Array[String] + + def initialize: ( + entity_token: String, + status_reasons: ::Array[String], + valid_documents: ::Array[String] + ) -> void + + def to_hash: -> { + entity_token: String, + status_reasons: ::Array[String], + valid_documents: ::Array[String] + } + end + end +end diff --git a/sig/lithic/models/responder_endpoint_check_status_params.rbs b/sig/lithic/models/responder_endpoint_check_status_params.rbs new file mode 100644 index 00000000..fd199282 --- /dev/null +++ b/sig/lithic/models/responder_endpoint_check_status_params.rbs @@ -0,0 +1,37 @@ +module Lithic + module Models + type responder_endpoint_check_status_params = + { type: Lithic::Models::ResponderEndpointCheckStatusParams::type_ } + & Lithic::Internal::Type::request_parameters + + class ResponderEndpointCheckStatusParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor type: Lithic::Models::ResponderEndpointCheckStatusParams::type_ + + def initialize: ( + type: Lithic::Models::ResponderEndpointCheckStatusParams::type_, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + type: Lithic::Models::ResponderEndpointCheckStatusParams::type_, + request_options: Lithic::RequestOptions + } + + type type_ = + :AUTH_STREAM_ACCESS | :THREE_DS_DECISIONING | :TOKENIZATION_DECISIONING + + module Type + extend Lithic::Internal::Type::Enum + + AUTH_STREAM_ACCESS: :AUTH_STREAM_ACCESS + THREE_DS_DECISIONING: :THREE_DS_DECISIONING + TOKENIZATION_DECISIONING: :TOKENIZATION_DECISIONING + + def self?.values: -> ::Array[Lithic::Models::ResponderEndpointCheckStatusParams::type_] + end + end + end +end diff --git a/sig/lithic/models/responder_endpoint_create_params.rbs b/sig/lithic/models/responder_endpoint_create_params.rbs new file mode 100644 index 00000000..f7ae4d75 --- /dev/null +++ b/sig/lithic/models/responder_endpoint_create_params.rbs @@ -0,0 +1,50 @@ +module Lithic + module Models + type responder_endpoint_create_params = + { + type: Lithic::Models::ResponderEndpointCreateParams::type_, + url: String + } + & Lithic::Internal::Type::request_parameters + + class ResponderEndpointCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader type: Lithic::Models::ResponderEndpointCreateParams::type_? + + def type=: ( + Lithic::Models::ResponderEndpointCreateParams::type_ + ) -> Lithic::Models::ResponderEndpointCreateParams::type_ + + attr_reader url: String? + + def url=: (String) -> String + + def initialize: ( + ?type: Lithic::Models::ResponderEndpointCreateParams::type_, + ?url: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + type: Lithic::Models::ResponderEndpointCreateParams::type_, + url: String, + request_options: Lithic::RequestOptions + } + + type type_ = + :AUTH_STREAM_ACCESS | :THREE_DS_DECISIONING | :TOKENIZATION_DECISIONING + + module Type + extend Lithic::Internal::Type::Enum + + AUTH_STREAM_ACCESS: :AUTH_STREAM_ACCESS + THREE_DS_DECISIONING: :THREE_DS_DECISIONING + TOKENIZATION_DECISIONING: :TOKENIZATION_DECISIONING + + def self?.values: -> ::Array[Lithic::Models::ResponderEndpointCreateParams::type_] + end + end + end +end diff --git a/sig/lithic/models/responder_endpoint_create_response.rbs b/sig/lithic/models/responder_endpoint_create_response.rbs new file mode 100644 index 00000000..900fcb48 --- /dev/null +++ b/sig/lithic/models/responder_endpoint_create_response.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type responder_endpoint_create_response = { enrolled: bool } + + class ResponderEndpointCreateResponse < Lithic::Internal::Type::BaseModel + attr_reader enrolled: bool? + + def enrolled=: (bool) -> bool + + def initialize: (?enrolled: bool) -> void + + def to_hash: -> { enrolled: bool } + end + end +end diff --git a/sig/lithic/models/responder_endpoint_delete_params.rbs b/sig/lithic/models/responder_endpoint_delete_params.rbs new file mode 100644 index 00000000..78c1a9b1 --- /dev/null +++ b/sig/lithic/models/responder_endpoint_delete_params.rbs @@ -0,0 +1,37 @@ +module Lithic + module Models + type responder_endpoint_delete_params = + { type: Lithic::Models::ResponderEndpointDeleteParams::type_ } + & Lithic::Internal::Type::request_parameters + + class ResponderEndpointDeleteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor type: Lithic::Models::ResponderEndpointDeleteParams::type_ + + def initialize: ( + type: Lithic::Models::ResponderEndpointDeleteParams::type_, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + type: Lithic::Models::ResponderEndpointDeleteParams::type_, + request_options: Lithic::RequestOptions + } + + type type_ = + :AUTH_STREAM_ACCESS | :THREE_DS_DECISIONING | :TOKENIZATION_DECISIONING + + module Type + extend Lithic::Internal::Type::Enum + + AUTH_STREAM_ACCESS: :AUTH_STREAM_ACCESS + THREE_DS_DECISIONING: :THREE_DS_DECISIONING + TOKENIZATION_DECISIONING: :TOKENIZATION_DECISIONING + + def self?.values: -> ::Array[Lithic::Models::ResponderEndpointDeleteParams::type_] + end + end + end +end diff --git a/sig/lithic/models/responder_endpoint_status.rbs b/sig/lithic/models/responder_endpoint_status.rbs new file mode 100644 index 00000000..02e49f6a --- /dev/null +++ b/sig/lithic/models/responder_endpoint_status.rbs @@ -0,0 +1,17 @@ +module Lithic + module Models + type responder_endpoint_status = { enrolled: bool, url: String? } + + class ResponderEndpointStatus < Lithic::Internal::Type::BaseModel + attr_reader enrolled: bool? + + def enrolled=: (bool) -> bool + + attr_accessor url: String? + + def initialize: (?enrolled: bool, ?url: String?) -> void + + def to_hash: -> { enrolled: bool, url: String? } + end + end +end diff --git a/sig/lithic/models/settlement_detail.rbs b/sig/lithic/models/settlement_detail.rbs new file mode 100644 index 00000000..c90f5d78 --- /dev/null +++ b/sig/lithic/models/settlement_detail.rbs @@ -0,0 +1,179 @@ +module Lithic + module Models + type settlement_detail = + { + token: String, + account_token: String?, + card_program_token: String?, + card_token: String?, + created: Time, + currency: String, + disputes_gross_amount: Integer, + event_tokens: ::Array[String], + institution: String, + interchange_fee_extended_precision: Integer, + interchange_gross_amount: Integer, + network: Lithic::Models::SettlementDetail::network, + other_fees_details: Lithic::SettlementDetail::OtherFeesDetails, + other_fees_gross_amount: Integer, + report_date: String, + settlement_date: String, + transaction_token: String?, + transactions_gross_amount: Integer, + type: Lithic::Models::SettlementDetail::type_, + updated: Time, + fee_description: String + } + + class SettlementDetail < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor account_token: String? + + attr_accessor card_program_token: String? + + attr_accessor card_token: String? + + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor disputes_gross_amount: Integer + + attr_accessor event_tokens: ::Array[String] + + attr_accessor institution: String + + attr_accessor interchange_fee_extended_precision: Integer + + attr_accessor interchange_gross_amount: Integer + + attr_accessor network: Lithic::Models::SettlementDetail::network + + attr_accessor other_fees_details: Lithic::SettlementDetail::OtherFeesDetails + + attr_accessor other_fees_gross_amount: Integer + + attr_accessor report_date: String + + attr_accessor settlement_date: String + + attr_accessor transaction_token: String? + + attr_accessor transactions_gross_amount: Integer + + attr_accessor type: Lithic::Models::SettlementDetail::type_ + + attr_accessor updated: Time + + attr_reader fee_description: String? + + def fee_description=: (String) -> String + + def initialize: ( + token: String, + account_token: String?, + card_program_token: String?, + card_token: String?, + created: Time, + currency: String, + disputes_gross_amount: Integer, + event_tokens: ::Array[String], + institution: String, + interchange_fee_extended_precision: Integer, + interchange_gross_amount: Integer, + network: Lithic::Models::SettlementDetail::network, + other_fees_details: Lithic::SettlementDetail::OtherFeesDetails, + other_fees_gross_amount: Integer, + report_date: String, + settlement_date: String, + transaction_token: String?, + transactions_gross_amount: Integer, + type: Lithic::Models::SettlementDetail::type_, + updated: Time, + ?fee_description: String + ) -> void + + def to_hash: -> { + token: String, + account_token: String?, + card_program_token: String?, + card_token: String?, + created: Time, + currency: String, + disputes_gross_amount: Integer, + event_tokens: ::Array[String], + institution: String, + interchange_fee_extended_precision: Integer, + interchange_gross_amount: Integer, + network: Lithic::Models::SettlementDetail::network, + other_fees_details: Lithic::SettlementDetail::OtherFeesDetails, + other_fees_gross_amount: Integer, + report_date: String, + settlement_date: String, + transaction_token: String?, + transactions_gross_amount: Integer, + type: Lithic::Models::SettlementDetail::type_, + updated: Time, + fee_description: String + } + + type network = + :AMEX | :INTERLINK | :MAESTRO | :MASTERCARD | :UNKNOWN | :VISA + + module Network + extend Lithic::Internal::Type::Enum + + AMEX: :AMEX + INTERLINK: :INTERLINK + MAESTRO: :MAESTRO + MASTERCARD: :MASTERCARD + UNKNOWN: :UNKNOWN + VISA: :VISA + + def self?.values: -> ::Array[Lithic::Models::SettlementDetail::network] + end + + type other_fees_details = { isa: Integer } + + class OtherFeesDetails < Lithic::Internal::Type::BaseModel + attr_reader isa: Integer? + + def isa=: (Integer) -> Integer + + def initialize: (?isa: Integer) -> void + + def to_hash: -> { isa: Integer } + end + + type type_ = + :ADJUSTMENT + | :ARBITRATION + | :CHARGEBACK + | :CLEARING + | :COLLABORATION + | :FEE + | :FINANCIAL + | :NON_FINANCIAL + | :PREARBITRATION + | :REPRESENTMENT + + module Type + extend Lithic::Internal::Type::Enum + + ADJUSTMENT: :ADJUSTMENT + ARBITRATION: :ARBITRATION + CHARGEBACK: :CHARGEBACK + CLEARING: :CLEARING + COLLABORATION: :COLLABORATION + FEE: :FEE + FINANCIAL: :FINANCIAL + NON_FINANCIAL: :NON_FINANCIAL + PREARBITRATION: :PREARBITRATION + REPRESENTMENT: :REPRESENTMENT + + def self?.values: -> ::Array[Lithic::Models::SettlementDetail::type_] + end + end + end +end diff --git a/sig/lithic/models/settlement_report.rbs b/sig/lithic/models/settlement_report.rbs new file mode 100644 index 00000000..4578c62c --- /dev/null +++ b/sig/lithic/models/settlement_report.rbs @@ -0,0 +1,70 @@ +module Lithic + module Models + type settlement_report = + { + created: Time, + currency: String, + details: ::Array[Lithic::SettlementSummaryDetails], + disputes_gross_amount: Integer, + interchange_gross_amount: Integer, + is_complete: bool, + other_fees_gross_amount: Integer, + report_date: String, + settled_net_amount: Integer, + transactions_gross_amount: Integer, + updated: Time + } + + class SettlementReport < Lithic::Internal::Type::BaseModel + attr_accessor created: Time + + attr_accessor currency: String + + attr_accessor details: ::Array[Lithic::SettlementSummaryDetails] + + attr_accessor disputes_gross_amount: Integer + + attr_accessor interchange_gross_amount: Integer + + attr_accessor is_complete: bool + + attr_accessor other_fees_gross_amount: Integer + + attr_accessor report_date: String + + attr_accessor settled_net_amount: Integer + + attr_accessor transactions_gross_amount: Integer + + attr_accessor updated: Time + + def initialize: ( + created: Time, + currency: String, + details: ::Array[Lithic::SettlementSummaryDetails], + disputes_gross_amount: Integer, + interchange_gross_amount: Integer, + is_complete: bool, + other_fees_gross_amount: Integer, + report_date: String, + settled_net_amount: Integer, + transactions_gross_amount: Integer, + updated: Time + ) -> void + + def to_hash: -> { + created: Time, + currency: String, + details: ::Array[Lithic::SettlementSummaryDetails], + disputes_gross_amount: Integer, + interchange_gross_amount: Integer, + is_complete: bool, + other_fees_gross_amount: Integer, + report_date: String, + settled_net_amount: Integer, + transactions_gross_amount: Integer, + updated: Time + } + end + end +end diff --git a/sig/lithic/models/settlement_report_updated_webhook_event.rbs b/sig/lithic/models/settlement_report_updated_webhook_event.rbs new file mode 100644 index 00000000..1d947673 --- /dev/null +++ b/sig/lithic/models/settlement_report_updated_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type settlement_report_updated_webhook_event = + { event_type: :"settlement_report.updated" } + + class SettlementReportUpdatedWebhookEvent < Lithic::Models::SettlementReport + def event_type: -> :"settlement_report.updated" + + def event_type=: ( + :"settlement_report.updated" _ + ) -> :"settlement_report.updated" + + def initialize: (?event_type: :"settlement_report.updated") -> void + + def to_hash: -> { event_type: :"settlement_report.updated" } + end + end +end diff --git a/sig/lithic/models/settlement_summary_details.rbs b/sig/lithic/models/settlement_summary_details.rbs new file mode 100644 index 00000000..9a7c1cab --- /dev/null +++ b/sig/lithic/models/settlement_summary_details.rbs @@ -0,0 +1,89 @@ +module Lithic + module Models + type settlement_summary_details = + { + currency: String, + disputes_gross_amount: Integer, + institution: String, + interchange_gross_amount: Integer, + network: Lithic::Models::SettlementSummaryDetails::network, + other_fees_gross_amount: Integer, + settled_net_amount: Integer, + transactions_gross_amount: Integer + } + + class SettlementSummaryDetails < Lithic::Internal::Type::BaseModel + attr_reader currency: String? + + def currency=: (String) -> String + + attr_reader disputes_gross_amount: Integer? + + def disputes_gross_amount=: (Integer) -> Integer + + attr_reader institution: String? + + def institution=: (String) -> String + + attr_reader interchange_gross_amount: Integer? + + def interchange_gross_amount=: (Integer) -> Integer + + attr_reader network: Lithic::Models::SettlementSummaryDetails::network? + + def network=: ( + Lithic::Models::SettlementSummaryDetails::network + ) -> Lithic::Models::SettlementSummaryDetails::network + + attr_reader other_fees_gross_amount: Integer? + + def other_fees_gross_amount=: (Integer) -> Integer + + attr_reader settled_net_amount: Integer? + + def settled_net_amount=: (Integer) -> Integer + + attr_reader transactions_gross_amount: Integer? + + def transactions_gross_amount=: (Integer) -> Integer + + def initialize: ( + ?currency: String, + ?disputes_gross_amount: Integer, + ?institution: String, + ?interchange_gross_amount: Integer, + ?network: Lithic::Models::SettlementSummaryDetails::network, + ?other_fees_gross_amount: Integer, + ?settled_net_amount: Integer, + ?transactions_gross_amount: Integer + ) -> void + + def to_hash: -> { + currency: String, + disputes_gross_amount: Integer, + institution: String, + interchange_gross_amount: Integer, + network: Lithic::Models::SettlementSummaryDetails::network, + other_fees_gross_amount: Integer, + settled_net_amount: Integer, + transactions_gross_amount: Integer + } + + type network = + :AMEX | :INTERLINK | :MAESTRO | :MASTERCARD | :UNKNOWN | :VISA + + module Network + extend Lithic::Internal::Type::Enum + + AMEX: :AMEX + INTERLINK: :INTERLINK + MAESTRO: :MAESTRO + MASTERCARD: :MASTERCARD + UNKNOWN: :UNKNOWN + VISA: :VISA + + def self?.values: -> ::Array[Lithic::Models::SettlementSummaryDetails::network] + end + end + end +end diff --git a/sig/lithic/models/shipping_address.rbs b/sig/lithic/models/shipping_address.rbs new file mode 100644 index 00000000..ed762ee6 --- /dev/null +++ b/sig/lithic/models/shipping_address.rbs @@ -0,0 +1,78 @@ +module Lithic + module Models + type shipping_address = + { + :address1 => String, + city: String, + country: String, + first_name: String, + last_name: String, + postal_code: String, + state: String, + :address2 => String, + email: String, + :line2_text => String, + phone_number: String + } + + class ShippingAddress < Lithic::Internal::Type::BaseModel + attr_accessor address1: String + + attr_accessor city: String + + attr_accessor country: String + + attr_accessor first_name: String + + attr_accessor last_name: String + + attr_accessor postal_code: String + + attr_accessor state: String + + attr_reader address2: String? + + def address2=: (String) -> String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader line2_text: String? + + def line2_text=: (String) -> String + + attr_reader phone_number: String? + + def phone_number=: (String) -> String + + def initialize: ( + address1: String, + city: String, + country: String, + first_name: String, + last_name: String, + postal_code: String, + state: String, + ?address2: String, + ?email: String, + ?line2_text: String, + ?phone_number: String + ) -> void + + def to_hash: -> { + :address1 => String, + city: String, + country: String, + first_name: String, + last_name: String, + postal_code: String, + state: String, + :address2 => String, + email: String, + :line2_text => String, + phone_number: String + } + end + end +end diff --git a/sig/lithic/models/signals_response.rbs b/sig/lithic/models/signals_response.rbs new file mode 100644 index 00000000..a8afd35c --- /dev/null +++ b/sig/lithic/models/signals_response.rbs @@ -0,0 +1,170 @@ +module Lithic + module Models + type signals_response = + { + :approved_txn_amount_m2 => Float?, + :approved_txn_amount_m2_30d => Float?, + :approved_txn_amount_m2_7d => Float?, + :approved_txn_amount_m2_90d => Float?, + approved_txn_count: Integer?, + :approved_txn_count_30d => Integer?, + :approved_txn_count_7d => Integer?, + :approved_txn_count_90d => Integer?, + avg_transaction_amount: Float?, + :avg_transaction_amount_30d => Float?, + :avg_transaction_amount_7d => Float?, + :avg_transaction_amount_90d => Float?, + distinct_country_count: Integer?, + distinct_mcc_count: Integer?, + first_txn_at: Time?, + is_first_transaction: bool?, + last_cp_country: String?, + last_cp_postal_code: String?, + last_cp_timestamp: Time?, + last_txn_approved_at: Time?, + seen_countries: ::Array[String]?, + seen_mccs: ::Array[String]?, + seen_merchants: ::Array[String]?, + stdev_transaction_amount: Float?, + :stdev_transaction_amount_30d => Float?, + :stdev_transaction_amount_7d => Float?, + :stdev_transaction_amount_90d => Float?, + three_ds_success_count: Integer?, + three_ds_success_rate: Float?, + three_ds_total_count: Integer?, + time_since_last_transaction_days: Float? + } + + class SignalsResponse < Lithic::Internal::Type::BaseModel + attr_accessor approved_txn_amount_m2: Float? + + attr_accessor approved_txn_amount_m2_30d: Float? + + attr_accessor approved_txn_amount_m2_7d: Float? + + attr_accessor approved_txn_amount_m2_90d: Float? + + attr_accessor approved_txn_count: Integer? + + attr_accessor approved_txn_count_30d: Integer? + + attr_accessor approved_txn_count_7d: Integer? + + attr_accessor approved_txn_count_90d: Integer? + + attr_accessor avg_transaction_amount: Float? + + attr_accessor avg_transaction_amount_30d: Float? + + attr_accessor avg_transaction_amount_7d: Float? + + attr_accessor avg_transaction_amount_90d: Float? + + attr_accessor distinct_country_count: Integer? + + attr_accessor distinct_mcc_count: Integer? + + attr_accessor first_txn_at: Time? + + attr_accessor is_first_transaction: bool? + + attr_accessor last_cp_country: String? + + attr_accessor last_cp_postal_code: String? + + attr_accessor last_cp_timestamp: Time? + + attr_accessor last_txn_approved_at: Time? + + attr_accessor seen_countries: ::Array[String]? + + attr_accessor seen_mccs: ::Array[String]? + + attr_accessor seen_merchants: ::Array[String]? + + attr_accessor stdev_transaction_amount: Float? + + attr_accessor stdev_transaction_amount_30d: Float? + + attr_accessor stdev_transaction_amount_7d: Float? + + attr_accessor stdev_transaction_amount_90d: Float? + + attr_accessor three_ds_success_count: Integer? + + attr_accessor three_ds_success_rate: Float? + + attr_accessor three_ds_total_count: Integer? + + attr_accessor time_since_last_transaction_days: Float? + + def initialize: ( + approved_txn_amount_m2: Float?, + approved_txn_amount_m2_30d: Float?, + approved_txn_amount_m2_7d: Float?, + approved_txn_amount_m2_90d: Float?, + approved_txn_count: Integer?, + approved_txn_count_30d: Integer?, + approved_txn_count_7d: Integer?, + approved_txn_count_90d: Integer?, + avg_transaction_amount: Float?, + avg_transaction_amount_30d: Float?, + avg_transaction_amount_7d: Float?, + avg_transaction_amount_90d: Float?, + distinct_country_count: Integer?, + distinct_mcc_count: Integer?, + first_txn_at: Time?, + is_first_transaction: bool?, + last_cp_country: String?, + last_cp_postal_code: String?, + last_cp_timestamp: Time?, + last_txn_approved_at: Time?, + seen_countries: ::Array[String]?, + seen_mccs: ::Array[String]?, + seen_merchants: ::Array[String]?, + stdev_transaction_amount: Float?, + stdev_transaction_amount_30d: Float?, + stdev_transaction_amount_7d: Float?, + stdev_transaction_amount_90d: Float?, + three_ds_success_count: Integer?, + three_ds_success_rate: Float?, + three_ds_total_count: Integer?, + time_since_last_transaction_days: Float? + ) -> void + + def to_hash: -> { + :approved_txn_amount_m2 => Float?, + :approved_txn_amount_m2_30d => Float?, + :approved_txn_amount_m2_7d => Float?, + :approved_txn_amount_m2_90d => Float?, + approved_txn_count: Integer?, + :approved_txn_count_30d => Integer?, + :approved_txn_count_7d => Integer?, + :approved_txn_count_90d => Integer?, + avg_transaction_amount: Float?, + :avg_transaction_amount_30d => Float?, + :avg_transaction_amount_7d => Float?, + :avg_transaction_amount_90d => Float?, + distinct_country_count: Integer?, + distinct_mcc_count: Integer?, + first_txn_at: Time?, + is_first_transaction: bool?, + last_cp_country: String?, + last_cp_postal_code: String?, + last_cp_timestamp: Time?, + last_txn_approved_at: Time?, + seen_countries: ::Array[String]?, + seen_mccs: ::Array[String]?, + seen_merchants: ::Array[String]?, + stdev_transaction_amount: Float?, + :stdev_transaction_amount_30d => Float?, + :stdev_transaction_amount_7d => Float?, + :stdev_transaction_amount_90d => Float?, + three_ds_success_count: Integer?, + three_ds_success_rate: Float?, + three_ds_total_count: Integer?, + time_since_last_transaction_days: Float? + } + end + end +end diff --git a/sig/lithic/models/spend_limit_duration.rbs b/sig/lithic/models/spend_limit_duration.rbs new file mode 100644 index 00000000..0de2b92d --- /dev/null +++ b/sig/lithic/models/spend_limit_duration.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + type spend_limit_duration = :ANNUALLY | :FOREVER | :MONTHLY | :TRANSACTION + + module SpendLimitDuration + extend Lithic::Internal::Type::Enum + + ANNUALLY: :ANNUALLY + FOREVER: :FOREVER + MONTHLY: :MONTHLY + TRANSACTION: :TRANSACTION + + def self?.values: -> ::Array[Lithic::Models::spend_limit_duration] + end + end +end diff --git a/sig/lithic/models/statement_totals.rbs b/sig/lithic/models/statement_totals.rbs new file mode 100644 index 00000000..bbf915ea --- /dev/null +++ b/sig/lithic/models/statement_totals.rbs @@ -0,0 +1,70 @@ +module Lithic + module Models + type statement_totals = + { + balance_transfers: Integer, + cash_advances: Integer, + credits: Integer, + debits: Integer, + fees: Integer, + interest: Integer, + payments: Integer, + purchases: Integer, + credit_details: top?, + debit_details: top?, + payment_details: top? + } + + class StatementTotals < Lithic::Internal::Type::BaseModel + attr_accessor balance_transfers: Integer + + attr_accessor cash_advances: Integer + + attr_accessor credits: Integer + + attr_accessor debits: Integer + + attr_accessor fees: Integer + + attr_accessor interest: Integer + + attr_accessor payments: Integer + + attr_accessor purchases: Integer + + attr_accessor credit_details: top? + + attr_accessor debit_details: top? + + attr_accessor payment_details: top? + + def initialize: ( + balance_transfers: Integer, + cash_advances: Integer, + credits: Integer, + debits: Integer, + fees: Integer, + interest: Integer, + payments: Integer, + purchases: Integer, + ?credit_details: top?, + ?debit_details: top?, + ?payment_details: top? + ) -> void + + def to_hash: -> { + balance_transfers: Integer, + cash_advances: Integer, + credits: Integer, + debits: Integer, + fees: Integer, + interest: Integer, + payments: Integer, + purchases: Integer, + credit_details: top?, + debit_details: top?, + payment_details: top? + } + end + end +end diff --git a/sig/lithic/models/statements_created_webhook_event.rbs b/sig/lithic/models/statements_created_webhook_event.rbs new file mode 100644 index 00000000..118b50c5 --- /dev/null +++ b/sig/lithic/models/statements_created_webhook_event.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + type statements_created_webhook_event = + { event_type: :"statements.created" } + + class StatementsCreatedWebhookEvent < Lithic::Models::FinancialAccounts::Statement + def event_type: -> :"statements.created" + + def event_type=: (:"statements.created" _) -> :"statements.created" + + def initialize: (?event_type: :"statements.created") -> void + + def to_hash: -> { event_type: :"statements.created" } + end + end +end diff --git a/sig/lithic/models/three_ds/authentication_retrieve_params.rbs b/sig/lithic/models/three_ds/authentication_retrieve_params.rbs new file mode 100644 index 00000000..a8b989f6 --- /dev/null +++ b/sig/lithic/models/three_ds/authentication_retrieve_params.rbs @@ -0,0 +1,26 @@ +module Lithic + module Models + module ThreeDS + type authentication_retrieve_params = + { three_ds_authentication_token: String } + & Lithic::Internal::Type::request_parameters + + class AuthenticationRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor three_ds_authentication_token: String + + def initialize: ( + three_ds_authentication_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + three_ds_authentication_token: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/three_ds/authentication_simulate_otp_entry_params.rbs b/sig/lithic/models/three_ds/authentication_simulate_otp_entry_params.rbs new file mode 100644 index 00000000..0c5d1b1a --- /dev/null +++ b/sig/lithic/models/three_ds/authentication_simulate_otp_entry_params.rbs @@ -0,0 +1,30 @@ +module Lithic + module Models + module ThreeDS + type authentication_simulate_otp_entry_params = + { token: String, otp: String } + & Lithic::Internal::Type::request_parameters + + class AuthenticationSimulateOtpEntryParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor token: String + + attr_accessor otp: String + + def initialize: ( + token: String, + otp: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + token: String, + otp: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/three_ds/authentication_simulate_params.rbs b/sig/lithic/models/three_ds/authentication_simulate_params.rbs new file mode 100644 index 00000000..1c99b8ba --- /dev/null +++ b/sig/lithic/models/three_ds/authentication_simulate_params.rbs @@ -0,0 +1,98 @@ +module Lithic + module Models + module ThreeDS + type authentication_simulate_params = + { + merchant: Lithic::ThreeDS::AuthenticationSimulateParams::Merchant, + pan: String, + transaction: Lithic::ThreeDS::AuthenticationSimulateParams::Transaction, + card_expiry_check: Lithic::Models::ThreeDS::AuthenticationSimulateParams::card_expiry_check + } + & Lithic::Internal::Type::request_parameters + + class AuthenticationSimulateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor merchant: Lithic::ThreeDS::AuthenticationSimulateParams::Merchant + + attr_accessor pan: String + + attr_accessor transaction: Lithic::ThreeDS::AuthenticationSimulateParams::Transaction + + attr_reader card_expiry_check: Lithic::Models::ThreeDS::AuthenticationSimulateParams::card_expiry_check? + + def card_expiry_check=: ( + Lithic::Models::ThreeDS::AuthenticationSimulateParams::card_expiry_check + ) -> Lithic::Models::ThreeDS::AuthenticationSimulateParams::card_expiry_check + + def initialize: ( + merchant: Lithic::ThreeDS::AuthenticationSimulateParams::Merchant, + pan: String, + transaction: Lithic::ThreeDS::AuthenticationSimulateParams::Transaction, + ?card_expiry_check: Lithic::Models::ThreeDS::AuthenticationSimulateParams::card_expiry_check, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + merchant: Lithic::ThreeDS::AuthenticationSimulateParams::Merchant, + pan: String, + transaction: Lithic::ThreeDS::AuthenticationSimulateParams::Transaction, + card_expiry_check: Lithic::Models::ThreeDS::AuthenticationSimulateParams::card_expiry_check, + request_options: Lithic::RequestOptions + } + + type merchant = + { id: String, country: String, mcc: String, name: String } + + class Merchant < Lithic::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor country: String + + attr_accessor mcc: String + + attr_accessor name: String + + def initialize: ( + id: String, + country: String, + mcc: String, + name: String + ) -> void + + def to_hash: -> { + id: String, + country: String, + mcc: String, + name: String + } + end + + type transaction = { amount: Integer, currency: String } + + class Transaction < Lithic::Internal::Type::BaseModel + attr_accessor amount: Integer + + attr_accessor currency: String + + def initialize: (amount: Integer, currency: String) -> void + + def to_hash: -> { amount: Integer, currency: String } + end + + type card_expiry_check = :MATCH | :MISMATCH | :NOT_PRESENT + + module CardExpiryCheck + extend Lithic::Internal::Type::Enum + + MATCH: :MATCH + MISMATCH: :MISMATCH + NOT_PRESENT: :NOT_PRESENT + + def self?.values: -> ::Array[Lithic::Models::ThreeDS::AuthenticationSimulateParams::card_expiry_check] + end + end + end + end +end diff --git a/sig/lithic/models/three_ds/authentication_simulate_response.rbs b/sig/lithic/models/three_ds/authentication_simulate_response.rbs new file mode 100644 index 00000000..3fad26f3 --- /dev/null +++ b/sig/lithic/models/three_ds/authentication_simulate_response.rbs @@ -0,0 +1,17 @@ +module Lithic + module Models + module ThreeDS + type authentication_simulate_response = { token: String } + + class AuthenticationSimulateResponse < Lithic::Internal::Type::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + def initialize: (?token: String) -> void + + def to_hash: -> { token: String } + end + end + end +end diff --git a/sig/lithic/models/three_ds/challenge_response.rbs b/sig/lithic/models/three_ds/challenge_response.rbs new file mode 100644 index 00000000..7229cb52 --- /dev/null +++ b/sig/lithic/models/three_ds/challenge_response.rbs @@ -0,0 +1,27 @@ +module Lithic + module Models + module ThreeDS + type challenge_response = + { + token: String, + challenge_response: Lithic::Models::ThreeDS::challenge_result + } + + class ChallengeResponse < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor challenge_response: Lithic::Models::ThreeDS::challenge_result + + def initialize: ( + token: String, + challenge_response: Lithic::Models::ThreeDS::challenge_result + ) -> void + + def to_hash: -> { + token: String, + challenge_response: Lithic::Models::ThreeDS::challenge_result + } + end + end + end +end diff --git a/sig/lithic/models/three_ds/challenge_result.rbs b/sig/lithic/models/three_ds/challenge_result.rbs new file mode 100644 index 00000000..d80e3d8d --- /dev/null +++ b/sig/lithic/models/three_ds/challenge_result.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + module ThreeDS + type challenge_result = :APPROVE | :DECLINE_BY_CUSTOMER + + module ChallengeResult + extend Lithic::Internal::Type::Enum + + APPROVE: :APPROVE + DECLINE_BY_CUSTOMER: :DECLINE_BY_CUSTOMER + + def self?.values: -> ::Array[Lithic::Models::ThreeDS::challenge_result] + end + end + end +end diff --git a/sig/lithic/models/three_ds/decisioning_challenge_response_params.rbs b/sig/lithic/models/three_ds/decisioning_challenge_response_params.rbs new file mode 100644 index 00000000..7192f039 --- /dev/null +++ b/sig/lithic/models/three_ds/decisioning_challenge_response_params.rbs @@ -0,0 +1,17 @@ +module Lithic + module Models + module ThreeDS + type decisioning_challenge_response_params = + { } & Lithic::Internal::Type::request_parameters + + class DecisioningChallengeResponseParams < Lithic::Models::ThreeDS::ChallengeResponse + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> { request_options: Lithic::RequestOptions } + end + end + end +end diff --git a/sig/lithic/models/three_ds/decisioning_retrieve_secret_params.rbs b/sig/lithic/models/three_ds/decisioning_retrieve_secret_params.rbs new file mode 100644 index 00000000..fd7dd76e --- /dev/null +++ b/sig/lithic/models/three_ds/decisioning_retrieve_secret_params.rbs @@ -0,0 +1,17 @@ +module Lithic + module Models + module ThreeDS + type decisioning_retrieve_secret_params = + { } & Lithic::Internal::Type::request_parameters + + class DecisioningRetrieveSecretParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> { request_options: Lithic::RequestOptions } + end + end + end +end diff --git a/sig/lithic/models/three_ds/decisioning_retrieve_secret_response.rbs b/sig/lithic/models/three_ds/decisioning_retrieve_secret_response.rbs new file mode 100644 index 00000000..1123358f --- /dev/null +++ b/sig/lithic/models/three_ds/decisioning_retrieve_secret_response.rbs @@ -0,0 +1,17 @@ +module Lithic + module Models + module ThreeDS + type decisioning_retrieve_secret_response = { secret: String } + + class DecisioningRetrieveSecretResponse < Lithic::Internal::Type::BaseModel + attr_reader secret: String? + + def secret=: (String) -> String + + def initialize: (?secret: String) -> void + + def to_hash: -> { secret: String } + end + end + end +end diff --git a/sig/lithic/models/three_ds/decisioning_rotate_secret_params.rbs b/sig/lithic/models/three_ds/decisioning_rotate_secret_params.rbs new file mode 100644 index 00000000..d5a7fe02 --- /dev/null +++ b/sig/lithic/models/three_ds/decisioning_rotate_secret_params.rbs @@ -0,0 +1,17 @@ +module Lithic + module Models + module ThreeDS + type decisioning_rotate_secret_params = + { } & Lithic::Internal::Type::request_parameters + + class DecisioningRotateSecretParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> { request_options: Lithic::RequestOptions } + end + end + end +end diff --git a/sig/lithic/models/three_ds_authentication.rbs b/sig/lithic/models/three_ds_authentication.rbs new file mode 100644 index 00000000..844c69db --- /dev/null +++ b/sig/lithic/models/three_ds_authentication.rbs @@ -0,0 +1,911 @@ +module Lithic + module Models + type three_ds_authentication = + { + token: String, + account_type: Lithic::Models::ThreeDSAuthentication::account_type?, + authentication_result: Lithic::Models::ThreeDSAuthentication::authentication_result, + card_expiry_check: Lithic::Models::ThreeDSAuthentication::card_expiry_check, + card_token: String, + cardholder: Lithic::ThreeDSAuthentication::Cardholder, + channel: Lithic::Models::ThreeDSAuthentication::channel, + created: Time, + merchant: Lithic::ThreeDSAuthentication::Merchant, + message_category: Lithic::Models::ThreeDSAuthentication::message_category, + three_ds_requestor_challenge_indicator: Lithic::Models::ThreeDSAuthentication::three_ds_requestor_challenge_indicator, + additional_data: Lithic::ThreeDSAuthentication::AdditionalData?, + app: Lithic::ThreeDSAuthentication::App?, + authentication_request_type: Lithic::Models::ThreeDSAuthentication::authentication_request_type?, + browser: Lithic::ThreeDSAuthentication::Browser?, + challenge_metadata: Lithic::ThreeDSAuthentication::ChallengeMetadata?, + challenge_orchestrated_by: Lithic::Models::ThreeDSAuthentication::challenge_orchestrated_by?, + decision_made_by: Lithic::Models::ThreeDSAuthentication::decision_made_by?, + three_ri_request_type: Lithic::Models::ThreeDSAuthentication::three_ri_request_type?, + transaction: Lithic::ThreeDSAuthentication::Transaction? + } + + class ThreeDSAuthentication < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor account_type: Lithic::Models::ThreeDSAuthentication::account_type? + + attr_accessor authentication_result: Lithic::Models::ThreeDSAuthentication::authentication_result + + attr_accessor card_expiry_check: Lithic::Models::ThreeDSAuthentication::card_expiry_check + + attr_accessor card_token: String + + attr_accessor cardholder: Lithic::ThreeDSAuthentication::Cardholder + + attr_accessor channel: Lithic::Models::ThreeDSAuthentication::channel + + attr_accessor created: Time + + attr_accessor merchant: Lithic::ThreeDSAuthentication::Merchant + + attr_accessor message_category: Lithic::Models::ThreeDSAuthentication::message_category + + attr_accessor three_ds_requestor_challenge_indicator: Lithic::Models::ThreeDSAuthentication::three_ds_requestor_challenge_indicator + + attr_accessor additional_data: Lithic::ThreeDSAuthentication::AdditionalData? + + attr_accessor app: Lithic::ThreeDSAuthentication::App? + + attr_accessor authentication_request_type: Lithic::Models::ThreeDSAuthentication::authentication_request_type? + + attr_accessor browser: Lithic::ThreeDSAuthentication::Browser? + + attr_accessor challenge_metadata: Lithic::ThreeDSAuthentication::ChallengeMetadata? + + attr_accessor challenge_orchestrated_by: Lithic::Models::ThreeDSAuthentication::challenge_orchestrated_by? + + attr_accessor decision_made_by: Lithic::Models::ThreeDSAuthentication::decision_made_by? + + attr_accessor three_ri_request_type: Lithic::Models::ThreeDSAuthentication::three_ri_request_type? + + attr_accessor transaction: Lithic::ThreeDSAuthentication::Transaction? + + def initialize: ( + token: String, + account_type: Lithic::Models::ThreeDSAuthentication::account_type?, + authentication_result: Lithic::Models::ThreeDSAuthentication::authentication_result, + card_expiry_check: Lithic::Models::ThreeDSAuthentication::card_expiry_check, + card_token: String, + cardholder: Lithic::ThreeDSAuthentication::Cardholder, + channel: Lithic::Models::ThreeDSAuthentication::channel, + created: Time, + merchant: Lithic::ThreeDSAuthentication::Merchant, + message_category: Lithic::Models::ThreeDSAuthentication::message_category, + three_ds_requestor_challenge_indicator: Lithic::Models::ThreeDSAuthentication::three_ds_requestor_challenge_indicator, + ?additional_data: Lithic::ThreeDSAuthentication::AdditionalData?, + ?app: Lithic::ThreeDSAuthentication::App?, + ?authentication_request_type: Lithic::Models::ThreeDSAuthentication::authentication_request_type?, + ?browser: Lithic::ThreeDSAuthentication::Browser?, + ?challenge_metadata: Lithic::ThreeDSAuthentication::ChallengeMetadata?, + ?challenge_orchestrated_by: Lithic::Models::ThreeDSAuthentication::challenge_orchestrated_by?, + ?decision_made_by: Lithic::Models::ThreeDSAuthentication::decision_made_by?, + ?three_ri_request_type: Lithic::Models::ThreeDSAuthentication::three_ri_request_type?, + ?transaction: Lithic::ThreeDSAuthentication::Transaction? + ) -> void + + def to_hash: -> { + token: String, + account_type: Lithic::Models::ThreeDSAuthentication::account_type?, + authentication_result: Lithic::Models::ThreeDSAuthentication::authentication_result, + card_expiry_check: Lithic::Models::ThreeDSAuthentication::card_expiry_check, + card_token: String, + cardholder: Lithic::ThreeDSAuthentication::Cardholder, + channel: Lithic::Models::ThreeDSAuthentication::channel, + created: Time, + merchant: Lithic::ThreeDSAuthentication::Merchant, + message_category: Lithic::Models::ThreeDSAuthentication::message_category, + three_ds_requestor_challenge_indicator: Lithic::Models::ThreeDSAuthentication::three_ds_requestor_challenge_indicator, + additional_data: Lithic::ThreeDSAuthentication::AdditionalData?, + app: Lithic::ThreeDSAuthentication::App?, + authentication_request_type: Lithic::Models::ThreeDSAuthentication::authentication_request_type?, + browser: Lithic::ThreeDSAuthentication::Browser?, + challenge_metadata: Lithic::ThreeDSAuthentication::ChallengeMetadata?, + challenge_orchestrated_by: Lithic::Models::ThreeDSAuthentication::challenge_orchestrated_by?, + decision_made_by: Lithic::Models::ThreeDSAuthentication::decision_made_by?, + three_ri_request_type: Lithic::Models::ThreeDSAuthentication::three_ri_request_type?, + transaction: Lithic::ThreeDSAuthentication::Transaction? + } + + type account_type = :CREDIT | :DEBIT | :NOT_APPLICABLE + + module AccountType + extend Lithic::Internal::Type::Enum + + CREDIT: :CREDIT + DEBIT: :DEBIT + NOT_APPLICABLE: :NOT_APPLICABLE + + def self?.values: -> ::Array[Lithic::Models::ThreeDSAuthentication::account_type] + end + + type authentication_result = + :DECLINE | :SUCCESS | :PENDING_CHALLENGE | :PENDING_DECISION + + module AuthenticationResult + extend Lithic::Internal::Type::Enum + + DECLINE: :DECLINE + SUCCESS: :SUCCESS + PENDING_CHALLENGE: :PENDING_CHALLENGE + PENDING_DECISION: :PENDING_DECISION + + def self?.values: -> ::Array[Lithic::Models::ThreeDSAuthentication::authentication_result] + end + + type card_expiry_check = :MATCH | :MISMATCH | :NOT_PRESENT + + module CardExpiryCheck + extend Lithic::Internal::Type::Enum + + MATCH: :MATCH + MISMATCH: :MISMATCH + NOT_PRESENT: :NOT_PRESENT + + def self?.values: -> ::Array[Lithic::Models::ThreeDSAuthentication::card_expiry_check] + end + + type cardholder = + { + address_match: bool?, + address_on_file_match: Lithic::Models::ThreeDSAuthentication::Cardholder::address_on_file_match, + billing_address: Lithic::ThreeDSAuthentication::Cardholder::BillingAddress, + email: String?, + name: String?, + phone_number_home: String?, + phone_number_mobile: String?, + phone_number_work: String?, + shipping_address: Lithic::ThreeDSAuthentication::Cardholder::ShippingAddress + } + + class Cardholder < Lithic::Internal::Type::BaseModel + attr_accessor address_match: bool? + + attr_reader address_on_file_match: Lithic::Models::ThreeDSAuthentication::Cardholder::address_on_file_match? + + def address_on_file_match=: ( + Lithic::Models::ThreeDSAuthentication::Cardholder::address_on_file_match + ) -> Lithic::Models::ThreeDSAuthentication::Cardholder::address_on_file_match + + attr_reader billing_address: Lithic::ThreeDSAuthentication::Cardholder::BillingAddress? + + def billing_address=: ( + Lithic::ThreeDSAuthentication::Cardholder::BillingAddress + ) -> Lithic::ThreeDSAuthentication::Cardholder::BillingAddress + + attr_accessor email: String? + + attr_accessor name: String? + + attr_accessor phone_number_home: String? + + attr_accessor phone_number_mobile: String? + + attr_accessor phone_number_work: String? + + attr_reader shipping_address: Lithic::ThreeDSAuthentication::Cardholder::ShippingAddress? + + def shipping_address=: ( + Lithic::ThreeDSAuthentication::Cardholder::ShippingAddress + ) -> Lithic::ThreeDSAuthentication::Cardholder::ShippingAddress + + def initialize: ( + ?address_match: bool?, + ?address_on_file_match: Lithic::Models::ThreeDSAuthentication::Cardholder::address_on_file_match, + ?billing_address: Lithic::ThreeDSAuthentication::Cardholder::BillingAddress, + ?email: String?, + ?name: String?, + ?phone_number_home: String?, + ?phone_number_mobile: String?, + ?phone_number_work: String?, + ?shipping_address: Lithic::ThreeDSAuthentication::Cardholder::ShippingAddress + ) -> void + + def to_hash: -> { + address_match: bool?, + address_on_file_match: Lithic::Models::ThreeDSAuthentication::Cardholder::address_on_file_match, + billing_address: Lithic::ThreeDSAuthentication::Cardholder::BillingAddress, + email: String?, + name: String?, + phone_number_home: String?, + phone_number_mobile: String?, + phone_number_work: String?, + shipping_address: Lithic::ThreeDSAuthentication::Cardholder::ShippingAddress + } + + type address_on_file_match = + :MATCH + | :MATCH_ADDRESS_ONLY + | :MATCH_ZIP_ONLY + | :MISMATCH + | :NOT_PRESENT + + module AddressOnFileMatch + extend Lithic::Internal::Type::Enum + + MATCH: :MATCH + MATCH_ADDRESS_ONLY: :MATCH_ADDRESS_ONLY + MATCH_ZIP_ONLY: :MATCH_ZIP_ONLY + MISMATCH: :MISMATCH + NOT_PRESENT: :NOT_PRESENT + + def self?.values: -> ::Array[Lithic::Models::ThreeDSAuthentication::Cardholder::address_on_file_match] + end + + type billing_address = + { + :address1 => String?, + :address2 => String?, + :address3 => String?, + city: String?, + country: String?, + postal_code: String? + } + + class BillingAddress < Lithic::Internal::Type::BaseModel + attr_accessor address1: String? + + attr_accessor address2: String? + + attr_accessor address3: String? + + attr_accessor city: String? + + attr_accessor country: String? + + attr_accessor postal_code: String? + + def initialize: ( + ?address1: String?, + ?address2: String?, + ?address3: String?, + ?city: String?, + ?country: String?, + ?postal_code: String? + ) -> void + + def to_hash: -> { + :address1 => String?, + :address2 => String?, + :address3 => String?, + city: String?, + country: String?, + postal_code: String? + } + end + + type shipping_address = + { + :address1 => String?, + :address2 => String?, + :address3 => String?, + city: String?, + country: String?, + postal_code: String? + } + + class ShippingAddress < Lithic::Internal::Type::BaseModel + attr_accessor address1: String? + + attr_accessor address2: String? + + attr_accessor address3: String? + + attr_accessor city: String? + + attr_accessor country: String? + + attr_accessor postal_code: String? + + def initialize: ( + ?address1: String?, + ?address2: String?, + ?address3: String?, + ?city: String?, + ?country: String?, + ?postal_code: String? + ) -> void + + def to_hash: -> { + :address1 => String?, + :address2 => String?, + :address3 => String?, + city: String?, + country: String?, + postal_code: String? + } + end + end + + type channel = :APP_BASED | :BROWSER | :THREE_DS_REQUESTOR_INITIATED + + module Channel + extend Lithic::Internal::Type::Enum + + APP_BASED: :APP_BASED + BROWSER: :BROWSER + THREE_DS_REQUESTOR_INITIATED: :THREE_DS_REQUESTOR_INITIATED + + def self?.values: -> ::Array[Lithic::Models::ThreeDSAuthentication::channel] + end + + type merchant = + { + risk_indicator: Lithic::ThreeDSAuthentication::Merchant::RiskIndicator, + id: String?, + country: String?, + mcc: String?, + name: String? + } + + class Merchant < Lithic::Internal::Type::BaseModel + attr_accessor risk_indicator: Lithic::ThreeDSAuthentication::Merchant::RiskIndicator + + attr_accessor id: String? + + attr_accessor country: String? + + attr_accessor mcc: String? + + attr_accessor name: String? + + def initialize: ( + risk_indicator: Lithic::ThreeDSAuthentication::Merchant::RiskIndicator, + ?id: String?, + ?country: String?, + ?mcc: String?, + ?name: String? + ) -> void + + def to_hash: -> { + risk_indicator: Lithic::ThreeDSAuthentication::Merchant::RiskIndicator, + id: String?, + country: String?, + mcc: String?, + name: String? + } + + type risk_indicator = + { + delivery_email_address: String?, + delivery_time_frame: Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator::delivery_time_frame?, + gift_card_amount: Integer?, + gift_card_count: Integer?, + gift_card_currency: String?, + order_availability: Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator::order_availability?, + pre_order_available_date: Time?, + reorder_items: Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator::reorder_items?, + shipping_method: Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator::shipping_method? + } + + class RiskIndicator < Lithic::Internal::Type::BaseModel + attr_accessor delivery_email_address: String? + + attr_accessor delivery_time_frame: Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator::delivery_time_frame? + + attr_accessor gift_card_amount: Integer? + + attr_accessor gift_card_count: Integer? + + attr_accessor gift_card_currency: String? + + attr_accessor order_availability: Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator::order_availability? + + attr_accessor pre_order_available_date: Time? + + attr_accessor reorder_items: Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator::reorder_items? + + attr_accessor shipping_method: Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator::shipping_method? + + def initialize: ( + ?delivery_email_address: String?, + ?delivery_time_frame: Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator::delivery_time_frame?, + ?gift_card_amount: Integer?, + ?gift_card_count: Integer?, + ?gift_card_currency: String?, + ?order_availability: Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator::order_availability?, + ?pre_order_available_date: Time?, + ?reorder_items: Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator::reorder_items?, + ?shipping_method: Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator::shipping_method? + ) -> void + + def to_hash: -> { + delivery_email_address: String?, + delivery_time_frame: Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator::delivery_time_frame?, + gift_card_amount: Integer?, + gift_card_count: Integer?, + gift_card_currency: String?, + order_availability: Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator::order_availability?, + pre_order_available_date: Time?, + reorder_items: Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator::reorder_items?, + shipping_method: Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator::shipping_method? + } + + type delivery_time_frame = + :ELECTRONIC_DELIVERY + | :OVERNIGHT_SHIPPING + | :SAME_DAY_SHIPPING + | :TWO_DAY_OR_MORE_SHIPPING + + module DeliveryTimeFrame + extend Lithic::Internal::Type::Enum + + ELECTRONIC_DELIVERY: :ELECTRONIC_DELIVERY + OVERNIGHT_SHIPPING: :OVERNIGHT_SHIPPING + SAME_DAY_SHIPPING: :SAME_DAY_SHIPPING + TWO_DAY_OR_MORE_SHIPPING: :TWO_DAY_OR_MORE_SHIPPING + + def self?.values: -> ::Array[Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator::delivery_time_frame] + end + + type order_availability = + :FUTURE_AVAILABILITY | :MERCHANDISE_AVAILABLE + + module OrderAvailability + extend Lithic::Internal::Type::Enum + + FUTURE_AVAILABILITY: :FUTURE_AVAILABILITY + MERCHANDISE_AVAILABLE: :MERCHANDISE_AVAILABLE + + def self?.values: -> ::Array[Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator::order_availability] + end + + type reorder_items = :FIRST_TIME_ORDERED | :REORDERED + + module ReorderItems + extend Lithic::Internal::Type::Enum + + FIRST_TIME_ORDERED: :FIRST_TIME_ORDERED + REORDERED: :REORDERED + + def self?.values: -> ::Array[Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator::reorder_items] + end + + type shipping_method = + :DIGITAL_GOODS + | :LOCKER_DELIVERY + | :OTHER + | :PICK_UP_AND_GO_DELIVERY + | :SHIP_TO_BILLING_ADDRESS + | :SHIP_TO_NON_BILLING_ADDRESS + | :SHIP_TO_OTHER_VERIFIED_ADDRESS + | :SHIP_TO_STORE + | :TRAVEL_AND_EVENT_TICKETS + + module ShippingMethod + extend Lithic::Internal::Type::Enum + + DIGITAL_GOODS: :DIGITAL_GOODS + LOCKER_DELIVERY: :LOCKER_DELIVERY + OTHER: :OTHER + PICK_UP_AND_GO_DELIVERY: :PICK_UP_AND_GO_DELIVERY + SHIP_TO_BILLING_ADDRESS: :SHIP_TO_BILLING_ADDRESS + SHIP_TO_NON_BILLING_ADDRESS: :SHIP_TO_NON_BILLING_ADDRESS + SHIP_TO_OTHER_VERIFIED_ADDRESS: :SHIP_TO_OTHER_VERIFIED_ADDRESS + SHIP_TO_STORE: :SHIP_TO_STORE + TRAVEL_AND_EVENT_TICKETS: :TRAVEL_AND_EVENT_TICKETS + + def self?.values: -> ::Array[Lithic::Models::ThreeDSAuthentication::Merchant::RiskIndicator::shipping_method] + end + end + end + + type message_category = + :NON_PAYMENT_AUTHENTICATION | :PAYMENT_AUTHENTICATION + + module MessageCategory + extend Lithic::Internal::Type::Enum + + NON_PAYMENT_AUTHENTICATION: :NON_PAYMENT_AUTHENTICATION + PAYMENT_AUTHENTICATION: :PAYMENT_AUTHENTICATION + + def self?.values: -> ::Array[Lithic::Models::ThreeDSAuthentication::message_category] + end + + type three_ds_requestor_challenge_indicator = + :NO_PREFERENCE + | :NO_CHALLENGE_REQUESTED + | :CHALLENGE_PREFERENCE + | :CHALLENGE_MANDATE + | :NO_CHALLENGE_RISK_ALREADY_ASSESSED + | :DATA_SHARE_ONLY + | :OTHER + + module ThreeDSRequestorChallengeIndicator + extend Lithic::Internal::Type::Enum + + NO_PREFERENCE: :NO_PREFERENCE + NO_CHALLENGE_REQUESTED: :NO_CHALLENGE_REQUESTED + CHALLENGE_PREFERENCE: :CHALLENGE_PREFERENCE + CHALLENGE_MANDATE: :CHALLENGE_MANDATE + NO_CHALLENGE_RISK_ALREADY_ASSESSED: :NO_CHALLENGE_RISK_ALREADY_ASSESSED + DATA_SHARE_ONLY: :DATA_SHARE_ONLY + OTHER: :OTHER + + def self?.values: -> ::Array[Lithic::Models::ThreeDSAuthentication::three_ds_requestor_challenge_indicator] + end + + type additional_data = + { + network_decision: Lithic::Models::ThreeDSAuthentication::AdditionalData::network_decision?, + network_risk_score: Integer? + } + + class AdditionalData < Lithic::Internal::Type::BaseModel + attr_accessor network_decision: Lithic::Models::ThreeDSAuthentication::AdditionalData::network_decision? + + attr_accessor network_risk_score: Integer? + + def initialize: ( + ?network_decision: Lithic::Models::ThreeDSAuthentication::AdditionalData::network_decision?, + ?network_risk_score: Integer? + ) -> void + + def to_hash: -> { + network_decision: Lithic::Models::ThreeDSAuthentication::AdditionalData::network_decision?, + network_risk_score: Integer? + } + + type network_decision = :LOW_RISK | :NOT_LOW_RISK + + module NetworkDecision + extend Lithic::Internal::Type::Enum + + LOW_RISK: :LOW_RISK + NOT_LOW_RISK: :NOT_LOW_RISK + + def self?.values: -> ::Array[Lithic::Models::ThreeDSAuthentication::AdditionalData::network_decision] + end + end + + type app = + { + device: String?, + device_info: String?, + ip: String, + latitude: Float?, + locale: String?, + longitude: Float?, + os: String?, + platform: String?, + screen_height: Integer?, + screen_width: Integer?, + time_zone: String? + } + + class App < Lithic::Internal::Type::BaseModel + attr_accessor device: String? + + attr_accessor device_info: String? + + attr_reader ip: String? + + def ip=: (String) -> String + + attr_accessor latitude: Float? + + attr_accessor locale: String? + + attr_accessor longitude: Float? + + attr_accessor os: String? + + attr_accessor platform: String? + + attr_accessor screen_height: Integer? + + attr_accessor screen_width: Integer? + + attr_accessor time_zone: String? + + def initialize: ( + ?device: String?, + ?device_info: String?, + ?ip: String, + ?latitude: Float?, + ?locale: String?, + ?longitude: Float?, + ?os: String?, + ?platform: String?, + ?screen_height: Integer?, + ?screen_width: Integer?, + ?time_zone: String? + ) -> void + + def to_hash: -> { + device: String?, + device_info: String?, + ip: String, + latitude: Float?, + locale: String?, + longitude: Float?, + os: String?, + platform: String?, + screen_height: Integer?, + screen_width: Integer?, + time_zone: String? + } + end + + type authentication_request_type = + :ADD_CARD + | :BILLING_AGREEMENT + | :DELAYED_SHIPMENT + | :EMV_TOKEN_CARDHOLDER_VERIFICATION + | :INSTALLMENT_TRANSACTION + | :MAINTAIN_CARD + | :PAYMENT_TRANSACTION + | :RECURRING_TRANSACTION + | :SPLIT_PAYMENT + | :SPLIT_SHIPMENT + + module AuthenticationRequestType + extend Lithic::Internal::Type::Enum + + ADD_CARD: :ADD_CARD + BILLING_AGREEMENT: :BILLING_AGREEMENT + DELAYED_SHIPMENT: :DELAYED_SHIPMENT + EMV_TOKEN_CARDHOLDER_VERIFICATION: :EMV_TOKEN_CARDHOLDER_VERIFICATION + INSTALLMENT_TRANSACTION: :INSTALLMENT_TRANSACTION + MAINTAIN_CARD: :MAINTAIN_CARD + PAYMENT_TRANSACTION: :PAYMENT_TRANSACTION + RECURRING_TRANSACTION: :RECURRING_TRANSACTION + SPLIT_PAYMENT: :SPLIT_PAYMENT + SPLIT_SHIPMENT: :SPLIT_SHIPMENT + + def self?.values: -> ::Array[Lithic::Models::ThreeDSAuthentication::authentication_request_type] + end + + type browser = + { + accept_header: String?, + ip: String?, + java_enabled: bool?, + javascript_enabled: bool?, + language: String?, + time_zone: String?, + user_agent: String? + } + + class Browser < Lithic::Internal::Type::BaseModel + attr_accessor accept_header: String? + + attr_accessor ip: String? + + attr_accessor java_enabled: bool? + + attr_accessor javascript_enabled: bool? + + attr_accessor language: String? + + attr_accessor time_zone: String? + + attr_accessor user_agent: String? + + def initialize: ( + ?accept_header: String?, + ?ip: String?, + ?java_enabled: bool?, + ?javascript_enabled: bool?, + ?language: String?, + ?time_zone: String?, + ?user_agent: String? + ) -> void + + def to_hash: -> { + accept_header: String?, + ip: String?, + java_enabled: bool?, + javascript_enabled: bool?, + language: String?, + time_zone: String?, + user_agent: String? + } + end + + type challenge_metadata = + { + method_type: Lithic::Models::ThreeDSAuthentication::ChallengeMetadata::method_type, + status: Lithic::Models::ThreeDSAuthentication::ChallengeMetadata::status, + phone_number: String? + } + + class ChallengeMetadata < Lithic::Internal::Type::BaseModel + attr_accessor method_type: Lithic::Models::ThreeDSAuthentication::ChallengeMetadata::method_type + + attr_accessor status: Lithic::Models::ThreeDSAuthentication::ChallengeMetadata::status + + attr_accessor phone_number: String? + + def initialize: ( + method_type: Lithic::Models::ThreeDSAuthentication::ChallengeMetadata::method_type, + status: Lithic::Models::ThreeDSAuthentication::ChallengeMetadata::status, + ?phone_number: String? + ) -> void + + def to_hash: -> { + method_type: Lithic::Models::ThreeDSAuthentication::ChallengeMetadata::method_type, + status: Lithic::Models::ThreeDSAuthentication::ChallengeMetadata::status, + phone_number: String? + } + + type method_type = :SMS_OTP | :OUT_OF_BAND + + module MethodType + extend Lithic::Internal::Type::Enum + + SMS_OTP: :SMS_OTP + OUT_OF_BAND: :OUT_OF_BAND + + def self?.values: -> ::Array[Lithic::Models::ThreeDSAuthentication::ChallengeMetadata::method_type] + end + + type status = + :SUCCESS + | :PENDING + | :SMS_DELIVERY_FAILED + | :CARDHOLDER_TIMEOUT + | :CANCELED_VIA_CHALLENGE_UI + | :CANCELED_OOB + | :ATTEMPTS_EXCEEDED + | :ABORTED + | :ERROR + + module Status + extend Lithic::Internal::Type::Enum + + SUCCESS: :SUCCESS + PENDING: :PENDING + SMS_DELIVERY_FAILED: :SMS_DELIVERY_FAILED + CARDHOLDER_TIMEOUT: :CARDHOLDER_TIMEOUT + CANCELED_VIA_CHALLENGE_UI: :CANCELED_VIA_CHALLENGE_UI + CANCELED_OOB: :CANCELED_OOB + ATTEMPTS_EXCEEDED: :ATTEMPTS_EXCEEDED + ABORTED: :ABORTED + ERROR: :ERROR + + def self?.values: -> ::Array[Lithic::Models::ThreeDSAuthentication::ChallengeMetadata::status] + end + end + + type challenge_orchestrated_by = :LITHIC | :CUSTOMER | :NO_CHALLENGE + + module ChallengeOrchestratedBy + extend Lithic::Internal::Type::Enum + + LITHIC: :LITHIC + CUSTOMER: :CUSTOMER + NO_CHALLENGE: :NO_CHALLENGE + + def self?.values: -> ::Array[Lithic::Models::ThreeDSAuthentication::challenge_orchestrated_by] + end + + type decision_made_by = + :LITHIC_RULES + | :LITHIC_DEFAULT + | :CUSTOMER_RULES + | :CUSTOMER_ENDPOINT + | :NETWORK + | :UNKNOWN + + module DecisionMadeBy + extend Lithic::Internal::Type::Enum + + LITHIC_RULES: :LITHIC_RULES + LITHIC_DEFAULT: :LITHIC_DEFAULT + CUSTOMER_RULES: :CUSTOMER_RULES + CUSTOMER_ENDPOINT: :CUSTOMER_ENDPOINT + NETWORK: :NETWORK + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::ThreeDSAuthentication::decision_made_by] + end + + type three_ri_request_type = + :ACCOUNT_VERIFICATION + | :ADD_CARD + | :BILLING_AGREEMENT + | :CARD_SECURITY_CODE_STATUS_CHECK + | :DELAYED_SHIPMENT + | :DEVICE_BINDING_STATUS_CHECK + | :INSTALLMENT_TRANSACTION + | :MAIL_ORDER + | :MAINTAIN_CARD_INFO + | :OTHER_PAYMENT + | :RECURRING_TRANSACTION + | :SPLIT_PAYMENT + | :SPLIT_SHIPMENT + | :TELEPHONE_ORDER + | :TOP_UP + | :TRUST_LIST_STATUS_CHECK + + module ThreeRiRequestType + extend Lithic::Internal::Type::Enum + + ACCOUNT_VERIFICATION: :ACCOUNT_VERIFICATION + ADD_CARD: :ADD_CARD + BILLING_AGREEMENT: :BILLING_AGREEMENT + CARD_SECURITY_CODE_STATUS_CHECK: :CARD_SECURITY_CODE_STATUS_CHECK + DELAYED_SHIPMENT: :DELAYED_SHIPMENT + DEVICE_BINDING_STATUS_CHECK: :DEVICE_BINDING_STATUS_CHECK + INSTALLMENT_TRANSACTION: :INSTALLMENT_TRANSACTION + MAIL_ORDER: :MAIL_ORDER + MAINTAIN_CARD_INFO: :MAINTAIN_CARD_INFO + OTHER_PAYMENT: :OTHER_PAYMENT + RECURRING_TRANSACTION: :RECURRING_TRANSACTION + SPLIT_PAYMENT: :SPLIT_PAYMENT + SPLIT_SHIPMENT: :SPLIT_SHIPMENT + TELEPHONE_ORDER: :TELEPHONE_ORDER + TOP_UP: :TOP_UP + TRUST_LIST_STATUS_CHECK: :TRUST_LIST_STATUS_CHECK + + def self?.values: -> ::Array[Lithic::Models::ThreeDSAuthentication::three_ri_request_type] + end + + type transaction = + { + amount: Float, + cardholder_amount: Float?, + currency: String, + currency_exponent: Float, + date_time: Time, + type: Lithic::Models::ThreeDSAuthentication::Transaction::type_? + } + + class Transaction < Lithic::Internal::Type::BaseModel + attr_accessor amount: Float + + attr_accessor cardholder_amount: Float? + + attr_accessor currency: String + + attr_accessor currency_exponent: Float + + attr_accessor date_time: Time + + attr_accessor type: Lithic::Models::ThreeDSAuthentication::Transaction::type_? + + def initialize: ( + amount: Float, + cardholder_amount: Float?, + currency: String, + currency_exponent: Float, + date_time: Time, + type: Lithic::Models::ThreeDSAuthentication::Transaction::type_? + ) -> void + + def to_hash: -> { + amount: Float, + cardholder_amount: Float?, + currency: String, + currency_exponent: Float, + date_time: Time, + type: Lithic::Models::ThreeDSAuthentication::Transaction::type_? + } + + type type_ = + :ACCOUNT_FUNDING + | :CHECK_ACCEPTANCE + | :GOODS_SERVICE_PURCHASE + | :PREPAID_ACTIVATION_AND_LOAD + | :QUASI_CASH_TRANSACTION + + module Type + extend Lithic::Internal::Type::Enum + + ACCOUNT_FUNDING: :ACCOUNT_FUNDING + CHECK_ACCEPTANCE: :CHECK_ACCEPTANCE + GOODS_SERVICE_PURCHASE: :GOODS_SERVICE_PURCHASE + PREPAID_ACTIVATION_AND_LOAD: :PREPAID_ACTIVATION_AND_LOAD + QUASI_CASH_TRANSACTION: :QUASI_CASH_TRANSACTION + + def self?.values: -> ::Array[Lithic::Models::ThreeDSAuthentication::Transaction::type_] + end + end + end + end +end diff --git a/sig/lithic/models/three_ds_authentication_approval_request_webhook_event.rbs b/sig/lithic/models/three_ds_authentication_approval_request_webhook_event.rbs new file mode 100644 index 00000000..9abec01b --- /dev/null +++ b/sig/lithic/models/three_ds_authentication_approval_request_webhook_event.rbs @@ -0,0 +1,22 @@ +module Lithic + module Models + type three_ds_authentication_approval_request_webhook_event = + { event_type: :"three_ds_authentication.approval_request" } + + class ThreeDSAuthenticationApprovalRequestWebhookEvent < Lithic::Models::ThreeDSAuthentication + def event_type: -> :"three_ds_authentication.approval_request" + + def event_type=: ( + :"three_ds_authentication.approval_request" _ + ) -> :"three_ds_authentication.approval_request" + + def initialize: ( + ?event_type: :"three_ds_authentication.approval_request" + ) -> void + + def to_hash: -> { + event_type: :"three_ds_authentication.approval_request" + } + end + end +end diff --git a/sig/lithic/models/three_ds_authentication_challenge_webhook_event.rbs b/sig/lithic/models/three_ds_authentication_challenge_webhook_event.rbs new file mode 100644 index 00000000..7b686c7c --- /dev/null +++ b/sig/lithic/models/three_ds_authentication_challenge_webhook_event.rbs @@ -0,0 +1,72 @@ +module Lithic + module Models + type three_ds_authentication_challenge_webhook_event = + { + authentication_object: Lithic::ThreeDSAuthentication, + challenge: Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge, + event_type: :"three_ds_authentication.challenge" + } + + class ThreeDSAuthenticationChallengeWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor authentication_object: Lithic::ThreeDSAuthentication + + attr_accessor challenge: Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge + + attr_accessor event_type: :"three_ds_authentication.challenge" + + def initialize: ( + authentication_object: Lithic::ThreeDSAuthentication, + challenge: Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge, + ?event_type: :"three_ds_authentication.challenge" + ) -> void + + def to_hash: -> { + authentication_object: Lithic::ThreeDSAuthentication, + challenge: Lithic::ThreeDSAuthenticationChallengeWebhookEvent::Challenge, + event_type: :"three_ds_authentication.challenge" + } + + type challenge = + { + challenge_method_type: Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::challenge_method_type, + expiry_time: Time, + start_time: Time, + app_requestor_url: String? + } + + class Challenge < Lithic::Internal::Type::BaseModel + attr_accessor challenge_method_type: Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::challenge_method_type + + attr_accessor expiry_time: Time + + attr_accessor start_time: Time + + attr_accessor app_requestor_url: String? + + def initialize: ( + challenge_method_type: Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::challenge_method_type, + expiry_time: Time, + start_time: Time, + ?app_requestor_url: String? + ) -> void + + def to_hash: -> { + challenge_method_type: Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::challenge_method_type, + expiry_time: Time, + start_time: Time, + app_requestor_url: String? + } + + type challenge_method_type = :OUT_OF_BAND + + module ChallengeMethodType + extend Lithic::Internal::Type::Enum + + OUT_OF_BAND: :OUT_OF_BAND + + def self?.values: -> ::Array[Lithic::Models::ThreeDSAuthenticationChallengeWebhookEvent::Challenge::challenge_method_type] + end + end + end + end +end diff --git a/sig/lithic/models/three_ds_authentication_created_webhook_event.rbs b/sig/lithic/models/three_ds_authentication_created_webhook_event.rbs new file mode 100644 index 00000000..29da370f --- /dev/null +++ b/sig/lithic/models/three_ds_authentication_created_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type three_ds_authentication_created_webhook_event = + { event_type: :"three_ds_authentication.created" } + + class ThreeDSAuthenticationCreatedWebhookEvent < Lithic::Models::ThreeDSAuthentication + def event_type: -> :"three_ds_authentication.created" + + def event_type=: ( + :"three_ds_authentication.created" _ + ) -> :"three_ds_authentication.created" + + def initialize: (?event_type: :"three_ds_authentication.created") -> void + + def to_hash: -> { event_type: :"three_ds_authentication.created" } + end + end +end diff --git a/sig/lithic/models/three_ds_authentication_updated_webhook_event.rbs b/sig/lithic/models/three_ds_authentication_updated_webhook_event.rbs new file mode 100644 index 00000000..cece2538 --- /dev/null +++ b/sig/lithic/models/three_ds_authentication_updated_webhook_event.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type three_ds_authentication_updated_webhook_event = + { event_type: :"three_ds_authentication.updated" } + + class ThreeDSAuthenticationUpdatedWebhookEvent < Lithic::Models::ThreeDSAuthentication + def event_type: -> :"three_ds_authentication.updated" + + def event_type=: ( + :"three_ds_authentication.updated" _ + ) -> :"three_ds_authentication.updated" + + def initialize: (?event_type: :"three_ds_authentication.updated") -> void + + def to_hash: -> { event_type: :"three_ds_authentication.updated" } + end + end +end diff --git a/sig/lithic/models/token_info.rbs b/sig/lithic/models/token_info.rbs new file mode 100644 index 00000000..fe1e8b66 --- /dev/null +++ b/sig/lithic/models/token_info.rbs @@ -0,0 +1,36 @@ +module Lithic + module Models + type token_info = { wallet_type: Lithic::Models::TokenInfo::wallet_type } + + class TokenInfo < Lithic::Internal::Type::BaseModel + attr_accessor wallet_type: Lithic::Models::TokenInfo::wallet_type + + def initialize: ( + wallet_type: Lithic::Models::TokenInfo::wallet_type + ) -> void + + def to_hash: -> { wallet_type: Lithic::Models::TokenInfo::wallet_type } + + type wallet_type = + :APPLE_PAY + | :GOOGLE_PAY + | :MASTERPASS + | :MERCHANT + | :OTHER + | :SAMSUNG_PAY + + module WalletType + extend Lithic::Internal::Type::Enum + + APPLE_PAY: :APPLE_PAY + GOOGLE_PAY: :GOOGLE_PAY + MASTERPASS: :MASTERPASS + MERCHANT: :MERCHANT + OTHER: :OTHER + SAMSUNG_PAY: :SAMSUNG_PAY + + def self?.values: -> ::Array[Lithic::Models::TokenInfo::wallet_type] + end + end + end +end diff --git a/sig/lithic/models/token_metadata.rbs b/sig/lithic/models/token_metadata.rbs new file mode 100644 index 00000000..e56e5111 --- /dev/null +++ b/sig/lithic/models/token_metadata.rbs @@ -0,0 +1,121 @@ +module Lithic + module Models + type token_metadata = + { + payment_account_info: Lithic::TokenMetadata::PaymentAccountInfo, + status: String, + payment_app_instance_id: String?, + token_requestor_id: String, + token_requestor_name: Lithic::Models::TokenMetadata::token_requestor_name + } + + class TokenMetadata < Lithic::Internal::Type::BaseModel + attr_accessor payment_account_info: Lithic::TokenMetadata::PaymentAccountInfo + + attr_accessor status: String + + attr_accessor payment_app_instance_id: String? + + attr_reader token_requestor_id: String? + + def token_requestor_id=: (String) -> String + + attr_reader token_requestor_name: Lithic::Models::TokenMetadata::token_requestor_name? + + def token_requestor_name=: ( + Lithic::Models::TokenMetadata::token_requestor_name + ) -> Lithic::Models::TokenMetadata::token_requestor_name + + def initialize: ( + payment_account_info: Lithic::TokenMetadata::PaymentAccountInfo, + status: String, + ?payment_app_instance_id: String?, + ?token_requestor_id: String, + ?token_requestor_name: Lithic::Models::TokenMetadata::token_requestor_name + ) -> void + + def to_hash: -> { + payment_account_info: Lithic::TokenMetadata::PaymentAccountInfo, + status: String, + payment_app_instance_id: String?, + token_requestor_id: String, + token_requestor_name: Lithic::Models::TokenMetadata::token_requestor_name + } + + type payment_account_info = + { + account_holder_data: Lithic::TokenMetadata::PaymentAccountInfo::AccountHolderData, + pan_unique_reference: String?, + payment_account_reference: String?, + token_unique_reference: String? + } + + class PaymentAccountInfo < Lithic::Internal::Type::BaseModel + attr_accessor account_holder_data: Lithic::TokenMetadata::PaymentAccountInfo::AccountHolderData + + attr_accessor pan_unique_reference: String? + + attr_accessor payment_account_reference: String? + + attr_accessor token_unique_reference: String? + + def initialize: ( + account_holder_data: Lithic::TokenMetadata::PaymentAccountInfo::AccountHolderData, + ?pan_unique_reference: String?, + ?payment_account_reference: String?, + ?token_unique_reference: String? + ) -> void + + def to_hash: -> { + account_holder_data: Lithic::TokenMetadata::PaymentAccountInfo::AccountHolderData, + pan_unique_reference: String?, + payment_account_reference: String?, + token_unique_reference: String? + } + + type account_holder_data = { phone_number: String? } + + class AccountHolderData < Lithic::Internal::Type::BaseModel + attr_accessor phone_number: String? + + def initialize: (?phone_number: String?) -> void + + def to_hash: -> { phone_number: String? } + end + end + + type token_requestor_name = + :AMAZON_ONE + | :ANDROID_PAY + | :APPLE_PAY + | :FACEBOOK + | :FITBIT_PAY + | :GARMIN_PAY + | :GOOGLE_PAY + | :MICROSOFT_PAY + | :NETFLIX + | :SAMSUNG_PAY + | :UNKNOWN + | :VISA_CHECKOUT + + module TokenRequestorName + extend Lithic::Internal::Type::Enum + + AMAZON_ONE: :AMAZON_ONE + ANDROID_PAY: :ANDROID_PAY + APPLE_PAY: :APPLE_PAY + FACEBOOK: :FACEBOOK + FITBIT_PAY: :FITBIT_PAY + GARMIN_PAY: :GARMIN_PAY + GOOGLE_PAY: :GOOGLE_PAY + MICROSOFT_PAY: :MICROSOFT_PAY + NETFLIX: :NETFLIX + SAMSUNG_PAY: :SAMSUNG_PAY + UNKNOWN: :UNKNOWN + VISA_CHECKOUT: :VISA_CHECKOUT + + def self?.values: -> ::Array[Lithic::Models::TokenMetadata::token_requestor_name] + end + end + end +end diff --git a/sig/lithic/models/tokenization.rbs b/sig/lithic/models/tokenization.rbs new file mode 100644 index 00000000..75bdc3b7 --- /dev/null +++ b/sig/lithic/models/tokenization.rbs @@ -0,0 +1,280 @@ +module Lithic + module Models + type tokenization = + { + token: String, + account_token: String, + card_token: String, + created_at: Time, + dpan: String?, + status: Lithic::Models::Tokenization::status, + token_requestor_name: Lithic::Models::Tokenization::token_requestor_name, + token_unique_reference: String, + tokenization_channel: Lithic::Models::Tokenization::tokenization_channel, + updated_at: Time, + device_id: String?, + digital_card_art_token: String?, + events: ::Array[Lithic::Tokenization::Event], + payment_account_reference_id: String? + } + + class Tokenization < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor account_token: String + + attr_accessor card_token: String + + attr_accessor created_at: Time + + attr_accessor dpan: String? + + attr_accessor status: Lithic::Models::Tokenization::status + + attr_accessor token_requestor_name: Lithic::Models::Tokenization::token_requestor_name + + attr_accessor token_unique_reference: String + + attr_accessor tokenization_channel: Lithic::Models::Tokenization::tokenization_channel + + attr_accessor updated_at: Time + + attr_accessor device_id: String? + + attr_accessor digital_card_art_token: String? + + attr_reader events: ::Array[Lithic::Tokenization::Event]? + + def events=: ( + ::Array[Lithic::Tokenization::Event] + ) -> ::Array[Lithic::Tokenization::Event] + + attr_accessor payment_account_reference_id: String? + + def initialize: ( + token: String, + account_token: String, + card_token: String, + created_at: Time, + dpan: String?, + status: Lithic::Models::Tokenization::status, + token_requestor_name: Lithic::Models::Tokenization::token_requestor_name, + token_unique_reference: String, + tokenization_channel: Lithic::Models::Tokenization::tokenization_channel, + updated_at: Time, + ?device_id: String?, + ?digital_card_art_token: String?, + ?events: ::Array[Lithic::Tokenization::Event], + ?payment_account_reference_id: String? + ) -> void + + def to_hash: -> { + token: String, + account_token: String, + card_token: String, + created_at: Time, + dpan: String?, + status: Lithic::Models::Tokenization::status, + token_requestor_name: Lithic::Models::Tokenization::token_requestor_name, + token_unique_reference: String, + tokenization_channel: Lithic::Models::Tokenization::tokenization_channel, + updated_at: Time, + device_id: String?, + digital_card_art_token: String?, + events: ::Array[Lithic::Tokenization::Event], + payment_account_reference_id: String? + } + + type status = + :ACTIVE + | :DEACTIVATED + | :INACTIVE + | :PAUSED + | :PENDING_2FA + | :PENDING_ACTIVATION + | :UNKNOWN + + module Status + extend Lithic::Internal::Type::Enum + + ACTIVE: :ACTIVE + DEACTIVATED: :DEACTIVATED + INACTIVE: :INACTIVE + PAUSED: :PAUSED + PENDING_2_FA: :PENDING_2FA + PENDING_ACTIVATION: :PENDING_ACTIVATION + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::Tokenization::status] + end + + type token_requestor_name = + :AMAZON_ONE + | :ANDROID_PAY + | :APPLE_PAY + | :FACEBOOK + | :FITBIT_PAY + | :GARMIN_PAY + | :GOOGLE_PAY + | :MICROSOFT_PAY + | :NETFLIX + | :SAMSUNG_PAY + | :UNKNOWN + | :VISA_CHECKOUT + | String + + module TokenRequestorName + extend Lithic::Internal::Type::Union + + def self?.variants: -> ::Array[Lithic::Models::Tokenization::token_requestor_name] + + AMAZON_ONE: :AMAZON_ONE + ANDROID_PAY: :ANDROID_PAY + APPLE_PAY: :APPLE_PAY + FACEBOOK: :FACEBOOK + FITBIT_PAY: :FITBIT_PAY + GARMIN_PAY: :GARMIN_PAY + GOOGLE_PAY: :GOOGLE_PAY + MICROSOFT_PAY: :MICROSOFT_PAY + NETFLIX: :NETFLIX + SAMSUNG_PAY: :SAMSUNG_PAY + UNKNOWN: :UNKNOWN + VISA_CHECKOUT: :VISA_CHECKOUT + end + + type tokenization_channel = :DIGITAL_WALLET | :MERCHANT + + module TokenizationChannel + extend Lithic::Internal::Type::Enum + + DIGITAL_WALLET: :DIGITAL_WALLET + MERCHANT: :MERCHANT + + def self?.values: -> ::Array[Lithic::Models::Tokenization::tokenization_channel] + end + + type event = + { + token: String, + created_at: Time, + result: Lithic::Models::Tokenization::Event::result, + rule_results: ::Array[Lithic::TokenizationRuleResult], + tokenization_decline_reasons: ::Array[Lithic::Models::tokenization_decline_reason], + tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason], + type: Lithic::Models::Tokenization::Event::type_ + } + + class Event < Lithic::Internal::Type::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader created_at: Time? + + def created_at=: (Time) -> Time + + attr_reader result: Lithic::Models::Tokenization::Event::result? + + def result=: ( + Lithic::Models::Tokenization::Event::result + ) -> Lithic::Models::Tokenization::Event::result + + attr_reader rule_results: ::Array[Lithic::TokenizationRuleResult]? + + def rule_results=: ( + ::Array[Lithic::TokenizationRuleResult] + ) -> ::Array[Lithic::TokenizationRuleResult] + + attr_reader tokenization_decline_reasons: ::Array[Lithic::Models::tokenization_decline_reason]? + + def tokenization_decline_reasons=: ( + ::Array[Lithic::Models::tokenization_decline_reason] + ) -> ::Array[Lithic::Models::tokenization_decline_reason] + + attr_reader tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason]? + + def tokenization_tfa_reasons=: ( + ::Array[Lithic::Models::tokenization_tfa_reason] + ) -> ::Array[Lithic::Models::tokenization_tfa_reason] + + attr_reader type: Lithic::Models::Tokenization::Event::type_? + + def type=: ( + Lithic::Models::Tokenization::Event::type_ + ) -> Lithic::Models::Tokenization::Event::type_ + + def initialize: ( + ?token: String, + ?created_at: Time, + ?result: Lithic::Models::Tokenization::Event::result, + ?rule_results: ::Array[Lithic::TokenizationRuleResult], + ?tokenization_decline_reasons: ::Array[Lithic::Models::tokenization_decline_reason], + ?tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason], + ?type: Lithic::Models::Tokenization::Event::type_ + ) -> void + + def to_hash: -> { + token: String, + created_at: Time, + result: Lithic::Models::Tokenization::Event::result, + rule_results: ::Array[Lithic::TokenizationRuleResult], + tokenization_decline_reasons: ::Array[Lithic::Models::tokenization_decline_reason], + tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason], + type: Lithic::Models::Tokenization::Event::type_ + } + + type result = + :APPROVED + | :DECLINED + | :NOTIFICATION_DELIVERED + | :REQUIRE_ADDITIONAL_AUTHENTICATION + | :TOKEN_ACTIVATED + | :TOKEN_CREATED + | :TOKEN_DEACTIVATED + | :TOKEN_DELETED_FROM_CONSUMER_APP + | :TOKEN_INACTIVE + | :TOKEN_STATE_UNKNOWN + | :TOKEN_SUSPENDED + | :TOKEN_UPDATED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + NOTIFICATION_DELIVERED: :NOTIFICATION_DELIVERED + REQUIRE_ADDITIONAL_AUTHENTICATION: :REQUIRE_ADDITIONAL_AUTHENTICATION + TOKEN_ACTIVATED: :TOKEN_ACTIVATED + TOKEN_CREATED: :TOKEN_CREATED + TOKEN_DEACTIVATED: :TOKEN_DEACTIVATED + TOKEN_DELETED_FROM_CONSUMER_APP: :TOKEN_DELETED_FROM_CONSUMER_APP + TOKEN_INACTIVE: :TOKEN_INACTIVE + TOKEN_STATE_UNKNOWN: :TOKEN_STATE_UNKNOWN + TOKEN_SUSPENDED: :TOKEN_SUSPENDED + TOKEN_UPDATED: :TOKEN_UPDATED + + def self?.values: -> ::Array[Lithic::Models::Tokenization::Event::result] + end + + type type_ = + :TOKENIZATION_2FA + | :TOKENIZATION_AUTHORIZATION + | :TOKENIZATION_DECISIONING + | :TOKENIZATION_ELIGIBILITY_CHECK + | :TOKENIZATION_UPDATED + + module Type + extend Lithic::Internal::Type::Enum + + TOKENIZATION_2_FA: :TOKENIZATION_2FA + TOKENIZATION_AUTHORIZATION: :TOKENIZATION_AUTHORIZATION + TOKENIZATION_DECISIONING: :TOKENIZATION_DECISIONING + TOKENIZATION_ELIGIBILITY_CHECK: :TOKENIZATION_ELIGIBILITY_CHECK + TOKENIZATION_UPDATED: :TOKENIZATION_UPDATED + + def self?.values: -> ::Array[Lithic::Models::Tokenization::Event::type_] + end + end + end + end +end diff --git a/sig/lithic/models/tokenization_activate_params.rbs b/sig/lithic/models/tokenization_activate_params.rbs new file mode 100644 index 00000000..73cf7ccb --- /dev/null +++ b/sig/lithic/models/tokenization_activate_params.rbs @@ -0,0 +1,24 @@ +module Lithic + module Models + type tokenization_activate_params = + { tokenization_token: String } + & Lithic::Internal::Type::request_parameters + + class TokenizationActivateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor tokenization_token: String + + def initialize: ( + tokenization_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + tokenization_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/tokenization_approval_request_webhook_event.rbs b/sig/lithic/models/tokenization_approval_request_webhook_event.rbs new file mode 100644 index 00000000..1cf1f1b7 --- /dev/null +++ b/sig/lithic/models/tokenization_approval_request_webhook_event.rbs @@ -0,0 +1,219 @@ +module Lithic + module Models + type tokenization_approval_request_webhook_event = + { + account_token: String, + card_token: String, + created: Time, + customer_tokenization_decision: Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision?, + event_type: Lithic::Models::TokenizationApprovalRequestWebhookEvent::event_type, + issuer_decision: Lithic::Models::TokenizationApprovalRequestWebhookEvent::issuer_decision, + token_metadata: Lithic::TokenMetadata, + tokenization_channel: Lithic::Models::TokenizationApprovalRequestWebhookEvent::tokenization_channel, + tokenization_token: String, + wallet_decisioning_info: Lithic::WalletDecisioningInfo, + device: Lithic::Device, + rule_results: ::Array[Lithic::TokenizationRuleResult], + tokenization_decline_reasons: ::Array[Lithic::Models::tokenization_decline_reason], + tokenization_source: Lithic::Models::TokenizationApprovalRequestWebhookEvent::tokenization_source, + tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason] + } + + class TokenizationApprovalRequestWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor account_token: String + + attr_accessor card_token: String + + attr_accessor created: Time + + attr_accessor customer_tokenization_decision: Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision? + + attr_accessor event_type: Lithic::Models::TokenizationApprovalRequestWebhookEvent::event_type + + attr_accessor issuer_decision: Lithic::Models::TokenizationApprovalRequestWebhookEvent::issuer_decision + + attr_accessor token_metadata: Lithic::TokenMetadata + + attr_accessor tokenization_channel: Lithic::Models::TokenizationApprovalRequestWebhookEvent::tokenization_channel + + attr_accessor tokenization_token: String + + attr_accessor wallet_decisioning_info: Lithic::WalletDecisioningInfo + + attr_reader device: Lithic::Device? + + def device=: (Lithic::Device) -> Lithic::Device + + attr_reader rule_results: ::Array[Lithic::TokenizationRuleResult]? + + def rule_results=: ( + ::Array[Lithic::TokenizationRuleResult] + ) -> ::Array[Lithic::TokenizationRuleResult] + + attr_reader tokenization_decline_reasons: ::Array[Lithic::Models::tokenization_decline_reason]? + + def tokenization_decline_reasons=: ( + ::Array[Lithic::Models::tokenization_decline_reason] + ) -> ::Array[Lithic::Models::tokenization_decline_reason] + + attr_reader tokenization_source: Lithic::Models::TokenizationApprovalRequestWebhookEvent::tokenization_source? + + def tokenization_source=: ( + Lithic::Models::TokenizationApprovalRequestWebhookEvent::tokenization_source + ) -> Lithic::Models::TokenizationApprovalRequestWebhookEvent::tokenization_source + + attr_reader tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason]? + + def tokenization_tfa_reasons=: ( + ::Array[Lithic::Models::tokenization_tfa_reason] + ) -> ::Array[Lithic::Models::tokenization_tfa_reason] + + def initialize: ( + account_token: String, + card_token: String, + created: Time, + customer_tokenization_decision: Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision?, + event_type: Lithic::Models::TokenizationApprovalRequestWebhookEvent::event_type, + issuer_decision: Lithic::Models::TokenizationApprovalRequestWebhookEvent::issuer_decision, + token_metadata: Lithic::TokenMetadata, + tokenization_channel: Lithic::Models::TokenizationApprovalRequestWebhookEvent::tokenization_channel, + tokenization_token: String, + wallet_decisioning_info: Lithic::WalletDecisioningInfo, + ?device: Lithic::Device, + ?rule_results: ::Array[Lithic::TokenizationRuleResult], + ?tokenization_decline_reasons: ::Array[Lithic::Models::tokenization_decline_reason], + ?tokenization_source: Lithic::Models::TokenizationApprovalRequestWebhookEvent::tokenization_source, + ?tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason] + ) -> void + + def to_hash: -> { + account_token: String, + card_token: String, + created: Time, + customer_tokenization_decision: Lithic::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision?, + event_type: Lithic::Models::TokenizationApprovalRequestWebhookEvent::event_type, + issuer_decision: Lithic::Models::TokenizationApprovalRequestWebhookEvent::issuer_decision, + token_metadata: Lithic::TokenMetadata, + tokenization_channel: Lithic::Models::TokenizationApprovalRequestWebhookEvent::tokenization_channel, + tokenization_token: String, + wallet_decisioning_info: Lithic::WalletDecisioningInfo, + device: Lithic::Device, + rule_results: ::Array[Lithic::TokenizationRuleResult], + tokenization_decline_reasons: ::Array[Lithic::Models::tokenization_decline_reason], + tokenization_source: Lithic::Models::TokenizationApprovalRequestWebhookEvent::tokenization_source, + tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason] + } + + type customer_tokenization_decision = + { + outcome: Lithic::Models::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::outcome, + responder_url: String, + latency: String, + response_code: String + } + + class CustomerTokenizationDecision < Lithic::Internal::Type::BaseModel + attr_accessor outcome: Lithic::Models::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::outcome + + attr_accessor responder_url: String + + attr_reader latency: String? + + def latency=: (String) -> String + + attr_reader response_code: String? + + def response_code=: (String) -> String + + def initialize: ( + outcome: Lithic::Models::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::outcome, + responder_url: String, + ?latency: String, + ?response_code: String + ) -> void + + def to_hash: -> { + outcome: Lithic::Models::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::outcome, + responder_url: String, + latency: String, + response_code: String + } + + type outcome = + :APPROVED + | :DECLINED + | :ERROR + | :INVALID_RESPONSE + | :REQUIRE_ADDITIONAL_AUTHENTICATION + | :TIMEOUT + + module Outcome + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + ERROR: :ERROR + INVALID_RESPONSE: :INVALID_RESPONSE + REQUIRE_ADDITIONAL_AUTHENTICATION: :REQUIRE_ADDITIONAL_AUTHENTICATION + TIMEOUT: :TIMEOUT + + def self?.values: -> ::Array[Lithic::Models::TokenizationApprovalRequestWebhookEvent::CustomerTokenizationDecision::outcome] + end + end + + type event_type = :"tokenization.approval_request" + + module EventType + extend Lithic::Internal::Type::Enum + + TOKENIZATION_APPROVAL_REQUEST: :"tokenization.approval_request" + + def self?.values: -> ::Array[Lithic::Models::TokenizationApprovalRequestWebhookEvent::event_type] + end + + type issuer_decision = :APPROVED | :DENIED | :VERIFICATION_REQUIRED + + module IssuerDecision + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DENIED: :DENIED + VERIFICATION_REQUIRED: :VERIFICATION_REQUIRED + + def self?.values: -> ::Array[Lithic::Models::TokenizationApprovalRequestWebhookEvent::issuer_decision] + end + + type tokenization_channel = :DIGITAL_WALLET | :MERCHANT + + module TokenizationChannel + extend Lithic::Internal::Type::Enum + + DIGITAL_WALLET: :DIGITAL_WALLET + MERCHANT: :MERCHANT + + def self?.values: -> ::Array[Lithic::Models::TokenizationApprovalRequestWebhookEvent::tokenization_channel] + end + + type tokenization_source = + :ACCOUNT_ON_FILE + | :CONTACTLESS_TAP + | :MANUAL_PROVISION + | :PUSH_PROVISION + | :TOKEN + | :UNKNOWN + + module TokenizationSource + extend Lithic::Internal::Type::Enum + + ACCOUNT_ON_FILE: :ACCOUNT_ON_FILE + CONTACTLESS_TAP: :CONTACTLESS_TAP + MANUAL_PROVISION: :MANUAL_PROVISION + PUSH_PROVISION: :PUSH_PROVISION + TOKEN: :TOKEN + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::TokenizationApprovalRequestWebhookEvent::tokenization_source] + end + end + end +end diff --git a/sig/lithic/models/tokenization_deactivate_params.rbs b/sig/lithic/models/tokenization_deactivate_params.rbs new file mode 100644 index 00000000..b0c37419 --- /dev/null +++ b/sig/lithic/models/tokenization_deactivate_params.rbs @@ -0,0 +1,24 @@ +module Lithic + module Models + type tokenization_deactivate_params = + { tokenization_token: String } + & Lithic::Internal::Type::request_parameters + + class TokenizationDeactivateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor tokenization_token: String + + def initialize: ( + tokenization_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + tokenization_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/tokenization_decisioning_retrieve_secret_params.rbs b/sig/lithic/models/tokenization_decisioning_retrieve_secret_params.rbs new file mode 100644 index 00000000..a33d91af --- /dev/null +++ b/sig/lithic/models/tokenization_decisioning_retrieve_secret_params.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type tokenization_decisioning_retrieve_secret_params = + { } & Lithic::Internal::Type::request_parameters + + class TokenizationDecisioningRetrieveSecretParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> { request_options: Lithic::RequestOptions } + end + end +end diff --git a/sig/lithic/models/tokenization_decisioning_rotate_secret_params.rbs b/sig/lithic/models/tokenization_decisioning_rotate_secret_params.rbs new file mode 100644 index 00000000..417f2f8a --- /dev/null +++ b/sig/lithic/models/tokenization_decisioning_rotate_secret_params.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type tokenization_decisioning_rotate_secret_params = + { } & Lithic::Internal::Type::request_parameters + + class TokenizationDecisioningRotateSecretParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> { request_options: Lithic::RequestOptions } + end + end +end diff --git a/sig/lithic/models/tokenization_decisioning_rotate_secret_response.rbs b/sig/lithic/models/tokenization_decisioning_rotate_secret_response.rbs new file mode 100644 index 00000000..bae99a7e --- /dev/null +++ b/sig/lithic/models/tokenization_decisioning_rotate_secret_response.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type tokenization_decisioning_rotate_secret_response = { secret: String } + + class TokenizationDecisioningRotateSecretResponse < Lithic::Internal::Type::BaseModel + attr_reader secret: String? + + def secret=: (String) -> String + + def initialize: (?secret: String) -> void + + def to_hash: -> { secret: String } + end + end +end diff --git a/sig/lithic/models/tokenization_decline_reason.rbs b/sig/lithic/models/tokenization_decline_reason.rbs new file mode 100644 index 00000000..a4fcd594 --- /dev/null +++ b/sig/lithic/models/tokenization_decline_reason.rbs @@ -0,0 +1,40 @@ +module Lithic + module Models + type tokenization_decline_reason = + :ACCOUNT_SCORE_1 + | :DEVICE_SCORE_1 + | :ALL_WALLET_DECLINE_REASONS_PRESENT + | :WALLET_RECOMMENDED_DECISION_RED + | :CVC_MISMATCH + | :CARD_EXPIRY_MONTH_MISMATCH + | :CARD_EXPIRY_YEAR_MISMATCH + | :CARD_INVALID_STATE + | :CUSTOMER_RED_PATH + | :INVALID_CUSTOMER_RESPONSE + | :NETWORK_FAILURE + | :GENERIC_DECLINE + | :DIGITAL_CARD_ART_REQUIRED + | :INVALID_PAN + + module TokenizationDeclineReason + extend Lithic::Internal::Type::Enum + + ACCOUNT_SCORE_1: :ACCOUNT_SCORE_1 + DEVICE_SCORE_1: :DEVICE_SCORE_1 + ALL_WALLET_DECLINE_REASONS_PRESENT: :ALL_WALLET_DECLINE_REASONS_PRESENT + WALLET_RECOMMENDED_DECISION_RED: :WALLET_RECOMMENDED_DECISION_RED + CVC_MISMATCH: :CVC_MISMATCH + CARD_EXPIRY_MONTH_MISMATCH: :CARD_EXPIRY_MONTH_MISMATCH + CARD_EXPIRY_YEAR_MISMATCH: :CARD_EXPIRY_YEAR_MISMATCH + CARD_INVALID_STATE: :CARD_INVALID_STATE + CUSTOMER_RED_PATH: :CUSTOMER_RED_PATH + INVALID_CUSTOMER_RESPONSE: :INVALID_CUSTOMER_RESPONSE + NETWORK_FAILURE: :NETWORK_FAILURE + GENERIC_DECLINE: :GENERIC_DECLINE + DIGITAL_CARD_ART_REQUIRED: :DIGITAL_CARD_ART_REQUIRED + INVALID_PAN: :INVALID_PAN + + def self?.values: -> ::Array[Lithic::Models::tokenization_decline_reason] + end + end +end diff --git a/sig/lithic/models/tokenization_list_params.rbs b/sig/lithic/models/tokenization_list_params.rbs new file mode 100644 index 00000000..6dbecae1 --- /dev/null +++ b/sig/lithic/models/tokenization_list_params.rbs @@ -0,0 +1,91 @@ +module Lithic + module Models + type tokenization_list_params = + { + account_token: String, + begin_: Date, + card_token: String, + end_: Date, + ending_before: String, + page_size: Integer, + starting_after: String, + tokenization_channel: Lithic::Models::TokenizationListParams::tokenization_channel + } + & Lithic::Internal::Type::request_parameters + + class TokenizationListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader begin_: Date? + + def begin_=: (Date) -> Date + + attr_reader card_token: String? + + def card_token=: (String) -> String + + attr_reader end_: Date? + + def end_=: (Date) -> Date + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader tokenization_channel: Lithic::Models::TokenizationListParams::tokenization_channel? + + def tokenization_channel=: ( + Lithic::Models::TokenizationListParams::tokenization_channel + ) -> Lithic::Models::TokenizationListParams::tokenization_channel + + def initialize: ( + ?account_token: String, + ?begin_: Date, + ?card_token: String, + ?end_: Date, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?tokenization_channel: Lithic::Models::TokenizationListParams::tokenization_channel, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + account_token: String, + begin_: Date, + card_token: String, + end_: Date, + ending_before: String, + page_size: Integer, + starting_after: String, + tokenization_channel: Lithic::Models::TokenizationListParams::tokenization_channel, + request_options: Lithic::RequestOptions + } + + type tokenization_channel = :DIGITAL_WALLET | :MERCHANT | :ALL + + module TokenizationChannel + extend Lithic::Internal::Type::Enum + + DIGITAL_WALLET: :DIGITAL_WALLET + MERCHANT: :MERCHANT + ALL: :ALL + + def self?.values: -> ::Array[Lithic::Models::TokenizationListParams::tokenization_channel] + end + end + end +end diff --git a/sig/lithic/models/tokenization_pause_params.rbs b/sig/lithic/models/tokenization_pause_params.rbs new file mode 100644 index 00000000..98c3303b --- /dev/null +++ b/sig/lithic/models/tokenization_pause_params.rbs @@ -0,0 +1,24 @@ +module Lithic + module Models + type tokenization_pause_params = + { tokenization_token: String } + & Lithic::Internal::Type::request_parameters + + class TokenizationPauseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor tokenization_token: String + + def initialize: ( + tokenization_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + tokenization_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/tokenization_resend_activation_code_params.rbs b/sig/lithic/models/tokenization_resend_activation_code_params.rbs new file mode 100644 index 00000000..35a7aff3 --- /dev/null +++ b/sig/lithic/models/tokenization_resend_activation_code_params.rbs @@ -0,0 +1,47 @@ +module Lithic + module Models + type tokenization_resend_activation_code_params = + { + tokenization_token: String, + activation_method_type: Lithic::Models::TokenizationResendActivationCodeParams::activation_method_type + } + & Lithic::Internal::Type::request_parameters + + class TokenizationResendActivationCodeParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor tokenization_token: String + + attr_reader activation_method_type: Lithic::Models::TokenizationResendActivationCodeParams::activation_method_type? + + def activation_method_type=: ( + Lithic::Models::TokenizationResendActivationCodeParams::activation_method_type + ) -> Lithic::Models::TokenizationResendActivationCodeParams::activation_method_type + + def initialize: ( + tokenization_token: String, + ?activation_method_type: Lithic::Models::TokenizationResendActivationCodeParams::activation_method_type, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + tokenization_token: String, + activation_method_type: Lithic::Models::TokenizationResendActivationCodeParams::activation_method_type, + request_options: Lithic::RequestOptions + } + + type activation_method_type = + :EMAIL_TO_CARDHOLDER_ADDRESS | :TEXT_TO_CARDHOLDER_NUMBER + + module ActivationMethodType + extend Lithic::Internal::Type::Enum + + EMAIL_TO_CARDHOLDER_ADDRESS: :EMAIL_TO_CARDHOLDER_ADDRESS + TEXT_TO_CARDHOLDER_NUMBER: :TEXT_TO_CARDHOLDER_NUMBER + + def self?.values: -> ::Array[Lithic::Models::TokenizationResendActivationCodeParams::activation_method_type] + end + end + end +end diff --git a/sig/lithic/models/tokenization_result_webhook_event.rbs b/sig/lithic/models/tokenization_result_webhook_event.rbs new file mode 100644 index 00000000..5f033d0d --- /dev/null +++ b/sig/lithic/models/tokenization_result_webhook_event.rbs @@ -0,0 +1,133 @@ +module Lithic + module Models + type tokenization_result_webhook_event = + { + account_token: String, + card_token: String, + created: Time, + event_type: :"tokenization.result", + tokenization_result_details: Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails, + tokenization_token: String + } + + class TokenizationResultWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor account_token: String + + attr_accessor card_token: String + + attr_accessor created: Time + + attr_accessor event_type: :"tokenization.result" + + attr_accessor tokenization_result_details: Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails + + attr_accessor tokenization_token: String + + def initialize: ( + account_token: String, + card_token: String, + created: Time, + tokenization_result_details: Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails, + tokenization_token: String, + ?event_type: :"tokenization.result" + ) -> void + + def to_hash: -> { + account_token: String, + card_token: String, + created: Time, + event_type: :"tokenization.result", + tokenization_result_details: Lithic::TokenizationResultWebhookEvent::TokenizationResultDetails, + tokenization_token: String + } + + type tokenization_result_details = + { + issuer_decision: String, + tokenization_decline_reasons: ::Array[Lithic::Models::TokenizationResultWebhookEvent::TokenizationResultDetails::tokenization_decline_reason], + customer_decision: String?, + rule_results: ::Array[Lithic::TokenizationRuleResult], + token_activated_date_time: Time?, + tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason], + wallet_decision: String? + } + + class TokenizationResultDetails < Lithic::Internal::Type::BaseModel + attr_accessor issuer_decision: String + + attr_accessor tokenization_decline_reasons: ::Array[Lithic::Models::TokenizationResultWebhookEvent::TokenizationResultDetails::tokenization_decline_reason] + + attr_accessor customer_decision: String? + + attr_reader rule_results: ::Array[Lithic::TokenizationRuleResult]? + + def rule_results=: ( + ::Array[Lithic::TokenizationRuleResult] + ) -> ::Array[Lithic::TokenizationRuleResult] + + attr_accessor token_activated_date_time: Time? + + attr_reader tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason]? + + def tokenization_tfa_reasons=: ( + ::Array[Lithic::Models::tokenization_tfa_reason] + ) -> ::Array[Lithic::Models::tokenization_tfa_reason] + + attr_accessor wallet_decision: String? + + def initialize: ( + issuer_decision: String, + tokenization_decline_reasons: ::Array[Lithic::Models::TokenizationResultWebhookEvent::TokenizationResultDetails::tokenization_decline_reason], + ?customer_decision: String?, + ?rule_results: ::Array[Lithic::TokenizationRuleResult], + ?token_activated_date_time: Time?, + ?tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason], + ?wallet_decision: String? + ) -> void + + def to_hash: -> { + issuer_decision: String, + tokenization_decline_reasons: ::Array[Lithic::Models::TokenizationResultWebhookEvent::TokenizationResultDetails::tokenization_decline_reason], + customer_decision: String?, + rule_results: ::Array[Lithic::TokenizationRuleResult], + token_activated_date_time: Time?, + tokenization_tfa_reasons: ::Array[Lithic::Models::tokenization_tfa_reason], + wallet_decision: String? + } + + type tokenization_decline_reason = + :ACCOUNT_SCORE_1 + | :ALL_WALLET_DECLINE_REASONS_PRESENT + | :CARD_EXPIRY_MONTH_MISMATCH + | :CARD_EXPIRY_YEAR_MISMATCH + | :CARD_INVALID_STATE + | :CUSTOMER_RED_PATH + | :CVC_MISMATCH + | :DEVICE_SCORE_1 + | :GENERIC_DECLINE + | :INVALID_CUSTOMER_RESPONSE + | :NETWORK_FAILURE + | :WALLET_RECOMMENDED_DECISION_RED + + module TokenizationDeclineReason + extend Lithic::Internal::Type::Enum + + ACCOUNT_SCORE_1: :ACCOUNT_SCORE_1 + ALL_WALLET_DECLINE_REASONS_PRESENT: :ALL_WALLET_DECLINE_REASONS_PRESENT + CARD_EXPIRY_MONTH_MISMATCH: :CARD_EXPIRY_MONTH_MISMATCH + CARD_EXPIRY_YEAR_MISMATCH: :CARD_EXPIRY_YEAR_MISMATCH + CARD_INVALID_STATE: :CARD_INVALID_STATE + CUSTOMER_RED_PATH: :CUSTOMER_RED_PATH + CVC_MISMATCH: :CVC_MISMATCH + DEVICE_SCORE_1: :DEVICE_SCORE_1 + GENERIC_DECLINE: :GENERIC_DECLINE + INVALID_CUSTOMER_RESPONSE: :INVALID_CUSTOMER_RESPONSE + NETWORK_FAILURE: :NETWORK_FAILURE + WALLET_RECOMMENDED_DECISION_RED: :WALLET_RECOMMENDED_DECISION_RED + + def self?.values: -> ::Array[Lithic::Models::TokenizationResultWebhookEvent::TokenizationResultDetails::tokenization_decline_reason] + end + end + end + end +end diff --git a/sig/lithic/models/tokenization_retrieve_params.rbs b/sig/lithic/models/tokenization_retrieve_params.rbs new file mode 100644 index 00000000..e14a7824 --- /dev/null +++ b/sig/lithic/models/tokenization_retrieve_params.rbs @@ -0,0 +1,24 @@ +module Lithic + module Models + type tokenization_retrieve_params = + { tokenization_token: String } + & Lithic::Internal::Type::request_parameters + + class TokenizationRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor tokenization_token: String + + def initialize: ( + tokenization_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + tokenization_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/tokenization_rule_result.rbs b/sig/lithic/models/tokenization_rule_result.rbs new file mode 100644 index 00000000..24050ab5 --- /dev/null +++ b/sig/lithic/models/tokenization_rule_result.rbs @@ -0,0 +1,48 @@ +module Lithic + module Models + type tokenization_rule_result = + { + auth_rule_token: String?, + explanation: String?, + name: String?, + result: Lithic::Models::TokenizationRuleResult::result + } + + class TokenizationRuleResult < Lithic::Internal::Type::BaseModel + attr_accessor auth_rule_token: String? + + attr_accessor explanation: String? + + attr_accessor name: String? + + attr_accessor result: Lithic::Models::TokenizationRuleResult::result + + def initialize: ( + auth_rule_token: String?, + explanation: String?, + name: String?, + result: Lithic::Models::TokenizationRuleResult::result + ) -> void + + def to_hash: -> { + auth_rule_token: String?, + explanation: String?, + name: String?, + result: Lithic::Models::TokenizationRuleResult::result + } + + type result = :APPROVED | :DECLINED | :REQUIRE_TFA | :ERROR + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + REQUIRE_TFA: :REQUIRE_TFA + ERROR: :ERROR + + def self?.values: -> ::Array[Lithic::Models::TokenizationRuleResult::result] + end + end + end +end diff --git a/sig/lithic/models/tokenization_secret.rbs b/sig/lithic/models/tokenization_secret.rbs new file mode 100644 index 00000000..7d714f92 --- /dev/null +++ b/sig/lithic/models/tokenization_secret.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type tokenization_secret = { secret: String } + + class TokenizationSecret < Lithic::Internal::Type::BaseModel + attr_reader secret: String? + + def secret=: (String) -> String + + def initialize: (?secret: String) -> void + + def to_hash: -> { secret: String } + end + end +end diff --git a/sig/lithic/models/tokenization_simulate_params.rbs b/sig/lithic/models/tokenization_simulate_params.rbs new file mode 100644 index 00000000..44b1a185 --- /dev/null +++ b/sig/lithic/models/tokenization_simulate_params.rbs @@ -0,0 +1,97 @@ +module Lithic + module Models + type tokenization_simulate_params = + { + cvv: String, + expiration_date: String, + pan: String, + tokenization_source: Lithic::Models::TokenizationSimulateParams::tokenization_source, + account_score: Integer, + device_score: Integer, + entity: String, + wallet_recommended_decision: Lithic::Models::TokenizationSimulateParams::wallet_recommended_decision + } + & Lithic::Internal::Type::request_parameters + + class TokenizationSimulateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor cvv: String + + attr_accessor expiration_date: String + + attr_accessor pan: String + + attr_accessor tokenization_source: Lithic::Models::TokenizationSimulateParams::tokenization_source + + attr_reader account_score: Integer? + + def account_score=: (Integer) -> Integer + + attr_reader device_score: Integer? + + def device_score=: (Integer) -> Integer + + attr_reader entity: String? + + def entity=: (String) -> String + + attr_reader wallet_recommended_decision: Lithic::Models::TokenizationSimulateParams::wallet_recommended_decision? + + def wallet_recommended_decision=: ( + Lithic::Models::TokenizationSimulateParams::wallet_recommended_decision + ) -> Lithic::Models::TokenizationSimulateParams::wallet_recommended_decision + + def initialize: ( + cvv: String, + expiration_date: String, + pan: String, + tokenization_source: Lithic::Models::TokenizationSimulateParams::tokenization_source, + ?account_score: Integer, + ?device_score: Integer, + ?entity: String, + ?wallet_recommended_decision: Lithic::Models::TokenizationSimulateParams::wallet_recommended_decision, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + cvv: String, + expiration_date: String, + pan: String, + tokenization_source: Lithic::Models::TokenizationSimulateParams::tokenization_source, + account_score: Integer, + device_score: Integer, + entity: String, + wallet_recommended_decision: Lithic::Models::TokenizationSimulateParams::wallet_recommended_decision, + request_options: Lithic::RequestOptions + } + + type tokenization_source = :APPLE_PAY | :GOOGLE | :SAMSUNG_PAY | :MERCHANT + + module TokenizationSource + extend Lithic::Internal::Type::Enum + + APPLE_PAY: :APPLE_PAY + GOOGLE: :GOOGLE + SAMSUNG_PAY: :SAMSUNG_PAY + MERCHANT: :MERCHANT + + def self?.values: -> ::Array[Lithic::Models::TokenizationSimulateParams::tokenization_source] + end + + type wallet_recommended_decision = + :APPROVED | :DECLINED | :REQUIRE_ADDITIONAL_AUTHENTICATION + + module WalletRecommendedDecision + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + REQUIRE_ADDITIONAL_AUTHENTICATION: :REQUIRE_ADDITIONAL_AUTHENTICATION + + def self?.values: -> ::Array[Lithic::Models::TokenizationSimulateParams::wallet_recommended_decision] + end + end + end +end diff --git a/sig/lithic/models/tokenization_tfa_reason.rbs b/sig/lithic/models/tokenization_tfa_reason.rbs new file mode 100644 index 00000000..d59a63f2 --- /dev/null +++ b/sig/lithic/models/tokenization_tfa_reason.rbs @@ -0,0 +1,42 @@ +module Lithic + module Models + type tokenization_tfa_reason = + :WALLET_RECOMMENDED_TFA + | :SUSPICIOUS_ACTIVITY + | :DEVICE_RECENTLY_LOST + | :TOO_MANY_RECENT_ATTEMPTS + | :TOO_MANY_RECENT_TOKENS + | :TOO_MANY_DIFFERENT_CARDHOLDERS + | :OUTSIDE_HOME_TERRITORY + | :HAS_SUSPENDED_TOKENS + | :HIGH_RISK + | :ACCOUNT_SCORE_LOW + | :DEVICE_SCORE_LOW + | :CARD_STATE_TFA + | :HARDCODED_TFA + | :CUSTOMER_RULE_TFA + | :DEVICE_HOST_CARD_EMULATION + + module TokenizationTfaReason + extend Lithic::Internal::Type::Enum + + WALLET_RECOMMENDED_TFA: :WALLET_RECOMMENDED_TFA + SUSPICIOUS_ACTIVITY: :SUSPICIOUS_ACTIVITY + DEVICE_RECENTLY_LOST: :DEVICE_RECENTLY_LOST + TOO_MANY_RECENT_ATTEMPTS: :TOO_MANY_RECENT_ATTEMPTS + TOO_MANY_RECENT_TOKENS: :TOO_MANY_RECENT_TOKENS + TOO_MANY_DIFFERENT_CARDHOLDERS: :TOO_MANY_DIFFERENT_CARDHOLDERS + OUTSIDE_HOME_TERRITORY: :OUTSIDE_HOME_TERRITORY + HAS_SUSPENDED_TOKENS: :HAS_SUSPENDED_TOKENS + HIGH_RISK: :HIGH_RISK + ACCOUNT_SCORE_LOW: :ACCOUNT_SCORE_LOW + DEVICE_SCORE_LOW: :DEVICE_SCORE_LOW + CARD_STATE_TFA: :CARD_STATE_TFA + HARDCODED_TFA: :HARDCODED_TFA + CUSTOMER_RULE_TFA: :CUSTOMER_RULE_TFA + DEVICE_HOST_CARD_EMULATION: :DEVICE_HOST_CARD_EMULATION + + def self?.values: -> ::Array[Lithic::Models::tokenization_tfa_reason] + end + end +end diff --git a/sig/lithic/models/tokenization_two_factor_authentication_code_sent_webhook_event.rbs b/sig/lithic/models/tokenization_two_factor_authentication_code_sent_webhook_event.rbs new file mode 100644 index 00000000..f2faccb7 --- /dev/null +++ b/sig/lithic/models/tokenization_two_factor_authentication_code_sent_webhook_event.rbs @@ -0,0 +1,78 @@ +module Lithic + module Models + type tokenization_two_factor_authentication_code_sent_webhook_event = + { + account_token: String, + activation_method: Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod, + card_token: String, + created: Time, + event_type: :"tokenization.two_factor_authentication_code_sent", + tokenization_token: String + } + + class TokenizationTwoFactorAuthenticationCodeSentWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor account_token: String + + attr_accessor activation_method: Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod + + attr_accessor card_token: String + + attr_accessor created: Time + + attr_accessor event_type: :"tokenization.two_factor_authentication_code_sent" + + attr_accessor tokenization_token: String + + def initialize: ( + account_token: String, + activation_method: Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod, + card_token: String, + created: Time, + tokenization_token: String, + ?event_type: :"tokenization.two_factor_authentication_code_sent" + ) -> void + + def to_hash: -> { + account_token: String, + activation_method: Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod, + card_token: String, + created: Time, + event_type: :"tokenization.two_factor_authentication_code_sent", + tokenization_token: String + } + + type activation_method = + { + type: Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::type_, + value: String + } + + class ActivationMethod < Lithic::Internal::Type::BaseModel + attr_accessor type: Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::type_ + + attr_accessor value: String + + def initialize: ( + type: Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::type_, + value: String + ) -> void + + def to_hash: -> { + type: Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::type_, + value: String + } + + type type_ = :EMAIL_TO_CARDHOLDER_ADDRESS | :TEXT_TO_CARDHOLDER_NUMBER + + module Type + extend Lithic::Internal::Type::Enum + + EMAIL_TO_CARDHOLDER_ADDRESS: :EMAIL_TO_CARDHOLDER_ADDRESS + TEXT_TO_CARDHOLDER_NUMBER: :TEXT_TO_CARDHOLDER_NUMBER + + def self?.values: -> ::Array[Lithic::Models::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent::ActivationMethod::type_] + end + end + end + end +end diff --git a/sig/lithic/models/tokenization_two_factor_authentication_code_webhook_event.rbs b/sig/lithic/models/tokenization_two_factor_authentication_code_webhook_event.rbs new file mode 100644 index 00000000..983d3b10 --- /dev/null +++ b/sig/lithic/models/tokenization_two_factor_authentication_code_webhook_event.rbs @@ -0,0 +1,83 @@ +module Lithic + module Models + type tokenization_two_factor_authentication_code_webhook_event = + { + account_token: String, + activation_method: Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod, + authentication_code: String, + card_token: String, + created: Time, + event_type: :"tokenization.two_factor_authentication_code", + tokenization_token: String + } + + class TokenizationTwoFactorAuthenticationCodeWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor account_token: String + + attr_accessor activation_method: Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod + + attr_accessor authentication_code: String + + attr_accessor card_token: String + + attr_accessor created: Time + + attr_accessor event_type: :"tokenization.two_factor_authentication_code" + + attr_accessor tokenization_token: String + + def initialize: ( + account_token: String, + activation_method: Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod, + authentication_code: String, + card_token: String, + created: Time, + tokenization_token: String, + ?event_type: :"tokenization.two_factor_authentication_code" + ) -> void + + def to_hash: -> { + account_token: String, + activation_method: Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod, + authentication_code: String, + card_token: String, + created: Time, + event_type: :"tokenization.two_factor_authentication_code", + tokenization_token: String + } + + type activation_method = + { + type: Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::type_, + value: String + } + + class ActivationMethod < Lithic::Internal::Type::BaseModel + attr_accessor type: Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::type_ + + attr_accessor value: String + + def initialize: ( + type: Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::type_, + value: String + ) -> void + + def to_hash: -> { + type: Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::type_, + value: String + } + + type type_ = :EMAIL_TO_CARDHOLDER_ADDRESS | :TEXT_TO_CARDHOLDER_NUMBER + + module Type + extend Lithic::Internal::Type::Enum + + EMAIL_TO_CARDHOLDER_ADDRESS: :EMAIL_TO_CARDHOLDER_ADDRESS + TEXT_TO_CARDHOLDER_NUMBER: :TEXT_TO_CARDHOLDER_NUMBER + + def self?.values: -> ::Array[Lithic::Models::TokenizationTwoFactorAuthenticationCodeWebhookEvent::ActivationMethod::type_] + end + end + end + end +end diff --git a/sig/lithic/models/tokenization_unpause_params.rbs b/sig/lithic/models/tokenization_unpause_params.rbs new file mode 100644 index 00000000..21e43f6b --- /dev/null +++ b/sig/lithic/models/tokenization_unpause_params.rbs @@ -0,0 +1,24 @@ +module Lithic + module Models + type tokenization_unpause_params = + { tokenization_token: String } + & Lithic::Internal::Type::request_parameters + + class TokenizationUnpauseParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor tokenization_token: String + + def initialize: ( + tokenization_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + tokenization_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/tokenization_update_digital_card_art_params.rbs b/sig/lithic/models/tokenization_update_digital_card_art_params.rbs new file mode 100644 index 00000000..9ca7965a --- /dev/null +++ b/sig/lithic/models/tokenization_update_digital_card_art_params.rbs @@ -0,0 +1,30 @@ +module Lithic + module Models + type tokenization_update_digital_card_art_params = + { tokenization_token: String, digital_card_art_token: String } + & Lithic::Internal::Type::request_parameters + + class TokenizationUpdateDigitalCardArtParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor tokenization_token: String + + attr_reader digital_card_art_token: String? + + def digital_card_art_token=: (String) -> String + + def initialize: ( + tokenization_token: String, + ?digital_card_art_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + tokenization_token: String, + digital_card_art_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/tokenization_updated_webhook_event.rbs b/sig/lithic/models/tokenization_updated_webhook_event.rbs new file mode 100644 index 00000000..d9a70820 --- /dev/null +++ b/sig/lithic/models/tokenization_updated_webhook_event.rbs @@ -0,0 +1,40 @@ +module Lithic + module Models + type tokenization_updated_webhook_event = + { + account_token: String, + card_token: String, + created: Time, + event_type: :"tokenization.updated", + tokenization: Lithic::Tokenization + } + + class TokenizationUpdatedWebhookEvent < Lithic::Internal::Type::BaseModel + attr_accessor account_token: String + + attr_accessor card_token: String + + attr_accessor created: Time + + attr_accessor event_type: :"tokenization.updated" + + attr_accessor tokenization: Lithic::Tokenization + + def initialize: ( + account_token: String, + card_token: String, + created: Time, + tokenization: Lithic::Tokenization, + ?event_type: :"tokenization.updated" + ) -> void + + def to_hash: -> { + account_token: String, + card_token: String, + created: Time, + event_type: :"tokenization.updated", + tokenization: Lithic::Tokenization + } + end + end +end diff --git a/sig/lithic/models/transaction.rbs b/sig/lithic/models/transaction.rbs new file mode 100644 index 00000000..9cbb5dc9 --- /dev/null +++ b/sig/lithic/models/transaction.rbs @@ -0,0 +1,1452 @@ +module Lithic + module Models + type transaction = + { + token: String, + account_token: String, + acquirer_fee: Integer?, + acquirer_reference_number: String?, + amount: Integer, + amounts: Lithic::Transaction::Amounts, + authorization_amount: Integer?, + authorization_code: String?, + avs: Lithic::Transaction::Avs?, + card_token: String, + cardholder_authentication: Lithic::CardholderAuthentication?, + created: Time, + financial_account_token: String?, + merchant: Lithic::Transaction::Merchant, + merchant_amount: Integer?, + merchant_authorization_amount: Integer?, + merchant_currency: String, + network: Lithic::Models::Transaction::network?, + network_risk_score: Integer?, + pos: Lithic::Transaction::Pos, + result: Lithic::Models::Transaction::result, + service_location: Lithic::Transaction::ServiceLocation?, + settled_amount: Integer, + status: Lithic::Models::Transaction::status, + tags: ::Hash[Symbol, String], + token_info: Lithic::TokenInfo?, + updated: Time, + events: ::Array[Lithic::Transaction::Event] + } + + class Transaction < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor account_token: String + + attr_accessor acquirer_fee: Integer? + + attr_accessor acquirer_reference_number: String? + + attr_accessor amount: Integer + + attr_accessor amounts: Lithic::Transaction::Amounts + + attr_accessor authorization_amount: Integer? + + attr_accessor authorization_code: String? + + attr_accessor avs: Lithic::Transaction::Avs? + + attr_accessor card_token: String + + attr_accessor cardholder_authentication: Lithic::CardholderAuthentication? + + attr_accessor created: Time + + attr_accessor financial_account_token: String? + + attr_accessor merchant: Lithic::Transaction::Merchant + + attr_accessor merchant_amount: Integer? + + attr_accessor merchant_authorization_amount: Integer? + + attr_accessor merchant_currency: String + + attr_accessor network: Lithic::Models::Transaction::network? + + attr_accessor network_risk_score: Integer? + + attr_accessor pos: Lithic::Transaction::Pos + + attr_accessor result: Lithic::Models::Transaction::result + + attr_accessor service_location: Lithic::Transaction::ServiceLocation? + + attr_accessor settled_amount: Integer + + attr_accessor status: Lithic::Models::Transaction::status + + attr_accessor tags: ::Hash[Symbol, String] + + attr_accessor token_info: Lithic::TokenInfo? + + attr_accessor updated: Time + + attr_reader events: ::Array[Lithic::Transaction::Event]? + + def events=: ( + ::Array[Lithic::Transaction::Event] + ) -> ::Array[Lithic::Transaction::Event] + + def initialize: ( + token: String, + account_token: String, + acquirer_fee: Integer?, + acquirer_reference_number: String?, + amount: Integer, + amounts: Lithic::Transaction::Amounts, + authorization_amount: Integer?, + authorization_code: String?, + avs: Lithic::Transaction::Avs?, + card_token: String, + cardholder_authentication: Lithic::CardholderAuthentication?, + created: Time, + financial_account_token: String?, + merchant: Lithic::Transaction::Merchant, + merchant_amount: Integer?, + merchant_authorization_amount: Integer?, + merchant_currency: String, + network: Lithic::Models::Transaction::network?, + network_risk_score: Integer?, + pos: Lithic::Transaction::Pos, + result: Lithic::Models::Transaction::result, + service_location: Lithic::Transaction::ServiceLocation?, + settled_amount: Integer, + status: Lithic::Models::Transaction::status, + tags: ::Hash[Symbol, String], + token_info: Lithic::TokenInfo?, + updated: Time, + ?events: ::Array[Lithic::Transaction::Event] + ) -> void + + def to_hash: -> { + token: String, + account_token: String, + acquirer_fee: Integer?, + acquirer_reference_number: String?, + amount: Integer, + amounts: Lithic::Transaction::Amounts, + authorization_amount: Integer?, + authorization_code: String?, + avs: Lithic::Transaction::Avs?, + card_token: String, + cardholder_authentication: Lithic::CardholderAuthentication?, + created: Time, + financial_account_token: String?, + merchant: Lithic::Transaction::Merchant, + merchant_amount: Integer?, + merchant_authorization_amount: Integer?, + merchant_currency: String, + network: Lithic::Models::Transaction::network?, + network_risk_score: Integer?, + pos: Lithic::Transaction::Pos, + result: Lithic::Models::Transaction::result, + service_location: Lithic::Transaction::ServiceLocation?, + settled_amount: Integer, + status: Lithic::Models::Transaction::status, + tags: ::Hash[Symbol, String], + token_info: Lithic::TokenInfo?, + updated: Time, + events: ::Array[Lithic::Transaction::Event] + } + + type amounts = + { + cardholder: Lithic::Transaction::Amounts::Cardholder, + hold: Lithic::Transaction::Amounts::Hold, + merchant: Lithic::Transaction::Amounts::Merchant, + settlement: Lithic::Transaction::Amounts::Settlement + } + + class Amounts < Lithic::Internal::Type::BaseModel + attr_accessor cardholder: Lithic::Transaction::Amounts::Cardholder + + attr_accessor hold: Lithic::Transaction::Amounts::Hold + + attr_accessor merchant: Lithic::Transaction::Amounts::Merchant + + attr_accessor settlement: Lithic::Transaction::Amounts::Settlement + + def initialize: ( + cardholder: Lithic::Transaction::Amounts::Cardholder, + hold: Lithic::Transaction::Amounts::Hold, + merchant: Lithic::Transaction::Amounts::Merchant, + settlement: Lithic::Transaction::Amounts::Settlement + ) -> void + + def to_hash: -> { + cardholder: Lithic::Transaction::Amounts::Cardholder, + hold: Lithic::Transaction::Amounts::Hold, + merchant: Lithic::Transaction::Amounts::Merchant, + settlement: Lithic::Transaction::Amounts::Settlement + } + + type cardholder = + { amount: Integer, conversion_rate: String, currency: String } + + class Cardholder < Lithic::Internal::Type::BaseModel + attr_accessor amount: Integer + + attr_accessor conversion_rate: String + + attr_accessor currency: String + + def initialize: ( + amount: Integer, + conversion_rate: String, + currency: String + ) -> void + + def to_hash: -> { + amount: Integer, + conversion_rate: String, + currency: String + } + end + + type hold = { amount: Integer, currency: String } + + class Hold < Lithic::Internal::Type::BaseModel + attr_accessor amount: Integer + + attr_accessor currency: String + + def initialize: (amount: Integer, currency: String) -> void + + def to_hash: -> { amount: Integer, currency: String } + end + + type merchant = { amount: Integer, currency: String } + + class Merchant < Lithic::Internal::Type::BaseModel + attr_accessor amount: Integer + + attr_accessor currency: String + + def initialize: (amount: Integer, currency: String) -> void + + def to_hash: -> { amount: Integer, currency: String } + end + + type settlement = { amount: Integer, currency: String } + + class Settlement < Lithic::Internal::Type::BaseModel + attr_accessor amount: Integer + + attr_accessor currency: String + + def initialize: (amount: Integer, currency: String) -> void + + def to_hash: -> { amount: Integer, currency: String } + end + end + + type avs = { address: String, zipcode: String } + + class Avs < Lithic::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor zipcode: String + + def initialize: (address: String, zipcode: String) -> void + + def to_hash: -> { address: String, zipcode: String } + end + + type merchant = + { phone_number: String?, postal_code: String?, street_address: String? } + + class Merchant < Lithic::Models::Merchant + def phone_number: -> String? + + def phone_number=: (String? _) -> String? + + def postal_code: -> String? + + def postal_code=: (String? _) -> String? + + def street_address: -> String? + + def street_address=: (String? _) -> String? + + def initialize: ( + phone_number: String?, + postal_code: String?, + street_address: String? + ) -> void + + def to_hash: -> { + phone_number: String?, + postal_code: String?, + street_address: String? + } + end + + type network = + :AMEX | :INTERLINK | :MAESTRO | :MASTERCARD | :UNKNOWN | :VISA + + module Network + extend Lithic::Internal::Type::Enum + + AMEX: :AMEX + INTERLINK: :INTERLINK + MAESTRO: :MAESTRO + MASTERCARD: :MASTERCARD + UNKNOWN: :UNKNOWN + VISA: :VISA + + def self?.values: -> ::Array[Lithic::Models::Transaction::network] + end + + type pos = + { + entry_mode: Lithic::Transaction::Pos::EntryMode, + terminal: Lithic::Transaction::Pos::Terminal + } + + class Pos < Lithic::Internal::Type::BaseModel + attr_accessor entry_mode: Lithic::Transaction::Pos::EntryMode + + attr_accessor terminal: Lithic::Transaction::Pos::Terminal + + def initialize: ( + entry_mode: Lithic::Transaction::Pos::EntryMode, + terminal: Lithic::Transaction::Pos::Terminal + ) -> void + + def to_hash: -> { + entry_mode: Lithic::Transaction::Pos::EntryMode, + terminal: Lithic::Transaction::Pos::Terminal + } + + type entry_mode = + { + card: Lithic::Models::Transaction::Pos::EntryMode::card, + cardholder: Lithic::Models::Transaction::Pos::EntryMode::cardholder, + pan: Lithic::Models::Transaction::Pos::EntryMode::pan, + pin_entered: bool + } + + class EntryMode < Lithic::Internal::Type::BaseModel + attr_accessor card: Lithic::Models::Transaction::Pos::EntryMode::card + + attr_accessor cardholder: Lithic::Models::Transaction::Pos::EntryMode::cardholder + + attr_accessor pan: Lithic::Models::Transaction::Pos::EntryMode::pan + + attr_accessor pin_entered: bool + + def initialize: ( + card: Lithic::Models::Transaction::Pos::EntryMode::card, + cardholder: Lithic::Models::Transaction::Pos::EntryMode::cardholder, + pan: Lithic::Models::Transaction::Pos::EntryMode::pan, + pin_entered: bool + ) -> void + + def to_hash: -> { + card: Lithic::Models::Transaction::Pos::EntryMode::card, + cardholder: Lithic::Models::Transaction::Pos::EntryMode::cardholder, + pan: Lithic::Models::Transaction::Pos::EntryMode::pan, + pin_entered: bool + } + + type card = :NOT_PRESENT | :PREAUTHORIZED | :PRESENT | :UNKNOWN + + module Card + extend Lithic::Internal::Type::Enum + + NOT_PRESENT: :NOT_PRESENT + PREAUTHORIZED: :PREAUTHORIZED + PRESENT: :PRESENT + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::Transaction::Pos::EntryMode::card] + end + + type cardholder = + :DEFERRED_BILLING + | :ELECTRONIC_ORDER + | :INSTALLMENT + | :MAIL_ORDER + | :NOT_PRESENT + | :PREAUTHORIZED + | :PRESENT + | :REOCCURRING + | :TELEPHONE_ORDER + | :UNKNOWN + + module Cardholder + extend Lithic::Internal::Type::Enum + + DEFERRED_BILLING: :DEFERRED_BILLING + ELECTRONIC_ORDER: :ELECTRONIC_ORDER + INSTALLMENT: :INSTALLMENT + MAIL_ORDER: :MAIL_ORDER + NOT_PRESENT: :NOT_PRESENT + PREAUTHORIZED: :PREAUTHORIZED + PRESENT: :PRESENT + REOCCURRING: :REOCCURRING + TELEPHONE_ORDER: :TELEPHONE_ORDER + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::Transaction::Pos::EntryMode::cardholder] + end + + type pan = + :AUTO_ENTRY + | :BAR_CODE + | :CONTACTLESS + | :CREDENTIAL_ON_FILE + | :ECOMMERCE + | :ERROR_KEYED + | :ERROR_MAGNETIC_STRIPE + | :ICC + | :KEY_ENTERED + | :MAGNETIC_STRIPE + | :MANUAL + | :OCR + | :SECURE_CARDLESS + | :UNKNOWN + | :UNSPECIFIED + + module Pan + extend Lithic::Internal::Type::Enum + + AUTO_ENTRY: :AUTO_ENTRY + BAR_CODE: :BAR_CODE + CONTACTLESS: :CONTACTLESS + CREDENTIAL_ON_FILE: :CREDENTIAL_ON_FILE + ECOMMERCE: :ECOMMERCE + ERROR_KEYED: :ERROR_KEYED + ERROR_MAGNETIC_STRIPE: :ERROR_MAGNETIC_STRIPE + ICC: :ICC + KEY_ENTERED: :KEY_ENTERED + MAGNETIC_STRIPE: :MAGNETIC_STRIPE + MANUAL: :MANUAL + OCR: :OCR + SECURE_CARDLESS: :SECURE_CARDLESS + UNKNOWN: :UNKNOWN + UNSPECIFIED: :UNSPECIFIED + + def self?.values: -> ::Array[Lithic::Models::Transaction::Pos::EntryMode::pan] + end + end + + type terminal = + { + attended: bool, + card_retention_capable: bool, + on_premise: bool, + operator: Lithic::Models::Transaction::Pos::Terminal::operator, + partial_approval_capable: bool, + pin_capability: Lithic::Models::Transaction::Pos::Terminal::pin_capability, + type: Lithic::Models::Transaction::Pos::Terminal::type_, + acceptor_terminal_id: String? + } + + class Terminal < Lithic::Internal::Type::BaseModel + attr_accessor attended: bool + + attr_accessor card_retention_capable: bool + + attr_accessor on_premise: bool + + attr_accessor operator: Lithic::Models::Transaction::Pos::Terminal::operator + + attr_accessor partial_approval_capable: bool + + attr_accessor pin_capability: Lithic::Models::Transaction::Pos::Terminal::pin_capability + + attr_accessor type: Lithic::Models::Transaction::Pos::Terminal::type_ + + attr_accessor acceptor_terminal_id: String? + + def initialize: ( + attended: bool, + card_retention_capable: bool, + on_premise: bool, + operator: Lithic::Models::Transaction::Pos::Terminal::operator, + partial_approval_capable: bool, + pin_capability: Lithic::Models::Transaction::Pos::Terminal::pin_capability, + type: Lithic::Models::Transaction::Pos::Terminal::type_, + ?acceptor_terminal_id: String? + ) -> void + + def to_hash: -> { + attended: bool, + card_retention_capable: bool, + on_premise: bool, + operator: Lithic::Models::Transaction::Pos::Terminal::operator, + partial_approval_capable: bool, + pin_capability: Lithic::Models::Transaction::Pos::Terminal::pin_capability, + type: Lithic::Models::Transaction::Pos::Terminal::type_, + acceptor_terminal_id: String? + } + + type operator = + :ADMINISTRATIVE | :CARDHOLDER | :CARD_ACCEPTOR | :UNKNOWN + + module Operator + extend Lithic::Internal::Type::Enum + + ADMINISTRATIVE: :ADMINISTRATIVE + CARDHOLDER: :CARDHOLDER + CARD_ACCEPTOR: :CARD_ACCEPTOR + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::Transaction::Pos::Terminal::operator] + end + + type pin_capability = + :CAPABLE | :INOPERATIVE | :NOT_CAPABLE | :UNSPECIFIED + + module PinCapability + extend Lithic::Internal::Type::Enum + + CAPABLE: :CAPABLE + INOPERATIVE: :INOPERATIVE + NOT_CAPABLE: :NOT_CAPABLE + UNSPECIFIED: :UNSPECIFIED + + def self?.values: -> ::Array[Lithic::Models::Transaction::Pos::Terminal::pin_capability] + end + + type type_ = + :ADMINISTRATIVE + | :ATM + | :AUTHORIZATION + | :COUPON_MACHINE + | :DIAL_TERMINAL + | :ECOMMERCE + | :ECR + | :FUEL_MACHINE + | :HOME_TERMINAL + | :MICR + | :OFF_PREMISE + | :PAYMENT + | :PDA + | :PHONE + | :POINT + | :POS_TERMINAL + | :PUBLIC_UTILITY + | :SELF_SERVICE + | :TELEVISION + | :TELLER + | :TRAVELERS_CHECK_MACHINE + | :VENDING + | :VOICE + | :UNKNOWN + + module Type + extend Lithic::Internal::Type::Enum + + ADMINISTRATIVE: :ADMINISTRATIVE + ATM: :ATM + AUTHORIZATION: :AUTHORIZATION + COUPON_MACHINE: :COUPON_MACHINE + DIAL_TERMINAL: :DIAL_TERMINAL + ECOMMERCE: :ECOMMERCE + ECR: :ECR + FUEL_MACHINE: :FUEL_MACHINE + HOME_TERMINAL: :HOME_TERMINAL + MICR: :MICR + OFF_PREMISE: :OFF_PREMISE + PAYMENT: :PAYMENT + PDA: :PDA + PHONE: :PHONE + POINT: :POINT + POS_TERMINAL: :POS_TERMINAL + PUBLIC_UTILITY: :PUBLIC_UTILITY + SELF_SERVICE: :SELF_SERVICE + TELEVISION: :TELEVISION + TELLER: :TELLER + TRAVELERS_CHECK_MACHINE: :TRAVELERS_CHECK_MACHINE + VENDING: :VENDING + VOICE: :VOICE + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::Transaction::Pos::Terminal::type_] + end + end + end + + type result = + :ACCOUNT_PAUSED + | :ACCOUNT_STATE_TRANSACTION_FAIL + | :APPROVED + | :BANK_CONNECTION_ERROR + | :BANK_NOT_VERIFIED + | :CARD_CLOSED + | :CARD_PAUSED + | :DECLINED + | :FRAUD_ADVICE + | :IGNORED_TTL_EXPIRY + | :SUSPECTED_FRAUD + | :INACTIVE_ACCOUNT + | :INCORRECT_PIN + | :INVALID_CARD_DETAILS + | :INSUFFICIENT_FUNDS + | :INSUFFICIENT_FUNDS_PRELOAD + | :INVALID_TRANSACTION + | :MERCHANT_BLACKLIST + | :ORIGINAL_NOT_FOUND + | :PREVIOUSLY_COMPLETED + | :SINGLE_USE_RECHARGED + | :SWITCH_INOPERATIVE_ADVICE + | :UNAUTHORIZED_MERCHANT + | :UNKNOWN_HOST_TIMEOUT + | :USER_TRANSACTION_LIMIT + + module Result + extend Lithic::Internal::Type::Enum + + ACCOUNT_PAUSED: :ACCOUNT_PAUSED + ACCOUNT_STATE_TRANSACTION_FAIL: :ACCOUNT_STATE_TRANSACTION_FAIL + APPROVED: :APPROVED + BANK_CONNECTION_ERROR: :BANK_CONNECTION_ERROR + BANK_NOT_VERIFIED: :BANK_NOT_VERIFIED + CARD_CLOSED: :CARD_CLOSED + CARD_PAUSED: :CARD_PAUSED + DECLINED: :DECLINED + FRAUD_ADVICE: :FRAUD_ADVICE + IGNORED_TTL_EXPIRY: :IGNORED_TTL_EXPIRY + SUSPECTED_FRAUD: :SUSPECTED_FRAUD + INACTIVE_ACCOUNT: :INACTIVE_ACCOUNT + INCORRECT_PIN: :INCORRECT_PIN + INVALID_CARD_DETAILS: :INVALID_CARD_DETAILS + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + INSUFFICIENT_FUNDS_PRELOAD: :INSUFFICIENT_FUNDS_PRELOAD + INVALID_TRANSACTION: :INVALID_TRANSACTION + MERCHANT_BLACKLIST: :MERCHANT_BLACKLIST + ORIGINAL_NOT_FOUND: :ORIGINAL_NOT_FOUND + PREVIOUSLY_COMPLETED: :PREVIOUSLY_COMPLETED + SINGLE_USE_RECHARGED: :SINGLE_USE_RECHARGED + SWITCH_INOPERATIVE_ADVICE: :SWITCH_INOPERATIVE_ADVICE + UNAUTHORIZED_MERCHANT: :UNAUTHORIZED_MERCHANT + UNKNOWN_HOST_TIMEOUT: :UNKNOWN_HOST_TIMEOUT + USER_TRANSACTION_LIMIT: :USER_TRANSACTION_LIMIT + + def self?.values: -> ::Array[Lithic::Models::Transaction::result] + end + + type service_location = + { + city: String?, + country: String?, + postal_code: String?, + state: String?, + street_address: String? + } + + class ServiceLocation < Lithic::Internal::Type::BaseModel + attr_accessor city: String? + + attr_accessor country: String? + + attr_accessor postal_code: String? + + attr_accessor state: String? + + attr_accessor street_address: String? + + def initialize: ( + city: String?, + country: String?, + postal_code: String?, + state: String?, + street_address: String? + ) -> void + + def to_hash: -> { + city: String?, + country: String?, + postal_code: String?, + state: String?, + street_address: String? + } + end + + type status = :DECLINED | :EXPIRED | :PENDING | :SETTLED | :VOIDED + + module Status + extend Lithic::Internal::Type::Enum + + DECLINED: :DECLINED + EXPIRED: :EXPIRED + PENDING: :PENDING + SETTLED: :SETTLED + VOIDED: :VOIDED + + def self?.values: -> ::Array[Lithic::Models::Transaction::status] + end + + type event = + { + token: String, + amount: Integer, + amounts: Lithic::Transaction::Event::Amounts, + created: Time, + detailed_results: ::Array[Lithic::Models::Transaction::Event::detailed_result], + effective_polarity: Lithic::Models::Transaction::Event::effective_polarity, + network_info: Lithic::Transaction::Event::NetworkInfo?, + result: Lithic::Models::Transaction::Event::result, + rule_results: ::Array[Lithic::Transaction::Event::RuleResult], + type: Lithic::Models::Transaction::Event::type_, + account_type: Lithic::Models::Transaction::Event::account_type, + network_specific_data: Lithic::Transaction::Event::NetworkSpecificData? + } + + class Event < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor amount: Integer + + attr_accessor amounts: Lithic::Transaction::Event::Amounts + + attr_accessor created: Time + + attr_accessor detailed_results: ::Array[Lithic::Models::Transaction::Event::detailed_result] + + attr_accessor effective_polarity: Lithic::Models::Transaction::Event::effective_polarity + + attr_accessor network_info: Lithic::Transaction::Event::NetworkInfo? + + attr_accessor result: Lithic::Models::Transaction::Event::result + + attr_accessor rule_results: ::Array[Lithic::Transaction::Event::RuleResult] + + attr_accessor type: Lithic::Models::Transaction::Event::type_ + + attr_reader account_type: Lithic::Models::Transaction::Event::account_type? + + def account_type=: ( + Lithic::Models::Transaction::Event::account_type + ) -> Lithic::Models::Transaction::Event::account_type + + attr_accessor network_specific_data: Lithic::Transaction::Event::NetworkSpecificData? + + def initialize: ( + token: String, + amount: Integer, + amounts: Lithic::Transaction::Event::Amounts, + created: Time, + detailed_results: ::Array[Lithic::Models::Transaction::Event::detailed_result], + effective_polarity: Lithic::Models::Transaction::Event::effective_polarity, + network_info: Lithic::Transaction::Event::NetworkInfo?, + result: Lithic::Models::Transaction::Event::result, + rule_results: ::Array[Lithic::Transaction::Event::RuleResult], + type: Lithic::Models::Transaction::Event::type_, + ?account_type: Lithic::Models::Transaction::Event::account_type, + ?network_specific_data: Lithic::Transaction::Event::NetworkSpecificData? + ) -> void + + def to_hash: -> { + token: String, + amount: Integer, + amounts: Lithic::Transaction::Event::Amounts, + created: Time, + detailed_results: ::Array[Lithic::Models::Transaction::Event::detailed_result], + effective_polarity: Lithic::Models::Transaction::Event::effective_polarity, + network_info: Lithic::Transaction::Event::NetworkInfo?, + result: Lithic::Models::Transaction::Event::result, + rule_results: ::Array[Lithic::Transaction::Event::RuleResult], + type: Lithic::Models::Transaction::Event::type_, + account_type: Lithic::Models::Transaction::Event::account_type, + network_specific_data: Lithic::Transaction::Event::NetworkSpecificData? + } + + type amounts = + { + cardholder: Lithic::Transaction::Event::Amounts::Cardholder, + merchant: Lithic::Transaction::Event::Amounts::Merchant, + settlement: Lithic::Transaction::Event::Amounts::Settlement? + } + + class Amounts < Lithic::Internal::Type::BaseModel + attr_accessor cardholder: Lithic::Transaction::Event::Amounts::Cardholder + + attr_accessor merchant: Lithic::Transaction::Event::Amounts::Merchant + + attr_accessor settlement: Lithic::Transaction::Event::Amounts::Settlement? + + def initialize: ( + cardholder: Lithic::Transaction::Event::Amounts::Cardholder, + merchant: Lithic::Transaction::Event::Amounts::Merchant, + settlement: Lithic::Transaction::Event::Amounts::Settlement? + ) -> void + + def to_hash: -> { + cardholder: Lithic::Transaction::Event::Amounts::Cardholder, + merchant: Lithic::Transaction::Event::Amounts::Merchant, + settlement: Lithic::Transaction::Event::Amounts::Settlement? + } + + type cardholder = + { amount: Integer, conversion_rate: String, currency: String } + + class Cardholder < Lithic::Internal::Type::BaseModel + attr_accessor amount: Integer + + attr_accessor conversion_rate: String + + attr_accessor currency: String + + def initialize: ( + amount: Integer, + conversion_rate: String, + currency: String + ) -> void + + def to_hash: -> { + amount: Integer, + conversion_rate: String, + currency: String + } + end + + type merchant = { amount: Integer, currency: String } + + class Merchant < Lithic::Internal::Type::BaseModel + attr_accessor amount: Integer + + attr_accessor currency: String + + def initialize: (amount: Integer, currency: String) -> void + + def to_hash: -> { amount: Integer, currency: String } + end + + type settlement = + { amount: Integer, conversion_rate: String, currency: String } + + class Settlement < Lithic::Internal::Type::BaseModel + attr_accessor amount: Integer + + attr_accessor conversion_rate: String + + attr_accessor currency: String + + def initialize: ( + amount: Integer, + conversion_rate: String, + currency: String + ) -> void + + def to_hash: -> { + amount: Integer, + conversion_rate: String, + currency: String + } + end + end + + type detailed_result = + :ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED + | :ACCOUNT_DELINQUENT + | :ACCOUNT_INACTIVE + | :ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED + | :ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED + | :ACCOUNT_PAUSED + | :ACCOUNT_UNDER_REVIEW + | :ADDRESS_INCORRECT + | :APPROVED + | :AUTH_RULE_ALLOWED_COUNTRY + | :AUTH_RULE_ALLOWED_MCC + | :AUTH_RULE_BLOCKED_COUNTRY + | :AUTH_RULE_BLOCKED_MCC + | :AUTH_RULE + | :CARD_CLOSED + | :CARD_CRYPTOGRAM_VALIDATION_FAILURE + | :CARD_EXPIRED + | :CARD_EXPIRY_DATE_INCORRECT + | :CARD_INVALID + | :CARD_NOT_ACTIVATED + | :CARD_PAUSED + | :CARD_PIN_INCORRECT + | :CARD_RESTRICTED + | :CARD_SECURITY_CODE_INCORRECT + | :CARD_SPEND_LIMIT_EXCEEDED + | :CONTACT_CARD_ISSUER + | :CUSTOMER_ASA_TIMEOUT + | :CUSTOM_ASA_RESULT + | :DECLINED + | :DO_NOT_HONOR + | :DRIVER_NUMBER_INVALID + | :FORMAT_ERROR + | :INSUFFICIENT_FUNDING_SOURCE_BALANCE + | :INSUFFICIENT_FUNDS + | :LITHIC_SYSTEM_ERROR + | :LITHIC_SYSTEM_RATE_LIMIT + | :MALFORMED_ASA_RESPONSE + | :MERCHANT_INVALID + | :MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE + | :MERCHANT_NOT_PERMITTED + | :OVER_REVERSAL_ATTEMPTED + | :PIN_BLOCKED + | :PROGRAM_CARD_SPEND_LIMIT_EXCEEDED + | :PROGRAM_SUSPENDED + | :PROGRAM_USAGE_RESTRICTION + | :REVERSAL_UNMATCHED + | :SECURITY_VIOLATION + | :SINGLE_USE_CARD_REATTEMPTED + | :SUSPECTED_FRAUD + | :TRANSACTION_INVALID + | :TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL + | :TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER + | :TRANSACTION_PREVIOUSLY_COMPLETED + | :UNAUTHORIZED_MERCHANT + | :VEHICLE_NUMBER_INVALID + | :CARDHOLDER_CHALLENGED + | :CARDHOLDER_CHALLENGE_FAILED + + module DetailedResult + extend Lithic::Internal::Type::Enum + + ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED: :ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED + ACCOUNT_DELINQUENT: :ACCOUNT_DELINQUENT + ACCOUNT_INACTIVE: :ACCOUNT_INACTIVE + ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED: :ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED + ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED: :ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED + ACCOUNT_PAUSED: :ACCOUNT_PAUSED + ACCOUNT_UNDER_REVIEW: :ACCOUNT_UNDER_REVIEW + ADDRESS_INCORRECT: :ADDRESS_INCORRECT + APPROVED: :APPROVED + AUTH_RULE_ALLOWED_COUNTRY: :AUTH_RULE_ALLOWED_COUNTRY + AUTH_RULE_ALLOWED_MCC: :AUTH_RULE_ALLOWED_MCC + AUTH_RULE_BLOCKED_COUNTRY: :AUTH_RULE_BLOCKED_COUNTRY + AUTH_RULE_BLOCKED_MCC: :AUTH_RULE_BLOCKED_MCC + AUTH_RULE: :AUTH_RULE + CARD_CLOSED: :CARD_CLOSED + CARD_CRYPTOGRAM_VALIDATION_FAILURE: :CARD_CRYPTOGRAM_VALIDATION_FAILURE + CARD_EXPIRED: :CARD_EXPIRED + CARD_EXPIRY_DATE_INCORRECT: :CARD_EXPIRY_DATE_INCORRECT + CARD_INVALID: :CARD_INVALID + CARD_NOT_ACTIVATED: :CARD_NOT_ACTIVATED + CARD_PAUSED: :CARD_PAUSED + CARD_PIN_INCORRECT: :CARD_PIN_INCORRECT + CARD_RESTRICTED: :CARD_RESTRICTED + CARD_SECURITY_CODE_INCORRECT: :CARD_SECURITY_CODE_INCORRECT + CARD_SPEND_LIMIT_EXCEEDED: :CARD_SPEND_LIMIT_EXCEEDED + CONTACT_CARD_ISSUER: :CONTACT_CARD_ISSUER + CUSTOMER_ASA_TIMEOUT: :CUSTOMER_ASA_TIMEOUT + CUSTOM_ASA_RESULT: :CUSTOM_ASA_RESULT + DECLINED: :DECLINED + DO_NOT_HONOR: :DO_NOT_HONOR + DRIVER_NUMBER_INVALID: :DRIVER_NUMBER_INVALID + FORMAT_ERROR: :FORMAT_ERROR + INSUFFICIENT_FUNDING_SOURCE_BALANCE: :INSUFFICIENT_FUNDING_SOURCE_BALANCE + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + LITHIC_SYSTEM_ERROR: :LITHIC_SYSTEM_ERROR + LITHIC_SYSTEM_RATE_LIMIT: :LITHIC_SYSTEM_RATE_LIMIT + MALFORMED_ASA_RESPONSE: :MALFORMED_ASA_RESPONSE + MERCHANT_INVALID: :MERCHANT_INVALID + MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE: :MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE + MERCHANT_NOT_PERMITTED: :MERCHANT_NOT_PERMITTED + OVER_REVERSAL_ATTEMPTED: :OVER_REVERSAL_ATTEMPTED + PIN_BLOCKED: :PIN_BLOCKED + PROGRAM_CARD_SPEND_LIMIT_EXCEEDED: :PROGRAM_CARD_SPEND_LIMIT_EXCEEDED + PROGRAM_SUSPENDED: :PROGRAM_SUSPENDED + PROGRAM_USAGE_RESTRICTION: :PROGRAM_USAGE_RESTRICTION + REVERSAL_UNMATCHED: :REVERSAL_UNMATCHED + SECURITY_VIOLATION: :SECURITY_VIOLATION + SINGLE_USE_CARD_REATTEMPTED: :SINGLE_USE_CARD_REATTEMPTED + SUSPECTED_FRAUD: :SUSPECTED_FRAUD + TRANSACTION_INVALID: :TRANSACTION_INVALID + TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL: :TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL + TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER: :TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER + TRANSACTION_PREVIOUSLY_COMPLETED: :TRANSACTION_PREVIOUSLY_COMPLETED + UNAUTHORIZED_MERCHANT: :UNAUTHORIZED_MERCHANT + VEHICLE_NUMBER_INVALID: :VEHICLE_NUMBER_INVALID + CARDHOLDER_CHALLENGED: :CARDHOLDER_CHALLENGED + CARDHOLDER_CHALLENGE_FAILED: :CARDHOLDER_CHALLENGE_FAILED + + def self?.values: -> ::Array[Lithic::Models::Transaction::Event::detailed_result] + end + + type effective_polarity = :CREDIT | :DEBIT + + module EffectivePolarity + extend Lithic::Internal::Type::Enum + + CREDIT: :CREDIT + DEBIT: :DEBIT + + def self?.values: -> ::Array[Lithic::Models::Transaction::Event::effective_polarity] + end + + type network_info = + { + acquirer: Lithic::Transaction::Event::NetworkInfo::Acquirer?, + amex: Lithic::Transaction::Event::NetworkInfo::Amex?, + mastercard: Lithic::Transaction::Event::NetworkInfo::Mastercard?, + visa: Lithic::Transaction::Event::NetworkInfo::Visa? + } + + class NetworkInfo < Lithic::Internal::Type::BaseModel + attr_accessor acquirer: Lithic::Transaction::Event::NetworkInfo::Acquirer? + + attr_accessor amex: Lithic::Transaction::Event::NetworkInfo::Amex? + + attr_accessor mastercard: Lithic::Transaction::Event::NetworkInfo::Mastercard? + + attr_accessor visa: Lithic::Transaction::Event::NetworkInfo::Visa? + + def initialize: ( + acquirer: Lithic::Transaction::Event::NetworkInfo::Acquirer?, + amex: Lithic::Transaction::Event::NetworkInfo::Amex?, + mastercard: Lithic::Transaction::Event::NetworkInfo::Mastercard?, + visa: Lithic::Transaction::Event::NetworkInfo::Visa? + ) -> void + + def to_hash: -> { + acquirer: Lithic::Transaction::Event::NetworkInfo::Acquirer?, + amex: Lithic::Transaction::Event::NetworkInfo::Amex?, + mastercard: Lithic::Transaction::Event::NetworkInfo::Mastercard?, + visa: Lithic::Transaction::Event::NetworkInfo::Visa? + } + + type acquirer = + { + acquirer_reference_number: String?, + retrieval_reference_number: String? + } + + class Acquirer < Lithic::Internal::Type::BaseModel + attr_accessor acquirer_reference_number: String? + + attr_accessor retrieval_reference_number: String? + + def initialize: ( + acquirer_reference_number: String?, + retrieval_reference_number: String? + ) -> void + + def to_hash: -> { + acquirer_reference_number: String?, + retrieval_reference_number: String? + } + end + + type amex = + { original_transaction_id: String?, transaction_id: String? } + + class Amex < Lithic::Internal::Type::BaseModel + attr_accessor original_transaction_id: String? + + attr_accessor transaction_id: String? + + def initialize: ( + original_transaction_id: String?, + transaction_id: String? + ) -> void + + def to_hash: -> { + original_transaction_id: String?, + transaction_id: String? + } + end + + type mastercard = + { + banknet_reference_number: String?, + original_banknet_reference_number: String?, + original_switch_serial_number: String?, + switch_serial_number: String? + } + + class Mastercard < Lithic::Internal::Type::BaseModel + attr_accessor banknet_reference_number: String? + + attr_accessor original_banknet_reference_number: String? + + attr_accessor original_switch_serial_number: String? + + attr_accessor switch_serial_number: String? + + def initialize: ( + banknet_reference_number: String?, + original_banknet_reference_number: String?, + original_switch_serial_number: String?, + switch_serial_number: String? + ) -> void + + def to_hash: -> { + banknet_reference_number: String?, + original_banknet_reference_number: String?, + original_switch_serial_number: String?, + switch_serial_number: String? + } + end + + type visa = + { original_transaction_id: String?, transaction_id: String? } + + class Visa < Lithic::Internal::Type::BaseModel + attr_accessor original_transaction_id: String? + + attr_accessor transaction_id: String? + + def initialize: ( + original_transaction_id: String?, + transaction_id: String? + ) -> void + + def to_hash: -> { + original_transaction_id: String?, + transaction_id: String? + } + end + end + + type result = + :ACCOUNT_PAUSED + | :ACCOUNT_STATE_TRANSACTION_FAIL + | :APPROVED + | :BANK_CONNECTION_ERROR + | :BANK_NOT_VERIFIED + | :CARD_CLOSED + | :CARD_PAUSED + | :DECLINED + | :FRAUD_ADVICE + | :IGNORED_TTL_EXPIRY + | :SUSPECTED_FRAUD + | :INACTIVE_ACCOUNT + | :INCORRECT_PIN + | :INVALID_CARD_DETAILS + | :INSUFFICIENT_FUNDS + | :INSUFFICIENT_FUNDS_PRELOAD + | :INVALID_TRANSACTION + | :MERCHANT_BLACKLIST + | :ORIGINAL_NOT_FOUND + | :PREVIOUSLY_COMPLETED + | :SINGLE_USE_RECHARGED + | :SWITCH_INOPERATIVE_ADVICE + | :UNAUTHORIZED_MERCHANT + | :UNKNOWN_HOST_TIMEOUT + | :USER_TRANSACTION_LIMIT + + module Result + extend Lithic::Internal::Type::Enum + + ACCOUNT_PAUSED: :ACCOUNT_PAUSED + ACCOUNT_STATE_TRANSACTION_FAIL: :ACCOUNT_STATE_TRANSACTION_FAIL + APPROVED: :APPROVED + BANK_CONNECTION_ERROR: :BANK_CONNECTION_ERROR + BANK_NOT_VERIFIED: :BANK_NOT_VERIFIED + CARD_CLOSED: :CARD_CLOSED + CARD_PAUSED: :CARD_PAUSED + DECLINED: :DECLINED + FRAUD_ADVICE: :FRAUD_ADVICE + IGNORED_TTL_EXPIRY: :IGNORED_TTL_EXPIRY + SUSPECTED_FRAUD: :SUSPECTED_FRAUD + INACTIVE_ACCOUNT: :INACTIVE_ACCOUNT + INCORRECT_PIN: :INCORRECT_PIN + INVALID_CARD_DETAILS: :INVALID_CARD_DETAILS + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + INSUFFICIENT_FUNDS_PRELOAD: :INSUFFICIENT_FUNDS_PRELOAD + INVALID_TRANSACTION: :INVALID_TRANSACTION + MERCHANT_BLACKLIST: :MERCHANT_BLACKLIST + ORIGINAL_NOT_FOUND: :ORIGINAL_NOT_FOUND + PREVIOUSLY_COMPLETED: :PREVIOUSLY_COMPLETED + SINGLE_USE_RECHARGED: :SINGLE_USE_RECHARGED + SWITCH_INOPERATIVE_ADVICE: :SWITCH_INOPERATIVE_ADVICE + UNAUTHORIZED_MERCHANT: :UNAUTHORIZED_MERCHANT + UNKNOWN_HOST_TIMEOUT: :UNKNOWN_HOST_TIMEOUT + USER_TRANSACTION_LIMIT: :USER_TRANSACTION_LIMIT + + def self?.values: -> ::Array[Lithic::Models::Transaction::Event::result] + end + + type rule_result = + { + auth_rule_token: String?, + explanation: String?, + name: String?, + result: Lithic::Models::Transaction::Event::RuleResult::result + } + + class RuleResult < Lithic::Internal::Type::BaseModel + attr_accessor auth_rule_token: String? + + attr_accessor explanation: String? + + attr_accessor name: String? + + attr_accessor result: Lithic::Models::Transaction::Event::RuleResult::result + + def initialize: ( + auth_rule_token: String?, + explanation: String?, + name: String?, + result: Lithic::Models::Transaction::Event::RuleResult::result + ) -> void + + def to_hash: -> { + auth_rule_token: String?, + explanation: String?, + name: String?, + result: Lithic::Models::Transaction::Event::RuleResult::result + } + + type result = + :ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED + | :ACCOUNT_DELINQUENT + | :ACCOUNT_INACTIVE + | :ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED + | :ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED + | :ACCOUNT_PAUSED + | :ACCOUNT_UNDER_REVIEW + | :ADDRESS_INCORRECT + | :APPROVED + | :AUTH_RULE_ALLOWED_COUNTRY + | :AUTH_RULE_ALLOWED_MCC + | :AUTH_RULE_BLOCKED_COUNTRY + | :AUTH_RULE_BLOCKED_MCC + | :AUTH_RULE + | :CARD_CLOSED + | :CARD_CRYPTOGRAM_VALIDATION_FAILURE + | :CARD_EXPIRED + | :CARD_EXPIRY_DATE_INCORRECT + | :CARD_INVALID + | :CARD_NOT_ACTIVATED + | :CARD_PAUSED + | :CARD_PIN_INCORRECT + | :CARD_RESTRICTED + | :CARD_SECURITY_CODE_INCORRECT + | :CARD_SPEND_LIMIT_EXCEEDED + | :CONTACT_CARD_ISSUER + | :CUSTOMER_ASA_TIMEOUT + | :CUSTOM_ASA_RESULT + | :DECLINED + | :DO_NOT_HONOR + | :DRIVER_NUMBER_INVALID + | :FORMAT_ERROR + | :INSUFFICIENT_FUNDING_SOURCE_BALANCE + | :INSUFFICIENT_FUNDS + | :LITHIC_SYSTEM_ERROR + | :LITHIC_SYSTEM_RATE_LIMIT + | :MALFORMED_ASA_RESPONSE + | :MERCHANT_INVALID + | :MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE + | :MERCHANT_NOT_PERMITTED + | :OVER_REVERSAL_ATTEMPTED + | :PIN_BLOCKED + | :PROGRAM_CARD_SPEND_LIMIT_EXCEEDED + | :PROGRAM_SUSPENDED + | :PROGRAM_USAGE_RESTRICTION + | :REVERSAL_UNMATCHED + | :SECURITY_VIOLATION + | :SINGLE_USE_CARD_REATTEMPTED + | :SUSPECTED_FRAUD + | :TRANSACTION_INVALID + | :TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL + | :TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER + | :TRANSACTION_PREVIOUSLY_COMPLETED + | :UNAUTHORIZED_MERCHANT + | :VEHICLE_NUMBER_INVALID + | :CARDHOLDER_CHALLENGED + | :CARDHOLDER_CHALLENGE_FAILED + + module Result + extend Lithic::Internal::Type::Enum + + ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED: :ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED + ACCOUNT_DELINQUENT: :ACCOUNT_DELINQUENT + ACCOUNT_INACTIVE: :ACCOUNT_INACTIVE + ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED: :ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED + ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED: :ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED + ACCOUNT_PAUSED: :ACCOUNT_PAUSED + ACCOUNT_UNDER_REVIEW: :ACCOUNT_UNDER_REVIEW + ADDRESS_INCORRECT: :ADDRESS_INCORRECT + APPROVED: :APPROVED + AUTH_RULE_ALLOWED_COUNTRY: :AUTH_RULE_ALLOWED_COUNTRY + AUTH_RULE_ALLOWED_MCC: :AUTH_RULE_ALLOWED_MCC + AUTH_RULE_BLOCKED_COUNTRY: :AUTH_RULE_BLOCKED_COUNTRY + AUTH_RULE_BLOCKED_MCC: :AUTH_RULE_BLOCKED_MCC + AUTH_RULE: :AUTH_RULE + CARD_CLOSED: :CARD_CLOSED + CARD_CRYPTOGRAM_VALIDATION_FAILURE: :CARD_CRYPTOGRAM_VALIDATION_FAILURE + CARD_EXPIRED: :CARD_EXPIRED + CARD_EXPIRY_DATE_INCORRECT: :CARD_EXPIRY_DATE_INCORRECT + CARD_INVALID: :CARD_INVALID + CARD_NOT_ACTIVATED: :CARD_NOT_ACTIVATED + CARD_PAUSED: :CARD_PAUSED + CARD_PIN_INCORRECT: :CARD_PIN_INCORRECT + CARD_RESTRICTED: :CARD_RESTRICTED + CARD_SECURITY_CODE_INCORRECT: :CARD_SECURITY_CODE_INCORRECT + CARD_SPEND_LIMIT_EXCEEDED: :CARD_SPEND_LIMIT_EXCEEDED + CONTACT_CARD_ISSUER: :CONTACT_CARD_ISSUER + CUSTOMER_ASA_TIMEOUT: :CUSTOMER_ASA_TIMEOUT + CUSTOM_ASA_RESULT: :CUSTOM_ASA_RESULT + DECLINED: :DECLINED + DO_NOT_HONOR: :DO_NOT_HONOR + DRIVER_NUMBER_INVALID: :DRIVER_NUMBER_INVALID + FORMAT_ERROR: :FORMAT_ERROR + INSUFFICIENT_FUNDING_SOURCE_BALANCE: :INSUFFICIENT_FUNDING_SOURCE_BALANCE + INSUFFICIENT_FUNDS: :INSUFFICIENT_FUNDS + LITHIC_SYSTEM_ERROR: :LITHIC_SYSTEM_ERROR + LITHIC_SYSTEM_RATE_LIMIT: :LITHIC_SYSTEM_RATE_LIMIT + MALFORMED_ASA_RESPONSE: :MALFORMED_ASA_RESPONSE + MERCHANT_INVALID: :MERCHANT_INVALID + MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE: :MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE + MERCHANT_NOT_PERMITTED: :MERCHANT_NOT_PERMITTED + OVER_REVERSAL_ATTEMPTED: :OVER_REVERSAL_ATTEMPTED + PIN_BLOCKED: :PIN_BLOCKED + PROGRAM_CARD_SPEND_LIMIT_EXCEEDED: :PROGRAM_CARD_SPEND_LIMIT_EXCEEDED + PROGRAM_SUSPENDED: :PROGRAM_SUSPENDED + PROGRAM_USAGE_RESTRICTION: :PROGRAM_USAGE_RESTRICTION + REVERSAL_UNMATCHED: :REVERSAL_UNMATCHED + SECURITY_VIOLATION: :SECURITY_VIOLATION + SINGLE_USE_CARD_REATTEMPTED: :SINGLE_USE_CARD_REATTEMPTED + SUSPECTED_FRAUD: :SUSPECTED_FRAUD + TRANSACTION_INVALID: :TRANSACTION_INVALID + TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL: :TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL + TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER: :TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER + TRANSACTION_PREVIOUSLY_COMPLETED: :TRANSACTION_PREVIOUSLY_COMPLETED + UNAUTHORIZED_MERCHANT: :UNAUTHORIZED_MERCHANT + VEHICLE_NUMBER_INVALID: :VEHICLE_NUMBER_INVALID + CARDHOLDER_CHALLENGED: :CARDHOLDER_CHALLENGED + CARDHOLDER_CHALLENGE_FAILED: :CARDHOLDER_CHALLENGE_FAILED + + def self?.values: -> ::Array[Lithic::Models::Transaction::Event::RuleResult::result] + end + end + + type type_ = + :AUTHORIZATION + | :AUTHORIZATION_ADVICE + | :AUTHORIZATION_EXPIRY + | :AUTHORIZATION_REVERSAL + | :BALANCE_INQUIRY + | :CLEARING + | :CORRECTION_CREDIT + | :CORRECTION_DEBIT + | :CREDIT_AUTHORIZATION + | :CREDIT_AUTHORIZATION_ADVICE + | :FINANCIAL_AUTHORIZATION + | :FINANCIAL_CREDIT_AUTHORIZATION + | :RETURN + | :RETURN_REVERSAL + + module Type + extend Lithic::Internal::Type::Enum + + AUTHORIZATION: :AUTHORIZATION + AUTHORIZATION_ADVICE: :AUTHORIZATION_ADVICE + AUTHORIZATION_EXPIRY: :AUTHORIZATION_EXPIRY + AUTHORIZATION_REVERSAL: :AUTHORIZATION_REVERSAL + BALANCE_INQUIRY: :BALANCE_INQUIRY + CLEARING: :CLEARING + CORRECTION_CREDIT: :CORRECTION_CREDIT + CORRECTION_DEBIT: :CORRECTION_DEBIT + CREDIT_AUTHORIZATION: :CREDIT_AUTHORIZATION + CREDIT_AUTHORIZATION_ADVICE: :CREDIT_AUTHORIZATION_ADVICE + FINANCIAL_AUTHORIZATION: :FINANCIAL_AUTHORIZATION + FINANCIAL_CREDIT_AUTHORIZATION: :FINANCIAL_CREDIT_AUTHORIZATION + RETURN: :RETURN + RETURN_REVERSAL: :RETURN_REVERSAL + + def self?.values: -> ::Array[Lithic::Models::Transaction::Event::type_] + end + + type account_type = :CHECKING | :SAVINGS + + module AccountType + extend Lithic::Internal::Type::Enum + + CHECKING: :CHECKING + SAVINGS: :SAVINGS + + def self?.values: -> ::Array[Lithic::Models::Transaction::Event::account_type] + end + + type network_specific_data = + { + mastercard: Lithic::Transaction::Event::NetworkSpecificData::Mastercard, + visa: Lithic::Transaction::Event::NetworkSpecificData::Visa + } + + class NetworkSpecificData < Lithic::Internal::Type::BaseModel + attr_accessor mastercard: Lithic::Transaction::Event::NetworkSpecificData::Mastercard + + attr_accessor visa: Lithic::Transaction::Event::NetworkSpecificData::Visa + + def initialize: ( + mastercard: Lithic::Transaction::Event::NetworkSpecificData::Mastercard, + visa: Lithic::Transaction::Event::NetworkSpecificData::Visa + ) -> void + + def to_hash: -> { + mastercard: Lithic::Transaction::Event::NetworkSpecificData::Mastercard, + visa: Lithic::Transaction::Event::NetworkSpecificData::Visa + } + + type mastercard = + { + ecommerce_security_level_indicator: String?, + on_behalf_service_result: ::Array[Lithic::Transaction::Event::NetworkSpecificData::Mastercard::OnBehalfServiceResult]?, + transaction_type_identifier: String? + } + + class Mastercard < Lithic::Internal::Type::BaseModel + attr_accessor ecommerce_security_level_indicator: String? + + attr_accessor on_behalf_service_result: ::Array[Lithic::Transaction::Event::NetworkSpecificData::Mastercard::OnBehalfServiceResult]? + + attr_accessor transaction_type_identifier: String? + + def initialize: ( + ecommerce_security_level_indicator: String?, + on_behalf_service_result: ::Array[Lithic::Transaction::Event::NetworkSpecificData::Mastercard::OnBehalfServiceResult]?, + transaction_type_identifier: String? + ) -> void + + def to_hash: -> { + ecommerce_security_level_indicator: String?, + on_behalf_service_result: ::Array[Lithic::Transaction::Event::NetworkSpecificData::Mastercard::OnBehalfServiceResult]?, + transaction_type_identifier: String? + } + + type on_behalf_service_result = + { :result_1 => String, :result_2 => String, service: String } + + class OnBehalfServiceResult < Lithic::Internal::Type::BaseModel + attr_accessor result_1: String + + attr_accessor result_2: String + + attr_accessor service: String + + def initialize: ( + result_1: String, + result_2: String, + service: String + ) -> void + + def to_hash: -> { + :result_1 => String, + :result_2 => String, + service: String + } + end + end + + type visa = { business_application_identifier: String? } + + class Visa < Lithic::Internal::Type::BaseModel + attr_accessor business_application_identifier: String? + + def initialize: (business_application_identifier: String?) -> void + + def to_hash: -> { business_application_identifier: String? } + end + end + end + end + end +end diff --git a/sig/lithic/models/transaction_expire_authorization_params.rbs b/sig/lithic/models/transaction_expire_authorization_params.rbs new file mode 100644 index 00000000..75b593b4 --- /dev/null +++ b/sig/lithic/models/transaction_expire_authorization_params.rbs @@ -0,0 +1,23 @@ +module Lithic + module Models + type transaction_expire_authorization_params = + { transaction_token: String } & Lithic::Internal::Type::request_parameters + + class TransactionExpireAuthorizationParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor transaction_token: String + + def initialize: ( + transaction_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + transaction_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/transaction_list_params.rbs b/sig/lithic/models/transaction_list_params.rbs new file mode 100644 index 00000000..0b6feccb --- /dev/null +++ b/sig/lithic/models/transaction_list_params.rbs @@ -0,0 +1,113 @@ +module Lithic + module Models + type transaction_list_params = + { + account_token: String, + begin_: Time, + card_token: String, + end_: Time, + ending_before: String, + page_size: Integer, + result: Lithic::Models::TransactionListParams::result, + starting_after: String, + status: Lithic::Models::TransactionListParams::status + } + & Lithic::Internal::Type::request_parameters + + class TransactionListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader card_token: String? + + def card_token=: (String) -> String + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader result: Lithic::Models::TransactionListParams::result? + + def result=: ( + Lithic::Models::TransactionListParams::result + ) -> Lithic::Models::TransactionListParams::result + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader status: Lithic::Models::TransactionListParams::status? + + def status=: ( + Lithic::Models::TransactionListParams::status + ) -> Lithic::Models::TransactionListParams::status + + def initialize: ( + ?account_token: String, + ?begin_: Time, + ?card_token: String, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?result: Lithic::Models::TransactionListParams::result, + ?starting_after: String, + ?status: Lithic::Models::TransactionListParams::status, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + account_token: String, + begin_: Time, + card_token: String, + end_: Time, + ending_before: String, + page_size: Integer, + result: Lithic::Models::TransactionListParams::result, + starting_after: String, + status: Lithic::Models::TransactionListParams::status, + request_options: Lithic::RequestOptions + } + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::TransactionListParams::result] + end + + type status = :PENDING | :VOIDED | :SETTLED | :DECLINED | :EXPIRED + + module Status + extend Lithic::Internal::Type::Enum + + PENDING: :PENDING + VOIDED: :VOIDED + SETTLED: :SETTLED + DECLINED: :DECLINED + EXPIRED: :EXPIRED + + def self?.values: -> ::Array[Lithic::Models::TransactionListParams::status] + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/case_activity_entry.rbs b/sig/lithic/models/transaction_monitoring/case_activity_entry.rbs new file mode 100644 index 00000000..62e2c94f --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/case_activity_entry.rbs @@ -0,0 +1,47 @@ +module Lithic + module Models + module TransactionMonitoring + type case_activity_entry = + { + token: String, + actor_token: String?, + created: Time, + entry_type: Lithic::Models::TransactionMonitoring::case_activity_type, + new_value: String?, + previous_value: String? + } + + class CaseActivityEntry < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor actor_token: String? + + attr_accessor created: Time + + attr_accessor entry_type: Lithic::Models::TransactionMonitoring::case_activity_type + + attr_accessor new_value: String? + + attr_accessor previous_value: String? + + def initialize: ( + token: String, + actor_token: String?, + created: Time, + entry_type: Lithic::Models::TransactionMonitoring::case_activity_type, + new_value: String?, + previous_value: String? + ) -> void + + def to_hash: -> { + token: String, + actor_token: String?, + created: Time, + entry_type: Lithic::Models::TransactionMonitoring::case_activity_type, + new_value: String?, + previous_value: String? + } + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/case_activity_type.rbs b/sig/lithic/models/transaction_monitoring/case_activity_type.rbs new file mode 100644 index 00000000..a6da68a4 --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/case_activity_type.rbs @@ -0,0 +1,32 @@ +module Lithic + module Models + module TransactionMonitoring + type case_activity_type = + :STATUS + | :TITLE + | :ASSIGNED_TO + | :RESOLUTION_OUTCOME + | :RESOLUTION_NOTES + | :TAGS + | :PRIORITY + | :COMMENT + | :FILE + + module CaseActivityType + extend Lithic::Internal::Type::Enum + + STATUS: :STATUS + TITLE: :TITLE + ASSIGNED_TO: :ASSIGNED_TO + RESOLUTION_OUTCOME: :RESOLUTION_OUTCOME + RESOLUTION_NOTES: :RESOLUTION_NOTES + TAGS: :TAGS + PRIORITY: :PRIORITY + COMMENT: :COMMENT + FILE: :FILE + + def self?.values: -> ::Array[Lithic::Models::TransactionMonitoring::case_activity_type] + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/case_card.rbs b/sig/lithic/models/transaction_monitoring/case_card.rbs new file mode 100644 index 00000000..e0ddada3 --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/case_card.rbs @@ -0,0 +1,32 @@ +module Lithic + module Models + module TransactionMonitoring + type case_card = + { + account_token: String, + card_token: String, + transaction_count: Integer + } + + class CaseCard < Lithic::Internal::Type::BaseModel + attr_accessor account_token: String + + attr_accessor card_token: String + + attr_accessor transaction_count: Integer + + def initialize: ( + account_token: String, + card_token: String, + transaction_count: Integer + ) -> void + + def to_hash: -> { + account_token: String, + card_token: String, + transaction_count: Integer + } + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/case_entity.rbs b/sig/lithic/models/transaction_monitoring/case_entity.rbs new file mode 100644 index 00000000..5e13dc88 --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/case_entity.rbs @@ -0,0 +1,38 @@ +module Lithic + module Models + module TransactionMonitoring + type case_entity = + { + entity_token: String, + entity_type: Lithic::Models::TransactionMonitoring::CaseEntity::entity_type + } + + class CaseEntity < Lithic::Internal::Type::BaseModel + attr_accessor entity_token: String + + attr_accessor entity_type: Lithic::Models::TransactionMonitoring::CaseEntity::entity_type + + def initialize: ( + entity_token: String, + entity_type: Lithic::Models::TransactionMonitoring::CaseEntity::entity_type + ) -> void + + def to_hash: -> { + entity_token: String, + entity_type: Lithic::Models::TransactionMonitoring::CaseEntity::entity_type + } + + type entity_type = :CARD | :ACCOUNT + + module EntityType + extend Lithic::Internal::Type::Enum + + CARD: :CARD + ACCOUNT: :ACCOUNT + + def self?.values: -> ::Array[Lithic::Models::TransactionMonitoring::CaseEntity::entity_type] + end + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/case_list_activity_params.rbs b/sig/lithic/models/transaction_monitoring/case_list_activity_params.rbs new file mode 100644 index 00000000..edc5dc96 --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/case_list_activity_params.rbs @@ -0,0 +1,49 @@ +module Lithic + module Models + module TransactionMonitoring + type case_list_activity_params = + { + case_token: String, + ending_before: String, + page_size: Integer, + starting_after: String + } + & Lithic::Internal::Type::request_parameters + + class CaseListActivityParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor case_token: String + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + case_token: String, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + case_token: String, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/case_list_params.rbs b/sig/lithic/models/transaction_monitoring/case_list_params.rbs new file mode 100644 index 00000000..a5578dba --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/case_list_params.rbs @@ -0,0 +1,125 @@ +module Lithic + module Models + module TransactionMonitoring + type case_list_params = + { + account_token: String, + assignee: String, + begin_: Time, + card_token: String, + end_: Time, + ending_before: String, + entity_token: String, + page_size: Integer, + queue_token: String, + rule_token: String, + sort_by: Lithic::Models::TransactionMonitoring::case_sort_order, + starting_after: String, + status: Lithic::Models::TransactionMonitoring::case_status, + transaction_token: String + } + & Lithic::Internal::Type::request_parameters + + class CaseListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader account_token: String? + + def account_token=: (String) -> String + + attr_reader assignee: String? + + def assignee=: (String) -> String + + attr_reader begin_: Time? + + def begin_=: (Time) -> Time + + attr_reader card_token: String? + + def card_token=: (String) -> String + + attr_reader end_: Time? + + def end_=: (Time) -> Time + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader entity_token: String? + + def entity_token=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader queue_token: String? + + def queue_token=: (String) -> String + + attr_reader rule_token: String? + + def rule_token=: (String) -> String + + attr_reader sort_by: Lithic::Models::TransactionMonitoring::case_sort_order? + + def sort_by=: ( + Lithic::Models::TransactionMonitoring::case_sort_order + ) -> Lithic::Models::TransactionMonitoring::case_sort_order + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + attr_reader status: Lithic::Models::TransactionMonitoring::case_status? + + def status=: ( + Lithic::Models::TransactionMonitoring::case_status + ) -> Lithic::Models::TransactionMonitoring::case_status + + attr_reader transaction_token: String? + + def transaction_token=: (String) -> String + + def initialize: ( + ?account_token: String, + ?assignee: String, + ?begin_: Time, + ?card_token: String, + ?end_: Time, + ?ending_before: String, + ?entity_token: String, + ?page_size: Integer, + ?queue_token: String, + ?rule_token: String, + ?sort_by: Lithic::Models::TransactionMonitoring::case_sort_order, + ?starting_after: String, + ?status: Lithic::Models::TransactionMonitoring::case_status, + ?transaction_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + account_token: String, + assignee: String, + begin_: Time, + card_token: String, + end_: Time, + ending_before: String, + entity_token: String, + page_size: Integer, + queue_token: String, + rule_token: String, + sort_by: Lithic::Models::TransactionMonitoring::case_sort_order, + starting_after: String, + status: Lithic::Models::TransactionMonitoring::case_status, + transaction_token: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/case_list_transactions_params.rbs b/sig/lithic/models/transaction_monitoring/case_list_transactions_params.rbs new file mode 100644 index 00000000..6dc57b8f --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/case_list_transactions_params.rbs @@ -0,0 +1,49 @@ +module Lithic + module Models + module TransactionMonitoring + type case_list_transactions_params = + { + case_token: String, + ending_before: String, + page_size: Integer, + starting_after: String + } + & Lithic::Internal::Type::request_parameters + + class CaseListTransactionsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor case_token: String + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + case_token: String, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + case_token: String, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/case_priority.rbs b/sig/lithic/models/transaction_monitoring/case_priority.rbs new file mode 100644 index 00000000..c401f763 --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/case_priority.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + module TransactionMonitoring + type case_priority = :LOW | :MEDIUM | :HIGH | :CRITICAL + + module CasePriority + extend Lithic::Internal::Type::Enum + + LOW: :LOW + MEDIUM: :MEDIUM + HIGH: :HIGH + CRITICAL: :CRITICAL + + def self?.values: -> ::Array[Lithic::Models::TransactionMonitoring::case_priority] + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/case_retrieve_cards_params.rbs b/sig/lithic/models/transaction_monitoring/case_retrieve_cards_params.rbs new file mode 100644 index 00000000..82933296 --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/case_retrieve_cards_params.rbs @@ -0,0 +1,25 @@ +module Lithic + module Models + module TransactionMonitoring + type case_retrieve_cards_params = + { case_token: String } & Lithic::Internal::Type::request_parameters + + class CaseRetrieveCardsParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor case_token: String + + def initialize: ( + case_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + case_token: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/case_retrieve_cards_response.rbs b/sig/lithic/models/transaction_monitoring/case_retrieve_cards_response.rbs new file mode 100644 index 00000000..4fd043ce --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/case_retrieve_cards_response.rbs @@ -0,0 +1,10 @@ +module Lithic + module Models + module TransactionMonitoring + type case_retrieve_cards_response = + ::Array[Lithic::TransactionMonitoring::CaseCard] + + CaseRetrieveCardsResponse: Lithic::Internal::Type::Converter + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/case_retrieve_params.rbs b/sig/lithic/models/transaction_monitoring/case_retrieve_params.rbs new file mode 100644 index 00000000..4c8e445b --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/case_retrieve_params.rbs @@ -0,0 +1,25 @@ +module Lithic + module Models + module TransactionMonitoring + type case_retrieve_params = + { case_token: String } & Lithic::Internal::Type::request_parameters + + class CaseRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor case_token: String + + def initialize: ( + case_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + case_token: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/case_sort_order.rbs b/sig/lithic/models/transaction_monitoring/case_sort_order.rbs new file mode 100644 index 00000000..db95f980 --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/case_sort_order.rbs @@ -0,0 +1,26 @@ +module Lithic + module Models + module TransactionMonitoring + type case_sort_order = + :CREATED_ASC + | :CREATED_DESC + | :PRIORITY_DESC + | :PRIORITY_ASC + | :STATUS_DESC + | :STATUS_ASC + + module CaseSortOrder + extend Lithic::Internal::Type::Enum + + CREATED_ASC: :CREATED_ASC + CREATED_DESC: :CREATED_DESC + PRIORITY_DESC: :PRIORITY_DESC + PRIORITY_ASC: :PRIORITY_ASC + STATUS_DESC: :STATUS_DESC + STATUS_ASC: :STATUS_ASC + + def self?.values: -> ::Array[Lithic::Models::TransactionMonitoring::case_sort_order] + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/case_status.rbs b/sig/lithic/models/transaction_monitoring/case_status.rbs new file mode 100644 index 00000000..599772c1 --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/case_status.rbs @@ -0,0 +1,21 @@ +module Lithic + module Models + module TransactionMonitoring + type case_status = + :OPEN | :ASSIGNED | :IN_REVIEW | :ESCALATED | :RESOLVED | :CLOSED + + module CaseStatus + extend Lithic::Internal::Type::Enum + + OPEN: :OPEN + ASSIGNED: :ASSIGNED + IN_REVIEW: :IN_REVIEW + ESCALATED: :ESCALATED + RESOLVED: :RESOLVED + CLOSED: :CLOSED + + def self?.values: -> ::Array[Lithic::Models::TransactionMonitoring::case_status] + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/case_transaction.rbs b/sig/lithic/models/transaction_monitoring/case_transaction.rbs new file mode 100644 index 00000000..24d2bdb9 --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/case_transaction.rbs @@ -0,0 +1,42 @@ +module Lithic + module Models + module TransactionMonitoring + type case_transaction = + { + token: String, + account_token: String, + added_at: Time, + card_token: String, + transaction_created_at: Time + } + + class CaseTransaction < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor account_token: String + + attr_accessor added_at: Time + + attr_accessor card_token: String + + attr_accessor transaction_created_at: Time + + def initialize: ( + token: String, + account_token: String, + added_at: Time, + card_token: String, + transaction_created_at: Time + ) -> void + + def to_hash: -> { + token: String, + account_token: String, + added_at: Time, + card_token: String, + transaction_created_at: Time + } + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/case_update_params.rbs b/sig/lithic/models/transaction_monitoring/case_update_params.rbs new file mode 100644 index 00000000..715617c2 --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/case_update_params.rbs @@ -0,0 +1,91 @@ +module Lithic + module Models + module TransactionMonitoring + type case_update_params = + { + case_token: String, + actor_token: String, + assignee: String?, + priority: Lithic::Models::TransactionMonitoring::case_priority, + resolution: Lithic::Models::TransactionMonitoring::resolution_outcome, + resolution_notes: String, + sla_deadline: Time?, + status: Lithic::Models::TransactionMonitoring::case_status, + tags: ::Hash[Symbol, String], + title: String? + } + & Lithic::Internal::Type::request_parameters + + class CaseUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor case_token: String + + attr_reader actor_token: String? + + def actor_token=: (String) -> String + + attr_accessor assignee: String? + + attr_reader priority: Lithic::Models::TransactionMonitoring::case_priority? + + def priority=: ( + Lithic::Models::TransactionMonitoring::case_priority + ) -> Lithic::Models::TransactionMonitoring::case_priority + + attr_reader resolution: Lithic::Models::TransactionMonitoring::resolution_outcome? + + def resolution=: ( + Lithic::Models::TransactionMonitoring::resolution_outcome + ) -> Lithic::Models::TransactionMonitoring::resolution_outcome + + attr_reader resolution_notes: String? + + def resolution_notes=: (String) -> String + + attr_accessor sla_deadline: Time? + + attr_reader status: Lithic::Models::TransactionMonitoring::case_status? + + def status=: ( + Lithic::Models::TransactionMonitoring::case_status + ) -> Lithic::Models::TransactionMonitoring::case_status + + attr_reader tags: ::Hash[Symbol, String]? + + def tags=: (::Hash[Symbol, String]) -> ::Hash[Symbol, String] + + attr_accessor title: String? + + def initialize: ( + case_token: String, + ?actor_token: String, + ?assignee: String?, + ?priority: Lithic::Models::TransactionMonitoring::case_priority, + ?resolution: Lithic::Models::TransactionMonitoring::resolution_outcome, + ?resolution_notes: String, + ?sla_deadline: Time?, + ?status: Lithic::Models::TransactionMonitoring::case_status, + ?tags: ::Hash[Symbol, String], + ?title: String?, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + case_token: String, + actor_token: String, + assignee: String?, + priority: Lithic::Models::TransactionMonitoring::case_priority, + resolution: Lithic::Models::TransactionMonitoring::resolution_outcome, + resolution_notes: String, + sla_deadline: Time?, + status: Lithic::Models::TransactionMonitoring::case_status, + tags: ::Hash[Symbol, String], + title: String?, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/cases/case_file.rbs b/sig/lithic/models/transaction_monitoring/cases/case_file.rbs new file mode 100644 index 00000000..6a64d623 --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/cases/case_file.rbs @@ -0,0 +1,86 @@ +module Lithic + module Models + module TransactionMonitoring + class CaseFile = Cases::CaseFile + + module Cases + type case_file = + { + token: String, + created: Time, + download_url: String?, + download_url_expires: Time?, + failure_reason: String?, + mime_type: String?, + name: String, + size_bytes: Integer?, + status: Lithic::Models::TransactionMonitoring::Cases::file_status, + updated: Time, + upload_constraints: Lithic::TransactionMonitoring::Cases::UploadConstraints?, + upload_url: String?, + upload_url_expires: Time? + } + + class CaseFile < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor created: Time + + attr_accessor download_url: String? + + attr_accessor download_url_expires: Time? + + attr_accessor failure_reason: String? + + attr_accessor mime_type: String? + + attr_accessor name: String + + attr_accessor size_bytes: Integer? + + attr_accessor status: Lithic::Models::TransactionMonitoring::Cases::file_status + + attr_accessor updated: Time + + attr_accessor upload_constraints: Lithic::TransactionMonitoring::Cases::UploadConstraints? + + attr_accessor upload_url: String? + + attr_accessor upload_url_expires: Time? + + def initialize: ( + token: String, + created: Time, + download_url: String?, + download_url_expires: Time?, + failure_reason: String?, + mime_type: String?, + name: String, + size_bytes: Integer?, + status: Lithic::Models::TransactionMonitoring::Cases::file_status, + updated: Time, + upload_constraints: Lithic::TransactionMonitoring::Cases::UploadConstraints?, + upload_url: String?, + upload_url_expires: Time? + ) -> void + + def to_hash: -> { + token: String, + created: Time, + download_url: String?, + download_url_expires: Time?, + failure_reason: String?, + mime_type: String?, + name: String, + size_bytes: Integer?, + status: Lithic::Models::TransactionMonitoring::Cases::file_status, + updated: Time, + upload_constraints: Lithic::TransactionMonitoring::Cases::UploadConstraints?, + upload_url: String?, + upload_url_expires: Time? + } + end + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/cases/comment_create_params.rbs b/sig/lithic/models/transaction_monitoring/cases/comment_create_params.rbs new file mode 100644 index 00000000..313ff4cf --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/cases/comment_create_params.rbs @@ -0,0 +1,38 @@ +module Lithic + module Models + module TransactionMonitoring + module Cases + type comment_create_params = + { case_token: String, comment: String, actor_token: String } + & Lithic::Internal::Type::request_parameters + + class CommentCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor case_token: String + + attr_accessor comment: String + + attr_reader actor_token: String? + + def actor_token=: (String) -> String + + def initialize: ( + case_token: String, + comment: String, + ?actor_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + case_token: String, + comment: String, + actor_token: String, + request_options: Lithic::RequestOptions + } + end + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/cases/comment_delete_params.rbs b/sig/lithic/models/transaction_monitoring/cases/comment_delete_params.rbs new file mode 100644 index 00000000..0ee0f8c6 --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/cases/comment_delete_params.rbs @@ -0,0 +1,32 @@ +module Lithic + module Models + module TransactionMonitoring + module Cases + type comment_delete_params = + { case_token: String, comment_token: String } + & Lithic::Internal::Type::request_parameters + + class CommentDeleteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor case_token: String + + attr_accessor comment_token: String + + def initialize: ( + case_token: String, + comment_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + case_token: String, + comment_token: String, + request_options: Lithic::RequestOptions + } + end + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/cases/comment_update_params.rbs b/sig/lithic/models/transaction_monitoring/cases/comment_update_params.rbs new file mode 100644 index 00000000..d9b11d51 --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/cases/comment_update_params.rbs @@ -0,0 +1,47 @@ +module Lithic + module Models + module TransactionMonitoring + module Cases + type comment_update_params = + { + case_token: String, + comment_token: String, + comment: String, + actor_token: String + } + & Lithic::Internal::Type::request_parameters + + class CommentUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor case_token: String + + attr_accessor comment_token: String + + attr_accessor comment: String + + attr_reader actor_token: String? + + def actor_token=: (String) -> String + + def initialize: ( + case_token: String, + comment_token: String, + comment: String, + ?actor_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + case_token: String, + comment_token: String, + comment: String, + actor_token: String, + request_options: Lithic::RequestOptions + } + end + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/cases/file_create_params.rbs b/sig/lithic/models/transaction_monitoring/cases/file_create_params.rbs new file mode 100644 index 00000000..6db499a0 --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/cases/file_create_params.rbs @@ -0,0 +1,32 @@ +module Lithic + module Models + module TransactionMonitoring + module Cases + type file_create_params = + { case_token: String, name: String } + & Lithic::Internal::Type::request_parameters + + class FileCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor case_token: String + + attr_accessor name: String + + def initialize: ( + case_token: String, + name: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + case_token: String, + name: String, + request_options: Lithic::RequestOptions + } + end + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/cases/file_delete_params.rbs b/sig/lithic/models/transaction_monitoring/cases/file_delete_params.rbs new file mode 100644 index 00000000..7ea3aec6 --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/cases/file_delete_params.rbs @@ -0,0 +1,32 @@ +module Lithic + module Models + module TransactionMonitoring + module Cases + type file_delete_params = + { case_token: String, file_token: String } + & Lithic::Internal::Type::request_parameters + + class FileDeleteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor case_token: String + + attr_accessor file_token: String + + def initialize: ( + case_token: String, + file_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + case_token: String, + file_token: String, + request_options: Lithic::RequestOptions + } + end + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/cases/file_list_params.rbs b/sig/lithic/models/transaction_monitoring/cases/file_list_params.rbs new file mode 100644 index 00000000..5a9a363e --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/cases/file_list_params.rbs @@ -0,0 +1,51 @@ +module Lithic + module Models + module TransactionMonitoring + module Cases + type file_list_params = + { + case_token: String, + ending_before: String, + page_size: Integer, + starting_after: String + } + & Lithic::Internal::Type::request_parameters + + class FileListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor case_token: String + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + case_token: String, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + case_token: String, + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + end + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/cases/file_retrieve_params.rbs b/sig/lithic/models/transaction_monitoring/cases/file_retrieve_params.rbs new file mode 100644 index 00000000..7cd46373 --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/cases/file_retrieve_params.rbs @@ -0,0 +1,32 @@ +module Lithic + module Models + module TransactionMonitoring + module Cases + type file_retrieve_params = + { case_token: String, file_token: String } + & Lithic::Internal::Type::request_parameters + + class FileRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor case_token: String + + attr_accessor file_token: String + + def initialize: ( + case_token: String, + file_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + case_token: String, + file_token: String, + request_options: Lithic::RequestOptions + } + end + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/cases/file_status.rbs b/sig/lithic/models/transaction_monitoring/cases/file_status.rbs new file mode 100644 index 00000000..b167a7bf --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/cases/file_status.rbs @@ -0,0 +1,19 @@ +module Lithic + module Models + module TransactionMonitoring + module Cases + type file_status = :PENDING | :READY | :REJECTED + + module FileStatus + extend Lithic::Internal::Type::Enum + + PENDING: :PENDING + READY: :READY + REJECTED: :REJECTED + + def self?.values: -> ::Array[Lithic::Models::TransactionMonitoring::Cases::file_status] + end + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/cases/upload_constraints.rbs b/sig/lithic/models/transaction_monitoring/cases/upload_constraints.rbs new file mode 100644 index 00000000..437f6a08 --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/cases/upload_constraints.rbs @@ -0,0 +1,26 @@ +module Lithic + module Models + module TransactionMonitoring + module Cases + type upload_constraints = + { accepted_mime_types: ::Array[String], max_size_bytes: Integer } + + class UploadConstraints < Lithic::Internal::Type::BaseModel + attr_accessor accepted_mime_types: ::Array[String] + + attr_accessor max_size_bytes: Integer + + def initialize: ( + accepted_mime_types: ::Array[String], + max_size_bytes: Integer + ) -> void + + def to_hash: -> { + accepted_mime_types: ::Array[String], + max_size_bytes: Integer + } + end + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/entity_type.rbs b/sig/lithic/models/transaction_monitoring/entity_type.rbs new file mode 100644 index 00000000..1d33e8e4 --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/entity_type.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + module TransactionMonitoring + type entity_type = :BENEFICIAL_OWNER_INDIVIDUAL | :CONTROL_PERSON + + module EntityType + extend Lithic::Internal::Type::Enum + + BENEFICIAL_OWNER_INDIVIDUAL: :BENEFICIAL_OWNER_INDIVIDUAL + CONTROL_PERSON: :CONTROL_PERSON + + def self?.values: -> ::Array[Lithic::Models::TransactionMonitoring::entity_type] + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/monitoring_case.rbs b/sig/lithic/models/transaction_monitoring/monitoring_case.rbs new file mode 100644 index 00000000..91a5a3d6 --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/monitoring_case.rbs @@ -0,0 +1,102 @@ +module Lithic + module Models + module TransactionMonitoring + type monitoring_case = + { + token: String, + assignee: String?, + collection_stopped: Time?, + created: Time, + entity: Lithic::TransactionMonitoring::CaseEntity?, + pending_transactions: bool, + priority: Lithic::Models::TransactionMonitoring::case_priority, + queue_token: String, + resolution: Lithic::Models::TransactionMonitoring::resolution_outcome?, + resolution_notes: String?, + resolved: Time?, + rule_token: String?, + sla_deadline: Time?, + status: Lithic::Models::TransactionMonitoring::case_status, + tags: ::Hash[Symbol, String], + title: String?, + updated: Time + } + + class MonitoringCase < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor assignee: String? + + attr_accessor collection_stopped: Time? + + attr_accessor created: Time + + attr_accessor entity: Lithic::TransactionMonitoring::CaseEntity? + + attr_accessor pending_transactions: bool + + attr_accessor priority: Lithic::Models::TransactionMonitoring::case_priority + + attr_accessor queue_token: String + + attr_accessor resolution: Lithic::Models::TransactionMonitoring::resolution_outcome? + + attr_accessor resolution_notes: String? + + attr_accessor resolved: Time? + + attr_accessor rule_token: String? + + attr_accessor sla_deadline: Time? + + attr_accessor status: Lithic::Models::TransactionMonitoring::case_status + + attr_accessor tags: ::Hash[Symbol, String] + + attr_accessor title: String? + + attr_accessor updated: Time + + def initialize: ( + token: String, + assignee: String?, + collection_stopped: Time?, + created: Time, + entity: Lithic::TransactionMonitoring::CaseEntity?, + pending_transactions: bool, + priority: Lithic::Models::TransactionMonitoring::case_priority, + queue_token: String, + resolution: Lithic::Models::TransactionMonitoring::resolution_outcome?, + resolution_notes: String?, + resolved: Time?, + rule_token: String?, + sla_deadline: Time?, + status: Lithic::Models::TransactionMonitoring::case_status, + tags: ::Hash[Symbol, String], + title: String?, + updated: Time + ) -> void + + def to_hash: -> { + token: String, + assignee: String?, + collection_stopped: Time?, + created: Time, + entity: Lithic::TransactionMonitoring::CaseEntity?, + pending_transactions: bool, + priority: Lithic::Models::TransactionMonitoring::case_priority, + queue_token: String, + resolution: Lithic::Models::TransactionMonitoring::resolution_outcome?, + resolution_notes: String?, + resolved: Time?, + rule_token: String?, + sla_deadline: Time?, + status: Lithic::Models::TransactionMonitoring::case_status, + tags: ::Hash[Symbol, String], + title: String?, + updated: Time + } + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/queue.rbs b/sig/lithic/models/transaction_monitoring/queue.rbs new file mode 100644 index 00000000..6d90ac75 --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/queue.rbs @@ -0,0 +1,101 @@ +module Lithic + module Models + module TransactionMonitoring + type queue = + { + token: String, + case_counts: Lithic::TransactionMonitoring::Queue::CaseCounts, + created: Time, + description: String?, + name: String, + updated: Time + } + + class Queue < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor case_counts: Lithic::TransactionMonitoring::Queue::CaseCounts + + attr_accessor created: Time + + attr_accessor description: String? + + attr_accessor name: String + + attr_accessor updated: Time + + def initialize: ( + token: String, + case_counts: Lithic::TransactionMonitoring::Queue::CaseCounts, + created: Time, + description: String?, + name: String, + updated: Time + ) -> void + + def to_hash: -> { + token: String, + case_counts: Lithic::TransactionMonitoring::Queue::CaseCounts, + created: Time, + description: String?, + name: String, + updated: Time + } + + type case_counts = + { + assigned: Integer, + closed: Integer, + escalated: Integer, + in_review: Integer, + open_: Integer, + resolved: Integer + } + + class CaseCounts < Lithic::Internal::Type::BaseModel + attr_reader assigned: Integer? + + def assigned=: (Integer) -> Integer + + attr_reader closed: Integer? + + def closed=: (Integer) -> Integer + + attr_reader escalated: Integer? + + def escalated=: (Integer) -> Integer + + attr_reader in_review: Integer? + + def in_review=: (Integer) -> Integer + + attr_reader open_: Integer? + + def open_=: (Integer) -> Integer + + attr_reader resolved: Integer? + + def resolved=: (Integer) -> Integer + + def initialize: ( + ?assigned: Integer, + ?closed: Integer, + ?escalated: Integer, + ?in_review: Integer, + ?open_: Integer, + ?resolved: Integer + ) -> void + + def to_hash: -> { + assigned: Integer, + closed: Integer, + escalated: Integer, + in_review: Integer, + open_: Integer, + resolved: Integer + } + end + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/queue_create_params.rbs b/sig/lithic/models/transaction_monitoring/queue_create_params.rbs new file mode 100644 index 00000000..6c2c346e --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/queue_create_params.rbs @@ -0,0 +1,30 @@ +module Lithic + module Models + module TransactionMonitoring + type queue_create_params = + { name: String, description: String? } + & Lithic::Internal::Type::request_parameters + + class QueueCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor name: String + + attr_accessor description: String? + + def initialize: ( + name: String, + ?description: String?, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + name: String, + description: String?, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/queue_delete_params.rbs b/sig/lithic/models/transaction_monitoring/queue_delete_params.rbs new file mode 100644 index 00000000..298838aa --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/queue_delete_params.rbs @@ -0,0 +1,25 @@ +module Lithic + module Models + module TransactionMonitoring + type queue_delete_params = + { queue_token: String } & Lithic::Internal::Type::request_parameters + + class QueueDeleteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor queue_token: String + + def initialize: ( + queue_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + queue_token: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/queue_list_params.rbs b/sig/lithic/models/transaction_monitoring/queue_list_params.rbs new file mode 100644 index 00000000..98d39a3a --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/queue_list_params.rbs @@ -0,0 +1,40 @@ +module Lithic + module Models + module TransactionMonitoring + type queue_list_params = + { ending_before: String, page_size: Integer, starting_after: String } + & Lithic::Internal::Type::request_parameters + + class QueueListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader ending_before: String? + + def ending_before=: (String) -> String + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader starting_after: String? + + def starting_after=: (String) -> String + + def initialize: ( + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + ending_before: String, + page_size: Integer, + starting_after: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/queue_retrieve_params.rbs b/sig/lithic/models/transaction_monitoring/queue_retrieve_params.rbs new file mode 100644 index 00000000..a87089fc --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/queue_retrieve_params.rbs @@ -0,0 +1,25 @@ +module Lithic + module Models + module TransactionMonitoring + type queue_retrieve_params = + { queue_token: String } & Lithic::Internal::Type::request_parameters + + class QueueRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor queue_token: String + + def initialize: ( + queue_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + queue_token: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/queue_update_params.rbs b/sig/lithic/models/transaction_monitoring/queue_update_params.rbs new file mode 100644 index 00000000..6330a791 --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/queue_update_params.rbs @@ -0,0 +1,36 @@ +module Lithic + module Models + module TransactionMonitoring + type queue_update_params = + { queue_token: String, description: String?, name: String } + & Lithic::Internal::Type::request_parameters + + class QueueUpdateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor queue_token: String + + attr_accessor description: String? + + attr_reader name: String? + + def name=: (String) -> String + + def initialize: ( + queue_token: String, + ?description: String?, + ?name: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + queue_token: String, + description: String?, + name: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/transaction_monitoring/resolution_outcome.rbs b/sig/lithic/models/transaction_monitoring/resolution_outcome.rbs new file mode 100644 index 00000000..4890b7de --- /dev/null +++ b/sig/lithic/models/transaction_monitoring/resolution_outcome.rbs @@ -0,0 +1,24 @@ +module Lithic + module Models + module TransactionMonitoring + type resolution_outcome = + :CONFIRMED_FRAUD + | :SUSPICIOUS_ACTIVITY + | :FALSE_POSITIVE + | :NO_ACTION_REQUIRED + | :ESCALATED_EXTERNAL + + module ResolutionOutcome + extend Lithic::Internal::Type::Enum + + CONFIRMED_FRAUD: :CONFIRMED_FRAUD + SUSPICIOUS_ACTIVITY: :SUSPICIOUS_ACTIVITY + FALSE_POSITIVE: :FALSE_POSITIVE + NO_ACTION_REQUIRED: :NO_ACTION_REQUIRED + ESCALATED_EXTERNAL: :ESCALATED_EXTERNAL + + def self?.values: -> ::Array[Lithic::Models::TransactionMonitoring::resolution_outcome] + end + end + end +end diff --git a/sig/lithic/models/transaction_retrieve_params.rbs b/sig/lithic/models/transaction_retrieve_params.rbs new file mode 100644 index 00000000..e4922df1 --- /dev/null +++ b/sig/lithic/models/transaction_retrieve_params.rbs @@ -0,0 +1,23 @@ +module Lithic + module Models + type transaction_retrieve_params = + { transaction_token: String } & Lithic::Internal::Type::request_parameters + + class TransactionRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor transaction_token: String + + def initialize: ( + transaction_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + transaction_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/transaction_route_params.rbs b/sig/lithic/models/transaction_route_params.rbs new file mode 100644 index 00000000..2d29c411 --- /dev/null +++ b/sig/lithic/models/transaction_route_params.rbs @@ -0,0 +1,28 @@ +module Lithic + module Models + type transaction_route_params = + { transaction_token: String, financial_account_token: String } + & Lithic::Internal::Type::request_parameters + + class TransactionRouteParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor transaction_token: String + + attr_accessor financial_account_token: String + + def initialize: ( + transaction_token: String, + financial_account_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + transaction_token: String, + financial_account_token: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/transaction_simulate_authorization_advice_params.rbs b/sig/lithic/models/transaction_simulate_authorization_advice_params.rbs new file mode 100644 index 00000000..b8943dac --- /dev/null +++ b/sig/lithic/models/transaction_simulate_authorization_advice_params.rbs @@ -0,0 +1,28 @@ +module Lithic + module Models + type transaction_simulate_authorization_advice_params = + { token: String, amount: Integer } + & Lithic::Internal::Type::request_parameters + + class TransactionSimulateAuthorizationAdviceParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor token: String + + attr_accessor amount: Integer + + def initialize: ( + token: String, + amount: Integer, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + token: String, + amount: Integer, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/transaction_simulate_authorization_advice_response.rbs b/sig/lithic/models/transaction_simulate_authorization_advice_response.rbs new file mode 100644 index 00000000..16dfeba7 --- /dev/null +++ b/sig/lithic/models/transaction_simulate_authorization_advice_response.rbs @@ -0,0 +1,20 @@ +module Lithic + module Models + type transaction_simulate_authorization_advice_response = + { token: String, debugging_request_id: String } + + class TransactionSimulateAuthorizationAdviceResponse < Lithic::Internal::Type::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader debugging_request_id: String? + + def debugging_request_id=: (String) -> String + + def initialize: (?token: String, ?debugging_request_id: String) -> void + + def to_hash: -> { token: String, debugging_request_id: String } + end + end +end diff --git a/sig/lithic/models/transaction_simulate_authorization_params.rbs b/sig/lithic/models/transaction_simulate_authorization_params.rbs new file mode 100644 index 00000000..473422ed --- /dev/null +++ b/sig/lithic/models/transaction_simulate_authorization_params.rbs @@ -0,0 +1,127 @@ +module Lithic + module Models + type transaction_simulate_authorization_params = + { + amount: Integer, + descriptor: String, + pan: String, + mcc: String, + merchant_acceptor_city: String, + merchant_acceptor_country: String, + merchant_acceptor_id: String, + merchant_acceptor_state: String, + merchant_amount: Integer, + merchant_currency: String, + partial_approval_capable: bool, + pin: String, + status: Lithic::Models::TransactionSimulateAuthorizationParams::status + } + & Lithic::Internal::Type::request_parameters + + class TransactionSimulateAuthorizationParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor amount: Integer + + attr_accessor descriptor: String + + attr_accessor pan: String + + attr_reader mcc: String? + + def mcc=: (String) -> String + + attr_reader merchant_acceptor_city: String? + + def merchant_acceptor_city=: (String) -> String + + attr_reader merchant_acceptor_country: String? + + def merchant_acceptor_country=: (String) -> String + + attr_reader merchant_acceptor_id: String? + + def merchant_acceptor_id=: (String) -> String + + attr_reader merchant_acceptor_state: String? + + def merchant_acceptor_state=: (String) -> String + + attr_reader merchant_amount: Integer? + + def merchant_amount=: (Integer) -> Integer + + attr_reader merchant_currency: String? + + def merchant_currency=: (String) -> String + + attr_reader partial_approval_capable: bool? + + def partial_approval_capable=: (bool) -> bool + + attr_reader pin: String? + + def pin=: (String) -> String + + attr_reader status: Lithic::Models::TransactionSimulateAuthorizationParams::status? + + def status=: ( + Lithic::Models::TransactionSimulateAuthorizationParams::status + ) -> Lithic::Models::TransactionSimulateAuthorizationParams::status + + def initialize: ( + amount: Integer, + descriptor: String, + pan: String, + ?mcc: String, + ?merchant_acceptor_city: String, + ?merchant_acceptor_country: String, + ?merchant_acceptor_id: String, + ?merchant_acceptor_state: String, + ?merchant_amount: Integer, + ?merchant_currency: String, + ?partial_approval_capable: bool, + ?pin: String, + ?status: Lithic::Models::TransactionSimulateAuthorizationParams::status, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + amount: Integer, + descriptor: String, + pan: String, + mcc: String, + merchant_acceptor_city: String, + merchant_acceptor_country: String, + merchant_acceptor_id: String, + merchant_acceptor_state: String, + merchant_amount: Integer, + merchant_currency: String, + partial_approval_capable: bool, + pin: String, + status: Lithic::Models::TransactionSimulateAuthorizationParams::status, + request_options: Lithic::RequestOptions + } + + type status = + :AUTHORIZATION + | :BALANCE_INQUIRY + | :CREDIT_AUTHORIZATION + | :FINANCIAL_AUTHORIZATION + | :FINANCIAL_CREDIT_AUTHORIZATION + + module Status + extend Lithic::Internal::Type::Enum + + AUTHORIZATION: :AUTHORIZATION + BALANCE_INQUIRY: :BALANCE_INQUIRY + CREDIT_AUTHORIZATION: :CREDIT_AUTHORIZATION + FINANCIAL_AUTHORIZATION: :FINANCIAL_AUTHORIZATION + FINANCIAL_CREDIT_AUTHORIZATION: :FINANCIAL_CREDIT_AUTHORIZATION + + def self?.values: -> ::Array[Lithic::Models::TransactionSimulateAuthorizationParams::status] + end + end + end +end diff --git a/sig/lithic/models/transaction_simulate_authorization_response.rbs b/sig/lithic/models/transaction_simulate_authorization_response.rbs new file mode 100644 index 00000000..ea477b02 --- /dev/null +++ b/sig/lithic/models/transaction_simulate_authorization_response.rbs @@ -0,0 +1,20 @@ +module Lithic + module Models + type transaction_simulate_authorization_response = + { token: String, debugging_request_id: String } + + class TransactionSimulateAuthorizationResponse < Lithic::Internal::Type::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader debugging_request_id: String? + + def debugging_request_id=: (String) -> String + + def initialize: (?token: String, ?debugging_request_id: String) -> void + + def to_hash: -> { token: String, debugging_request_id: String } + end + end +end diff --git a/sig/lithic/models/transaction_simulate_clearing_params.rbs b/sig/lithic/models/transaction_simulate_clearing_params.rbs new file mode 100644 index 00000000..43a7c432 --- /dev/null +++ b/sig/lithic/models/transaction_simulate_clearing_params.rbs @@ -0,0 +1,30 @@ +module Lithic + module Models + type transaction_simulate_clearing_params = + { token: String, amount: Integer } + & Lithic::Internal::Type::request_parameters + + class TransactionSimulateClearingParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor token: String + + attr_reader amount: Integer? + + def amount=: (Integer) -> Integer + + def initialize: ( + token: String, + ?amount: Integer, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + token: String, + amount: Integer, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/transaction_simulate_clearing_response.rbs b/sig/lithic/models/transaction_simulate_clearing_response.rbs new file mode 100644 index 00000000..597d220f --- /dev/null +++ b/sig/lithic/models/transaction_simulate_clearing_response.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + type transaction_simulate_clearing_response = + { debugging_request_id: String } + + class TransactionSimulateClearingResponse < Lithic::Internal::Type::BaseModel + attr_reader debugging_request_id: String? + + def debugging_request_id=: (String) -> String + + def initialize: (?debugging_request_id: String) -> void + + def to_hash: -> { debugging_request_id: String } + end + end +end diff --git a/sig/lithic/models/transaction_simulate_credit_authorization_advice_params.rbs b/sig/lithic/models/transaction_simulate_credit_authorization_advice_params.rbs new file mode 100644 index 00000000..d5ffc877 --- /dev/null +++ b/sig/lithic/models/transaction_simulate_credit_authorization_advice_params.rbs @@ -0,0 +1,71 @@ +module Lithic + module Models + type transaction_simulate_credit_authorization_advice_params = + { + amount: Integer, + descriptor: String, + pan: String, + mcc: String, + merchant_acceptor_city: String, + merchant_acceptor_country: String, + merchant_acceptor_id: String, + merchant_acceptor_state: String + } + & Lithic::Internal::Type::request_parameters + + class TransactionSimulateCreditAuthorizationAdviceParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor amount: Integer + + attr_accessor descriptor: String + + attr_accessor pan: String + + attr_reader mcc: String? + + def mcc=: (String) -> String + + attr_reader merchant_acceptor_city: String? + + def merchant_acceptor_city=: (String) -> String + + attr_reader merchant_acceptor_country: String? + + def merchant_acceptor_country=: (String) -> String + + attr_reader merchant_acceptor_id: String? + + def merchant_acceptor_id=: (String) -> String + + attr_reader merchant_acceptor_state: String? + + def merchant_acceptor_state=: (String) -> String + + def initialize: ( + amount: Integer, + descriptor: String, + pan: String, + ?mcc: String, + ?merchant_acceptor_city: String, + ?merchant_acceptor_country: String, + ?merchant_acceptor_id: String, + ?merchant_acceptor_state: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + amount: Integer, + descriptor: String, + pan: String, + mcc: String, + merchant_acceptor_city: String, + merchant_acceptor_country: String, + merchant_acceptor_id: String, + merchant_acceptor_state: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/transaction_simulate_credit_authorization_advice_response.rbs b/sig/lithic/models/transaction_simulate_credit_authorization_advice_response.rbs new file mode 100644 index 00000000..a91c77d3 --- /dev/null +++ b/sig/lithic/models/transaction_simulate_credit_authorization_advice_response.rbs @@ -0,0 +1,20 @@ +module Lithic + module Models + type transaction_simulate_credit_authorization_advice_response = + { token: String, debugging_request_id: String } + + class TransactionSimulateCreditAuthorizationAdviceResponse < Lithic::Internal::Type::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader debugging_request_id: String? + + def debugging_request_id=: (String) -> String + + def initialize: (?token: String, ?debugging_request_id: String) -> void + + def to_hash: -> { token: String, debugging_request_id: String } + end + end +end diff --git a/sig/lithic/models/transaction_simulate_return_params.rbs b/sig/lithic/models/transaction_simulate_return_params.rbs new file mode 100644 index 00000000..4a0588a4 --- /dev/null +++ b/sig/lithic/models/transaction_simulate_return_params.rbs @@ -0,0 +1,32 @@ +module Lithic + module Models + type transaction_simulate_return_params = + { amount: Integer, descriptor: String, pan: String } + & Lithic::Internal::Type::request_parameters + + class TransactionSimulateReturnParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor amount: Integer + + attr_accessor descriptor: String + + attr_accessor pan: String + + def initialize: ( + amount: Integer, + descriptor: String, + pan: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + amount: Integer, + descriptor: String, + pan: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/transaction_simulate_return_response.rbs b/sig/lithic/models/transaction_simulate_return_response.rbs new file mode 100644 index 00000000..2b79f1b9 --- /dev/null +++ b/sig/lithic/models/transaction_simulate_return_response.rbs @@ -0,0 +1,20 @@ +module Lithic + module Models + type transaction_simulate_return_response = + { token: String, debugging_request_id: String } + + class TransactionSimulateReturnResponse < Lithic::Internal::Type::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader debugging_request_id: String? + + def debugging_request_id=: (String) -> String + + def initialize: (?token: String, ?debugging_request_id: String) -> void + + def to_hash: -> { token: String, debugging_request_id: String } + end + end +end diff --git a/sig/lithic/models/transaction_simulate_return_reversal_params.rbs b/sig/lithic/models/transaction_simulate_return_reversal_params.rbs new file mode 100644 index 00000000..1d9c8ece --- /dev/null +++ b/sig/lithic/models/transaction_simulate_return_reversal_params.rbs @@ -0,0 +1,20 @@ +module Lithic + module Models + type transaction_simulate_return_reversal_params = + { token: String } & Lithic::Internal::Type::request_parameters + + class TransactionSimulateReturnReversalParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor token: String + + def initialize: ( + token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { token: String, request_options: Lithic::RequestOptions } + end + end +end diff --git a/sig/lithic/models/transaction_simulate_return_reversal_response.rbs b/sig/lithic/models/transaction_simulate_return_reversal_response.rbs new file mode 100644 index 00000000..7170d954 --- /dev/null +++ b/sig/lithic/models/transaction_simulate_return_reversal_response.rbs @@ -0,0 +1,16 @@ +module Lithic + module Models + type transaction_simulate_return_reversal_response = + { debugging_request_id: String } + + class TransactionSimulateReturnReversalResponse < Lithic::Internal::Type::BaseModel + attr_reader debugging_request_id: String? + + def debugging_request_id=: (String) -> String + + def initialize: (?debugging_request_id: String) -> void + + def to_hash: -> { debugging_request_id: String } + end + end +end diff --git a/sig/lithic/models/transaction_simulate_void_params.rbs b/sig/lithic/models/transaction_simulate_void_params.rbs new file mode 100644 index 00000000..312393d6 --- /dev/null +++ b/sig/lithic/models/transaction_simulate_void_params.rbs @@ -0,0 +1,53 @@ +module Lithic + module Models + type transaction_simulate_void_params = + { + token: String, + amount: Integer, + type: Lithic::Models::TransactionSimulateVoidParams::type_ + } + & Lithic::Internal::Type::request_parameters + + class TransactionSimulateVoidParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor token: String + + attr_reader amount: Integer? + + def amount=: (Integer) -> Integer + + attr_reader type: Lithic::Models::TransactionSimulateVoidParams::type_? + + def type=: ( + Lithic::Models::TransactionSimulateVoidParams::type_ + ) -> Lithic::Models::TransactionSimulateVoidParams::type_ + + def initialize: ( + token: String, + ?amount: Integer, + ?type: Lithic::Models::TransactionSimulateVoidParams::type_, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + token: String, + amount: Integer, + type: Lithic::Models::TransactionSimulateVoidParams::type_, + request_options: Lithic::RequestOptions + } + + type type_ = :AUTHORIZATION_EXPIRY | :AUTHORIZATION_REVERSAL + + module Type + extend Lithic::Internal::Type::Enum + + AUTHORIZATION_EXPIRY: :AUTHORIZATION_EXPIRY + AUTHORIZATION_REVERSAL: :AUTHORIZATION_REVERSAL + + def self?.values: -> ::Array[Lithic::Models::TransactionSimulateVoidParams::type_] + end + end + end +end diff --git a/sig/lithic/models/transaction_simulate_void_response.rbs b/sig/lithic/models/transaction_simulate_void_response.rbs new file mode 100644 index 00000000..f5e68634 --- /dev/null +++ b/sig/lithic/models/transaction_simulate_void_response.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type transaction_simulate_void_response = { debugging_request_id: String } + + class TransactionSimulateVoidResponse < Lithic::Internal::Type::BaseModel + attr_reader debugging_request_id: String? + + def debugging_request_id=: (String) -> String + + def initialize: (?debugging_request_id: String) -> void + + def to_hash: -> { debugging_request_id: String } + end + end +end diff --git a/sig/lithic/models/transactions/enhanced_commercial_data_retrieve_params.rbs b/sig/lithic/models/transactions/enhanced_commercial_data_retrieve_params.rbs new file mode 100644 index 00000000..a92027e1 --- /dev/null +++ b/sig/lithic/models/transactions/enhanced_commercial_data_retrieve_params.rbs @@ -0,0 +1,26 @@ +module Lithic + module Models + module Transactions + type enhanced_commercial_data_retrieve_params = + { transaction_token: String } + & Lithic::Internal::Type::request_parameters + + class EnhancedCommercialDataRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor transaction_token: String + + def initialize: ( + transaction_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + transaction_token: String, + request_options: Lithic::RequestOptions + } + end + end + end +end diff --git a/sig/lithic/models/transactions/enhanced_commercial_data_retrieve_response.rbs b/sig/lithic/models/transactions/enhanced_commercial_data_retrieve_response.rbs new file mode 100644 index 00000000..be183f50 --- /dev/null +++ b/sig/lithic/models/transactions/enhanced_commercial_data_retrieve_response.rbs @@ -0,0 +1,20 @@ +module Lithic + module Models + module Transactions + type enhanced_commercial_data_retrieve_response = + { data: ::Array[Lithic::Transactions::Events::EnhancedData] } + + class EnhancedCommercialDataRetrieveResponse < Lithic::Internal::Type::BaseModel + attr_accessor data: ::Array[Lithic::Transactions::Events::EnhancedData] + + def initialize: ( + data: ::Array[Lithic::Transactions::Events::EnhancedData] + ) -> void + + def to_hash: -> { + data: ::Array[Lithic::Transactions::Events::EnhancedData] + } + end + end + end +end diff --git a/sig/lithic/models/transactions/events/enhanced_commercial_data_retrieve_params.rbs b/sig/lithic/models/transactions/events/enhanced_commercial_data_retrieve_params.rbs new file mode 100644 index 00000000..80d9cac1 --- /dev/null +++ b/sig/lithic/models/transactions/events/enhanced_commercial_data_retrieve_params.rbs @@ -0,0 +1,27 @@ +module Lithic + module Models + module Transactions + module Events + type enhanced_commercial_data_retrieve_params = + { event_token: String } & Lithic::Internal::Type::request_parameters + + class EnhancedCommercialDataRetrieveParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor event_token: String + + def initialize: ( + event_token: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + event_token: String, + request_options: Lithic::RequestOptions + } + end + end + end + end +end diff --git a/sig/lithic/models/transactions/events/enhanced_data.rbs b/sig/lithic/models/transactions/events/enhanced_data.rbs new file mode 100644 index 00000000..4060b1f1 --- /dev/null +++ b/sig/lithic/models/transactions/events/enhanced_data.rbs @@ -0,0 +1,538 @@ +module Lithic + module Models + module Transactions + module Events + type enhanced_data = + { + token: String, + common: Lithic::Transactions::Events::EnhancedData::Common, + event_token: String, + fleet: ::Array[Lithic::Transactions::Events::EnhancedData::Fleet], + transaction_token: String + } + + class EnhancedData < Lithic::Internal::Type::BaseModel + attr_accessor token: String + + attr_accessor common: Lithic::Transactions::Events::EnhancedData::Common + + attr_accessor event_token: String + + attr_accessor fleet: ::Array[Lithic::Transactions::Events::EnhancedData::Fleet] + + attr_accessor transaction_token: String + + def initialize: ( + token: String, + common: Lithic::Transactions::Events::EnhancedData::Common, + event_token: String, + fleet: ::Array[Lithic::Transactions::Events::EnhancedData::Fleet], + transaction_token: String + ) -> void + + def to_hash: -> { + token: String, + common: Lithic::Transactions::Events::EnhancedData::Common, + event_token: String, + fleet: ::Array[Lithic::Transactions::Events::EnhancedData::Fleet], + transaction_token: String + } + + type common = + { + line_items: ::Array[Lithic::Transactions::Events::EnhancedData::Common::LineItem], + tax: Lithic::Transactions::Events::EnhancedData::Common::Tax, + customer_reference_number: String?, + merchant_reference_number: String?, + order_date: Date? + } + + class Common < Lithic::Internal::Type::BaseModel + attr_accessor line_items: ::Array[Lithic::Transactions::Events::EnhancedData::Common::LineItem] + + attr_accessor tax: Lithic::Transactions::Events::EnhancedData::Common::Tax + + attr_accessor customer_reference_number: String? + + attr_accessor merchant_reference_number: String? + + attr_accessor order_date: Date? + + def initialize: ( + line_items: ::Array[Lithic::Transactions::Events::EnhancedData::Common::LineItem], + tax: Lithic::Transactions::Events::EnhancedData::Common::Tax, + ?customer_reference_number: String?, + ?merchant_reference_number: String?, + ?order_date: Date? + ) -> void + + def to_hash: -> { + line_items: ::Array[Lithic::Transactions::Events::EnhancedData::Common::LineItem], + tax: Lithic::Transactions::Events::EnhancedData::Common::Tax, + customer_reference_number: String?, + merchant_reference_number: String?, + order_date: Date? + } + + type line_item = + { + amount: String?, + description: String?, + product_code: String?, + quantity: String? + } + + class LineItem < Lithic::Internal::Type::BaseModel + attr_accessor amount: String? + + attr_accessor description: String? + + attr_accessor product_code: String? + + attr_accessor quantity: String? + + def initialize: ( + ?amount: String?, + ?description: String?, + ?product_code: String?, + ?quantity: String? + ) -> void + + def to_hash: -> { + amount: String?, + description: String?, + product_code: String?, + quantity: String? + } + end + + type tax = + { + amount: Integer?, + exempt: Lithic::Models::Transactions::Events::EnhancedData::Common::Tax::exempt?, + merchant_tax_id: String? + } + + class Tax < Lithic::Internal::Type::BaseModel + attr_accessor amount: Integer? + + attr_accessor exempt: Lithic::Models::Transactions::Events::EnhancedData::Common::Tax::exempt? + + attr_accessor merchant_tax_id: String? + + def initialize: ( + ?amount: Integer?, + ?exempt: Lithic::Models::Transactions::Events::EnhancedData::Common::Tax::exempt?, + ?merchant_tax_id: String? + ) -> void + + def to_hash: -> { + amount: Integer?, + exempt: Lithic::Models::Transactions::Events::EnhancedData::Common::Tax::exempt?, + merchant_tax_id: String? + } + + type exempt = :TAX_INCLUDED | :TAX_NOT_INCLUDED | :NOT_SUPPORTED + + module Exempt + extend Lithic::Internal::Type::Enum + + TAX_INCLUDED: :TAX_INCLUDED + TAX_NOT_INCLUDED: :TAX_NOT_INCLUDED + NOT_SUPPORTED: :NOT_SUPPORTED + + def self?.values: -> ::Array[Lithic::Models::Transactions::Events::EnhancedData::Common::Tax::exempt] + end + end + end + + type fleet = + { + amount_totals: Lithic::Transactions::Events::EnhancedData::Fleet::AmountTotals, + fuel: Lithic::Transactions::Events::EnhancedData::Fleet::Fuel, + driver_number: String?, + odometer: Integer?, + service_type: Lithic::Models::Transactions::Events::EnhancedData::Fleet::service_type, + vehicle_number: String? + } + + class Fleet < Lithic::Internal::Type::BaseModel + attr_accessor amount_totals: Lithic::Transactions::Events::EnhancedData::Fleet::AmountTotals + + attr_accessor fuel: Lithic::Transactions::Events::EnhancedData::Fleet::Fuel + + attr_accessor driver_number: String? + + attr_accessor odometer: Integer? + + attr_reader service_type: Lithic::Models::Transactions::Events::EnhancedData::Fleet::service_type? + + def service_type=: ( + Lithic::Models::Transactions::Events::EnhancedData::Fleet::service_type + ) -> Lithic::Models::Transactions::Events::EnhancedData::Fleet::service_type + + attr_accessor vehicle_number: String? + + def initialize: ( + amount_totals: Lithic::Transactions::Events::EnhancedData::Fleet::AmountTotals, + fuel: Lithic::Transactions::Events::EnhancedData::Fleet::Fuel, + ?driver_number: String?, + ?odometer: Integer?, + ?service_type: Lithic::Models::Transactions::Events::EnhancedData::Fleet::service_type, + ?vehicle_number: String? + ) -> void + + def to_hash: -> { + amount_totals: Lithic::Transactions::Events::EnhancedData::Fleet::AmountTotals, + fuel: Lithic::Transactions::Events::EnhancedData::Fleet::Fuel, + driver_number: String?, + odometer: Integer?, + service_type: Lithic::Models::Transactions::Events::EnhancedData::Fleet::service_type, + vehicle_number: String? + } + + type amount_totals = + { discount: Integer?, gross_sale: Integer?, net_sale: Integer? } + + class AmountTotals < Lithic::Internal::Type::BaseModel + attr_accessor discount: Integer? + + attr_accessor gross_sale: Integer? + + attr_accessor net_sale: Integer? + + def initialize: ( + ?discount: Integer?, + ?gross_sale: Integer?, + ?net_sale: Integer? + ) -> void + + def to_hash: -> { + discount: Integer?, + gross_sale: Integer?, + net_sale: Integer? + } + end + + type fuel = + { + quantity: String?, + type: Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::type_?, + unit_of_measure: Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::unit_of_measure?, + unit_price: Integer? + } + + class Fuel < Lithic::Internal::Type::BaseModel + attr_accessor quantity: String? + + attr_accessor type: Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::type_? + + attr_accessor unit_of_measure: Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::unit_of_measure? + + attr_accessor unit_price: Integer? + + def initialize: ( + ?quantity: String?, + ?type: Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::type_?, + ?unit_of_measure: Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::unit_of_measure?, + ?unit_price: Integer? + ) -> void + + def to_hash: -> { + quantity: String?, + type: Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::type_?, + unit_of_measure: Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::unit_of_measure?, + unit_price: Integer? + } + + type type_ = + :UNKNOWN + | :REGULAR + | :MID_PLUS + | :PREMIUM_SUPER + | :MID_PLUS_2 + | :PREMIUM_SUPER_2 + | :ETHANOL_5_7_BLEND + | :MID_PLUS_ETHANOL_5_7_PERCENT_BLEND + | :PREMIUM_SUPER_ETHANOL_5_7_PERCENT_BLEND + | :ETHANOL_7_7_PERCENT_BLEND + | :MID_PLUS_ETHANOL_7_7_PERCENT_BLEND + | :GREEN_GASOLINE_REGULAR + | :GREEN_GASOLINE_MID_PLUS + | :GREEN_GASOLINE_PREMIUM_SUPER + | :REGULAR_DIESEL_2 + | :PREMIUM_DIESEL_2 + | :REGULAR_DIESEL_1 + | :COMPRESSED_NATURAL_GAS + | :LIQUID_PROPANE_GAS + | :LIQUID_NATURAL_GAS + | :E_85 + | :REFORMULATED_1 + | :REFORMULATED_2 + | :REFORMULATED_3 + | :REFORMULATED_4 + | :REFORMULATED_5 + | :DIESEL_OFF_ROAD_1_AND_2_NON_TAXABLE + | :DIESEL_OFF_ROAD_NON_TAXABLE + | :BIODIESEL_BLEND_OFF_ROAD_NON_TAXABLE + | :UNDEFINED_FUEL + | :RACING_FUEL + | :MID_PLUS_2_10_PERCENT_BLEND + | :PREMIUM_SUPER_2_10_PERCENT_BLEND + | :MID_PLUS_ETHANOL_2_15_PERCENT_BLEND + | :PREMIUM_SUPER_ETHANOL_2_15_PERCENT_BLEND + | :PREMIUM_SUPER_ETHANOL_7_7_PERCENT_BLEND + | :REGULAR_ETHANOL_10_PERCENT_BLEND + | :MID_PLUS_ETHANOL_10_PERCENT_BLEND + | :PREMIUM_SUPER_ETHANOL_10_PERCENT_BLEND + | :B2_DIESEL_BLEND_2_PERCENT_BIODIESEL + | :B5_DIESEL_BLEND_5_PERCENT_BIODIESEL + | :B10_DIESEL_BLEND_10_PERCENT_BIODIESEL + | :B11_DIESEL_BLEND_11_PERCENT_BIODIESEL + | :B15_DIESEL_BLEND_15_PERCENT_BIODIESEL + | :B20_DIESEL_BLEND_20_PERCENT_BIODIESEL + | :B100_DIESEL_BLEND_100_PERCENT_BIODIESEL + | :B1_DIESEL_BLEND_1_PERCENT_BIODIESEL + | :ADDITIZED_DIESEL_2 + | :ADDITIZED_DIESEL_3 + | :RENEWABLE_DIESEL_R95 + | :RENEWABLE_DIESEL_BIODIESEL_6_20_PERCENT + | :DIESEL_EXHAUST_FLUID + | :PREMIUM_DIESEL_1 + | :REGULAR_ETHANOL_15_PERCENT_BLEND + | :MID_PLUS_ETHANOL_15_PERCENT_BLEND + | :PREMIUM_SUPER_ETHANOL_15_PERCENT_BLEND + | :PREMIUM_DIESEL_BLEND_LESS_THAN_20_PERCENT_BIODIESEL + | :PREMIUM_DIESEL_BLEND_GREATER_THAN_20_PERCENT_BIODIESEL + | :B75_DIESEL_BLEND_75_PERCENT_BIODIESEL + | :B99_DIESEL_BLEND_99_PERCENT_BIODIESEL + | :MISCELLANEOUS_FUEL + | :JET_FUEL + | :AVIATION_FUEL_REGULAR + | :AVIATION_FUEL_PREMIUM + | :AVIATION_FUEL_JP8 + | :AVIATION_FUEL_4 + | :AVIATION_FUEL_5 + | :BIOJET_DIESEL + | :AVIATION_BIOFUEL_GASOLINE + | :MISCELLANEOUS_AVIATION_FUEL + | :MARINE_FUEL_1 + | :MARINE_FUEL_2 + | :MARINE_FUEL_3 + | :MARINE_FUEL_4 + | :MARINE_FUEL_5 + | :MARINE_OTHER + | :MARINE_DIESEL + | :MISCELLANEOUS_MARINE_FUEL + | :KEROSENE_LOW_SULFUR + | :WHITE_GAS + | :HEATING_OIL + | :OTHER_FUEL_NON_TAXABLE + | :KEROSENE_ULTRA_LOW_SULFUR + | :KEROSENE_LOW_SULFUR_NON_TAXABLE + | :KEROSENE_ULTRA_LOW_SULFUR_NON_TAXABLE + | :EVC_1_LEVEL_1_CHARGE_110V_15_AMP + | :EVC_2_LEVEL_2_CHARGE_240V_15_40_AMP + | :EVC_3_LEVEL_3_CHARGE_480V_3_PHASE_CHARGE + | :BIODIESEL_BLEND_2_PERCENT_OFF_ROAD_NON_TAXABLE + | :BIODIESEL_BLEND_5_PERCENT_OFF_ROAD_NON_TAXABLE + | :BIODIESEL_BLEND_10_PERCENT_OFF_ROAD_NON_TAXABLE + | :BIODIESEL_BLEND_11_PERCENT_OFF_ROAD_NON_TAXABLE + | :BIODIESEL_BLEND_15_PERCENT_OFF_ROAD_NON_TAXABLE + | :BIODIESEL_BLEND_20_PERCENT_OFF_ROAD_NON_TAXABLE + | :DIESEL_1_OFF_ROAD_NON_TAXABLE + | :DIESEL_2_OFF_ROAD_NON_TAXABLE + | :DIESEL_1_PREMIUM_OFF_ROAD_NON_TAXABLE + | :DIESEL_2_PREMIUM_OFF_ROAD_NON_TAXABLE + | :ADDITIVE_DOSAGE + | :ETHANOL_BLENDS_E16_E84 + | :LOW_OCTANE_UNL + | :BLENDED_DIESEL_1_AND_2 + | :OFF_ROAD_REGULAR_NON_TAXABLE + | :OFF_ROAD_MID_PLUS_NON_TAXABLE + | :OFF_ROAD_PREMIUM_SUPER_NON_TAXABLE + | :OFF_ROAD_MID_PLUS_2_NON_TAXABLE + | :OFF_ROAD_PREMIUM_SUPER_2_NON_TAXABLE + | :RECREATIONAL_FUEL_90_OCTANE + | :HYDROGEN_H35 + | :HYDROGEN_H70 + | :RENEWABLE_DIESEL_R95_OFF_ROAD_NON_TAXABLE + | :BIODIESEL_BLEND_1_PERCENT_OFF_ROAD_NON_TAXABLE + | :BIODIESEL_BLEND_75_PERCENT_OFF_ROAD_NON_TAXABLE + | :BIODIESEL_BLEND_99_PERCENT_OFF_ROAD_NON_TAXABLE + | :BIODIESEL_BLEND_100_PERCENT_OFF_ROAD_NON_TAXABLE + | :RENEWABLE_DIESEL_BIODIESEL_6_20_PERCENT_OFF_ROAD_NON_TAXABLE + | :MISCELLANEOUS_OTHER_FUEL + + module Type + extend Lithic::Internal::Type::Enum + + UNKNOWN: :UNKNOWN + REGULAR: :REGULAR + MID_PLUS: :MID_PLUS + PREMIUM_SUPER: :PREMIUM_SUPER + MID_PLUS_2: :MID_PLUS_2 + PREMIUM_SUPER_2: :PREMIUM_SUPER_2 + ETHANOL_5_7_BLEND: :ETHANOL_5_7_BLEND + MID_PLUS_ETHANOL_5_7_PERCENT_BLEND: :MID_PLUS_ETHANOL_5_7_PERCENT_BLEND + PREMIUM_SUPER_ETHANOL_5_7_PERCENT_BLEND: :PREMIUM_SUPER_ETHANOL_5_7_PERCENT_BLEND + ETHANOL_7_7_PERCENT_BLEND: :ETHANOL_7_7_PERCENT_BLEND + MID_PLUS_ETHANOL_7_7_PERCENT_BLEND: :MID_PLUS_ETHANOL_7_7_PERCENT_BLEND + GREEN_GASOLINE_REGULAR: :GREEN_GASOLINE_REGULAR + GREEN_GASOLINE_MID_PLUS: :GREEN_GASOLINE_MID_PLUS + GREEN_GASOLINE_PREMIUM_SUPER: :GREEN_GASOLINE_PREMIUM_SUPER + REGULAR_DIESEL_2: :REGULAR_DIESEL_2 + PREMIUM_DIESEL_2: :PREMIUM_DIESEL_2 + REGULAR_DIESEL_1: :REGULAR_DIESEL_1 + COMPRESSED_NATURAL_GAS: :COMPRESSED_NATURAL_GAS + LIQUID_PROPANE_GAS: :LIQUID_PROPANE_GAS + LIQUID_NATURAL_GAS: :LIQUID_NATURAL_GAS + E_85: :E_85 + REFORMULATED_1: :REFORMULATED_1 + REFORMULATED_2: :REFORMULATED_2 + REFORMULATED_3: :REFORMULATED_3 + REFORMULATED_4: :REFORMULATED_4 + REFORMULATED_5: :REFORMULATED_5 + DIESEL_OFF_ROAD_1_AND_2_NON_TAXABLE: :DIESEL_OFF_ROAD_1_AND_2_NON_TAXABLE + DIESEL_OFF_ROAD_NON_TAXABLE: :DIESEL_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_OFF_ROAD_NON_TAXABLE: :BIODIESEL_BLEND_OFF_ROAD_NON_TAXABLE + UNDEFINED_FUEL: :UNDEFINED_FUEL + RACING_FUEL: :RACING_FUEL + MID_PLUS_2_10_PERCENT_BLEND: :MID_PLUS_2_10_PERCENT_BLEND + PREMIUM_SUPER_2_10_PERCENT_BLEND: :PREMIUM_SUPER_2_10_PERCENT_BLEND + MID_PLUS_ETHANOL_2_15_PERCENT_BLEND: :MID_PLUS_ETHANOL_2_15_PERCENT_BLEND + PREMIUM_SUPER_ETHANOL_2_15_PERCENT_BLEND: :PREMIUM_SUPER_ETHANOL_2_15_PERCENT_BLEND + PREMIUM_SUPER_ETHANOL_7_7_PERCENT_BLEND: :PREMIUM_SUPER_ETHANOL_7_7_PERCENT_BLEND + REGULAR_ETHANOL_10_PERCENT_BLEND: :REGULAR_ETHANOL_10_PERCENT_BLEND + MID_PLUS_ETHANOL_10_PERCENT_BLEND: :MID_PLUS_ETHANOL_10_PERCENT_BLEND + PREMIUM_SUPER_ETHANOL_10_PERCENT_BLEND: :PREMIUM_SUPER_ETHANOL_10_PERCENT_BLEND + B2_DIESEL_BLEND_2_PERCENT_BIODIESEL: :B2_DIESEL_BLEND_2_PERCENT_BIODIESEL + B5_DIESEL_BLEND_5_PERCENT_BIODIESEL: :B5_DIESEL_BLEND_5_PERCENT_BIODIESEL + B10_DIESEL_BLEND_10_PERCENT_BIODIESEL: :B10_DIESEL_BLEND_10_PERCENT_BIODIESEL + B11_DIESEL_BLEND_11_PERCENT_BIODIESEL: :B11_DIESEL_BLEND_11_PERCENT_BIODIESEL + B15_DIESEL_BLEND_15_PERCENT_BIODIESEL: :B15_DIESEL_BLEND_15_PERCENT_BIODIESEL + B20_DIESEL_BLEND_20_PERCENT_BIODIESEL: :B20_DIESEL_BLEND_20_PERCENT_BIODIESEL + B100_DIESEL_BLEND_100_PERCENT_BIODIESEL: :B100_DIESEL_BLEND_100_PERCENT_BIODIESEL + B1_DIESEL_BLEND_1_PERCENT_BIODIESEL: :B1_DIESEL_BLEND_1_PERCENT_BIODIESEL + ADDITIZED_DIESEL_2: :ADDITIZED_DIESEL_2 + ADDITIZED_DIESEL_3: :ADDITIZED_DIESEL_3 + RENEWABLE_DIESEL_R95: :RENEWABLE_DIESEL_R95 + RENEWABLE_DIESEL_BIODIESEL_6_20_PERCENT: :RENEWABLE_DIESEL_BIODIESEL_6_20_PERCENT + DIESEL_EXHAUST_FLUID: :DIESEL_EXHAUST_FLUID + PREMIUM_DIESEL_1: :PREMIUM_DIESEL_1 + REGULAR_ETHANOL_15_PERCENT_BLEND: :REGULAR_ETHANOL_15_PERCENT_BLEND + MID_PLUS_ETHANOL_15_PERCENT_BLEND: :MID_PLUS_ETHANOL_15_PERCENT_BLEND + PREMIUM_SUPER_ETHANOL_15_PERCENT_BLEND: :PREMIUM_SUPER_ETHANOL_15_PERCENT_BLEND + PREMIUM_DIESEL_BLEND_LESS_THAN_20_PERCENT_BIODIESEL: :PREMIUM_DIESEL_BLEND_LESS_THAN_20_PERCENT_BIODIESEL + PREMIUM_DIESEL_BLEND_GREATER_THAN_20_PERCENT_BIODIESEL: :PREMIUM_DIESEL_BLEND_GREATER_THAN_20_PERCENT_BIODIESEL + B75_DIESEL_BLEND_75_PERCENT_BIODIESEL: :B75_DIESEL_BLEND_75_PERCENT_BIODIESEL + B99_DIESEL_BLEND_99_PERCENT_BIODIESEL: :B99_DIESEL_BLEND_99_PERCENT_BIODIESEL + MISCELLANEOUS_FUEL: :MISCELLANEOUS_FUEL + JET_FUEL: :JET_FUEL + AVIATION_FUEL_REGULAR: :AVIATION_FUEL_REGULAR + AVIATION_FUEL_PREMIUM: :AVIATION_FUEL_PREMIUM + AVIATION_FUEL_JP8: :AVIATION_FUEL_JP8 + AVIATION_FUEL_4: :AVIATION_FUEL_4 + AVIATION_FUEL_5: :AVIATION_FUEL_5 + BIOJET_DIESEL: :BIOJET_DIESEL + AVIATION_BIOFUEL_GASOLINE: :AVIATION_BIOFUEL_GASOLINE + MISCELLANEOUS_AVIATION_FUEL: :MISCELLANEOUS_AVIATION_FUEL + MARINE_FUEL_1: :MARINE_FUEL_1 + MARINE_FUEL_2: :MARINE_FUEL_2 + MARINE_FUEL_3: :MARINE_FUEL_3 + MARINE_FUEL_4: :MARINE_FUEL_4 + MARINE_FUEL_5: :MARINE_FUEL_5 + MARINE_OTHER: :MARINE_OTHER + MARINE_DIESEL: :MARINE_DIESEL + MISCELLANEOUS_MARINE_FUEL: :MISCELLANEOUS_MARINE_FUEL + KEROSENE_LOW_SULFUR: :KEROSENE_LOW_SULFUR + WHITE_GAS: :WHITE_GAS + HEATING_OIL: :HEATING_OIL + OTHER_FUEL_NON_TAXABLE: :OTHER_FUEL_NON_TAXABLE + KEROSENE_ULTRA_LOW_SULFUR: :KEROSENE_ULTRA_LOW_SULFUR + KEROSENE_LOW_SULFUR_NON_TAXABLE: :KEROSENE_LOW_SULFUR_NON_TAXABLE + KEROSENE_ULTRA_LOW_SULFUR_NON_TAXABLE: :KEROSENE_ULTRA_LOW_SULFUR_NON_TAXABLE + EVC_1_LEVEL_1_CHARGE_110_V_15_AMP: :EVC_1_LEVEL_1_CHARGE_110V_15_AMP + EVC_2_LEVEL_2_CHARGE_240_V_15_40_AMP: :EVC_2_LEVEL_2_CHARGE_240V_15_40_AMP + EVC_3_LEVEL_3_CHARGE_480_V_3_PHASE_CHARGE: :EVC_3_LEVEL_3_CHARGE_480V_3_PHASE_CHARGE + BIODIESEL_BLEND_2_PERCENT_OFF_ROAD_NON_TAXABLE: :BIODIESEL_BLEND_2_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_5_PERCENT_OFF_ROAD_NON_TAXABLE: :BIODIESEL_BLEND_5_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_10_PERCENT_OFF_ROAD_NON_TAXABLE: :BIODIESEL_BLEND_10_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_11_PERCENT_OFF_ROAD_NON_TAXABLE: :BIODIESEL_BLEND_11_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_15_PERCENT_OFF_ROAD_NON_TAXABLE: :BIODIESEL_BLEND_15_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_20_PERCENT_OFF_ROAD_NON_TAXABLE: :BIODIESEL_BLEND_20_PERCENT_OFF_ROAD_NON_TAXABLE + DIESEL_1_OFF_ROAD_NON_TAXABLE: :DIESEL_1_OFF_ROAD_NON_TAXABLE + DIESEL_2_OFF_ROAD_NON_TAXABLE: :DIESEL_2_OFF_ROAD_NON_TAXABLE + DIESEL_1_PREMIUM_OFF_ROAD_NON_TAXABLE: :DIESEL_1_PREMIUM_OFF_ROAD_NON_TAXABLE + DIESEL_2_PREMIUM_OFF_ROAD_NON_TAXABLE: :DIESEL_2_PREMIUM_OFF_ROAD_NON_TAXABLE + ADDITIVE_DOSAGE: :ADDITIVE_DOSAGE + ETHANOL_BLENDS_E16_E84: :ETHANOL_BLENDS_E16_E84 + LOW_OCTANE_UNL: :LOW_OCTANE_UNL + BLENDED_DIESEL_1_AND_2: :BLENDED_DIESEL_1_AND_2 + OFF_ROAD_REGULAR_NON_TAXABLE: :OFF_ROAD_REGULAR_NON_TAXABLE + OFF_ROAD_MID_PLUS_NON_TAXABLE: :OFF_ROAD_MID_PLUS_NON_TAXABLE + OFF_ROAD_PREMIUM_SUPER_NON_TAXABLE: :OFF_ROAD_PREMIUM_SUPER_NON_TAXABLE + OFF_ROAD_MID_PLUS_2_NON_TAXABLE: :OFF_ROAD_MID_PLUS_2_NON_TAXABLE + OFF_ROAD_PREMIUM_SUPER_2_NON_TAXABLE: :OFF_ROAD_PREMIUM_SUPER_2_NON_TAXABLE + RECREATIONAL_FUEL_90_OCTANE: :RECREATIONAL_FUEL_90_OCTANE + HYDROGEN_H35: :HYDROGEN_H35 + HYDROGEN_H70: :HYDROGEN_H70 + RENEWABLE_DIESEL_R95_OFF_ROAD_NON_TAXABLE: :RENEWABLE_DIESEL_R95_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_1_PERCENT_OFF_ROAD_NON_TAXABLE: :BIODIESEL_BLEND_1_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_75_PERCENT_OFF_ROAD_NON_TAXABLE: :BIODIESEL_BLEND_75_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_99_PERCENT_OFF_ROAD_NON_TAXABLE: :BIODIESEL_BLEND_99_PERCENT_OFF_ROAD_NON_TAXABLE + BIODIESEL_BLEND_100_PERCENT_OFF_ROAD_NON_TAXABLE: :BIODIESEL_BLEND_100_PERCENT_OFF_ROAD_NON_TAXABLE + RENEWABLE_DIESEL_BIODIESEL_6_20_PERCENT_OFF_ROAD_NON_TAXABLE: :RENEWABLE_DIESEL_BIODIESEL_6_20_PERCENT_OFF_ROAD_NON_TAXABLE + MISCELLANEOUS_OTHER_FUEL: :MISCELLANEOUS_OTHER_FUEL + + def self?.values: -> ::Array[Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::type_] + end + + type unit_of_measure = + :GALLONS + | :LITERS + | :POUNDS + | :KILOGRAMS + | :IMPERIAL_GALLONS + | :NOT_APPLICABLE + | :UNKNOWN + + module UnitOfMeasure + extend Lithic::Internal::Type::Enum + + GALLONS: :GALLONS + LITERS: :LITERS + POUNDS: :POUNDS + KILOGRAMS: :KILOGRAMS + IMPERIAL_GALLONS: :IMPERIAL_GALLONS + NOT_APPLICABLE: :NOT_APPLICABLE + UNKNOWN: :UNKNOWN + + def self?.values: -> ::Array[Lithic::Models::Transactions::Events::EnhancedData::Fleet::Fuel::unit_of_measure] + end + end + + type service_type = + :UNKNOWN + | :UNDEFINED + | :SELF_SERVICE + | :FULL_SERVICE + | :NON_FUEL_ONLY + + module ServiceType + extend Lithic::Internal::Type::Enum + + UNKNOWN: :UNKNOWN + UNDEFINED: :UNDEFINED + SELF_SERVICE: :SELF_SERVICE + FULL_SERVICE: :FULL_SERVICE + NON_FUEL_ONLY: :NON_FUEL_ONLY + + def self?.values: -> ::Array[Lithic::Models::Transactions::Events::EnhancedData::Fleet::service_type] + end + end + end + end + end + end +end diff --git a/sig/lithic/models/transfer.rbs b/sig/lithic/models/transfer.rbs new file mode 100644 index 00000000..c335417a --- /dev/null +++ b/sig/lithic/models/transfer.rbs @@ -0,0 +1,149 @@ +module Lithic + module Models + type transfer = + { + token: String, + category: Lithic::Models::Transfer::category, + created: Time, + currency: String, + descriptor: String, + events: ::Array[Lithic::FinancialEvent], + from_balance: ::Array[Lithic::Balance], + pending_amount: Integer, + result: Lithic::Models::Transfer::result, + settled_amount: Integer, + status: Lithic::Models::Transfer::status, + to_balance: ::Array[Lithic::Balance], + updated: Time + } + + class Transfer < Lithic::Internal::Type::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader category: Lithic::Models::Transfer::category? + + def category=: ( + Lithic::Models::Transfer::category + ) -> Lithic::Models::Transfer::category + + attr_reader created: Time? + + def created=: (Time) -> Time + + attr_reader currency: String? + + def currency=: (String) -> String + + attr_reader descriptor: String? + + def descriptor=: (String) -> String + + attr_reader events: ::Array[Lithic::FinancialEvent]? + + def events=: ( + ::Array[Lithic::FinancialEvent] + ) -> ::Array[Lithic::FinancialEvent] + + attr_reader from_balance: ::Array[Lithic::Balance]? + + def from_balance=: (::Array[Lithic::Balance]) -> ::Array[Lithic::Balance] + + attr_reader pending_amount: Integer? + + def pending_amount=: (Integer) -> Integer + + attr_reader result: Lithic::Models::Transfer::result? + + def result=: ( + Lithic::Models::Transfer::result + ) -> Lithic::Models::Transfer::result + + attr_reader settled_amount: Integer? + + def settled_amount=: (Integer) -> Integer + + attr_reader status: Lithic::Models::Transfer::status? + + def status=: ( + Lithic::Models::Transfer::status + ) -> Lithic::Models::Transfer::status + + attr_reader to_balance: ::Array[Lithic::Balance]? + + def to_balance=: (::Array[Lithic::Balance]) -> ::Array[Lithic::Balance] + + attr_reader updated: Time? + + def updated=: (Time) -> Time + + def initialize: ( + ?token: String, + ?category: Lithic::Models::Transfer::category, + ?created: Time, + ?currency: String, + ?descriptor: String, + ?events: ::Array[Lithic::FinancialEvent], + ?from_balance: ::Array[Lithic::Balance], + ?pending_amount: Integer, + ?result: Lithic::Models::Transfer::result, + ?settled_amount: Integer, + ?status: Lithic::Models::Transfer::status, + ?to_balance: ::Array[Lithic::Balance], + ?updated: Time + ) -> void + + def to_hash: -> { + token: String, + category: Lithic::Models::Transfer::category, + created: Time, + currency: String, + descriptor: String, + events: ::Array[Lithic::FinancialEvent], + from_balance: ::Array[Lithic::Balance], + pending_amount: Integer, + result: Lithic::Models::Transfer::result, + settled_amount: Integer, + status: Lithic::Models::Transfer::status, + to_balance: ::Array[Lithic::Balance], + updated: Time + } + + type category = :TRANSFER + + module Category + extend Lithic::Internal::Type::Enum + + TRANSFER: :TRANSFER + + def self?.values: -> ::Array[Lithic::Models::Transfer::category] + end + + type result = :APPROVED | :DECLINED + + module Result + extend Lithic::Internal::Type::Enum + + APPROVED: :APPROVED + DECLINED: :DECLINED + + def self?.values: -> ::Array[Lithic::Models::Transfer::result] + end + + type status = :DECLINED | :EXPIRED | :PENDING | :SETTLED | :VOIDED + + module Status + extend Lithic::Internal::Type::Enum + + DECLINED: :DECLINED + EXPIRED: :EXPIRED + PENDING: :PENDING + SETTLED: :SETTLED + VOIDED: :VOIDED + + def self?.values: -> ::Array[Lithic::Models::Transfer::status] + end + end + end +end diff --git a/sig/lithic/models/transfer_create_params.rbs b/sig/lithic/models/transfer_create_params.rbs new file mode 100644 index 00000000..4da286c9 --- /dev/null +++ b/sig/lithic/models/transfer_create_params.rbs @@ -0,0 +1,44 @@ +module Lithic + module Models + type transfer_create_params = + { amount: Integer, from: String, to: String, token: String, memo: String } + & Lithic::Internal::Type::request_parameters + + class TransferCreateParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_accessor amount: Integer + + attr_accessor from: String + + attr_accessor to: String + + attr_reader token: String? + + def token=: (String) -> String + + attr_reader memo: String? + + def memo=: (String) -> String + + def initialize: ( + amount: Integer, + from: String, + to: String, + ?token: String, + ?memo: String, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { + amount: Integer, + from: String, + to: String, + token: String, + memo: String, + request_options: Lithic::RequestOptions + } + end + end +end diff --git a/sig/lithic/models/transfer_limit_list_params.rbs b/sig/lithic/models/transfer_limit_list_params.rbs new file mode 100644 index 00000000..cedc1844 --- /dev/null +++ b/sig/lithic/models/transfer_limit_list_params.rbs @@ -0,0 +1,22 @@ +module Lithic + module Models + type transfer_limit_list_params = + { date: Date } & Lithic::Internal::Type::request_parameters + + class TransferLimitListParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + attr_reader date: Date? + + def date=: (Date) -> Date + + def initialize: ( + ?date: Date, + ?request_options: Lithic::request_opts + ) -> void + + def to_hash: -> { date: Date, request_options: Lithic::RequestOptions } + end + end +end diff --git a/sig/lithic/models/transfer_limits_response.rbs b/sig/lithic/models/transfer_limits_response.rbs new file mode 100644 index 00000000..30742f36 --- /dev/null +++ b/sig/lithic/models/transfer_limits_response.rbs @@ -0,0 +1,220 @@ +module Lithic + module Models + type transfer_limits_response = + { data: ::Array[Lithic::TransferLimitsResponse::Data], has_more: bool } + + class TransferLimitsResponse < Lithic::Internal::Type::BaseModel + attr_accessor data: ::Array[Lithic::TransferLimitsResponse::Data] + + attr_accessor has_more: bool + + def initialize: ( + data: ::Array[Lithic::TransferLimitsResponse::Data], + has_more: bool + ) -> void + + def to_hash: -> { + data: ::Array[Lithic::TransferLimitsResponse::Data], + has_more: bool + } + + type data = + { + company_id: String, + daily_limit: Lithic::TransferLimitsResponse::Data::DailyLimit, + date: Date, + is_fbo: bool, + monthly_limit: Lithic::TransferLimitsResponse::Data::MonthlyLimit, + program_limit_per_transaction: Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction + } + + class Data < Lithic::Internal::Type::BaseModel + attr_accessor company_id: String + + attr_accessor daily_limit: Lithic::TransferLimitsResponse::Data::DailyLimit + + attr_accessor date: Date + + attr_accessor is_fbo: bool + + attr_accessor monthly_limit: Lithic::TransferLimitsResponse::Data::MonthlyLimit + + attr_accessor program_limit_per_transaction: Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction + + def initialize: ( + company_id: String, + daily_limit: Lithic::TransferLimitsResponse::Data::DailyLimit, + date: Date, + is_fbo: bool, + monthly_limit: Lithic::TransferLimitsResponse::Data::MonthlyLimit, + program_limit_per_transaction: Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction + ) -> void + + def to_hash: -> { + company_id: String, + daily_limit: Lithic::TransferLimitsResponse::Data::DailyLimit, + date: Date, + is_fbo: bool, + monthly_limit: Lithic::TransferLimitsResponse::Data::MonthlyLimit, + program_limit_per_transaction: Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction + } + + type daily_limit = + { + credit: Lithic::TransferLimitsResponse::Data::DailyLimit::Credit, + debit: Lithic::TransferLimitsResponse::Data::DailyLimit::Debit + } + + class DailyLimit < Lithic::Internal::Type::BaseModel + attr_accessor credit: Lithic::TransferLimitsResponse::Data::DailyLimit::Credit + + attr_accessor debit: Lithic::TransferLimitsResponse::Data::DailyLimit::Debit + + def initialize: ( + credit: Lithic::TransferLimitsResponse::Data::DailyLimit::Credit, + debit: Lithic::TransferLimitsResponse::Data::DailyLimit::Debit + ) -> void + + def to_hash: -> { + credit: Lithic::TransferLimitsResponse::Data::DailyLimit::Credit, + debit: Lithic::TransferLimitsResponse::Data::DailyLimit::Debit + } + + type credit = { limit: Integer, amount_originated: Integer? } + + class Credit < Lithic::Internal::Type::BaseModel + attr_accessor limit: Integer + + attr_accessor amount_originated: Integer? + + def initialize: ( + limit: Integer, + ?amount_originated: Integer? + ) -> void + + def to_hash: -> { limit: Integer, amount_originated: Integer? } + end + + type debit = { limit: Integer, amount_originated: Integer? } + + class Debit < Lithic::Internal::Type::BaseModel + attr_accessor limit: Integer + + attr_accessor amount_originated: Integer? + + def initialize: ( + limit: Integer, + ?amount_originated: Integer? + ) -> void + + def to_hash: -> { limit: Integer, amount_originated: Integer? } + end + end + + type monthly_limit = + { + credit: Lithic::TransferLimitsResponse::Data::MonthlyLimit::Credit, + debit: Lithic::TransferLimitsResponse::Data::MonthlyLimit::Debit + } + + class MonthlyLimit < Lithic::Internal::Type::BaseModel + attr_accessor credit: Lithic::TransferLimitsResponse::Data::MonthlyLimit::Credit + + attr_accessor debit: Lithic::TransferLimitsResponse::Data::MonthlyLimit::Debit + + def initialize: ( + credit: Lithic::TransferLimitsResponse::Data::MonthlyLimit::Credit, + debit: Lithic::TransferLimitsResponse::Data::MonthlyLimit::Debit + ) -> void + + def to_hash: -> { + credit: Lithic::TransferLimitsResponse::Data::MonthlyLimit::Credit, + debit: Lithic::TransferLimitsResponse::Data::MonthlyLimit::Debit + } + + type credit = { limit: Integer, amount_originated: Integer? } + + class Credit < Lithic::Internal::Type::BaseModel + attr_accessor limit: Integer + + attr_accessor amount_originated: Integer? + + def initialize: ( + limit: Integer, + ?amount_originated: Integer? + ) -> void + + def to_hash: -> { limit: Integer, amount_originated: Integer? } + end + + type debit = { limit: Integer, amount_originated: Integer? } + + class Debit < Lithic::Internal::Type::BaseModel + attr_accessor limit: Integer + + attr_accessor amount_originated: Integer? + + def initialize: ( + limit: Integer, + ?amount_originated: Integer? + ) -> void + + def to_hash: -> { limit: Integer, amount_originated: Integer? } + end + end + + type program_limit_per_transaction = + { + credit: Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Credit, + debit: Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Debit + } + + class ProgramLimitPerTransaction < Lithic::Internal::Type::BaseModel + attr_accessor credit: Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Credit + + attr_accessor debit: Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Debit + + def initialize: ( + credit: Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Credit, + debit: Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Debit + ) -> void + + def to_hash: -> { + credit: Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Credit, + debit: Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction::Debit + } + + type credit = { limit: Integer, amount_originated: Integer? } + + class Credit < Lithic::Internal::Type::BaseModel + attr_accessor limit: Integer + + attr_accessor amount_originated: Integer? + + def initialize: ( + limit: Integer, + ?amount_originated: Integer? + ) -> void + + def to_hash: -> { limit: Integer, amount_originated: Integer? } + end + + type debit = { limit: Integer, amount_originated: Integer? } + + class Debit < Lithic::Internal::Type::BaseModel + attr_accessor limit: Integer + + attr_accessor amount_originated: Integer? + + def initialize: ( + limit: Integer, + ?amount_originated: Integer? + ) -> void + + def to_hash: -> { limit: Integer, amount_originated: Integer? } + end + end + end + end + end +end diff --git a/sig/lithic/models/verification_method.rbs b/sig/lithic/models/verification_method.rbs new file mode 100644 index 00000000..5656d5c3 --- /dev/null +++ b/sig/lithic/models/verification_method.rbs @@ -0,0 +1,18 @@ +module Lithic + module Models + type verification_method = + :MANUAL | :MICRO_DEPOSIT | :PRENOTE | :EXTERNALLY_VERIFIED | :UNVERIFIED + + module VerificationMethod + extend Lithic::Internal::Type::Enum + + MANUAL: :MANUAL + MICRO_DEPOSIT: :MICRO_DEPOSIT + PRENOTE: :PRENOTE + EXTERNALLY_VERIFIED: :EXTERNALLY_VERIFIED + UNVERIFIED: :UNVERIFIED + + def self?.values: -> ::Array[Lithic::Models::verification_method] + end + end +end diff --git a/sig/lithic/models/wallet_decisioning_info.rbs b/sig/lithic/models/wallet_decisioning_info.rbs new file mode 100644 index 00000000..a83a6f6d --- /dev/null +++ b/sig/lithic/models/wallet_decisioning_info.rbs @@ -0,0 +1,35 @@ +module Lithic + module Models + type wallet_decisioning_info = + { + account_score: String?, + device_score: String?, + recommended_decision: String?, + recommendation_reasons: ::Array[String]? + } + + class WalletDecisioningInfo < Lithic::Internal::Type::BaseModel + attr_accessor account_score: String? + + attr_accessor device_score: String? + + attr_accessor recommended_decision: String? + + attr_accessor recommendation_reasons: ::Array[String]? + + def initialize: ( + account_score: String?, + device_score: String?, + recommended_decision: String?, + ?recommendation_reasons: ::Array[String]? + ) -> void + + def to_hash: -> { + account_score: String?, + device_score: String?, + recommended_decision: String?, + recommendation_reasons: ::Array[String]? + } + end + end +end diff --git a/sig/lithic/models/webhook_parsed_params.rbs b/sig/lithic/models/webhook_parsed_params.rbs new file mode 100644 index 00000000..33f55329 --- /dev/null +++ b/sig/lithic/models/webhook_parsed_params.rbs @@ -0,0 +1,15 @@ +module Lithic + module Models + type webhook_parsed_params = + { } & Lithic::Internal::Type::request_parameters + + class WebhookParsedParams < Lithic::Internal::Type::BaseModel + extend Lithic::Internal::Type::RequestParameters::Converter + include Lithic::Internal::Type::RequestParameters + + def initialize: (?request_options: Lithic::request_opts) -> void + + def to_hash: -> { request_options: Lithic::RequestOptions } + end + end +end diff --git a/sig/lithic/models/wire_party_details.rbs b/sig/lithic/models/wire_party_details.rbs new file mode 100644 index 00000000..6e1ebacb --- /dev/null +++ b/sig/lithic/models/wire_party_details.rbs @@ -0,0 +1,35 @@ +module Lithic + module Models + type wire_party_details = + { + account_number: String?, + agent_id: String?, + agent_name: String?, + name: String? + } + + class WirePartyDetails < Lithic::Internal::Type::BaseModel + attr_accessor account_number: String? + + attr_accessor agent_id: String? + + attr_accessor agent_name: String? + + attr_accessor name: String? + + def initialize: ( + ?account_number: String?, + ?agent_id: String?, + ?agent_name: String?, + ?name: String? + ) -> void + + def to_hash: -> { + account_number: String?, + agent_id: String?, + agent_name: String?, + name: String? + } + end + end +end diff --git a/sig/lithic/request_options.rbs b/sig/lithic/request_options.rbs new file mode 100644 index 00000000..50bf44bf --- /dev/null +++ b/sig/lithic/request_options.rbs @@ -0,0 +1,34 @@ +module Lithic + type request_opts = + Lithic::RequestOptions | Lithic::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 < Lithic::Internal::Type::BaseModel + def self.validate!: (Lithic::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: ( + ?Lithic::request_options | ::Hash[Symbol, top] values + ) -> void + end +end diff --git a/sig/lithic/resources/account_activity.rbs b/sig/lithic/resources/account_activity.rbs new file mode 100644 index 00000000..03dfa3e7 --- /dev/null +++ b/sig/lithic/resources/account_activity.rbs @@ -0,0 +1,27 @@ +module Lithic + module Resources + class AccountActivity + def list: ( + ?account_token: String, + ?begin_: Time, + ?business_account_token: String, + ?category: Lithic::Models::AccountActivityListParams::category, + ?end_: Time, + ?ending_before: String, + ?financial_account_token: String, + ?page_size: Integer, + ?result: Lithic::Models::AccountActivityListParams::result, + ?starting_after: String, + ?status: Lithic::Models::AccountActivityListParams::status, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::Models::account_activity_list_response] + + def retrieve_transaction: ( + String transaction_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::account_activity_retrieve_transaction_response + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/account_holders.rbs b/sig/lithic/resources/account_holders.rbs new file mode 100644 index 00000000..2087b805 --- /dev/null +++ b/sig/lithic/resources/account_holders.rbs @@ -0,0 +1,73 @@ +module Lithic + module Resources + class AccountHolders + attr_reader entities: Lithic::Resources::AccountHolders::Entities + + def create: ( + body: Lithic::Models::AccountHolderCreateParams::body, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::AccountHolderCreateResponse + + def retrieve: ( + String account_holder_token, + ?request_options: Lithic::request_opts + ) -> Lithic::AccountHolder + + def update: ( + String account_holder_token, + body: Lithic::Models::AccountHolderUpdateParams::body, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::account_holder_update_response + + def list: ( + ?begin_: Time, + ?email: String, + ?end_: Time, + ?ending_before: String, + ?external_id: String, + ?first_name: String, + ?last_name: String, + ?legal_business_name: String, + ?limit: Integer, + ?phone_number: String, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::SinglePage[Lithic::AccountHolder] + + def list_documents: ( + String account_holder_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::AccountHolderListDocumentsResponse + + def retrieve_document: ( + String document_token, + account_holder_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Document + + def simulate_enrollment_document_review: ( + document_upload_token: String, + status: Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::status, + ?accepted_entity_status_reasons: ::Array[String], + ?status_reason: Lithic::Models::AccountHolderSimulateEnrollmentDocumentReviewParams::status_reason, + ?request_options: Lithic::request_opts + ) -> Lithic::Document + + def simulate_enrollment_review: ( + ?account_holder_token: String, + ?status: Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status, + ?status_reasons: ::Array[Lithic::Models::AccountHolderSimulateEnrollmentReviewParams::status_reason], + ?request_options: Lithic::request_opts + ) -> Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse + + def upload_document: ( + String account_holder_token, + document_type: Lithic::Models::AccountHolderUploadDocumentParams::document_type, + entity_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Document + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/account_holders/entities.rbs b/sig/lithic/resources/account_holders/entities.rbs new file mode 100644 index 00000000..d7750b92 --- /dev/null +++ b/sig/lithic/resources/account_holders/entities.rbs @@ -0,0 +1,28 @@ +module Lithic + module Resources + class AccountHolders + class Entities + def create: ( + String account_holder_token, + address: Lithic::AccountHolders::EntityCreateParams::Address, + dob: String, + email: String, + first_name: String, + government_id: String, + last_name: String, + phone_number: String, + type: Lithic::Models::TransactionMonitoring::entity_type, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::AccountHolders::EntityCreateResponse + + def delete: ( + String entity_token, + account_holder_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::AccountHolders::AccountHolderEntity + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/accounts.rbs b/sig/lithic/resources/accounts.rbs new file mode 100644 index 00000000..fced6c59 --- /dev/null +++ b/sig/lithic/resources/accounts.rbs @@ -0,0 +1,43 @@ +module Lithic + module Resources + class Accounts + def retrieve: ( + String account_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Account + + def update: ( + String account_token, + ?comment: String, + ?daily_spend_limit: Integer, + ?lifetime_spend_limit: Integer, + ?monthly_spend_limit: Integer, + ?state: Lithic::Models::AccountUpdateParams::state, + ?substatus: Lithic::Models::AccountUpdateParams::substatus?, + ?verification_address: Lithic::AccountUpdateParams::VerificationAddress, + ?request_options: Lithic::request_opts + ) -> Lithic::Account + + def list: ( + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::Account] + + def retrieve_signals: ( + String account_token, + ?request_options: Lithic::request_opts + ) -> Lithic::SignalsResponse + + def retrieve_spend_limits: ( + String account_token, + ?request_options: Lithic::request_opts + ) -> Lithic::AccountSpendLimits + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/auth_rules.rbs b/sig/lithic/resources/auth_rules.rbs new file mode 100644 index 00000000..a9a36ea3 --- /dev/null +++ b/sig/lithic/resources/auth_rules.rbs @@ -0,0 +1,9 @@ +module Lithic + module Resources + class AuthRules + attr_reader v2: Lithic::Resources::AuthRules::V2 + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/auth_rules/v2.rbs b/sig/lithic/resources/auth_rules/v2.rbs new file mode 100644 index 00000000..a90b6874 --- /dev/null +++ b/sig/lithic/resources/auth_rules/v2.rbs @@ -0,0 +1,87 @@ +module Lithic + module Resources + class AuthRules + class V2 + attr_reader backtests: Lithic::Resources::AuthRules::V2::Backtests + + def create: ( + body: Lithic::Models::AuthRules::V2CreateParams::body, + ?request_options: Lithic::request_opts + ) -> Lithic::AuthRules::AuthRule + + def retrieve: ( + String auth_rule_token, + ?request_options: Lithic::request_opts + ) -> Lithic::AuthRules::AuthRule + + def update: ( + String auth_rule_token, + body: Lithic::Models::AuthRules::V2UpdateParams::body, + ?request_options: Lithic::request_opts + ) -> Lithic::AuthRules::AuthRule + + def list: ( + ?account_token: String, + ?business_account_token: String, + ?card_token: String, + ?ending_before: String, + ?event_stream: Lithic::Models::AuthRules::event_stream, + ?event_streams: ::Array[Lithic::Models::AuthRules::event_stream], + ?page_size: Integer, + ?scope: Lithic::Models::AuthRules::V2ListParams::scope, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::AuthRules::AuthRule] + + def delete: ( + String auth_rule_token, + ?request_options: Lithic::request_opts + ) -> nil + + def draft: ( + String auth_rule_token, + ?parameters: Lithic::Models::AuthRules::V2DraftParams::parameters?, + ?request_options: Lithic::request_opts + ) -> Lithic::AuthRules::AuthRule + + def list_results: ( + ?auth_rule_token: String, + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?event_token: String, + ?has_actions: bool, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::Models::AuthRules::v2_list_results_response] + + def list_versions: ( + String auth_rule_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::AuthRules::V2ListVersionsResponse + + def promote: ( + String auth_rule_token, + ?request_options: Lithic::request_opts + ) -> Lithic::AuthRules::AuthRule + + def retrieve_features: ( + String auth_rule_token, + ?account_token: String, + ?card_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::AuthRules::V2RetrieveFeaturesResponse + + def retrieve_report: ( + String auth_rule_token, + begin_: Date, + end_: Date, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::AuthRules::V2RetrieveReportResponse + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/auth_rules/v2/backtests.rbs b/sig/lithic/resources/auth_rules/v2/backtests.rbs new file mode 100644 index 00000000..f0ef44b9 --- /dev/null +++ b/sig/lithic/resources/auth_rules/v2/backtests.rbs @@ -0,0 +1,24 @@ +module Lithic + module Resources + class AuthRules + class V2 + class Backtests + def create: ( + String auth_rule_token, + ?end_: Time, + ?start: Time, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::AuthRules::V2::BacktestCreateResponse + + def retrieve: ( + String auth_rule_backtest_token, + auth_rule_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::AuthRules::V2::BacktestResults + + def initialize: (client: Lithic::Client) -> void + end + end + end + end +end diff --git a/sig/lithic/resources/auth_stream_enrollment.rbs b/sig/lithic/resources/auth_stream_enrollment.rbs new file mode 100644 index 00000000..ab11d071 --- /dev/null +++ b/sig/lithic/resources/auth_stream_enrollment.rbs @@ -0,0 +1,13 @@ +module Lithic + module Resources + class AuthStreamEnrollment + def retrieve_secret: ( + ?request_options: Lithic::request_opts + ) -> Lithic::AuthStreamSecret + + def rotate_secret: (?request_options: Lithic::request_opts) -> nil + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/balances.rbs b/sig/lithic/resources/balances.rbs new file mode 100644 index 00000000..56daeebb --- /dev/null +++ b/sig/lithic/resources/balances.rbs @@ -0,0 +1,15 @@ +module Lithic + module Resources + class Balances + def list: ( + ?account_token: String, + ?balance_date: Time, + ?business_account_token: String, + ?financial_account_type: Lithic::Models::BalanceListParams::financial_account_type, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::SinglePage[Lithic::Balance] + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/book_transfers.rbs b/sig/lithic/resources/book_transfers.rbs new file mode 100644 index 00000000..84570912 --- /dev/null +++ b/sig/lithic/resources/book_transfers.rbs @@ -0,0 +1,54 @@ +module Lithic + module Resources + class BookTransfers + def create: ( + amount: Integer, + category: Lithic::Models::BookTransferCreateParams::category, + from_financial_account_token: String, + subtype: String, + to_financial_account_token: String, + type: Lithic::Models::BookTransferCreateParams::type_, + ?token: String, + ?external_id: String, + ?hold_token: String, + ?memo: String, + ?on_closed_account: Lithic::Models::BookTransferCreateParams::on_closed_account, + ?request_options: Lithic::request_opts + ) -> Lithic::BookTransferResponse + + def retrieve: ( + String book_transfer_token, + ?request_options: Lithic::request_opts + ) -> Lithic::BookTransferResponse + + def list: ( + ?account_token: String, + ?begin_: Time, + ?business_account_token: String, + ?category: Lithic::Models::BookTransferListParams::category, + ?end_: Time, + ?ending_before: String, + ?financial_account_token: String, + ?page_size: Integer, + ?result: Lithic::Models::BookTransferListParams::result, + ?starting_after: String, + ?status: Lithic::Models::BookTransferListParams::status, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::BookTransferResponse] + + def retry_: ( + String book_transfer_token, + retry_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::BookTransferResponse + + def reverse: ( + String book_transfer_token, + ?memo: String, + ?request_options: Lithic::request_opts + ) -> Lithic::BookTransferResponse + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/card_authorizations.rbs b/sig/lithic/resources/card_authorizations.rbs new file mode 100644 index 00000000..b7a303cd --- /dev/null +++ b/sig/lithic/resources/card_authorizations.rbs @@ -0,0 +1,13 @@ +module Lithic + module Resources + class CardAuthorizations + def challenge_response: ( + String event_token, + response: Lithic::Models::CardAuthorizationChallengeResponseParams::response, + ?request_options: Lithic::request_opts + ) -> nil + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/card_bulk_orders.rbs b/sig/lithic/resources/card_bulk_orders.rbs new file mode 100644 index 00000000..4936d985 --- /dev/null +++ b/sig/lithic/resources/card_bulk_orders.rbs @@ -0,0 +1,34 @@ +module Lithic + module Resources + class CardBulkOrders + def create: ( + customer_product_id: String, + shipping_address: top, + shipping_method: Lithic::Models::CardBulkOrderCreateParams::shipping_method, + ?request_options: Lithic::request_opts + ) -> Lithic::CardBulkOrder + + def retrieve: ( + String bulk_order_token, + ?request_options: Lithic::request_opts + ) -> Lithic::CardBulkOrder + + def update: ( + String bulk_order_token, + status: Lithic::Models::CardBulkOrderUpdateParams::status, + ?request_options: Lithic::request_opts + ) -> Lithic::CardBulkOrder + + def list: ( + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::CardBulkOrder] + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/card_programs.rbs b/sig/lithic/resources/card_programs.rbs new file mode 100644 index 00000000..9f0ad859 --- /dev/null +++ b/sig/lithic/resources/card_programs.rbs @@ -0,0 +1,19 @@ +module Lithic + module Resources + class CardPrograms + def retrieve: ( + String card_program_token, + ?request_options: Lithic::request_opts + ) -> Lithic::CardProgram + + def list: ( + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::CardProgram] + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/cards.rbs b/sig/lithic/resources/cards.rbs new file mode 100644 index 00000000..71d04318 --- /dev/null +++ b/sig/lithic/resources/cards.rbs @@ -0,0 +1,138 @@ +module Lithic + module Resources + class Cards + attr_reader balances: Lithic::Resources::Cards::Balances + + attr_reader financial_transactions: Lithic::Resources::Cards::FinancialTransactions + + def create: ( + type: Lithic::Models::CardCreateParams::type_, + ?account_token: String, + ?bulk_order_token: String, + ?card_program_token: String, + ?carrier: Lithic::Carrier, + ?digital_card_art_token: String, + ?exp_month: String, + ?exp_year: String, + ?memo: String, + ?pin: String, + ?product_id: String, + ?replacement_account_token: String, + ?replacement_comment: String, + ?replacement_for: String, + ?replacement_substatus: Lithic::Models::CardCreateParams::replacement_substatus, + ?shipping_address: Lithic::ShippingAddress, + ?shipping_method: Lithic::Models::CardCreateParams::shipping_method, + ?spend_limit: Integer, + ?spend_limit_duration: Lithic::Models::spend_limit_duration, + ?state: Lithic::Models::CardCreateParams::state, + ?idempotency_key: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Card + + def retrieve: ( + String card_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Card + + def update: ( + String card_token, + ?comment: String, + ?digital_card_art_token: String, + ?memo: String, + ?network_program_token: String, + ?pin: String, + ?pin_status: Lithic::Models::CardUpdateParams::pin_status, + ?spend_limit: Integer, + ?spend_limit_duration: Lithic::Models::spend_limit_duration, + ?state: Lithic::Models::CardUpdateParams::state, + ?substatus: Lithic::Models::CardUpdateParams::substatus, + ?request_options: Lithic::request_opts + ) -> Lithic::Card + + def list: ( + ?account_token: String, + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?memo: String, + ?page_size: Integer, + ?starting_after: String, + ?state: Lithic::Models::CardListParams::state, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::NonPCICard] + + def convert_physical: ( + String card_token, + shipping_address: Lithic::ShippingAddress, + ?carrier: Lithic::Carrier, + ?product_id: String, + ?shipping_method: Lithic::Models::CardConvertPhysicalParams::shipping_method, + ?request_options: Lithic::request_opts + ) -> Lithic::Card + + def embed: ( + embed_request: String, + hmac: String, + ?request_options: Lithic::request_opts + ) -> String + + def provision: ( + String card_token, + ?certificate: String, + ?client_device_id: String, + ?client_wallet_account_id: String, + ?digital_wallet: Lithic::Models::CardProvisionParams::digital_wallet, + ?nonce: String, + ?nonce_signature: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::CardProvisionResponse + + def reissue: ( + String card_token, + ?carrier: Lithic::Carrier, + ?product_id: String, + ?shipping_address: Lithic::ShippingAddress, + ?shipping_method: Lithic::Models::CardReissueParams::shipping_method, + ?request_options: Lithic::request_opts + ) -> Lithic::Card + + def renew: ( + String card_token, + shipping_address: Lithic::ShippingAddress, + ?carrier: Lithic::Carrier, + ?exp_month: String, + ?exp_year: String, + ?product_id: String, + ?shipping_method: Lithic::Models::CardRenewParams::shipping_method, + ?request_options: Lithic::request_opts + ) -> Lithic::Card + + def retrieve_signals: ( + String card_token, + ?request_options: Lithic::request_opts + ) -> Lithic::SignalsResponse + + def retrieve_spend_limits: ( + String card_token, + ?request_options: Lithic::request_opts + ) -> Lithic::CardSpendLimits + + def search_by_pan: ( + pan: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Card + + def web_provision: ( + String card_token, + ?client_device_id: String, + ?client_wallet_account_id: String, + ?digital_wallet: Lithic::Models::CardWebProvisionParams::digital_wallet, + ?server_session_id: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::card_web_provision_response + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/cards/balances.rbs b/sig/lithic/resources/cards/balances.rbs new file mode 100644 index 00000000..b5bf71df --- /dev/null +++ b/sig/lithic/resources/cards/balances.rbs @@ -0,0 +1,16 @@ +module Lithic + module Resources + class Cards + class Balances + def list: ( + String card_token, + ?balance_date: Time, + ?last_transaction_event_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::SinglePage[Lithic::FinancialAccountBalance] + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/cards/financial_transactions.rbs b/sig/lithic/resources/cards/financial_transactions.rbs new file mode 100644 index 00000000..ac174a31 --- /dev/null +++ b/sig/lithic/resources/cards/financial_transactions.rbs @@ -0,0 +1,27 @@ +module Lithic + module Resources + class Cards + class FinancialTransactions + def retrieve: ( + String financial_transaction_token, + card_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::FinancialTransaction + + def list: ( + String card_token, + ?begin_: Time, + ?category: Lithic::Models::Cards::FinancialTransactionListParams::category, + ?end_: Time, + ?ending_before: String, + ?result: Lithic::Models::Cards::FinancialTransactionListParams::result, + ?starting_after: String, + ?status: Lithic::Models::Cards::FinancialTransactionListParams::status, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::SinglePage[Lithic::FinancialTransaction] + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/credit_products.rbs b/sig/lithic/resources/credit_products.rbs new file mode 100644 index 00000000..d45757f6 --- /dev/null +++ b/sig/lithic/resources/credit_products.rbs @@ -0,0 +1,11 @@ +module Lithic + module Resources + class CreditProducts + attr_reader extended_credit: Lithic::Resources::CreditProducts::ExtendedCredit + + attr_reader prime_rates: Lithic::Resources::CreditProducts::PrimeRates + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/credit_products/extended_credit.rbs b/sig/lithic/resources/credit_products/extended_credit.rbs new file mode 100644 index 00000000..b1d020ae --- /dev/null +++ b/sig/lithic/resources/credit_products/extended_credit.rbs @@ -0,0 +1,14 @@ +module Lithic + module Resources + class CreditProducts + class ExtendedCredit + def retrieve: ( + String credit_product_token, + ?request_options: Lithic::request_opts + ) -> Lithic::CreditProducts::CreditProductsExtendedCredit + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/credit_products/prime_rates.rbs b/sig/lithic/resources/credit_products/prime_rates.rbs new file mode 100644 index 00000000..87dba96e --- /dev/null +++ b/sig/lithic/resources/credit_products/prime_rates.rbs @@ -0,0 +1,23 @@ +module Lithic + module Resources + class CreditProducts + class PrimeRates + def create: ( + String credit_product_token, + effective_date: Date, + rate: String, + ?request_options: Lithic::request_opts + ) -> nil + + def retrieve: ( + String credit_product_token, + ?ending_before: Date, + ?starting_after: Date, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::CreditProducts::PrimeRateRetrieveResponse + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/digital_card_art.rbs b/sig/lithic/resources/digital_card_art.rbs new file mode 100644 index 00000000..0f9db1a9 --- /dev/null +++ b/sig/lithic/resources/digital_card_art.rbs @@ -0,0 +1,19 @@ +module Lithic + module Resources + class DigitalCardArt + def retrieve: ( + String digital_card_art_token, + ?request_options: Lithic::request_opts + ) -> Lithic::DigitalCardArtAPI + + def list: ( + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::DigitalCardArtAPI] + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/disputes.rbs b/sig/lithic/resources/disputes.rbs new file mode 100644 index 00000000..02b2207b --- /dev/null +++ b/sig/lithic/resources/disputes.rbs @@ -0,0 +1,74 @@ +module Lithic + module Resources + class Disputes + def create: ( + amount: Integer, + reason: Lithic::Models::DisputeCreateParams::reason, + transaction_token: String, + ?customer_filed_date: Time, + ?customer_note: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Dispute + + def retrieve: ( + String dispute_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Dispute + + def update: ( + String dispute_token, + ?amount: Integer, + ?customer_filed_date: Time, + ?customer_note: String, + ?reason: Lithic::Models::DisputeUpdateParams::reason, + ?request_options: Lithic::request_opts + ) -> Lithic::Dispute + + def list: ( + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?status: Lithic::Models::DisputeListParams::status, + ?transaction_tokens: ::Array[String], + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::Dispute] + + def delete: ( + String dispute_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Dispute + + def delete_evidence: ( + String evidence_token, + dispute_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::DisputeEvidence + + def initiate_evidence_upload: ( + String dispute_token, + ?filename: String, + ?request_options: Lithic::request_opts + ) -> Lithic::DisputeEvidence + + def list_evidences: ( + String dispute_token, + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::DisputeEvidence] + + def retrieve_evidence: ( + String evidence_token, + dispute_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::DisputeEvidence + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/disputes_v2.rbs b/sig/lithic/resources/disputes_v2.rbs new file mode 100644 index 00000000..0c961b1c --- /dev/null +++ b/sig/lithic/resources/disputes_v2.rbs @@ -0,0 +1,24 @@ +module Lithic + module Resources + class DisputesV2 + def retrieve: ( + String dispute_token, + ?request_options: Lithic::request_opts + ) -> Lithic::DisputeV2 + + def list: ( + ?account_token: String, + ?begin_: Time, + ?card_token: String, + ?disputed_transaction_token: String, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::DisputeV2] + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/events.rbs b/sig/lithic/resources/events.rbs new file mode 100644 index 00000000..5ce7aa05 --- /dev/null +++ b/sig/lithic/resources/events.rbs @@ -0,0 +1,38 @@ +module Lithic + module Resources + class Events + attr_reader subscriptions: Lithic::Resources::Events::Subscriptions + + attr_reader event_subscriptions: Lithic::Resources::Events::EventSubscriptions + + def retrieve: ( + String event_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Event + + def list: ( + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?event_types: ::Array[Lithic::Models::EventListParams::event_type], + ?page_size: Integer, + ?starting_after: String, + ?with_content: bool, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::Event] + + def list_attempts: ( + String event_token, + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?status: Lithic::Models::EventListAttemptsParams::status, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::MessageAttempt] + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/events/event_subscriptions.rbs b/sig/lithic/resources/events/event_subscriptions.rbs new file mode 100644 index 00000000..e0972599 --- /dev/null +++ b/sig/lithic/resources/events/event_subscriptions.rbs @@ -0,0 +1,15 @@ +module Lithic + module Resources + class Events + class EventSubscriptions + def resend: ( + String event_subscription_token, + event_token: String, + ?request_options: Lithic::request_opts + ) -> nil + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/events/subscriptions.rbs b/sig/lithic/resources/events/subscriptions.rbs new file mode 100644 index 00000000..c52fae65 --- /dev/null +++ b/sig/lithic/resources/events/subscriptions.rbs @@ -0,0 +1,84 @@ +module Lithic + module Resources + class Events + class Subscriptions + def create: ( + url: String, + ?description: String, + ?disabled: bool, + ?event_types: ::Array[Lithic::Models::Events::SubscriptionCreateParams::event_type], + ?request_options: Lithic::request_opts + ) -> Lithic::EventSubscription + + def retrieve: ( + String event_subscription_token, + ?request_options: Lithic::request_opts + ) -> Lithic::EventSubscription + + def update: ( + String event_subscription_token, + url: String, + ?description: String, + ?disabled: bool, + ?event_types: ::Array[Lithic::Models::Events::SubscriptionUpdateParams::event_type], + ?request_options: Lithic::request_opts + ) -> Lithic::EventSubscription + + def list: ( + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::EventSubscription] + + def delete: ( + String event_subscription_token, + ?request_options: Lithic::request_opts + ) -> nil + + def list_attempts: ( + String event_subscription_token, + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?status: Lithic::Models::Events::SubscriptionListAttemptsParams::status, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::MessageAttempt] + + def recover: ( + String event_subscription_token, + ?begin_: Time, + ?end_: Time, + ?request_options: Lithic::request_opts + ) -> nil + + def replay_missing: ( + String event_subscription_token, + ?begin_: Time, + ?end_: Time, + ?request_options: Lithic::request_opts + ) -> nil + + def retrieve_secret: ( + String event_subscription_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::Events::SubscriptionRetrieveSecretResponse + + def rotate_secret: ( + String event_subscription_token, + ?request_options: Lithic::request_opts + ) -> nil + + def send_simulated_example: ( + String event_subscription_token, + ?event_type: Lithic::Models::Events::SubscriptionSendSimulatedExampleParams::event_type, + ?request_options: Lithic::request_opts + ) -> nil + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/external_bank_accounts.rbs b/sig/lithic/resources/external_bank_accounts.rbs new file mode 100644 index 00000000..6794a496 --- /dev/null +++ b/sig/lithic/resources/external_bank_accounts.rbs @@ -0,0 +1,75 @@ +module Lithic + module Resources + class ExternalBankAccounts + attr_reader micro_deposits: Lithic::Resources::ExternalBankAccounts::MicroDeposits + + def create: ( + body: Lithic::Models::ExternalBankAccountCreateParams::body, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::ExternalBankAccountCreateResponse + + def retrieve: ( + String external_bank_account_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::ExternalBankAccountRetrieveResponse + + def update: ( + String external_bank_account_token, + ?address: Lithic::ExternalBankAccountAddress, + ?company_id: String, + ?dob: Date, + ?doing_business_as: String, + ?name: String, + ?owner: String, + ?owner_type: Lithic::Models::owner_type, + ?type: Lithic::Models::ExternalBankAccountUpdateParams::type_, + ?user_defined_id: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::ExternalBankAccountUpdateResponse + + def list: ( + ?account_token: String, + ?account_types: ::Array[Lithic::Models::ExternalBankAccountListParams::account_type], + ?countries: ::Array[String], + ?ending_before: String, + ?owner_types: ::Array[Lithic::Models::owner_type], + ?page_size: Integer, + ?starting_after: String, + ?states: ::Array[Lithic::Models::ExternalBankAccountListParams::state], + ?verification_states: ::Array[Lithic::Models::ExternalBankAccountListParams::verification_state], + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::Models::ExternalBankAccountListResponse] + + def pause: ( + String external_bank_account_token, + ?request_options: Lithic::request_opts + ) -> Lithic::ExternalBankAccount + + def retry_micro_deposits: ( + String external_bank_account_token, + ?financial_account_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse + + def retry_prenote: ( + String external_bank_account_token, + ?financial_account_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::ExternalBankAccount + + def set_verification_method: ( + String external_bank_account_token, + verification_method: Lithic::Models::ExternalBankAccountSetVerificationMethodParams::verification_method, + ?financial_account_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::ExternalBankAccount + + def unpause: ( + String external_bank_account_token, + ?request_options: Lithic::request_opts + ) -> Lithic::ExternalBankAccount + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/external_bank_accounts/micro_deposits.rbs b/sig/lithic/resources/external_bank_accounts/micro_deposits.rbs new file mode 100644 index 00000000..836cdd0b --- /dev/null +++ b/sig/lithic/resources/external_bank_accounts/micro_deposits.rbs @@ -0,0 +1,15 @@ +module Lithic + module Resources + class ExternalBankAccounts + class MicroDeposits + def create: ( + String external_bank_account_token, + micro_deposits: ::Array[Integer], + ?request_options: Lithic::request_opts + ) -> Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/external_payments.rbs b/sig/lithic/resources/external_payments.rbs new file mode 100644 index 00000000..8ccaec77 --- /dev/null +++ b/sig/lithic/resources/external_payments.rbs @@ -0,0 +1,68 @@ +module Lithic + module Resources + class ExternalPayments + def create: ( + amount: Integer, + category: Lithic::Models::ExternalPaymentCreateParams::category, + effective_date: Date, + financial_account_token: String, + payment_type: Lithic::Models::ExternalPaymentCreateParams::payment_type, + ?token: String, + ?memo: String, + ?progress_to: Lithic::Models::ExternalPaymentCreateParams::progress_to, + ?user_defined_id: String, + ?request_options: Lithic::request_opts + ) -> Lithic::ExternalPayment + + def retrieve: ( + String external_payment_token, + ?request_options: Lithic::request_opts + ) -> Lithic::ExternalPayment + + def list: ( + ?begin_: Time, + ?business_account_token: String, + ?category: Lithic::Models::ExternalPaymentListParams::category, + ?end_: Time, + ?ending_before: String, + ?financial_account_token: String, + ?page_size: Integer, + ?result: Lithic::Models::ExternalPaymentListParams::result, + ?starting_after: String, + ?status: Lithic::Models::ExternalPaymentListParams::status, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::ExternalPayment] + + def cancel: ( + String external_payment_token, + effective_date: Date, + ?memo: String, + ?request_options: Lithic::request_opts + ) -> Lithic::ExternalPayment + + def release: ( + String external_payment_token, + effective_date: Date, + ?memo: String, + ?request_options: Lithic::request_opts + ) -> Lithic::ExternalPayment + + def reverse: ( + String external_payment_token, + effective_date: Date, + ?memo: String, + ?request_options: Lithic::request_opts + ) -> Lithic::ExternalPayment + + def settle: ( + String external_payment_token, + effective_date: Date, + ?memo: String, + ?progress_to: Lithic::Models::ExternalPaymentSettleParams::progress_to, + ?request_options: Lithic::request_opts + ) -> Lithic::ExternalPayment + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/financial_accounts.rbs b/sig/lithic/resources/financial_accounts.rbs new file mode 100644 index 00000000..7a607491 --- /dev/null +++ b/sig/lithic/resources/financial_accounts.rbs @@ -0,0 +1,62 @@ +module Lithic + module Resources + class FinancialAccounts + attr_reader balances: Lithic::Resources::FinancialAccounts::Balances + + attr_reader financial_transactions: Lithic::Resources::FinancialAccounts::FinancialTransactions + + attr_reader credit_configuration: Lithic::Resources::FinancialAccounts::CreditConfiguration + + attr_reader statements: Lithic::Resources::FinancialAccounts::Statements + + attr_reader loan_tapes: Lithic::Resources::FinancialAccounts::LoanTapes + + attr_reader loan_tape_configuration: Lithic::Resources::FinancialAccounts::LoanTapeConfiguration + + attr_reader interest_tier_schedule: Lithic::Resources::FinancialAccounts::InterestTierSchedule + + def create: ( + nickname: String, + type: Lithic::Models::FinancialAccountCreateParams::type_, + ?account_token: String, + ?is_for_benefit_of: bool, + ?idempotency_key: String, + ?request_options: Lithic::request_opts + ) -> Lithic::FinancialAccount + + def retrieve: ( + String financial_account_token, + ?request_options: Lithic::request_opts + ) -> Lithic::FinancialAccount + + def update: ( + String financial_account_token, + ?nickname: String, + ?request_options: Lithic::request_opts + ) -> Lithic::FinancialAccount + + def list: ( + ?account_token: String, + ?business_account_token: String, + ?type: Lithic::Models::FinancialAccountListParams::type_, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::SinglePage[Lithic::FinancialAccount] + + def register_account_number: ( + String financial_account_token, + account_number: String, + ?request_options: Lithic::request_opts + ) -> nil + + def update_status: ( + String financial_account_token, + status: Lithic::Models::FinancialAccountUpdateStatusParams::status, + substatus: Lithic::Models::FinancialAccountUpdateStatusParams::substatus?, + ?user_defined_status: String, + ?request_options: Lithic::request_opts + ) -> Lithic::FinancialAccount + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/financial_accounts/balances.rbs b/sig/lithic/resources/financial_accounts/balances.rbs new file mode 100644 index 00000000..3bf91e50 --- /dev/null +++ b/sig/lithic/resources/financial_accounts/balances.rbs @@ -0,0 +1,16 @@ +module Lithic + module Resources + class FinancialAccounts + class Balances + def list: ( + String financial_account_token, + ?balance_date: Time, + ?last_transaction_event_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::SinglePage[Lithic::FinancialAccountBalance] + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/financial_accounts/credit_configuration.rbs b/sig/lithic/resources/financial_accounts/credit_configuration.rbs new file mode 100644 index 00000000..1de579e6 --- /dev/null +++ b/sig/lithic/resources/financial_accounts/credit_configuration.rbs @@ -0,0 +1,24 @@ +module Lithic + module Resources + class FinancialAccounts + class CreditConfiguration + def retrieve: ( + String financial_account_token, + ?request_options: Lithic::request_opts + ) -> Lithic::FinancialAccounts::FinancialAccountCreditConfig + + def update: ( + String financial_account_token, + ?auto_collection_configuration: Lithic::FinancialAccounts::CreditConfigurationUpdateParams::AutoCollectionConfiguration, + ?credit_limit: Integer, + ?credit_product_token: String, + ?external_bank_account_token: String, + ?tier: String, + ?request_options: Lithic::request_opts + ) -> Lithic::FinancialAccounts::FinancialAccountCreditConfig + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/financial_accounts/financial_transactions.rbs b/sig/lithic/resources/financial_accounts/financial_transactions.rbs new file mode 100644 index 00000000..865c7671 --- /dev/null +++ b/sig/lithic/resources/financial_accounts/financial_transactions.rbs @@ -0,0 +1,27 @@ +module Lithic + module Resources + class FinancialAccounts + class FinancialTransactions + def retrieve: ( + String financial_transaction_token, + financial_account_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::FinancialTransaction + + def list: ( + String financial_account_token, + ?begin_: Time, + ?category: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::category, + ?end_: Time, + ?ending_before: String, + ?result: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::result, + ?starting_after: String, + ?status: Lithic::Models::FinancialAccounts::FinancialTransactionListParams::status, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::SinglePage[Lithic::FinancialTransaction] + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/financial_accounts/interest_tier_schedule.rbs b/sig/lithic/resources/financial_accounts/interest_tier_schedule.rbs new file mode 100644 index 00000000..f17fea9a --- /dev/null +++ b/sig/lithic/resources/financial_accounts/interest_tier_schedule.rbs @@ -0,0 +1,48 @@ +module Lithic + module Resources + class FinancialAccounts + class InterestTierSchedule + def create: ( + String financial_account_token, + credit_product_token: String, + effective_date: Date, + ?penalty_rates: top, + ?tier_name: String, + ?tier_rates: top, + ?request_options: Lithic::request_opts + ) -> Lithic::FinancialAccounts::FinancialAccountsInterestTierSchedule + + def retrieve: ( + Date effective_date, + financial_account_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::FinancialAccounts::FinancialAccountsInterestTierSchedule + + def update: ( + Date effective_date, + financial_account_token: String, + ?penalty_rates: top, + ?tier_name: String, + ?tier_rates: top, + ?request_options: Lithic::request_opts + ) -> Lithic::FinancialAccounts::FinancialAccountsInterestTierSchedule + + def list: ( + String financial_account_token, + ?after_date: Date, + ?before_date: Date, + ?for_date: Date, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::SinglePage[Lithic::FinancialAccounts::FinancialAccountsInterestTierSchedule] + + def delete: ( + Date effective_date, + financial_account_token: String, + ?request_options: Lithic::request_opts + ) -> nil + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/financial_accounts/loan_tape_configuration.rbs b/sig/lithic/resources/financial_accounts/loan_tape_configuration.rbs new file mode 100644 index 00000000..6f9c8fa7 --- /dev/null +++ b/sig/lithic/resources/financial_accounts/loan_tape_configuration.rbs @@ -0,0 +1,14 @@ +module Lithic + module Resources + class FinancialAccounts + class LoanTapeConfiguration + def retrieve: ( + String financial_account_token, + ?request_options: Lithic::request_opts + ) -> Lithic::FinancialAccounts::FinancialAccountsLoanTapeConfiguration + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/financial_accounts/loan_tapes.rbs b/sig/lithic/resources/financial_accounts/loan_tapes.rbs new file mode 100644 index 00000000..f033b2e7 --- /dev/null +++ b/sig/lithic/resources/financial_accounts/loan_tapes.rbs @@ -0,0 +1,25 @@ +module Lithic + module Resources + class FinancialAccounts + class LoanTapes + def retrieve: ( + String loan_tape_token, + financial_account_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::FinancialAccounts::LoanTape + + def list: ( + String financial_account_token, + ?begin_: Date, + ?end_: Date, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::FinancialAccounts::LoanTape] + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/financial_accounts/statements.rbs b/sig/lithic/resources/financial_accounts/statements.rbs new file mode 100644 index 00000000..320c4926 --- /dev/null +++ b/sig/lithic/resources/financial_accounts/statements.rbs @@ -0,0 +1,28 @@ +module Lithic + module Resources + class FinancialAccounts + class Statements + attr_reader line_items: Lithic::Resources::FinancialAccounts::Statements::LineItems + + def retrieve: ( + String statement_token, + financial_account_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::FinancialAccounts::Statement + + def list: ( + String financial_account_token, + ?begin_: Date, + ?end_: Date, + ?ending_before: String, + ?include_initial_statements: bool, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::FinancialAccounts::Statement] + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/financial_accounts/statements/line_items.rbs b/sig/lithic/resources/financial_accounts/statements/line_items.rbs new file mode 100644 index 00000000..4b6be067 --- /dev/null +++ b/sig/lithic/resources/financial_accounts/statements/line_items.rbs @@ -0,0 +1,20 @@ +module Lithic + module Resources + class FinancialAccounts + class Statements + class LineItems + def list: ( + String statement_token, + financial_account_token: String, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::FinancialAccounts::Statements::StatementLineItems::Data] + + def initialize: (client: Lithic::Client) -> void + end + end + end + end +end diff --git a/sig/lithic/resources/fraud.rbs b/sig/lithic/resources/fraud.rbs new file mode 100644 index 00000000..e6189c10 --- /dev/null +++ b/sig/lithic/resources/fraud.rbs @@ -0,0 +1,9 @@ +module Lithic + module Resources + class Fraud + attr_reader transactions: Lithic::Resources::Fraud::Transactions + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/fraud/transactions.rbs b/sig/lithic/resources/fraud/transactions.rbs new file mode 100644 index 00000000..0003ac01 --- /dev/null +++ b/sig/lithic/resources/fraud/transactions.rbs @@ -0,0 +1,22 @@ +module Lithic + module Resources + class Fraud + class Transactions + def retrieve: ( + String transaction_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::Fraud::TransactionRetrieveResponse + + def report: ( + String transaction_token, + fraud_status: Lithic::Models::Fraud::TransactionReportParams::fraud_status, + ?comment: String, + ?fraud_type: Lithic::Models::Fraud::TransactionReportParams::fraud_type, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::Fraud::TransactionReportResponse + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/funding_events.rbs b/sig/lithic/resources/funding_events.rbs new file mode 100644 index 00000000..b2aa6a85 --- /dev/null +++ b/sig/lithic/resources/funding_events.rbs @@ -0,0 +1,24 @@ +module Lithic + module Resources + class FundingEvents + def retrieve: ( + String funding_event_token, + ?request_options: Lithic::request_opts + ) -> Lithic::FundingEvent + + def list: ( + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::FundingEvent] + + def retrieve_details: ( + String funding_event_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::FundingEventRetrieveDetailsResponse + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/holds.rbs b/sig/lithic/resources/holds.rbs new file mode 100644 index 00000000..f4725933 --- /dev/null +++ b/sig/lithic/resources/holds.rbs @@ -0,0 +1,39 @@ +module Lithic + module Resources + class Holds + def create: ( + String financial_account_token, + amount: Integer, + ?token: String, + ?expiration_datetime: Time, + ?memo: String?, + ?user_defined_id: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Hold + + def retrieve: ( + String hold_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Hold + + def list: ( + String financial_account_token, + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?status: Lithic::Models::HoldListParams::status, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::Hold] + + def `void`: ( + String hold_token, + ?memo: String?, + ?request_options: Lithic::request_opts + ) -> Lithic::Hold + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/internal_transaction.rbs b/sig/lithic/resources/internal_transaction.rbs new file mode 100644 index 00000000..01bb87bf --- /dev/null +++ b/sig/lithic/resources/internal_transaction.rbs @@ -0,0 +1,7 @@ +module Lithic + module Resources + class InternalTransaction + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/management_operations.rbs b/sig/lithic/resources/management_operations.rbs new file mode 100644 index 00000000..e1e0d5e8 --- /dev/null +++ b/sig/lithic/resources/management_operations.rbs @@ -0,0 +1,47 @@ +module Lithic + module Resources + class ManagementOperations + def create: ( + amount: Integer, + category: Lithic::Models::ManagementOperationCreateParams::category, + direction: Lithic::Models::ManagementOperationCreateParams::direction, + effective_date: Date, + event_type: Lithic::Models::ManagementOperationCreateParams::event_type, + financial_account_token: String, + ?token: String, + ?memo: String, + ?on_closed_account: Lithic::Models::ManagementOperationCreateParams::on_closed_account, + ?subtype: String, + ?user_defined_id: String, + ?request_options: Lithic::request_opts + ) -> Lithic::ManagementOperationTransaction + + def retrieve: ( + String management_operation_token, + ?request_options: Lithic::request_opts + ) -> Lithic::ManagementOperationTransaction + + def list: ( + ?begin_: Time, + ?business_account_token: String, + ?category: Lithic::Models::ManagementOperationListParams::category, + ?end_: Time, + ?ending_before: String, + ?financial_account_token: String, + ?page_size: Integer, + ?starting_after: String, + ?status: Lithic::Models::ManagementOperationListParams::status, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::ManagementOperationTransaction] + + def reverse: ( + String management_operation_token, + effective_date: Date, + ?memo: String, + ?request_options: Lithic::request_opts + ) -> Lithic::ManagementOperationTransaction + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/network_programs.rbs b/sig/lithic/resources/network_programs.rbs new file mode 100644 index 00000000..9f8cd51d --- /dev/null +++ b/sig/lithic/resources/network_programs.rbs @@ -0,0 +1,19 @@ +module Lithic + module Resources + class NetworkPrograms + def retrieve: ( + String network_program_token, + ?request_options: Lithic::request_opts + ) -> Lithic::NetworkProgram + + def list: ( + ?begin_: Time, + ?end_: Time, + ?page_size: Integer, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::SinglePage[Lithic::NetworkProgram] + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/payments.rbs b/sig/lithic/resources/payments.rbs new file mode 100644 index 00000000..cbf52d48 --- /dev/null +++ b/sig/lithic/resources/payments.rbs @@ -0,0 +1,86 @@ +module Lithic + module Resources + class Payments + def create: ( + amount: Integer, + external_bank_account_token: String, + financial_account_token: String, + method_: Lithic::Models::PaymentCreateParams::method_, + method_attributes: Lithic::PaymentCreateParams::MethodAttributes, + type: Lithic::Models::PaymentCreateParams::type_, + ?token: String, + ?hold: Lithic::PaymentCreateParams::Hold, + ?memo: String, + ?user_defined_id: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::PaymentCreateResponse + + def retrieve: ( + String payment_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Payment + + def list: ( + ?account_token: String, + ?begin_: Time, + ?business_account_token: String, + ?category: Lithic::Models::PaymentListParams::category, + ?end_: Time, + ?ending_before: String, + ?financial_account_token: String, + ?page_size: Integer, + ?result: Lithic::Models::PaymentListParams::result, + ?starting_after: String, + ?status: Lithic::Models::PaymentListParams::status, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::Payment] + + def retry_: ( + String payment_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::PaymentRetryResponse + + def return_: ( + String payment_token, + financial_account_token: String, + return_reason_code: String, + ?addenda: String?, + ?date_of_death: Date?, + ?memo: String?, + ?request_options: Lithic::request_opts + ) -> Lithic::Payment + + def simulate_action: ( + String payment_token, + event_type: Lithic::Models::PaymentSimulateActionParams::event_type, + ?date_of_death: Date, + ?decline_reason: Lithic::Models::PaymentSimulateActionParams::decline_reason, + ?return_addenda: String, + ?return_reason_code: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::PaymentSimulateActionResponse + + def simulate_receipt: ( + token: String, + amount: Integer, + financial_account_token: String, + receipt_type: Lithic::Models::PaymentSimulateReceiptParams::receipt_type, + ?memo: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::PaymentSimulateReceiptResponse + + def simulate_release: ( + payment_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::PaymentSimulateReleaseResponse + + def simulate_return: ( + payment_token: String, + ?return_reason_code: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::PaymentSimulateReturnResponse + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/reports.rbs b/sig/lithic/resources/reports.rbs new file mode 100644 index 00000000..ed0b6840 --- /dev/null +++ b/sig/lithic/resources/reports.rbs @@ -0,0 +1,9 @@ +module Lithic + module Resources + class Reports + attr_reader settlement: Lithic::Resources::Reports::Settlement + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/reports/settlement.rbs b/sig/lithic/resources/reports/settlement.rbs new file mode 100644 index 00000000..65769797 --- /dev/null +++ b/sig/lithic/resources/reports/settlement.rbs @@ -0,0 +1,24 @@ +module Lithic + module Resources + class Reports + class Settlement + attr_reader network_totals: Lithic::Resources::Reports::Settlement::NetworkTotals + + def list_details: ( + Date report_date, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::SettlementDetail] + + def summary: ( + Date report_date, + ?request_options: Lithic::request_opts + ) -> Lithic::SettlementReport + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/reports/settlement/network_totals.rbs b/sig/lithic/resources/reports/settlement/network_totals.rbs new file mode 100644 index 00000000..e274b3ef --- /dev/null +++ b/sig/lithic/resources/reports/settlement/network_totals.rbs @@ -0,0 +1,31 @@ +module Lithic + module Resources + class Reports + class Settlement + class NetworkTotals + def retrieve: ( + String token, + ?request_options: Lithic::request_opts + ) -> Lithic::NetworkTotal + + def list: ( + ?begin_: Time, + ?end_: Time, + ?ending_before: String, + ?institution_id: String, + ?network: Lithic::Models::Reports::Settlement::NetworkTotalListParams::network, + ?page_size: Integer, + ?report_date: Date, + ?report_date_begin: Date, + ?report_date_end: Date, + ?settlement_institution_id: String, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::NetworkTotal] + + def initialize: (client: Lithic::Client) -> void + end + end + end + end +end diff --git a/sig/lithic/resources/responder_endpoints.rbs b/sig/lithic/resources/responder_endpoints.rbs new file mode 100644 index 00000000..f99fa6a4 --- /dev/null +++ b/sig/lithic/resources/responder_endpoints.rbs @@ -0,0 +1,23 @@ +module Lithic + module Resources + class ResponderEndpoints + def create: ( + ?type: Lithic::Models::ResponderEndpointCreateParams::type_, + ?url: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::ResponderEndpointCreateResponse + + def delete: ( + type: Lithic::Models::ResponderEndpointDeleteParams::type_, + ?request_options: Lithic::request_opts + ) -> nil + + def check_status: ( + type: Lithic::Models::ResponderEndpointCheckStatusParams::type_, + ?request_options: Lithic::request_opts + ) -> Lithic::ResponderEndpointStatus + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/three_ds.rbs b/sig/lithic/resources/three_ds.rbs new file mode 100644 index 00000000..5149a56d --- /dev/null +++ b/sig/lithic/resources/three_ds.rbs @@ -0,0 +1,11 @@ +module Lithic + module Resources + class ThreeDS + attr_reader authentication: Lithic::Resources::ThreeDS::Authentication + + attr_reader decisioning: Lithic::Resources::ThreeDS::Decisioning + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/three_ds/authentication.rbs b/sig/lithic/resources/three_ds/authentication.rbs new file mode 100644 index 00000000..4c54338e --- /dev/null +++ b/sig/lithic/resources/three_ds/authentication.rbs @@ -0,0 +1,28 @@ +module Lithic + module Resources + class ThreeDS + class Authentication + def retrieve: ( + String three_ds_authentication_token, + ?request_options: Lithic::request_opts + ) -> Lithic::ThreeDSAuthentication + + def simulate: ( + merchant: Lithic::ThreeDS::AuthenticationSimulateParams::Merchant, + pan: String, + transaction: Lithic::ThreeDS::AuthenticationSimulateParams::Transaction, + ?card_expiry_check: Lithic::Models::ThreeDS::AuthenticationSimulateParams::card_expiry_check, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::ThreeDS::AuthenticationSimulateResponse + + def simulate_otp_entry: ( + token: String, + otp: String, + ?request_options: Lithic::request_opts + ) -> nil + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/three_ds/decisioning.rbs b/sig/lithic/resources/three_ds/decisioning.rbs new file mode 100644 index 00000000..f5f7a7b7 --- /dev/null +++ b/sig/lithic/resources/three_ds/decisioning.rbs @@ -0,0 +1,21 @@ +module Lithic + module Resources + class ThreeDS + class Decisioning + def challenge_response: ( + token: String, + challenge_response: Lithic::Models::ThreeDS::challenge_result, + ?request_options: Lithic::request_opts + ) -> nil + + def retrieve_secret: ( + ?request_options: Lithic::request_opts + ) -> Lithic::Models::ThreeDS::DecisioningRetrieveSecretResponse + + def rotate_secret: (?request_options: Lithic::request_opts) -> nil + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/tokenization_decisioning.rbs b/sig/lithic/resources/tokenization_decisioning.rbs new file mode 100644 index 00000000..440e9695 --- /dev/null +++ b/sig/lithic/resources/tokenization_decisioning.rbs @@ -0,0 +1,15 @@ +module Lithic + module Resources + class TokenizationDecisioning + def retrieve_secret: ( + ?request_options: Lithic::request_opts + ) -> Lithic::TokenizationSecret + + def rotate_secret: ( + ?request_options: Lithic::request_opts + ) -> Lithic::Models::TokenizationDecisioningRotateSecretResponse + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/tokenizations.rbs b/sig/lithic/resources/tokenizations.rbs new file mode 100644 index 00000000..1559992c --- /dev/null +++ b/sig/lithic/resources/tokenizations.rbs @@ -0,0 +1,68 @@ +module Lithic + module Resources + class Tokenizations + def retrieve: ( + String tokenization_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Tokenization + + def list: ( + ?account_token: String, + ?begin_: Date, + ?card_token: String, + ?end_: Date, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?tokenization_channel: Lithic::Models::TokenizationListParams::tokenization_channel, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::Tokenization] + + def activate: ( + String tokenization_token, + ?request_options: Lithic::request_opts + ) -> nil + + def deactivate: ( + String tokenization_token, + ?request_options: Lithic::request_opts + ) -> nil + + def pause: ( + String tokenization_token, + ?request_options: Lithic::request_opts + ) -> nil + + def resend_activation_code: ( + String tokenization_token, + ?activation_method_type: Lithic::Models::TokenizationResendActivationCodeParams::activation_method_type, + ?request_options: Lithic::request_opts + ) -> nil + + def simulate: ( + cvv: String, + expiration_date: String, + pan: String, + tokenization_source: Lithic::Models::TokenizationSimulateParams::tokenization_source, + ?account_score: Integer, + ?device_score: Integer, + ?entity: String, + ?wallet_recommended_decision: Lithic::Models::TokenizationSimulateParams::wallet_recommended_decision, + ?request_options: Lithic::request_opts + ) -> Lithic::Tokenization + + def unpause: ( + String tokenization_token, + ?request_options: Lithic::request_opts + ) -> nil + + def update_digital_card_art: ( + String tokenization_token, + ?digital_card_art_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Tokenization + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/transaction_monitoring.rbs b/sig/lithic/resources/transaction_monitoring.rbs new file mode 100644 index 00000000..fd57a3d0 --- /dev/null +++ b/sig/lithic/resources/transaction_monitoring.rbs @@ -0,0 +1,11 @@ +module Lithic + module Resources + class TransactionMonitoring + attr_reader cases: Lithic::Resources::TransactionMonitoring::Cases + + attr_reader queues: Lithic::Resources::TransactionMonitoring::Queues + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/transaction_monitoring/cases.rbs b/sig/lithic/resources/transaction_monitoring/cases.rbs new file mode 100644 index 00000000..2190a299 --- /dev/null +++ b/sig/lithic/resources/transaction_monitoring/cases.rbs @@ -0,0 +1,71 @@ +module Lithic + module Resources + class TransactionMonitoring + class Cases + attr_reader comments: Lithic::Resources::TransactionMonitoring::Cases::Comments + + attr_reader files: Lithic::Resources::TransactionMonitoring::Cases::Files + + def retrieve: ( + String case_token, + ?request_options: Lithic::request_opts + ) -> Lithic::TransactionMonitoring::MonitoringCase + + def update: ( + String case_token, + ?actor_token: String, + ?assignee: String?, + ?priority: Lithic::Models::TransactionMonitoring::case_priority, + ?resolution: Lithic::Models::TransactionMonitoring::resolution_outcome, + ?resolution_notes: String, + ?sla_deadline: Time?, + ?status: Lithic::Models::TransactionMonitoring::case_status, + ?tags: ::Hash[Symbol, String], + ?title: String?, + ?request_options: Lithic::request_opts + ) -> Lithic::TransactionMonitoring::MonitoringCase + + def list: ( + ?account_token: String, + ?assignee: String, + ?begin_: Time, + ?card_token: String, + ?end_: Time, + ?ending_before: String, + ?entity_token: String, + ?page_size: Integer, + ?queue_token: String, + ?rule_token: String, + ?sort_by: Lithic::Models::TransactionMonitoring::case_sort_order, + ?starting_after: String, + ?status: Lithic::Models::TransactionMonitoring::case_status, + ?transaction_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::TransactionMonitoring::MonitoringCase] + + def list_activity: ( + String case_token, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::TransactionMonitoring::CaseActivityEntry] + + def list_transactions: ( + String case_token, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::TransactionMonitoring::CaseTransaction] + + def retrieve_cards: ( + String case_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::TransactionMonitoring::case_retrieve_cards_response + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/transaction_monitoring/cases/comments.rbs b/sig/lithic/resources/transaction_monitoring/cases/comments.rbs new file mode 100644 index 00000000..62500f5b --- /dev/null +++ b/sig/lithic/resources/transaction_monitoring/cases/comments.rbs @@ -0,0 +1,32 @@ +module Lithic + module Resources + class TransactionMonitoring + class Cases + class Comments + def create: ( + String case_token, + comment: String, + ?actor_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::TransactionMonitoring::CaseActivityEntry + + def update: ( + String comment_token, + case_token: String, + comment: String, + ?actor_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::TransactionMonitoring::CaseActivityEntry + + def delete: ( + String comment_token, + case_token: String, + ?request_options: Lithic::request_opts + ) -> nil + + def initialize: (client: Lithic::Client) -> void + end + end + end + end +end diff --git a/sig/lithic/resources/transaction_monitoring/cases/files.rbs b/sig/lithic/resources/transaction_monitoring/cases/files.rbs new file mode 100644 index 00000000..d9a0b657 --- /dev/null +++ b/sig/lithic/resources/transaction_monitoring/cases/files.rbs @@ -0,0 +1,37 @@ +module Lithic + module Resources + class TransactionMonitoring + class Cases + class Files + def create: ( + String case_token, + name: String, + ?request_options: Lithic::request_opts + ) -> Lithic::TransactionMonitoring::Cases::CaseFile + + def retrieve: ( + String file_token, + case_token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::TransactionMonitoring::Cases::CaseFile + + def list: ( + String case_token, + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::TransactionMonitoring::Cases::CaseFile] + + def delete: ( + String file_token, + case_token: String, + ?request_options: Lithic::request_opts + ) -> nil + + def initialize: (client: Lithic::Client) -> void + end + end + end + end +end diff --git a/sig/lithic/resources/transaction_monitoring/queues.rbs b/sig/lithic/resources/transaction_monitoring/queues.rbs new file mode 100644 index 00000000..090f2eb7 --- /dev/null +++ b/sig/lithic/resources/transaction_monitoring/queues.rbs @@ -0,0 +1,39 @@ +module Lithic + module Resources + class TransactionMonitoring + class Queues + def create: ( + name: String, + ?description: String?, + ?request_options: Lithic::request_opts + ) -> Lithic::TransactionMonitoring::Queue + + def retrieve: ( + String queue_token, + ?request_options: Lithic::request_opts + ) -> Lithic::TransactionMonitoring::Queue + + def update: ( + String queue_token, + ?description: String?, + ?name: String, + ?request_options: Lithic::request_opts + ) -> Lithic::TransactionMonitoring::Queue + + def list: ( + ?ending_before: String, + ?page_size: Integer, + ?starting_after: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::TransactionMonitoring::Queue] + + def delete: ( + String queue_token, + ?request_options: Lithic::request_opts + ) -> nil + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/transactions.rbs b/sig/lithic/resources/transactions.rbs new file mode 100644 index 00000000..bd02a210 --- /dev/null +++ b/sig/lithic/resources/transactions.rbs @@ -0,0 +1,100 @@ +module Lithic + module Resources + class Transactions + attr_reader enhanced_commercial_data: Lithic::Resources::Transactions::EnhancedCommercialData + + attr_reader events: Lithic::Resources::Transactions::Events + + def retrieve: ( + String transaction_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Transaction + + def list: ( + ?account_token: String, + ?begin_: Time, + ?card_token: String, + ?end_: Time, + ?ending_before: String, + ?page_size: Integer, + ?result: Lithic::Models::TransactionListParams::result, + ?starting_after: String, + ?status: Lithic::Models::TransactionListParams::status, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::CursorPage[Lithic::Transaction] + + def expire_authorization: ( + String transaction_token, + ?request_options: Lithic::request_opts + ) -> nil + + def route: ( + String transaction_token, + financial_account_token: String, + ?request_options: Lithic::request_opts + ) -> nil + + def simulate_authorization: ( + amount: Integer, + descriptor: String, + pan: String, + ?mcc: String, + ?merchant_acceptor_city: String, + ?merchant_acceptor_country: String, + ?merchant_acceptor_id: String, + ?merchant_acceptor_state: String, + ?merchant_amount: Integer, + ?merchant_currency: String, + ?partial_approval_capable: bool, + ?pin: String, + ?status: Lithic::Models::TransactionSimulateAuthorizationParams::status, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::TransactionSimulateAuthorizationResponse + + def simulate_authorization_advice: ( + token: String, + amount: Integer, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::TransactionSimulateAuthorizationAdviceResponse + + def simulate_clearing: ( + token: String, + ?amount: Integer, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::TransactionSimulateClearingResponse + + def simulate_credit_authorization_advice: ( + amount: Integer, + descriptor: String, + pan: String, + ?mcc: String, + ?merchant_acceptor_city: String, + ?merchant_acceptor_country: String, + ?merchant_acceptor_id: String, + ?merchant_acceptor_state: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::TransactionSimulateCreditAuthorizationAdviceResponse + + def simulate_return: ( + amount: Integer, + descriptor: String, + pan: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::TransactionSimulateReturnResponse + + def simulate_return_reversal: ( + token: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::TransactionSimulateReturnReversalResponse + + def simulate_void: ( + token: String, + ?amount: Integer, + ?type: Lithic::Models::TransactionSimulateVoidParams::type_, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::TransactionSimulateVoidResponse + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/transactions/enhanced_commercial_data.rbs b/sig/lithic/resources/transactions/enhanced_commercial_data.rbs new file mode 100644 index 00000000..3557adbb --- /dev/null +++ b/sig/lithic/resources/transactions/enhanced_commercial_data.rbs @@ -0,0 +1,14 @@ +module Lithic + module Resources + class Transactions + class EnhancedCommercialData + def retrieve: ( + String transaction_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Models::Transactions::EnhancedCommercialDataRetrieveResponse + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/transactions/events.rbs b/sig/lithic/resources/transactions/events.rbs new file mode 100644 index 00000000..135ac859 --- /dev/null +++ b/sig/lithic/resources/transactions/events.rbs @@ -0,0 +1,11 @@ +module Lithic + module Resources + class Transactions + class Events + attr_reader enhanced_commercial_data: Lithic::Resources::Transactions::Events::EnhancedCommercialData + + def initialize: (client: Lithic::Client) -> void + end + end + end +end diff --git a/sig/lithic/resources/transactions/events/enhanced_commercial_data.rbs b/sig/lithic/resources/transactions/events/enhanced_commercial_data.rbs new file mode 100644 index 00000000..80639c37 --- /dev/null +++ b/sig/lithic/resources/transactions/events/enhanced_commercial_data.rbs @@ -0,0 +1,16 @@ +module Lithic + module Resources + class Transactions + class Events + class EnhancedCommercialData + def retrieve: ( + String event_token, + ?request_options: Lithic::request_opts + ) -> Lithic::Transactions::Events::EnhancedData + + def initialize: (client: Lithic::Client) -> void + end + end + end + end +end diff --git a/sig/lithic/resources/transfer_limits.rbs b/sig/lithic/resources/transfer_limits.rbs new file mode 100644 index 00000000..a8c8c553 --- /dev/null +++ b/sig/lithic/resources/transfer_limits.rbs @@ -0,0 +1,12 @@ +module Lithic + module Resources + class TransferLimits + def list: ( + ?date: Date, + ?request_options: Lithic::request_opts + ) -> Lithic::Internal::SinglePage[Lithic::TransferLimitsResponse::Data] + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/transfers.rbs b/sig/lithic/resources/transfers.rbs new file mode 100644 index 00000000..8a695578 --- /dev/null +++ b/sig/lithic/resources/transfers.rbs @@ -0,0 +1,16 @@ +module Lithic + module Resources + class Transfers + def create: ( + amount: Integer, + from: String, + to: String, + ?token: String, + ?memo: String, + ?request_options: Lithic::request_opts + ) -> Lithic::Transfer + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/resources/webhooks.rbs b/sig/lithic/resources/webhooks.rbs new file mode 100644 index 00000000..498dbb10 --- /dev/null +++ b/sig/lithic/resources/webhooks.rbs @@ -0,0 +1,71 @@ +module Lithic + module Resources + class Webhooks + def parsed: ( + String payload, + headers: ::Hash[String, String], + ?key: String? + ) -> (Lithic::AccountHolderCreatedWebhookEvent + | Lithic::ParsedWebhookEvent::KYBPayload + | Lithic::ParsedWebhookEvent::KYCPayload + | Lithic::ParsedWebhookEvent::LegacyPayload + | Lithic::AccountHolderVerificationWebhookEvent + | Lithic::AccountHolderDocumentUpdatedWebhookEvent + | Lithic::CardAuthorizationApprovalRequestWebhookEvent + | Lithic::CardAuthorizationChallengeWebhookEvent + | Lithic::CardAuthorizationChallengeResponseWebhookEvent + | Lithic::AuthRulesBacktestReportCreatedWebhookEvent + | Lithic::BalanceUpdatedWebhookEvent + | Lithic::BookTransferTransactionCreatedWebhookEvent + | Lithic::BookTransferTransactionUpdatedWebhookEvent + | Lithic::CardCreatedWebhookEvent + | Lithic::CardConvertedWebhookEvent + | Lithic::CardRenewedWebhookEvent + | Lithic::CardReissuedWebhookEvent + | Lithic::CardShippedWebhookEvent + | Lithic::CardUpdatedWebhookEvent + | Lithic::CardTransactionUpdatedWebhookEvent + | Lithic::CardTransactionEnhancedDataCreatedWebhookEvent + | Lithic::CardTransactionEnhancedDataUpdatedWebhookEvent + | Lithic::DigitalWalletTokenizationApprovalRequestWebhookEvent + | Lithic::DigitalWalletTokenizationResultWebhookEvent + | Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeWebhookEvent + | Lithic::DigitalWalletTokenizationTwoFactorAuthenticationCodeSentWebhookEvent + | Lithic::DigitalWalletTokenizationUpdatedWebhookEvent + | Lithic::DisputeUpdatedWebhookEvent + | Lithic::DisputeEvidenceUploadFailedWebhookEvent + | Lithic::ExternalBankAccountCreatedWebhookEvent + | Lithic::ExternalBankAccountUpdatedWebhookEvent + | Lithic::ExternalPaymentCreatedWebhookEvent + | Lithic::ExternalPaymentUpdatedWebhookEvent + | Lithic::FinancialAccountCreatedWebhookEvent + | Lithic::FinancialAccountUpdatedWebhookEvent + | Lithic::FundingEventCreatedWebhookEvent + | Lithic::LoanTapeCreatedWebhookEvent + | Lithic::LoanTapeUpdatedWebhookEvent + | Lithic::ManagementOperationCreatedWebhookEvent + | Lithic::ManagementOperationUpdatedWebhookEvent + | Lithic::InternalTransactionCreatedWebhookEvent + | Lithic::InternalTransactionUpdatedWebhookEvent + | Lithic::NetworkTotalCreatedWebhookEvent + | Lithic::NetworkTotalUpdatedWebhookEvent + | Lithic::PaymentTransactionCreatedWebhookEvent + | Lithic::PaymentTransactionUpdatedWebhookEvent + | Lithic::SettlementReportUpdatedWebhookEvent + | Lithic::StatementsCreatedWebhookEvent + | Lithic::ThreeDSAuthenticationCreatedWebhookEvent + | Lithic::ThreeDSAuthenticationUpdatedWebhookEvent + | Lithic::ThreeDSAuthenticationChallengeWebhookEvent + | Lithic::TokenizationApprovalRequestWebhookEvent + | Lithic::TokenizationResultWebhookEvent + | Lithic::TokenizationTwoFactorAuthenticationCodeWebhookEvent + | Lithic::TokenizationTwoFactorAuthenticationCodeSentWebhookEvent + | Lithic::TokenizationUpdatedWebhookEvent + | Lithic::ThreeDSAuthenticationApprovalRequestWebhookEvent + | Lithic::DisputeTransactionCreatedWebhookEvent + | Lithic::DisputeTransactionUpdatedWebhookEvent) + + def initialize: (client: Lithic::Client) -> void + end + end +end diff --git a/sig/lithic/version.rbs b/sig/lithic/version.rbs new file mode 100644 index 00000000..21aef239 --- /dev/null +++ b/sig/lithic/version.rbs @@ -0,0 +1,3 @@ +module Lithic + VERSION: String +end diff --git a/sorbet/config b/sorbet/config new file mode 100644 index 00000000..6fe84ed8 --- /dev/null +++ b/sorbet/config @@ -0,0 +1,2 @@ +--dir=rbi/ +--ignore=test/ diff --git a/sorbet/rbi/.gitignore b/sorbet/rbi/.gitignore new file mode 100644 index 00000000..d6b7ef32 --- /dev/null +++ b/sorbet/rbi/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/test/lithic/client_test.rb b/test/lithic/client_test.rb new file mode 100644 index 00000000..51439af4 --- /dev/null +++ b/test/lithic/client_test.rb @@ -0,0 +1,309 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +class LithicTest < 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_unknown_environment + e = assert_raises(ArgumentError) do + Lithic::Client.new(environment: "wrong") + end + assert_match(/environment must be one of/, e.message) + end + + def test_raises_on_missing_non_nullable_opts + e = assert_raises(ArgumentError) do + Lithic::Client.new + end + assert_match(/is required/, e.message) + end + + def test_client_default_request_default_retry_attempts + stub_request(:post, "http://localhost/v1/cards").to_return_json(status: 500, body: {}) + + lithic = Lithic::Client.new(base_url: "http://localhost", api_key: "My Lithic API Key") + + assert_raises(Lithic::Errors::InternalServerError) do + lithic.cards.create(type: :VIRTUAL) + end + + assert_requested(:any, /./, times: 3) + end + + def test_client_given_request_default_retry_attempts + stub_request(:post, "http://localhost/v1/cards").to_return_json(status: 500, body: {}) + + lithic = Lithic::Client.new(base_url: "http://localhost", api_key: "My Lithic API Key", max_retries: 3) + + assert_raises(Lithic::Errors::InternalServerError) do + lithic.cards.create(type: :VIRTUAL) + end + + assert_requested(:any, /./, times: 4) + end + + def test_client_default_request_given_retry_attempts + stub_request(:post, "http://localhost/v1/cards").to_return_json(status: 500, body: {}) + + lithic = Lithic::Client.new(base_url: "http://localhost", api_key: "My Lithic API Key") + + assert_raises(Lithic::Errors::InternalServerError) do + lithic.cards.create(type: :VIRTUAL, 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/v1/cards").to_return_json(status: 500, body: {}) + + lithic = Lithic::Client.new(base_url: "http://localhost", api_key: "My Lithic API Key", max_retries: 3) + + assert_raises(Lithic::Errors::InternalServerError) do + lithic.cards.create(type: :VIRTUAL, request_options: {max_retries: 4}) + end + + assert_requested(:any, /./, times: 5) + end + + def test_client_retry_after_seconds + stub_request(:post, "http://localhost/v1/cards").to_return_json( + status: 500, + headers: {"retry-after" => "1.3"}, + body: {} + ) + + lithic = Lithic::Client.new(base_url: "http://localhost", api_key: "My Lithic API Key", max_retries: 1) + + assert_raises(Lithic::Errors::InternalServerError) do + lithic.cards.create(type: :VIRTUAL) + 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/v1/cards").to_return_json( + status: 500, + headers: {"retry-after" => (time_now + 10).httpdate}, + body: {} + ) + + lithic = Lithic::Client.new(base_url: "http://localhost", api_key: "My Lithic API Key", max_retries: 1) + + Thread.current.thread_variable_set(:time_now, time_now) + assert_raises(Lithic::Errors::InternalServerError) do + lithic.cards.create(type: :VIRTUAL) + 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/v1/cards").to_return_json( + status: 500, + headers: {"retry-after-ms" => "1300"}, + body: {} + ) + + lithic = Lithic::Client.new(base_url: "http://localhost", api_key: "My Lithic API Key", max_retries: 1) + + assert_raises(Lithic::Errors::InternalServerError) do + lithic.cards.create(type: :VIRTUAL) + 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/v1/cards").to_return_json(status: 500, body: {}) + + lithic = Lithic::Client.new(base_url: "http://localhost", api_key: "My Lithic API Key") + + assert_raises(Lithic::Errors::InternalServerError) do + lithic.cards.create(type: :VIRTUAL) + 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/v1/cards").to_return_json(status: 500, body: {}) + + lithic = Lithic::Client.new(base_url: "http://localhost", api_key: "My Lithic API Key") + + assert_raises(Lithic::Errors::InternalServerError) do + lithic.cards.create( + type: :VIRTUAL, + 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/v1/cards").to_return_json(status: 500, body: {}) + + lithic = Lithic::Client.new(base_url: "http://localhost", api_key: "My Lithic API Key") + + assert_raises(Lithic::Errors::InternalServerError) do + lithic.cards.create( + type: :VIRTUAL, + 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/v1/cards").to_return_json( + status: 307, + headers: {"location" => "/redirected"}, + body: {} + ) + stub_request(:any, "http://localhost/redirected").to_return( + status: 307, + headers: {"location" => "/redirected"} + ) + + lithic = Lithic::Client.new(base_url: "http://localhost", api_key: "My Lithic API Key") + + assert_raises(Lithic::Errors::APIConnectionError) do + lithic.cards.create(type: :VIRTUAL, request_options: {extra_headers: {}}) + end + + recorded, = WebMock::RequestRegistry.instance.requested_signatures.hash.first + + assert_requested(:any, "http://localhost/redirected", times: Lithic::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/v1/cards").to_return_json( + status: 303, + headers: {"location" => "/redirected"}, + body: {} + ) + stub_request(:get, "http://localhost/redirected").to_return( + status: 303, + headers: {"location" => "/redirected"} + ) + + lithic = Lithic::Client.new(base_url: "http://localhost", api_key: "My Lithic API Key") + + assert_raises(Lithic::Errors::APIConnectionError) do + lithic.cards.create(type: :VIRTUAL, request_options: {extra_headers: {}}) + end + + assert_requested(:get, "http://localhost/redirected", times: Lithic::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/v1/cards").to_return_json( + status: 307, + headers: {"location" => "/redirected"}, + body: {} + ) + stub_request(:any, "http://localhost/redirected").to_return( + status: 307, + headers: {"location" => "/redirected"} + ) + + lithic = Lithic::Client.new(base_url: "http://localhost", api_key: "My Lithic API Key") + + assert_raises(Lithic::Errors::APIConnectionError) do + lithic.cards.create(type: :VIRTUAL, 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: Lithic::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/v1/cards").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"} + ) + + lithic = Lithic::Client.new(base_url: "http://localhost", api_key: "My Lithic API Key") + + assert_raises(Lithic::Errors::APIConnectionError) do + lithic.cards.create(type: :VIRTUAL, request_options: {extra_headers: {"authorization" => "Bearer xyz"}}) + end + + assert_requested(:any, "https://example.com/redirected", times: Lithic::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/v1/cards").to_return_json(status: 200, body: {}) + + lithic = Lithic::Client.new(base_url: "http://localhost", api_key: "My Lithic API Key") + + lithic.cards.create(type: :VIRTUAL) + + 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/lithic/file_part_test.rb b/test/lithic/file_part_test.rb new file mode 100644 index 00000000..70ac4911 --- /dev/null +++ b/test/lithic/file_part_test.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +class Lithic::Test::FilePartTest < Minitest::Test + def test_to_json + text = "gray" + filepart = Lithic::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/lithic/internal/sorbet_runtime_support_test.rb b/test/lithic/internal/sorbet_runtime_support_test.rb new file mode 100644 index 00000000..d808a705 --- /dev/null +++ b/test/lithic/internal/sorbet_runtime_support_test.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::SorbetRuntimeSupportTest < Minitest::Test + extend Minitest::Serial + + i_suck_and_my_tests_are_order_dependent! + + module E + extend Lithic::Internal::Type::Enum + + define_sorbet_constant!(:TaggedSymbol) { 1 } + end + + module U + extend Lithic::Internal::Type::Union + + define_sorbet_constant!(:Variants) { 2 } + end + + class M < Lithic::Internal::Type::BaseModel + define_sorbet_constant!(:OrHash) { 3 } + end + + def test_nil_aliases + err = Lithic::Internal::Util::SorbetRuntimeSupport::MissingSorbetRuntimeError + + assert_raises(err) { Lithic::Internal::AnyHash } + assert_raises(err) { Lithic::Internal::FileInput } + assert_raises(err) { Lithic::Internal::Type::Converter::Input } + assert_raises(err) { Lithic::Internal::Type::Converter::CoerceState } + assert_raises(err) { Lithic::Internal::Type::Converter::DumpState } + assert_raises(err) { Lithic::Internal::Type::BaseModel::KnownField } + assert_raises(err) { Lithic::Internal::Util::ParsedUri } + assert_raises(err) { Lithic::Internal::Util::ServerSentEvent } + assert_raises(err) { Lithic::Internal::Transport::BaseClient::RequestComponents } + assert_raises(err) { Lithic::Internal::Transport::BaseClient::RequestInput } + assert_raises(err) { Lithic::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/lithic/internal/type/base_model_test.rb b/test/lithic/internal/type/base_model_test.rb new file mode 100644 index 00000000..4f14b5a5 --- /dev/null +++ b/test/lithic/internal/type/base_model_test.rb @@ -0,0 +1,727 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::PrimitiveModelTest < Minitest::Test + A = Lithic::Internal::Type::ArrayOf[-> { Integer }] + H = Lithic::Internal::Type::HashOf[-> { Integer }, nil?: true] + + module E + extend Lithic::Internal::Type::Enum + end + + module U + extend Lithic::Internal::Type::Union + end + + class B < Lithic::Internal::Type::BaseModel + optional :a, Integer + optional :b, B + end + + def test_typing + converters = [ + Lithic::Internal::Type::Unknown, + Lithic::Internal::Type::Boolean, + A, + H, + E, + U, + B + ] + + converters.each do |conv| + assert_pattern do + conv => Lithic::Internal::Type::Converter + end + end + end + + def test_coerce + cases = { + [Lithic::Internal::Type::Unknown, :a] => [{yes: 1}, :a], + [NilClass, :a] => [{maybe: 1}, nil], + [NilClass, nil] => [{yes: 1}, nil], + [Lithic::Internal::Type::Boolean, true] => [{yes: 1}, true], + [Lithic::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 = Lithic::Internal::Type::Converter.new_coerce_state + assert_pattern do + Lithic::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 = { + [Lithic::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}}, + [Lithic::Internal::Type::Boolean, true] => true, + [Lithic::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__)] => Lithic::FilePart + } + + cases.each do + target, input = _1 + expect = _2 + assert_pattern do + Lithic::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 = Lithic::Internal::Type::Converter.new_coerce_state + Lithic::Internal::Type::Converter.coerce(target, input, state: state) + assert_pattern do + state => {error: ^expect} + end + end + end + + def test_dump_retry + types = [ + Lithic::Internal::Type::Unknown, + Lithic::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} + Lithic::Internal::Type::Converter.dump(target, input, state: state) + + assert_pattern do + state => {can_retry: false} + end + end + end + end +end + +class Lithic::Test::EnumModelTest < Minitest::Test + class E0 + include Lithic::Internal::Type::Enum + + attr_reader :values + + def initialize(*values) = (@values = values) + end + + module E1 + extend Lithic::Internal::Type::Enum + + TRUE = true + end + + module E2 + extend Lithic::Internal::Type::Enum + + ONE = 1 + TWO = 2 + end + + module E3 + extend Lithic::Internal::Type::Enum + + ONE = 1.0 + TWO = 2.0 + end + + module E4 + extend Lithic::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 = Lithic::Internal::Type::Converter.new_coerce_state + assert_pattern do + Lithic::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 + Lithic::Internal::Type::Converter.dump(target, input) => ^expect + end + end + end +end + +class Lithic::Test::CollectionModelTest < Minitest::Test + A1 = Lithic::Internal::Type::ArrayOf[-> { Integer }] + H1 = Lithic::Internal::Type::HashOf[Integer] + + A2 = Lithic::Internal::Type::ArrayOf[H1] + H2 = Lithic::Internal::Type::HashOf[-> { A1 }] + + A3 = Lithic::Internal::Type::ArrayOf[Integer, nil?: true] + H3 = Lithic::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 = Lithic::Internal::Type::Converter.new_coerce_state + assert_pattern do + Lithic::Internal::Type::Converter.coerce(target, input, state: state) => ^expect + state.fetch(:exactness).filter { _2.nonzero? }.to_h => ^exactness + end + end + end +end + +class Lithic::Test::BaseModelTest < Minitest::Test + class M1 < Lithic::Internal::Type::BaseModel + required :a, Integer + end + + class M2 < M1 + required :a, Time + required :b, Integer, nil?: true + optional :c, String + end + + class M3 < Lithic::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 < Lithic::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, Lithic::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 = Lithic::Internal::Type::Converter.new_coerce_state + assert_pattern do + coerced = Lithic::Internal::Type::Converter.coerce(target, input, state: state) + assert_equal(coerced, coerced) + if coerced.is_a?(Lithic::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 + Lithic::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 Lithic::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 Lithic::Test::UnionTest < Minitest::Test + class U0 + include Lithic::Internal::Type::Union + + def initialize(*variants) = variants.each { variant(_1) } + end + + module U1 + extend Lithic::Internal::Type::Union + + variant const: :a + variant const: 2 + end + + class M1 < Lithic::Internal::Type::BaseModel + required :t, const: :a, api_name: :type + optional :c, String + end + + class M2 < Lithic::Internal::Type::BaseModel + required :type, const: :b + optional :c, String + end + + module U2 + extend Lithic::Internal::Type::Union + + discriminator :type + + variant :a, M1 + variant :b, M2 + end + + module U3 + extend Lithic::Internal::Type::Union + + discriminator :type + + variant :a, M1 + variant String + end + + module U4 + extend Lithic::Internal::Type::Union + + discriminator :type + + variant String + variant :a, M1 + end + + class M3 < Lithic::Internal::Type::BaseModel + optional :recur, -> { U5 } + required :a, Integer + end + + class M4 < Lithic::Internal::Type::BaseModel + optional :recur, -> { U5 } + required :a, Lithic::Internal::Type::ArrayOf[-> { U5 }] + end + + class M5 < Lithic::Internal::Type::BaseModel + optional :recur, -> { U5 } + required :b, Lithic::Internal::Type::ArrayOf[-> { U5 }] + end + + module U5 + extend Lithic::Internal::Type::Union + + variant -> { M3 } + variant -> { M4 } + end + + module U6 + extend Lithic::Internal::Type::Union + + variant -> { M3 } + variant -> { M5 } + end + + def test_accessors + model = M3.new(recur: []) + tap do + model.recur + flunk + rescue Lithic::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 = Lithic::Internal::Type::Converter.new_coerce_state + assert_pattern do + coerced = Lithic::Internal::Type::Converter.coerce(target, input, state: state) + assert_equal(coerced, coerced) + if coerced.is_a?(Lithic::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 Lithic::Test::BaseModelQoLTest < Minitest::Test + class E0 + include Lithic::Internal::Type::Enum + + attr_reader :values + + def initialize(*values) = (@values = values) + end + + module E1 + extend Lithic::Internal::Type::Enum + + A = 1 + end + + module E2 + extend Lithic::Internal::Type::Enum + + A = 1 + end + + module E3 + extend Lithic::Internal::Type::Enum + + A = 2 + B = 3 + end + + class U0 + include Lithic::Internal::Type::Union + + def initialize(*variants) = variants.each { variant(_1) } + end + + module U1 + extend Lithic::Internal::Type::Union + + variant String + variant Integer + end + + module U2 + extend Lithic::Internal::Type::Union + + variant String + variant Integer + end + + class M1 < Lithic::Internal::Type::BaseModel + required :a, Integer + end + + class M2 < Lithic::Internal::Type::BaseModel + required :a, Integer, nil?: true + end + + class M3 < M2 + required :a, Integer + end + + def test_equality + cases = { + [Lithic::Internal::Type::Unknown, Lithic::Internal::Type::Unknown] => true, + [Lithic::Internal::Type::Boolean, Lithic::Internal::Type::Boolean] => true, + [Lithic::Internal::Type::Unknown, Lithic::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 Lithic::Test::MetaInfoTest < Minitest::Test + A1 = Lithic::Internal::Type::ArrayOf[Integer, nil?: true, doc: "dog"] + H1 = Lithic::Internal::Type::HashOf[-> { String }, nil?: true, doc: "dawg"] + + class M1 < Lithic::Internal::Type::BaseModel + required :a, Integer, doc: "dog" + optional :b, -> { String }, nil?: true, doc: "dawg" + end + + module U1 + extend Lithic::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/lithic/internal/util_test.rb b/test/lithic/internal/util_test.rb new file mode 100644 index 00000000..6c5fe386 --- /dev/null +++ b/test/lithic/internal/util_test.rb @@ -0,0 +1,675 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::UtilDataHandlingTest < Minitest::Test + def test_left_map + assert_pattern do + Lithic::Internal::Util.deep_merge({a: 1}, nil) => nil + end + end + + def test_right_map + assert_pattern do + Lithic::Internal::Util.deep_merge(nil, {a: 1}) => {a: 1} + end + end + + def test_disjoint_maps + assert_pattern do + Lithic::Internal::Util.deep_merge({b: 2}, {a: 1}) => {a: 1, b: 2} + end + end + + def test_overlapping_maps + assert_pattern do + Lithic::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 + Lithic::Internal::Util.deep_merge({b: {b2: 1}}, {b: {b2: 2}}) => {b: {b2: 2}} + end + end + + def test_nested_left_map + assert_pattern do + Lithic::Internal::Util.deep_merge({b: {b2: 1}}, {b: 6}) => {b: 6} + end + end + + def test_omission + merged = Lithic::Internal::Util.deep_merge( + {b: {b2: 1, b3: {c: 4, d: 5}}}, + {b: {b2: 1, b3: {c: Lithic::Internal::OMIT, d: 5}}} + ) + + assert_pattern do + merged => {b: {b2: 1, b3: {d: 5}}} + end + end + + def test_concat + merged = Lithic::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 = Lithic::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 + Lithic::Internal::Util.dig(1, nil) => 1 + Lithic::Internal::Util.dig({a: 1}, :b) => nil + Lithic::Internal::Util.dig({a: 1}, :a) => 1 + Lithic::Internal::Util.dig({a: {b: 1}}, [:a, :b]) => 1 + + Lithic::Internal::Util.dig([], 1) => nil + Lithic::Internal::Util.dig([nil, [nil, 1]], [1, 1]) => 1 + Lithic::Internal::Util.dig({a: [nil, 1]}, [:a, 1]) => 1 + Lithic::Internal::Util.dig([], 1.0) => nil + + Lithic::Internal::Util.dig(Object, 1) => nil + Lithic::Internal::Util.dig([], 1.0) { 2 } => 2 + Lithic::Internal::Util.dig([], ->(_) { 2 }) => 2 + Lithic::Internal::Util.dig([1], -> { _1 in [1] }) => true + end + end +end + +class Lithic::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 = Lithic::Internal::Util.parse_uri(url) + unparsed = Lithic::Internal::Util.unparse_uri(parsed).to_s + + assert_equal(url, unparsed) + assert_equal(parsed, Lithic::Internal::Util.parse_uri(unparsed)) + end + end + + def test_joining + cases = [ + [ + "h://a.b/c?d=e", + "h://nope/ignored", + Lithic::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), + Lithic::Internal::Util.join_parsed_uri( + Lithic::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), + Lithic::Internal::Util.join_parsed_uri( + Lithic::Internal::Util.parse_uri(base_url), + {path: path} + ) + ) + end + end +end + +class Lithic::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 + Lithic::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 + Lithic::Internal::Util::JSONL_CONTENT.match?(header) => ^verdict + end + end + end +end + +class Lithic::Test::UtilFormDataEncodingTest < Minitest::Test + class FakeCGI < CGI + def initialize(headers, io) + encoded = io.to_a + @ctype = headers["content-type"] + # rubocop:disable Lint/EmptyBlock + @io = Lithic::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, = Lithic::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 = Lithic::Internal::Type::Converter.dump(Lithic::Internal::Type::FileInput, "abc") + headers = {"content-type" => "multipart/form-data"} + cases = { + "abc" => ["", "abc"], + StringIO.new("abc") => ["", "abc"], + fileinput => %w[upload abc], + Lithic::FilePart.new(StringIO.new("abc")) => ["", "abc"], + file => [file.basename.to_path, /^class Lithic/], + Lithic::FilePart.new(file, filename: "d o g") => ["d%20o%20g", /^class Lithic/] + } + cases.each do |body, testcase| + filename, val = testcase + encoded = Lithic::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: Lithic::FilePart.new("a")} => {"strio" => "a"}, + {pathname: Pathname(__FILE__)} => {"pathname" => -> { _1.read in /^class Lithic/ }}, + {pathname: Lithic::FilePart.new(Pathname(__FILE__))} => {"pathname" => -> { _1.read in /^class Lithic/ }} + } + cases.each do |body, testcase| + encoded = Lithic::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 Lithic::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 = Lithic::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 = Lithic::Internal::Util.writable_enum do |y| + IO.copy_stream(input, y) + end + assert_equal(expected, enum.to_a.join) + end + end +end + +class Lithic::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 = Lithic::Internal::Util.fused_enum(enum, external: true) do + touched = true + loop { enum.next } + end + Lithic::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 = Lithic::Internal::Util.fused_enum(enum, external: true) { loop { enum.next } } + fused_2 = Lithic::Internal::Util.chain_fused(fused_1) { fused_1.each(&_1) } + fused_3 = Lithic::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 = Lithic::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 = Lithic::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 = Lithic::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 = Lithic::Internal::Util.fused_enum([1, 2, 3].to_enum) do + once = once.succ + end + + Lithic::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 = Lithic::Internal::Util.fused_enum(enum) + first = fused.next + + assert_equal(1, first) + Lithic::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 = Lithic::Internal::Util.fused_enum(enum) + + assert_equal(0, taken) + Lithic::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 = Lithic::Internal::Util.fused_enum(enum) + Lithic::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 = Lithic::Internal::Util.fused_enum(enum) + fused_2 = Lithic::Internal::Util.decode_lines(fused_1) + fused_3 = Lithic::Internal::Util.decode_sse(fused_2) + + assert_equal(0, taken) + Lithic::Internal::Util.close_fused!(fused_3) + assert_equal(0, taken) + end +end + +class Lithic::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| + Lithic::Internal::Util.force_charset!(content_type, text: text) + assert_equal(encoding, text.encoding) + end + end +end + +class Lithic::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 = Lithic::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 = Lithic::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 = Lithic::Internal::Util.decode_sse(input).map(&:compact) + assert_equal(expected, actual, name) + end + end + end +end diff --git a/test/lithic/resource_namespaces.rb b/test/lithic/resource_namespaces.rb new file mode 100644 index 00000000..250765f2 --- /dev/null +++ b/test/lithic/resource_namespaces.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +module Lithic + module Test + module Resources + module AccountHolders + end + + module AuthRules + module V2 + end + end + + module Cards + end + + module Cases + end + + module CreditProducts + end + + module Events + end + + module ExternalBankAccounts + end + + module FinancialAccounts + module Statements + end + end + + module Fraud + end + + module Reports + module Settlement + end + end + + module Settlement + end + + module Statements + end + + module ThreeDS + end + + module TransactionMonitoring + module Cases + end + end + + module Transactions + module Events + end + end + + module V2 + end + end + end +end diff --git a/test/lithic/resources/account_activity_test.rb b/test/lithic/resources/account_activity_test.rb new file mode 100644 index 00000000..43d29a9e --- /dev/null +++ b/test/lithic/resources/account_activity_test.rb @@ -0,0 +1,274 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::AccountActivityTest < Lithic::Test::ResourceTest + def test_list + response = @lithic.account_activity.list + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::AccountActivityListResponse + end + + assert_pattern do + case row + in Lithic::Models::AccountActivityListResponse::Internal + in Lithic::BookTransferResponse + in Lithic::Models::AccountActivityListResponse::Card + in Lithic::Payment + in Lithic::ExternalPayment + in Lithic::ManagementOperationTransaction + in Lithic::Hold + end + end + + assert_pattern do + case row + in { + family: :INTERNAL, + token: String, + category: Lithic::Models::AccountActivityListResponse::Internal::Category, + created: Time, + currency: String, + descriptor: String, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::FinancialEvent]), + financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::AccountActivityListResponse::Internal::Result, + settled_amount: Integer, + status: Lithic::Models::AccountActivityListResponse::Internal::Status, + updated: Time + } + in { + family: :TRANSFER, + token: String, + category: Lithic::BookTransferResponse::Category, + created: Time, + currency: String, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::BookTransferResponse::Event]), + from_financial_account_token: String, + pending_amount: Integer, + result: Lithic::BookTransferResponse::Result, + settled_amount: Integer, + status: Lithic::BookTransferResponse::Status, + to_financial_account_token: String, + updated: Time, + external_id: String | nil, + external_resource: Lithic::ExternalResource | nil, + transaction_series: Lithic::BookTransferResponse::TransactionSeries | nil + } + in { + family: :PAYMENT, + token: String, + category: Lithic::Payment::Category, + created: Time, + descriptor: String, + direction: Lithic::Payment::Direction, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::Payment::Event]), + financial_account_token: String, + method_: Lithic::Payment::Method, + method_attributes: Lithic::Payment::MethodAttributes, + pending_amount: Integer, + related_account_tokens: Lithic::Payment::RelatedAccountTokens | nil, + result: Lithic::Payment::Result, + settled_amount: Integer, + source: Lithic::Payment::Source, + status: Lithic::Payment::Status, + updated: Time, + currency: String | nil, + expected_release_date: Date | nil, + external_bank_account_token: String | nil, + tags: ^(Lithic::Internal::Type::HashOf[String]) | nil, + type: Lithic::Payment::Type | nil, + user_defined_id: String | nil + } + in { + family: :EXTERNAL_PAYMENT, + token: String, + created: Time, + status: Lithic::ExternalPayment::Status, + updated: Time, + category: Lithic::ExternalPayment::Category | nil, + currency: String | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::ExternalPayment::Event]) | nil, + financial_account_token: String | nil, + payment_type: Lithic::ExternalPayment::PaymentType | nil, + pending_amount: Integer | nil, + result: Lithic::ExternalPayment::Result | nil, + settled_amount: Integer | nil, + user_defined_id: String | nil + } + in { + family: :MANAGEMENT_OPERATION, + token: String, + created: Time, + status: Lithic::ManagementOperationTransaction::Status, + updated: Time, + category: Lithic::ManagementOperationTransaction::Category | nil, + currency: String | nil, + direction: Lithic::ManagementOperationTransaction::Direction | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::ManagementOperationTransaction::Event]) | nil, + external_resource: Lithic::ExternalResource | nil, + financial_account_token: String | nil, + pending_amount: Integer | nil, + result: Lithic::ManagementOperationTransaction::Result | nil, + settled_amount: Integer | nil, + transaction_series: Lithic::ManagementOperationTransaction::TransactionSeries | nil, + user_defined_id: String | nil + } + in { + family: :HOLD, + token: String, + created: Time, + status: Lithic::Hold::Status, + updated: Time, + currency: String | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::HoldEvent]) | nil, + expiration_datetime: Time | nil, + financial_account_token: String | nil, + pending_amount: Integer | nil, + result: Lithic::Hold::Result | nil, + user_defined_id: String | nil + } + end + end + end + + def test_retrieve_transaction + response = @lithic.account_activity.retrieve_transaction("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::AccountActivityRetrieveTransactionResponse + end + + assert_pattern do + case response + in Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal + in Lithic::BookTransferResponse + in Lithic::Models::AccountActivityRetrieveTransactionResponse::Card + in Lithic::Payment + in Lithic::ExternalPayment + in Lithic::ManagementOperationTransaction + in Lithic::Hold + end + end + + assert_pattern do + case response + in { + family: :INTERNAL, + token: String, + category: Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Category, + created: Time, + currency: String, + descriptor: String, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::FinancialEvent]), + financial_account_token: String, + pending_amount: Integer, + result: Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Result, + settled_amount: Integer, + status: Lithic::Models::AccountActivityRetrieveTransactionResponse::Internal::Status, + updated: Time + } + in { + family: :TRANSFER, + token: String, + category: Lithic::BookTransferResponse::Category, + created: Time, + currency: String, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::BookTransferResponse::Event]), + from_financial_account_token: String, + pending_amount: Integer, + result: Lithic::BookTransferResponse::Result, + settled_amount: Integer, + status: Lithic::BookTransferResponse::Status, + to_financial_account_token: String, + updated: Time, + external_id: String | nil, + external_resource: Lithic::ExternalResource | nil, + transaction_series: Lithic::BookTransferResponse::TransactionSeries | nil + } + in { + family: :PAYMENT, + token: String, + category: Lithic::Payment::Category, + created: Time, + descriptor: String, + direction: Lithic::Payment::Direction, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::Payment::Event]), + financial_account_token: String, + method_: Lithic::Payment::Method, + method_attributes: Lithic::Payment::MethodAttributes, + pending_amount: Integer, + related_account_tokens: Lithic::Payment::RelatedAccountTokens | nil, + result: Lithic::Payment::Result, + settled_amount: Integer, + source: Lithic::Payment::Source, + status: Lithic::Payment::Status, + updated: Time, + currency: String | nil, + expected_release_date: Date | nil, + external_bank_account_token: String | nil, + tags: ^(Lithic::Internal::Type::HashOf[String]) | nil, + type: Lithic::Payment::Type | nil, + user_defined_id: String | nil + } + in { + family: :EXTERNAL_PAYMENT, + token: String, + created: Time, + status: Lithic::ExternalPayment::Status, + updated: Time, + category: Lithic::ExternalPayment::Category | nil, + currency: String | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::ExternalPayment::Event]) | nil, + financial_account_token: String | nil, + payment_type: Lithic::ExternalPayment::PaymentType | nil, + pending_amount: Integer | nil, + result: Lithic::ExternalPayment::Result | nil, + settled_amount: Integer | nil, + user_defined_id: String | nil + } + in { + family: :MANAGEMENT_OPERATION, + token: String, + created: Time, + status: Lithic::ManagementOperationTransaction::Status, + updated: Time, + category: Lithic::ManagementOperationTransaction::Category | nil, + currency: String | nil, + direction: Lithic::ManagementOperationTransaction::Direction | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::ManagementOperationTransaction::Event]) | nil, + external_resource: Lithic::ExternalResource | nil, + financial_account_token: String | nil, + pending_amount: Integer | nil, + result: Lithic::ManagementOperationTransaction::Result | nil, + settled_amount: Integer | nil, + transaction_series: Lithic::ManagementOperationTransaction::TransactionSeries | nil, + user_defined_id: String | nil + } + in { + family: :HOLD, + token: String, + created: Time, + status: Lithic::Hold::Status, + updated: Time, + currency: String | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::HoldEvent]) | nil, + expiration_datetime: Time | nil, + financial_account_token: String | nil, + pending_amount: Integer | nil, + result: Lithic::Hold::Result | nil, + user_defined_id: String | nil + } + end + end + end +end diff --git a/test/lithic/resources/account_holders/entities_test.rb b/test/lithic/resources/account_holders/entities_test.rb new file mode 100644 index 00000000..f944551a --- /dev/null +++ b/test/lithic/resources/account_holders/entities_test.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::AccountHolders::EntitiesTest < Lithic::Test::ResourceTest + def test_create_required_params + response = + @lithic.account_holders.entities.create( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + address: { + address1: "300 Normal Forest Way", + city: "Portland", + country: "USA", + postal_code: "90210", + state: "OR" + }, + dob: "1991-03-08T08:00:00Z", + email: "tim@left-earth.com", + first_name: "Timmy", + government_id: "211-23-1412", + last_name: "Turner", + phone_number: "+15555555555", + type: :BENEFICIAL_OWNER_INDIVIDUAL + ) + + assert_pattern do + response => Lithic::Models::AccountHolders::EntityCreateResponse + end + + assert_pattern do + response => { + token: String, + account_holder_token: String, + created: Time, + required_documents: ^(Lithic::Internal::Type::ArrayOf[Lithic::RequiredDocument]), + status: Lithic::Models::AccountHolders::EntityCreateResponse::Status, + status_reasons: ^(Lithic::Internal::Type::ArrayOf[enum: Lithic::Models::AccountHolders::EntityCreateResponse::StatusReason]) + } + end + end + + def test_delete_required_params + response = + @lithic.account_holders.entities.delete( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_holder_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => Lithic::AccountHolders::AccountHolderEntity + end + + assert_pattern do + response => { + token: String, + account_holder_token: String, + address: Lithic::AccountHolders::AccountHolderEntity::Address, + dob: String | nil, + email: String | nil, + first_name: String | nil, + last_name: String | nil, + phone_number: String | nil, + status: Lithic::AccountHolders::AccountHolderEntity::Status, + type: Lithic::TransactionMonitoring::EntityType + } + end + end +end diff --git a/test/lithic/resources/account_holders_test.rb b/test/lithic/resources/account_holders_test.rb new file mode 100644 index 00000000..f6f565bf --- /dev/null +++ b/test/lithic/resources/account_holders_test.rb @@ -0,0 +1,276 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::AccountHoldersTest < Lithic::Test::ResourceTest + def test_create_required_params + response = + @lithic.account_holders.create( + body: { + beneficial_owner_individuals: [ + { + address: { + address1: "300 Normal Forest Way", + city: "Portland", + country: "USA", + postal_code: "90210", + state: "OR" + }, + dob: "1991-03-08T08:00:00Z", + email: "tim@left-earth.com", + first_name: "Timmy", + government_id: "211-23-1412", + last_name: "Turner" + } + ], + business_entity: { + address: { + address1: "123 Old Forest Way", + city: "Omaha", + country: "USA", + postal_code: "61022", + state: "NE" + }, + government_id: "12-3456789", + legal_business_name: "Busy Business, Inc.", + phone_numbers: ["+15555555555"] + }, + control_person: { + address: { + address1: "451 New Forest Way", + city: "Springfield", + country: "USA", + postal_code: "68022", + state: "IL" + }, + dob: "1991-03-08T08:00:00Z", + email: "tom@middle-pluto.com", + first_name: "Tom", + government_id: "111-23-1412", + last_name: "Timothy" + }, + nature_of_business: "Software company selling solutions to the restaurant industry", + tos_timestamp: "2022-03-08T08:00:00Z", + workflow: :KYB_BYO + } + ) + + assert_pattern do + response => Lithic::Models::AccountHolderCreateResponse + end + + assert_pattern do + response => { + token: String, + account_token: String, + status: Lithic::Models::AccountHolderCreateResponse::Status, + status_reasons: ^(Lithic::Internal::Type::ArrayOf[enum: Lithic::Models::AccountHolderCreateResponse::StatusReason]), + created: Time | nil, + external_id: String | nil, + required_documents: ^(Lithic::Internal::Type::ArrayOf[Lithic::RequiredDocument]) | nil + } + end + end + + def test_retrieve + response = @lithic.account_holders.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::AccountHolder + end + + assert_pattern do + response => { + token: String, + created: Time, + account_token: String | nil, + beneficial_owner_individuals: ^(Lithic::Internal::Type::ArrayOf[Lithic::AccountHolder::BeneficialOwnerIndividual]) | nil, + business_account_token: String | nil, + business_entity: Lithic::AccountHolder::BusinessEntity | nil, + control_person: Lithic::AccountHolder::ControlPerson | nil, + email: String | nil, + exemption_type: Lithic::AccountHolder::ExemptionType | nil, + external_id: String | nil, + individual: Lithic::AccountHolder::Individual | nil, + naics_code: String | nil, + nature_of_business: String | nil, + phone_number: String | nil, + required_documents: ^(Lithic::Internal::Type::ArrayOf[Lithic::RequiredDocument]) | nil, + status: Lithic::AccountHolder::Status | nil, + status_reasons: ^(Lithic::Internal::Type::ArrayOf[enum: Lithic::AccountHolder::StatusReason]) | nil, + user_type: Lithic::AccountHolder::UserType | nil, + verification_application: Lithic::AccountHolder::VerificationApplication | nil, + website_url: String | nil + } + end + end + + def test_update_required_params + response = @lithic.account_holders.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", body: {}) + + assert_pattern do + response => Lithic::Models::AccountHolderUpdateResponse + end + + assert_pattern do + case response + in Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse + in Lithic::Models::AccountHolderUpdateResponse::PatchResponse + end + end + end + + def test_list + response = @lithic.account_holders.list + + assert_pattern do + response => Lithic::Internal::SinglePage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::AccountHolder + end + + assert_pattern do + row => { + token: String, + created: Time, + account_token: String | nil, + beneficial_owner_individuals: ^(Lithic::Internal::Type::ArrayOf[Lithic::AccountHolder::BeneficialOwnerIndividual]) | nil, + business_account_token: String | nil, + business_entity: Lithic::AccountHolder::BusinessEntity | nil, + control_person: Lithic::AccountHolder::ControlPerson | nil, + email: String | nil, + exemption_type: Lithic::AccountHolder::ExemptionType | nil, + external_id: String | nil, + individual: Lithic::AccountHolder::Individual | nil, + naics_code: String | nil, + nature_of_business: String | nil, + phone_number: String | nil, + required_documents: ^(Lithic::Internal::Type::ArrayOf[Lithic::RequiredDocument]) | nil, + status: Lithic::AccountHolder::Status | nil, + status_reasons: ^(Lithic::Internal::Type::ArrayOf[enum: Lithic::AccountHolder::StatusReason]) | nil, + user_type: Lithic::AccountHolder::UserType | nil, + verification_application: Lithic::AccountHolder::VerificationApplication | nil, + website_url: String | nil + } + end + end + + def test_list_documents + response = @lithic.account_holders.list_documents("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::AccountHolderListDocumentsResponse + end + + assert_pattern do + response => { + data: ^(Lithic::Internal::Type::ArrayOf[Lithic::Document]) | nil + } + end + end + + def test_retrieve_document_required_params + response = + @lithic.account_holders.retrieve_document( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_holder_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => Lithic::Document + end + + assert_pattern do + response => { + token: String, + account_holder_token: String, + document_type: Lithic::Document::DocumentType, + entity_token: String, + required_document_uploads: ^(Lithic::Internal::Type::ArrayOf[Lithic::Document::RequiredDocumentUpload]) + } + end + end + + def test_simulate_enrollment_document_review_required_params + response = + @lithic.account_holders.simulate_enrollment_document_review( + document_upload_token: "b11cd67b-0a52-4180-8365-314f3def5426", + status: :UPLOADED + ) + + assert_pattern do + response => Lithic::Document + end + + assert_pattern do + response => { + token: String, + account_holder_token: String, + document_type: Lithic::Document::DocumentType, + entity_token: String, + required_document_uploads: ^(Lithic::Internal::Type::ArrayOf[Lithic::Document::RequiredDocumentUpload]) + } + end + end + + def test_simulate_enrollment_review + response = @lithic.account_holders.simulate_enrollment_review + + assert_pattern do + response => Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse + end + + assert_pattern do + response => { + token: String | nil, + account_token: String | nil, + beneficial_owner_individuals: ^(Lithic::Internal::Type::ArrayOf[Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::BeneficialOwnerIndividual]) | nil, + business_account_token: String | nil, + business_entity: Lithic::KYBBusinessEntity | nil, + control_person: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ControlPerson | nil, + created: Time | nil, + email: String | nil, + exemption_type: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::ExemptionType | nil, + external_id: String | nil, + individual: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Individual | nil, + naics_code: String | nil, + nature_of_business: String | nil, + phone_number: String | nil, + required_documents: ^(Lithic::Internal::Type::ArrayOf[Lithic::RequiredDocument]) | nil, + status: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::Status | nil, + status_reasons: ^(Lithic::Internal::Type::ArrayOf[enum: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::StatusReason]) | nil, + user_type: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::UserType | nil, + verification_application: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse::VerificationApplication | nil, + website_url: String | nil + } + end + end + + def test_upload_document_required_params + response = + @lithic.account_holders.upload_document( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + document_type: :EIN_LETTER, + entity_token: "83cf25ae-c14f-4d10-9fa2-0119f36c7286" + ) + + assert_pattern do + response => Lithic::Document + end + + assert_pattern do + response => { + token: String, + account_holder_token: String, + document_type: Lithic::Document::DocumentType, + entity_token: String, + required_document_uploads: ^(Lithic::Internal::Type::ArrayOf[Lithic::Document::RequiredDocumentUpload]) + } + end + end +end diff --git a/test/lithic/resources/accounts_test.rb b/test/lithic/resources/accounts_test.rb new file mode 100644 index 00000000..887da7c8 --- /dev/null +++ b/test/lithic/resources/accounts_test.rb @@ -0,0 +1,143 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::AccountsTest < Lithic::Test::ResourceTest + def test_retrieve + response = @lithic.accounts.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Account + end + + assert_pattern do + response => { + token: String, + created: Time | nil, + spend_limit: Lithic::Account::SpendLimit, + state: Lithic::Account::State, + account_holder: Lithic::Account::AccountHolder | nil, + auth_rule_tokens: ^(Lithic::Internal::Type::ArrayOf[String]) | nil, + cardholder_currency: String | nil, + comment: String | nil, + substatus: Lithic::Account::Substatus | nil, + verification_address: Lithic::Account::VerificationAddress | nil + } + end + end + + def test_update + skip("Prism returns invalid data") + + response = @lithic.accounts.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Account + end + + assert_pattern do + response => { + token: String, + created: Time | nil, + spend_limit: Lithic::Account::SpendLimit, + state: Lithic::Account::State, + account_holder: Lithic::Account::AccountHolder | nil, + auth_rule_tokens: ^(Lithic::Internal::Type::ArrayOf[String]) | nil, + cardholder_currency: String | nil, + comment: String | nil, + substatus: Lithic::Account::Substatus | nil, + verification_address: Lithic::Account::VerificationAddress | nil + } + end + end + + def test_list + response = @lithic.accounts.list + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Account + end + + assert_pattern do + row => { + token: String, + created: Time | nil, + spend_limit: Lithic::Account::SpendLimit, + state: Lithic::Account::State, + account_holder: Lithic::Account::AccountHolder | nil, + auth_rule_tokens: ^(Lithic::Internal::Type::ArrayOf[String]) | nil, + cardholder_currency: String | nil, + comment: String | nil, + substatus: Lithic::Account::Substatus | nil, + verification_address: Lithic::Account::VerificationAddress | nil + } + end + end + + def test_retrieve_signals + response = @lithic.accounts.retrieve_signals("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::SignalsResponse + end + + assert_pattern do + response => { + approved_txn_amount_m2: Float | nil, + approved_txn_amount_m2_30d: Float | nil, + approved_txn_amount_m2_7d: Float | nil, + approved_txn_amount_m2_90d: Float | nil, + approved_txn_count: Integer | nil, + approved_txn_count_30d: Integer | nil, + approved_txn_count_7d: Integer | nil, + approved_txn_count_90d: Integer | nil, + avg_transaction_amount: Float | nil, + avg_transaction_amount_30d: Float | nil, + avg_transaction_amount_7d: Float | nil, + avg_transaction_amount_90d: Float | nil, + distinct_country_count: Integer | nil, + distinct_mcc_count: Integer | nil, + first_txn_at: Time | nil, + is_first_transaction: Lithic::Internal::Type::Boolean | nil, + last_cp_country: String | nil, + last_cp_postal_code: String | nil, + last_cp_timestamp: Time | nil, + last_txn_approved_at: Time | nil, + seen_countries: ^(Lithic::Internal::Type::ArrayOf[String]) | nil, + seen_mccs: ^(Lithic::Internal::Type::ArrayOf[String]) | nil, + seen_merchants: ^(Lithic::Internal::Type::ArrayOf[String]) | nil, + stdev_transaction_amount: Float | nil, + stdev_transaction_amount_30d: Float | nil, + stdev_transaction_amount_7d: Float | nil, + stdev_transaction_amount_90d: Float | nil, + three_ds_success_count: Integer | nil, + three_ds_success_rate: Float | nil, + three_ds_total_count: Integer | nil, + time_since_last_transaction_days: Float | nil + } + end + end + + def test_retrieve_spend_limits + response = @lithic.accounts.retrieve_spend_limits("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::AccountSpendLimits + end + + assert_pattern do + response => { + available_spend_limit: Lithic::AccountSpendLimits::AvailableSpendLimit, + spend_limit: Lithic::AccountSpendLimits::SpendLimit | nil, + spend_velocity: Lithic::AccountSpendLimits::SpendVelocity | nil + } + end + end +end diff --git a/test/lithic/resources/auth_rules/v2/backtests_test.rb b/test/lithic/resources/auth_rules/v2/backtests_test.rb new file mode 100644 index 00000000..adeb8479 --- /dev/null +++ b/test/lithic/resources/auth_rules/v2/backtests_test.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +require_relative "../../../test_helper" + +class Lithic::Test::Resources::AuthRules::V2::BacktestsTest < Lithic::Test::ResourceTest + def test_create + response = @lithic.auth_rules.v2.backtests.create("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::AuthRules::V2::BacktestCreateResponse + end + + assert_pattern do + response => { + backtest_token: String | nil + } + end + end + + def test_retrieve_required_params + response = + @lithic.auth_rules.v2.backtests.retrieve( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + auth_rule_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => Lithic::AuthRules::V2::BacktestResults + end + + assert_pattern do + response => { + backtest_token: String, + results: Lithic::AuthRules::V2::BacktestResults::Results, + simulation_parameters: Lithic::AuthRules::V2::BacktestResults::SimulationParameters + } + end + end +end diff --git a/test/lithic/resources/auth_rules/v2_test.rb b/test/lithic/resources/auth_rules/v2_test.rb new file mode 100644 index 00000000..d06f197a --- /dev/null +++ b/test/lithic/resources/auth_rules/v2_test.rb @@ -0,0 +1,269 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::AuthRules::V2Test < Lithic::Test::ResourceTest + def test_create_required_params + response = + @lithic.auth_rules.v2.create( + body: { + parameters: {conditions: [{attribute: :MCC, operation: :IS_ONE_OF, value: "string"}]}, + type: :CONDITIONAL_BLOCK + } + ) + + assert_pattern do + response => Lithic::AuthRules::AuthRule + end + + assert_pattern do + response => { + token: String, + account_tokens: ^(Lithic::Internal::Type::ArrayOf[String]), + business_account_tokens: ^(Lithic::Internal::Type::ArrayOf[String]), + card_tokens: ^(Lithic::Internal::Type::ArrayOf[String]), + current_version: Lithic::AuthRules::AuthRule::CurrentVersion | nil, + draft_version: Lithic::AuthRules::AuthRule::DraftVersion | nil, + event_stream: Lithic::AuthRules::EventStream, + lithic_managed: Lithic::Internal::Type::Boolean, + name: String | nil, + program_level: Lithic::Internal::Type::Boolean, + state: Lithic::AuthRules::AuthRule::State, + type: Lithic::AuthRules::AuthRule::Type, + excluded_account_tokens: ^(Lithic::Internal::Type::ArrayOf[String]) | nil, + excluded_business_account_tokens: ^(Lithic::Internal::Type::ArrayOf[String]) | nil, + excluded_card_tokens: ^(Lithic::Internal::Type::ArrayOf[String]) | nil + } + end + end + + def test_retrieve + response = @lithic.auth_rules.v2.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::AuthRules::AuthRule + end + + assert_pattern do + response => { + token: String, + account_tokens: ^(Lithic::Internal::Type::ArrayOf[String]), + business_account_tokens: ^(Lithic::Internal::Type::ArrayOf[String]), + card_tokens: ^(Lithic::Internal::Type::ArrayOf[String]), + current_version: Lithic::AuthRules::AuthRule::CurrentVersion | nil, + draft_version: Lithic::AuthRules::AuthRule::DraftVersion | nil, + event_stream: Lithic::AuthRules::EventStream, + lithic_managed: Lithic::Internal::Type::Boolean, + name: String | nil, + program_level: Lithic::Internal::Type::Boolean, + state: Lithic::AuthRules::AuthRule::State, + type: Lithic::AuthRules::AuthRule::Type, + excluded_account_tokens: ^(Lithic::Internal::Type::ArrayOf[String]) | nil, + excluded_business_account_tokens: ^(Lithic::Internal::Type::ArrayOf[String]) | nil, + excluded_card_tokens: ^(Lithic::Internal::Type::ArrayOf[String]) | nil + } + end + end + + def test_update_required_params + response = @lithic.auth_rules.v2.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", body: {}) + + assert_pattern do + response => Lithic::AuthRules::AuthRule + end + + assert_pattern do + response => { + token: String, + account_tokens: ^(Lithic::Internal::Type::ArrayOf[String]), + business_account_tokens: ^(Lithic::Internal::Type::ArrayOf[String]), + card_tokens: ^(Lithic::Internal::Type::ArrayOf[String]), + current_version: Lithic::AuthRules::AuthRule::CurrentVersion | nil, + draft_version: Lithic::AuthRules::AuthRule::DraftVersion | nil, + event_stream: Lithic::AuthRules::EventStream, + lithic_managed: Lithic::Internal::Type::Boolean, + name: String | nil, + program_level: Lithic::Internal::Type::Boolean, + state: Lithic::AuthRules::AuthRule::State, + type: Lithic::AuthRules::AuthRule::Type, + excluded_account_tokens: ^(Lithic::Internal::Type::ArrayOf[String]) | nil, + excluded_business_account_tokens: ^(Lithic::Internal::Type::ArrayOf[String]) | nil, + excluded_card_tokens: ^(Lithic::Internal::Type::ArrayOf[String]) | nil + } + end + end + + def test_list + response = @lithic.auth_rules.v2.list + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::AuthRules::AuthRule + end + + assert_pattern do + row => { + token: String, + account_tokens: ^(Lithic::Internal::Type::ArrayOf[String]), + business_account_tokens: ^(Lithic::Internal::Type::ArrayOf[String]), + card_tokens: ^(Lithic::Internal::Type::ArrayOf[String]), + current_version: Lithic::AuthRules::AuthRule::CurrentVersion | nil, + draft_version: Lithic::AuthRules::AuthRule::DraftVersion | nil, + event_stream: Lithic::AuthRules::EventStream, + lithic_managed: Lithic::Internal::Type::Boolean, + name: String | nil, + program_level: Lithic::Internal::Type::Boolean, + state: Lithic::AuthRules::AuthRule::State, + type: Lithic::AuthRules::AuthRule::Type, + excluded_account_tokens: ^(Lithic::Internal::Type::ArrayOf[String]) | nil, + excluded_business_account_tokens: ^(Lithic::Internal::Type::ArrayOf[String]) | nil, + excluded_card_tokens: ^(Lithic::Internal::Type::ArrayOf[String]) | nil + } + end + end + + def test_delete + response = @lithic.auth_rules.v2.delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => nil + end + end + + def test_draft + response = @lithic.auth_rules.v2.draft("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::AuthRules::AuthRule + end + + assert_pattern do + response => { + token: String, + account_tokens: ^(Lithic::Internal::Type::ArrayOf[String]), + business_account_tokens: ^(Lithic::Internal::Type::ArrayOf[String]), + card_tokens: ^(Lithic::Internal::Type::ArrayOf[String]), + current_version: Lithic::AuthRules::AuthRule::CurrentVersion | nil, + draft_version: Lithic::AuthRules::AuthRule::DraftVersion | nil, + event_stream: Lithic::AuthRules::EventStream, + lithic_managed: Lithic::Internal::Type::Boolean, + name: String | nil, + program_level: Lithic::Internal::Type::Boolean, + state: Lithic::AuthRules::AuthRule::State, + type: Lithic::AuthRules::AuthRule::Type, + excluded_account_tokens: ^(Lithic::Internal::Type::ArrayOf[String]) | nil, + excluded_business_account_tokens: ^(Lithic::Internal::Type::ArrayOf[String]) | nil, + excluded_card_tokens: ^(Lithic::Internal::Type::ArrayOf[String]) | nil + } + end + end + + def test_list_results + response = @lithic.auth_rules.v2.list_results + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::AuthRules::V2ListResultsResponse + end + + assert_pattern do + case row + in Lithic::Models::AuthRules::V2ListResultsResponse::AuthorizationResult + in Lithic::Models::AuthRules::V2ListResultsResponse::Authentication3DSResult + in Lithic::Models::AuthRules::V2ListResultsResponse::TokenizationResult + in Lithic::Models::AuthRules::V2ListResultsResponse::ACHResult + end + end + end + + def test_list_versions + response = @lithic.auth_rules.v2.list_versions("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::AuthRules::V2ListVersionsResponse + end + + assert_pattern do + response => { + data: ^(Lithic::Internal::Type::ArrayOf[Lithic::AuthRules::AuthRuleVersion]) + } + end + end + + def test_promote + response = @lithic.auth_rules.v2.promote("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::AuthRules::AuthRule + end + + assert_pattern do + response => { + token: String, + account_tokens: ^(Lithic::Internal::Type::ArrayOf[String]), + business_account_tokens: ^(Lithic::Internal::Type::ArrayOf[String]), + card_tokens: ^(Lithic::Internal::Type::ArrayOf[String]), + current_version: Lithic::AuthRules::AuthRule::CurrentVersion | nil, + draft_version: Lithic::AuthRules::AuthRule::DraftVersion | nil, + event_stream: Lithic::AuthRules::EventStream, + lithic_managed: Lithic::Internal::Type::Boolean, + name: String | nil, + program_level: Lithic::Internal::Type::Boolean, + state: Lithic::AuthRules::AuthRule::State, + type: Lithic::AuthRules::AuthRule::Type, + excluded_account_tokens: ^(Lithic::Internal::Type::ArrayOf[String]) | nil, + excluded_business_account_tokens: ^(Lithic::Internal::Type::ArrayOf[String]) | nil, + excluded_card_tokens: ^(Lithic::Internal::Type::ArrayOf[String]) | nil + } + end + end + + def test_retrieve_features + response = @lithic.auth_rules.v2.retrieve_features("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::AuthRules::V2RetrieveFeaturesResponse + end + + assert_pattern do + response => { + evaluated: Time, + features: ^(Lithic::Internal::Type::ArrayOf[Lithic::Models::AuthRules::V2RetrieveFeaturesResponse::Feature]) + } + end + end + + def test_retrieve_report_required_params + response = + @lithic.auth_rules.v2.retrieve_report( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + begin_: "2019-12-27", + end_: "2019-12-27" + ) + + assert_pattern do + response => Lithic::Models::AuthRules::V2RetrieveReportResponse + end + + assert_pattern do + response => { + auth_rule_token: String, + begin_: Date, + daily_statistics: ^(Lithic::Internal::Type::ArrayOf[Lithic::Models::AuthRules::V2RetrieveReportResponse::DailyStatistic]), + end_: Date + } + end + end +end diff --git a/test/lithic/resources/auth_rules_test.rb b/test/lithic/resources/auth_rules_test.rb new file mode 100644 index 00000000..047830a7 --- /dev/null +++ b/test/lithic/resources/auth_rules_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::AuthRulesTest < Lithic::Test::ResourceTest +end diff --git a/test/lithic/resources/auth_stream_enrollment_test.rb b/test/lithic/resources/auth_stream_enrollment_test.rb new file mode 100644 index 00000000..50b2e088 --- /dev/null +++ b/test/lithic/resources/auth_stream_enrollment_test.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::AuthStreamEnrollmentTest < Lithic::Test::ResourceTest + def test_retrieve_secret + response = @lithic.auth_stream_enrollment.retrieve_secret + + assert_pattern do + response => Lithic::AuthStreamSecret + end + + assert_pattern do + response => { + secret: String | nil + } + end + end + + def test_rotate_secret + response = @lithic.auth_stream_enrollment.rotate_secret + + assert_pattern do + response => nil + end + end +end diff --git a/test/lithic/resources/balances_test.rb b/test/lithic/resources/balances_test.rb new file mode 100644 index 00000000..0403fa40 --- /dev/null +++ b/test/lithic/resources/balances_test.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::BalancesTest < Lithic::Test::ResourceTest + def test_list + response = @lithic.balances.list + + assert_pattern do + response => Lithic::Internal::SinglePage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Balance + end + + assert_pattern do + row => { + available_amount: Integer, + created: Time, + currency: String, + financial_account_token: String, + financial_account_type: Lithic::Balance::FinancialAccountType, + last_transaction_event_token: String | nil, + last_transaction_token: String | nil, + pending_amount: Integer, + total_amount: Integer, + updated: Time + } + end + end +end diff --git a/test/lithic/resources/book_transfers_test.rb b/test/lithic/resources/book_transfers_test.rb new file mode 100644 index 00000000..5d1294bb --- /dev/null +++ b/test/lithic/resources/book_transfers_test.rb @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::BookTransfersTest < Lithic::Test::ResourceTest + def test_create_required_params + response = + @lithic.book_transfers.create( + amount: 1, + category: :ADJUSTMENT, + from_financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + subtype: "subtype", + to_financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + type: :ATM_BALANCE_INQUIRY + ) + + assert_pattern do + response => Lithic::BookTransferResponse + end + + assert_pattern do + response => { + token: String, + category: Lithic::BookTransferResponse::Category, + created: Time, + currency: String, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::BookTransferResponse::Event]), + family: Symbol, + from_financial_account_token: String, + pending_amount: Integer, + result: Lithic::BookTransferResponse::Result, + settled_amount: Integer, + status: Lithic::BookTransferResponse::Status, + to_financial_account_token: String, + updated: Time, + external_id: String | nil, + external_resource: Lithic::ExternalResource | nil, + transaction_series: Lithic::BookTransferResponse::TransactionSeries | nil + } + end + end + + def test_retrieve + response = @lithic.book_transfers.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::BookTransferResponse + end + + assert_pattern do + response => { + token: String, + category: Lithic::BookTransferResponse::Category, + created: Time, + currency: String, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::BookTransferResponse::Event]), + family: Symbol, + from_financial_account_token: String, + pending_amount: Integer, + result: Lithic::BookTransferResponse::Result, + settled_amount: Integer, + status: Lithic::BookTransferResponse::Status, + to_financial_account_token: String, + updated: Time, + external_id: String | nil, + external_resource: Lithic::ExternalResource | nil, + transaction_series: Lithic::BookTransferResponse::TransactionSeries | nil + } + end + end + + def test_list + response = @lithic.book_transfers.list + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::BookTransferResponse + end + + assert_pattern do + row => { + token: String, + category: Lithic::BookTransferResponse::Category, + created: Time, + currency: String, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::BookTransferResponse::Event]), + family: Symbol, + from_financial_account_token: String, + pending_amount: Integer, + result: Lithic::BookTransferResponse::Result, + settled_amount: Integer, + status: Lithic::BookTransferResponse::Status, + to_financial_account_token: String, + updated: Time, + external_id: String | nil, + external_resource: Lithic::ExternalResource | nil, + transaction_series: Lithic::BookTransferResponse::TransactionSeries | nil + } + end + end + + def test_retry__required_params + response = + @lithic.book_transfers.retry_( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + retry_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => Lithic::BookTransferResponse + end + + assert_pattern do + response => { + token: String, + category: Lithic::BookTransferResponse::Category, + created: Time, + currency: String, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::BookTransferResponse::Event]), + family: Symbol, + from_financial_account_token: String, + pending_amount: Integer, + result: Lithic::BookTransferResponse::Result, + settled_amount: Integer, + status: Lithic::BookTransferResponse::Status, + to_financial_account_token: String, + updated: Time, + external_id: String | nil, + external_resource: Lithic::ExternalResource | nil, + transaction_series: Lithic::BookTransferResponse::TransactionSeries | nil + } + end + end + + def test_reverse + response = @lithic.book_transfers.reverse("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::BookTransferResponse + end + + assert_pattern do + response => { + token: String, + category: Lithic::BookTransferResponse::Category, + created: Time, + currency: String, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::BookTransferResponse::Event]), + family: Symbol, + from_financial_account_token: String, + pending_amount: Integer, + result: Lithic::BookTransferResponse::Result, + settled_amount: Integer, + status: Lithic::BookTransferResponse::Status, + to_financial_account_token: String, + updated: Time, + external_id: String | nil, + external_resource: Lithic::ExternalResource | nil, + transaction_series: Lithic::BookTransferResponse::TransactionSeries | nil + } + end + end +end diff --git a/test/lithic/resources/card_authorizations_test.rb b/test/lithic/resources/card_authorizations_test.rb new file mode 100644 index 00000000..6af39f52 --- /dev/null +++ b/test/lithic/resources/card_authorizations_test.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::CardAuthorizationsTest < Lithic::Test::ResourceTest + def test_challenge_response_required_params + response = + @lithic.card_authorizations.challenge_response( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + response: :APPROVE + ) + + assert_pattern do + response => nil + end + end +end diff --git a/test/lithic/resources/card_bulk_orders_test.rb b/test/lithic/resources/card_bulk_orders_test.rb new file mode 100644 index 00000000..df7c62e1 --- /dev/null +++ b/test/lithic/resources/card_bulk_orders_test.rb @@ -0,0 +1,109 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::CardBulkOrdersTest < Lithic::Test::ResourceTest + def test_create_required_params + response = + @lithic.card_bulk_orders.create( + customer_product_id: "custom-card-design-123", + shipping_address: { + address1: "123 Main Street", + city: "NEW YORK", + country: "USA", + first_name: "Johnny", + last_name: "Appleseed", + postal_code: "10001", + state: "NY" + }, + shipping_method: :BULK_EXPEDITED + ) + + assert_pattern do + response => Lithic::CardBulkOrder + end + + assert_pattern do + response => { + token: String, + card_tokens: ^(Lithic::Internal::Type::ArrayOf[String]), + created: Time, + customer_product_id: String | nil, + shipping_address: Lithic::Internal::Type::Unknown, + shipping_method: Lithic::CardBulkOrder::ShippingMethod, + status: Lithic::CardBulkOrder::Status, + updated: Time + } + end + end + + def test_retrieve + response = @lithic.card_bulk_orders.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::CardBulkOrder + end + + assert_pattern do + response => { + token: String, + card_tokens: ^(Lithic::Internal::Type::ArrayOf[String]), + created: Time, + customer_product_id: String | nil, + shipping_address: Lithic::Internal::Type::Unknown, + shipping_method: Lithic::CardBulkOrder::ShippingMethod, + status: Lithic::CardBulkOrder::Status, + updated: Time + } + end + end + + def test_update_required_params + response = @lithic.card_bulk_orders.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", status: :LOCKED) + + assert_pattern do + response => Lithic::CardBulkOrder + end + + assert_pattern do + response => { + token: String, + card_tokens: ^(Lithic::Internal::Type::ArrayOf[String]), + created: Time, + customer_product_id: String | nil, + shipping_address: Lithic::Internal::Type::Unknown, + shipping_method: Lithic::CardBulkOrder::ShippingMethod, + status: Lithic::CardBulkOrder::Status, + updated: Time + } + end + end + + def test_list + response = @lithic.card_bulk_orders.list + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::CardBulkOrder + end + + assert_pattern do + row => { + token: String, + card_tokens: ^(Lithic::Internal::Type::ArrayOf[String]), + created: Time, + customer_product_id: String | nil, + shipping_address: Lithic::Internal::Type::Unknown, + shipping_method: Lithic::CardBulkOrder::ShippingMethod, + status: Lithic::CardBulkOrder::Status, + updated: Time + } + end + end +end diff --git a/test/lithic/resources/card_programs_test.rb b/test/lithic/resources/card_programs_test.rb new file mode 100644 index 00000000..a3ceb6e1 --- /dev/null +++ b/test/lithic/resources/card_programs_test.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::CardProgramsTest < Lithic::Test::ResourceTest + def test_retrieve + response = @lithic.card_programs.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::CardProgram + end + + assert_pattern do + response => { + token: String, + account_level_management_enabled: Lithic::Internal::Type::Boolean, + created: Time, + name: String, + pan_range_end: String, + pan_range_start: String, + cardholder_currency: String | nil, + settlement_currencies: ^(Lithic::Internal::Type::ArrayOf[String]) | nil + } + end + end + + def test_list + response = @lithic.card_programs.list + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::CardProgram + end + + assert_pattern do + row => { + token: String, + account_level_management_enabled: Lithic::Internal::Type::Boolean, + created: Time, + name: String, + pan_range_end: String, + pan_range_start: String, + cardholder_currency: String | nil, + settlement_currencies: ^(Lithic::Internal::Type::ArrayOf[String]) | nil + } + end + end +end diff --git a/test/lithic/resources/cards/balances_test.rb b/test/lithic/resources/cards/balances_test.rb new file mode 100644 index 00000000..0610eca4 --- /dev/null +++ b/test/lithic/resources/cards/balances_test.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::Cards::BalancesTest < Lithic::Test::ResourceTest + def test_list + response = @lithic.cards.balances.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Internal::SinglePage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::FinancialAccountBalance + end + + assert_pattern do + row => { + token: String, + available_amount: Integer, + created: Time, + currency: String, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + type: Lithic::FinancialAccountBalance::Type, + updated: Time + } + end + end +end diff --git a/test/lithic/resources/cards/financial_transactions_test.rb b/test/lithic/resources/cards/financial_transactions_test.rb new file mode 100644 index 00000000..8d319405 --- /dev/null +++ b/test/lithic/resources/cards/financial_transactions_test.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::Cards::FinancialTransactionsTest < Lithic::Test::ResourceTest + def test_retrieve_required_params + response = + @lithic.cards.financial_transactions.retrieve( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + card_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => Lithic::FinancialTransaction + end + + assert_pattern do + response => { + token: String, + category: Lithic::FinancialTransaction::Category, + created: Time, + currency: String, + descriptor: String, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::FinancialEvent]), + pending_amount: Integer, + result: Lithic::FinancialTransaction::Result, + settled_amount: Integer, + status: Lithic::FinancialTransaction::Status, + updated: Time + } + end + end + + def test_list + response = @lithic.cards.financial_transactions.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Internal::SinglePage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::FinancialTransaction + end + + assert_pattern do + row => { + token: String, + category: Lithic::FinancialTransaction::Category, + created: Time, + currency: String, + descriptor: String, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::FinancialEvent]), + pending_amount: Integer, + result: Lithic::FinancialTransaction::Result, + settled_amount: Integer, + status: Lithic::FinancialTransaction::Status, + updated: Time + } + end + end +end diff --git a/test/lithic/resources/cards_test.rb b/test/lithic/resources/cards_test.rb new file mode 100644 index 00000000..ef519052 --- /dev/null +++ b/test/lithic/resources/cards_test.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::CardsTest < Lithic::Test::ResourceTest + def test_create_required_params + response = @lithic.cards.create(type: :VIRTUAL) + + assert_pattern do + response => Lithic::Card + end + end + + def test_retrieve + response = @lithic.cards.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Card + end + end + + def test_update + response = @lithic.cards.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Card + end + end + + def test_list + response = @lithic.cards.list + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::NonPCICard + end + + assert_pattern do + row => { + token: String, + account_token: String, + card_program_token: String, + created: Time, + funding: Lithic::NonPCICard::Funding | nil, + last_four: String, + pin_status: Lithic::NonPCICard::PinStatus, + spend_limit: Integer, + spend_limit_duration: Lithic::SpendLimitDuration, + state: Lithic::NonPCICard::State, + type: Lithic::NonPCICard::Type, + auth_rule_tokens: ^(Lithic::Internal::Type::ArrayOf[String]) | nil, + bulk_order_token: String | nil, + cardholder_currency: String | nil, + comment: String | nil, + digital_card_art_token: String | nil, + exp_month: String | nil, + exp_year: String | nil, + hostname: String | nil, + memo: String | nil, + network_program_token: String | nil, + pending_commands: ^(Lithic::Internal::Type::ArrayOf[String]) | nil, + product_id: String | nil, + replacement_for: String | nil, + substatus: Lithic::NonPCICard::Substatus | nil + } + end + end + + def test_convert_physical_required_params + response = + @lithic.cards.convert_physical( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + shipping_address: { + address1: "5 Broad Street", + city: "NEW YORK", + country: "USA", + first_name: "Janet", + last_name: "Yellen", + postal_code: "10001", + state: "NY" + } + ) + + assert_pattern do + response => Lithic::Card + end + end + + def test_embed_required_params + response = @lithic.cards.embed(embed_request: "embed_request", hmac: "hmac") + + assert_pattern do + response => String + end + end + + def test_provision + response = @lithic.cards.provision("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::CardProvisionResponse + end + + assert_pattern do + response => { + provisioning_payload: Lithic::Models::CardProvisionResponse::ProvisioningPayload | nil + } + end + end + + def test_reissue + response = @lithic.cards.reissue("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Card + end + end + + def test_renew_required_params + response = + @lithic.cards.renew( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + shipping_address: { + address1: "5 Broad Street", + city: "NEW YORK", + country: "USA", + first_name: "Janet", + last_name: "Yellen", + postal_code: "10001", + state: "NY" + } + ) + + assert_pattern do + response => Lithic::Card + end + end + + def test_retrieve_signals + response = @lithic.cards.retrieve_signals("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::SignalsResponse + end + + assert_pattern do + response => { + approved_txn_amount_m2: Float | nil, + approved_txn_amount_m2_30d: Float | nil, + approved_txn_amount_m2_7d: Float | nil, + approved_txn_amount_m2_90d: Float | nil, + approved_txn_count: Integer | nil, + approved_txn_count_30d: Integer | nil, + approved_txn_count_7d: Integer | nil, + approved_txn_count_90d: Integer | nil, + avg_transaction_amount: Float | nil, + avg_transaction_amount_30d: Float | nil, + avg_transaction_amount_7d: Float | nil, + avg_transaction_amount_90d: Float | nil, + distinct_country_count: Integer | nil, + distinct_mcc_count: Integer | nil, + first_txn_at: Time | nil, + is_first_transaction: Lithic::Internal::Type::Boolean | nil, + last_cp_country: String | nil, + last_cp_postal_code: String | nil, + last_cp_timestamp: Time | nil, + last_txn_approved_at: Time | nil, + seen_countries: ^(Lithic::Internal::Type::ArrayOf[String]) | nil, + seen_mccs: ^(Lithic::Internal::Type::ArrayOf[String]) | nil, + seen_merchants: ^(Lithic::Internal::Type::ArrayOf[String]) | nil, + stdev_transaction_amount: Float | nil, + stdev_transaction_amount_30d: Float | nil, + stdev_transaction_amount_7d: Float | nil, + stdev_transaction_amount_90d: Float | nil, + three_ds_success_count: Integer | nil, + three_ds_success_rate: Float | nil, + three_ds_total_count: Integer | nil, + time_since_last_transaction_days: Float | nil + } + end + end + + def test_retrieve_spend_limits + response = @lithic.cards.retrieve_spend_limits("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::CardSpendLimits + end + + assert_pattern do + response => { + available_spend_limit: Lithic::CardSpendLimits::AvailableSpendLimit, + spend_limit: Lithic::CardSpendLimits::SpendLimit | nil, + spend_velocity: Lithic::CardSpendLimits::SpendVelocity | nil + } + end + end + + def test_search_by_pan_required_params + response = @lithic.cards.search_by_pan(pan: "4111111289144142") + + assert_pattern do + response => Lithic::Card + end + end + + def test_web_provision + response = @lithic.cards.web_provision("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::CardWebProvisionResponse + end + + assert_pattern do + case response + in Lithic::Models::CardWebProvisionResponse::AppleWebPushProvisioningResponse + in Lithic::Models::CardWebProvisionResponse::GoogleWebPushProvisioningResponse + end + end + end +end diff --git a/test/lithic/resources/credit_products/extended_credit_test.rb b/test/lithic/resources/credit_products/extended_credit_test.rb new file mode 100644 index 00000000..a9b74317 --- /dev/null +++ b/test/lithic/resources/credit_products/extended_credit_test.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::CreditProducts::ExtendedCreditTest < Lithic::Test::ResourceTest + def test_retrieve + response = @lithic.credit_products.extended_credit.retrieve("credit_product_token") + + assert_pattern do + response => Lithic::CreditProducts::CreditProductsExtendedCredit + end + + assert_pattern do + response => { + credit_extended: Integer + } + end + end +end diff --git a/test/lithic/resources/credit_products/prime_rates_test.rb b/test/lithic/resources/credit_products/prime_rates_test.rb new file mode 100644 index 00000000..c384f9e2 --- /dev/null +++ b/test/lithic/resources/credit_products/prime_rates_test.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::CreditProducts::PrimeRatesTest < Lithic::Test::ResourceTest + def test_create_required_params + response = + @lithic.credit_products.prime_rates.create( + "credit_product_token", + effective_date: "2019-12-27", + rate: "rate" + ) + + assert_pattern do + response => nil + end + end + + def test_retrieve + response = @lithic.credit_products.prime_rates.retrieve("credit_product_token") + + assert_pattern do + response => Lithic::Models::CreditProducts::PrimeRateRetrieveResponse + end + + assert_pattern do + response => { + data: ^(Lithic::Internal::Type::ArrayOf[Lithic::Models::CreditProducts::PrimeRateRetrieveResponse::Data]), + has_more: Lithic::Internal::Type::Boolean + } + end + end +end diff --git a/test/lithic/resources/credit_products_test.rb b/test/lithic/resources/credit_products_test.rb new file mode 100644 index 00000000..8364fc4f --- /dev/null +++ b/test/lithic/resources/credit_products_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::CreditProductsTest < Lithic::Test::ResourceTest +end diff --git a/test/lithic/resources/digital_card_art_test.rb b/test/lithic/resources/digital_card_art_test.rb new file mode 100644 index 00000000..943614fe --- /dev/null +++ b/test/lithic/resources/digital_card_art_test.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::DigitalCardArtTest < Lithic::Test::ResourceTest + def test_retrieve + response = @lithic.digital_card_art.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::DigitalCardArtAPI + end + + assert_pattern do + response => { + token: String, + card_program_token: String, + created: Time, + description: String, + is_enabled: Lithic::Internal::Type::Boolean, + network: Lithic::DigitalCardArtAPI::Network, + is_card_program_default: Lithic::Internal::Type::Boolean | nil + } + end + end + + def test_list + response = @lithic.digital_card_art.list + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::DigitalCardArtAPI + end + + assert_pattern do + row => { + token: String, + card_program_token: String, + created: Time, + description: String, + is_enabled: Lithic::Internal::Type::Boolean, + network: Lithic::DigitalCardArtAPI::Network, + is_card_program_default: Lithic::Internal::Type::Boolean | nil + } + end + end +end diff --git a/test/lithic/resources/disputes_test.rb b/test/lithic/resources/disputes_test.rb new file mode 100644 index 00000000..067040f1 --- /dev/null +++ b/test/lithic/resources/disputes_test.rb @@ -0,0 +1,267 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::DisputesTest < Lithic::Test::ResourceTest + def test_create_required_params + response = + @lithic.disputes.create( + amount: 10_000, + reason: :FRAUD_CARD_PRESENT, + transaction_token: "12345624-aa69-4cbc-a946-30d90181b621" + ) + + assert_pattern do + response => Lithic::Dispute + end + + assert_pattern do + response => { + token: String, + amount: Integer, + arbitration_date: Time | nil, + created: Time, + customer_filed_date: Time | nil, + customer_note: String | nil, + network_claim_ids: ^(Lithic::Internal::Type::ArrayOf[String]) | nil, + network_filed_date: Time | nil, + network_reason_code: String | nil, + prearbitration_date: Time | nil, + primary_claim_id: String | nil, + reason: Lithic::Dispute::Reason, + representment_date: Time | nil, + resolution_date: Time | nil, + resolution_note: String | nil, + resolution_reason: Lithic::Dispute::ResolutionReason | nil, + status: Lithic::Dispute::Status, + transaction_token: String + } + end + end + + def test_retrieve + response = @lithic.disputes.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Dispute + end + + assert_pattern do + response => { + token: String, + amount: Integer, + arbitration_date: Time | nil, + created: Time, + customer_filed_date: Time | nil, + customer_note: String | nil, + network_claim_ids: ^(Lithic::Internal::Type::ArrayOf[String]) | nil, + network_filed_date: Time | nil, + network_reason_code: String | nil, + prearbitration_date: Time | nil, + primary_claim_id: String | nil, + reason: Lithic::Dispute::Reason, + representment_date: Time | nil, + resolution_date: Time | nil, + resolution_note: String | nil, + resolution_reason: Lithic::Dispute::ResolutionReason | nil, + status: Lithic::Dispute::Status, + transaction_token: String + } + end + end + + def test_update + response = @lithic.disputes.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Dispute + end + + assert_pattern do + response => { + token: String, + amount: Integer, + arbitration_date: Time | nil, + created: Time, + customer_filed_date: Time | nil, + customer_note: String | nil, + network_claim_ids: ^(Lithic::Internal::Type::ArrayOf[String]) | nil, + network_filed_date: Time | nil, + network_reason_code: String | nil, + prearbitration_date: Time | nil, + primary_claim_id: String | nil, + reason: Lithic::Dispute::Reason, + representment_date: Time | nil, + resolution_date: Time | nil, + resolution_note: String | nil, + resolution_reason: Lithic::Dispute::ResolutionReason | nil, + status: Lithic::Dispute::Status, + transaction_token: String + } + end + end + + def test_list + response = @lithic.disputes.list + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Dispute + end + + assert_pattern do + row => { + token: String, + amount: Integer, + arbitration_date: Time | nil, + created: Time, + customer_filed_date: Time | nil, + customer_note: String | nil, + network_claim_ids: ^(Lithic::Internal::Type::ArrayOf[String]) | nil, + network_filed_date: Time | nil, + network_reason_code: String | nil, + prearbitration_date: Time | nil, + primary_claim_id: String | nil, + reason: Lithic::Dispute::Reason, + representment_date: Time | nil, + resolution_date: Time | nil, + resolution_note: String | nil, + resolution_reason: Lithic::Dispute::ResolutionReason | nil, + status: Lithic::Dispute::Status, + transaction_token: String + } + end + end + + def test_delete + response = @lithic.disputes.delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Dispute + end + + assert_pattern do + response => { + token: String, + amount: Integer, + arbitration_date: Time | nil, + created: Time, + customer_filed_date: Time | nil, + customer_note: String | nil, + network_claim_ids: ^(Lithic::Internal::Type::ArrayOf[String]) | nil, + network_filed_date: Time | nil, + network_reason_code: String | nil, + prearbitration_date: Time | nil, + primary_claim_id: String | nil, + reason: Lithic::Dispute::Reason, + representment_date: Time | nil, + resolution_date: Time | nil, + resolution_note: String | nil, + resolution_reason: Lithic::Dispute::ResolutionReason | nil, + status: Lithic::Dispute::Status, + transaction_token: String + } + end + end + + def test_delete_evidence_required_params + response = + @lithic.disputes.delete_evidence( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + dispute_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => Lithic::DisputeEvidence + end + + assert_pattern do + response => { + token: String, + created: Time, + dispute_token: String, + upload_status: Lithic::DisputeEvidence::UploadStatus, + download_url: String | nil, + filename: String | nil, + upload_url: String | nil + } + end + end + + def test_initiate_evidence_upload + response = @lithic.disputes.initiate_evidence_upload("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::DisputeEvidence + end + + assert_pattern do + response => { + token: String, + created: Time, + dispute_token: String, + upload_status: Lithic::DisputeEvidence::UploadStatus, + download_url: String | nil, + filename: String | nil, + upload_url: String | nil + } + end + end + + def test_list_evidences + response = @lithic.disputes.list_evidences("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::DisputeEvidence + end + + assert_pattern do + row => { + token: String, + created: Time, + dispute_token: String, + upload_status: Lithic::DisputeEvidence::UploadStatus, + download_url: String | nil, + filename: String | nil, + upload_url: String | nil + } + end + end + + def test_retrieve_evidence_required_params + response = + @lithic.disputes.retrieve_evidence( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + dispute_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => Lithic::DisputeEvidence + end + + assert_pattern do + response => { + token: String, + created: Time, + dispute_token: String, + upload_status: Lithic::DisputeEvidence::UploadStatus, + download_url: String | nil, + filename: String | nil, + upload_url: String | nil + } + end + end +end diff --git a/test/lithic/resources/disputes_v2_test.rb b/test/lithic/resources/disputes_v2_test.rb new file mode 100644 index 00000000..5a795435 --- /dev/null +++ b/test/lithic/resources/disputes_v2_test.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::DisputesV2Test < Lithic::Test::ResourceTest + def test_retrieve + response = @lithic.disputes_v2.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::DisputeV2 + end + + assert_pattern do + response => { + token: String, + account_token: String, + card_token: String, + case_id: String | nil, + created: Time, + currency: String, + disposition: Lithic::DisputeV2::Disposition | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::DisputeV2::Event]), + liability_allocation: Lithic::DisputeV2::LiabilityAllocation, + merchant: Lithic::Merchant, + network: Lithic::DisputeV2::Network, + status: Lithic::DisputeV2::Status | nil, + transaction_series: Lithic::DisputeV2::TransactionSeries | nil, + updated: Time + } + end + end + + def test_list + response = @lithic.disputes_v2.list + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::DisputeV2 + end + + assert_pattern do + row => { + token: String, + account_token: String, + card_token: String, + case_id: String | nil, + created: Time, + currency: String, + disposition: Lithic::DisputeV2::Disposition | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::DisputeV2::Event]), + liability_allocation: Lithic::DisputeV2::LiabilityAllocation, + merchant: Lithic::Merchant, + network: Lithic::DisputeV2::Network, + status: Lithic::DisputeV2::Status | nil, + transaction_series: Lithic::DisputeV2::TransactionSeries | nil, + updated: Time + } + end + end +end diff --git a/test/lithic/resources/events/event_subscriptions_test.rb b/test/lithic/resources/events/event_subscriptions_test.rb new file mode 100644 index 00000000..058f6136 --- /dev/null +++ b/test/lithic/resources/events/event_subscriptions_test.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::Events::EventSubscriptionsTest < Lithic::Test::ResourceTest + def test_resend_required_params + response = + @lithic.events.event_subscriptions.resend("event_subscription_token", event_token: "event_token") + + assert_pattern do + response => nil + end + end +end diff --git a/test/lithic/resources/events/subscriptions_test.rb b/test/lithic/resources/events/subscriptions_test.rb new file mode 100644 index 00000000..51eea81e --- /dev/null +++ b/test/lithic/resources/events/subscriptions_test.rb @@ -0,0 +1,174 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::Events::SubscriptionsTest < Lithic::Test::ResourceTest + def test_create_required_params + response = @lithic.events.subscriptions.create(url: "https://example.com") + + assert_pattern do + response => Lithic::EventSubscription + end + + assert_pattern do + response => { + token: String, + description: String, + disabled: Lithic::Internal::Type::Boolean, + url: String, + event_types: ^(Lithic::Internal::Type::ArrayOf[enum: Lithic::EventSubscription::EventType]) | nil + } + end + end + + def test_retrieve + response = @lithic.events.subscriptions.retrieve("event_subscription_token") + + assert_pattern do + response => Lithic::EventSubscription + end + + assert_pattern do + response => { + token: String, + description: String, + disabled: Lithic::Internal::Type::Boolean, + url: String, + event_types: ^(Lithic::Internal::Type::ArrayOf[enum: Lithic::EventSubscription::EventType]) | nil + } + end + end + + def test_update_required_params + response = @lithic.events.subscriptions.update("event_subscription_token", url: "https://example.com") + + assert_pattern do + response => Lithic::EventSubscription + end + + assert_pattern do + response => { + token: String, + description: String, + disabled: Lithic::Internal::Type::Boolean, + url: String, + event_types: ^(Lithic::Internal::Type::ArrayOf[enum: Lithic::EventSubscription::EventType]) | nil + } + end + end + + def test_list + response = @lithic.events.subscriptions.list + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::EventSubscription + end + + assert_pattern do + row => { + token: String, + description: String, + disabled: Lithic::Internal::Type::Boolean, + url: String, + event_types: ^(Lithic::Internal::Type::ArrayOf[enum: Lithic::EventSubscription::EventType]) | nil + } + end + end + + def test_delete + skip("Prism Mock server doesn't want Accept header, but server requires it.") + + response = @lithic.events.subscriptions.delete("event_subscription_token") + + assert_pattern do + response => nil + end + end + + def test_list_attempts + response = @lithic.events.subscriptions.list_attempts("event_subscription_token") + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::MessageAttempt + end + + assert_pattern do + row => { + token: String, + created: Time, + event_subscription_token: String, + event_token: String, + response: String, + response_status_code: Integer, + status: Lithic::MessageAttempt::Status, + url: String + } + end + end + + def test_recover + skip("Prism Mock server doesn't want Accept header, but server requires it.") + + response = @lithic.events.subscriptions.recover("event_subscription_token") + + assert_pattern do + response => nil + end + end + + def test_replay_missing + skip("Prism Mock server doesn't want Accept header, but server requires it.") + + response = @lithic.events.subscriptions.replay_missing("event_subscription_token") + + assert_pattern do + response => nil + end + end + + def test_retrieve_secret + response = @lithic.events.subscriptions.retrieve_secret("event_subscription_token") + + assert_pattern do + response => Lithic::Models::Events::SubscriptionRetrieveSecretResponse + end + + assert_pattern do + response => { + secret: String | nil + } + end + end + + def test_rotate_secret + skip("Prism Mock server doesn't want Accept header, but server requires it.") + + response = @lithic.events.subscriptions.rotate_secret("event_subscription_token") + + assert_pattern do + response => nil + end + end + + def test_send_simulated_example + response = @lithic.events.subscriptions.send_simulated_example("event_subscription_token") + + assert_pattern do + response => nil + end + end +end diff --git a/test/lithic/resources/events_test.rb b/test/lithic/resources/events_test.rb new file mode 100644 index 00000000..ba949677 --- /dev/null +++ b/test/lithic/resources/events_test.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::EventsTest < Lithic::Test::ResourceTest + def test_retrieve + response = @lithic.events.retrieve("event_token") + + assert_pattern do + response => Lithic::Event + end + + assert_pattern do + response => { + token: String, + created: Time, + event_type: Lithic::Event::EventType, + payload: ^(Lithic::Internal::Type::HashOf[Lithic::Internal::Type::Unknown]) + } + end + end + + def test_list + response = @lithic.events.list + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Event + end + + assert_pattern do + row => { + token: String, + created: Time, + event_type: Lithic::Event::EventType, + payload: ^(Lithic::Internal::Type::HashOf[Lithic::Internal::Type::Unknown]) + } + end + end + + def test_list_attempts + response = @lithic.events.list_attempts("event_token") + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::MessageAttempt + end + + assert_pattern do + row => { + token: String, + created: Time, + event_subscription_token: String, + event_token: String, + response: String, + response_status_code: Integer, + status: Lithic::MessageAttempt::Status, + url: String + } + end + end +end diff --git a/test/lithic/resources/external_bank_accounts/micro_deposits_test.rb b/test/lithic/resources/external_bank_accounts/micro_deposits_test.rb new file mode 100644 index 00000000..8af9e9f8 --- /dev/null +++ b/test/lithic/resources/external_bank_accounts/micro_deposits_test.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::ExternalBankAccounts::MicroDepositsTest < Lithic::Test::ResourceTest + def test_create_required_params + response = + @lithic.external_bank_accounts.micro_deposits.create( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + micro_deposits: [0, 0] + ) + + assert_pattern do + response => Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse + end + + assert_pattern do + response => { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::OwnerType, + routing_number: String, + state: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::State, + type: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::Type, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationMethod, + verification_state: Lithic::Models::ExternalBankAccounts::MicroDepositCreateResponse::VerificationState, + account_token: String | nil, + address: Lithic::ExternalBankAccountAddress | nil, + company_id: String | nil, + dob: Date | nil, + doing_business_as: String | nil, + financial_account_token: String | nil, + name: String | nil, + user_defined_id: String | nil, + verification_failed_reason: String | nil + } + end + end +end diff --git a/test/lithic/resources/external_bank_accounts_test.rb b/test/lithic/resources/external_bank_accounts_test.rb new file mode 100644 index 00000000..c5e3a5d7 --- /dev/null +++ b/test/lithic/resources/external_bank_accounts_test.rb @@ -0,0 +1,344 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::ExternalBankAccountsTest < Lithic::Test::ResourceTest + def test_create_required_params + response = + @lithic.external_bank_accounts.create( + body: { + account_number: "13719713158835300", + country: "USA", + currency: "USD", + financial_account_token: "dabadb3b-700c-41e3-8801-d5dfc84ebea0", + owner: "John Doe", + owner_type: :BUSINESS, + routing_number: "011103093", + type: :CHECKING, + verification_method: :MICRO_DEPOSIT + } + ) + + assert_pattern do + response => Lithic::Models::ExternalBankAccountCreateResponse + end + + assert_pattern do + response => { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountCreateResponse::OwnerType, + routing_number: String, + state: Lithic::Models::ExternalBankAccountCreateResponse::State, + type: Lithic::Models::ExternalBankAccountCreateResponse::Type, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountCreateResponse::VerificationMethod, + verification_state: Lithic::Models::ExternalBankAccountCreateResponse::VerificationState, + account_token: String | nil, + address: Lithic::ExternalBankAccountAddress | nil, + company_id: String | nil, + dob: Date | nil, + doing_business_as: String | nil, + financial_account_token: String | nil, + name: String | nil, + user_defined_id: String | nil, + verification_failed_reason: String | nil + } + end + end + + def test_retrieve + response = @lithic.external_bank_accounts.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::ExternalBankAccountRetrieveResponse + end + + assert_pattern do + response => { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountRetrieveResponse::OwnerType, + routing_number: String, + state: Lithic::Models::ExternalBankAccountRetrieveResponse::State, + type: Lithic::Models::ExternalBankAccountRetrieveResponse::Type, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationMethod, + verification_state: Lithic::Models::ExternalBankAccountRetrieveResponse::VerificationState, + account_token: String | nil, + address: Lithic::ExternalBankAccountAddress | nil, + company_id: String | nil, + dob: Date | nil, + doing_business_as: String | nil, + financial_account_token: String | nil, + name: String | nil, + user_defined_id: String | nil, + verification_failed_reason: String | nil + } + end + end + + def test_update + response = @lithic.external_bank_accounts.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::ExternalBankAccountUpdateResponse + end + + assert_pattern do + response => { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountUpdateResponse::OwnerType, + routing_number: String, + state: Lithic::Models::ExternalBankAccountUpdateResponse::State, + type: Lithic::Models::ExternalBankAccountUpdateResponse::Type, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountUpdateResponse::VerificationMethod, + verification_state: Lithic::Models::ExternalBankAccountUpdateResponse::VerificationState, + account_token: String | nil, + address: Lithic::ExternalBankAccountAddress | nil, + company_id: String | nil, + dob: Date | nil, + doing_business_as: String | nil, + financial_account_token: String | nil, + name: String | nil, + user_defined_id: String | nil, + verification_failed_reason: String | nil + } + end + end + + def test_list + response = @lithic.external_bank_accounts.list + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Models::ExternalBankAccountListResponse + end + + assert_pattern do + row => { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountListResponse::OwnerType, + routing_number: String, + state: Lithic::Models::ExternalBankAccountListResponse::State, + type: Lithic::Models::ExternalBankAccountListResponse::Type, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountListResponse::VerificationMethod, + verification_state: Lithic::Models::ExternalBankAccountListResponse::VerificationState, + account_token: String | nil, + address: Lithic::ExternalBankAccountAddress | nil, + company_id: String | nil, + dob: Date | nil, + doing_business_as: String | nil, + financial_account_token: String | nil, + name: String | nil, + user_defined_id: String | nil, + verification_failed_reason: String | nil + } + end + end + + def test_pause + response = @lithic.external_bank_accounts.pause("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::ExternalBankAccount + end + + assert_pattern do + response => { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::OwnerType, + routing_number: String, + state: Lithic::ExternalBankAccount::State, + type: Lithic::ExternalBankAccount::Type, + verification_attempts: Integer, + verification_method: Lithic::VerificationMethod, + verification_state: Lithic::ExternalBankAccount::VerificationState, + account_token: String | nil, + address: Lithic::ExternalBankAccountAddress | nil, + company_id: String | nil, + dob: Date | nil, + doing_business_as: String | nil, + financial_account_token: String | nil, + name: String | nil, + user_defined_id: String | nil, + verification_failed_reason: String | nil + } + end + end + + def test_retry_micro_deposits + response = @lithic.external_bank_accounts.retry_micro_deposits("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse + end + + assert_pattern do + response => { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::OwnerType, + routing_number: String, + state: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::State, + type: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::Type, + verification_attempts: Integer, + verification_method: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationMethod, + verification_state: Lithic::Models::ExternalBankAccountRetryMicroDepositsResponse::VerificationState, + account_token: String | nil, + address: Lithic::ExternalBankAccountAddress | nil, + company_id: String | nil, + dob: Date | nil, + doing_business_as: String | nil, + financial_account_token: String | nil, + name: String | nil, + user_defined_id: String | nil, + verification_failed_reason: String | nil + } + end + end + + def test_retry_prenote + response = @lithic.external_bank_accounts.retry_prenote("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::ExternalBankAccount + end + + assert_pattern do + response => { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::OwnerType, + routing_number: String, + state: Lithic::ExternalBankAccount::State, + type: Lithic::ExternalBankAccount::Type, + verification_attempts: Integer, + verification_method: Lithic::VerificationMethod, + verification_state: Lithic::ExternalBankAccount::VerificationState, + account_token: String | nil, + address: Lithic::ExternalBankAccountAddress | nil, + company_id: String | nil, + dob: Date | nil, + doing_business_as: String | nil, + financial_account_token: String | nil, + name: String | nil, + user_defined_id: String | nil, + verification_failed_reason: String | nil + } + end + end + + def test_set_verification_method_required_params + response = + @lithic.external_bank_accounts.set_verification_method( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + verification_method: :MICRO_DEPOSIT + ) + + assert_pattern do + response => Lithic::ExternalBankAccount + end + + assert_pattern do + response => { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::OwnerType, + routing_number: String, + state: Lithic::ExternalBankAccount::State, + type: Lithic::ExternalBankAccount::Type, + verification_attempts: Integer, + verification_method: Lithic::VerificationMethod, + verification_state: Lithic::ExternalBankAccount::VerificationState, + account_token: String | nil, + address: Lithic::ExternalBankAccountAddress | nil, + company_id: String | nil, + dob: Date | nil, + doing_business_as: String | nil, + financial_account_token: String | nil, + name: String | nil, + user_defined_id: String | nil, + verification_failed_reason: String | nil + } + end + end + + def test_unpause + response = @lithic.external_bank_accounts.unpause("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::ExternalBankAccount + end + + assert_pattern do + response => { + token: String, + country: String, + created: Time, + currency: String, + last_four: String, + owner: String, + owner_type: Lithic::OwnerType, + routing_number: String, + state: Lithic::ExternalBankAccount::State, + type: Lithic::ExternalBankAccount::Type, + verification_attempts: Integer, + verification_method: Lithic::VerificationMethod, + verification_state: Lithic::ExternalBankAccount::VerificationState, + account_token: String | nil, + address: Lithic::ExternalBankAccountAddress | nil, + company_id: String | nil, + dob: Date | nil, + doing_business_as: String | nil, + financial_account_token: String | nil, + name: String | nil, + user_defined_id: String | nil, + verification_failed_reason: String | nil + } + end + end +end diff --git a/test/lithic/resources/external_payments_test.rb b/test/lithic/resources/external_payments_test.rb new file mode 100644 index 00000000..62b340d2 --- /dev/null +++ b/test/lithic/resources/external_payments_test.rb @@ -0,0 +1,212 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::ExternalPaymentsTest < Lithic::Test::ResourceTest + def test_create_required_params + response = + @lithic.external_payments.create( + amount: 0, + category: :EXTERNAL_WIRE, + effective_date: "2019-12-27", + financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + payment_type: :DEPOSIT + ) + + assert_pattern do + response => Lithic::ExternalPayment + end + + assert_pattern do + response => { + token: String, + created: Time, + status: Lithic::ExternalPayment::Status, + updated: Time, + category: Lithic::ExternalPayment::Category | nil, + currency: String | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::ExternalPayment::Event]) | nil, + family: Lithic::ExternalPayment::Family | nil, + financial_account_token: String | nil, + payment_type: Lithic::ExternalPayment::PaymentType | nil, + pending_amount: Integer | nil, + result: Lithic::ExternalPayment::Result | nil, + settled_amount: Integer | nil, + user_defined_id: String | nil + } + end + end + + def test_retrieve + response = @lithic.external_payments.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::ExternalPayment + end + + assert_pattern do + response => { + token: String, + created: Time, + status: Lithic::ExternalPayment::Status, + updated: Time, + category: Lithic::ExternalPayment::Category | nil, + currency: String | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::ExternalPayment::Event]) | nil, + family: Lithic::ExternalPayment::Family | nil, + financial_account_token: String | nil, + payment_type: Lithic::ExternalPayment::PaymentType | nil, + pending_amount: Integer | nil, + result: Lithic::ExternalPayment::Result | nil, + settled_amount: Integer | nil, + user_defined_id: String | nil + } + end + end + + def test_list + response = @lithic.external_payments.list + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::ExternalPayment + end + + assert_pattern do + row => { + token: String, + created: Time, + status: Lithic::ExternalPayment::Status, + updated: Time, + category: Lithic::ExternalPayment::Category | nil, + currency: String | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::ExternalPayment::Event]) | nil, + family: Lithic::ExternalPayment::Family | nil, + financial_account_token: String | nil, + payment_type: Lithic::ExternalPayment::PaymentType | nil, + pending_amount: Integer | nil, + result: Lithic::ExternalPayment::Result | nil, + settled_amount: Integer | nil, + user_defined_id: String | nil + } + end + end + + def test_cancel_required_params + response = + @lithic.external_payments.cancel("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", effective_date: "2019-12-27") + + assert_pattern do + response => Lithic::ExternalPayment + end + + assert_pattern do + response => { + token: String, + created: Time, + status: Lithic::ExternalPayment::Status, + updated: Time, + category: Lithic::ExternalPayment::Category | nil, + currency: String | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::ExternalPayment::Event]) | nil, + family: Lithic::ExternalPayment::Family | nil, + financial_account_token: String | nil, + payment_type: Lithic::ExternalPayment::PaymentType | nil, + pending_amount: Integer | nil, + result: Lithic::ExternalPayment::Result | nil, + settled_amount: Integer | nil, + user_defined_id: String | nil + } + end + end + + def test_release_required_params + response = + @lithic.external_payments.release("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", effective_date: "2019-12-27") + + assert_pattern do + response => Lithic::ExternalPayment + end + + assert_pattern do + response => { + token: String, + created: Time, + status: Lithic::ExternalPayment::Status, + updated: Time, + category: Lithic::ExternalPayment::Category | nil, + currency: String | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::ExternalPayment::Event]) | nil, + family: Lithic::ExternalPayment::Family | nil, + financial_account_token: String | nil, + payment_type: Lithic::ExternalPayment::PaymentType | nil, + pending_amount: Integer | nil, + result: Lithic::ExternalPayment::Result | nil, + settled_amount: Integer | nil, + user_defined_id: String | nil + } + end + end + + def test_reverse_required_params + response = + @lithic.external_payments.reverse("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", effective_date: "2019-12-27") + + assert_pattern do + response => Lithic::ExternalPayment + end + + assert_pattern do + response => { + token: String, + created: Time, + status: Lithic::ExternalPayment::Status, + updated: Time, + category: Lithic::ExternalPayment::Category | nil, + currency: String | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::ExternalPayment::Event]) | nil, + family: Lithic::ExternalPayment::Family | nil, + financial_account_token: String | nil, + payment_type: Lithic::ExternalPayment::PaymentType | nil, + pending_amount: Integer | nil, + result: Lithic::ExternalPayment::Result | nil, + settled_amount: Integer | nil, + user_defined_id: String | nil + } + end + end + + def test_settle_required_params + response = + @lithic.external_payments.settle("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", effective_date: "2019-12-27") + + assert_pattern do + response => Lithic::ExternalPayment + end + + assert_pattern do + response => { + token: String, + created: Time, + status: Lithic::ExternalPayment::Status, + updated: Time, + category: Lithic::ExternalPayment::Category | nil, + currency: String | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::ExternalPayment::Event]) | nil, + family: Lithic::ExternalPayment::Family | nil, + financial_account_token: String | nil, + payment_type: Lithic::ExternalPayment::PaymentType | nil, + pending_amount: Integer | nil, + result: Lithic::ExternalPayment::Result | nil, + settled_amount: Integer | nil, + user_defined_id: String | nil + } + end + end +end diff --git a/test/lithic/resources/financial_accounts/balances_test.rb b/test/lithic/resources/financial_accounts/balances_test.rb new file mode 100644 index 00000000..20de9af7 --- /dev/null +++ b/test/lithic/resources/financial_accounts/balances_test.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::FinancialAccounts::BalancesTest < Lithic::Test::ResourceTest + def test_list + response = @lithic.financial_accounts.balances.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Internal::SinglePage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::FinancialAccountBalance + end + + assert_pattern do + row => { + token: String, + available_amount: Integer, + created: Time, + currency: String, + last_transaction_event_token: String, + last_transaction_token: String, + pending_amount: Integer, + total_amount: Integer, + type: Lithic::FinancialAccountBalance::Type, + updated: Time + } + end + end +end diff --git a/test/lithic/resources/financial_accounts/credit_configuration_test.rb b/test/lithic/resources/financial_accounts/credit_configuration_test.rb new file mode 100644 index 00000000..6146bb0d --- /dev/null +++ b/test/lithic/resources/financial_accounts/credit_configuration_test.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::FinancialAccounts::CreditConfigurationTest < Lithic::Test::ResourceTest + def test_retrieve + response = + @lithic.financial_accounts.credit_configuration.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::FinancialAccounts::FinancialAccountCreditConfig + end + + assert_pattern do + response => { + account_token: String, + auto_collection_configuration: Lithic::FinancialAccounts::FinancialAccountCreditConfig::AutoCollectionConfiguration, + credit_limit: Integer | nil, + credit_product_token: String | nil, + external_bank_account_token: String | nil, + tier: String | nil + } + end + end + + def test_update + response = @lithic.financial_accounts.credit_configuration.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::FinancialAccounts::FinancialAccountCreditConfig + end + + assert_pattern do + response => { + account_token: String, + auto_collection_configuration: Lithic::FinancialAccounts::FinancialAccountCreditConfig::AutoCollectionConfiguration, + credit_limit: Integer | nil, + credit_product_token: String | nil, + external_bank_account_token: String | nil, + tier: String | nil + } + end + end +end diff --git a/test/lithic/resources/financial_accounts/financial_transactions_test.rb b/test/lithic/resources/financial_accounts/financial_transactions_test.rb new file mode 100644 index 00000000..b68b2153 --- /dev/null +++ b/test/lithic/resources/financial_accounts/financial_transactions_test.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::FinancialAccounts::FinancialTransactionsTest < Lithic::Test::ResourceTest + def test_retrieve_required_params + response = + @lithic.financial_accounts.financial_transactions.retrieve( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => Lithic::FinancialTransaction + end + + assert_pattern do + response => { + token: String, + category: Lithic::FinancialTransaction::Category, + created: Time, + currency: String, + descriptor: String, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::FinancialEvent]), + pending_amount: Integer, + result: Lithic::FinancialTransaction::Result, + settled_amount: Integer, + status: Lithic::FinancialTransaction::Status, + updated: Time + } + end + end + + def test_list + response = @lithic.financial_accounts.financial_transactions.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Internal::SinglePage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::FinancialTransaction + end + + assert_pattern do + row => { + token: String, + category: Lithic::FinancialTransaction::Category, + created: Time, + currency: String, + descriptor: String, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::FinancialEvent]), + pending_amount: Integer, + result: Lithic::FinancialTransaction::Result, + settled_amount: Integer, + status: Lithic::FinancialTransaction::Status, + updated: Time + } + end + end +end diff --git a/test/lithic/resources/financial_accounts/interest_tier_schedule_test.rb b/test/lithic/resources/financial_accounts/interest_tier_schedule_test.rb new file mode 100644 index 00000000..c38a284c --- /dev/null +++ b/test/lithic/resources/financial_accounts/interest_tier_schedule_test.rb @@ -0,0 +1,109 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::FinancialAccounts::InterestTierScheduleTest < Lithic::Test::ResourceTest + def test_create_required_params + response = + @lithic.financial_accounts.interest_tier_schedule.create( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + credit_product_token: "credit_product_token", + effective_date: "2019-12-27" + ) + + assert_pattern do + response => Lithic::FinancialAccounts::FinancialAccountsInterestTierSchedule + end + + assert_pattern do + response => { + credit_product_token: String, + effective_date: Date, + penalty_rates: Lithic::Internal::Type::Unknown | nil, + tier_name: String | nil, + tier_rates: Lithic::Internal::Type::Unknown | nil + } + end + end + + def test_retrieve_required_params + response = + @lithic.financial_accounts.interest_tier_schedule.retrieve( + "2019-12-27", + financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => Lithic::FinancialAccounts::FinancialAccountsInterestTierSchedule + end + + assert_pattern do + response => { + credit_product_token: String, + effective_date: Date, + penalty_rates: Lithic::Internal::Type::Unknown | nil, + tier_name: String | nil, + tier_rates: Lithic::Internal::Type::Unknown | nil + } + end + end + + def test_update_required_params + response = + @lithic.financial_accounts.interest_tier_schedule.update( + "2019-12-27", + financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => Lithic::FinancialAccounts::FinancialAccountsInterestTierSchedule + end + + assert_pattern do + response => { + credit_product_token: String, + effective_date: Date, + penalty_rates: Lithic::Internal::Type::Unknown | nil, + tier_name: String | nil, + tier_rates: Lithic::Internal::Type::Unknown | nil + } + end + end + + def test_list + response = @lithic.financial_accounts.interest_tier_schedule.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Internal::SinglePage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::FinancialAccounts::FinancialAccountsInterestTierSchedule + end + + assert_pattern do + row => { + credit_product_token: String, + effective_date: Date, + penalty_rates: Lithic::Internal::Type::Unknown | nil, + tier_name: String | nil, + tier_rates: Lithic::Internal::Type::Unknown | nil + } + end + end + + def test_delete_required_params + response = + @lithic.financial_accounts.interest_tier_schedule.delete( + "2019-12-27", + financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => nil + end + end +end diff --git a/test/lithic/resources/financial_accounts/loan_tape_configuration_test.rb b/test/lithic/resources/financial_accounts/loan_tape_configuration_test.rb new file mode 100644 index 00000000..9e82dbed --- /dev/null +++ b/test/lithic/resources/financial_accounts/loan_tape_configuration_test.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::FinancialAccounts::LoanTapeConfigurationTest < Lithic::Test::ResourceTest + def test_retrieve + response = + @lithic.financial_accounts.loan_tape_configuration.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::FinancialAccounts::FinancialAccountsLoanTapeConfiguration + end + + assert_pattern do + response => { + created_at: Time, + financial_account_token: String, + instance_token: String, + updated_at: Time, + credit_product_token: String | nil, + loan_tape_rebuild_configuration: Lithic::FinancialAccounts::LoanTapeRebuildConfiguration | nil, + tier_schedule_changed_at: Time | nil + } + end + end +end diff --git a/test/lithic/resources/financial_accounts/loan_tapes_test.rb b/test/lithic/resources/financial_accounts/loan_tapes_test.rb new file mode 100644 index 00000000..837a0129 --- /dev/null +++ b/test/lithic/resources/financial_accounts/loan_tapes_test.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::FinancialAccounts::LoanTapesTest < Lithic::Test::ResourceTest + def test_retrieve_required_params + response = + @lithic.financial_accounts.loan_tapes.retrieve( + "loan_tape_token", + financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => Lithic::FinancialAccounts::LoanTape + end + + assert_pattern do + response => { + token: String, + account_standing: Lithic::FinancialAccounts::LoanTape::AccountStanding, + available_credit: Integer, + balances: Lithic::FinancialAccounts::LoanTape::Balances, + created: Time, + credit_limit: Integer, + credit_product_token: String, + date: Date, + day_totals: Lithic::StatementTotals, + ending_balance: Integer, + excess_credits: Integer, + financial_account_token: String, + interest_details: Lithic::FinancialAccounts::LoanTape::InterestDetails | nil, + minimum_payment_balance: Lithic::FinancialAccounts::LoanTape::MinimumPaymentBalance, + payment_allocation: Lithic::FinancialAccounts::LoanTape::PaymentAllocation, + period_totals: Lithic::StatementTotals, + previous_statement_balance: Lithic::FinancialAccounts::LoanTape::PreviousStatementBalance, + starting_balance: Integer, + updated: Time, + version: Integer, + ytd_totals: Lithic::StatementTotals, + day_of_period: Integer | nil, + tier: String | nil + } + end + end + + def test_list + response = @lithic.financial_accounts.loan_tapes.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::FinancialAccounts::LoanTape + end + + assert_pattern do + row => { + token: String, + account_standing: Lithic::FinancialAccounts::LoanTape::AccountStanding, + available_credit: Integer, + balances: Lithic::FinancialAccounts::LoanTape::Balances, + created: Time, + credit_limit: Integer, + credit_product_token: String, + date: Date, + day_totals: Lithic::StatementTotals, + ending_balance: Integer, + excess_credits: Integer, + financial_account_token: String, + interest_details: Lithic::FinancialAccounts::LoanTape::InterestDetails | nil, + minimum_payment_balance: Lithic::FinancialAccounts::LoanTape::MinimumPaymentBalance, + payment_allocation: Lithic::FinancialAccounts::LoanTape::PaymentAllocation, + period_totals: Lithic::StatementTotals, + previous_statement_balance: Lithic::FinancialAccounts::LoanTape::PreviousStatementBalance, + starting_balance: Integer, + updated: Time, + version: Integer, + ytd_totals: Lithic::StatementTotals, + day_of_period: Integer | nil, + tier: String | nil + } + end + end +end diff --git a/test/lithic/resources/financial_accounts/statements/line_items_test.rb b/test/lithic/resources/financial_accounts/statements/line_items_test.rb new file mode 100644 index 00000000..5a74a210 --- /dev/null +++ b/test/lithic/resources/financial_accounts/statements/line_items_test.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +require_relative "../../../test_helper" + +class Lithic::Test::Resources::FinancialAccounts::Statements::LineItemsTest < Lithic::Test::ResourceTest + def test_list_required_params + response = + @lithic.financial_accounts.statements.line_items.list( + "statement_token", + financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::FinancialAccounts::Statements::StatementLineItems::Data + end + + assert_pattern do + row => { + token: String, + amount: Integer, + category: Lithic::FinancialAccounts::Statements::StatementLineItems::Data::Category, + created: Time, + currency: String, + effective_date: Date, + event_type: Lithic::FinancialAccounts::Statements::StatementLineItems::Data::EventType, + financial_account_token: String, + financial_transaction_event_token: String, + financial_transaction_token: String, + card_token: String | nil, + descriptor: String | nil, + event_subtype: String | nil, + loan_tape_date: Date | nil + } + end + end +end diff --git a/test/lithic/resources/financial_accounts/statements_test.rb b/test/lithic/resources/financial_accounts/statements_test.rb new file mode 100644 index 00000000..10156420 --- /dev/null +++ b/test/lithic/resources/financial_accounts/statements_test.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::FinancialAccounts::StatementsTest < Lithic::Test::ResourceTest + def test_retrieve_required_params + response = + @lithic.financial_accounts.statements.retrieve( + "statement_token", + financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => Lithic::FinancialAccounts::Statement + end + + assert_pattern do + response => { + token: String, + account_standing: Lithic::FinancialAccounts::Statement::AccountStanding, + amount_due: Lithic::FinancialAccounts::Statement::AmountDue, + available_credit: Integer, + created: Time, + credit_limit: Integer, + credit_product_token: String | nil, + days_in_billing_cycle: Integer, + ending_balance: Integer, + financial_account_token: String, + payment_due_date: Date | nil, + period_totals: Lithic::StatementTotals, + starting_balance: Integer, + statement_end_date: Date, + statement_start_date: Date, + statement_type: Lithic::FinancialAccounts::Statement::StatementType, + updated: Time, + ytd_totals: Lithic::StatementTotals, + interest_details: Lithic::FinancialAccounts::Statement::InterestDetails | nil, + next_payment_due_date: Date | nil, + next_statement_end_date: Date | nil, + payoff_details: Lithic::FinancialAccounts::Statement::PayoffDetails | nil, + statement_totals: Lithic::StatementTotals | nil + } + end + end + + def test_list + response = @lithic.financial_accounts.statements.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::FinancialAccounts::Statement + end + + assert_pattern do + row => { + token: String, + account_standing: Lithic::FinancialAccounts::Statement::AccountStanding, + amount_due: Lithic::FinancialAccounts::Statement::AmountDue, + available_credit: Integer, + created: Time, + credit_limit: Integer, + credit_product_token: String | nil, + days_in_billing_cycle: Integer, + ending_balance: Integer, + financial_account_token: String, + payment_due_date: Date | nil, + period_totals: Lithic::StatementTotals, + starting_balance: Integer, + statement_end_date: Date, + statement_start_date: Date, + statement_type: Lithic::FinancialAccounts::Statement::StatementType, + updated: Time, + ytd_totals: Lithic::StatementTotals, + interest_details: Lithic::FinancialAccounts::Statement::InterestDetails | nil, + next_payment_due_date: Date | nil, + next_statement_end_date: Date | nil, + payoff_details: Lithic::FinancialAccounts::Statement::PayoffDetails | nil, + statement_totals: Lithic::StatementTotals | nil + } + end + end +end diff --git a/test/lithic/resources/financial_accounts_test.rb b/test/lithic/resources/financial_accounts_test.rb new file mode 100644 index 00000000..862cf2e7 --- /dev/null +++ b/test/lithic/resources/financial_accounts_test.rb @@ -0,0 +1,159 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::FinancialAccountsTest < Lithic::Test::ResourceTest + def test_create_required_params + response = @lithic.financial_accounts.create(nickname: "nickname", type: :OPERATING) + + assert_pattern do + response => Lithic::FinancialAccount + end + + assert_pattern do + response => { + token: String, + account_token: String | nil, + created: Time, + credit_configuration: Lithic::FinancialAccount::CreditConfiguration | nil, + is_for_benefit_of: Lithic::Internal::Type::Boolean, + nickname: String | nil, + status: Lithic::FinancialAccount::Status, + substatus: Lithic::FinancialAccount::Substatus | nil, + type: Lithic::FinancialAccount::Type, + updated: Time, + user_defined_status: String | nil, + account_number: String | nil, + routing_number: String | nil + } + end + end + + def test_retrieve + response = @lithic.financial_accounts.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::FinancialAccount + end + + assert_pattern do + response => { + token: String, + account_token: String | nil, + created: Time, + credit_configuration: Lithic::FinancialAccount::CreditConfiguration | nil, + is_for_benefit_of: Lithic::Internal::Type::Boolean, + nickname: String | nil, + status: Lithic::FinancialAccount::Status, + substatus: Lithic::FinancialAccount::Substatus | nil, + type: Lithic::FinancialAccount::Type, + updated: Time, + user_defined_status: String | nil, + account_number: String | nil, + routing_number: String | nil + } + end + end + + def test_update + response = @lithic.financial_accounts.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::FinancialAccount + end + + assert_pattern do + response => { + token: String, + account_token: String | nil, + created: Time, + credit_configuration: Lithic::FinancialAccount::CreditConfiguration | nil, + is_for_benefit_of: Lithic::Internal::Type::Boolean, + nickname: String | nil, + status: Lithic::FinancialAccount::Status, + substatus: Lithic::FinancialAccount::Substatus | nil, + type: Lithic::FinancialAccount::Type, + updated: Time, + user_defined_status: String | nil, + account_number: String | nil, + routing_number: String | nil + } + end + end + + def test_list + response = @lithic.financial_accounts.list + + assert_pattern do + response => Lithic::Internal::SinglePage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::FinancialAccount + end + + assert_pattern do + row => { + token: String, + account_token: String | nil, + created: Time, + credit_configuration: Lithic::FinancialAccount::CreditConfiguration | nil, + is_for_benefit_of: Lithic::Internal::Type::Boolean, + nickname: String | nil, + status: Lithic::FinancialAccount::Status, + substatus: Lithic::FinancialAccount::Substatus | nil, + type: Lithic::FinancialAccount::Type, + updated: Time, + user_defined_status: String | nil, + account_number: String | nil, + routing_number: String | nil + } + end + end + + def test_register_account_number_required_params + response = + @lithic.financial_accounts.register_account_number( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + account_number: "account_number" + ) + + assert_pattern do + response => nil + end + end + + def test_update_status_required_params + response = + @lithic.financial_accounts.update_status( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + status: :CLOSED, + substatus: :END_USER_REQUEST + ) + + assert_pattern do + response => Lithic::FinancialAccount + end + + assert_pattern do + response => { + token: String, + account_token: String | nil, + created: Time, + credit_configuration: Lithic::FinancialAccount::CreditConfiguration | nil, + is_for_benefit_of: Lithic::Internal::Type::Boolean, + nickname: String | nil, + status: Lithic::FinancialAccount::Status, + substatus: Lithic::FinancialAccount::Substatus | nil, + type: Lithic::FinancialAccount::Type, + updated: Time, + user_defined_status: String | nil, + account_number: String | nil, + routing_number: String | nil + } + end + end +end diff --git a/test/lithic/resources/fraud/transactions_test.rb b/test/lithic/resources/fraud/transactions_test.rb new file mode 100644 index 00000000..c27fad97 --- /dev/null +++ b/test/lithic/resources/fraud/transactions_test.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::Fraud::TransactionsTest < Lithic::Test::ResourceTest + def test_retrieve + response = @lithic.fraud.transactions.retrieve("00000000-0000-0000-0000-000000000000") + + assert_pattern do + response => Lithic::Models::Fraud::TransactionRetrieveResponse + end + + assert_pattern do + response => { + fraud_status: Lithic::Models::Fraud::TransactionRetrieveResponse::FraudStatus, + transaction_token: String, + comment: String | nil, + created_at: Time | nil, + fraud_type: Lithic::Models::Fraud::TransactionRetrieveResponse::FraudType | nil, + updated_at: Time | nil + } + end + end + + def test_report_required_params + response = + @lithic.fraud.transactions.report( + "00000000-0000-0000-0000-000000000000", + fraud_status: :SUSPECTED_FRAUD + ) + + assert_pattern do + response => Lithic::Models::Fraud::TransactionReportResponse + end + + assert_pattern do + response => { + fraud_status: Lithic::Models::Fraud::TransactionReportResponse::FraudStatus, + transaction_token: String, + comment: String | nil, + created_at: Time | nil, + fraud_type: Lithic::Models::Fraud::TransactionReportResponse::FraudType | nil, + updated_at: Time | nil + } + end + end +end diff --git a/test/lithic/resources/fraud_test.rb b/test/lithic/resources/fraud_test.rb new file mode 100644 index 00000000..f8c1b764 --- /dev/null +++ b/test/lithic/resources/fraud_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::FraudTest < Lithic::Test::ResourceTest +end diff --git a/test/lithic/resources/funding_events_test.rb b/test/lithic/resources/funding_events_test.rb new file mode 100644 index 00000000..d747a222 --- /dev/null +++ b/test/lithic/resources/funding_events_test.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::FundingEventsTest < Lithic::Test::ResourceTest + def test_retrieve + response = @lithic.funding_events.retrieve("funding_event_token") + + assert_pattern do + response => Lithic::FundingEvent + end + + assert_pattern do + response => { + token: String, + collection_resource_type: Lithic::FundingEvent::CollectionResourceType, + collection_tokens: ^(Lithic::Internal::Type::ArrayOf[String]), + created: Time, + high_watermark: Time, + network_settlement_summary: ^(Lithic::Internal::Type::ArrayOf[Lithic::FundingEvent::NetworkSettlementSummary]), + previous_high_watermark: Time, + updated: Time + } + end + end + + def test_list + response = @lithic.funding_events.list + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::FundingEvent + end + + assert_pattern do + row => { + token: String, + collection_resource_type: Lithic::FundingEvent::CollectionResourceType, + collection_tokens: ^(Lithic::Internal::Type::ArrayOf[String]), + created: Time, + high_watermark: Time, + network_settlement_summary: ^(Lithic::Internal::Type::ArrayOf[Lithic::FundingEvent::NetworkSettlementSummary]), + previous_high_watermark: Time, + updated: Time + } + end + end + + def test_retrieve_details + response = @lithic.funding_events.retrieve_details("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::FundingEventRetrieveDetailsResponse + end + + assert_pattern do + response => { + token: String, + settlement_details_url: String, + settlement_summary_url: String + } + end + end +end diff --git a/test/lithic/resources/holds_test.rb b/test/lithic/resources/holds_test.rb new file mode 100644 index 00000000..eb7932b6 --- /dev/null +++ b/test/lithic/resources/holds_test.rb @@ -0,0 +1,112 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::HoldsTest < Lithic::Test::ResourceTest + def test_create_required_params + response = @lithic.holds.create("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", amount: 1) + + assert_pattern do + response => Lithic::Hold + end + + assert_pattern do + response => { + token: String, + created: Time, + status: Lithic::Hold::Status, + updated: Time, + currency: String | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::HoldEvent]) | nil, + expiration_datetime: Time | nil, + family: Lithic::Hold::Family | nil, + financial_account_token: String | nil, + pending_amount: Integer | nil, + result: Lithic::Hold::Result | nil, + user_defined_id: String | nil + } + end + end + + def test_retrieve + response = @lithic.holds.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Hold + end + + assert_pattern do + response => { + token: String, + created: Time, + status: Lithic::Hold::Status, + updated: Time, + currency: String | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::HoldEvent]) | nil, + expiration_datetime: Time | nil, + family: Lithic::Hold::Family | nil, + financial_account_token: String | nil, + pending_amount: Integer | nil, + result: Lithic::Hold::Result | nil, + user_defined_id: String | nil + } + end + end + + def test_list + response = @lithic.holds.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Hold + end + + assert_pattern do + row => { + token: String, + created: Time, + status: Lithic::Hold::Status, + updated: Time, + currency: String | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::HoldEvent]) | nil, + expiration_datetime: Time | nil, + family: Lithic::Hold::Family | nil, + financial_account_token: String | nil, + pending_amount: Integer | nil, + result: Lithic::Hold::Result | nil, + user_defined_id: String | nil + } + end + end + + def test_void + response = @lithic.holds.void("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Hold + end + + assert_pattern do + response => { + token: String, + created: Time, + status: Lithic::Hold::Status, + updated: Time, + currency: String | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::HoldEvent]) | nil, + expiration_datetime: Time | nil, + family: Lithic::Hold::Family | nil, + financial_account_token: String | nil, + pending_amount: Integer | nil, + result: Lithic::Hold::Result | nil, + user_defined_id: String | nil + } + end + end +end diff --git a/test/lithic/resources/internal_transaction_test.rb b/test/lithic/resources/internal_transaction_test.rb new file mode 100644 index 00000000..3b61c459 --- /dev/null +++ b/test/lithic/resources/internal_transaction_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::InternalTransactionTest < Lithic::Test::ResourceTest +end diff --git a/test/lithic/resources/management_operations_test.rb b/test/lithic/resources/management_operations_test.rb new file mode 100644 index 00000000..e8d58ebf --- /dev/null +++ b/test/lithic/resources/management_operations_test.rb @@ -0,0 +1,140 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::ManagementOperationsTest < Lithic::Test::ResourceTest + def test_create_required_params + response = + @lithic.management_operations.create( + amount: 1, + category: :MANAGEMENT_FEE, + direction: :CREDIT, + effective_date: "2019-12-27", + event_type: :LOSS_WRITE_OFF, + financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => Lithic::ManagementOperationTransaction + end + + assert_pattern do + response => { + token: String, + created: Time, + status: Lithic::ManagementOperationTransaction::Status, + updated: Time, + category: Lithic::ManagementOperationTransaction::Category | nil, + currency: String | nil, + direction: Lithic::ManagementOperationTransaction::Direction | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::ManagementOperationTransaction::Event]) | nil, + external_resource: Lithic::ExternalResource | nil, + family: Lithic::ManagementOperationTransaction::Family | nil, + financial_account_token: String | nil, + pending_amount: Integer | nil, + result: Lithic::ManagementOperationTransaction::Result | nil, + settled_amount: Integer | nil, + transaction_series: Lithic::ManagementOperationTransaction::TransactionSeries | nil, + user_defined_id: String | nil + } + end + end + + def test_retrieve + response = @lithic.management_operations.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::ManagementOperationTransaction + end + + assert_pattern do + response => { + token: String, + created: Time, + status: Lithic::ManagementOperationTransaction::Status, + updated: Time, + category: Lithic::ManagementOperationTransaction::Category | nil, + currency: String | nil, + direction: Lithic::ManagementOperationTransaction::Direction | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::ManagementOperationTransaction::Event]) | nil, + external_resource: Lithic::ExternalResource | nil, + family: Lithic::ManagementOperationTransaction::Family | nil, + financial_account_token: String | nil, + pending_amount: Integer | nil, + result: Lithic::ManagementOperationTransaction::Result | nil, + settled_amount: Integer | nil, + transaction_series: Lithic::ManagementOperationTransaction::TransactionSeries | nil, + user_defined_id: String | nil + } + end + end + + def test_list + response = @lithic.management_operations.list + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::ManagementOperationTransaction + end + + assert_pattern do + row => { + token: String, + created: Time, + status: Lithic::ManagementOperationTransaction::Status, + updated: Time, + category: Lithic::ManagementOperationTransaction::Category | nil, + currency: String | nil, + direction: Lithic::ManagementOperationTransaction::Direction | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::ManagementOperationTransaction::Event]) | nil, + external_resource: Lithic::ExternalResource | nil, + family: Lithic::ManagementOperationTransaction::Family | nil, + financial_account_token: String | nil, + pending_amount: Integer | nil, + result: Lithic::ManagementOperationTransaction::Result | nil, + settled_amount: Integer | nil, + transaction_series: Lithic::ManagementOperationTransaction::TransactionSeries | nil, + user_defined_id: String | nil + } + end + end + + def test_reverse_required_params + response = + @lithic.management_operations.reverse( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + effective_date: "2019-12-27" + ) + + assert_pattern do + response => Lithic::ManagementOperationTransaction + end + + assert_pattern do + response => { + token: String, + created: Time, + status: Lithic::ManagementOperationTransaction::Status, + updated: Time, + category: Lithic::ManagementOperationTransaction::Category | nil, + currency: String | nil, + direction: Lithic::ManagementOperationTransaction::Direction | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::ManagementOperationTransaction::Event]) | nil, + external_resource: Lithic::ExternalResource | nil, + family: Lithic::ManagementOperationTransaction::Family | nil, + financial_account_token: String | nil, + pending_amount: Integer | nil, + result: Lithic::ManagementOperationTransaction::Result | nil, + settled_amount: Integer | nil, + transaction_series: Lithic::ManagementOperationTransaction::TransactionSeries | nil, + user_defined_id: String | nil + } + end + end +end diff --git a/test/lithic/resources/network_programs_test.rb b/test/lithic/resources/network_programs_test.rb new file mode 100644 index 00000000..f076d4ed --- /dev/null +++ b/test/lithic/resources/network_programs_test.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::NetworkProgramsTest < Lithic::Test::ResourceTest + def test_retrieve + response = @lithic.network_programs.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::NetworkProgram + end + + assert_pattern do + response => { + token: String, + default_product_code: String, + name: String, + registered_program_identification_number: String + } + end + end + + def test_list + response = @lithic.network_programs.list + + assert_pattern do + response => Lithic::Internal::SinglePage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::NetworkProgram + end + + assert_pattern do + row => { + token: String, + default_product_code: String, + name: String, + registered_program_identification_number: String + } + end + end +end diff --git a/test/lithic/resources/payments_test.rb b/test/lithic/resources/payments_test.rb new file mode 100644 index 00000000..156f1d5a --- /dev/null +++ b/test/lithic/resources/payments_test.rb @@ -0,0 +1,223 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::PaymentsTest < Lithic::Test::ResourceTest + def test_create_required_params + response = + @lithic.payments.create( + amount: 1, + external_bank_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + method_: :ACH_NEXT_DAY, + method_attributes: {sec_code: :CCD}, + type: :COLLECTION + ) + + assert_pattern do + response => Lithic::Models::PaymentCreateResponse + end + end + + def test_retrieve + response = @lithic.payments.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Payment + end + + assert_pattern do + response => { + token: String, + category: Lithic::Payment::Category, + created: Time, + descriptor: String, + direction: Lithic::Payment::Direction, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::Payment::Event]), + family: Symbol, + financial_account_token: String, + method_: Lithic::Payment::Method, + method_attributes: Lithic::Payment::MethodAttributes, + pending_amount: Integer, + related_account_tokens: Lithic::Payment::RelatedAccountTokens | nil, + result: Lithic::Payment::Result, + settled_amount: Integer, + source: Lithic::Payment::Source, + status: Lithic::Payment::Status, + updated: Time, + currency: String | nil, + expected_release_date: Date | nil, + external_bank_account_token: String | nil, + tags: ^(Lithic::Internal::Type::HashOf[String]) | nil, + type: Lithic::Payment::Type | nil, + user_defined_id: String | nil + } + end + end + + def test_list + response = @lithic.payments.list + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Payment + end + + assert_pattern do + row => { + token: String, + category: Lithic::Payment::Category, + created: Time, + descriptor: String, + direction: Lithic::Payment::Direction, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::Payment::Event]), + family: Symbol, + financial_account_token: String, + method_: Lithic::Payment::Method, + method_attributes: Lithic::Payment::MethodAttributes, + pending_amount: Integer, + related_account_tokens: Lithic::Payment::RelatedAccountTokens | nil, + result: Lithic::Payment::Result, + settled_amount: Integer, + source: Lithic::Payment::Source, + status: Lithic::Payment::Status, + updated: Time, + currency: String | nil, + expected_release_date: Date | nil, + external_bank_account_token: String | nil, + tags: ^(Lithic::Internal::Type::HashOf[String]) | nil, + type: Lithic::Payment::Type | nil, + user_defined_id: String | nil + } + end + end + + def test_retry_ + response = @lithic.payments.retry_("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::PaymentRetryResponse + end + end + + def test_return__required_params + response = + @lithic.payments.return_( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + return_reason_code: "R01" + ) + + assert_pattern do + response => Lithic::Payment + end + + assert_pattern do + response => { + token: String, + category: Lithic::Payment::Category, + created: Time, + descriptor: String, + direction: Lithic::Payment::Direction, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::Payment::Event]), + family: Symbol, + financial_account_token: String, + method_: Lithic::Payment::Method, + method_attributes: Lithic::Payment::MethodAttributes, + pending_amount: Integer, + related_account_tokens: Lithic::Payment::RelatedAccountTokens | nil, + result: Lithic::Payment::Result, + settled_amount: Integer, + source: Lithic::Payment::Source, + status: Lithic::Payment::Status, + updated: Time, + currency: String | nil, + expected_release_date: Date | nil, + external_bank_account_token: String | nil, + tags: ^(Lithic::Internal::Type::HashOf[String]) | nil, + type: Lithic::Payment::Type | nil, + user_defined_id: String | nil + } + end + end + + def test_simulate_action_required_params + response = + @lithic.payments.simulate_action( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + event_type: :ACH_ORIGINATION_REVIEWED + ) + + assert_pattern do + response => Lithic::Models::PaymentSimulateActionResponse + end + + assert_pattern do + response => { + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateActionResponse::Result, + transaction_event_token: String + } + end + end + + def test_simulate_receipt_required_params + response = + @lithic.payments.simulate_receipt( + token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + amount: 0, + financial_account_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + receipt_type: :RECEIPT_CREDIT + ) + + assert_pattern do + response => Lithic::Models::PaymentSimulateReceiptResponse + end + + assert_pattern do + response => { + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateReceiptResponse::Result, + transaction_event_token: String + } + end + end + + def test_simulate_release_required_params + response = @lithic.payments.simulate_release(payment_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::PaymentSimulateReleaseResponse + end + + assert_pattern do + response => { + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateReleaseResponse::Result, + transaction_event_token: String + } + end + end + + def test_simulate_return_required_params + response = @lithic.payments.simulate_return(payment_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Models::PaymentSimulateReturnResponse + end + + assert_pattern do + response => { + debugging_request_id: String, + result: Lithic::Models::PaymentSimulateReturnResponse::Result, + transaction_event_token: String + } + end + end +end diff --git a/test/lithic/resources/reports/settlement/network_totals_test.rb b/test/lithic/resources/reports/settlement/network_totals_test.rb new file mode 100644 index 00000000..1511d3e5 --- /dev/null +++ b/test/lithic/resources/reports/settlement/network_totals_test.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +require_relative "../../../test_helper" + +class Lithic::Test::Resources::Reports::Settlement::NetworkTotalsTest < Lithic::Test::ResourceTest + def test_retrieve + response = @lithic.reports.settlement.network_totals.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::NetworkTotal + end + + assert_pattern do + response => { + token: String, + amounts: Lithic::NetworkTotal::Amounts, + created: Time, + currency: String, + institution_id: String, + is_complete: Lithic::Internal::Type::Boolean, + network: Lithic::NetworkTotal::Network, + report_date: Date, + settlement_institution_id: String, + settlement_service: String, + updated: Time, + cycle: Integer | nil + } + end + end + + def test_list + response = @lithic.reports.settlement.network_totals.list + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::NetworkTotal + end + + assert_pattern do + row => { + token: String, + amounts: Lithic::NetworkTotal::Amounts, + created: Time, + currency: String, + institution_id: String, + is_complete: Lithic::Internal::Type::Boolean, + network: Lithic::NetworkTotal::Network, + report_date: Date, + settlement_institution_id: String, + settlement_service: String, + updated: Time, + cycle: Integer | nil + } + end + end +end diff --git a/test/lithic/resources/reports/settlement_test.rb b/test/lithic/resources/reports/settlement_test.rb new file mode 100644 index 00000000..ca356991 --- /dev/null +++ b/test/lithic/resources/reports/settlement_test.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::Reports::SettlementTest < Lithic::Test::ResourceTest + def test_list_details + response = @lithic.reports.settlement.list_details("2023-09-01") + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::SettlementDetail + end + + assert_pattern do + row => { + token: String, + account_token: String | nil, + card_program_token: String | nil, + card_token: String | nil, + created: Time, + currency: String, + disputes_gross_amount: Integer, + event_tokens: ^(Lithic::Internal::Type::ArrayOf[String]), + institution: String, + interchange_fee_extended_precision: Integer, + interchange_gross_amount: Integer, + network: Lithic::SettlementDetail::Network, + other_fees_details: Lithic::SettlementDetail::OtherFeesDetails, + other_fees_gross_amount: Integer, + report_date: String, + settlement_date: String, + transaction_token: String | nil, + transactions_gross_amount: Integer, + type: Lithic::SettlementDetail::Type, + updated: Time, + fee_description: String | nil + } + end + end + + def test_summary + response = @lithic.reports.settlement.summary("2023-09-01") + + assert_pattern do + response => Lithic::SettlementReport + end + + assert_pattern do + response => { + created: Time, + currency: String, + details: ^(Lithic::Internal::Type::ArrayOf[Lithic::SettlementSummaryDetails]), + disputes_gross_amount: Integer, + interchange_gross_amount: Integer, + is_complete: Lithic::Internal::Type::Boolean, + other_fees_gross_amount: Integer, + report_date: String, + settled_net_amount: Integer, + transactions_gross_amount: Integer, + updated: Time + } + end + end +end diff --git a/test/lithic/resources/reports_test.rb b/test/lithic/resources/reports_test.rb new file mode 100644 index 00000000..20f1b07b --- /dev/null +++ b/test/lithic/resources/reports_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::ReportsTest < Lithic::Test::ResourceTest +end diff --git a/test/lithic/resources/responder_endpoints_test.rb b/test/lithic/resources/responder_endpoints_test.rb new file mode 100644 index 00000000..1980887d --- /dev/null +++ b/test/lithic/resources/responder_endpoints_test.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::ResponderEndpointsTest < Lithic::Test::ResourceTest + def test_create + response = @lithic.responder_endpoints.create + + assert_pattern do + response => Lithic::Models::ResponderEndpointCreateResponse + end + + assert_pattern do + response => { + enrolled: Lithic::Internal::Type::Boolean | nil + } + end + end + + def test_delete_required_params + skip("Prism errors when accept header set but no request body is defined") + + response = @lithic.responder_endpoints.delete(type: :AUTH_STREAM_ACCESS) + + assert_pattern do + response => nil + end + end + + def test_check_status_required_params + response = @lithic.responder_endpoints.check_status(type: :AUTH_STREAM_ACCESS) + + assert_pattern do + response => Lithic::ResponderEndpointStatus + end + + assert_pattern do + response => { + enrolled: Lithic::Internal::Type::Boolean | nil, + url: String | nil + } + end + end +end diff --git a/test/lithic/resources/shared_test.rb b/test/lithic/resources/shared_test.rb new file mode 100644 index 00000000..c6c52a04 --- /dev/null +++ b/test/lithic/resources/shared_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::SharedTest < Lithic::Test::ResourceTest +end diff --git a/test/lithic/resources/three_ds/authentication_test.rb b/test/lithic/resources/three_ds/authentication_test.rb new file mode 100644 index 00000000..db205363 --- /dev/null +++ b/test/lithic/resources/three_ds/authentication_test.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::ThreeDS::AuthenticationTest < Lithic::Test::ResourceTest + def test_retrieve + response = @lithic.three_ds.authentication.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::ThreeDSAuthentication + end + + assert_pattern do + response => { + token: String, + account_type: Lithic::ThreeDSAuthentication::AccountType | nil, + authentication_result: Lithic::ThreeDSAuthentication::AuthenticationResult, + card_expiry_check: Lithic::ThreeDSAuthentication::CardExpiryCheck, + card_token: String, + cardholder: Lithic::ThreeDSAuthentication::Cardholder, + channel: Lithic::ThreeDSAuthentication::Channel, + created: Time, + merchant: Lithic::ThreeDSAuthentication::Merchant, + message_category: Lithic::ThreeDSAuthentication::MessageCategory, + three_ds_requestor_challenge_indicator: Lithic::ThreeDSAuthentication::ThreeDSRequestorChallengeIndicator, + additional_data: Lithic::ThreeDSAuthentication::AdditionalData | nil, + app: Lithic::ThreeDSAuthentication::App | nil, + authentication_request_type: Lithic::ThreeDSAuthentication::AuthenticationRequestType | nil, + browser: Lithic::ThreeDSAuthentication::Browser | nil, + challenge_metadata: Lithic::ThreeDSAuthentication::ChallengeMetadata | nil, + challenge_orchestrated_by: Lithic::ThreeDSAuthentication::ChallengeOrchestratedBy | nil, + decision_made_by: Lithic::ThreeDSAuthentication::DecisionMadeBy | nil, + three_ri_request_type: Lithic::ThreeDSAuthentication::ThreeRiRequestType | nil, + transaction: Lithic::ThreeDSAuthentication::Transaction | nil + } + end + end + + def test_simulate_required_params + response = + @lithic.three_ds.authentication.simulate( + merchant: {id: "OODKZAPJVN4YS7O", country: "USA", mcc: "5812", name: "COFFEE SHOP"}, + pan: "4111111289144142", + transaction: {amount: 0, currency: "GBP"} + ) + + assert_pattern do + response => Lithic::Models::ThreeDS::AuthenticationSimulateResponse + end + + assert_pattern do + response => { + token: String | nil + } + end + end + + def test_simulate_otp_entry_required_params + response = + @lithic.three_ds.authentication.simulate_otp_entry( + token: "fabd829d-7f7b-4432-a8f2-07ea4889aaac", + otp: "123456" + ) + + assert_pattern do + response => nil + end + end +end diff --git a/test/lithic/resources/three_ds/decisioning_test.rb b/test/lithic/resources/three_ds/decisioning_test.rb new file mode 100644 index 00000000..4189fda6 --- /dev/null +++ b/test/lithic/resources/three_ds/decisioning_test.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::ThreeDS::DecisioningTest < Lithic::Test::ResourceTest + def test_challenge_response_required_params + response = + @lithic.three_ds.decisioning.challenge_response( + token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + challenge_response: :APPROVE + ) + + assert_pattern do + response => nil + end + end + + def test_retrieve_secret + response = @lithic.three_ds.decisioning.retrieve_secret + + assert_pattern do + response => Lithic::Models::ThreeDS::DecisioningRetrieveSecretResponse + end + + assert_pattern do + response => { + secret: String | nil + } + end + end + + def test_rotate_secret + response = @lithic.three_ds.decisioning.rotate_secret + + assert_pattern do + response => nil + end + end +end diff --git a/test/lithic/resources/three_ds_test.rb b/test/lithic/resources/three_ds_test.rb new file mode 100644 index 00000000..37c8f2cd --- /dev/null +++ b/test/lithic/resources/three_ds_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::ThreeDSTest < Lithic::Test::ResourceTest +end diff --git a/test/lithic/resources/tokenization_decisioning_test.rb b/test/lithic/resources/tokenization_decisioning_test.rb new file mode 100644 index 00000000..98bd0319 --- /dev/null +++ b/test/lithic/resources/tokenization_decisioning_test.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::TokenizationDecisioningTest < Lithic::Test::ResourceTest + def test_retrieve_secret + response = @lithic.tokenization_decisioning.retrieve_secret + + assert_pattern do + response => Lithic::TokenizationSecret + end + + assert_pattern do + response => { + secret: String | nil + } + end + end + + def test_rotate_secret + response = @lithic.tokenization_decisioning.rotate_secret + + assert_pattern do + response => Lithic::Models::TokenizationDecisioningRotateSecretResponse + end + + assert_pattern do + response => { + secret: String | nil + } + end + end +end diff --git a/test/lithic/resources/tokenizations_test.rb b/test/lithic/resources/tokenizations_test.rb new file mode 100644 index 00000000..8cfa5444 --- /dev/null +++ b/test/lithic/resources/tokenizations_test.rb @@ -0,0 +1,166 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::TokenizationsTest < Lithic::Test::ResourceTest + def test_retrieve + response = @lithic.tokenizations.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Tokenization + end + + assert_pattern do + response => { + token: String, + account_token: String, + card_token: String, + created_at: Time, + dpan: String | nil, + status: Lithic::Tokenization::Status, + token_requestor_name: Lithic::Tokenization::TokenRequestorName, + token_unique_reference: String, + tokenization_channel: Lithic::Tokenization::TokenizationChannel, + updated_at: Time, + device_id: String | nil, + digital_card_art_token: String | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::Tokenization::Event]) | nil, + payment_account_reference_id: String | nil + } + end + end + + def test_list + response = @lithic.tokenizations.list + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Tokenization + end + + assert_pattern do + row => { + token: String, + account_token: String, + card_token: String, + created_at: Time, + dpan: String | nil, + status: Lithic::Tokenization::Status, + token_requestor_name: Lithic::Tokenization::TokenRequestorName, + token_unique_reference: String, + tokenization_channel: Lithic::Tokenization::TokenizationChannel, + updated_at: Time, + device_id: String | nil, + digital_card_art_token: String | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::Tokenization::Event]) | nil, + payment_account_reference_id: String | nil + } + end + end + + def test_activate + response = @lithic.tokenizations.activate("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => nil + end + end + + def test_deactivate + response = @lithic.tokenizations.deactivate("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => nil + end + end + + def test_pause + response = @lithic.tokenizations.pause("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => nil + end + end + + def test_resend_activation_code + response = @lithic.tokenizations.resend_activation_code("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => nil + end + end + + def test_simulate_required_params + response = + @lithic.tokenizations.simulate( + cvv: "776", + expiration_date: "08/29", + pan: "4111111289144142", + tokenization_source: :APPLE_PAY + ) + + assert_pattern do + response => Lithic::Tokenization + end + + assert_pattern do + response => { + token: String, + account_token: String, + card_token: String, + created_at: Time, + dpan: String | nil, + status: Lithic::Tokenization::Status, + token_requestor_name: Lithic::Tokenization::TokenRequestorName, + token_unique_reference: String, + tokenization_channel: Lithic::Tokenization::TokenizationChannel, + updated_at: Time, + device_id: String | nil, + digital_card_art_token: String | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::Tokenization::Event]) | nil, + payment_account_reference_id: String | nil + } + end + end + + def test_unpause + response = @lithic.tokenizations.unpause("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => nil + end + end + + def test_update_digital_card_art + response = @lithic.tokenizations.update_digital_card_art("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Tokenization + end + + assert_pattern do + response => { + token: String, + account_token: String, + card_token: String, + created_at: Time, + dpan: String | nil, + status: Lithic::Tokenization::Status, + token_requestor_name: Lithic::Tokenization::TokenRequestorName, + token_unique_reference: String, + tokenization_channel: Lithic::Tokenization::TokenizationChannel, + updated_at: Time, + device_id: String | nil, + digital_card_art_token: String | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::Tokenization::Event]) | nil, + payment_account_reference_id: String | nil + } + end + end +end diff --git a/test/lithic/resources/transaction_monitoring/cases/comments_test.rb b/test/lithic/resources/transaction_monitoring/cases/comments_test.rb new file mode 100644 index 00000000..1143351e --- /dev/null +++ b/test/lithic/resources/transaction_monitoring/cases/comments_test.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +require_relative "../../../test_helper" + +class Lithic::Test::Resources::TransactionMonitoring::Cases::CommentsTest < Lithic::Test::ResourceTest + def test_create_required_params + response = + @lithic.transaction_monitoring.cases.comments.create( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + comment: "comment" + ) + + assert_pattern do + response => Lithic::TransactionMonitoring::CaseActivityEntry + end + + assert_pattern do + response => { + token: String, + actor_token: String | nil, + created: Time, + entry_type: Lithic::TransactionMonitoring::CaseActivityType, + new_value: String | nil, + previous_value: String | nil + } + end + end + + def test_update_required_params + response = + @lithic.transaction_monitoring.cases.comments.update( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + case_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + comment: "comment" + ) + + assert_pattern do + response => Lithic::TransactionMonitoring::CaseActivityEntry + end + + assert_pattern do + response => { + token: String, + actor_token: String | nil, + created: Time, + entry_type: Lithic::TransactionMonitoring::CaseActivityType, + new_value: String | nil, + previous_value: String | nil + } + end + end + + def test_delete_required_params + response = + @lithic.transaction_monitoring.cases.comments.delete( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + case_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => nil + end + end +end diff --git a/test/lithic/resources/transaction_monitoring/cases/files_test.rb b/test/lithic/resources/transaction_monitoring/cases/files_test.rb new file mode 100644 index 00000000..09900d9d --- /dev/null +++ b/test/lithic/resources/transaction_monitoring/cases/files_test.rb @@ -0,0 +1,107 @@ +# frozen_string_literal: true + +require_relative "../../../test_helper" + +class Lithic::Test::Resources::TransactionMonitoring::Cases::FilesTest < Lithic::Test::ResourceTest + def test_create_required_params + response = + @lithic.transaction_monitoring.cases.files.create("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", name: "name") + + assert_pattern do + response => Lithic::TransactionMonitoring::Cases::CaseFile + end + + assert_pattern do + response => { + token: String, + created: Time, + download_url: String | nil, + download_url_expires: Time | nil, + failure_reason: String | nil, + mime_type: String | nil, + name: String, + size_bytes: Integer | nil, + status: Lithic::TransactionMonitoring::Cases::FileStatus, + updated: Time, + upload_constraints: Lithic::TransactionMonitoring::Cases::UploadConstraints | nil, + upload_url: String | nil, + upload_url_expires: Time | nil + } + end + end + + def test_retrieve_required_params + response = + @lithic.transaction_monitoring.cases.files.retrieve( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + case_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => Lithic::TransactionMonitoring::Cases::CaseFile + end + + assert_pattern do + response => { + token: String, + created: Time, + download_url: String | nil, + download_url_expires: Time | nil, + failure_reason: String | nil, + mime_type: String | nil, + name: String, + size_bytes: Integer | nil, + status: Lithic::TransactionMonitoring::Cases::FileStatus, + updated: Time, + upload_constraints: Lithic::TransactionMonitoring::Cases::UploadConstraints | nil, + upload_url: String | nil, + upload_url_expires: Time | nil + } + end + end + + def test_list + response = @lithic.transaction_monitoring.cases.files.list("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::TransactionMonitoring::Cases::CaseFile + end + + assert_pattern do + row => { + token: String, + created: Time, + download_url: String | nil, + download_url_expires: Time | nil, + failure_reason: String | nil, + mime_type: String | nil, + name: String, + size_bytes: Integer | nil, + status: Lithic::TransactionMonitoring::Cases::FileStatus, + updated: Time, + upload_constraints: Lithic::TransactionMonitoring::Cases::UploadConstraints | nil, + upload_url: String | nil, + upload_url_expires: Time | nil + } + end + end + + def test_delete_required_params + response = + @lithic.transaction_monitoring.cases.files.delete( + "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + case_token: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => nil + end + end +end diff --git a/test/lithic/resources/transaction_monitoring/cases_test.rb b/test/lithic/resources/transaction_monitoring/cases_test.rb new file mode 100644 index 00000000..780a9cb4 --- /dev/null +++ b/test/lithic/resources/transaction_monitoring/cases_test.rb @@ -0,0 +1,161 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::TransactionMonitoring::CasesTest < Lithic::Test::ResourceTest + def test_retrieve + response = @lithic.transaction_monitoring.cases.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::TransactionMonitoring::MonitoringCase + end + + assert_pattern do + response => { + token: String, + assignee: String | nil, + collection_stopped: Time | nil, + created: Time, + entity: Lithic::TransactionMonitoring::CaseEntity | nil, + pending_transactions: Lithic::Internal::Type::Boolean, + priority: Lithic::TransactionMonitoring::CasePriority, + queue_token: String, + resolution: Lithic::TransactionMonitoring::ResolutionOutcome | nil, + resolution_notes: String | nil, + resolved: Time | nil, + rule_token: String | nil, + sla_deadline: Time | nil, + status: Lithic::TransactionMonitoring::CaseStatus, + tags: ^(Lithic::Internal::Type::HashOf[String]), + title: String | nil, + updated: Time + } + end + end + + def test_update + response = @lithic.transaction_monitoring.cases.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::TransactionMonitoring::MonitoringCase + end + + assert_pattern do + response => { + token: String, + assignee: String | nil, + collection_stopped: Time | nil, + created: Time, + entity: Lithic::TransactionMonitoring::CaseEntity | nil, + pending_transactions: Lithic::Internal::Type::Boolean, + priority: Lithic::TransactionMonitoring::CasePriority, + queue_token: String, + resolution: Lithic::TransactionMonitoring::ResolutionOutcome | nil, + resolution_notes: String | nil, + resolved: Time | nil, + rule_token: String | nil, + sla_deadline: Time | nil, + status: Lithic::TransactionMonitoring::CaseStatus, + tags: ^(Lithic::Internal::Type::HashOf[String]), + title: String | nil, + updated: Time + } + end + end + + def test_list + response = @lithic.transaction_monitoring.cases.list + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::TransactionMonitoring::MonitoringCase + end + + assert_pattern do + row => { + token: String, + assignee: String | nil, + collection_stopped: Time | nil, + created: Time, + entity: Lithic::TransactionMonitoring::CaseEntity | nil, + pending_transactions: Lithic::Internal::Type::Boolean, + priority: Lithic::TransactionMonitoring::CasePriority, + queue_token: String, + resolution: Lithic::TransactionMonitoring::ResolutionOutcome | nil, + resolution_notes: String | nil, + resolved: Time | nil, + rule_token: String | nil, + sla_deadline: Time | nil, + status: Lithic::TransactionMonitoring::CaseStatus, + tags: ^(Lithic::Internal::Type::HashOf[String]), + title: String | nil, + updated: Time + } + end + end + + def test_list_activity + response = @lithic.transaction_monitoring.cases.list_activity("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::TransactionMonitoring::CaseActivityEntry + end + + assert_pattern do + row => { + token: String, + actor_token: String | nil, + created: Time, + entry_type: Lithic::TransactionMonitoring::CaseActivityType, + new_value: String | nil, + previous_value: String | nil + } + end + end + + def test_list_transactions + response = @lithic.transaction_monitoring.cases.list_transactions("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::TransactionMonitoring::CaseTransaction + end + + assert_pattern do + row => { + token: String, + account_token: String, + added_at: Time, + card_token: String, + transaction_created_at: Time + } + end + end + + def test_retrieve_cards + response = @lithic.transaction_monitoring.cases.retrieve_cards("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => ^(Lithic::Internal::Type::ArrayOf[Lithic::TransactionMonitoring::CaseCard]) + end + end +end diff --git a/test/lithic/resources/transaction_monitoring/queues_test.rb b/test/lithic/resources/transaction_monitoring/queues_test.rb new file mode 100644 index 00000000..782858d0 --- /dev/null +++ b/test/lithic/resources/transaction_monitoring/queues_test.rb @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::TransactionMonitoring::QueuesTest < Lithic::Test::ResourceTest + def test_create_required_params + response = @lithic.transaction_monitoring.queues.create(name: "name") + + assert_pattern do + response => Lithic::TransactionMonitoring::Queue + end + + assert_pattern do + response => { + token: String, + case_counts: Lithic::TransactionMonitoring::Queue::CaseCounts, + created: Time, + description: String | nil, + name: String, + updated: Time + } + end + end + + def test_retrieve + response = @lithic.transaction_monitoring.queues.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::TransactionMonitoring::Queue + end + + assert_pattern do + response => { + token: String, + case_counts: Lithic::TransactionMonitoring::Queue::CaseCounts, + created: Time, + description: String | nil, + name: String, + updated: Time + } + end + end + + def test_update + response = @lithic.transaction_monitoring.queues.update("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::TransactionMonitoring::Queue + end + + assert_pattern do + response => { + token: String, + case_counts: Lithic::TransactionMonitoring::Queue::CaseCounts, + created: Time, + description: String | nil, + name: String, + updated: Time + } + end + end + + def test_list + response = @lithic.transaction_monitoring.queues.list + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::TransactionMonitoring::Queue + end + + assert_pattern do + row => { + token: String, + case_counts: Lithic::TransactionMonitoring::Queue::CaseCounts, + created: Time, + description: String | nil, + name: String, + updated: Time + } + end + end + + def test_delete + response = @lithic.transaction_monitoring.queues.delete("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => nil + end + end +end diff --git a/test/lithic/resources/transaction_monitoring_test.rb b/test/lithic/resources/transaction_monitoring_test.rb new file mode 100644 index 00000000..9959f6ca --- /dev/null +++ b/test/lithic/resources/transaction_monitoring_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::TransactionMonitoringTest < Lithic::Test::ResourceTest +end diff --git a/test/lithic/resources/transactions/enhanced_commercial_data_test.rb b/test/lithic/resources/transactions/enhanced_commercial_data_test.rb new file mode 100644 index 00000000..70b7f611 --- /dev/null +++ b/test/lithic/resources/transactions/enhanced_commercial_data_test.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::Transactions::EnhancedCommercialDataTest < Lithic::Test::ResourceTest + def test_retrieve + response = @lithic.transactions.enhanced_commercial_data.retrieve("00000000-0000-0000-0000-000000000000") + + assert_pattern do + response => Lithic::Models::Transactions::EnhancedCommercialDataRetrieveResponse + end + + assert_pattern do + response => { + data: ^(Lithic::Internal::Type::ArrayOf[Lithic::Transactions::Events::EnhancedData]) + } + end + end +end diff --git a/test/lithic/resources/transactions/events/enhanced_commercial_data_test.rb b/test/lithic/resources/transactions/events/enhanced_commercial_data_test.rb new file mode 100644 index 00000000..4a7bc84e --- /dev/null +++ b/test/lithic/resources/transactions/events/enhanced_commercial_data_test.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +require_relative "../../../test_helper" + +class Lithic::Test::Resources::Transactions::Events::EnhancedCommercialDataTest < Lithic::Test::ResourceTest + def test_retrieve + response = + @lithic.transactions.events.enhanced_commercial_data.retrieve("00000000-0000-0000-0000-000000000000") + + assert_pattern do + response => Lithic::Transactions::Events::EnhancedData + end + + assert_pattern do + response => { + token: String, + common: Lithic::Transactions::Events::EnhancedData::Common, + event_token: String, + fleet: ^(Lithic::Internal::Type::ArrayOf[Lithic::Transactions::Events::EnhancedData::Fleet]), + transaction_token: String + } + end + end +end diff --git a/test/lithic/resources/transactions/events_test.rb b/test/lithic/resources/transactions/events_test.rb new file mode 100644 index 00000000..f2bb2b26 --- /dev/null +++ b/test/lithic/resources/transactions/events_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Lithic::Test::Resources::Transactions::EventsTest < Lithic::Test::ResourceTest +end diff --git a/test/lithic/resources/transactions_test.rb b/test/lithic/resources/transactions_test.rb new file mode 100644 index 00000000..5413def7 --- /dev/null +++ b/test/lithic/resources/transactions_test.rb @@ -0,0 +1,231 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::TransactionsTest < Lithic::Test::ResourceTest + def test_retrieve + response = @lithic.transactions.retrieve("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + + assert_pattern do + response => Lithic::Transaction + end + + assert_pattern do + response => { + token: String, + account_token: String, + acquirer_fee: Integer | nil, + acquirer_reference_number: String | nil, + amount: Integer, + amounts: Lithic::Transaction::Amounts, + authorization_amount: Integer | nil, + authorization_code: String | nil, + avs: Lithic::Transaction::Avs | nil, + card_token: String, + cardholder_authentication: Lithic::CardholderAuthentication | nil, + created: Time, + financial_account_token: String | nil, + merchant: Lithic::Transaction::Merchant, + merchant_amount: Integer | nil, + merchant_authorization_amount: Integer | nil, + merchant_currency: String, + network: Lithic::Transaction::Network | nil, + network_risk_score: Integer | nil, + pos: Lithic::Transaction::Pos, + result: Lithic::Transaction::Result, + service_location: Lithic::Transaction::ServiceLocation | nil, + settled_amount: Integer, + status: Lithic::Transaction::Status, + tags: ^(Lithic::Internal::Type::HashOf[String]), + token_info: Lithic::TokenInfo | nil, + updated: Time, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::Transaction::Event]) | nil + } + end + end + + def test_list + response = @lithic.transactions.list + + assert_pattern do + response => Lithic::Internal::CursorPage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::Transaction + end + + assert_pattern do + row => { + token: String, + account_token: String, + acquirer_fee: Integer | nil, + acquirer_reference_number: String | nil, + amount: Integer, + amounts: Lithic::Transaction::Amounts, + authorization_amount: Integer | nil, + authorization_code: String | nil, + avs: Lithic::Transaction::Avs | nil, + card_token: String, + cardholder_authentication: Lithic::CardholderAuthentication | nil, + created: Time, + financial_account_token: String | nil, + merchant: Lithic::Transaction::Merchant, + merchant_amount: Integer | nil, + merchant_authorization_amount: Integer | nil, + merchant_currency: String, + network: Lithic::Transaction::Network | nil, + network_risk_score: Integer | nil, + pos: Lithic::Transaction::Pos, + result: Lithic::Transaction::Result, + service_location: Lithic::Transaction::ServiceLocation | nil, + settled_amount: Integer, + status: Lithic::Transaction::Status, + tags: ^(Lithic::Internal::Type::HashOf[String]), + token_info: Lithic::TokenInfo | nil, + updated: Time, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::Transaction::Event]) | nil + } + end + end + + def test_expire_authorization + response = @lithic.transactions.expire_authorization("00000000-0000-0000-0000-000000000000") + + assert_pattern do + response => nil + end + end + + def test_route_required_params + response = + @lithic.transactions.route( + "00000000-0000-0000-0000-000000000000", + financial_account_token: "00000000-0000-0000-0000-000000000000" + ) + + assert_pattern do + response => nil + end + end + + def test_simulate_authorization_required_params + response = + @lithic.transactions.simulate_authorization( + amount: 3831, + descriptor: "COFFEE SHOP", + pan: "4111111289144142" + ) + + assert_pattern do + response => Lithic::Models::TransactionSimulateAuthorizationResponse + end + + assert_pattern do + response => { + token: String | nil, + debugging_request_id: String | nil + } + end + end + + def test_simulate_authorization_advice_required_params + response = + @lithic.transactions.simulate_authorization_advice( + token: "fabd829d-7f7b-4432-a8f2-07ea4889aaac", + amount: 3831 + ) + + assert_pattern do + response => Lithic::Models::TransactionSimulateAuthorizationAdviceResponse + end + + assert_pattern do + response => { + token: String | nil, + debugging_request_id: String | nil + } + end + end + + def test_simulate_clearing_required_params + response = @lithic.transactions.simulate_clearing(token: "fabd829d-7f7b-4432-a8f2-07ea4889aaac") + + assert_pattern do + response => Lithic::Models::TransactionSimulateClearingResponse + end + + assert_pattern do + response => { + debugging_request_id: String | nil + } + end + end + + def test_simulate_credit_authorization_advice_required_params + response = + @lithic.transactions.simulate_credit_authorization_advice( + amount: 3831, + descriptor: "COFFEE SHOP", + pan: "4111111289144142" + ) + + assert_pattern do + response => Lithic::Models::TransactionSimulateCreditAuthorizationAdviceResponse + end + + assert_pattern do + response => { + token: String | nil, + debugging_request_id: String | nil + } + end + end + + def test_simulate_return_required_params + response = + @lithic.transactions.simulate_return(amount: 3831, descriptor: "COFFEE SHOP", pan: "4111111289144142") + + assert_pattern do + response => Lithic::Models::TransactionSimulateReturnResponse + end + + assert_pattern do + response => { + token: String | nil, + debugging_request_id: String | nil + } + end + end + + def test_simulate_return_reversal_required_params + response = @lithic.transactions.simulate_return_reversal(token: "fabd829d-7f7b-4432-a8f2-07ea4889aaac") + + assert_pattern do + response => Lithic::Models::TransactionSimulateReturnReversalResponse + end + + assert_pattern do + response => { + debugging_request_id: String | nil + } + end + end + + def test_simulate_void_required_params + response = @lithic.transactions.simulate_void(token: "fabd829d-7f7b-4432-a8f2-07ea4889aaac") + + assert_pattern do + response => Lithic::Models::TransactionSimulateVoidResponse + end + + assert_pattern do + response => { + debugging_request_id: String | nil + } + end + end +end diff --git a/test/lithic/resources/transfer_limits_test.rb b/test/lithic/resources/transfer_limits_test.rb new file mode 100644 index 00000000..a4326c87 --- /dev/null +++ b/test/lithic/resources/transfer_limits_test.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::TransferLimitsTest < Lithic::Test::ResourceTest + def test_list + response = @lithic.transfer_limits.list + + assert_pattern do + response => Lithic::Internal::SinglePage + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Lithic::TransferLimitsResponse::Data + end + + assert_pattern do + row => { + company_id: String, + daily_limit: Lithic::TransferLimitsResponse::Data::DailyLimit, + date: Date, + is_fbo: Lithic::Internal::Type::Boolean, + monthly_limit: Lithic::TransferLimitsResponse::Data::MonthlyLimit, + program_limit_per_transaction: Lithic::TransferLimitsResponse::Data::ProgramLimitPerTransaction + } + end + end +end diff --git a/test/lithic/resources/transfers_test.rb b/test/lithic/resources/transfers_test.rb new file mode 100644 index 00000000..585f69cb --- /dev/null +++ b/test/lithic/resources/transfers_test.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::TransfersTest < Lithic::Test::ResourceTest + def test_create_required_params + response = + @lithic.transfers.create( + amount: 0, + from: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + to: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" + ) + + assert_pattern do + response => Lithic::Transfer + end + + assert_pattern do + response => { + token: String | nil, + category: Lithic::Transfer::Category | nil, + created: Time | nil, + currency: String | nil, + descriptor: String | nil, + events: ^(Lithic::Internal::Type::ArrayOf[Lithic::FinancialEvent]) | nil, + from_balance: ^(Lithic::Internal::Type::ArrayOf[Lithic::Balance]) | nil, + pending_amount: Integer | nil, + result: Lithic::Transfer::Result | nil, + settled_amount: Integer | nil, + status: Lithic::Transfer::Status | nil, + to_balance: ^(Lithic::Internal::Type::ArrayOf[Lithic::Balance]) | nil, + updated: Time | nil + } + end + end +end diff --git a/test/lithic/resources/webhooks_test.rb b/test/lithic/resources/webhooks_test.rb new file mode 100644 index 00000000..3006737c --- /dev/null +++ b/test/lithic/resources/webhooks_test.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Lithic::Test::Resources::WebhooksTest < Lithic::Test::ResourceTest + def test_parsed + key = "whsec_c2VjcmV0Cg==" + + webhook = StandardWebhooks::Webhook.new(key) + + data = + "{\"account_token\":\"00000000-0000-0000-0000-000000000002\",\"card_token\":\"00000000-0000-0000-0000-000000000001\",\"created\":\"2023-09-18T12:34:56Z\",\"digital_wallet_token_metadata\":{\"payment_account_info\":{\"account_holder_data\":{\"phone_number\":\"+15555555555\"},\"pan_unique_reference\":\"pan_unique_ref_1234567890123456789012345678\",\"payment_account_reference\":\"ref_1234567890123456789012\",\"token_unique_reference\":\"token_unique_ref_1234567890123456789012345678\"},\"status\":\"Pending\",\"payment_app_instance_id\":\"app_instance_123456789012345678901234567890\",\"token_requestor_id\":\"12345678901\",\"token_requestor_name\":\"APPLE_PAY\"},\"event_type\":\"digital_wallet.tokenization_approval_request\",\"issuer_decision\":\"APPROVED\",\"tokenization_channel\":\"DIGITAL_WALLET\",\"tokenization_token\":\"tok_1234567890abcdef\",\"wallet_decisioning_info\":{\"account_score\":\"100\",\"device_score\":\"100\",\"recommended_decision\":\"Decision1\",\"recommendation_reasons\":[\"Reason1\"]},\"customer_tokenization_decision\":{\"outcome\":\"APPROVED\",\"responder_url\":\"https://example.com\",\"latency\":\"100\",\"response_code\":\"123456\"},\"device\":{\"imei\":\"123456789012345\",\"ip_address\":\"1.1.1.1\",\"location\":\"37.3860517/-122.0838511\"},\"rule_results\":[{\"auth_rule_token\":\"550e8400-e29b-41d4-a716-446655440003\",\"explanation\":\"Account risk too high\",\"name\":\"CustomerAccountRule\",\"result\":\"DECLINED\"}],\"tokenization_decline_reasons\":[\"ACCOUNT_SCORE_1\"],\"tokenization_source\":\"PUSH_PROVISION\",\"tokenization_tfa_reasons\":[\"WALLET_RECOMMENDED_TFA\"]}" + message_id = "1" + timestamp = Time.now.to_i.to_s + signature = webhook.sign(message_id, timestamp, data) + headers = + {"webhook-id" => message_id, "webhook-timestamp" => timestamp, "webhook-signature" => signature} + + @lithic.webhooks.parsed(data, headers: headers, key: key) + + bad_headers = [ + headers.merge("webhook-id" => "bad"), + headers.merge("webhook-timestamp" => "0"), + headers.merge("webhook-signature" => webhook.sign(message_id, timestamp, "xxx")) + ] + bad_headers.each do |bad_header| + assert_raises(StandardWebhooks::WebhookVerificationError) do + @lithic.webhooks.parsed(data, headers: bad_header, key: key) + end + end + end +end diff --git a/test/lithic/test_helper.rb b/test/lithic/test_helper.rb new file mode 100644 index 00000000..4fc1909e --- /dev/null +++ b/test/lithic/test_helper.rb @@ -0,0 +1,87 @@ +# 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/lithic" +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 Lithic::Test::SingletonClient < Lithic::Client + include Singleton + + TEST_API_BASE_URL = ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010") + + def initialize + super(base_url: Lithic::Test::SingletonClient::TEST_API_BASE_URL, api_key: "My Lithic API 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 Lithic::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 + @lithic = Lithic::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