-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathmock_directory_user.py
More file actions
52 lines (49 loc) · 1.77 KB
/
mock_directory_user.py
File metadata and controls
52 lines (49 loc) · 1.77 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
import datetime
from workos.types.directory_sync import DirectoryUserWithGroups
from workos.types.directory_sync.directory_user import DirectoryUserEmail, InlineRole
class MockDirectoryUser(DirectoryUserWithGroups):
def __init__(self, id):
now = datetime.datetime.now().isoformat()
super().__init__(
object="directory_user",
id=id,
idp_id="idp_id_" + id,
directory_id="directory_id",
organization_id="org_id_" + id,
first_name="gsuite_directory",
last_name="fried chicken",
job_title="developer",
email="marcelina@foo-corp.com",
emails=[
DirectoryUserEmail(
primary=True, type="work", value="marcelina@foo-corp.com"
)
],
username=None,
groups=[],
state="active",
created_at=now,
updated_at=now,
custom_attributes={},
raw_attributes={
"schemas": ["urn:scim:schemas:core:1.0"],
"name": {"familyName": "Seri", "givenName": "Marcelina"},
"externalId": "external-id",
"locale": "en_US",
"userName": "marcelina@foo-corp.com",
"id": "directory_usr_id",
"displayName": "Marcelina Seri",
"title": "developer",
"active": True,
"groups": [],
"meta": None,
"emails": [
{
"value": "marcelina@foo-corp.com",
"type": "work",
"primary": "true",
}
],
},
role=InlineRole(slug="member"),
)