"""paypalserversdk.

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

# ruff: noqa: E501
from paypalserversdk.models.update_pricing_scheme import (
    UpdatePricingScheme,
)


class UpdatePricingSchemesRequest(object):
    """Implementation of the 'Update Pricing Schemes Request' model.

    The update pricing scheme request details.

    Attributes:
        pricing_schemes (List[UpdatePricingScheme]): An array of pricing schemes.

    """

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

    def __init__(
        self,
        pricing_schemes=None):
        """Initialize a UpdatePricingSchemesRequest instance."""
        # Initialize members of the class
        self.pricing_schemes = pricing_schemes

    @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
        pricing_schemes = None
        if dictionary.get("pricing_schemes") is not None:
            pricing_schemes = [
                UpdatePricingScheme.from_dictionary(x)
                    for x in dictionary.get("pricing_schemes")
            ]

        # Return an object of this model
        return cls(pricing_schemes)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _pricing_schemes=self.pricing_schemes
        return (
            f"{self.__class__.__name__}("
            f"pricing_schemes={_pricing_schemes!r}, "
            f")"
        )

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