Wrapper Classes¶
The Amorphic SDK provides enhanced wrapper classes that simplify authentication, provide helper utilities, and offer a more user-friendly interface to the underlying OpenAPI client.
Overview¶
The wrapper classes provide:
AmorphicApiClient: Enhanced API client with built-in authentication, version checking, and logging
TokenFetcher: Utility for fetching PAT tokens from various sources (environment variables, AWS SSM, Secrets Manager)
HelpCommand: Comprehensive help system for discovering and exploring available APIs
Key Benefits¶
Simplified Authentication: Automatic token management from multiple sources
Discovery Tools: Built-in help system to explore available APIs and methods
Quick Start¶
import certifi
import boto3
from openapi_client.amorphic_api_client import AmorphicApiClient
from openapi_client.api.datasets_api import DatasetsApi
ssm = boto3.client('ssm')
api_gw_url = ssm.get_parameter(Name='adp/amorphic/config/apigwurl', WithDecryption=False)['Parameter']['Value'] # String type; use WithDecryption=True for SecureString
role_id = ssm.get_parameter(Name='adp/amorphic/config/roleid', WithDecryption=False)['Parameter']['Value'] # String type; use WithDecryption=True for SecureString
client = AmorphicApiClient.create_with_auth(
host=api_gw_url,
role_id=role_id,
ssl_ca_cert=certifi.where(),
ssm_parameter='adp/amorphic/config/pattoken'
)
# Use with any API
datasets_api = DatasetsApi(client)