-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathpoll_data.py
More file actions
197 lines (152 loc) · 5.61 KB
/
Copy pathpoll_data.py
File metadata and controls
197 lines (152 loc) · 5.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
import pprint
import re # noqa: F401
import six
from dataclasses import dataclass, field, fields
from typing import Dict, List, Optional, Any
from dataclasses import InitVar
@dataclass
class PollData:
"""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 = {
'queue_name': 'str',
'domain': 'str',
'worker_id': 'str',
'last_poll_time': 'int'
}
attribute_map = {
'queue_name': 'queueName',
'domain': 'domain',
'worker_id': 'workerId',
'last_poll_time': 'lastPollTime'
}
queue_name: Optional[str] = field(default=None)
domain: Optional[str] = field(default=None)
worker_id: Optional[str] = field(default=None)
last_poll_time: Optional[int] = field(default=None)
# Private backing fields for properties
_queue_name: Optional[str] = field(default=None, init=False, repr=False)
_domain: Optional[str] = field(default=None, init=False, repr=False)
_worker_id: Optional[str] = field(default=None, init=False, repr=False)
_last_poll_time: Optional[int] = field(default=None, init=False, repr=False)
discriminator: Optional[str] = field(default=None, init=False, repr=False)
def __init__(self, queue_name=None, domain=None, worker_id=None, last_poll_time=None): # noqa: E501
"""PollData - a model defined in Swagger""" # noqa: E501
self._queue_name = None
self._domain = None
self._worker_id = None
self._last_poll_time = None
self.discriminator = None
if queue_name is not None:
self.queue_name = queue_name
if domain is not None:
self.domain = domain
if worker_id is not None:
self.worker_id = worker_id
if last_poll_time is not None:
self.last_poll_time = last_poll_time
def __post_init__(self):
"""Initialize private fields after dataclass initialization"""
pass
@property
def queue_name(self):
"""Gets the queue_name of this PollData. # noqa: E501
:return: The queue_name of this PollData. # noqa: E501
:rtype: str
"""
return self._queue_name
@queue_name.setter
def queue_name(self, queue_name):
"""Sets the queue_name of this PollData.
:param queue_name: The queue_name of this PollData. # noqa: E501
:type: str
"""
self._queue_name = queue_name
@property
def domain(self):
"""Gets the domain of this PollData. # noqa: E501
:return: The domain of this PollData. # noqa: E501
:rtype: str
"""
return self._domain
@domain.setter
def domain(self, domain):
"""Sets the domain of this PollData.
:param domain: The domain of this PollData. # noqa: E501
:type: str
"""
self._domain = domain
@property
def worker_id(self):
"""Gets the worker_id of this PollData. # noqa: E501
:return: The worker_id of this PollData. # noqa: E501
:rtype: str
"""
return self._worker_id
@worker_id.setter
def worker_id(self, worker_id):
"""Sets the worker_id of this PollData.
:param worker_id: The worker_id of this PollData. # noqa: E501
:type: str
"""
self._worker_id = worker_id
@property
def last_poll_time(self):
"""Gets the last_poll_time of this PollData. # noqa: E501
:return: The last_poll_time of this PollData. # noqa: E501
:rtype: int
"""
return self._last_poll_time
@last_poll_time.setter
def last_poll_time(self, last_poll_time):
"""Sets the last_poll_time of this PollData.
:param last_poll_time: The last_poll_time of this PollData. # noqa: E501
:type: int
"""
self._last_poll_time = last_poll_time
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(PollData, 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, PollData):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other