"""paypalserversdk.

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

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


class AuctionInformation(object):
    """Implementation of the 'Auction Information' model.

    The auction information.

    Attributes:
        auction_site (str): The name of the auction site.
        auction_item_site (str): The auction site URL.
        auction_buyer_id (str): The ID of the buyer who makes the purchase in the
            auction. This ID might be different from the payer ID provided for the
            payment.
        auction_closing_date (str): The date and time, in [Internet date and time
            format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are
            required while fractional seconds are optional. Note: The regular
            expression provides guidance but does not reject all invalid dates.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "auction_site": "auction_site",
        "auction_item_site": "auction_item_site",
        "auction_buyer_id": "auction_buyer_id",
        "auction_closing_date": "auction_closing_date",
    }

    _optionals = [
        "auction_site",
        "auction_item_site",
        "auction_buyer_id",
        "auction_closing_date",
    ]

    def __init__(
        self,
        auction_site=APIHelper.SKIP,
        auction_item_site=APIHelper.SKIP,
        auction_buyer_id=APIHelper.SKIP,
        auction_closing_date=APIHelper.SKIP):
        """Initialize a AuctionInformation instance."""
        # Initialize members of the class
        if auction_site is not APIHelper.SKIP:
            self.auction_site = auction_site
        if auction_item_site is not APIHelper.SKIP:
            self.auction_item_site = auction_item_site
        if auction_buyer_id is not APIHelper.SKIP:
            self.auction_buyer_id = auction_buyer_id
        if auction_closing_date is not APIHelper.SKIP:
            self.auction_closing_date = auction_closing_date

    @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
        auction_site =\
            dictionary.get("auction_site")\
            if dictionary.get("auction_site")\
                else APIHelper.SKIP
        auction_item_site =\
            dictionary.get("auction_item_site")\
            if dictionary.get("auction_item_site")\
                else APIHelper.SKIP
        auction_buyer_id =\
            dictionary.get("auction_buyer_id")\
            if dictionary.get("auction_buyer_id")\
                else APIHelper.SKIP
        auction_closing_date =\
            dictionary.get("auction_closing_date")\
            if dictionary.get("auction_closing_date")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(auction_site,
                   auction_item_site,
                   auction_buyer_id,
                   auction_closing_date)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _auction_site=(
            self.auction_site
            if hasattr(self, "auction_site")
            else None
        )
        _auction_item_site=(
            self.auction_item_site
            if hasattr(self, "auction_item_site")
            else None
        )
        _auction_buyer_id=(
            self.auction_buyer_id
            if hasattr(self, "auction_buyer_id")
            else None
        )
        _auction_closing_date=(
            self.auction_closing_date
            if hasattr(self, "auction_closing_date")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"auction_site={_auction_site!r}, "
            f"auction_item_site={_auction_item_site!r}, "
            f"auction_buyer_id={_auction_buyer_id!r}, "
            f"auction_closing_date={_auction_closing_date!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _auction_site=(
            self.auction_site
            if hasattr(self, "auction_site")
            else None
        )
        _auction_item_site=(
            self.auction_item_site
            if hasattr(self, "auction_item_site")
            else None
        )
        _auction_buyer_id=(
            self.auction_buyer_id
            if hasattr(self, "auction_buyer_id")
            else None
        )
        _auction_closing_date=(
            self.auction_closing_date
            if hasattr(self, "auction_closing_date")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"auction_site={_auction_site!s}, "
            f"auction_item_site={_auction_item_site!s}, "
            f"auction_buyer_id={_auction_buyer_id!s}, "
            f"auction_closing_date={_auction_closing_date!s}, "
            f")"
        )
