enqueue_job_contract.py•5.95 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 EnqueueJobContract(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 = {"worker_tag": "str", "credential_id": "str", "questions": "list[AppValue]", "priority": "str"}
attribute_map = {
"worker_tag": "workerTag",
"credential_id": "credentialId",
"questions": "questions",
"priority": "priority",
}
def __init__(self, worker_tag=None, credential_id=None, questions=None, priority=None, _configuration=None): # noqa: E501
"""EnqueueJobContract - a model defined in Swagger""" # noqa: E501
if _configuration is None:
_configuration = Configuration()
self._configuration = _configuration
self._worker_tag = None
self._credential_id = None
self._questions = None
self._priority = None
self.discriminator = None
if worker_tag is not None:
self.worker_tag = worker_tag
if credential_id is not None:
self.credential_id = credential_id
if questions is not None:
self.questions = questions
if priority is not None:
self.priority = priority
@property
def worker_tag(self):
"""Gets the worker_tag of this EnqueueJobContract. # noqa: E501
:return: The worker_tag of this EnqueueJobContract. # noqa: E501
:rtype: str
"""
return self._worker_tag
@worker_tag.setter
def worker_tag(self, worker_tag):
"""Sets the worker_tag of this EnqueueJobContract.
:param worker_tag: The worker_tag of this EnqueueJobContract. # noqa: E501
:type: str
"""
self._worker_tag = worker_tag
@property
def credential_id(self):
"""Gets the credential_id of this EnqueueJobContract. # noqa: E501
:return: The credential_id of this EnqueueJobContract. # noqa: E501
:rtype: str
"""
return self._credential_id
@credential_id.setter
def credential_id(self, credential_id):
"""Sets the credential_id of this EnqueueJobContract.
:param credential_id: The credential_id of this EnqueueJobContract. # noqa: E501
:type: str
"""
self._credential_id = credential_id
@property
def questions(self):
"""Gets the questions of this EnqueueJobContract. # noqa: E501
:return: The questions of this EnqueueJobContract. # noqa: E501
:rtype: list[AppValue]
"""
return self._questions
@questions.setter
def questions(self, questions):
"""Sets the questions of this EnqueueJobContract.
:param questions: The questions of this EnqueueJobContract. # noqa: E501
:type: list[AppValue]
"""
self._questions = questions
@property
def priority(self):
"""Gets the priority of this EnqueueJobContract. # noqa: E501
:return: The priority of this EnqueueJobContract. # noqa: E501
:rtype: str
"""
return self._priority
@priority.setter
def priority(self, priority):
"""Sets the priority of this EnqueueJobContract.
:param priority: The priority of this EnqueueJobContract. # noqa: E501
: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
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(EnqueueJobContract, 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, EnqueueJobContract):
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, EnqueueJobContract):
return True
return self.to_dict() != other.to_dict()