# 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
        # changes in user_id or action_id are not allowed
        doc.pop('user_id', None)
        doc.pop('action_id', None)
        ActionDoc.validate_patch(doc)
        return doc

    @staticmethod
    def create(doc, user_id):
        action_id = doc.get('action_id', uuid.uuid4().hex)
        doc.update({
            'user_id': user_id,
            'action_id': action_id,
        })
        ActionDoc.validate(doc)
        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(

# 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

        # changes in user_id or action_id are not allowed
        doc.pop('user_id', None)
        doc.pop('action_id', None)
        ActionDoc.validate_patch(doc)
        return doc

    @staticmethod
    def create(doc, user_id):
        action_id = doc.get('action_id', uuid.uuid4().hex)
        doc.update({
            'user_id': user_id,
            'action_id': action_id,
        })
        ActionDoc.validate(doc)
        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)