class documentation

class Service:

View In Hierarchy

Base class for service classes.

Method __getattribute__ Override __getattribute__ to allow access to service endpoints by their endpoint name instead of the method name.
Method __init_subclass__ Initialize the service sub class, creating the service endpoint map by checking the methods marked by the @endpoint decorator.
Class Variable _pm_endpointMap Mapping of endpoint names to method names
Class Variable _service_metadata_ A dictionary to store any metadata of the service that can be used by the plugins. The metadata are not used by the service itself, but can be used to store any information that is relevant to the service...
def __getattribute__(self, name: str) -> Any:

Override __getattribute__ to allow access to service endpoints by their endpoint name instead of the method name.

Parameters
name:strThe name of the attribute to access. This can be either the real method name or the endpoint name defined by the @endpoint decorator.
Returns
AnyThe attribute value. If the name is an endpoint name, the corresponding method is returned.
def __init_subclass__(cls, **kwargs: Any):

Initialize the service sub class, creating the service endpoint map by checking the methods marked by the @endpoint decorator.

_pm_endpointMap: dict[str, str] =

Mapping of endpoint names to method names

_service_metadata_: dict[str, Any] =

A dictionary to store any metadata of the service that can be used by the plugins. The metadata are not used by the service itself, but can be used to store any information that is relevant to the service. They are passed in the result of the service endpoint calls, so that callers can use them to determine how to handle the endpoint calls.