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

"""
paypalserversdk

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

        # Initialize members of the class
        self.billing_cycle_sequence = billing_cycle_sequence 
        self.pricing_scheme = pricing_scheme 

    @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
        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 (f'{self.__class__.__name__}('
                f'billing_cycle_sequence={self.billing_cycle_sequence!r}, '
                f'pricing_scheme={self.pricing_scheme!r})')

    def __str__(self):
        return (f'{self.__class__.__name__}('
                f'billing_cycle_sequence={self.billing_cycle_sequence!s}, '
                f'pricing_scheme={self.pricing_scheme!s})')
