class documentation

Content Serialization Types

Class Method fromCoAP Return the enum from a string for a content serialization.
Class Method fromWebSocketSubProtocol Return the enum from a string for a content serialization.
Class Method getType Return the enum from a content-type header definition.
Class Method supportedContentSerializations Return a list of supported media types for content serialization.
Class Method supportedContentSerializationsSimple Return a simplified (only the names of the serializations) list of supported media types for content serialization.
Class Method supportedContentSerializationsWS Return a list of supported media types for content serialization for WebSocket communication.
Method __eq__ Compare two ContentSerializationType enums for equality.
Method toHttpContentType Return the http mime header for an enum value.
Method toSimple Return the simple string for an enum value.
Method toWSContentType Return the WebSocket content header for an enum value.
Constant CBOR CBOR.
Constant JSON JSON.
Constant PLAIN Plain text.
Constant UNKNOWN Unknown.
Constant XML XML.

Inherited from ACMEIntEnum:

Class Method has Check whether the enum type has an entry with either the given int value or string name.
Class Method to Return an enum value by its name.
Method __int__ Get the integer value of an enum.
Method __repr__ Stringify an enum.
Method __str__ Stringify an enum.
@classmethod
def fromCoAP(cls, t: int) -> ContentSerializationType:

Return the enum from a string for a content serialization.

Parameters
t:intcontent type number to convert
Returns
ContentSerializationTypeThe enum value.
@classmethod
def fromWebSocketSubProtocol(cls, t: str) -> ContentSerializationType:

Return the enum from a string for a content serialization.

Parameters
t:strString to convert.
Returns
ContentSerializationTypeThe enum value.
@classmethod
def getType(cls, t: str | ContentSerializationType, default: ContentSerializationType | None = None) -> ContentSerializationType:

Return the enum from a content-type header definition.

Parameters
t:str | ContentSerializationTypeString to convert. If it is already an enum, it is returned as is.
default:ContentSerializationType | NoneDefault value to return if the string is not a valid content-type.
Returns
ContentSerializationTypeThe enum value.
@classmethod
def supportedContentSerializations(cls) -> list[str]:

Return a list of supported media types for content serialization.

Returns
list[str]A list of supported media types for content serialization.
@classmethod
def supportedContentSerializationsSimple(cls) -> list[str]:

Return a simplified (only the names of the serializations) list of supported media types for content serialization.

Returns
list[str]A list of supported media types for content serialization.
@classmethod
def supportedContentSerializationsWS(cls) -> Sequence[str]:

Return a list of supported media types for content serialization for WebSocket communication.

Returns
Sequence[str]A list of supported media types for content serialization.
def __eq__(self, other: object) -> bool:

Compare two ContentSerializationType enums for equality.

Parameters
other:objectThe other enum to compare with.
Returns
boolTrue if the enums are equal.
def toHttpContentType(self) -> str:

Return the http mime header for an enum value.

Returns
strThe mime header for an enum value.
def toSimple(self) -> str:

Return the simple string for an enum value.

Returns
strThe simple string for an enum value.
def toWSContentType(self) -> str:

Return the WebSocket content header for an enum value.

Returns
strThe mime header for an enum value.
CBOR =

CBOR.

Value
auto()
JSON =

JSON.

Value
auto()
PLAIN =

Plain text.

Value
auto()
UNKNOWN =

Unknown.

Value
auto()
XML =

XML.

Value
auto()