-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Meetings * Automatic code clean on snippets * Add snippets for guides
- Loading branch information
Showing
38 changed files
with
904 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
DotNetCliCodeSnippets/Meetings/Guides/AllowParticipantRecording.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using Vonage; | ||
using Vonage.Meetings.Common; | ||
using Vonage.Meetings.CreateRoom; | ||
using Vonage.Request; | ||
|
||
namespace DotnetCliCodeSnippets.Meetings.Guides; | ||
|
||
public class AllowParticipantRecording : ICodeSnippet | ||
{ | ||
public async Task Execute() | ||
{ | ||
var applicationId = Environment.GetEnvironmentVariable("VONAGE_APP_ID") ?? "VONAGE_APP_ID"; | ||
var privateKeyPath = Environment.GetEnvironmentVariable("VONAGE_PRIVATE_KEY_PATH") ?? "VONAGE_PRIVATE_KEY_PATH"; | ||
var credentials = Credentials.FromAppIdAndPrivateKeyPath(applicationId, privateKeyPath); | ||
var client = new VonageClient(credentials); | ||
var request = CreateRoomRequest.Build() | ||
.WithDisplayName("New Meeting Room") | ||
.WithFeatures(new Room.Features {IsRecordingAvailable = true}) | ||
.Create(); | ||
var response = await client.MeetingsClient.CreateRoomAsync(request); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
DotNetCliCodeSnippets/Meetings/Guides/ApplyLanguageToAllParticipants.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using Vonage; | ||
using Vonage.Meetings.Common; | ||
using Vonage.Meetings.CreateRoom; | ||
using Vonage.Request; | ||
|
||
namespace DotnetCliCodeSnippets.Meetings.Guides; | ||
|
||
public class ApplyLanguageToAllParticipants : ICodeSnippet | ||
{ | ||
public async Task Execute() | ||
{ | ||
var applicationId = Environment.GetEnvironmentVariable("VONAGE_APP_ID") ?? "VONAGE_APP_ID"; | ||
var privateKeyPath = Environment.GetEnvironmentVariable("VONAGE_PRIVATE_KEY_PATH") ?? "VONAGE_PRIVATE_KEY_PATH"; | ||
var credentials = Credentials.FromAppIdAndPrivateKeyPath(applicationId, privateKeyPath); | ||
var client = new VonageClient(credentials); | ||
var request = CreateRoomRequest.Build() | ||
.WithDisplayName("New Meeting Room") | ||
.WithUserInterfaceSettings(new UiSettings(UiSettings.UserInterfaceLanguage.Es)) | ||
.Create(); | ||
var response = await client.MeetingsClient.CreateRoomAsync(request); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
DotNetCliCodeSnippets/Meetings/Guides/CreateRoomWithTheme.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using Vonage; | ||
using Vonage.Meetings.CreateRoom; | ||
using Vonage.Request; | ||
|
||
namespace DotnetCliCodeSnippets.Meetings.Guides; | ||
|
||
public class CreateRoomWithTheme : ICodeSnippet | ||
{ | ||
public async Task Execute() | ||
{ | ||
var applicationId = Environment.GetEnvironmentVariable("VONAGE_APP_ID") ?? "VONAGE_APP_ID"; | ||
var privateKeyPath = Environment.GetEnvironmentVariable("VONAGE_PRIVATE_KEY_PATH") ?? "VONAGE_PRIVATE_KEY_PATH"; | ||
var expirationDate = DateTime.Parse(Environment.GetEnvironmentVariable("EXPIRATION_DATE") ?? "EXPIRATION_DATE"); | ||
var credentials = Credentials.FromAppIdAndPrivateKeyPath(applicationId, privateKeyPath); | ||
var client = new VonageClient(credentials); | ||
var request = CreateRoomRequest.Build() | ||
.WithDisplayName("New Meetings Room") | ||
.AsLongTermRoom(expirationDate) | ||
.WithThemeId("e8b1d80b-8f78-4578-94f2-328596e01387") | ||
.Create(); | ||
var response = await client.MeetingsClient.CreateRoomAsync(request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System; | ||
using System.Drawing; | ||
using System.Threading.Tasks; | ||
using Vonage; | ||
using Vonage.Meetings.CreateTheme; | ||
using Vonage.Request; | ||
|
||
namespace DotnetCliCodeSnippets.Meetings.Guides; | ||
|
||
public class CreateTheme : ICodeSnippet | ||
{ | ||
public async Task Execute() | ||
{ | ||
var applicationId = Environment.GetEnvironmentVariable("VONAGE_APP_ID") ?? "VONAGE_APP_ID"; | ||
var privateKeyPath = Environment.GetEnvironmentVariable("VONAGE_PRIVATE_KEY_PATH") ?? "VONAGE_PRIVATE_KEY_PATH"; | ||
var credentials = Credentials.FromAppIdAndPrivateKeyPath(applicationId, privateKeyPath); | ||
var client = new VonageClient(credentials); | ||
var request = CreateThemeRequest.Build() | ||
.WithBrand("Orange") | ||
.WithColor(Color.FromArgb(255, 255, 65, 0)) | ||
.WithName("orange-room") | ||
.Create(); | ||
var response = await client.MeetingsClient.CreateThemeAsync(request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using Vonage; | ||
using Vonage.Meetings.DeleteRecording; | ||
using Vonage.Request; | ||
|
||
namespace DotnetCliCodeSnippets.Meetings.Guides; | ||
|
||
public class DeleteRecording : ICodeSnippet | ||
{ | ||
public async Task Execute() | ||
{ | ||
var applicationId = Environment.GetEnvironmentVariable("VONAGE_APP_ID") ?? "VONAGE_APP_ID"; | ||
var privateKeyPath = Environment.GetEnvironmentVariable("VONAGE_PRIVATE_KEY_PATH") ?? "VONAGE_PRIVATE_KEY_PATH"; | ||
var credentials = Credentials.FromAppIdAndPrivateKeyPath(applicationId, privateKeyPath); | ||
var client = new VonageClient(credentials); | ||
var request = DeleteRecordingRequest.Parse(new Guid("9f6fe8ae-3458-4a72-b532-8276d5533e97")); | ||
var response = await client.MeetingsClient.DeleteRecordingAsync(request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using Vonage; | ||
using Vonage.Meetings.DeleteTheme; | ||
using Vonage.Request; | ||
|
||
namespace DotnetCliCodeSnippets.Meetings.Guides; | ||
|
||
public class DeleteTheme : ICodeSnippet | ||
{ | ||
public async Task Execute() | ||
{ | ||
var applicationId = Environment.GetEnvironmentVariable("VONAGE_APP_ID") ?? "VONAGE_APP_ID"; | ||
var privateKeyPath = Environment.GetEnvironmentVariable("VONAGE_PRIVATE_KEY_PATH") ?? "VONAGE_PRIVATE_KEY_PATH"; | ||
var credentials = Credentials.FromAppIdAndPrivateKeyPath(applicationId, privateKeyPath); | ||
var client = new VonageClient(credentials); | ||
var request = DeleteThemeRequest.Build() | ||
.WithThemeId(new Guid("e8b1d80b-8f78-4578-94f2-328596e01387")) | ||
.WithForceDelete() | ||
.Create(); | ||
var response = await client.MeetingsClient.DeleteThemeAsync(request); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
DotNetCliCodeSnippets/Meetings/Guides/IndividualLanguageSelection.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using Vonage; | ||
using Vonage.Meetings.Common; | ||
using Vonage.Meetings.CreateRoom; | ||
using Vonage.Request; | ||
|
||
namespace DotnetCliCodeSnippets.Meetings.Guides; | ||
|
||
public class IndividualLanguageSelection : ICodeSnippet | ||
{ | ||
public async Task Execute() | ||
{ | ||
var applicationId = Environment.GetEnvironmentVariable("VONAGE_APP_ID") ?? "VONAGE_APP_ID"; | ||
var privateKeyPath = Environment.GetEnvironmentVariable("VONAGE_PRIVATE_KEY_PATH") ?? "VONAGE_PRIVATE_KEY_PATH"; | ||
var credentials = Credentials.FromAppIdAndPrivateKeyPath(applicationId, privateKeyPath); | ||
var client = new VonageClient(credentials); | ||
var request = CreateRoomRequest.Build() | ||
.WithDisplayName("New Meeting Room") | ||
.WithFeatures(new Room.Features {IsLocaleSwitcherAvailable = true}) | ||
.Create(); | ||
var response = await client.MeetingsClient.CreateRoomAsync(request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using Vonage; | ||
using Vonage.Meetings.GetRecordings; | ||
using Vonage.Request; | ||
|
||
namespace DotnetCliCodeSnippets.Meetings.Guides; | ||
|
||
public class ListRecordings : ICodeSnippet | ||
{ | ||
public async Task Execute() | ||
{ | ||
var applicationId = Environment.GetEnvironmentVariable("VONAGE_APP_ID") ?? "VONAGE_APP_ID"; | ||
var privateKeyPath = Environment.GetEnvironmentVariable("VONAGE_PRIVATE_KEY_PATH") ?? "VONAGE_PRIVATE_KEY_PATH"; | ||
var credentials = Credentials.FromAppIdAndPrivateKeyPath(applicationId, privateKeyPath); | ||
var client = new VonageClient(credentials); | ||
var request = | ||
GetRecordingsRequest.Parse("2_MX40NjMwODczMn5-MTU3NTgyODEwNzQ2MH5OZDJrVmdBRUNDbG5MUzNqNX20yQ1Z-fg"); | ||
var response = await client.MeetingsClient.GetRecordingsAsync(request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using Vonage; | ||
using Vonage.Meetings.GetRooms; | ||
using Vonage.Request; | ||
|
||
namespace DotnetCliCodeSnippets.Meetings.Guides; | ||
|
||
public class ListRooms : ICodeSnippet | ||
{ | ||
public async Task Execute() | ||
{ | ||
var applicationId = Environment.GetEnvironmentVariable("VONAGE_APP_ID") ?? "VONAGE_APP_ID"; | ||
var privateKeyPath = Environment.GetEnvironmentVariable("VONAGE_PRIVATE_KEY_PATH") ?? "VONAGE_PRIVATE_KEY_PATH"; | ||
var credentials = Credentials.FromAppIdAndPrivateKeyPath(applicationId, privateKeyPath); | ||
var client = new VonageClient(credentials); | ||
var request = GetRoomsRequest.Build().Create(); | ||
var response = await client.MeetingsClient.GetRoomsAsync(request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using Vonage; | ||
using Vonage.Meetings.GetRoomsByTheme; | ||
using Vonage.Request; | ||
|
||
namespace DotnetCliCodeSnippets.Meetings.Guides; | ||
|
||
public class ListRoomsByTheme : ICodeSnippet | ||
{ | ||
public async Task Execute() | ||
{ | ||
var applicationId = Environment.GetEnvironmentVariable("VONAGE_APP_ID") ?? "VONAGE_APP_ID"; | ||
var privateKeyPath = Environment.GetEnvironmentVariable("VONAGE_PRIVATE_KEY_PATH") ?? "VONAGE_PRIVATE_KEY_PATH"; | ||
var credentials = Credentials.FromAppIdAndPrivateKeyPath(applicationId, privateKeyPath); | ||
var client = new VonageClient(credentials); | ||
var request = GetRoomsByThemeRequest.Build() | ||
.WithThemeId(new Guid("e8b1d80b-8f78-4578-94f2-328596e01387")) | ||
.Create(); | ||
var response = await client.MeetingsClient.GetRoomsByThemeAsync(request); | ||
var message = response.Match( | ||
success => $"Rooms retrieved: {success.Rooms}", | ||
failure => $"Rooms retrieval failed: {failure.GetFailureMessage()}"); | ||
Console.WriteLine(message); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
DotNetCliCodeSnippets/Meetings/Guides/PreConfiguredRecordingOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using Vonage; | ||
using Vonage.Meetings.Common; | ||
using Vonage.Meetings.CreateRoom; | ||
using Vonage.Request; | ||
|
||
namespace DotnetCliCodeSnippets.Meetings.Guides; | ||
|
||
public class PreConfiguredRecordingOptions : ICodeSnippet | ||
{ | ||
public async Task Execute() | ||
{ | ||
var applicationId = Environment.GetEnvironmentVariable("VONAGE_APP_ID") ?? "VONAGE_APP_ID"; | ||
var privateKeyPath = Environment.GetEnvironmentVariable("VONAGE_PRIVATE_KEY_PATH") ?? "VONAGE_PRIVATE_KEY_PATH"; | ||
var expirationDate = DateTime.Parse(Environment.GetEnvironmentVariable("EXPIRATION_DATE") ?? "EXPIRATION_DATE"); | ||
var credentials = Credentials.FromAppIdAndPrivateKeyPath(applicationId, privateKeyPath); | ||
var client = new VonageClient(credentials); | ||
var request = CreateRoomRequest.Build() | ||
.WithDisplayName("New Meeting Room") | ||
.AsLongTermRoom(expirationDate) | ||
.WithRecordingOptions(new Room.RecordingOptions {AutoRecord = true, RecordOnlyOwner = true}) | ||
.Create(); | ||
var response = await client.MeetingsClient.CreateRoomAsync(request); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
DotNetCliCodeSnippets/Meetings/Guides/RemoveThemeFromRoom.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using Vonage; | ||
using Vonage.Meetings.UpdateRoom; | ||
using Vonage.Request; | ||
|
||
namespace DotnetCliCodeSnippets.Meetings.Guides; | ||
|
||
public class RemoveThemeFromRoom : ICodeSnippet | ||
{ | ||
public async Task Execute() | ||
{ | ||
var applicationId = Environment.GetEnvironmentVariable("VONAGE_APP_ID") ?? "VONAGE_APP_ID"; | ||
var privateKeyPath = Environment.GetEnvironmentVariable("VONAGE_PRIVATE_KEY_PATH") ?? "VONAGE_PRIVATE_KEY_PATH"; | ||
var credentials = Credentials.FromAppIdAndPrivateKeyPath(applicationId, privateKeyPath); | ||
var client = new VonageClient(credentials); | ||
var request = UpdateRoomRequest.Build() | ||
.WithRoomId(new Guid("9f6fe8ae-3458-4a72-b532-8276d5533e97")) | ||
.WithThemeId(null) | ||
.Create(); | ||
var response = await client.MeetingsClient.UpdateRoomAsync(request); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
DotNetCliCodeSnippets/Meetings/Guides/RetrieveRecording.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using Vonage; | ||
using Vonage.Meetings.GetRecording; | ||
using Vonage.Request; | ||
|
||
namespace DotnetCliCodeSnippets.Meetings.Guides; | ||
|
||
public class RetrieveRecording : ICodeSnippet | ||
{ | ||
public async Task Execute() | ||
{ | ||
var applicationId = Environment.GetEnvironmentVariable("VONAGE_APP_ID") ?? "VONAGE_APP_ID"; | ||
var privateKeyPath = Environment.GetEnvironmentVariable("VONAGE_PRIVATE_KEY_PATH") ?? "VONAGE_PRIVATE_KEY_PATH"; | ||
var credentials = Credentials.FromAppIdAndPrivateKeyPath(applicationId, privateKeyPath); | ||
var client = new VonageClient(credentials); | ||
var request = GetRecordingRequest.Parse(new Guid("9f6fe8ae-3458-4a72-b532-8276d5533e97")); | ||
var response = await client.MeetingsClient.GetRecordingAsync(request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using Vonage; | ||
using Vonage.Meetings.GetRoom; | ||
using Vonage.Request; | ||
|
||
namespace DotnetCliCodeSnippets.Meetings.Guides; | ||
|
||
public class RetrieveRoom : ICodeSnippet | ||
{ | ||
public async Task Execute() | ||
{ | ||
var applicationId = Environment.GetEnvironmentVariable("VONAGE_APP_ID") ?? "VONAGE_APP_ID"; | ||
var privateKeyPath = Environment.GetEnvironmentVariable("VONAGE_PRIVATE_KEY_PATH") ?? "VONAGE_PRIVATE_KEY_PATH"; | ||
var credentials = Credentials.FromAppIdAndPrivateKeyPath(applicationId, privateKeyPath); | ||
var client = new VonageClient(credentials); | ||
var request = GetRoomRequest.Parse(new Guid("9f6fe8ae-3458-4a72-b532-8276d5533e97")); | ||
var response = await client.MeetingsClient.GetRoomAsync(request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using Vonage; | ||
using Vonage.Meetings.GetTheme; | ||
using Vonage.Request; | ||
|
||
namespace DotnetCliCodeSnippets.Meetings.Guides; | ||
|
||
public class RetrieveTheme : ICodeSnippet | ||
{ | ||
public async Task Execute() | ||
{ | ||
var applicationId = Environment.GetEnvironmentVariable("VONAGE_APP_ID") ?? "VONAGE_APP_ID"; | ||
var privateKeyPath = Environment.GetEnvironmentVariable("VONAGE_PRIVATE_KEY_PATH") ?? "VONAGE_PRIVATE_KEY_PATH"; | ||
var credentials = Credentials.FromAppIdAndPrivateKeyPath(applicationId, privateKeyPath); | ||
var client = new VonageClient(credentials); | ||
var request = GetThemeRequest.Parse(new Guid("ef2b46f3-8ebb-437e-a671-272e4990fbc8")); | ||
var response = await client.MeetingsClient.GetThemeAsync(request); | ||
} | ||
} |
Oops, something went wrong.