Module Expr Str Import alias ImportFrom alias alias ClassDef bases NameLoad body Pass decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore NameLoad Assign NameStore Dict Assign NameStore ListLoad Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr For NameStore NameLoad body If BoolOpAnd CompareNotEq NameLoad Str UnaryOpNot Call AttributeLoad NameLoad attr Str UnaryOpNot Call NameLoad NameLoad NameLoad body Expr Call NameLoad NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Dict For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad If UnaryOpNot AttributeLoad NameLoad attr body For NameStore AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Return Call NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore ListComp NameLoad comprehension NameStore NameLoad CompareNotIn NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr ListComp NameLoad comprehension NameStore AttributeLoad NameLoad attr CompareNotIn NameLoad AttributeLoad NameLoad attr Assign NameStore Str If BoolOpAnd AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad Str attr keyword NameLoad keyword AttributeLoad NameLoad attr If NameLoad body Assign NameStore Call AttributeLoad Str attr keyword NameLoad keyword NameLoad If NameLoad body Raise Call NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore BoolOpOr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad NameLoad attr NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str For NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call NameLoad NameLoad NameLoad If NameLoad body Return IfExp Call NameLoad NameLoad Str Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore NameLoad Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareGt Call NameLoad NameLoad Num body Assign NameStore ListComp NameLoad comprehension NameStore Call AttributeLoad NameLoad attr CompareNotEq NameLoad AttributeLoad NameLoad attr Raise Call NameLoad Call AttributeLoad Str attr NameLoad orelse If CompareLt Call NameLoad NameLoad Num body Raise Call NameLoad Call AttributeLoad Str attr AttributeLoad NameLoad attr decorator_list NameLoad decorator_list
N/A N/A 
Copyright 2015 Rackspace

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
 N/A json cafe.engine.models.base AutoMarshallingModel AutoMarshallingListModel DeserializationError N/A Exception N/A N/A N/A EventBaseModel N/A AutoMarshallingModel N/A N/A Base class for Event models

    This class provides default implementations for common
    model functionality. Child classes will need to
    override the kwarg_map and possibly the obj_model_key
    attributes. Additionally, models with submodels will
    need to override the _dict_to_obj method.

    Example:

        {
            "foo": {
                "key1": "value1",
                "key2": "value2",
                "id": "id_value"
            }
        }

        obj_model_key = 'foo'
        kwarg_map = {'key1': 'key1', 'key2': 'key2', 'id_': 'id'}

        (This mapping will generate: self.key1, self.key2, self.id_)
     N/A obj_model_key None N/A kwarg_map N/A N/A optional_kwargs N/A N/A strict_checking True __init__ N/A N/A self kwargs N/A N/A N/A N/A N/A N/A super EventBaseModel self __init__ N/A var kwargs N/A N/A N/A N/A var self N/A N/A N/A var startswith _ N/A N/A hasattr self var N/A N/A N/A setattr self var N/A N/A kwargs get var N/A _map_values_to_kwargs N/A N/A cls deserialized_obj N/A N/A N/A Map input dict to class attributes N/A N/A N/A cls _validate_attributes deserialized_obj N/A kwargs N/A N/A N/A local_kw deserialized_obj_kw N/A N/A N/A cls kwarg_map iteritems N/A N/A N/A kwargs N/A local_kw N/A N/A deserialized_obj get deserialized_obj_kw None N/A N/A N/A cls strict_checking N/A N/A key N/A cls _extra_args N/A N/A N/A kwargs N/A key N/A deserialized_obj N/A key N/A N/A cls kwargs N/A classmethod _validate_attributes N/A N/A cls deserialized_obj N/A N/A N/A Validate expected deserialization N/A expected N/A set N/A N/A N/A cls kwarg_map values N/A actual N/A set N/A N/A deserialized_obj keys N/A missing_args N/A list N/A N/A expected difference actual N/A N/A cls _extra_args N/A list N/A N/A actual difference expected N/A missing_args N/A arg N/A arg missing_args N/A arg N/A cls optional_kwargs N/A N/A cls _extra_args N/A arg N/A arg N/A cls _extra_args N/A arg N/A cls optional_kwargs N/A msg N/A N/A N/A cls _extra_args N/A cls strict_checking N/A N/A msg N/A N/A {msg} Found unexpected attributes: {attrs} format msg msg attrs N/A cls _extra_args N/A missing_args N/A N/A msg N/A N/A {msg} Missing expected attributes: {attrs} format msg msg attrs missing_args N/A msg N/A N/A N/A DeserializationError msg N/A classmethod _json_to_obj N/A N/A cls serialized_str N/A N/A N/A Deserialize a JSON string N/A json_dict N/A N/A json loads serialized_str N/A model_dict N/A N/A N/A json_dict get N/A cls obj_model_key json_dict N/A N/A N/A cls _dict_to_obj model_dict N/A classmethod _dict_to_obj N/A N/A cls json_dict N/A N/A N/A Default dict_to_obj implementation

        Default implementation works for simple cases. Override
        for instances with sub-models.
         N/A N/A N/A cls _map_values_to_kwargs json_dict N/A classmethod is_empty N/A N/A self N/A N/A N/A Check if all object values are False

        Example:
            obj_json = {
                "foo": []
                "bar": 0
            }

            obj.foo = []
            obj.bar = 0
            # obj.is_empty() returns True
         N/A key N/A N/A N/A self kwarg_map keys N/A N/A value N/A getattr self key N/A value N/A N/A N/A N/A hasattr value is_empty N/A N/A value is_empty False N/A True N/A N/A EventBaseListModel N/A AutoMarshallingListModel N/A N/A Base class for Event list models

    This class provides default implementations for common
    list model functionality. Child classes will need to
    override the list_model_key and ObjectModel attributes.

    Example:

        {
            "foo": [
                {
                    "key1": "value1",
                    "key2": "value2"
                }
            ]
        }

        list_model_key = 'foo'
        ObjectModel = Foo
     N/A list_model_key None N/A ObjectModel None _json_to_obj N/A N/A cls serialized_str N/A N/A N/A Deserialize a JSON string N/A json_dict N/A N/A json loads serialized_str N/A N/A N/A cls _validate_attributes json_dict N/A list_of_dicts N/A N/A json_dict get N/A cls list_model_key N/A N/A N/A cls _list_to_obj list_of_dicts N/A classmethod _list_to_obj N/A N/A cls list_of_dicts N/A N/A N/A Create list of objects from list of dicts N/A obj_list N/A cls N/A obj_dict list_of_dicts N/A N/A N/A N/A obj_list append N/A N/A N/A cls ObjectModel _dict_to_obj obj_dict N/A obj_list N/A classmethod _validate_attributes N/A N/A cls json_dict N/A N/A N/A Validate expected deserialization N/A N/A N/A len json_dict 1 N/A N/A extras N/A key N/A key N/A N/A json_dict keys N/A key N/A cls list_model_key N/A N/A DeserializationError N/A N/A Unexpected attributes in deserialized string: {0} format extras N/A N/A N/A N/A len json_dict 1 N/A N/A N/A DeserializationError N/A N/A Missing expected attribute: {0} format N/A cls list_model_key N/A classmethod N/A