cyclonedx.model.definition
==========================

.. py:module:: cyclonedx.model.definition


Classes
-------

.. autoapisummary::

   cyclonedx.model.definition.CreId
   cyclonedx.model.definition.Requirement
   cyclonedx.model.definition.Level
   cyclonedx.model.definition.Standard
   cyclonedx.model.definition.Definitions


Module Contents
---------------

.. py:class:: CreId(id: str)

   Bases: :py:obj:`py_serializable.helpers.BaseHelper`


   Helper class that allows us to perform validation on data strings that must conform to
   Common Requirements Enumeration (CRE) identifier(s).



   .. py:property:: id
      :type: str



   .. py:method:: serialize(o: Any) -> str
      :classmethod:


      general purpose serializer



   .. py:method:: deserialize(o: Any) -> _T_CreId
      :classmethod:


      general purpose deserializer



   .. py:method:: json_normalize(o: Any, *, view: Optional[Type[py_serializable.ViewType]], prop_info: py_serializable.ObjectMetadataLibrary.SerializableProperty, ctx: Type[Any], **kwargs: Any) -> Optional[Any]
      :classmethod:


      json specific normalizer



   .. py:method:: json_serialize(o: Any) -> Union[str, Any]
      :classmethod:


      json specific serializer



   .. py:method:: json_denormalize(o: Any, *, prop_info: py_serializable.ObjectMetadataLibrary.SerializableProperty, ctx: Type[Any], **kwargs: Any) -> Any
      :classmethod:


      json specific denormalizer

      :param tCls: the class that was desired to denormalize to
      :param pCls: tha prent class - as context



   .. py:method:: json_deserialize(o: Any) -> Any
      :classmethod:


      json specific deserializer



   .. py:method:: xml_normalize(o: Any, *, element_name: str, view: Optional[Type[py_serializable.ViewType]], xmlns: Optional[str], prop_info: py_serializable.ObjectMetadataLibrary.SerializableProperty, ctx: Type[Any], **kwargs: Any) -> Optional[Union[xml.etree.ElementTree.Element, Any]]
      :classmethod:


      xml specific normalizer



   .. py:method:: xml_serialize(o: Any) -> Union[str, Any]
      :classmethod:


      xml specific serializer



   .. py:method:: xml_denormalize(o: xml.etree.ElementTree.Element, *, default_ns: Optional[str], prop_info: py_serializable.ObjectMetadataLibrary.SerializableProperty, ctx: Type[Any], **kwargs: Any) -> Any
      :classmethod:


      xml specific denormalizer



   .. py:method:: xml_deserialize(o: Union[str, Any]) -> Any
      :classmethod:


      xml specific deserializer



.. py:class:: Requirement(*, bom_ref: Optional[Union[str, cyclonedx.model.bom_ref.BomRef]] = None, identifier: Optional[str] = None, title: Optional[str] = None, text: Optional[str] = None, descriptions: Optional[collections.abc.Iterable[str]] = None, open_cre: Optional[collections.abc.Iterable[CreId]] = None, parent: Optional[Union[str, cyclonedx.model.bom_ref.BomRef]] = None, properties: Optional[collections.abc.Iterable[cyclonedx.model.Property]] = None, external_references: Optional[collections.abc.Iterable[cyclonedx.model.ExternalReference]] = None)

   A requirement comprising a standard.

   .. note::
       See the CycloneDX Schema for hashType:
       https://cyclonedx.org/docs/1.7/json/#definitions_standards_items_requirements


   .. py:property:: identifier
      :type: Optional[str]


      Returns:
          The identifier of the requirement.



   .. py:property:: title
      :type: Optional[str]


      Returns:
          The title of the requirement.



   .. py:property:: text
      :type: Optional[str]


      Returns:
          The text of the requirement.



   .. py:property:: descriptions
      :type: SortedSet[str]


      Returns:
          A SortedSet of descriptions of the requirement.



   .. py:property:: open_cre
      :type: SortedSet[CreId]


      CRE is a structured and standardized framework for uniting security standards and guidelines. CRE links each
      section of a resource to a shared topic identifier (a Common Requirement). Through this shared topic link, all
      resources map to each other. Use of CRE promotes clear and unambiguous communication among stakeholders.

      Returns:
          The Common Requirements Enumeration (CRE) identifier(s).
          CREs must match regular expression: ^CRE:[0-9]+-[0-9]+$



   .. py:property:: parent
      :type: Optional[cyclonedx.model.bom_ref.BomRef]


      Returns:
          The optional bom-ref to a parent requirement. This establishes a hierarchy of requirements. Top-level
          requirements must not define a parent. Only child requirements should define parents.



   .. py:property:: properties
      :type: SortedSet[Property]


      Provides the ability to document properties in a key/value store. This provides flexibility to include data not
      officially supported in the standard without having to use additional namespaces or create extensions.

      Return:
          Set of `Property`



   .. py:property:: external_references
      :type: SortedSet[ExternalReference]


      Provides the ability to document external references related to the component or to the project the component
      describes.

      Returns:
          Set of `ExternalReference`



   .. py:property:: bom_ref
      :type: cyclonedx.model.bom_ref.BomRef


      An optional identifier which can be used to reference the requirement elsewhere in the BOM.
      Every bom-ref MUST be unique within the BOM.

      Returns:
          `BomRef`



.. py:class:: Level(*, bom_ref: Optional[Union[str, cyclonedx.model.bom_ref.BomRef]] = None, identifier: Optional[str] = None, title: Optional[str] = None, description: Optional[str] = None, requirements: Optional[collections.abc.Iterable[Union[str, cyclonedx.model.bom_ref.BomRef]]] = None)

   Level of compliance for a standard.

   .. note::
       See the CycloneDX Schema for hashType: https://cyclonedx.org/docs/1.7/json/#definitions_standards_items_levels


   .. py:property:: identifier
      :type: Optional[str]


      Returns:
          The identifier of the level.



   .. py:property:: title
      :type: Optional[str]


      Returns:
          The title of the level.



   .. py:property:: description
      :type: Optional[str]


      Returns:
          The description of the level.



   .. py:property:: requirements
      :type: SortedSet[BomRef]


      Returns:
          A SortedSet of requirements associated with the level.



   .. py:property:: bom_ref
      :type: cyclonedx.model.bom_ref.BomRef


      An optional identifier which can be used to reference the level elsewhere in the BOM.
      Every bom-ref MUST be unique within the BOM.

      Returns:
          `BomRef`



.. py:class:: Standard(*, bom_ref: Optional[Union[str, cyclonedx.model.bom_ref.BomRef]] = None, name: Optional[str] = None, version: Optional[str] = None, description: Optional[str] = None, owner: Optional[str] = None, requirements: Optional[collections.abc.Iterable[Requirement]] = None, levels: Optional[collections.abc.Iterable[Level]] = None, external_references: Optional[collections.abc.Iterable[cyclonedx.model.ExternalReference]] = None)

   A standard of regulations, industry or organizational-specific standards, maturity models, best practices,
   or any other requirements.

   .. note::
       See the CycloneDX Schema for hashType: https://cyclonedx.org/docs/1.7/xml/#type_standard


   .. py:property:: name
      :type: Optional[str]


      Returns:
          The name of the standard



   .. py:property:: version
      :type: Optional[str]


      Returns:
          The version of the standard



   .. py:property:: description
      :type: Optional[str]


      Returns:
          The description of the standard



   .. py:property:: owner
      :type: Optional[str]


      Returns:
          The owner of the standard, often the entity responsible for its release.



   .. py:property:: requirements
      :type: SortedSet[Requirement]


      Returns:
          A SortedSet of requirements comprising the standard.



   .. py:property:: levels
      :type: SortedSet[Level]


      Returns:
          A SortedSet of levels associated with the standard. Some standards have different levels of compliance.



   .. py:property:: external_references
      :type: SortedSet[ExternalReference]


      Returns:
          A SortedSet of external references associated with the standard.



   .. py:property:: bom_ref
      :type: cyclonedx.model.bom_ref.BomRef


      An optional identifier which can be used to reference the standard elsewhere in the BOM. Every bom-ref MUST be
      unique within the BOM.

      Returns:
          `BomRef`



.. py:class:: Definitions(*, standards: Optional[collections.abc.Iterable[Standard]] = None)

   The repository for definitions

   .. note::
       See the CycloneDX Schema for hashType: https://cyclonedx.org/docs/1.7/xml/#type_definitionsType


   .. py:property:: standards
      :type: SortedSet[Standard]


      Returns:
          A SortedSet of Standards



