# Path: ceagle/api_fake_data/base.py
# CONF = config.CONF
# def route(reg):
#     def decorator(method):
#     def __init__(self, name, endpoint):
#     def _setup_routing(self):
#     def _find_route(self, path):
#     def default(self, path, *args, **kwargs):
#     def get(self, path, **kwargs):
# def api_handler(fake):
#     def real_function_handler(real):
#         def choice_maker(*args, **kwargs):
# def randnum(from_num, to_num, round_by=2):
# class FakeClient(object):


import datetime
import random
import flask
from ceagle.api_fake_data import base
    }

    if with_latest_run:
        runbook['latest_run'] = get_single_run(False)
    return runbook


def get_single_run(with_parent=True):
    finished_at = datetime.datetime.now().isoformat()
    started_at = (datetime.datetime.now() - datetime.timedelta(
        minutes=random.randint(1, 20))).isoformat()

    region_choices = [
        "region_one", "region_two"
    ]
    run = {
        "id": str(random.randint(1, 1000)),
        "created_at": started_at,
        "updated_at": finished_at,
        "user": "cloud_user",
        "output": "SGVsbG8gV29ybGQhCg==",
        "return_code": 0,
        "parent": None,
        "region": random.choice(region_choices),
    }
    if with_parent:
        run["parent"] = get_single_runbook(False)
    return run



# Path: ceagle/api_fake_data/base.py
# CONF = config.CONF
# def route(reg):
#     def decorator(method):
#     def __init__(self, name, endpoint):
#     def _setup_routing(self):
#     def _find_route(self, path):
#     def default(self, path, *args, **kwargs):
#     def get(self, path, **kwargs):
# def api_handler(fake):
#     def real_function_handler(real):
#         def choice_maker(*args, **kwargs):
# def randnum(from_num, to_num, round_by=2):
# class FakeClient(object):


# Path: ceagle/api_fake_data/fake_runbooks.py
import datetime
import random
import flask
from ceagle.api_fake_data import base

    }

    if with_latest_run:
        runbook['latest_run'] = get_single_run(False)
    return runbook


def get_single_run(with_parent=True):
    finished_at = datetime.datetime.now().isoformat()
    started_at = (datetime.datetime.now() - datetime.timedelta(
        minutes=random.randint(1, 20))).isoformat()

    region_choices = [
        "region_one", "region_two"
    ]
    run = {
        "id": str(random.randint(1, 1000)),
        "created_at": started_at,
        "updated_at": finished_at,
        "user": "cloud_user",
        "output": "SGVsbG8gV29ybGQhCg==",
        "return_code": 0,
        "parent": None,
        "region": random.choice(region_choices),
    }
    if with_parent:
        run["parent"] = get_single_runbook(False)
    return run



@base.api_handler