Skip to main content

SVIClient and API layers

SVIClient is the package entry point. It owns one generated client per service and assembles the handwritten usability layer on top. The services, custom included, share one sync and one async connection pool, which close() and close_async() release.

Stable entry points​

SVIClient exposes:

  • svi.api
  • svi.admin
  • svi.documents
  • svi.alerts
  • svi.search
  • svi.workflows
  • svi.custom
  • svi.runtime_config

It also exposes svi.environment_host, the hostname parsed out of the configured base URL, which is None when no base URL is set.

svi.auth holds the resolved TokenProvider, or None on an unauthenticated client. It is a client attribute, not the svi.auth module that the provider classes are imported from.

Raw generated layer​

svi.api is the direct generated surface:

  • svi.api.alerts
  • svi.api.datahub
  • svi.api.sand
  • svi.api.workflows
  • svi.api.files
  • svi.api.folders
  • svi.api.transport

Use this layer when you want endpoint-level coverage without passing a generated client instance around.

Failures come back the same way they do from the capability layer: a status the spec does not model, or a body the SDK cannot read, raises the service family's sasvi.errors class with status_code set, keeping the generated exception as __cause__. A successful status the SDK cannot parse raises MalformedResponseError, whose details hold the model path and the reason, for example ("EntityTypeCollection > EntityType", "KeyError: 'name'"). An enum value the spec does not list is not a parse failure: the model carries the raw string and the SDK logs it once at WARNING. Documented error statuses still come back as the generated error model, so a 404 stays a returned model rather than an exception.

# Assume `svi` is an authenticated SVIClient.
alerts = svi.api.alerts.get_alerts()
reference_lists = svi.api.datahub.get_reference_list_or_lists()
types = svi.api.sand.get_types()
workflows = svi.api.workflows.get_workflows()
files_summary = svi.api.files.get_files_summary_for_filter()
folders_summary = svi.api.folders.get_folders()

Handwritten capability layer​

Top-level capability modules provide the stable usability surface:

  • svi.admin for environment-wide admin and configuration resources
  • svi.documents for bound Data Hub-backed Document objects
  • svi.alerts for bound Alert objects
  • svi.search for convenience-first SAND helpers
  • svi.workflows for runtime workflow instances and tasks
  • svi.admin.workflows for workflow definitions
  • svi.custom for authenticated, origin-locked requests to routes the SDK does not wrap (see Custom endpoint requests)

SVIClient also supports sync and async context-manager use:

with SVIClient(...) as svi:
...

async with SVIClient(...) as svi:
...

Construction is side-effect-free: auth and connectivity checks start on the first authenticated request or when you call verify_connection() / verify_connection_async(). Synchronous context managers close only sync clients, while async context managers or await svi.close_async() perform full cleanup.

Stability tiers​

The SDK intentionally exposes three tiers:

  1. stable entry points such as SVIClient, auth providers, and top-level capability modules
  2. broad generated coverage under svi.api.<service>
  3. internal implementation details that support runtime wiring and generation

This documentation site focuses on the first tier. The second tier remains public, but it is better discovered through code completion, examples, and service-specific usage.