Skip to content

Commit

Permalink
moderation wip
Browse files Browse the repository at this point in the history
  • Loading branch information
sachaarbonel committed Sep 19, 2024
1 parent 1dd6948 commit c9274f9
Showing 1 changed file with 100 additions and 0 deletions.
100 changes: 100 additions & 0 deletions docusaurus/video/docusaurus/docs/api/moderation/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,21 @@ call.block_user(user_id='sara')
call.unblock_user(user_id='sara')
```

</TabItem>
<TabItem value="go" label="Golang">

```go
// Block user
call.BlockUser(ctx, &BlockUserRequest{
UserID: "sara",
})

// Unblock user
call.UnblockUser(ctx, &UnblockUserRequest{
UserID: "sara",
})
```

</TabItem>
<TabItem value="curl" label="cURL">

Expand Down Expand Up @@ -101,6 +116,20 @@ call.update(
)
```

</TabItem>
<TabItem value="go" label="Golang">

```go
call.Update(ctx, &UpdateCallRequest{
SettingsOverride: &CallSettingsRequest{
Screensharing: &ScreensharingSettingsRequest{
Enabled: PtrTo(true),
AccessRequestEnabled: PtrTo(true),
},
},
})
```

</TabItem>
<TabItem value="curl" label="cURL">

Expand Down Expand Up @@ -152,6 +181,19 @@ call.mute_users(
)
```

</TabItem>

<TabItem value="go" label="Golang">

```go
// You can specify which kind of stream(s) to mute
call.MuteUsers(ctx, &MuteUsersRequest{
MuteAllUsers: PtrTo(true),
Audio: PtrTo(true),
MutedByID: PtrTo("john"),
})
```

</TabItem>
<TabItem value="curl" label="cURL">

Expand Down Expand Up @@ -200,6 +242,22 @@ call.mute_users(
)
```

</TabItem>

<TabItem value="go" label="Golang">

```go
call.MuteUsers(ctx, &MuteUsersRequest{
UserIDs: &[]string{alice.id,bob.id},
Audio: PtrTo(true),
Video: PtrTo(true),
Screenshare: PtrTo(true),
ScreenshareAudio: PtrTo(true),
MutedByID: user_id,
})

```

</TabItem>
<TabItem value="curl" label="cURL">

Expand Down Expand Up @@ -257,6 +315,16 @@ call.update_user_permissions(
)
```

</TabItem>
<TabItem value="go" label="Golang">

```go
call.UpdateUserPermissions(ctx, &UpdateUserPermissionsRequest{
UserID: "sara",
GrantPermissions: &[]string{SEND_AUDIO.String()},
})
```

</TabItem>
<TabItem value="curl" label="cURL">

Expand Down Expand Up @@ -301,6 +369,16 @@ call.update_user_permissions(
)
```

</TabItem>
<TabItem value="go" label="Golang">

```go
call.UpdateUserPermissions(ctx, &UpdateUserPermissionsRequest{
UserID: "sara",
RevokePermissions: &[]string{SEND_AUDIO.String()},
})
```

</TabItem>
<TabItem value="curl" label="cURL">

Expand Down Expand Up @@ -503,6 +581,28 @@ response = client.get_blocked_users(user_id=alice.id)
client.unblock_users(blocked_user_id=bob.id, user_id=alice.id)
```

</TabItem>
<TabItem value="go" label="Golang">

```go
// alice blocks bob
client.BlockUsers(ctx, &BlockUsersRequest{
BlockedUserID: "bob.ID",
UserID: &alice.ID,
})

// list blocked users by alice
response, err := client.GetBlockedUsers(ctx, &GetBlockedUsersRequest{
UserID: &alice.ID,
})

// alice unblocks bob
client.UnblockUsers(ctx, &UnblockUsersRequest{
BlockedUserID: bob.ID,
UserID: &alice.ID,
})
```

</TabItem>

<TabItem value="curl" label="cURL">
Expand Down

0 comments on commit c9274f9

Please sign in to comment.