forked from DevCycleHQ/python-server-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser_data.py
More file actions
539 lines (406 loc) · 15.6 KB
/
Copy pathuser_data.py
File metadata and controls
539 lines (406 loc) · 15.6 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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
# coding: utf-8
"""
DevCycle Bucketing API
Documents the DevCycle Bucketing API which provides and API interface to User Bucketing and for generated SDKs. # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import sys
import os
import six
import devcycle_python_sdk
class UserData(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 = {
'user_id': 'str',
'email': 'str',
'name': 'str',
'language': 'str',
'country': 'str',
'app_version': 'str',
'app_build': 'str',
'custom_data': 'object',
'private_custom_data': 'object',
'created_date': 'float',
'last_seen_date': 'float',
'platform': 'str',
'platform_version': 'str',
'device_model': 'str',
'sdk_type': 'str',
'sdk_version': 'str'
}
attribute_map = {
'user_id': 'user_id',
'email': 'email',
'name': 'name',
'language': 'language',
'country': 'country',
'app_version': 'appVersion',
'app_build': 'appBuild',
'custom_data': 'customData',
'private_custom_data': 'privateCustomData',
'created_date': 'createdDate',
'last_seen_date': 'lastSeenDate',
'platform': 'platform',
'platform_version': 'platformVersion',
'device_model': 'deviceModel',
'sdk_type': 'sdkType',
'sdk_version': 'sdkVersion'
}
def __init__(self, user_id=None, email=None, name=None, language=None, country=None, app_version=None, app_build=None, custom_data=None, private_custom_data=None, created_date=None, last_seen_date=None, device_model=None): # noqa: E501
"""UserData - a model defined in Swagger""" # noqa: E501
self._user_id = None
self._email = None
self._name = None
self._language = None
self._country = None
self._app_version = None
self._app_build = None
self._custom_data = None
self._private_custom_data = None
self._created_date = None
self._last_seen_date = None
self._platform = 'Python'
version_file = open(os.path.join(os.path.dirname(devcycle_python_sdk.__file__), 'VERSION.txt'))
VERSION = version_file.read().strip()
self._platform_version = sys.version[:5]
self._device_model = None
self._sdk_type = 'server'
self._sdk_version = VERSION
self.discriminator = None
self.user_id = user_id
if email is not None:
self.email = email
if name is not None:
self.name = name
if language is not None:
self.language = language
if country is not None:
self.country = country
if app_version is not None:
self.app_version = app_version
if app_build is not None:
self.app_build = app_build
if custom_data is not None:
self.custom_data = custom_data
if private_custom_data is not None:
self.private_custom_data = private_custom_data
if created_date is not None:
self.created_date = created_date
if last_seen_date is not None:
self.last_seen_date = last_seen_date
if device_model is not None:
self.device_model = device_model
@property
def user_id(self):
"""Gets the user_id of this UserData. # noqa: E501
Unique id to identify the user # noqa: E501
:return: The user_id of this UserData. # noqa: E501
:rtype: str
"""
return self._user_id
@user_id.setter
def user_id(self, user_id):
"""Sets the user_id of this UserData.
Unique id to identify the user # noqa: E501
:param user_id: The user_id of this UserData. # noqa: E501
:type: str
"""
if user_id is None:
raise ValueError("Invalid value for `user_id`, must not be `None`") # noqa: E501
self._user_id = user_id
@property
def email(self):
"""Gets the email of this UserData. # noqa: E501
User's email used to identify the user on the dashboard / target audiences # noqa: E501
:return: The email of this UserData. # noqa: E501
:rtype: str
"""
return self._email
@email.setter
def email(self, email):
"""Sets the email of this UserData.
User's email used to identify the user on the dashboard / target audiences # noqa: E501
:param email: The email of this UserData. # noqa: E501
:type: str
"""
self._email = email
@property
def name(self):
"""Gets the name of this UserData. # noqa: E501
User's name used to identify the user on the dashboard / target audiences # noqa: E501
:return: The name of this UserData. # noqa: E501
:rtype: str
"""
return self._name
@name.setter
def name(self, name):
"""Sets the name of this UserData.
User's name used to identify the user on the dashboard / target audiences # noqa: E501
:param name: The name of this UserData. # noqa: E501
:type: str
"""
self._name = name
@property
def language(self):
"""Gets the language of this UserData. # noqa: E501
User's language in ISO 639-1 format # noqa: E501
:return: The language of this UserData. # noqa: E501
:rtype: str
"""
return self._language
@language.setter
def language(self, language):
"""Sets the language of this UserData.
User's language in ISO 639-1 format # noqa: E501
:param language: The language of this UserData. # noqa: E501
:type: str
"""
self._language = language
@property
def country(self):
"""Gets the country of this UserData. # noqa: E501
User's country in ISO 3166 alpha-2 format # noqa: E501
:return: The country of this UserData. # noqa: E501
:rtype: str
"""
return self._country
@country.setter
def country(self, country):
"""Sets the country of this UserData.
User's country in ISO 3166 alpha-2 format # noqa: E501
:param country: The country of this UserData. # noqa: E501
:type: str
"""
self._country = country
@property
def app_version(self):
"""Gets the app_version of this UserData. # noqa: E501
App Version of the running application # noqa: E501
:return: The app_version of this UserData. # noqa: E501
:rtype: str
"""
return self._app_version
@app_version.setter
def app_version(self, app_version):
"""Sets the app_version of this UserData.
App Version of the running application # noqa: E501
:param app_version: The app_version of this UserData. # noqa: E501
:type: str
"""
self._app_version = app_version
@property
def app_build(self):
"""Gets the app_build of this UserData. # noqa: E501
App Build number of the running application # noqa: E501
:return: The app_build of this UserData. # noqa: E501
:rtype: str
"""
return self._app_build
@app_build.setter
def app_build(self, app_build):
"""Sets the app_build of this UserData.
App Build number of the running application # noqa: E501
:param app_build: The app_build of this UserData. # noqa: E501
:type: str
"""
self._app_build = app_build
@property
def custom_data(self):
"""Gets the custom_data of this UserData. # noqa: E501
User's custom data to target the user with, data will be logged to DevCycle for use in dashboard. # noqa: E501
:return: The custom_data of this UserData. # noqa: E501
:rtype: object
"""
return self._custom_data
@custom_data.setter
def custom_data(self, custom_data):
"""Sets the custom_data of this UserData.
User's custom data to target the user with, data will be logged to DevCycle for use in dashboard. # noqa: E501
:param custom_data: The custom_data of this UserData. # noqa: E501
:type: object
"""
self._custom_data = custom_data
@property
def private_custom_data(self):
"""Gets the private_custom_data of this UserData. # noqa: E501
User's custom data to target the user with, data will not be logged to DevCycle only used for feature bucketing. # noqa: E501
:return: The private_custom_data of this UserData. # noqa: E501
:rtype: object
"""
return self._private_custom_data
@private_custom_data.setter
def private_custom_data(self, private_custom_data):
"""Sets the private_custom_data of this UserData.
User's custom data to target the user with, data will not be logged to DevCycle only used for feature bucketing. # noqa: E501
:param private_custom_data: The private_custom_data of this UserData. # noqa: E501
:type: object
"""
self._private_custom_data = private_custom_data
@property
def created_date(self):
"""Gets the created_date of this UserData. # noqa: E501
Date the user was created, Unix epoch timestamp format # noqa: E501
:return: The created_date of this UserData. # noqa: E501
:rtype: float
"""
return self._created_date
@created_date.setter
def created_date(self, created_date):
"""Sets the created_date of this UserData.
Date the user was created, Unix epoch timestamp format # noqa: E501
:param created_date: The created_date of this UserData. # noqa: E501
:type: float
"""
self._created_date = created_date
@property
def last_seen_date(self):
"""Gets the last_seen_date of this UserData. # noqa: E501
Date the user was created, Unix epoch timestamp format # noqa: E501
:return: The last_seen_date of this UserData. # noqa: E501
:rtype: float
"""
return self._last_seen_date
@last_seen_date.setter
def last_seen_date(self, last_seen_date):
"""Sets the last_seen_date of this UserData.
Date the user was created, Unix epoch timestamp format # noqa: E501
:param last_seen_date: The last_seen_date of this UserData. # noqa: E501
:type: float
"""
self._last_seen_date = last_seen_date
@property
def platform(self):
"""Gets the platform of this UserData. # noqa: E501
Platform the Client SDK is running on # noqa: E501
:return: The platform of this UserData. # noqa: E501
:rtype: str
"""
return self._platform
@platform.setter
def platform(self, platform):
"""Sets the platform of this UserData.
Platform the Client SDK is running on # noqa: E501
:param platform: The platform of this UserData. # noqa: E501
:type: str
"""
self._platform = platform
@property
def platform_version(self):
"""Gets the platform_version of this UserData. # noqa: E501
Version of the platform the Client SDK is running on # noqa: E501
:return: The platform_version of this UserData. # noqa: E501
:rtype: str
"""
return self._platform_version
@platform_version.setter
def platform_version(self, platform_version):
"""Sets the platform_version of this UserData.
Version of the platform the Client SDK is running on # noqa: E501
:param platform_version: The platform_version of this UserData. # noqa: E501
:type: str
"""
self._platform_version = platform_version
@property
def device_model(self):
"""Gets the device_model of this UserData. # noqa: E501
User's device model # noqa: E501
:return: The device_model of this UserData. # noqa: E501
:rtype: str
"""
return self._device_model
@device_model.setter
def device_model(self, device_model):
"""Sets the device_model of this UserData.
User's device model # noqa: E501
:param device_model: The device_model of this UserData. # noqa: E501
:type: str
"""
self._device_model = device_model
@property
def sdk_type(self):
"""Gets the sdk_type of this UserData. # noqa: E501
DevCycle SDK type # noqa: E501
:return: The sdk_type of this UserData. # noqa: E501
:rtype: str
"""
return self._sdk_type
@sdk_type.setter
def sdk_type(self, sdk_type):
"""Sets the sdk_type of this UserData.
DevCycle SDK type # noqa: E501
:param sdk_type: The sdk_type of this UserData. # noqa: E501
:type: str
"""
allowed_values = ["api", "server"] # noqa: E501
if sdk_type not in allowed_values:
raise ValueError(
"Invalid value for `sdk_type` ({0}), must be one of {1}" # noqa: E501
.format(sdk_type, allowed_values)
)
self._sdk_type = sdk_type
@property
def sdk_version(self):
"""Gets the sdk_version of this UserData. # noqa: E501
DevCycle SDK Version # noqa: E501
:return: The sdk_version of this UserData. # noqa: E501
:rtype: str
"""
return self._sdk_version
@sdk_version.setter
def sdk_version(self, sdk_version):
"""Sets the sdk_version of this UserData.
DevCycle SDK Version # noqa: E501
:param sdk_version: The sdk_version of this UserData. # noqa: E501
:type: str
"""
self._sdk_version = sdk_version
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(UserData, 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, UserData):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other