# Path: ntfy/config.py
# USER_AGENT = 'ntfy/{version} {default_user_agent}'.format(
#     version=__version__,
#     default_user_agent=requests.utils.default_user_agent())


import requests
from ..config import USER_AGENT

def notify(title,
           message,
           secret,
           endpoint=None,
           level=3,
           link=None,
           retcode=None):
    """
    Required parameter:
        * ``secret`` - The Pushjet service secret token, created with
            http://docs.pushjet.io/docs/creating-a-new-service

    Optional parameters:
        * ``endpoint`` - custom Pushjet API endpoint
            (defaults to https://api.pushjet.io)
        * ``level`` - The importance level from 1(low) to 5(high)
        * ``link``
    """

    data = {
        'title': title,
        'message': message,
        'level': level,
        'secret': secret,
    }

    if link:
        data['link'] = link


# Path: ntfy/config.py
# USER_AGENT = 'ntfy/{version} {default_user_agent}'.format(
#     version=__version__,
#     default_user_agent=requests.utils.default_user_agent())


# Path: ntfy/backends/pushjet.py
import requests
from ..config import USER_AGENT


def notify(title,
           message,
           secret,
           endpoint=None,
           level=3,
           link=None,
           retcode=None):
    """
    Required parameter:
        * ``secret`` - The Pushjet service secret token, created with
            http://docs.pushjet.io/docs/creating-a-new-service

    Optional parameters:
        * ``endpoint`` - custom Pushjet API endpoint
            (defaults to https://api.pushjet.io)
        * ``level`` - The importance level from 1(low) to 5(high)
        * ``link``
    """

    data = {
        'title': title,
        'message': message,
        'level': level,
        'secret': secret,
    }

    if link:
        data['link'] = link


    headers = {'User-Agent': USER_AGENT}