# coding: utf-8

"""
Alteryx Server API V3

No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

OpenAPI spec version: 3

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re  # noqa: F401

import six

from src.server_client.configuration import Configuration


class IterationContract(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 = {
        "iteration_type": "str",
        "start_time": "datetime",
        "end_time": "datetime",
        "hourly_contract": "IterationHourlyContract",
        "daily_contract": "IterationDailyContract",
        "weekly_contract": "IterationWeeklyContract",
        "monthly_contract": "IterationMonthlyContract",
        "custom_contract": "IterationCustomContract",
    }

    attribute_map = {
        "iteration_type": "iterationType",
        "start_time": "startTime",
        "end_time": "endTime",
        "hourly_contract": "hourlyContract",
        "daily_contract": "dailyContract",
        "weekly_contract": "weeklyContract",
        "monthly_contract": "monthlyContract",
        "custom_contract": "customContract",
    }

    def __init__(
        self,
        iteration_type=None,
        start_time=None,
        end_time=None,
        hourly_contract=None,
        daily_contract=None,
        weekly_contract=None,
        monthly_contract=None,
        custom_contract=None,
        _configuration=None,
    ):  # noqa: E501
        """IterationContract - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._iteration_type = None
        self._start_time = None
        self._end_time = None
        self._hourly_contract = None
        self._daily_contract = None
        self._weekly_contract = None
        self._monthly_contract = None
        self._custom_contract = None
        self.discriminator = None

        self.iteration_type = iteration_type
        self.start_time = start_time
        if end_time is not None:
            self.end_time = end_time
        if hourly_contract is not None:
            self.hourly_contract = hourly_contract
        if daily_contract is not None:
            self.daily_contract = daily_contract
        if weekly_contract is not None:
            self.weekly_contract = weekly_contract
        if monthly_contract is not None:
            self.monthly_contract = monthly_contract
        if custom_contract is not None:
            self.custom_contract = custom_contract

    @property
    def iteration_type(self):
        """Gets the iteration_type of this IterationContract.  # noqa: E501


        :return: The iteration_type of this IterationContract.  # noqa: E501
        :rtype: str
        """
        return self._iteration_type

    @iteration_type.setter
    def iteration_type(self, iteration_type):
        """Sets the iteration_type of this IterationContract.


        :param iteration_type: The iteration_type of this IterationContract.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and iteration_type is None:
            raise ValueError("Invalid value for `iteration_type`, must not be `None`")  # noqa: E501
        allowed_values = ["Once", "Hourly", "Weekly", "Monthly", "Custom", "Daily"]  # noqa: E501
        if self._configuration.client_side_validation and iteration_type not in allowed_values:
            raise ValueError(
                "Invalid value for `iteration_type` ({0}), must be one of {1}".format(iteration_type, allowed_values)  # noqa: E501
            )

        self._iteration_type = iteration_type

    @property
    def start_time(self):
        """Gets the start_time of this IterationContract.  # noqa: E501

        Start Date Time as UTC-0  # noqa: E501

        :return: The start_time of this IterationContract.  # noqa: E501
        :rtype: datetime
        """
        return self._start_time

    @start_time.setter
    def start_time(self, start_time):
        """Sets the start_time of this IterationContract.

        Start Date Time as UTC-0  # noqa: E501

        :param start_time: The start_time of this IterationContract.  # noqa: E501
        :type: datetime
        """
        if self._configuration.client_side_validation and start_time is None:
            raise ValueError("Invalid value for `start_time`, must not be `None`")  # noqa: E501

        self._start_time = start_time

    @property
    def end_time(self):
        """Gets the end_time of this IterationContract.  # noqa: E501

        End Date Time as UTC-0  Optional, if excluded the iteration will be indefinite.   
            Ignored for "Single" IterationType  # noqa: E501

        :return: The end_time of this IterationContract.  # noqa: E501
        :rtype: datetime
        """
        return self._end_time

    @end_time.setter
    def end_time(self, end_time):
        """Sets the end_time of this IterationContract.

        End Date Time as UTC-0  Optional, if excluded the iteration will be indefinite.   
        Ignored for "Single" IterationType  # noqa: E501

        :param end_time: The end_time of this IterationContract.  # noqa: E501
        :type: datetime
        """

        self._end_time = end_time

    @property
    def hourly_contract(self):
        """Gets the hourly_contract of this IterationContract.  # noqa: E501

        Required when the IterationType is Hourly  # noqa: E501

        :return: The hourly_contract of this IterationContract.  # noqa: E501
        :rtype: IterationHourlyContract
        """
        return self._hourly_contract

    @hourly_contract.setter
    def hourly_contract(self, hourly_contract):
        """Sets the hourly_contract of this IterationContract.

        Required when the IterationType is Hourly  # noqa: E501

        :param hourly_contract: The hourly_contract of this IterationContract.  # noqa: E501
        :type: IterationHourlyContract
        """

        self._hourly_contract = hourly_contract

    @property
    def daily_contract(self):
        """Gets the daily_contract of this IterationContract.  # noqa: E501

        Required when the IterationType is Daily  # noqa: E501

        :return: The daily_contract of this IterationContract.  # noqa: E501
        :rtype: IterationDailyContract
        """
        return self._daily_contract

    @daily_contract.setter
    def daily_contract(self, daily_contract):
        """Sets the daily_contract of this IterationContract.

        Required when the IterationType is Daily  # noqa: E501

        :param daily_contract: The daily_contract of this IterationContract.  # noqa: E501
        :type: IterationDailyContract
        """

        self._daily_contract = daily_contract

    @property
    def weekly_contract(self):
        """Gets the weekly_contract of this IterationContract.  # noqa: E501

        Required when the IterationType is Weekly  # noqa: E501

        :return: The weekly_contract of this IterationContract.  # noqa: E501
        :rtype: IterationWeeklyContract
        """
        return self._weekly_contract

    @weekly_contract.setter
    def weekly_contract(self, weekly_contract):
        """Sets the weekly_contract of this IterationContract.

        Required when the IterationType is Weekly  # noqa: E501

        :param weekly_contract: The weekly_contract of this IterationContract.  # noqa: E501
        :type: IterationWeeklyContract
        """

        self._weekly_contract = weekly_contract

    @property
    def monthly_contract(self):
        """Gets the monthly_contract of this IterationContract.  # noqa: E501

        Required when the IterationType is Monthly  # noqa: E501

        :return: The monthly_contract of this IterationContract.  # noqa: E501
        :rtype: IterationMonthlyContract
        """
        return self._monthly_contract

    @monthly_contract.setter
    def monthly_contract(self, monthly_contract):
        """Sets the monthly_contract of this IterationContract.

        Required when the IterationType is Monthly  # noqa: E501

        :param monthly_contract: The monthly_contract of this IterationContract.  # noqa: E501
        :type: IterationMonthlyContract
        """

        self._monthly_contract = monthly_contract

    @property
    def custom_contract(self):
        """Gets the custom_contract of this IterationContract.  # noqa: E501

        Required when the IterationType is Custom  # noqa: E501

        :return: The custom_contract of this IterationContract.  # noqa: E501
        :rtype: IterationCustomContract
        """
        return self._custom_contract

    @custom_contract.setter
    def custom_contract(self, custom_contract):
        """Sets the custom_contract of this IterationContract.

        Required when the IterationType is Custom  # noqa: E501

        :param custom_contract: The custom_contract of this IterationContract.  # noqa: E501
        :type: IterationCustomContract
        """

        self._custom_contract = custom_contract

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

        for attr, _ in six.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
        if issubclass(IterationContract, dict):
            for key, value in self.items():
                result[key] = value

        return result

    def to_str(self):
        """Returns the string representation of the model"""
        return pprint.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, IterationContract):
            return False

        return self.to_dict() == other.to_dict()

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

        return self.to_dict() != other.to_dict()
