"""
PingPulse Airflow Provider

Seamlessly integrate PingPulse workflow monitoring with Apache Airflow.

Usage:
    pip install pingpulse-airflow

Three integration patterns:

1. Operator (explicit task):
    from pingpulse_airflow import PingPulseOperator

    ping = PingPulseOperator(
        task_id='ping_stage_1',
        workflow_id='dwf123abc',
        stage_path='1',
    )

2. Decorator (auto-ping on success/failure):
    from pingpulse_airflow import pingpulse_task

    @pingpulse_task(workflow_id='dwf123abc', stage_path='2')
    def my_task():
        return process_data()

3. Callbacks (attach to existing tasks):
    from pingpulse_airflow import pingpulse_success, pingpulse_failure

    task = PythonOperator(
        task_id='process',
        python_callable=run_job,
        on_success_callback=pingpulse_success('dwf123abc', '3'),
        on_failure_callback=pingpulse_failure('dwf123abc', '3'),
    )
"""

__version__ = "0.1.0"

from pingpulse_airflow.hooks.pingpulse import PingPulseHook
from pingpulse_airflow.operators.pingpulse import PingPulseOperator
from pingpulse_airflow.decorators import pingpulse_task
from pingpulse_airflow.callbacks import (
    pingpulse_success,
    pingpulse_failure,
    pingpulse_callback,
)

__all__ = [
    "PingPulseHook",
    "PingPulseOperator",
    "pingpulse_task",
    "pingpulse_success",
    "pingpulse_failure",
    "pingpulse_callback",
    "get_provider_info",
]


def get_provider_info():
    """
    Return provider metadata for Apache Airflow.

    This is used by Airflow to discover and register the provider.
    """
    return {
        "package-name": "pingpulse-airflow",
        "name": "PingPulse",
        "description": "Apache Airflow provider for PingPulse workflow monitoring",
        "connection-types": [
            {
                "connection-type": "pingpulse",
                "hook-class-name": "pingpulse_airflow.hooks.pingpulse.PingPulseHook",
            }
        ],
        "versions": [__version__],
    }
