<reponame>nidaizamir/Test-PY<filename>awsecommerceservice/models/promotions.py
# -*- coding: utf-8 -*-

"""
    awsecommerceservice

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

import awsecommerceservice.models.promotion

class Promotions(object):

    """Implementation of the 'Promotions' model.

    TODO: type model description here.

    Attributes:
        promotion (list of Promotion): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "promotion":'Promotion'
    }

    def __init__(self,
                 promotion=None):
        """Constructor for the Promotions class"""

        # Initialize members of the class
        self.promotion = promotion


    @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 dictionary is None:
            return None

        # Extract variables from the dictionary
        promotion = None
        if dictionary.get('Promotion') != None:
            promotion = list()
            for structure in dictionary.get('Promotion'):
                promotion.append(awsecommerceservice.models.promotion.Promotion.from_dictionary(structure))

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



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

"""
    awsecommerceservice

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

import awsecommerceservice.models.promotion

class Promotions(object):

    """Implementation of the 'Promotions' model.

    TODO: type model description here.

    Attributes:
        promotion (list of Promotion): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "promotion":'Promotion'
    }

    def __init__(self,
                 promotion=None):
        """Constructor for the Promotions class"""

        # Initialize members of the class
        self.promotion = promotion


    @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 dictionary is None:
            return None

        # Extract variables from the dictionary
        promotion = None
        if dictionary.get('Promotion') != None:
            promotion = list()
            for structure in dictionary.get('Promotion'):
                promotion.append(awsecommerceservice.models.promotion.Promotion.from_dictionary(structure))

        # Return an object of this model
        return cls(promotion)
# -*- coding: utf-8 -*- awsecommerceservice      This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). Implementation of the 'Promotions' model.      TODO: type model description here.      Attributes:         promotion (list of Promotion): TODO: type description here. # Create a mapping from Model property names to API property names Constructor for the Promotions class # Initialize members of the class 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. # Extract variables from the dictionary # Return an object of this model