# -*- coding: utf-8 -*-

"""
paypalserversdk

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
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):
        """Constructor for the AuctionInformation class"""

        # 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):
        """Creates 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 (f'{self.__class__.__name__}('
                f'auction_site={(self.auction_site if hasattr(self, "auction_site") else None)!r}, '
                f'auction_item_site={(self.auction_item_site if hasattr(self, "auction_item_site") else None)!r}, '
                f'auction_buyer_id={(self.auction_buyer_id if hasattr(self, "auction_buyer_id") else None)!r}, '
                f'auction_closing_date={(self.auction_closing_date if hasattr(self, "auction_closing_date") else None)!r})')

    def __str__(self):
        return (f'{self.__class__.__name__}('
                f'auction_site={(self.auction_site if hasattr(self, "auction_site") else None)!s}, '
                f'auction_item_site={(self.auction_item_site if hasattr(self, "auction_item_site") else None)!s}, '
                f'auction_buyer_id={(self.auction_buyer_id if hasattr(self, "auction_buyer_id") else None)!s}, '
                f'auction_closing_date={(self.auction_closing_date if hasattr(self, "auction_closing_date") else None)!s})')
