API Connection Model
Smarter API Connection Manifest Constants.
Smarter API Manifest - ApiConnection.spec.
- class smarter.apps.connection.manifest.models.api_connection.spec.ApiConnection(*, baseUrl, apiKey=None, authMethod='none', timeout=30, proxyProtocol=None, proxyHost=None, proxyPort=None, proxyUsername=None, proxyPassword=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
apiKeyas is: it is the name of a Secret, not the key itself.- Parameters:
v – The name of the Secret that holds the api key.
- Returns:
The value, unchanged.
- classmethod validate_auth_method(v)[source]
Validate that
authMethodis one of the supported authentication methods.- Parameters:
v – The authentication method.
- Returns:
The authentication method, unchanged.
- Raises:
SAMValidationError – if it is not in
AuthMethods.all().
- classmethod validate_proxy_host(v)[source]
Validate that
proxyHost, when set, is a valid domain.- Parameters:
v – The proxy host, or None.
- Returns:
The proxy host, unchanged.
- Raises:
SAMValidationError – if it is not a valid domain.
- classmethod validate_proxy_password(v)[source]
Accept
proxyPasswordas is: it is the name of a Secret, not the password itself.- Parameters:
v – The name of the Secret that holds the proxy password, or None.
- Returns:
The value, unchanged.
- classmethod validate_proxy_port(v)[source]
Validate that
proxyPort, when set, is between 1 and 65535.- Parameters:
v – The proxy port, or None.
- Returns:
The proxy port, unchanged.
- Raises:
SAMValidationError – if it is out of range.
- classmethod validate_proxy_protocol(v)[source]
Validate that
proxyProtocol, when set, ishttporhttps.- Parameters:
v – The proxy protocol, or None.
- Returns:
The proxy protocol, unchanged.
- Raises:
SAMValidationError – if it is set to any other value.
- classmethod validate_proxy_username(v)[source]
Validate that
proxyUsername, when set, contains no illegal characters.- Parameters:
v – The proxy username, or None.
- Returns:
The proxy username, unchanged.
- Raises:
SAMValidationError – if it is not a clean string.
- classmethod validate_root_domain(v)[source]
Validate that
baseUrlis a valid http or https url.- Parameters:
v – The base url.
- Returns:
The base url, unchanged.
- Raises:
SAMValidationError – if the url is not valid.
- classmethod validate_timeout(v)[source]
Validate that
timeoutis at least 1.- Parameters:
v – The timeout.
- Returns:
The timeout, unchanged.
- Raises:
SAMValidationError – if it is less than 1.
- class smarter.apps.connection.manifest.models.api_connection.spec.SAMApiConnectionSpec(*, connection)[source]
Bases:
AbstractSAMSpecBaseSmarter API Api Connection Manifest ApiConnection.spec.
- connection: ApiConnection
- 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 Connection Manifest
- class smarter.apps.connection.manifest.models.api_connection.model.SAMApiConnection(*, apiVersion, kind, metadata, spec, status=None)[source]
Bases:
SAMConnectionCommonSmarter API Connection Manifest - ApiConnection Model
- 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: SAMApiConnectionSpec