Pydantic Models
Smarter API PluginData Sql Connection Manifest Constants.
Smarter API Manifest - User.metadata
- class smarter.apps.provider.manifest.models.provider.metadata.SAMProviderMetadata(*, name, description, version, tags=<factory>, annotations=<factory>)[source]
Bases:
AbstractSAMMetadataBaseSmarter API Provider Manifest - Metadata class.
- model_config = {'arbitrary_types_allowed': True, 'from_attributes': True, 'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context, /)
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
Smarter API Manifest - Plugin.spec.
- class smarter.apps.provider.manifest.models.provider.spec.SAMProviderSpec(*, provider)[source]
Bases:
AbstractSAMSpecBaseSmarter API Api Connection Manifest ApiConnection.spec.
- model_config = {'arbitrary_types_allowed': True, 'from_attributes': True, 'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context, /)
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- provider: SAMProviderSpecProvider
- class smarter.apps.provider.manifest.models.provider.spec.SAMProviderSpecProvider(*, name, description=None, base_url=None, api_key=None, connectivity_test_path='', logo=None, website_url=None, contact_email=None, support_email=None, terms_of_service_url=None, docs_url=None, privacy_policy_url=None)[source]
Bases:
SmarterBasePydanticModelSmarter API - generic API Connection class.
- model_config = {'arbitrary_types_allowed': True, 'from_attributes': True, 'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context, /)
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- classmethod validate_api_key(v)[source]
Accept
api_keyunchanged.- Parameters:
v – The name of the Secret that holds the api key.
- Returns:
The value, unchanged.
- classmethod validate_api_url(v)[source]
Require
base_url, when set, to be a valid URL.- Parameters:
v – The API URL, or None.
- Returns:
The value, unchanged.
- Raises:
SAMValidationError – If the value is not a valid URL.
- classmethod validate_connectivity_test_path(v)[source]
Give
connectivity_test_pathleading and trailing slashes, and require a valid URL path.- Parameters:
v – The connectivity test path.
- Returns:
The path, with leading and trailing slashes, or None if it is empty.
- Raises:
SAMValidationError – If the path is not a valid URL path.
- classmethod validate_contact_email(v)[source]
Require
contact_email, when set, to be a valid email address.- Parameters:
v – The email address, or None.
- Returns:
The value, unchanged.
- Raises:
SAMValidationError – If the value is not a valid email address.
- classmethod validate_docs_url(v)[source]
Require
docs_url, when set, to be a valid URL.- Parameters:
v – The documentation URL, or None.
- Returns:
The value, unchanged.
- Raises:
SAMValidationError – If the value is not a valid URL.
- classmethod validate_logo(v)[source]
Require
logo, when set, to be a valid URL.- Parameters:
v – The logo URL, or None.
- Returns:
The value, unchanged.
- Raises:
SAMValidationError – If the value is not a valid URL.
- classmethod validate_name(v)[source]
Strip the Provider name, and require it to be non-empty snake case.
- Parameters:
v – The name.
- Returns:
The stripped name.
- Raises:
SAMValidationError – If the name is empty or not snake case.
- classmethod validate_privacy_policy_url(v)[source]
Require
privacy_policy_url, when set, to be a valid URL.- Parameters:
v – The privacy policy URL, or None.
- Returns:
The value, unchanged.
- Raises:
SAMValidationError – If the value is not a valid URL.
- classmethod validate_support_email(v)[source]
Require
support_email, when set, to be a valid email address.- Parameters:
v – The email address, or None.
- Returns:
The value, unchanged.
- Raises:
SAMValidationError – If the value is not a valid email address.
- classmethod validate_terms_of_service_url(v)[source]
Require
terms_of_service_url, when set, to be a valid URL.- Parameters:
v – The terms of service URL, or None.
- Returns:
The value, unchanged.
- Raises:
SAMValidationError – If the value is not a valid URL.
- classmethod validate_website(v)[source]
Require
website_url, when set, to be a valid URL.- Parameters:
v – The website URL, or None.
- Returns:
The value, unchanged.
- Raises:
SAMValidationError – If the value is not a valid URL.
- smarter.apps.provider.manifest.models.provider.spec.should_log(level)[source]
Check if logging should be done based on the waffle switch.
Smarter API Manifest - Account.status
- class smarter.apps.provider.manifest.models.provider.status.SAMProviderStatus(*, recordLocator, created, modified, dependencies=None, is_active, is_flagged, is_deprecated, is_suspended, is_verified, ownership_requested=None, contact_email_verified=None, support_email_verified=None, tos_accepted_at=None, tos_accepted_by=None, can_activate=True)[source]
Bases:
AbstractSAMStatusBaseSmarter API Provider Manifest - Status class.
- model_config = {'arbitrary_types_allowed': True, 'from_attributes': True, 'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context, /)
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
Smarter API Account Manifest
- class smarter.apps.provider.manifest.models.provider.model.SAMProvider(*, apiVersion, kind, metadata, spec, status=None)[source]
Bases:
AbstractSAMBaseSmarter API Manifest - Account
- metadata: SAMProviderMetadata
- model_config = {'arbitrary_types_allowed': True, 'from_attributes': True, 'frozen': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context, /)
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- spec: SAMProviderSpec
- status: SAMProviderStatus | None