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

"""
spotifywebapiwithfixesandimprovementsfromsonallux

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
from spotifywebapiwithfixesandimprovementsfromsonallux.api_helper import APIHelper


class DisallowsObject(object):

    """Implementation of the 'DisallowsObject' model.

    Attributes:
        interrupting_playback (bool): Interrupting playback. Optional field.
        pausing (bool): Pausing. Optional field.
        resuming (bool): Resuming. Optional field.
        seeking (bool): Seeking playback location. Optional field.
        skipping_next (bool): Skipping to the next context. Optional field.
        skipping_prev (bool): Skipping to the previous context. Optional field.
        toggling_repeat_context (bool): Toggling repeat context flag. Optional
            field.
        toggling_shuffle (bool): Toggling shuffle flag. Optional field.
        toggling_repeat_track (bool): Toggling repeat track flag. Optional
            field.
        transferring_playback (bool): Transfering playback between devices.
            Optional field.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "interrupting_playback": 'interrupting_playback',
        "pausing": 'pausing',
        "resuming": 'resuming',
        "seeking": 'seeking',
        "skipping_next": 'skipping_next',
        "skipping_prev": 'skipping_prev',
        "toggling_repeat_context": 'toggling_repeat_context',
        "toggling_shuffle": 'toggling_shuffle',
        "toggling_repeat_track": 'toggling_repeat_track',
        "transferring_playback": 'transferring_playback'
    }

    _optionals = [
        'interrupting_playback',
        'pausing',
        'resuming',
        'seeking',
        'skipping_next',
        'skipping_prev',
        'toggling_repeat_context',
        'toggling_shuffle',
        'toggling_repeat_track',
        'transferring_playback',
    ]

    def __init__(self,
                 interrupting_playback=APIHelper.SKIP,
                 pausing=APIHelper.SKIP,
                 resuming=APIHelper.SKIP,
                 seeking=APIHelper.SKIP,
                 skipping_next=APIHelper.SKIP,
                 skipping_prev=APIHelper.SKIP,
                 toggling_repeat_context=APIHelper.SKIP,
                 toggling_shuffle=APIHelper.SKIP,
                 toggling_repeat_track=APIHelper.SKIP,
                 transferring_playback=APIHelper.SKIP):
        """Constructor for the DisallowsObject class"""

        # Initialize members of the class
        if interrupting_playback is not APIHelper.SKIP:
            self.interrupting_playback = interrupting_playback 
        if pausing is not APIHelper.SKIP:
            self.pausing = pausing 
        if resuming is not APIHelper.SKIP:
            self.resuming = resuming 
        if seeking is not APIHelper.SKIP:
            self.seeking = seeking 
        if skipping_next is not APIHelper.SKIP:
            self.skipping_next = skipping_next 
        if skipping_prev is not APIHelper.SKIP:
            self.skipping_prev = skipping_prev 
        if toggling_repeat_context is not APIHelper.SKIP:
            self.toggling_repeat_context = toggling_repeat_context 
        if toggling_shuffle is not APIHelper.SKIP:
            self.toggling_shuffle = toggling_shuffle 
        if toggling_repeat_track is not APIHelper.SKIP:
            self.toggling_repeat_track = toggling_repeat_track 
        if transferring_playback is not APIHelper.SKIP:
            self.transferring_playback = transferring_playback 

    @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
        interrupting_playback = dictionary.get("interrupting_playback") if "interrupting_playback" in dictionary.keys() else APIHelper.SKIP
        pausing = dictionary.get("pausing") if "pausing" in dictionary.keys() else APIHelper.SKIP
        resuming = dictionary.get("resuming") if "resuming" in dictionary.keys() else APIHelper.SKIP
        seeking = dictionary.get("seeking") if "seeking" in dictionary.keys() else APIHelper.SKIP
        skipping_next = dictionary.get("skipping_next") if "skipping_next" in dictionary.keys() else APIHelper.SKIP
        skipping_prev = dictionary.get("skipping_prev") if "skipping_prev" in dictionary.keys() else APIHelper.SKIP
        toggling_repeat_context = dictionary.get("toggling_repeat_context") if "toggling_repeat_context" in dictionary.keys() else APIHelper.SKIP
        toggling_shuffle = dictionary.get("toggling_shuffle") if "toggling_shuffle" in dictionary.keys() else APIHelper.SKIP
        toggling_repeat_track = dictionary.get("toggling_repeat_track") if "toggling_repeat_track" in dictionary.keys() else APIHelper.SKIP
        transferring_playback = dictionary.get("transferring_playback") if "transferring_playback" in dictionary.keys() else APIHelper.SKIP
        # Return an object of this model
        return cls(interrupting_playback,
                   pausing,
                   resuming,
                   seeking,
                   skipping_next,
                   skipping_prev,
                   toggling_repeat_context,
                   toggling_shuffle,
                   toggling_repeat_track,
                   transferring_playback)

    @classmethod
    def validate(cls, dictionary):
        """Validates dictionary against class required properties

        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:
            boolean : if dictionary is valid contains required properties.

        """

        if isinstance(dictionary, cls):
            return True

        if not isinstance(dictionary, dict):
            return False

        return True

    def __repr__(self):
        return (f'{self.__class__.__name__}('
                f'interrupting_playback={(self.interrupting_playback if hasattr(self, "interrupting_playback") else None)!r}, '
                f'pausing={(self.pausing if hasattr(self, "pausing") else None)!r}, '
                f'resuming={(self.resuming if hasattr(self, "resuming") else None)!r}, '
                f'seeking={(self.seeking if hasattr(self, "seeking") else None)!r}, '
                f'skipping_next={(self.skipping_next if hasattr(self, "skipping_next") else None)!r}, '
                f'skipping_prev={(self.skipping_prev if hasattr(self, "skipping_prev") else None)!r}, '
                f'toggling_repeat_context={(self.toggling_repeat_context if hasattr(self, "toggling_repeat_context") else None)!r}, '
                f'toggling_shuffle={(self.toggling_shuffle if hasattr(self, "toggling_shuffle") else None)!r}, '
                f'toggling_repeat_track={(self.toggling_repeat_track if hasattr(self, "toggling_repeat_track") else None)!r}, '
                f'transferring_playback={(self.transferring_playback if hasattr(self, "transferring_playback") else None)!r})')

    def __str__(self):
        return (f'{self.__class__.__name__}('
                f'interrupting_playback={(self.interrupting_playback if hasattr(self, "interrupting_playback") else None)!s}, '
                f'pausing={(self.pausing if hasattr(self, "pausing") else None)!s}, '
                f'resuming={(self.resuming if hasattr(self, "resuming") else None)!s}, '
                f'seeking={(self.seeking if hasattr(self, "seeking") else None)!s}, '
                f'skipping_next={(self.skipping_next if hasattr(self, "skipping_next") else None)!s}, '
                f'skipping_prev={(self.skipping_prev if hasattr(self, "skipping_prev") else None)!s}, '
                f'toggling_repeat_context={(self.toggling_repeat_context if hasattr(self, "toggling_repeat_context") else None)!s}, '
                f'toggling_shuffle={(self.toggling_shuffle if hasattr(self, "toggling_shuffle") else None)!s}, '
                f'toggling_repeat_track={(self.toggling_repeat_track if hasattr(self, "toggling_repeat_track") else None)!s}, '
                f'transferring_playback={(self.transferring_playback if hasattr(self, "transferring_playback") else None)!s})')
