services#

Services for the teams domain.

class app.domain.teams.services.TeamInvitationService(session: AsyncSession | async_scoped_session[AsyncSession], statement: Select[tuple[ModelT]] | StatementLambdaElement | None = None, auto_expunge: bool = False, auto_refresh: bool = True, auto_commit: bool = False, order_by: list[OrderingPair] | OrderingPair | None = None, error_messages: ErrorMessages | None | EmptyType = <class 'advanced_alchemy.utils.dataclass.Empty'>, load: LoadSpec | None = None, execution_options: dict[str, Any] | None = None, **repo_kwargs: Any)[source]#

Bases: SQLAlchemyAsyncRepositoryService[TeamInvitation]

Team Invitation Service.

Configure the service object.

Parameters:
  • session – Session managing the unit-of-work for the operation.

  • statement – To facilitate customization of the underlying select query.

  • auto_expunge – Remove object from session before returning.

  • auto_refresh – Refresh object from session before returning.

  • auto_commit – Commit objects before returning.

  • order_by – Set default order options for queries.

  • error_messages – A set of custom error messages to use for operations

  • load – Set default relationships to be loaded

  • execution_options – Set default execution options

  • **repo_kwargs – passed as keyword args to repo instantiation.

repository_type#

alias of TeamInvitationRepository

class app.domain.teams.services.TeamMemberService(session: AsyncSession | async_scoped_session[AsyncSession], statement: Select[tuple[ModelT]] | StatementLambdaElement | None = None, auto_expunge: bool = False, auto_refresh: bool = True, auto_commit: bool = False, order_by: list[OrderingPair] | OrderingPair | None = None, error_messages: ErrorMessages | None | EmptyType = <class 'advanced_alchemy.utils.dataclass.Empty'>, load: LoadSpec | None = None, execution_options: dict[str, Any] | None = None, **repo_kwargs: Any)[source]#

Bases: SQLAlchemyAsyncRepositoryService[TeamMember]

Team Member Service.

Configure the service object.

Parameters:
  • session – Session managing the unit-of-work for the operation.

  • statement – To facilitate customization of the underlying select query.

  • auto_expunge – Remove object from session before returning.

  • auto_refresh – Refresh object from session before returning.

  • auto_commit – Commit objects before returning.

  • order_by – Set default order options for queries.

  • error_messages – A set of custom error messages to use for operations

  • load – Set default relationships to be loaded

  • execution_options – Set default execution options

  • **repo_kwargs – passed as keyword args to repo instantiation.

repository_type#

alias of TeamMemberRepository

class app.domain.teams.services.TeamService(**repo_kwargs: Any)[source]#

Bases: SQLAlchemyAsyncRepositoryService[Team]

Team Service.

Configure the service object.

Parameters:
  • session – Session managing the unit-of-work for the operation.

  • statement – To facilitate customization of the underlying select query.

  • auto_expunge – Remove object from session before returning.

  • auto_refresh – Refresh object from session before returning.

  • auto_commit – Commit objects before returning.

  • order_by – Set default order options for queries.

  • error_messages – A set of custom error messages to use for operations

  • load – Set default relationships to be loaded

  • execution_options – Set default execution options

  • **repo_kwargs – passed as keyword args to repo instantiation.

repository_type#

alias of TeamRepository

__init__(**repo_kwargs: Any) None[source]#

Configure the service object.

Parameters:
  • session – Session managing the unit-of-work for the operation.

  • statement – To facilitate customization of the underlying select query.

  • auto_expunge – Remove object from session before returning.

  • auto_refresh – Refresh object from session before returning.

  • auto_commit – Commit objects before returning.

  • order_by – Set default order options for queries.

  • error_messages – A set of custom error messages to use for operations

  • load – Set default relationships to be loaded

  • execution_options – Set default execution options

  • **repo_kwargs – passed as keyword args to repo instantiation.

async create(data: ModelDictT[Team], *, auto_commit: bool | None = None, auto_expunge: bool | None = None, auto_refresh: bool | None = None, error_messages: ErrorMessages | None | EmptyType = <class 'advanced_alchemy.utils.dataclass.Empty'>) Team[source]#

Create a new team with an owner.

async update(data: ModelDictT[Team], item_id: Any | None = None, *, id_attribute: str | InstrumentedAttribute[Any] | None = None, attribute_names: Iterable[str] | None = None, with_for_update: bool | None = None, auto_commit: bool | None = None, auto_expunge: bool | None = None, auto_refresh: bool | None = None, error_messages: ErrorMessages | None | EmptyType = <class 'advanced_alchemy.utils.dataclass.Empty'>, load: LoadSpec | None = None, execution_options: dict[str, Any] | None = None) Team[source]#

Wrap repository update operation.

Returns:

Updated representation.

async to_model(data: ModelDictT[Team], operation: str | None = None) Team[source]#

Parse and Convert input into a model.

Parameters:
  • data – Representations to be created.

  • operation – Optional operation flag so that you can provide behavior based on CRUD operation

Returns:

Representation of created instances.