# coding: utf-8

"""
    Knetik Platform API Documentation latest 

    This is the spec for the Knetik API.  Use this in conjunction with the documentation found at https://knetikcloud.com.

    OpenAPI spec version: latest 
    Contact: support@knetik.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from pprint import pformat
from six import iteritems
import re


class CreateActivityOccurrenceRequest(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """


    """
    Attributes:
      swagger_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    """
    swagger_types = {
        'activity_id': 'int',
        'challenge_activity_id': 'int',
        'core_settings': 'CoreActivityOccurrenceSettings',
        'entitlement': 'ItemIdRequest',
        'event_id': 'int',
        'host': 'int',
        'settings': 'list[SelectedSettingRequest]',
        'simulated': 'bool',
        'status': 'str',
        'users': 'list[Participant]'
    }

    attribute_map = {
        'activity_id': 'activity_id',
        'challenge_activity_id': 'challenge_activity_id',
        'core_settings': 'core_settings',
        'entitlement': 'entitlement',
        'event_id': 'event_id',
        'host': 'host',
        'settings': 'settings',
        'simulated': 'simulated',
        'status': 'status',
        'users': 'users'
    }

    def __init__(self, activity_id=None, challenge_activity_id=None, core_settings=None, entitlement=None, event_id=None, host=None, settings=None, simulated=None, status=None, users=None):
        """
        CreateActivityOccurrenceRequest - a model defined in Swagger
        """

        self._activity_id = None
        self._challenge_activity_id = None
        self._core_settings = None
        self._entitlement = None
        self._event_id = None
        self._host = None
        self._settings = None
        self._simulated = None
        self._status = None
        self._users = None
        self.discriminator = None

        if activity_id is not None:
          self.activity_id = activity_id
        if challenge_activity_id is not None:
          self.challenge_activity_id = challenge_activity_id
        if core_settings is not None:
          self.core_settings = core_settings
        if entitlement is not None:
          self.entitlement = entitlement
        if event_id is not None:
          self.event_id = event_id
        if host is not None:
          self.host = host
        if settings is not None:
          self.settings = settings
        if simulated is not None:
          self.simulated = simulated
        if status is not None:
          self.status = status
        if users is not None:
          self.users = users

    @property
    def activity_id(self):
        """
        Gets the activity_id of this CreateActivityOccurrenceRequest.
        The id of the activity, only needed when outside of challenge/event

        :return: The activity_id of this CreateActivityOccurrenceRequest.
        :rtype: int
        """
        return self._activity_id

    @activity_id.setter
    def activity_id(self, activity_id):
        """
        Sets the activity_id of this CreateActivityOccurrenceRequest.
        The id of the activity, only needed when outside of challenge/event

        :param activity_id: The activity_id of this CreateActivityOccurrenceRequest.
        :type: int
        """

        self._activity_id = activity_id

    @property
    def challenge_activity_id(self):
        """
        Gets the challenge_activity_id of this CreateActivityOccurrenceRequest.
        The id of the challenge activity (required if playing in a challenge/event). Note that this is the challenge_activity_id in case the same activity apears twice in the challenge.

        :return: The challenge_activity_id of this CreateActivityOccurrenceRequest.
        :rtype: int
        """
        return self._challenge_activity_id

    @challenge_activity_id.setter
    def challenge_activity_id(self, challenge_activity_id):
        """
        Sets the challenge_activity_id of this CreateActivityOccurrenceRequest.
        The id of the challenge activity (required if playing in a challenge/event). Note that this is the challenge_activity_id in case the same activity apears twice in the challenge.

        :param challenge_activity_id: The challenge_activity_id of this CreateActivityOccurrenceRequest.
        :type: int
        """

        self._challenge_activity_id = challenge_activity_id

    @property
    def core_settings(self):
        """
        Gets the core_settings of this CreateActivityOccurrenceRequest.
        Defines core settings about the activity that affect how it can be created/played by users.

        :return: The core_settings of this CreateActivityOccurrenceRequest.
        :rtype: CoreActivityOccurrenceSettings
        """
        return self._core_settings

    @core_settings.setter
    def core_settings(self, core_settings):
        """
        Sets the core_settings of this CreateActivityOccurrenceRequest.
        Defines core settings about the activity that affect how it can be created/played by users.

        :param core_settings: The core_settings of this CreateActivityOccurrenceRequest.
        :type: CoreActivityOccurrenceSettings
        """

        self._core_settings = core_settings

    @property
    def entitlement(self):
        """
        Gets the entitlement of this CreateActivityOccurrenceRequest.
        The entitlement item required to enter the occurrence. Required if not part of an event. Must come from the set of entitlement items listed in the activity

        :return: The entitlement of this CreateActivityOccurrenceRequest.
        :rtype: ItemIdRequest
        """
        return self._entitlement

    @entitlement.setter
    def entitlement(self, entitlement):
        """
        Sets the entitlement of this CreateActivityOccurrenceRequest.
        The entitlement item required to enter the occurrence. Required if not part of an event. Must come from the set of entitlement items listed in the activity

        :param entitlement: The entitlement of this CreateActivityOccurrenceRequest.
        :type: ItemIdRequest
        """

        self._entitlement = entitlement

    @property
    def event_id(self):
        """
        Gets the event_id of this CreateActivityOccurrenceRequest.
        The id of the event this occurence is a part of, if any

        :return: The event_id of this CreateActivityOccurrenceRequest.
        :rtype: int
        """
        return self._event_id

    @event_id.setter
    def event_id(self, event_id):
        """
        Sets the event_id of this CreateActivityOccurrenceRequest.
        The id of the event this occurence is a part of, if any

        :param event_id: The event_id of this CreateActivityOccurrenceRequest.
        :type: int
        """

        self._event_id = event_id

    @property
    def host(self):
        """
        Gets the host of this CreateActivityOccurrenceRequest.
        The host of the occurrence, if not a participant (will be left out of users array). Must be the caller that creates the occurrence unless admin. Requires activity/challenge to allow host_option of 'non_player' if not admin as well

        :return: The host of this CreateActivityOccurrenceRequest.
        :rtype: int
        """
        return self._host

    @host.setter
    def host(self, host):
        """
        Sets the host of this CreateActivityOccurrenceRequest.
        The host of the occurrence, if not a participant (will be left out of users array). Must be the caller that creates the occurrence unless admin. Requires activity/challenge to allow host_option of 'non_player' if not admin as well

        :param host: The host of this CreateActivityOccurrenceRequest.
        :type: int
        """

        self._host = host

    @property
    def settings(self):
        """
        Gets the settings of this CreateActivityOccurrenceRequest.
        The values selected from the available settings defined for the activity. Ex: difficulty: hard. Can be left out if the activity is played during an event and the settings are already set at the event level. Ex: every monday, difficulty: hard, number of questions: 10, category: sport. Otherwise, the set must exactly match those of the activity.

        :return: The settings of this CreateActivityOccurrenceRequest.
        :rtype: list[SelectedSettingRequest]
        """
        return self._settings

    @settings.setter
    def settings(self, settings):
        """
        Sets the settings of this CreateActivityOccurrenceRequest.
        The values selected from the available settings defined for the activity. Ex: difficulty: hard. Can be left out if the activity is played during an event and the settings are already set at the event level. Ex: every monday, difficulty: hard, number of questions: 10, category: sport. Otherwise, the set must exactly match those of the activity.

        :param settings: The settings of this CreateActivityOccurrenceRequest.
        :type: list[SelectedSettingRequest]
        """

        self._settings = settings

    @property
    def simulated(self):
        """
        Gets the simulated of this CreateActivityOccurrenceRequest.
        Whether this occurrence will be ran as a simulation. Simulations will not be rewarded. Useful for bot play or trials

        :return: The simulated of this CreateActivityOccurrenceRequest.
        :rtype: bool
        """
        return self._simulated

    @simulated.setter
    def simulated(self, simulated):
        """
        Sets the simulated of this CreateActivityOccurrenceRequest.
        Whether this occurrence will be ran as a simulation. Simulations will not be rewarded. Useful for bot play or trials

        :param simulated: The simulated of this CreateActivityOccurrenceRequest.
        :type: bool
        """

        self._simulated = simulated

    @property
    def status(self):
        """
        Gets the status of this CreateActivityOccurrenceRequest.
        The current status of the occurrence (default: SETUP).

        :return: The status of this CreateActivityOccurrenceRequest.
        :rtype: str
        """
        return self._status

    @status.setter
    def status(self, status):
        """
        Sets the status of this CreateActivityOccurrenceRequest.
        The current status of the occurrence (default: SETUP).

        :param status: The status of this CreateActivityOccurrenceRequest.
        :type: str
        """
        allowed_values = ["SETUP", "OPEN", "LAUNCHING", "PLAYING", "FINISHED", "ABANDONED"]
        if status not in allowed_values:
            raise ValueError(
                "Invalid value for `status` ({0}), must be one of {1}"
                .format(status, allowed_values)
            )

        self._status = status

    @property
    def users(self):
        """
        Gets the users of this CreateActivityOccurrenceRequest.
        The list of users participating in this occurrence. Can only be set directly with ACTIVITIES_ADMIN permission

        :return: The users of this CreateActivityOccurrenceRequest.
        :rtype: list[Participant]
        """
        return self._users

    @users.setter
    def users(self, users):
        """
        Sets the users of this CreateActivityOccurrenceRequest.
        The list of users participating in this occurrence. Can only be set directly with ACTIVITIES_ADMIN permission

        :param users: The users of this CreateActivityOccurrenceRequest.
        :type: list[Participant]
        """

        self._users = users

    def to_dict(self):
        """
        Returns the model properties as a dict
        """
        result = {}

        for attr, _ in iteritems(self.swagger_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
                    value
                ))
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1].to_dict())
                    if hasattr(item[1], "to_dict") else item,
                    value.items()
                ))
            else:
                result[attr] = value

        return result

    def to_str(self):
        """
        Returns the string representation of the model
        """
        return pformat(self.to_dict())

    def __repr__(self):
        """
        For `print` and `pprint`
        """
        return self.to_str()

    def __eq__(self, other):
        """
        Returns true if both objects are equal
        """
        if not isinstance(other, CreateActivityOccurrenceRequest):
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """
        Returns true if both objects are not equal
        """
        return not self == other
