Pydantic Models

Smarter API PluginData Sql Connection Manifest Constants

Smarter API Manifest - User.metadata

class smarter.apps.provider.manifest.models.provider.metadata.SAMProviderMetadata(*, name: str, description: str | None, version: str | None, tags: List[str] | None = <factory>, annotations: List[dict[str, str | int | float | bool | ~datetime.date | ~datetime.datetime | ~decimal.Decimal | ~uuid.UUID | bytes | list | dict]] | None=<factory>)[source]

Bases: AbstractSAMMetadataBase

Smarter API Provider Manifest - Metadata class.

class_identifier: ClassVar[str] = 'Provider.metadata'
model_config: ClassVar[ConfigDict] = {'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.

Return type:

None

Parameters:
  • self – The BaseModel instance.

  • context – The context.

Smarter API Manifest - Plugin.spec

class smarter.apps.provider.manifest.models.provider.spec.SAMProviderSpec(*, provider: SAMProviderSpecProvider)[source]

Bases: AbstractSAMSpecBase

Smarter API Api Connection Manifest ApiConnection.spec

class_identifier: ClassVar[str] = 'Provider.spec'
model_config: ClassVar[ConfigDict] = {'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.

Return type:

None

Parameters:
  • self – The BaseModel instance.

  • context – The context.

provider: SAMProviderSpecProvider
class smarter.apps.provider.manifest.models.provider.spec.SAMProviderSpecProvider(*, name: str, description: str | None = None, base_url: str | None = None, api_key: str | None = None, connectivity_test_path: str | None = '', logo: str | None = None, website_url: str | None = None, contact_email: EmailStr | None = None, support_email: EmailStr | None = None, terms_of_service_url: str | None = None, docs_url: str | None = None, privacy_policy_url: str | None = None)[source]

Bases: SmarterBasePydanticModel

Smarter API - generic API Connection class.

api_key: str | None
base_url: str | None
connectivity_test_path: str | None
contact_email: EmailStr | None
description: str | None
docs_url: str | None
model_config: ClassVar[ConfigDict] = {'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.

Return type:

None

Parameters:
  • self – The BaseModel instance.

  • context – The context.

name: str
privacy_policy_url: str | None
support_email: EmailStr | None
terms_of_service_url: str | None
classmethod validate_api_key(v)[source]
classmethod validate_api_url(v)[source]
classmethod validate_connectivity_test_path(v)[source]
classmethod validate_contact_email(v)[source]
classmethod validate_docs_url(v)[source]
classmethod validate_name(v)[source]
classmethod validate_privacy_policy_url(v)[source]
classmethod validate_support_email(v)[source]
classmethod validate_terms_of_service_url(v)[source]
classmethod validate_website(v)[source]
website_url: str | None
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: str, created: datetime, modified: datetime, is_active: bool, is_flagged: bool, is_deprecated: bool, is_suspended: bool, is_verified: bool, ownership_requested: EmailStr | None = None, contact_email_verified: datetime | None = None, support_email_verified: datetime | None = None, tos_accepted_at: datetime | None = None, tos_accepted_by: EmailStr | None = None, can_activate: bool = True)[source]

Bases: AbstractSAMStatusBase

Smarter API Provider Manifest - Status class.

can_activate: bool
class_identifier: ClassVar[str] = 'Provider.status'
contact_email_verified: datetime | None
is_active: bool
is_deprecated: bool
is_flagged: bool
is_suspended: bool
is_verified: bool
model_config: ClassVar[ConfigDict] = {'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.

Return type:

None

Parameters:
  • self – The BaseModel instance.

  • context – The context.

ownership_requested: EmailStr | None
support_email_verified: datetime | None
tos_accepted_at: datetime | None
tos_accepted_by: EmailStr | None

Smarter API Account Manifest

class smarter.apps.provider.manifest.models.provider.model.SAMProvider(*, apiVersion: str, kind: str, metadata: SAMProviderMetadata, spec: SAMProviderSpec, status: SAMProviderStatus | None = None)[source]

Bases: AbstractSAMBase

Smarter API Manifest - Account

class_identifier: ClassVar[str] = 'Provider'
metadata: SAMProviderMetadata
model_config: ClassVar[ConfigDict] = {'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.

Return type:

None

Parameters:
  • self – The BaseModel instance.

  • context – The context.

spec: SAMProviderSpec
status: SAMProviderStatus | None