create_schedule_contract.py•12.1 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 CreateScheduleContract(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 = {
"workflow_id": "str",
"iteration": "IterationContract",
"name": "str",
"comment": "str",
"priority": "str",
"worker_tag": "str",
"credential_id": "str",
"time_zone": "str",
"questions": "list[AppValue]",
}
attribute_map = {
"workflow_id": "workflowId",
"iteration": "iteration",
"name": "name",
"comment": "comment",
"priority": "priority",
"worker_tag": "workerTag",
"credential_id": "credentialId",
"time_zone": "timeZone",
"questions": "questions",
}
def __init__(
self,
workflow_id=None,
iteration=None,
name=None,
comment=None,
priority=None,
worker_tag=None,
credential_id=None,
time_zone=None,
questions=None,
_configuration=None,
): # noqa: E501
"""CreateScheduleContract - a model defined in Swagger""" # noqa: E501
if _configuration is None:
_configuration = Configuration()
self._configuration = _configuration
self._workflow_id = None
self._iteration = None
self._name = None
self._comment = None
self._priority = None
self._worker_tag = None
self._credential_id = None
self._time_zone = None
self._questions = None
self.discriminator = None
self.workflow_id = workflow_id
self.iteration = iteration
if name is not None:
self.name = name
if comment is not None:
self.comment = comment
if priority is not None:
self.priority = priority
if worker_tag is not None:
self.worker_tag = worker_tag
if credential_id is not None:
self.credential_id = credential_id
if time_zone is not None:
self.time_zone = time_zone
if questions is not None:
self.questions = questions
@property
def workflow_id(self):
"""Gets the workflow_id of this CreateScheduleContract. # noqa: E501
:return: The workflow_id of this CreateScheduleContract. # noqa: E501
:rtype: str
"""
return self._workflow_id
@workflow_id.setter
def workflow_id(self, workflow_id):
"""Sets the workflow_id of this CreateScheduleContract.
:param workflow_id: The workflow_id of this CreateScheduleContract. # noqa: E501
:type: str
"""
if self._configuration.client_side_validation and workflow_id is None:
raise ValueError("Invalid value for `workflow_id`, must not be `None`") # noqa: E501
self._workflow_id = workflow_id
@property
def iteration(self):
"""Gets the iteration of this CreateScheduleContract. # noqa: E501
Contains a property corresponding to each IterationType value. # noqa: E501
:return: The iteration of this CreateScheduleContract. # noqa: E501
:rtype: IterationContract
"""
return self._iteration
@iteration.setter
def iteration(self, iteration):
"""Sets the iteration of this CreateScheduleContract.
Contains a property corresponding to each IterationType value. # noqa: E501
:param iteration: The iteration of this CreateScheduleContract. # noqa: E501
:type: IterationContract
"""
if self._configuration.client_side_validation and iteration is None:
raise ValueError("Invalid value for `iteration`, must not be `None`") # noqa: E501
self._iteration = iteration
@property
def name(self):
"""Gets the name of this CreateScheduleContract. # noqa: E501
:return: The name of this CreateScheduleContract. # noqa: E501
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""Sets the name of this CreateScheduleContract.
:param name: The name of this CreateScheduleContract. # noqa: E501
:type: str
"""
if self._configuration.client_side_validation and name is not None and len(name) > 256:
raise ValueError("Invalid value for `name`, length must be less than or equal to `256`") # noqa: E501
if self._configuration.client_side_validation and name is not None and len(name) < 0:
raise ValueError("Invalid value for `name`, length must be greater than or equal to `0`") # noqa: E501
self._name = name
@property
def comment(self):
"""Gets the comment of this CreateScheduleContract. # noqa: E501
:return: The comment of this CreateScheduleContract. # noqa: E501
:rtype: str
"""
return self._comment
@comment.setter
def comment(self, comment):
"""Sets the comment of this CreateScheduleContract.
:param comment: The comment of this CreateScheduleContract. # noqa: E501
:type: str
"""
if self._configuration.client_side_validation and comment is not None and len(comment) > 1024:
raise ValueError("Invalid value for `comment`, length must be less than or equal to `1024`") # noqa: E501
if self._configuration.client_side_validation and comment is not None and len(comment) < 0:
raise ValueError("Invalid value for `comment`, length must be greater than or equal to `0`") # noqa: E501
self._comment = comment
@property
def priority(self):
"""Gets the priority of this CreateScheduleContract. # noqa: E501
Optional Priority of schedule execution. Authenticated user must be enabled to set priority or be a Curator,
else this property is ignored. # noqa: E501
:return: The priority of this CreateScheduleContract. # noqa: E501
:rtype: str
"""
return self._priority
@priority.setter
def priority(self, priority):
"""Sets the priority of this CreateScheduleContract.
Optional Priority of schedule execution. Authenticated user must be enabled to set priority or be a Curator,
else this property is ignored. # noqa: E501
:param priority:
The priority of this CreateScheduleContract.
:type: str
"""
allowed_values = ["Default", "Low", "Medium", "High", "Critical"] # noqa: E501
if self._configuration.client_side_validation and priority not in allowed_values:
raise ValueError(
"Invalid value for `priority` ({0}), must be one of {1}".format(priority, allowed_values) # noqa: E501
)
self._priority = priority
@property
def worker_tag(self):
"""Gets the worker_tag of this CreateScheduleContract. # noqa: E501
Optional WorkerTag for schedule execution. Authenticated user must be enabled to set worker tags,
else this property is ignored. # noqa: E501
:return: The worker_tag of this CreateScheduleContract. # noqa: E501
:rtype: str
"""
return self._worker_tag
@worker_tag.setter
def worker_tag(self, worker_tag):
"""Sets the worker_tag of this CreateScheduleContract.
Optional WorkerTag for schedule execution. Authenticated user must be enabled to set worker tags,
else this property is ignored. # noqa: E501
:param worker_tag:
The worker_tag of this CreateScheduleContract.
:type: str
"""
self._worker_tag = worker_tag
@property
def credential_id(self):
"""Gets the credential_id of this CreateScheduleContract. # noqa: E501
Optional Credential to be used for schedule execution. # noqa: E501
:return: The credential_id of this CreateScheduleContract. # noqa: E501
:rtype: str
"""
return self._credential_id
@credential_id.setter
def credential_id(self, credential_id):
"""Sets the credential_id of this CreateScheduleContract.
Optional Credential to be used for schedule execution. # noqa: E501
:param credential_id: The credential_id of this CreateScheduleContract. # noqa: E501
:type: str
"""
self._credential_id = credential_id
@property
def time_zone(self):
"""Gets the time_zone of this CreateScheduleContract. # noqa: E501
Optional TimeZone to be used for schedule execution. # noqa: E501
:return: The time_zone of this CreateScheduleContract. # noqa: E501
:rtype: str
"""
return self._time_zone
@time_zone.setter
def time_zone(self, time_zone):
"""Sets the time_zone of this CreateScheduleContract.
Optional TimeZone to be used for schedule execution. # noqa: E501
:param time_zone: The time_zone of this CreateScheduleContract. # noqa: E501
:type: str
"""
self._time_zone = time_zone
@property
def questions(self):
"""Gets the questions of this CreateScheduleContract. # noqa: E501
Analytic App Question and Answers # noqa: E501
:return: The questions of this CreateScheduleContract. # noqa: E501
:rtype: list[AppValue]
"""
return self._questions
@questions.setter
def questions(self, questions):
"""Sets the questions of this CreateScheduleContract.
Analytic App Question and Answers # noqa: E501
:param questions: The questions of this CreateScheduleContract. # noqa: E501
:type: list[AppValue]
"""
self._questions = questions
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(CreateScheduleContract, 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, CreateScheduleContract):
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, CreateScheduleContract):
return True
return self.to_dict() != other.to_dict()