Resources for Models

Contains useful resources for defining models for any provider using attrs.

class cloudpub.models.common.AttrsJSONDecodeMixin[source]

Implement the default JSON (de)serialization for attrs decorated classes.

classmethod from_json(json)[source]

Convert a JSON dictionary into class object.

Parameters:

json (dict) – A JSON containing a the attrs class keys.

Returns:

The converted object from JSON.

to_json()[source]

Convert a class object mapped by attrs into a dictionary.

Returns:

The JSON from object.

Return type:

dict