|
14 | 14 | }) |
15 | 15 |
|
16 | 16 | if response['success']: |
17 | | - print 'Create / Update Successful!' |
| 17 | + print('Create / Update Successful!') |
18 | 18 | else: |
19 | | - print response['errors'] |
| 19 | + print(response['errors']) |
20 | 20 |
|
21 | 21 | # 2. Bulk create - update |
22 | 22 | user1 = { |
|
43 | 43 | response = client.update_users_bulk(users=users) |
44 | 44 | for data in response['updated']: |
45 | 45 | if data['success']: |
46 | | - print 'BULK #' + data['id'] + ' success' |
| 46 | + print('BULK #' + data['id'] + ' success') |
47 | 47 | else: |
48 | | - print 'BULK #' + data['id'] + ' FAIL' |
49 | | - print data['errors'] |
| 48 | + print('BULK #' + data['id'] + ' FAIL') |
| 49 | + print(data['errors']) |
50 | 50 |
|
51 | 51 | # 3. Delete user |
52 | 52 | response = client.delete_user(user={'id': '1'}) |
53 | 53 | if response['status_code'] == 204: |
54 | | - print '#1 Deleted successful!' |
| 54 | + print('#1 Deleted successful!') |
55 | 55 | else: |
56 | | - print 'Something went wrong via DELETE request' |
| 56 | + print('Something went wrong via DELETE request') |
57 | 57 |
|
58 | 58 | # 4. Trying to update with invalid field, API should return error |
59 | 59 | response = client.update_user(user={ |
|
68 | 68 | }) |
69 | 69 |
|
70 | 70 | if response['success']: |
71 | | - print '# 1 Updated with invalid fields successful!' |
| 71 | + print('# 1 Updated with invalid fields successful!') |
72 | 72 | else: |
73 | | - print response['errors'] |
| 73 | + print(response['errors']) |
74 | 74 |
|
75 | 75 | # 5. Add new user attributes |
76 | 76 | response = client.add_user_attribute('silos', client.ATTRIBUTE_ARRAY, client.ATTRIBUTE_STRING) |
77 | 77 |
|
78 | 78 | if response['success']: |
79 | | - print 'Added user attribute `silos` successful!' |
| 79 | + print('Added user attribute `silos` successful!') |
80 | 80 | else: |
81 | | - print response['errors'] |
| 81 | + print(response['errors']) |
82 | 82 |
|
83 | 83 | # 6. List user attributes |
84 | 84 | response = client.list_user_attributes(offset=37, limit=10) |
85 | 85 | if response['status_code'] == 200: |
86 | | - print 'Got list user attributes successful!' |
87 | | - print response['attributes'] |
| 86 | + print('Got list user attributes successful!') |
| 87 | + print(response['attributes']) |
88 | 88 | else: |
89 | | - print response['errors'] |
| 89 | + print(response['errors']) |
90 | 90 |
|
91 | 91 | # 7. Add nested attribute |
92 | | -print client.add_nested_user_attribute('nested_attribute', 'main_attribute', client.ATTRIBUTE_STRING) |
| 92 | +print(client.add_nested_user_attribute('nested_attribute', 'main_attribute', client.ATTRIBUTE_STRING)) |
0 commit comments