Skip to content

Commit

Permalink
update python docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sachaarbonel committed Oct 31, 2023
1 parent a64bde8 commit cf8c22a
Show file tree
Hide file tree
Showing 9 changed files with 318 additions and 14 deletions.
64 changes: 62 additions & 2 deletions docusaurus/video/docusaurus/docs/api/basics/authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ await client.upsertUsers({

```py
users = {}
users["userid"] = UserRequest(
id=user_id, role="user", custom={"color": "red"}, name="This is a test user",image: "link/to/profile/image",
user = UserRequest(
id='user_id', role="user", custom={"color": "red"}, name="This is a test user",image= "link/to/profile/image",
)
users[user.id] = user
client.upsert_users(users=users)
```

Expand Down Expand Up @@ -90,6 +91,38 @@ client.updateUsersPartial({
});
```

</TabItem>
<TabItem value="py" label="Python">

```py
users = {}
user = UserRequest(
id= 'userid',
role= 'user',
custom= {
"color": 'red',
},
name= 'This is a test user',
image= 'link/to/profile/image',
)

users[user.id] = user
client.upsert_users(users=users)

// or
client.update_users_partial(
users= [
{
id: user.id,
set: {
color: 'blue',
},
unset: ['name'],
},
],
)
```

</TabItem>
</Tabs>

Expand All @@ -116,6 +149,21 @@ const guest: UserObjectRequest = {
const guest = (await client.createGuest({ user: guest })).user;
```

</TabItem>
<TabItem value="py" label="Python">

```py
guest = UserRequest(
id = '<id>',
name= '<name>',
custom= {
"color": 'red',
},
)

guest = (client.video.create_guest(user=guest)).user
```

</TabItem>
</Tabs>

Expand All @@ -136,6 +184,18 @@ client.deactivateUser({
client.deleteUser({ userId: '<id>' });
```

</TabItem>

<TabItem value="py" label="Python">

```py
client.deactivate_user(
user_id= '<id>',
)

client.delete_user( user_id= '<id>' )
```

</TabItem>
</Tabs>

Expand Down
25 changes: 25 additions & 0 deletions docusaurus/video/docusaurus/docs/api/call_types/geofencing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,30 @@ call.create({
});
```

</TabItem>
<TabItem value="py" label="Python">

```py
client.video.create_call_type(
name= '<call type name>',
settings= CallSettingsRequest(
geofencing= GeofenceSettingsRequest(
names= ['european_union'],
),
),
)

//override settings on call level
call.create(
data = CallRequest(
created_by_id= 'john',
settings_override= CallSettingsRequest(
geofencing= GeofenceSettingsRequest(
names= ['european_union', 'united_states'],
),
),
),
)
```
</TabItem>
</Tabs>
47 changes: 47 additions & 0 deletions docusaurus/video/docusaurus/docs/api/call_types/manage-types.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ client.video.listCallTypes();
client.getCallType({name: 'livestream'});
```

</TabItem>
<TabItem value="py" label="Python">

```py
client.video.list_call_types()

//or
client.get_call_type(name= 'livestream')
```
</TabItem>
</Tabs>

Expand All @@ -46,6 +55,27 @@ client.video.createCallType({
```

</TabItem>
<TabItem value="py" label="Python">

```py
client.video.create_call_type(
name= 'allhands',
settings = CallSettingsRequest(
audio=AudioSettingsRequest( mic_default_on= True, default_device ='speaker' ),
),
grants = {
"admin": [
OwnCapability.SEND_AUDIO.to_str(),
OwnCapability.SEND_VIDEO.to_str(),
OwnCapability.MUTE_USERS.to_str(),
],
"user": [OwnCapability.SEND_AUDIO.to_str(), OwnCapability.SEND_VIDEO.to_str()],
},
)

```
</TabItem>

</Tabs>

## Update call type
Expand All @@ -61,6 +91,16 @@ client.video.updateCallType('allhands', {
});
```

</TabItem>
<TabItem value="py" label="Python">

```py
client.video.update_call_type(name='allhands',
settings= CallSettingsRequest(
audio=AudioSettingsRequest( mic_default_on= False, default_device= 'earpiece' ),
),
)
```
</TabItem>
</Tabs>

Expand All @@ -73,5 +113,12 @@ client.video.updateCallType('allhands', {
client.video.deleteCallType({name: 'allhands'});
```

</TabItem>
<TabItem value="py" label="Python">

```py
client.video.delete_call_type(name= 'allhands')

```
</TabItem>
</Tabs>
26 changes: 26 additions & 0 deletions docusaurus/video/docusaurus/docs/api/call_types/permissions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,32 @@ client.video.updateCallType('default', {
});
```

</TabItem>

<TabItem value="py" label="Python">

```py
client.video.create_call_type(
name= '<call type name>',
grants={
"admin": [
OwnCapability.SEND_AUDIO.to_str(),
OwnCapability.SEND_VIDEO.to_str(),
OwnCapability.MUTE_USERS.to_str(),
],
"customrole": [
OwnCapability.SEND_AUDIO.to_str(),
OwnCapability.SEND_VIDEO.to_str(),
],
},
)

client.video.update_call_type(name = 'default',
grants= {
/* ... */
},
)
```
</TabItem>
</Tabs>

Expand Down
49 changes: 49 additions & 0 deletions docusaurus/video/docusaurus/docs/api/call_types/settings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,34 @@ call.create({
```

</TabItem>

<TabItem value="py" label="Python">

```py
client.video.create_call_type(
name= '<call type name>',
settings= CallSettingsRequest(
screensharing=ScreensharingSettingsRequest(
access_request_enabled= False,
enabled= True,
),
),
)

// override settings on call level
call.create(
data=CallRequest(
created_by_id= 'john',
settings_override= CallSettingsRequest(
screensharing= ScreensharingSettingsRequest(
enabled= False,
),
),
),
)
```
</TabItem>

</Tabs>

### Notification settings
Expand All @@ -77,4 +105,25 @@ client.video.createCallType({
```

</TabItem>
<TabItem value="py" label="Python">

```py
client.video.create_call_type(
name= '<call type name>',
notification_settings= NotificationSettingsRequest(
enabled= True,
call_notification= EventNotificationSettingsRequest(
apns=Apnsrequest(
title= '{{ user.display_name }} invites you to a call',
),
enabled= True,
),
session_started= EventNotificationSettingsRequest(
enabled: False,
),
),
)
```
</TabItem>

</Tabs>
36 changes: 30 additions & 6 deletions docusaurus/video/docusaurus/docs/api/moderation/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ call.unblockUser({ user_id: 'sara' });
<TabItem value="py" label="Python">

```py
TODO: python
// Block user
call.block_user( user_id='sara' )

// Unblock user
call.unblock_user( user_id= 'sara' )
```

</TabItem>
Expand All @@ -62,7 +66,11 @@ call.update({
<TabItem value="py" label="Python">

```py
TODO: python
call.update(
settings_override = CallSettingsRequest(
screensharing= ScreensharingSettingsRequest( enabled= True, access_request_enabled= True ),
),
)
```

</TabItem>
Expand All @@ -87,7 +95,11 @@ call.muteUsers({
<TabItem value="py" label="Python">

```py
TODO: python
// You can specify which kind of stream(s) to mute
call.mute_users(
mute_all_users= True,
audio=True,
)
```

</TabItem>
Expand All @@ -112,7 +124,13 @@ call.muteUsers({
<TabItem value="py" label="Python">

```py
TODO: python
call.mute_users(
user_ids= ['sara'],
audio= True,
video= True,
screenshare= True,
screenshare_audio = True,
)
```

</TabItem>
Expand Down Expand Up @@ -144,7 +162,10 @@ call.updateUserPermissions({
<TabItem value="py" label="Python">

```py
TODO: python
call.update_user_permissions(
user_id= 'sara',
grant_permissions= [OwnCapability.SEND_AUDIO.to_str()],
)
```

</TabItem>
Expand Down Expand Up @@ -172,7 +193,10 @@ call.updateUserPermissions({
<TabItem value="py" label="Python">

```py
TODO: python
call.update_user_permissions(
user_id= 'sara',
revoke_permissions= [OwnCapability.SEND_AUDIO.to_str()],
)
```

</TabItem>
Expand Down
Loading

0 comments on commit cf8c22a

Please sign in to comment.