Skip to content

Commit

Permalink
build: update SDK to v7.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Tr00d committed Mar 27, 2024
1 parent 55a9995 commit 20b0854
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 25 deletions.
2 changes: 1 addition & 1 deletion DotNetCliCodeSnippets/Application/CreateApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public async Task Execute()
Name = applicationName,
Capabilities = new ApplicationCapabilities{ Messages = messagesCapability }
};
var response = await client.ApplicationClient.CreateApplicaitonAsync(request);
var response = await client.ApplicationClient.CreateApplicationAsync(request);

Console.WriteLine(JsonConvert.SerializeObject(response));

Expand Down
22 changes: 8 additions & 14 deletions DotNetCliCodeSnippets/Application/UpdateApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Vonage.Common;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading.Tasks;
using Newtonsoft.Json;

Expand Down Expand Up @@ -38,20 +39,13 @@ public async Task Execute()
Method = "POST"
});
var messagesCapability = new Vonage.Applications.Capabilities.Messages(messagesWebhooks);
var voiceWebhooks = new Dictionary<Webhook.Type, Webhook>();
voiceWebhooks.Add(Webhook.Type.AnswerUrl,
new Webhook
{
Address = "https://example.com/webhooks/answer",
Method = "GET"
});
voiceWebhooks.Add(Webhook.Type.EventUrl,
new Webhook
{
Address = "https://example.com/webhooks/events",
Method = "POST"
});
var voiceCapability = new Vonage.Applications.Capabilities.Voice(voiceWebhooks);
var voiceWebhooks = new Dictionary<VoiceWebhookType, Vonage.Applications.Capabilities.Voice.VoiceWebhook>();
voiceWebhooks.Add(VoiceWebhookType.AnswerUrl, new Vonage.Applications.Capabilities.Voice.VoiceWebhook(new Uri("https://example.com/webhooks/answer"), HttpMethod.Get));
voiceWebhooks.Add(VoiceWebhookType.EventUrl, new Vonage.Applications.Capabilities.Voice.VoiceWebhook(new Uri("https://example.com/webhooks/events"), HttpMethod.Post));
var voiceCapability = new Vonage.Applications.Capabilities.Voice
{
Webhooks = voiceWebhooks,
};
var rtcWebhooks = new Dictionary<Webhook.Type, Webhook>();
rtcWebhooks.Add(Webhook.Type.EventUrl,
new Webhook
Expand Down
8 changes: 4 additions & 4 deletions DotNetCliCodeSnippets/DotnetCliCodeSnippets.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="Serilog" Version="3.0.1"/>
<PackageReference Include="Serilog.Extensions.Logging" Version="7.0.0"/>
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0"/>
<PackageReference Include="Vonage" Version="6.12.0"/>
<PackageReference Include="Serilog" Version="3.1.1" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
<PackageReference Include="Vonage" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ public class StartVerificationRequestWhatsApp : ICodeSnippet
public async Task Execute()
{
var TO_NUMBER = Environment.GetEnvironmentVariable("TO_NUMBER") ?? "TO_NUMBER";
var FROM_NUMBER = Environment.GetEnvironmentVariable("FROM_NUMBER") ?? "FROM_NUMBER";
var BRAND_NAME = Environment.GetEnvironmentVariable("VONAGE_BRAND_NAME") ?? "VONAGE_BRAND_NAME";
var VONAGE_APPLICATION_ID = Environment.GetEnvironmentVariable("VONAGE_APP_ID") ?? "VONAGE_APP_ID";
var VONAGE_APPLICATION_PRIVATE_KEY_PATH = Environment.GetEnvironmentVariable("VONAGE_PRIVATE_KEY_PATH") ?? "VONAGE_PRIVATE_KEY_PATH";
var credentials = Credentials.FromAppIdAndPrivateKeyPath(VONAGE_APPLICATION_ID, VONAGE_APPLICATION_PRIVATE_KEY_PATH);
var client = new VonageClient(credentials);
var request = StartVerificationRequest.Build()
.WithBrand(BRAND_NAME)
.WithWorkflow(WhatsAppWorkflow.Parse(TO_NUMBER))
.WithWorkflow(WhatsAppWorkflow.Parse(TO_NUMBER, FROM_NUMBER))
.Create();
var response = await client.VerifyV2Client.StartVerificationAsync(request);
var message = response.Match(
Expand Down
10 changes: 5 additions & 5 deletions DotNetWebhookCodeSnippets/DotnetWebhookCodeSnippets.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.12"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.12">
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0"/>
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="7.0.10"/>
<PackageReference Include="Vonage" Version="6.12.0"/>
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.2" />
<PackageReference Include="Vonage" Version="7.0.0" />
</ItemGroup>

</Project>

0 comments on commit 20b0854

Please sign in to comment.