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.

Class variables

var id : uuid.UUID

Identifier for this asset.

var metadata : Dict[str, str]

Metadata for this asset, most importantly the "view_name".

Static methods

def from_dict(kvs: Union[dict, list, str, int, float, bool, ForwardRef(None)], *, infer_missing=False) -> ~A
def from_json(s: Union[str, bytes, bytearray], *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) -> ~A
def 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]

Methods

def to_dict(self, encode_json=False) -> Dict[str, Union[dict, list, str, int, float, bool, ForwardRef(None)]]
def to_json(self, *, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: Union[int, str, ForwardRef(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: Optional[uuid.UUID] = None)

A group of participants in a federation of standardized data views.

Class variables

var federation_members : List[FederationMember]

The members of this federation group.

var id : Optional[uuid.UUID]

The unique identifier for this federation group.

var name : str

Name of the federation group.

Static methods

def create(name: str, members: List[FederationMember], session: Optional[Session] = 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: Optional[str] = None, group_id: Optional[uuid.UUID] = None, session: Optional[Session] = None) -> Optional[FederationGroup]

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: Union[dict, list, str, int, float, bool, ForwardRef(None)], *, infer_missing=False) -> ~A
def from_json(s: Union[str, bytes, bytearray], *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) -> ~A
def 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]

Methods

def to_dict(self, encode_json=False) -> Dict[str, Union[dict, list, str, int, float, bool, ForwardRef(None)]]
def to_json(self, *, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: Union[int, str, ForwardRef(None)] = None, separators: Tuple[str, str] = None, default: Callable = None, sort_keys: bool = False, **kw) -> str
class FederationMember (name: str, display: Optional[str], desc: Optional[str], assets: List[FederationAssetDetails])

A member of a FederationGroup and the assets being provided.

Class variables

var assets : List[FederationAssetDetails]

List of assets that this participant is providing to be federated.

var desc : Optional[str]

Description of the participant.

var display : Optional[str]

Display name of the participant, to be shown in the UI.

var name : str

Name of this participant.

Static methods

def create(name: str, display: str, assets: Mapping[str, Union[Asset, uuid.UUID]], desc: Optional[str] = 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: Union[dict, list, str, int, float, bool, ForwardRef(None)], *, infer_missing=False) -> ~A
def from_json(s: Union[str, bytes, bytearray], *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) -> ~A
def 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]

Methods

def to_dict(self, encode_json=False) -> Dict[str, Union[dict, list, str, int, float, bool, ForwardRef(None)]]
def to_json(self, *, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: Union[int, str, ForwardRef(None)] = None, separators: Tuple[str, str] = None, default: Callable = None, sort_keys: bool = False, **kw) -> str