"""paypalserversdk.

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

# ruff: noqa: E501
from paypalserversdk.models.subscription_pricing_scheme import (
    SubscriptionPricingScheme,
)


class UpdatePricingScheme(object):
    """Implementation of the 'Update Pricing Scheme' model.

    The update pricing scheme request details.

    Attributes:
        billing_cycle_sequence (int): The billing cycle sequence.
        pricing_scheme (SubscriptionPricingScheme): The pricing scheme details.

    """

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

    def __init__(
        self,
        billing_cycle_sequence=None,
        pricing_scheme=None):
        """Initialize a UpdatePricingScheme instance."""
        # Initialize members of the class
        self.billing_cycle_sequence = billing_cycle_sequence
        self.pricing_scheme = pricing_scheme

    @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
        billing_cycle_sequence =\
            dictionary.get("billing_cycle_sequence")\
            if dictionary.get("billing_cycle_sequence")\
                else None
        pricing_scheme =\
            SubscriptionPricingScheme.from_dictionary(
                dictionary.get("pricing_scheme"))\
                if dictionary.get("pricing_scheme") else None

        # Return an object of this model
        return cls(billing_cycle_sequence,
                   pricing_scheme)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _billing_cycle_sequence=self.billing_cycle_sequence
        _pricing_scheme=self.pricing_scheme
        return (
            f"{self.__class__.__name__}("
            f"billing_cycle_sequence={_billing_cycle_sequence!r}, "
            f"pricing_scheme={_pricing_scheme!r}, "
            f")"
        )

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