"""visaacceptancemergedspec.

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

# ruff: noqa: E501
from visaacceptancemergedspec.api_helper import (
    APIHelper,
)


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

    Attributes:
        final_capture (str): Indicates whether you can make additional captures
            against the authorized payment. Set to true if you do not intend to
            capture additional payments against the authorization. Set to false if
            you intend to capture additional payments Possible Values: - `true` -
            `false`
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

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

    _optionals = [
        "final_capture",
    ]

    def __init__(
        self,
        final_capture=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a CaptureOptions1 instance."""
        # Initialize members of the class
        if final_capture is not APIHelper.SKIP:
            self.final_capture = final_capture

        # 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
        final_capture =\
            dictionary.get("finalCapture")\
            if dictionary.get("finalCapture")\
                else APIHelper.SKIP

        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(final_capture,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _final_capture=(
            self.final_capture
            if hasattr(self, "final_capture")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"final_capture={_final_capture!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _final_capture=(
            self.final_capture
            if hasattr(self, "final_capture")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"final_capture={_final_capture!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
