flywheel-sdk 20.2.0rc3__py2.py3-none-any.whl → 20.3.2rc0__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. flywheel/__init__.py +7 -2
  2. flywheel/api/acquisitions_api.py +42 -0
  3. flywheel/api/analyses_api.py +42 -4
  4. flywheel/api/audit_trail_api.py +6 -0
  5. flywheel/api/auth_api.py +2 -0
  6. flywheel/api/batch_api.py +7 -0
  7. flywheel/api/bulk_api.py +2 -0
  8. flywheel/api/change_log_api.py +3 -0
  9. flywheel/api/collections_api.py +35 -0
  10. flywheel/api/config_api.py +4 -0
  11. flywheel/api/container_type_api.py +2 -0
  12. flywheel/api/containers_api.py +40 -0
  13. flywheel/api/data_view_executions_api.py +6 -0
  14. flywheel/api/dataexplorer_api.py +12 -0
  15. flywheel/api/devices_api.py +12 -0
  16. flywheel/api/dimse_api.py +9 -0
  17. flywheel/api/download_api.py +3 -0
  18. flywheel/api/files_api.py +19 -0
  19. flywheel/api/gears_api.py +18 -0
  20. flywheel/api/groups_api.py +27 -0
  21. flywheel/api/jobs_api.py +22 -0
  22. flywheel/api/jupyterlab_servers_api.py +3 -0
  23. flywheel/api/modalities_api.py +6 -0
  24. flywheel/api/packfiles_api.py +2 -0
  25. flywheel/api/projects_api.py +68 -0
  26. flywheel/api/reports_api.py +11 -0
  27. flywheel/api/resolve_api.py +3 -0
  28. flywheel/api/roles_api.py +6 -0
  29. flywheel/api/sessions_api.py +160 -0
  30. flywheel/api/site_api.py +16 -0
  31. flywheel/api/subjects_api.py +45 -0
  32. flywheel/api/tree_api.py +3 -0
  33. flywheel/api/uids_api.py +2 -0
  34. flywheel/api/upload_api.py +8 -0
  35. flywheel/api/users_api.py +20 -0
  36. flywheel/api/views_api.py +10 -0
  37. flywheel/api_client.py +1 -1
  38. flywheel/configuration.py +53 -2
  39. flywheel/flywheel.py +28 -2
  40. flywheel/models/__init__.py +8 -3
  41. flywheel/models/{project_copy_filter.py → copy_filter.py} +28 -28
  42. flywheel/models/{project_copy_status.py → copy_status.py} +1 -1
  43. flywheel/models/cvat_info.py +243 -0
  44. flywheel/models/cvat_settings.py +271 -0
  45. flywheel/models/cvat_settings_input.py +271 -0
  46. flywheel/models/cvat_sync_state.py +29 -0
  47. flywheel/models/features.py +55 -1
  48. flywheel/models/file.py +29 -1
  49. flywheel/models/file_list_output.py +29 -1
  50. flywheel/models/file_node.py +29 -1
  51. flywheel/models/file_output.py +29 -1
  52. flywheel/models/file_upsert_output.py +29 -1
  53. flywheel/models/mixins.py +0 -3
  54. flywheel/models/project_container_output.py +1 -1
  55. flywheel/models/project_copy_input.py +4 -4
  56. flywheel/models/project_modify.py +4 -4
  57. flywheel/models/project_node.py +1 -1
  58. flywheel/models/project_output.py +4 -4
  59. flywheel/models/project_settings_input.py +32 -4
  60. flywheel/models/project_settings_output.py +32 -4
  61. flywheel/models/search_parent_project.py +1 -1
  62. flywheel/models/search_parent_session.py +1 -0
  63. flywheel/models/session_container_output.py +1 -0
  64. flywheel/models/session_copy_input.py +251 -0
  65. flywheel/models/session_list_output.py +32 -4
  66. flywheel/models/session_node.py +1 -0
  67. flywheel/models/session_output.py +29 -1
  68. flywheel/util.py +10 -0
  69. {flywheel_sdk-20.2.0rc3.dist-info → flywheel_sdk-20.3.2rc0.dist-info}/METADATA +1 -1
  70. {flywheel_sdk-20.2.0rc3.dist-info → flywheel_sdk-20.3.2rc0.dist-info}/RECORD +73 -68
  71. {flywheel_sdk-20.2.0rc3.dist-info → flywheel_sdk-20.3.2rc0.dist-info}/WHEEL +1 -1
  72. {flywheel_sdk-20.2.0rc3.dist-info → flywheel_sdk-20.3.2rc0.dist-info}/licenses/LICENSE.txt +0 -0
  73. {flywheel_sdk-20.2.0rc3.dist-info → flywheel_sdk-20.3.2rc0.dist-info}/top_level.txt +0 -0
flywheel/configuration.py CHANGED
@@ -51,6 +51,7 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)):
51
51
  self.__logger_file = None
52
52
  self.__logger_format = None
53
53
  self.logger_formatter = None
54
+ self.__logging_filters = list()
54
55
 
55
56
  # Default Base url
56
57
  self.host = "https://dev.flywheel.io/api"
@@ -252,6 +253,56 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)):
252
253
  return "Python SDK Debug Report:\n"\
253
254
  "OS: {env}\n"\
254
255
  "Python Version: {pyversion}\n"\
255
- "Version of the API: 20.2.0-rc3\n"\
256
- "SDK Package Version: 20.2.0-rc3".\
256
+ "Version of the API: 20.3.2-rc0\n"\
257
+ "SDK Package Version: 20.3.2-rc0".\
257
258
  format(env=sys.platform, pyversion=sys.version)
259
+
260
+ def enable_message_cutoff(self, message_cutoff):
261
+ self.__logging_filters[:] = []
262
+
263
+ class SendFilter(logging.Filter):
264
+ def __init__(self, cutoff):
265
+ self.cutoff = cutoff
266
+
267
+ def filter(self, record):
268
+ # http.client lib doesn't use formatting strings
269
+ if record.msg.startswith("send: b'") and record.msg.endswith("'"):
270
+ data = record.msg[8:-1].encode("utf8").decode("unicode_escape")
271
+ data_len = len(data)
272
+ if data_len > self.cutoff:
273
+ first_part = data[:(self.cutoff//2)]
274
+ last_part = data[-(self.cutoff//2):]
275
+ shortened = f"{first_part}...[{data_len} bytes total]...{last_part}"
276
+ shortened_bytes = shortened.encode("utf8")
277
+ record.msg = f"send: {shortened_bytes!r}"
278
+ return True
279
+
280
+ filt = SendFilter(message_cutoff)
281
+ logger = logging.getLogger("http.client")
282
+ logger.addFilter(filt)
283
+ self.__logging_filters.append((logger, filt))
284
+
285
+ class ReceiveFilter(logging.Filter):
286
+ def __init__(self, cutoff):
287
+ self.cutoff = cutoff
288
+
289
+ def filter(self, record):
290
+ if record.msg == "response body: %s" and len(record.args) == 1:
291
+ body = record.args[0]
292
+ body_len = len(body)
293
+ if body_len > self.cutoff:
294
+ first_part = body[:(self.cutoff//2)]
295
+ last_part = body[-(self.cutoff//2):]
296
+ shortened = f"{first_part}...[{body_len} bytes total]...{last_part}"
297
+ record.args = (shortened,)
298
+ return True
299
+
300
+ filt = ReceiveFilter(message_cutoff)
301
+ logger = logging.getLogger("flywheel.rest")
302
+ logger.addFilter(filt)
303
+ self.__logging_filters.append((logger, filt))
304
+
305
+ def disable_message_cutoff(self):
306
+ for logger, filt in self.__logging_filters:
307
+ logger.removeFilter(filt)
308
+ self.__logging_filters[:] = []
flywheel/flywheel.py CHANGED
@@ -40,7 +40,7 @@ from flywheel.view_builder import ViewBuilder
40
40
  from flywheel.finder import Finder
41
41
  import flywheel.api
42
42
 
43
- SDK_VERSION = "20.2.0-rc3"
43
+ SDK_VERSION = "20.3.2-rc0"
44
44
 
45
45
  def config_from_api_key(api_key):
46
46
  parts = api_key.split(':')
@@ -194,6 +194,18 @@ class Flywheel:
194
194
  self.enable_feature('multipart_signed_url')
195
195
 
196
196
 
197
+ def enable_debug(self, message_cutoff=None):
198
+ self.api_client.configuration.debug = True
199
+
200
+ if message_cutoff is not None:
201
+ self.api_client.configuration.enable_message_cutoff(message_cutoff)
202
+
203
+
204
+ def disable_debug(self):
205
+ self.api_client.configuration.debug = False
206
+ self.api_client.configuration.disable_message_cutoff()
207
+
208
+
197
209
  def add_acquisition(self, body, **kwargs): # noqa: E501
198
210
  """Create a new acquisition
199
211
 
@@ -1378,10 +1390,11 @@ class Flywheel:
1378
1390
  :param str id:
1379
1391
  :param ContainerType level:
1380
1392
  :param str job:
1393
+ :param str metadata: Metadata object as a JSON-encoded string
1381
1394
  :param list[str] x_accept_feature: redirect header
1382
1395
  :param str content_type:
1383
1396
  :param bool async_: Perform the request asynchronously
1384
- :return: None
1397
+ :return: union[list[FileOutput],UploadTicketOutput]
1385
1398
  """
1386
1399
  if signed:
1387
1400
  signed_result = self.signed_upload_output_to_analysis(container_id, file, **kwargs)
@@ -6280,6 +6293,19 @@ class Flywheel:
6280
6293
  return self.sessions_api.rename_session_tag(cid, value, body, **kwargs)
6281
6294
 
6282
6295
 
6296
+ def session_copy(self, session_id, body, **kwargs): # noqa: E501
6297
+ """Smart copy a session
6298
+
6299
+ Smart copy a session
6300
+
6301
+ :param str session_id: (required)
6302
+ :param SessionCopyInput body: (required)
6303
+ :param bool async_: Perform the request asynchronously
6304
+ :return: None
6305
+ """
6306
+ return self.sessions_api.session_copy(session_id, body, **kwargs)
6307
+
6308
+
6283
6309
  def upload_file_to_session(self, container_id, file, signed=True, **kwargs): # noqa: E501
6284
6310
  """Upload a file to a(n) session.
6285
6311
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  Flywheel: API for data import, automated curation, image processing, machine learning workflows, and secure collaboration. # noqa: E501
8
8
 
9
- OpenAPI spec version: 20.2.0-rc3
9
+ OpenAPI spec version: 20.3.2-rc0
10
10
 
11
11
  Generated by: https://github.com/swagger-api/swagger-codegen.git
12
12
  """
@@ -74,6 +74,10 @@ from flywheel.models.body_region import BodyRegion
74
74
  from flywheel.models.bookmark import Bookmark
75
75
  from flywheel.models.bulk_move_input import BulkMoveInput
76
76
  from flywheel.models.bulk_move_sessions import BulkMoveSessions
77
+ from flywheel.models.cvat_info import CVATInfo
78
+ from flywheel.models.cvat_settings import CVATSettings
79
+ from flywheel.models.cvat_settings_input import CVATSettingsInput
80
+ from flywheel.models.cvat_sync_state import CVATSyncState
77
81
  from flywheel.models.callbacks_virus_scan_input import CallbacksVirusScanInput
78
82
  from flywheel.models.cancelled_batch_output import CancelledBatchOutput
79
83
  from flywheel.models.catalog_list_output import CatalogListOutput
@@ -141,6 +145,8 @@ from flywheel.models.container_type import ContainerType
141
145
  from flywheel.models.container_uidcheck import ContainerUidcheck
142
146
  from flywheel.models.container_update import ContainerUpdate
143
147
  from flywheel.models.context_input import ContextInput
148
+ from flywheel.models.copy_filter import CopyFilter
149
+ from flywheel.models.copy_status import CopyStatus
144
150
  from flywheel.models.core_models_api_key_api_key_input import CoreModelsApiKeyApiKeyInput
145
151
  from flywheel.models.core_models_common_source import CoreModelsCommonSource
146
152
  from flywheel.models.core_models_jobs_api_key_input import CoreModelsJobsApiKeyInput
@@ -439,10 +445,8 @@ from flywheel.models.project_acquisition_upsert_output import ProjectAcquisition
439
445
  from flywheel.models.project_catalog_list_output import ProjectCatalogListOutput
440
446
  from flywheel.models.project_contact import ProjectContact
441
447
  from flywheel.models.project_container_output import ProjectContainerOutput
442
- from flywheel.models.project_copy_filter import ProjectCopyFilter
443
448
  from flywheel.models.project_copy_input import ProjectCopyInput
444
449
  from flywheel.models.project_copy_output import ProjectCopyOutput
445
- from flywheel.models.project_copy_status import ProjectCopyStatus
446
450
  from flywheel.models.project_counters import ProjectCounters
447
451
  from flywheel.models.project_hierarchy_input import ProjectHierarchyInput
448
452
  from flywheel.models.project_hierarchy_output import ProjectHierarchyOutput
@@ -578,6 +582,7 @@ from flywheel.models.service_aet import ServiceAET
578
582
  from flywheel.models.service_aet_input import ServiceAETInput
579
583
  from flywheel.models.session import Session
580
584
  from flywheel.models.session_container_output import SessionContainerOutput
585
+ from flywheel.models.session_copy_input import SessionCopyInput
581
586
  from flywheel.models.session_embedded_subject import SessionEmbeddedSubject
582
587
  from flywheel.models.session_input import SessionInput
583
588
  from flywheel.models.session_list_output import SessionListOutput
@@ -18,7 +18,7 @@ import pprint
18
18
  import re # noqa: F401
19
19
  import six
20
20
 
21
- class ProjectCopyFilter(object):
21
+ class CopyFilter(object):
22
22
 
23
23
  swagger_types = {
24
24
  'exclude_analysis': 'bool',
@@ -48,8 +48,8 @@ class ProjectCopyFilter(object):
48
48
  }
49
49
 
50
50
  def __init__(self, exclude_analysis=False, exclude_notes=False, exclude_tags=False, include_rules=None, exclude_rules=None, exclude_empty_containers=True): # noqa: E501
51
- """ProjectCopyFilter - a model defined in Swagger"""
52
- super(ProjectCopyFilter, self).__init__()
51
+ """CopyFilter - a model defined in Swagger"""
52
+ super(CopyFilter, self).__init__()
53
53
 
54
54
  self._exclude_analysis = None
55
55
  self._exclude_notes = None
@@ -75,20 +75,20 @@ class ProjectCopyFilter(object):
75
75
 
76
76
  @property
77
77
  def exclude_analysis(self):
78
- """Gets the exclude_analysis of this ProjectCopyFilter.
78
+ """Gets the exclude_analysis of this CopyFilter.
79
79
 
80
80
 
81
- :return: The exclude_analysis of this ProjectCopyFilter.
81
+ :return: The exclude_analysis of this CopyFilter.
82
82
  :rtype: bool
83
83
  """
84
84
  return self._exclude_analysis
85
85
 
86
86
  @exclude_analysis.setter
87
87
  def exclude_analysis(self, exclude_analysis):
88
- """Sets the exclude_analysis of this ProjectCopyFilter.
88
+ """Sets the exclude_analysis of this CopyFilter.
89
89
 
90
90
 
91
- :param exclude_analysis: The exclude_analysis of this ProjectCopyFilter. # noqa: E501
91
+ :param exclude_analysis: The exclude_analysis of this CopyFilter. # noqa: E501
92
92
  :type: bool
93
93
  """
94
94
 
@@ -96,20 +96,20 @@ class ProjectCopyFilter(object):
96
96
 
97
97
  @property
98
98
  def exclude_notes(self):
99
- """Gets the exclude_notes of this ProjectCopyFilter.
99
+ """Gets the exclude_notes of this CopyFilter.
100
100
 
101
101
 
102
- :return: The exclude_notes of this ProjectCopyFilter.
102
+ :return: The exclude_notes of this CopyFilter.
103
103
  :rtype: bool
104
104
  """
105
105
  return self._exclude_notes
106
106
 
107
107
  @exclude_notes.setter
108
108
  def exclude_notes(self, exclude_notes):
109
- """Sets the exclude_notes of this ProjectCopyFilter.
109
+ """Sets the exclude_notes of this CopyFilter.
110
110
 
111
111
 
112
- :param exclude_notes: The exclude_notes of this ProjectCopyFilter. # noqa: E501
112
+ :param exclude_notes: The exclude_notes of this CopyFilter. # noqa: E501
113
113
  :type: bool
114
114
  """
115
115
 
@@ -117,20 +117,20 @@ class ProjectCopyFilter(object):
117
117
 
118
118
  @property
119
119
  def exclude_tags(self):
120
- """Gets the exclude_tags of this ProjectCopyFilter.
120
+ """Gets the exclude_tags of this CopyFilter.
121
121
 
122
122
 
123
- :return: The exclude_tags of this ProjectCopyFilter.
123
+ :return: The exclude_tags of this CopyFilter.
124
124
  :rtype: bool
125
125
  """
126
126
  return self._exclude_tags
127
127
 
128
128
  @exclude_tags.setter
129
129
  def exclude_tags(self, exclude_tags):
130
- """Sets the exclude_tags of this ProjectCopyFilter.
130
+ """Sets the exclude_tags of this CopyFilter.
131
131
 
132
132
 
133
- :param exclude_tags: The exclude_tags of this ProjectCopyFilter. # noqa: E501
133
+ :param exclude_tags: The exclude_tags of this CopyFilter. # noqa: E501
134
134
  :type: bool
135
135
  """
136
136
 
@@ -138,20 +138,20 @@ class ProjectCopyFilter(object):
138
138
 
139
139
  @property
140
140
  def include_rules(self):
141
- """Gets the include_rules of this ProjectCopyFilter.
141
+ """Gets the include_rules of this CopyFilter.
142
142
 
143
143
 
144
- :return: The include_rules of this ProjectCopyFilter.
144
+ :return: The include_rules of this CopyFilter.
145
145
  :rtype: list[str]
146
146
  """
147
147
  return self._include_rules
148
148
 
149
149
  @include_rules.setter
150
150
  def include_rules(self, include_rules):
151
- """Sets the include_rules of this ProjectCopyFilter.
151
+ """Sets the include_rules of this CopyFilter.
152
152
 
153
153
 
154
- :param include_rules: The include_rules of this ProjectCopyFilter. # noqa: E501
154
+ :param include_rules: The include_rules of this CopyFilter. # noqa: E501
155
155
  :type: list[str]
156
156
  """
157
157
 
@@ -159,20 +159,20 @@ class ProjectCopyFilter(object):
159
159
 
160
160
  @property
161
161
  def exclude_rules(self):
162
- """Gets the exclude_rules of this ProjectCopyFilter.
162
+ """Gets the exclude_rules of this CopyFilter.
163
163
 
164
164
 
165
- :return: The exclude_rules of this ProjectCopyFilter.
165
+ :return: The exclude_rules of this CopyFilter.
166
166
  :rtype: list[str]
167
167
  """
168
168
  return self._exclude_rules
169
169
 
170
170
  @exclude_rules.setter
171
171
  def exclude_rules(self, exclude_rules):
172
- """Sets the exclude_rules of this ProjectCopyFilter.
172
+ """Sets the exclude_rules of this CopyFilter.
173
173
 
174
174
 
175
- :param exclude_rules: The exclude_rules of this ProjectCopyFilter. # noqa: E501
175
+ :param exclude_rules: The exclude_rules of this CopyFilter. # noqa: E501
176
176
  :type: list[str]
177
177
  """
178
178
 
@@ -180,20 +180,20 @@ class ProjectCopyFilter(object):
180
180
 
181
181
  @property
182
182
  def exclude_empty_containers(self):
183
- """Gets the exclude_empty_containers of this ProjectCopyFilter.
183
+ """Gets the exclude_empty_containers of this CopyFilter.
184
184
 
185
185
 
186
- :return: The exclude_empty_containers of this ProjectCopyFilter.
186
+ :return: The exclude_empty_containers of this CopyFilter.
187
187
  :rtype: bool
188
188
  """
189
189
  return self._exclude_empty_containers
190
190
 
191
191
  @exclude_empty_containers.setter
192
192
  def exclude_empty_containers(self, exclude_empty_containers):
193
- """Sets the exclude_empty_containers of this ProjectCopyFilter.
193
+ """Sets the exclude_empty_containers of this CopyFilter.
194
194
 
195
195
 
196
- :param exclude_empty_containers: The exclude_empty_containers of this ProjectCopyFilter. # noqa: E501
196
+ :param exclude_empty_containers: The exclude_empty_containers of this CopyFilter. # noqa: E501
197
197
  :type: bool
198
198
  """
199
199
 
@@ -243,7 +243,7 @@ class ProjectCopyFilter(object):
243
243
 
244
244
  def __eq__(self, other):
245
245
  """Returns true if both objects are equal"""
246
- if not isinstance(other, ProjectCopyFilter):
246
+ if not isinstance(other, CopyFilter):
247
247
  return False
248
248
 
249
249
  return self.__dict__ == other.__dict__
@@ -20,7 +20,7 @@ import six
20
20
 
21
21
  import enum
22
22
 
23
- class ProjectCopyStatus(str, enum.Enum):
23
+ class CopyStatus(str, enum.Enum):
24
24
  STATIC = "static"
25
25
  SCHEDULED = "scheduled"
26
26
  COPYING = "copying"
@@ -0,0 +1,243 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Flywheel
5
+
6
+ No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7
+
8
+ OpenAPI spec version: 0.0.1
9
+
10
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
11
+ """
12
+
13
+
14
+ ## NOTE: This file is auto generated by the swagger code generator program.
15
+ ## Do not edit the file manually.
16
+
17
+ import pprint
18
+ import re # noqa: F401
19
+ import six
20
+
21
+ class CVATInfo(object):
22
+
23
+ swagger_types = {
24
+ 'task_id': 'int',
25
+ 'job_id': 'int',
26
+ 'sync_state': 'CVATSyncState',
27
+ 'errors': 'list[str]'
28
+ }
29
+
30
+ attribute_map = {
31
+ 'task_id': 'task_id',
32
+ 'job_id': 'job_id',
33
+ 'sync_state': 'sync_state',
34
+ 'errors': 'errors'
35
+ }
36
+
37
+ rattribute_map = {
38
+ 'task_id': 'task_id',
39
+ 'job_id': 'job_id',
40
+ 'sync_state': 'sync_state',
41
+ 'errors': 'errors'
42
+ }
43
+
44
+ def __init__(self, task_id=None, job_id=None, sync_state=None, errors=None): # noqa: E501
45
+ """CVATInfo - a model defined in Swagger"""
46
+ super(CVATInfo, self).__init__()
47
+
48
+ self._task_id = None
49
+ self._job_id = None
50
+ self._sync_state = None
51
+ self._errors = None
52
+ self.discriminator = None
53
+ self.alt_discriminator = None
54
+
55
+ self.task_id = task_id
56
+ if job_id is not None:
57
+ self.job_id = job_id
58
+ if sync_state is not None:
59
+ self.sync_state = sync_state
60
+ if errors is not None:
61
+ self.errors = errors
62
+
63
+ @property
64
+ def task_id(self):
65
+ """Gets the task_id of this CVATInfo.
66
+
67
+
68
+ :return: The task_id of this CVATInfo.
69
+ :rtype: int
70
+ """
71
+ return self._task_id
72
+
73
+ @task_id.setter
74
+ def task_id(self, task_id):
75
+ """Sets the task_id of this CVATInfo.
76
+
77
+
78
+ :param task_id: The task_id of this CVATInfo. # noqa: E501
79
+ :type: int
80
+ """
81
+
82
+ self._task_id = task_id
83
+
84
+ @property
85
+ def job_id(self):
86
+ """Gets the job_id of this CVATInfo.
87
+
88
+
89
+ :return: The job_id of this CVATInfo.
90
+ :rtype: int
91
+ """
92
+ return self._job_id
93
+
94
+ @job_id.setter
95
+ def job_id(self, job_id):
96
+ """Sets the job_id of this CVATInfo.
97
+
98
+
99
+ :param job_id: The job_id of this CVATInfo. # noqa: E501
100
+ :type: int
101
+ """
102
+
103
+ self._job_id = job_id
104
+
105
+ @property
106
+ def sync_state(self):
107
+ """Gets the sync_state of this CVATInfo.
108
+
109
+
110
+ :return: The sync_state of this CVATInfo.
111
+ :rtype: CVATSyncState
112
+ """
113
+ return self._sync_state
114
+
115
+ @sync_state.setter
116
+ def sync_state(self, sync_state):
117
+ """Sets the sync_state of this CVATInfo.
118
+
119
+
120
+ :param sync_state: The sync_state of this CVATInfo. # noqa: E501
121
+ :type: CVATSyncState
122
+ """
123
+
124
+ self._sync_state = sync_state
125
+
126
+ @property
127
+ def errors(self):
128
+ """Gets the errors of this CVATInfo.
129
+
130
+
131
+ :return: The errors of this CVATInfo.
132
+ :rtype: list[str]
133
+ """
134
+ return self._errors
135
+
136
+ @errors.setter
137
+ def errors(self, errors):
138
+ """Sets the errors of this CVATInfo.
139
+
140
+
141
+ :param errors: The errors of this CVATInfo. # noqa: E501
142
+ :type: list[str]
143
+ """
144
+
145
+ self._errors = errors
146
+
147
+
148
+ @staticmethod
149
+ def positional_to_model(value):
150
+ """Converts a positional argument to a model value"""
151
+ return value
152
+
153
+ def return_value(self):
154
+ """Unwraps return value from model"""
155
+ return self
156
+
157
+ def to_dict(self):
158
+ """Returns the model properties as a dict"""
159
+ result = {}
160
+
161
+ for attr, _ in six.iteritems(self.swagger_types):
162
+ value = getattr(self, attr)
163
+ if isinstance(value, list):
164
+ result[attr] = list(map(
165
+ lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
166
+ value
167
+ ))
168
+ elif hasattr(value, "to_dict"):
169
+ result[attr] = value.to_dict()
170
+ elif isinstance(value, dict):
171
+ result[attr] = dict(map(
172
+ lambda item: (item[0], item[1].to_dict())
173
+ if hasattr(item[1], "to_dict") else item,
174
+ value.items()
175
+ ))
176
+ else:
177
+ result[attr] = value
178
+
179
+ return result
180
+
181
+ def to_str(self):
182
+ """Returns the string representation of the model"""
183
+ return pprint.pformat(self.to_dict())
184
+
185
+ def __repr__(self):
186
+ """For `print` and `pprint`"""
187
+ return self.to_str()
188
+
189
+ def __eq__(self, other):
190
+ """Returns true if both objects are equal"""
191
+ if not isinstance(other, CVATInfo):
192
+ return False
193
+
194
+ return self.__dict__ == other.__dict__
195
+
196
+ def __ne__(self, other):
197
+ """Returns true if both objects are not equal"""
198
+ return not self == other
199
+
200
+ # Container emulation
201
+ def __getitem__(self, key):
202
+ """Returns the value of key"""
203
+ key = self._map_key(key)
204
+ return getattr(self, key)
205
+
206
+ def __setitem__(self, key, value):
207
+ """Sets the value of key"""
208
+ key = self._map_key(key)
209
+ setattr(self, key, value)
210
+
211
+ def __contains__(self, key):
212
+ """Checks if the given value is a key in this object"""
213
+ key = self._map_key(key, raise_on_error=False)
214
+ return key is not None
215
+
216
+ def keys(self):
217
+ """Returns the list of json properties in the object"""
218
+ return self.__class__.rattribute_map.keys()
219
+
220
+ def values(self):
221
+ """Returns the list of values in the object"""
222
+ for key in self.__class__.attribute_map.keys():
223
+ yield getattr(self, key)
224
+
225
+ def items(self):
226
+ """Returns the list of json property to value mapping"""
227
+ for key, prop in self.__class__.rattribute_map.items():
228
+ yield key, getattr(self, prop)
229
+
230
+ def get(self, key, default=None):
231
+ """Get the value of the provided json property, or default"""
232
+ key = self._map_key(key, raise_on_error=False)
233
+ if key:
234
+ return getattr(self, key, default)
235
+ return default
236
+
237
+ def _map_key(self, key, raise_on_error=True):
238
+ result = self.__class__.rattribute_map.get(key)
239
+ if result is None:
240
+ if raise_on_error:
241
+ raise AttributeError('Invalid attribute name: {}'.format(key))
242
+ return None
243
+ return '_' + result