# Copyright (c) 2026 MergeGuide, Inc. All rights reserved.
# SPDX-License-Identifier: Proprietary
"""Azure DevOps integration for MergeGuide.

This module provides integration with Azure DevOps for:
- Webhook handling for PR events (Service Hooks)
- PR status updates (Build Status API)
- PR comments (Threads API)
- Policy evaluation orchestration

Example usage:
    from mergeguide.azure_devops import (
        AzureDevOpsAuth,
        AzureDevOpsAPI,
        AzureDevOpsPRHandler,
        parse_webhook_event,
        verify_webhook_signature,
    )

    # Verify and parse webhook
    if verify_webhook_signature(payload, signature, secret):
        event = parse_webhook_event(headers, payload)
        if event.should_process_pr:
            # Handle PR evaluation
            auth = AzureDevOpsAuth(org_url, pat)
            api = AzureDevOpsAPI(auth)
            handler = AzureDevOpsPRHandler(api, policy_engine)
            result = await handler.handle_pull_request(event)
"""

from mergeguide.azure_devops.api import AzureDevOpsAPI
from mergeguide.azure_devops.auth import AzureDevOpsAuth
from mergeguide.azure_devops.comments import format_check_comment, format_error_comment
from mergeguide.azure_devops.pr_handler import AzureDevOpsPRHandler, PRCheckResult
from mergeguide.azure_devops.webhook import (
    AzureDevOpsWebhookEvent,
    parse_webhook_event,
    verify_webhook_signature,
)

__all__ = [
    "AzureDevOpsAuth",
    "AzureDevOpsAPI",
    "AzureDevOpsPRHandler",
    "AzureDevOpsWebhookEvent",
    "PRCheckResult",
    "parse_webhook_event",
    "verify_webhook_signature",
    "format_check_comment",
    "format_error_comment",
]
