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

"""
cookiesapi

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


class Name(object):

    """Implementation of the 'Name' model.

    Generic name, with an alternative label.

    Attributes:
        label (string): Display label.
        alt (string): Alternate display label.
        primary (string): Primary name.
        display (string): Display name for this record. Overrides all other
            names.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "label": 'label',
        "alt": 'alt',
        "primary": 'primary',
        "display": 'display'
    }

    def __init__(self,
                 label=None,
                 alt=None,
                 primary=None,
                 display=None):
        """Constructor for the Name class"""

        # Initialize members of the class
        self.label = label
        self.alt = alt
        self.primary = primary
        self.display = display

    @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
        label = dictionary.get('label')
        alt = dictionary.get('alt')
        primary = dictionary.get('primary')
        display = dictionary.get('display')

        # Return an object of this model
        return cls(label,
                   alt,
                   primary,
                   display)
