iteration_monthly_contract.py•7.13 kB
# 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 IterationMonthlyContract(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 = {"simple_day_of_month": "bool", "day_of_month": "int", "occurrence": "int", "day_of_week": "str"}
attribute_map = {
"simple_day_of_month": "simpleDayOfMonth",
"day_of_month": "dayOfMonth",
"occurrence": "occurrence",
"day_of_week": "dayOfWeek",
}
def __init__(
self, simple_day_of_month=None, day_of_month=None, occurrence=None, day_of_week=None, _configuration=None
): # noqa: E501
"""IterationMonthlyContract - a model defined in Swagger""" # noqa: E501
if _configuration is None:
_configuration = Configuration()
self._configuration = _configuration
self._simple_day_of_month = None
self._day_of_month = None
self._occurrence = None
self._day_of_week = None
self.discriminator = None
self.simple_day_of_month = simple_day_of_month
if day_of_month is not None:
self.day_of_month = day_of_month
if occurrence is not None:
self.occurrence = occurrence
if day_of_week is not None:
self.day_of_week = day_of_week
@property
def simple_day_of_month(self):
"""Gets the simple_day_of_month of this IterationMonthlyContract. # noqa: E501
:return: The simple_day_of_month of this IterationMonthlyContract. # noqa: E501
:rtype: bool
"""
return self._simple_day_of_month
@simple_day_of_month.setter
def simple_day_of_month(self, simple_day_of_month):
"""Sets the simple_day_of_month of this IterationMonthlyContract.
:param simple_day_of_month: The simple_day_of_month of this IterationMonthlyContract. # noqa: E501
:type: bool
"""
if self._configuration.client_side_validation and simple_day_of_month is None:
raise ValueError("Invalid value for `simple_day_of_month`, must not be `None`") # noqa: E501
self._simple_day_of_month = simple_day_of_month
@property
def day_of_month(self):
"""Gets the day_of_month of this IterationMonthlyContract. # noqa: E501
15 would be the 15th of each month. Required when SimpleDayOfMonth is true. # noqa: E501
:return: The day_of_month of this IterationMonthlyContract. # noqa: E501
:rtype: int
"""
return self._day_of_month
@day_of_month.setter
def day_of_month(self, day_of_month):
"""Sets the day_of_month of this IterationMonthlyContract.
15 would be the 15th of each month. Required when SimpleDayOfMonth is true. # noqa: E501
:param day_of_month: The day_of_month of this IterationMonthlyContract. # noqa: E501
:type: int
"""
self._day_of_month = day_of_month
@property
def occurrence(self):
"""Gets the occurrence of this IterationMonthlyContract. # noqa: E501
3 would imply the 3rd X of every month. Required when SimpleDayOfMonth is false. # noqa: E501
:return: The occurrence of this IterationMonthlyContract. # noqa: E501
:rtype: int
"""
return self._occurrence
@occurrence.setter
def occurrence(self, occurrence):
"""Sets the occurrence of this IterationMonthlyContract.
3 would imply the 3rd X of every month. Required when SimpleDayOfMonth is false. # noqa: E501
:param occurrence: The occurrence of this IterationMonthlyContract. # noqa: E501
:type: int
"""
self._occurrence = occurrence
@property
def day_of_week(self):
"""Gets the day_of_week of this IterationMonthlyContract. # noqa: E501
0 = \"Sunday\" 0 implies the Xth Sunday of every month. Required when SimpleDayOfMonth is false. # noqa: E501
:return: The day_of_week of this IterationMonthlyContract. # noqa: E501
:rtype: str
"""
return self._day_of_week
@day_of_week.setter
def day_of_week(self, day_of_week):
"""Sets the day_of_week of this IterationMonthlyContract.
0 = \"Sunday\" 0 implies the Xth Sunday of every month. Required when SimpleDayOfMonth is false. # noqa: E501
:param day_of_week: The day_of_week of this IterationMonthlyContract. # noqa: E501
:type: str
"""
allowed_values = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] # noqa: E501
if self._configuration.client_side_validation and day_of_week not in allowed_values:
raise ValueError(
"Invalid value for `day_of_week` ({0}), must be one of {1}".format(day_of_week, allowed_values) # noqa: E501
)
self._day_of_week = day_of_week
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(IterationMonthlyContract, 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, IterationMonthlyContract):
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, IterationMonthlyContract):
return True
return self.to_dict() != other.to_dict()