Skip to content

Commit

Permalink
Flag sync methods as obsolete
Browse files Browse the repository at this point in the history
  • Loading branch information
Tr00d committed Oct 17, 2023
1 parent 0af912e commit 0d21dd1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Vonage/NumberInsights/NumberInsightClient.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Threading.Tasks;
using Vonage.Common;
using Vonage.Request;
Expand All @@ -24,6 +25,7 @@ internal NumberInsightClient(Credentials credentials, Configuration configuratio
}

/// <inheritdoc/>
[Obsolete("Favor asynchronous version instead.")]
public AdvancedInsightsResponse GetNumberInsightAdvanced(AdvancedNumberInsightRequest request,
Credentials creds = null)
{
Expand Down Expand Up @@ -52,6 +54,7 @@ public async Task<AdvancedInsightsResponse> GetNumberInsightAdvancedAsync(Advanc
}

/// <inheritdoc/>
[Obsolete("Favor asynchronous version instead.")]
public AdvancedInsightsAsynchronousResponse GetNumberInsightAsynchronous(
AdvancedNumberInsightAsynchronousRequest request, Credentials creds = null)
{
Expand Down Expand Up @@ -80,6 +83,7 @@ public async Task<AdvancedInsightsAsynchronousResponse> GetNumberInsightAsynchro
}

/// <inheritdoc/>
[Obsolete("Favor asynchronous version instead.")]
public BasicInsightResponse GetNumberInsightBasic(BasicNumberInsightRequest request, Credentials creds = null)
{
var response = ApiRequest.Build(this.GetCredentials(creds), this.configuration, this.timeProvider)
Expand Down Expand Up @@ -107,6 +111,7 @@ public async Task<BasicInsightResponse> GetNumberInsightBasicAsync(BasicNumberIn
}

/// <inheritdoc/>
[Obsolete("Favor asynchronous version instead.")]
public StandardInsightResponse GetNumberInsightStandard(StandardNumberInsightRequest request,
Credentials creds = null)
{
Expand Down Expand Up @@ -143,11 +148,11 @@ public void ValidateNumberInsightResponse(NumberInsightResponseBase response)
case AdvancedInsightsAsynchronousResponse asyncResponse:
throw new VonageNumberInsightResponseException(
$"Advanced Insights Async response failed with status: {asyncResponse.Status}")
{Response = response};
{ Response = response };
case BasicInsightResponse basicInsightResponse:
throw new VonageNumberInsightResponseException(
$"Number insight request failed with status: {basicInsightResponse.Status} and error message: {basicInsightResponse.StatusMessage}")
{Response = response};
{ Response = response };
}
}
}
Expand Down

0 comments on commit 0d21dd1

Please sign in to comment.