Skip to content

Commit

Permalink
[Librarian] Regenerated @ 45fa5159053e1c1f62f6d613f3b67a9239b43a5f 25…
Browse files Browse the repository at this point in the history
…51818144b7f525e66740ded45831b930db82b8
  • Loading branch information
twilio-dx committed Dec 5, 2024
1 parent ce3b392 commit 1a0880d
Show file tree
Hide file tree
Showing 25 changed files with 1,557 additions and 40 deletions.
22 changes: 22 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
twilio-csharp Changelog
=======================

[2024-12-05] Version 7.8.0
--------------------------
**Library - Fix**
- [PR #770](https://github.com/twilio/twilio-csharp/pull/770): Update TwilioRestClient.cs to add overloaded method in rest client. Thanks to [@AsabuHere](https://github.com/AsabuHere)!

**Library - Feature**
- [PR #767](https://github.com/twilio/twilio-csharp/pull/767): Adding test cases for public oauth uptake. Thanks to [@AsabuHere](https://github.com/AsabuHere)!

**Api**
- Add optional parameter `intelligence_service` to `transcription`
- Updated `phone_number_sid` to be populated for sip trunking terminating calls.

**Numbers**
- Add Update Hosted Number Order V2 API endpoint
- Update Port in docs

**Twiml**
- Add optional parameter `intelligence_service` to `<Transcription>`
- Add support for new `<ConversationRelay>` and `<Assistant>` noun
- Add `events` attribute to `<Dial>` verb


[2024-11-15] Version 7.7.0
--------------------------
**Library - Feature**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ public class CreateTranscriptionOptions : IOptions<TranscriptionResource>
///<summary> The provider will add punctuation to recognition result </summary>
public bool? EnableAutomaticPunctuation { get; set; }

///<summary> The SID or the unique name of the [IntelligentService](https://www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription. </summary>
public string IntelligenceService { get; set; }


/// <summary> Construct a new CreateRealtimeTranscriptionOptions </summary>
/// <param name="pathCallSid"> The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Transcription resource is associated with. </param>
Expand Down Expand Up @@ -139,6 +142,10 @@ public List<KeyValuePair<string, string>> GetParams()
{
p.Add(new KeyValuePair<string, string>("EnableAutomaticPunctuation", EnableAutomaticPunctuation.Value.ToString().ToLower()));
}
if (IntelligenceService != null)
{
p.Add(new KeyValuePair<string, string>("IntelligenceService", IntelligenceService));
}
return p;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ public static async System.Threading.Tasks.Task<TranscriptionResource> CreateAsy
/// <param name="speechModel"> Recognition model used by the transcription engine, among those supported by the provider </param>
/// <param name="hints"> A Phrase contains words and phrase \\\"hints\\\" so that the speech recognition engine is more likely to recognize them. </param>
/// <param name="enableAutomaticPunctuation"> The provider will add punctuation to recognition result </param>
/// <param name="intelligenceService"> The SID or the unique name of the [IntelligentService](https://www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription. </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> A single instance of Transcription </returns>
public static TranscriptionResource Create(
Expand All @@ -149,9 +150,10 @@ public static TranscriptionResource Create(
string speechModel = null,
string hints = null,
bool? enableAutomaticPunctuation = null,
string intelligenceService = null,
ITwilioRestClient client = null)
{
var options = new CreateTranscriptionOptions(pathCallSid){ PathAccountSid = pathAccountSid, Name = name, Track = track, StatusCallbackUrl = statusCallbackUrl, StatusCallbackMethod = statusCallbackMethod, InboundTrackLabel = inboundTrackLabel, OutboundTrackLabel = outboundTrackLabel, PartialResults = partialResults, LanguageCode = languageCode, TranscriptionEngine = transcriptionEngine, ProfanityFilter = profanityFilter, SpeechModel = speechModel, Hints = hints, EnableAutomaticPunctuation = enableAutomaticPunctuation };
var options = new CreateTranscriptionOptions(pathCallSid){ PathAccountSid = pathAccountSid, Name = name, Track = track, StatusCallbackUrl = statusCallbackUrl, StatusCallbackMethod = statusCallbackMethod, InboundTrackLabel = inboundTrackLabel, OutboundTrackLabel = outboundTrackLabel, PartialResults = partialResults, LanguageCode = languageCode, TranscriptionEngine = transcriptionEngine, ProfanityFilter = profanityFilter, SpeechModel = speechModel, Hints = hints, EnableAutomaticPunctuation = enableAutomaticPunctuation, IntelligenceService = intelligenceService };
return Create(options, client);
}

Expand All @@ -172,6 +174,7 @@ public static TranscriptionResource Create(
/// <param name="speechModel"> Recognition model used by the transcription engine, among those supported by the provider </param>
/// <param name="hints"> A Phrase contains words and phrase \\\"hints\\\" so that the speech recognition engine is more likely to recognize them. </param>
/// <param name="enableAutomaticPunctuation"> The provider will add punctuation to recognition result </param>
/// <param name="intelligenceService"> The SID or the unique name of the [IntelligentService](https://www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription. </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> Task that resolves to A single instance of Transcription </returns>
public static async System.Threading.Tasks.Task<TranscriptionResource> CreateAsync(
Expand All @@ -190,9 +193,10 @@ public static async System.Threading.Tasks.Task<TranscriptionResource> CreateAsy
string speechModel = null,
string hints = null,
bool? enableAutomaticPunctuation = null,
string intelligenceService = null,
ITwilioRestClient client = null)
{
var options = new CreateTranscriptionOptions(pathCallSid){ PathAccountSid = pathAccountSid, Name = name, Track = track, StatusCallbackUrl = statusCallbackUrl, StatusCallbackMethod = statusCallbackMethod, InboundTrackLabel = inboundTrackLabel, OutboundTrackLabel = outboundTrackLabel, PartialResults = partialResults, LanguageCode = languageCode, TranscriptionEngine = transcriptionEngine, ProfanityFilter = profanityFilter, SpeechModel = speechModel, Hints = hints, EnableAutomaticPunctuation = enableAutomaticPunctuation };
var options = new CreateTranscriptionOptions(pathCallSid){ PathAccountSid = pathAccountSid, Name = name, Track = track, StatusCallbackUrl = statusCallbackUrl, StatusCallbackMethod = statusCallbackMethod, InboundTrackLabel = inboundTrackLabel, OutboundTrackLabel = outboundTrackLabel, PartialResults = partialResults, LanguageCode = languageCode, TranscriptionEngine = transcriptionEngine, ProfanityFilter = profanityFilter, SpeechModel = speechModel, Hints = hints, EnableAutomaticPunctuation = enableAutomaticPunctuation, IntelligenceService = intelligenceService };
return await CreateAsync(options, client);
}
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
namespace Twilio.Rest.Numbers.V1
{
/// <summary> Allows to fetch the webhook configuration </summary>
public class FetchWebhookOptions : IOptions<WebhookResource>
public class FetchPortingWebhookConfigurationFetchOptions : IOptions<PortingWebhookConfigurationFetchResource>
{


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@

namespace Twilio.Rest.Numbers.V1
{
public class WebhookResource : Resource
public class PortingWebhookConfigurationFetchResource : Resource
{





private static Request BuildFetchRequest(FetchWebhookOptions options, ITwilioRestClient client)
private static Request BuildFetchRequest(FetchPortingWebhookConfigurationFetchOptions options, ITwilioRestClient client)
{

string path = "/v1/Porting/Configuration/Webhook";
Expand All @@ -50,10 +50,10 @@ private static Request BuildFetchRequest(FetchWebhookOptions options, ITwilioRes
}

/// <summary> Allows to fetch the webhook configuration </summary>
/// <param name="options"> Fetch Webhook parameters </param>
/// <param name="options"> Fetch PortingWebhookConfigurationFetch parameters </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> A single instance of Webhook </returns>
public static WebhookResource Fetch(FetchWebhookOptions options, ITwilioRestClient client = null)
/// <returns> A single instance of PortingWebhookConfigurationFetch </returns>
public static PortingWebhookConfigurationFetchResource Fetch(FetchPortingWebhookConfigurationFetchOptions options, ITwilioRestClient client = null)
{
client = client ?? TwilioClient.GetRestClient();
var response = client.Request(BuildFetchRequest(options, client));
Expand All @@ -62,10 +62,10 @@ public static WebhookResource Fetch(FetchWebhookOptions options, ITwilioRestClie

#if !NET35
/// <summary> Allows to fetch the webhook configuration </summary>
/// <param name="options"> Fetch Webhook parameters </param>
/// <param name="options"> Fetch PortingWebhookConfigurationFetch parameters </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> Task that resolves to A single instance of Webhook </returns>
public static async System.Threading.Tasks.Task<WebhookResource> FetchAsync(FetchWebhookOptions options, ITwilioRestClient client = null)
/// <returns> Task that resolves to A single instance of PortingWebhookConfigurationFetch </returns>
public static async System.Threading.Tasks.Task<PortingWebhookConfigurationFetchResource> FetchAsync(FetchPortingWebhookConfigurationFetchOptions options, ITwilioRestClient client = null)
{
client = client ?? TwilioClient.GetRestClient();
var response = await client.RequestAsync(BuildFetchRequest(options, client));
Expand All @@ -74,35 +74,35 @@ public static async System.Threading.Tasks.Task<WebhookResource> FetchAsync(Fetc
#endif
/// <summary> Allows to fetch the webhook configuration </summary>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> A single instance of Webhook </returns>
public static WebhookResource Fetch(
/// <returns> A single instance of PortingWebhookConfigurationFetch </returns>
public static PortingWebhookConfigurationFetchResource Fetch(
ITwilioRestClient client = null)
{
var options = new FetchWebhookOptions(){ };
var options = new FetchPortingWebhookConfigurationFetchOptions(){ };
return Fetch(options, client);
}

#if !NET35
/// <summary> Allows to fetch the webhook configuration </summary>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> Task that resolves to A single instance of Webhook </returns>
public static async System.Threading.Tasks.Task<WebhookResource> FetchAsync(ITwilioRestClient client = null)
/// <returns> Task that resolves to A single instance of PortingWebhookConfigurationFetch </returns>
public static async System.Threading.Tasks.Task<PortingWebhookConfigurationFetchResource> FetchAsync(ITwilioRestClient client = null)
{
var options = new FetchWebhookOptions(){ };
var options = new FetchPortingWebhookConfigurationFetchOptions(){ };
return await FetchAsync(options, client);
}
#endif

/// <summary>
/// Converts a JSON string into a WebhookResource object
/// Converts a JSON string into a PortingWebhookConfigurationFetchResource object
/// </summary>
/// <param name="json"> Raw JSON string </param>
/// <returns> WebhookResource object represented by the provided JSON </returns>
public static WebhookResource FromJson(string json)
/// <returns> PortingWebhookConfigurationFetchResource object represented by the provided JSON </returns>
public static PortingWebhookConfigurationFetchResource FromJson(string json)
{
try
{
return JsonConvert.DeserializeObject<WebhookResource>(json);
return JsonConvert.DeserializeObject<PortingWebhookConfigurationFetchResource>(json);
}
catch (JsonException e)
{
Expand Down Expand Up @@ -153,7 +153,7 @@ public static string ToJson(object model)



private WebhookResource() {
private PortingWebhookConfigurationFetchResource() {

}
}
Expand Down
53 changes: 53 additions & 0 deletions src/Twilio/Rest/Numbers/V2/HostedNumberOrderOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,5 +286,58 @@ public List<KeyValuePair<string, string>> GetParams()

}

/// <summary> Updates a specific HostedNumberOrder. </summary>
public class UpdateHostedNumberOrderOptions : IOptions<HostedNumberOrderResource>
{

///<summary> The SID of the HostedNumberOrder resource to update. </summary>
public string PathSid { get; }


public HostedNumberOrderResource.StatusEnum Status { get; }

///<summary> The number of seconds to wait before initiating the ownership verification call. Can be a value between 0 and 60, inclusive. </summary>
public int? VerificationCallDelay { get; set; }

///<summary> The numerical extension to dial when making the ownership verification call. </summary>
public string VerificationCallExtension { get; set; }



/// <summary> Construct a new UpdateHostedNumberOrderOptions </summary>
/// <param name="pathSid"> The SID of the HostedNumberOrder resource to update. </param>
/// <param name="status"> </param>
public UpdateHostedNumberOrderOptions(string pathSid, HostedNumberOrderResource.StatusEnum status)
{
PathSid = pathSid;
Status = status;
}


/// <summary> Generate the necessary parameters </summary>
public List<KeyValuePair<string, string>> GetParams()
{
var p = new List<KeyValuePair<string, string>>();

if (Status != null)
{
p.Add(new KeyValuePair<string, string>("Status", Status.ToString()));
}
if (VerificationCallDelay != null)
{
p.Add(new KeyValuePair<string, string>("VerificationCallDelay", VerificationCallDelay.ToString()));
}
if (VerificationCallExtension != null)
{
p.Add(new KeyValuePair<string, string>("VerificationCallExtension", VerificationCallExtension));
}
return p;
}



}


}

Loading

0 comments on commit 1a0880d

Please sign in to comment.