"""cellpointapi.

This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
"""

# ruff: noqa: E501
from cellpointapi.api_helper import APIHelper


class CapturePaymentResponse(object):
    """Implementation of the 'CapturePaymentResponse' model.

    The response object that is returned when the capture is completed.

    Attributes:
        status (PaymentStatus): States that a transaction can be in.  <table>
            <thead>     <tr>       <th>Status</th>       <th>Description</th>
            </tr>   </thead>   <tbody>     <tr>       <td>AUTHORIZED</td>       <td>A
            transaction has been fully authorized and the funds are being held.</td>
            </tr>     <tr>       <td>AUTHORIZE_FAILED</td>       <td>Authorization
            has failed. No funds are being held.</td>     </tr>     <tr>
            <td>AUTHORIZE_INITIATED</td>       <td>A payment authorization has been
            initiated with CellPoint Digital.</td>     </tr>     <tr>
            <td>CANCELED</td>       <td>Authorization has been canceled and no funds
            are being held anymore.</td>     </tr>     <tr>
            <td>CANCELLATION_FAILED</td>       <td>Cancellation has failed. Funds are
            still held as part of the authorization.</td>     </tr>     <tr>
            <td>CANCELLATION_INITIATED</td>       <td>Cancellation of funds have been
            initiated and is pending completion.</td>     </tr>     <tr>
            <td>CAPTURED</td>       <td>         Authorized transaction that has been
            fully captured.         Depending on how settlement is done by payment
            processor, funds have been moved from buyer's account to merchant's
            account.       </td>     </tr>     <tr>       <td>CAPTURE_FAILED</td>
            <td>Capture has failed. Funds are still held as part of the
            authorization, but have not moved.</td>     </tr>     <tr>
            <td>CAPTURE_INITIATED</td>       <td>Capture has been initiated, but is
            pending completion.</td>     </tr>     <tr>
            <td>CAPTURE_PENDING</td>       <td>Authorization has already happened,
            and the transaction has now been marked as pending for capture. Capture
            will take place automatically as per configured schedule.</td>     </tr>
            <tr>       <td>CAPTURE_BATCHED</td>       <td>Authorization has already
            happened, and the transaction has been sent for capturing in a batch.
            Capture will finally take place automatically as per configured
            schedule.</td>     </tr>     <tr>       <td>PARTIALLY_CANCELED</td>
            <td>Authorized transaction is partially canceled<td>     </tr>     <tr>
            <td>PARTIALLY_CAPTURED</td>       <td>Authorized transaction is partially
            captured<td>     </tr>     <tr>       <td>PENDING_ACTION_COMPLETION</td>
            <td>The transaction is in a state where an action has been initiated, but
            is pending completion.</td>     </tr>     <tr>       <td>CLOSED</td>
            <td>The transaction that has previously failed has been closed to avoid
            its stagnation in review pools.</td>     </tr>   </tbody> </table>
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "status": "status",
    }

    def __init__(
        self,
        status=None,
        additional_properties=None):
        """Initialize a CapturePaymentResponse instance."""
        # Initialize members of the class
        self.status = status

        # Add additional model properties to the instance
        if additional_properties is None:
            additional_properties = {}
        self.additional_properties = additional_properties

    @classmethod
    def from_dictionary(cls,
                        dictionary):
        """Create an instance of this model from a dictionary

        Args:
            dictionary (dictionary): A dictionary representation of the object
            as obtained from the deserialization of the server's response. The
            keys MUST match property names in the API description.

        Returns:
            object: An instance of this structure class.

        """
        if not isinstance(dictionary, dict) or dictionary is None:
            return None

        # Extract variables from the dictionary
        status =\
            dictionary.get("status")\
            if dictionary.get("status")\
                else None

        additional_properties = APIHelper.get_additional_properties(
            dictionary={k: v for k, v in dictionary.items()
                        if k not in cls._names.values()},
            unboxing_function=lambda value: value)

        # Return an object of this model
        return cls(status,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _status=self.status
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"status={_status!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _status=self.status
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"status={_status!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
