# Path: ricloud/utils.py
# def log_debug(message, *args, **kwargs):
# def log_info(message, *args, **kwargs):
# def generate_timestamp():
# def _encode(data):
# def encode(data):
# def expanded_encode(data):
#     def default(self, data):
# def pretty_print(data):
# def encode_json(data, indent=None):
# def decode_json(data):
# def encode_b64(data):
# def decode_b64(data):
# def transform_csv_file_to_json(file_object):
# def join_url(base, url, allow_fragments=True):
# def get_url_path(url):
# def escape(string):
# def get_md5_hash(data, hex_encode=True):
# def get_path_extension(path):
# def get_directory_from_path(path):
# def ensure_directory_exists(directory):
# def ensure_path_exists(path):
# def get_filename(*args):
# class DataEncoder(json.JSONEncoder):
# class ExpandedDataEncoder(DataEncoder):


import os
import click
import ricloud
import ricloud.samples
from ricloud import utils
    from ricloud import conf
    from ricloud import conf
    from ricloud import conf
    from ricloud.webhooks import app
    help="Automatically sets up a webhook config for this URL.",
)
@click.option(
    "--only",
    default=None,
    help="Comma separated list. Only echo events with these slugs.",
)
@click.option(
    "--exclude",
    default=None,
    help="Comma separated list. Exclude events with these slugs.",
)
def listen(host, port, debug, webhook_url, only, exclude):
    """ricloud API event notification listener.

    Sets up a small Flask-based server listening on HOST (default: 0.0.0.0) and PORT (default: 8080).

    It is likely that you are using something like ngrok to expose the endpoint to the API. If that's the case, pass in the forwarding URL using the --webhook-url option. This will automatically setup a webhook config on the API and set it as active for your key (assuming it is valid).

    In most cases, you will likely set up a utility like ngrok to expose this endpoint to the internet.

    The default handler simply echos received event data to stdout.
    """

    webhook_secret = conf.get("webhooks", "secret")
    webhook_delta = conf.getint("webhooks", "delta")

    if webhook_url:
        key = ricloud.Key.current()


# Path: ricloud/utils.py
# def log_debug(message, *args, **kwargs):
# def log_info(message, *args, **kwargs):
# def generate_timestamp():
# def _encode(data):
# def encode(data):
# def expanded_encode(data):
#     def default(self, data):
# def pretty_print(data):
# def encode_json(data, indent=None):
# def decode_json(data):
# def encode_b64(data):
# def decode_b64(data):
# def transform_csv_file_to_json(file_object):
# def join_url(base, url, allow_fragments=True):
# def get_url_path(url):
# def escape(string):
# def get_md5_hash(data, hex_encode=True):
# def get_path_extension(path):
# def get_directory_from_path(path):
# def ensure_directory_exists(directory):
# def ensure_path_exists(path):
# def get_filename(*args):
# class DataEncoder(json.JSONEncoder):
# class ExpandedDataEncoder(DataEncoder):


# Path: ricloud/cli.py
import os
import click
import ricloud
import ricloud.samples
from ricloud import utils
    from ricloud import conf
    from ricloud import conf
    from ricloud import conf
    from ricloud.webhooks import app

    help="Automatically sets up a webhook config for this URL.",
)
@click.option(
    "--only",
    default=None,
    help="Comma separated list. Only echo events with these slugs.",
)
@click.option(
    "--exclude",
    default=None,
    help="Comma separated list. Exclude events with these slugs.",
)
def listen(host, port, debug, webhook_url, only, exclude):
    """ricloud API event notification listener.

    Sets up a small Flask-based server listening on HOST (default: 0.0.0.0) and PORT (default: 8080).

    It is likely that you are using something like ngrok to expose the endpoint to the API. If that's the case, pass in the forwarding URL using the --webhook-url option. This will automatically setup a webhook config on the API and set it as active for your key (assuming it is valid).

    In most cases, you will likely set up a utility like ngrok to expose this endpoint to the internet.

    The default handler simply echos received event data to stdout.
    """

    webhook_secret = conf.get("webhooks", "secret")
    webhook_delta = conf.getint("webhooks", "delta")

    if webhook_url:
        key = ricloud.Key.current()


        url = utils.join_url(webhook_url, "webhooks")