User

Smarter API User Manifest Constants.

Smarter API Manifest - User.metadata

class smarter.apps.account.manifest.models.user.metadata.SAMUserMetadata(*, name, description, version, tags=<factory>, annotations=<factory>, username)[source]

Bases: AbstractSAMMetadataBase

Smarter API User Manifest - Metadata class.

class_identifier: ClassVar[str] = 'User.metadata'
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.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

Return type:

None

username: str

Smarter API Manifest - User.spec.

class smarter.apps.account.manifest.models.user.spec.SAMUserAccountMembership(*, accountNumber, isAccountAdmin=False)[source]

Bases: AbstractSAMSpecBase

Smarter API User Manifest User.spec.accounts[]: the user’s membership of one account.

accountNumber: str
class_identifier: ClassVar[str] = 'User.spec.accounts'
isAccountAdmin: bool
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.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

Return type:

None

classmethod validate_account_number(v)[source]

Check that the account number has the form 1234-5678-9012.

Parameters:

v – The account number.

Returns:

The account number.

Raises:

SmarterValueError – when it is not an account number.

class smarter.apps.account.manifest.models.user.spec.SAMUserSpec(*, config, accounts=None)[source]

Bases: AbstractSAMSpecBase

Smarter API User Manifest User.spec.

accounts: list[SAMUserAccountMembership] | None
class_identifier: ClassVar[str] = 'User.spec'
config: SAMUserSpecConfig
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.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

Return type:

None

classmethod validate_accounts(v)[source]

Check that no account is listed twice.

Parameters:

v – The memberships, or None.

Returns:

The memberships, or None.

Raises:

SmarterValueError – when an account is listed more than once.

class smarter.apps.account.manifest.models.user.spec.SAMUserSpecConfig(*, firstName=None, lastName=None, email, isStaff=False, isActive, passwordSecret=None)[source]

Bases: AbstractSAMSpecBase

Smarter API User Manifest User.spec.config.

class_identifier: ClassVar[str] = 'User.spec.configuration'
email: str
firstName: str | None
isActive: bool
isStaff: bool | None
lastName: str | None
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.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

Return type:

None

passwordSecret: str | None

Smarter API Manifest - User.status

class smarter.apps.account.manifest.models.user.status.SAMUserStatus(*, recordLocator, created, modified, dependencies=None, account_number, username)[source]

Bases: AbstractSAMStatusBase

Smarter API User Manifest - Status class.

account_number: str
class_identifier: ClassVar[str] = 'User.status'
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.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

Return type:

None

username: str

Smarter API User Manifest

class smarter.apps.account.manifest.models.user.model.SAMUser(*, apiVersion, kind, metadata, spec, status=None)[source]

Bases: AbstractSAMBase

Smarter API Manifest - User

class_identifier: ClassVar[str] = 'User'
metadata: SAMUserMetadata
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.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.

Return type:

None

spec: SAMUserSpec
status: SAMUserStatus | None