otupy.profiles.xbom.data.link.Link
- class Link(link: object = None, name: ~otupy.profiles.xbom.data.name.Name = None, sid: ~otupy.profiles.xbom.data.service.SId = None, description: str = None, link_type: ~otupy.profiles.xbom.data.link_type.LinkType = None, role: ~otupy.profiles.xbom.data.peer_role.PeerRole = None, peers: ~otupy.types.base.array_of.ArrayOf.__new__.<locals>.ArrayOf = None)
Bases:
RecordA Link is a relationship between Services. A relationship is made between a subject (the
name) and one or more objects (thepeers).The Link class contains all Peers of a given LinkType for the given service Name. Implementations might instantiate multiple Links for different Peers of the same LinkType or provide all Peers in the same instance.
Methods
Convert Link to CycloneDX properties format.
Builds instance from dictionary
Converts to dictionary
validate_fieldsAttributes
Generic description of the relationship
Type of the link
Id of the link
Services connected on the link
Role of service in the link relationship
Service ID of the owner of this link
- __init__(link: object = None, name: ~otupy.profiles.xbom.data.name.Name = None, sid: ~otupy.profiles.xbom.data.service.SId = None, description: str = None, link_type: ~otupy.profiles.xbom.data.link_type.LinkType = None, role: ~otupy.profiles.xbom.data.peer_role.PeerRole = None, peers: ~otupy.types.base.array_of.ArrayOf.__new__.<locals>.ArrayOf = None)
- as_cyclonedx(link_id: str | None = None) List[Property]
Convert Link to CycloneDX properties format.
- Args:
link_id: The unique identifier for this link. If None, a UUID will be generated.
- Returns:
List[Property]: List of CycloneDX Property objects.
- classmethod fromdict(dic, e)
Builds instance from dictionary
It is used during deserialization to create an otupy instance from the text message. It takes an
Encoderinstance that is used to recursively build instances of the inner objects (theEncoderprovides standard methods to create instances of base objects like strings, integers, boolean).- Parameters:
dic – The intermediary dictionary representation from which the object is built.
e – The
Encoderthat is being used.
- Returns:
An instance of this class initialized from the dictionary values.
- peers: ArrayOf = None
Services connected on the link
- todict(e)
Converts to dictionary
It is used to convert this object to an intermediary representation during serialization. It takes an
Encoderargument that is used to recursively serialize inner data and structures (the Encoder provides standard methods for converting base types to dictionaries)..- Parameters:
e – The
Encoderthat is being used.- Returns:
A dictionary compliants to the Language Specification’s serialization rules.