from pyuspostalservice.endpoints.base.base_endpoint import USPSEndpoint
from pyuspostalservice.interfaces import (
    IPostable
)
from pyuspostalservice.models.usps import TrackingProofOfDelivery
from pyuspostalservice.types import (
    JSON,
    USPSRequestParams,
)


class TrackingIdProofOfDeliveryEndpoint(
    USPSEndpoint,
    IPostable[TrackingProofOfDelivery, USPSRequestParams],
):
    def __init__(self, client, parent_endpoint=None) -> None:
        USPSEndpoint.__init__(self, client, "proof-of-delivery", parent_endpoint=parent_endpoint)
        IPostable.__init__(self, TrackingProofOfDelivery)
        
    def post(
        self,
        data: JSON | None = None,
        params: USPSRequestParams | None = None,
    ) -> TrackingProofOfDelivery:
        """
        Performs a POST request against the /v3r2/proof-of-delivery endpoint.

        Parameters:
            data (dict[str, Any]): The data to send in the request body.
            params (dict[str, int | str]): The parameters to send in the request query string.
        Returns:
            TrackingProofOfDelivery: The parsed response data.
        """
        return self._parse_one(
            TrackingProofOfDelivery,
            super()._make_request("POST", data=data, params=params).json(),
        )
