# Path: freezer_api/common/exceptions.py
# class FreezerAPIException(falcon.HTTPError):
# class BadDataFormat(FreezerAPIException):
# class DocumentExists(FreezerAPIException):
# class StorageEngineError(FreezerAPIException):
# class DocumentNotFound(FreezerAPIException):
# class AccessForbidden(FreezerAPIException):
# class MethodNotImplemented(FreezerAPIException):
#     def __init__(self, message=''):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
# 
# Path: freezer_api/common/json_schemas.py



import time
import uuid
import jsonschema
from freezer_api.common import exceptions as freezer_api_exc
from freezer_api.common import json_schemas
        return doc

    @staticmethod
    def update(doc, user_id, action_id):
        doc.update({
            'user_id': user_id,
            'action_id': action_id,
        })
        ActionDoc.validate(doc)
        return doc


class SessionDoc(object):
    session_doc_validator = jsonschema.Draft4Validator(
        schema=json_schemas.session_schema)
    session_patch_validator = jsonschema.Draft4Validator(
        schema=json_schemas.session_patch_schema)

    @staticmethod
    def validate(doc):
        try:
            SessionDoc.session_doc_validator.validate(doc)
        except Exception as e:
            raise freezer_api_exc.BadDataFormat(str(e).splitlines()[0])

    @staticmethod
    def validate_patch(doc):
        try:
            SessionDoc.session_patch_validator.validate(doc)
        except Exception as e:

# Path: freezer_api/common/exceptions.py
# class FreezerAPIException(falcon.HTTPError):
# class BadDataFormat(FreezerAPIException):
# class DocumentExists(FreezerAPIException):
# class StorageEngineError(FreezerAPIException):
# class DocumentNotFound(FreezerAPIException):
# class AccessForbidden(FreezerAPIException):
# class MethodNotImplemented(FreezerAPIException):
#     def __init__(self, message=''):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
#     def handle(ex, req, resp, params):
# 
# Path: freezer_api/common/json_schemas.py



# Path: freezer_api/common/utils.py
import time
import uuid
import jsonschema
from freezer_api.common import exceptions as freezer_api_exc
from freezer_api.common import json_schemas

        return doc

    @staticmethod
    def update(doc, user_id, action_id):
        doc.update({
            'user_id': user_id,
            'action_id': action_id,
        })
        ActionDoc.validate(doc)
        return doc


class SessionDoc(object):
    session_doc_validator = jsonschema.Draft4Validator(
        schema=json_schemas.session_schema)
    session_patch_validator = jsonschema.Draft4Validator(
        schema=json_schemas.session_patch_schema)

    @staticmethod
    def validate(doc):
        try:
            SessionDoc.session_doc_validator.validate(doc)
        except Exception as e:
            raise freezer_api_exc.BadDataFormat(str(e).splitlines()[0])

    @staticmethod
    def validate_patch(doc):
        try:
            SessionDoc.session_patch_validator.validate(doc)
        except Exception as e:

            raise freezer_api_exc.BadDataFormat(str(e).splitlines()[0])