Module tripleblind.federation_group
Classes
class FederationAssetDetails (id: uuid.UUID, metadata: Dict[str, str])-
A single standard view asset that a federation member is providing.
Static methods
def from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) -> ~Adef from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) -> ~Adef schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) -> dataclasses_json.mm.SchemaF[~A]
Instance variables
var id : uuid.UUID-
Identifier for this asset.
var metadata : Dict[str, str]-
Metadata for this asset, most importantly the "view_name".
Methods
def to_dict(self, encode_json=False) -> Dict[str, dict | list | str | int | float | bool | None]def to_json(self, *, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] = None, default: Callable = None, sort_keys: bool = False, **kw) -> str
class FederationGroup (name: str, federation_members: List[FederationMember], id: uuid.UUID | None = None)-
A group of participants in a federation of standardized data views.
Static methods
def create(name: str, members: List[FederationMember], session: Session | None = None, allow_overwrite: bool = True) -> FederationGroup-
Create or update a federation group.
Args
name:str- A unique group name.
members:List[FederationMember]- A list of federation participants and the assets they are providing.
session:Session, optional- A connection session. If not specified the default session is used.
allow_overwrite:bool, optional- Whether to allow an existing group to be updated. If set to False and a group with the same name already exists, an exception will be thrown. Defaults to True.
Raises
ValueError- Federation group must have at least one member.
ValueError- All members must have the same number of assets.
ValueError- Federation Group {name} already exists.
ValueError- Failed to update federation group: {status_code}
Returns
FederationGroup- The new or updated federation group.
def find(name: str | None = None, group_id: uuid.UUID | None = None, session: Session | None = None) -> FederationGroup | None-
Find a federation group by name or ID.
Args
name:str- The group's name.
group_id:UUID- The group's unique identifier.
session:Session, optional- A connection session. If not specified the default session is used.
Returns
FederationGroup- The found group or None if not found.
def from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) -> ~Adef from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) -> ~Adef schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) -> dataclasses_json.mm.SchemaF[~A]
Instance variables
var federation_members : List[FederationMember]-
The members of this federation group.
var id : uuid.UUID | None-
The unique identifier for this federation group.
var name : str-
Name of the federation group.
Methods
def to_dict(self, encode_json=False) -> Dict[str, dict | list | str | int | float | bool | None]def to_json(self, *, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] = None, default: Callable = None, sort_keys: bool = False, **kw) -> str
class FederationMember (name: str, display: str | None, desc: str | None, assets: List[FederationAssetDetails])-
A member of a FederationGroup and the assets being provided.
Static methods
def create(name: str, display: str, assets: Mapping[str, Asset | uuid.UUID], desc: str | None = None) -> FederationMember-
Create a member of a FederationGroup.
Args
name:str- Name of this participant in the federation group.
display:str- Display name of the participant, to be shown in the UI.
assets:Mapping[str, Asset]- Dictionary of standard view names to assets. Assets must all belong to the same team.
desc:str, optional- Description of the participant.
Raises
ValueError- If assets is empty or if assets do not belong to the same team.
Returns
FederationMember- FederationMember object.
def from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) -> ~Adef from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) -> ~Adef schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) -> dataclasses_json.mm.SchemaF[~A]
Instance variables
var assets : List[FederationAssetDetails]-
List of assets that this participant is providing to be federated.
var desc : str | None-
Description of the participant.
var display : str | None-
Display name of the participant, to be shown in the UI.
var name : str-
Name of this participant.
Methods
def to_dict(self, encode_json=False) -> Dict[str, dict | list | str | int | float | bool | None]def to_json(self, *, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: int | str | None = None, separators: Tuple[str, str] = None, default: Callable = None, sort_keys: bool = False, **kw) -> str