# cyclonedx.serialization

Set of helper classes for use with `serializable` when conducting (de-)serialization.

## Classes

`BomRefHelper` | DEPRECATED in favour of `BomRef`.
`PackageUrl` | Base Helper.
`UrnUuidHelper` | Base Helper.
`LicenseRepositoryHelper` | DEPRECATED

## Package Contents

class cyclonedx.serialization.BomRefHelper

  Bases: `py_serializable.helpers.BaseHelper`

  DEPRECATED in favour of `BomRef`.

  Deprecated since version 8.6: Use `BomRef` instead.

  classmethod serialize(o: Any) → str | None

    general purpose serializer

  classmethod deserialize(o: Any) → cyclonedx.model.bom_ref.BomRef

    general purpose deserializer

  classmethod json_normalize(o: Any, *, view: Type[py_serializable.ViewType] | None, prop_info: py_serializable.ObjectMetadataLibrary.SerializableProperty, ctx: Type[Any], **kwargs: Any) → Any | None

    json specific normalizer

  classmethod json_serialize(o: Any) → str | Any

    json specific serializer

  classmethod json_denormalize(o: Any, *, prop_info: py_serializable.ObjectMetadataLibrary.SerializableProperty, ctx: Type[Any], **kwargs: Any) → Any

    json specific denormalizer

    Parameters:

      - tCls – the class that was desired to denormalize to

      - pCls – tha prent class - as context

  classmethod json_deserialize(o: Any) → Any

    json specific deserializer

  classmethod xml_normalize(o: Any, *, element_name: str, view: Type[py_serializable.ViewType] | None, xmlns: str | None, prop_info: py_serializable.ObjectMetadataLibrary.SerializableProperty, ctx: Type[Any], **kwargs: Any) → xml.etree.ElementTree.Element | Any | None

    xml specific normalizer

  classmethod xml_serialize(o: Any) → str | Any

    xml specific serializer

  classmethod xml_denormalize(o: xml.etree.ElementTree.Element, *, default_ns: str | None, prop_info: py_serializable.ObjectMetadataLibrary.SerializableProperty, ctx: Type[Any], **kwargs: Any) → Any

    xml specific denormalizer

  classmethod xml_deserialize(o: str | Any) → Any

    xml specific deserializer

class cyclonedx.serialization.PackageUrl

  Bases: `py_serializable.helpers.BaseHelper`

  Base Helper.

  Inherit from this class and implement/override the needed functions!

  This class does not provide any functionality, it is more like a Protocol with some fallback implementations.

  classmethod serialize(o: Any) → str

    general purpose serializer

  classmethod deserialize(o: Any) → packageurl.PackageURL

    general purpose deserializer

  classmethod json_normalize(o: Any, *, view: Type[py_serializable.ViewType] | None, prop_info: py_serializable.ObjectMetadataLibrary.SerializableProperty, ctx: Type[Any], **kwargs: Any) → Any | None

    json specific normalizer

  classmethod json_serialize(o: Any) → str | Any

    json specific serializer

  classmethod json_denormalize(o: Any, *, prop_info: py_serializable.ObjectMetadataLibrary.SerializableProperty, ctx: Type[Any], **kwargs: Any) → Any

    json specific denormalizer

    Parameters:

      - tCls – the class that was desired to denormalize to

      - pCls – tha prent class - as context

  classmethod json_deserialize(o: Any) → Any

    json specific deserializer

  classmethod xml_normalize(o: Any, *, element_name: str, view: Type[py_serializable.ViewType] | None, xmlns: str | None, prop_info: py_serializable.ObjectMetadataLibrary.SerializableProperty, ctx: Type[Any], **kwargs: Any) → xml.etree.ElementTree.Element | Any | None

    xml specific normalizer

  classmethod xml_serialize(o: Any) → str | Any

    xml specific serializer

  classmethod xml_denormalize(o: xml.etree.ElementTree.Element, *, default_ns: str | None, prop_info: py_serializable.ObjectMetadataLibrary.SerializableProperty, ctx: Type[Any], **kwargs: Any) → Any

    xml specific denormalizer

  classmethod xml_deserialize(o: str | Any) → Any

    xml specific deserializer

class cyclonedx.serialization.UrnUuidHelper

  Bases: `py_serializable.helpers.BaseHelper`

  Base Helper.

  Inherit from this class and implement/override the needed functions!

  This class does not provide any functionality, it is more like a Protocol with some fallback implementations.

  classmethod serialize(o: Any) → str

    general purpose serializer

  classmethod deserialize(o: Any) → uuid.UUID

    general purpose deserializer

  classmethod json_normalize(o: Any, *, view: Type[py_serializable.ViewType] | None, prop_info: py_serializable.ObjectMetadataLibrary.SerializableProperty, ctx: Type[Any], **kwargs: Any) → Any | None

    json specific normalizer

  classmethod json_serialize(o: Any) → str | Any

    json specific serializer

  classmethod json_denormalize(o: Any, *, prop_info: py_serializable.ObjectMetadataLibrary.SerializableProperty, ctx: Type[Any], **kwargs: Any) → Any

    json specific denormalizer

    Parameters:

      - tCls – the class that was desired to denormalize to

      - pCls – tha prent class - as context

  classmethod json_deserialize(o: Any) → Any

    json specific deserializer

  classmethod xml_normalize(o: Any, *, element_name: str, view: Type[py_serializable.ViewType] | None, xmlns: str | None, prop_info: py_serializable.ObjectMetadataLibrary.SerializableProperty, ctx: Type[Any], **kwargs: Any) → xml.etree.ElementTree.Element | Any | None

    xml specific normalizer

  classmethod xml_serialize(o: Any) → str | Any

    xml specific serializer

  classmethod xml_denormalize(o: xml.etree.ElementTree.Element, *, default_ns: str | None, prop_info: py_serializable.ObjectMetadataLibrary.SerializableProperty, ctx: Type[Any], **kwargs: Any) → Any

    xml specific denormalizer

  classmethod xml_deserialize(o: str | Any) → Any

    xml specific deserializer

class cyclonedx.serialization.LicenseRepositoryHelper

  Bases: `cyclonedx.model.license._LicenseRepositorySerializationHelper`

  DEPRECATED

  Deprecated since version 8.6: No public API planned for replacing this,

  classmethod json_normalize(o: LicenseRepository, *, view: type[py_serializable.ViewType] | None, **__: Any) → Any

    json specific normalizer

  classmethod json_denormalize(o: list[dict[str, Any]], **__: Any) → LicenseRepository

    json specific denormalizer

    Parameters:

      - tCls – the class that was desired to denormalize to

      - pCls – tha prent class - as context

  classmethod xml_normalize(o: LicenseRepository, *, element_name: str, view: type[py_serializable.ViewType] | None, xmlns: str | None, **__: Any) → xml.etree.ElementTree.Element | None

    xml specific normalizer

  classmethod xml_denormalize(o: xml.etree.ElementTree.Element, default_ns: str | None, **__: Any) → LicenseRepository

    xml specific denormalizer

  classmethod serialize(o: Any) → Any | str
    Abstractmethod:

    general purpose serializer

  classmethod deserialize(o: Any) → Any
    Abstractmethod:

    general purpose deserializer

  classmethod json_serialize(o: Any) → str | Any

    json specific serializer

  classmethod json_deserialize(o: Any) → Any

    json specific deserializer

  classmethod xml_serialize(o: Any) → str | Any

    xml specific serializer

  classmethod xml_deserialize(o: str | Any) → Any

    xml specific deserializer