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

"""
zypev1

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


class SortOption(object):

    """Implementation of the 'SortOption' model.

    TODO: type model description here.

    Attributes:
        sort_by_created_at (string): What value to sort the associated
            playlist by Must be one of: + created_at + published_at + title
        direction (string): Which direction to sort the associated playlist by
            Must be one of: + desc + asc
        sort_by_type (string): What datatype to sorty the associated playlist
            by Must be one of: + date + datetime + string + integer + array +
            boolean

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "sort_by_created_at": 'sort_by: created_at',
        "direction": 'direction',
        "sort_by_type": 'sort_by_type'
    }

    def __init__(self,
                 sort_by_created_at=None,
                 direction=None,
                 sort_by_type=None):
        """Constructor for the SortOption class"""

        # Initialize members of the class
        self.sort_by_created_at = sort_by_created_at
        self.direction = direction
        self.sort_by_type = sort_by_type

    @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
        sort_by_created_at = dictionary.get('sort_by: created_at')
        direction = dictionary.get('direction')
        sort_by_type = dictionary.get('sort_by_type')

        # Return an object of this model
        return cls(sort_by_created_at,
                   direction,
                   sort_by_type)
