#
# Copyright 2016 CognitiveScale, Inc.
#
# 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.
#

from json import JSONEncoder
from jsonpickle.handlers import BaseHandler


class ResultEncoder(JSONEncoder):
    """
    JSONEncoder for serializing Success and Error responses
    """
    def default(self, o):
        result = o.__dict__
        # remove set_attr collection
        result.pop("_setattrs", d=None)
        result["is_success"] = o.is_success
        return result


class Iso8601Handler(BaseHandler):
    def flatten(self, obj, data):
        return obj.isoformat()
010bfe11301ae1ea2c8f28b23b4a2fbf6de8c81c
<mask token>


class ResultEncoder(JSONEncoder):
    <mask token>
    <mask token>


class Iso8601Handler(BaseHandler):

    def flatten(self, obj, data):
        return obj.isoformat()

<mask token>


class ResultEncoder(JSONEncoder):
    <mask token>

    def default(self, o):
        result = o.__dict__
        result.pop('_setattrs', d=None)
        result['is_success'] = o.is_success
        return result


class Iso8601Handler(BaseHandler):

    def flatten(self, obj, data):
        return obj.isoformat()

<mask token>


class ResultEncoder(JSONEncoder):
    """
    JSONEncoder for serializing Success and Error responses
    """

    def default(self, o):
        result = o.__dict__
        result.pop('_setattrs', d=None)
        result['is_success'] = o.is_success
        return result


class Iso8601Handler(BaseHandler):

    def flatten(self, obj, data):
        return obj.isoformat()

from json import JSONEncoder
from jsonpickle.handlers import BaseHandler


class ResultEncoder(JSONEncoder):
    """
    JSONEncoder for serializing Success and Error responses
    """

    def default(self, o):
        result = o.__dict__
        result.pop('_setattrs', d=None)
        result['is_success'] = o.is_success
        return result


class Iso8601Handler(BaseHandler):

    def flatten(self, obj, data):
        return obj.isoformat()

#
# Copyright 2016 CognitiveScale, Inc.
#
# 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.
#

from json import JSONEncoder
from jsonpickle.handlers import BaseHandler


class ResultEncoder(JSONEncoder):
    """
    JSONEncoder for serializing Success and Error responses
    """
    def default(self, o):
        result = o.__dict__
        # remove set_attr collection
        result.pop("_setattrs", d=None)
        result["is_success"] = o.is_success
        return result


class Iso8601Handler(BaseHandler):
    def flatten(self, obj, data):
        return obj.isoformat()