From 86266beda4e732608179126683340211f18f5552 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 5 Oct 2022 11:01:14 -0700 Subject: [PATCH] [Librarian] Regenerated @ f65fb6491354c2afb05cb81a1442ab0880c883c1 --- CHANGES.md | 17 ++++ .../Account/Conference/ParticipantOptions.cs | 63 +++++++++++++++ .../Account/Conference/ParticipantResource.cs | 34 +++++++- .../Account/Usage/Record/AllTimeResource.cs | 1 + .../Account/Usage/Record/DailyResource.cs | 1 + .../Account/Usage/Record/LastMonthResource.cs | 1 + .../Account/Usage/Record/MonthlyResource.cs | 1 + .../Account/Usage/Record/ThisMonthResource.cs | 1 + .../Account/Usage/Record/TodayResource.cs | 1 + .../Account/Usage/Record/YearlyResource.cs | 1 + .../Account/Usage/Record/YesterdayResource.cs | 1 + .../Api/V2010/Account/Usage/RecordResource.cs | 1 + .../V2010/Account/Usage/TriggerResource.cs | 1 + src/Twilio/TwiML/Voice/Dial.cs | 52 +++++++++++- src/Twilio/TwiML/Voice/Number.cs | 80 ++++++++++++++++++- src/Twilio/TwiML/Voice/Sip.cs | 80 ++++++++++++++++++- test/Twilio.Test/TwiML/DialTest.cs | 22 ++++- test/Twilio.Test/TwiML/NumberTest.cs | 11 ++- test/Twilio.Test/TwiML/SipTest.cs | 11 ++- 19 files changed, 364 insertions(+), 16 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 2b8c392cf..37ed504a9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,23 @@ twilio-csharp Changelog ======================= +[2022-10-05] Version 5.80.1 +--------------------------- +**Library - Fix** +- [PR #632](https://github.com/twilio/twilio-csharp/pull/632): handling null 'from' parameter. Thanks to [@isha689](https://github.com/isha689)! +- [PR #636](https://github.com/twilio/twilio-csharp/pull/636): Make sonar exclusions a variable to reuse this file. Thanks to [@AsabuHere](https://github.com/AsabuHere)! + +**Library - Test** +- [PR #634](https://github.com/twilio/twilio-csharp/pull/634): Modifying make command to take project name and token as arguments for reuse. Thanks to [@AsabuHere](https://github.com/AsabuHere)! + +**Api** +- Added `virtual-agent` to `usage_record` API. +- Add AMD attributes to participant create request + +**Twiml** +- Add AMD attributes to `Number` and `Sip` + + [2022-09-07] Version 5.80.0 --------------------------- **Flex** diff --git a/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantOptions.cs b/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantOptions.cs index f6f294ff9..4e7f23eba 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantOptions.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantOptions.cs @@ -368,6 +368,34 @@ public class CreateParticipantOptions : IOptions /// The maximum duration of the call in seconds. /// public int? TimeLimit { get; set; } + /// + /// Enable machine detection or end of greeting detection + /// + public string MachineDetection { get; set; } + /// + /// Number of seconds to wait for machine detection + /// + public int? MachineDetectionTimeout { get; set; } + /// + /// Number of milliseconds for measuring stick for the length of the speech activity + /// + public int? MachineDetectionSpeechThreshold { get; set; } + /// + /// Number of milliseconds of silence after speech activity + /// + public int? MachineDetectionSpeechEndThreshold { get; set; } + /// + /// Number of milliseconds of initial silence + /// + public int? MachineDetectionSilenceTimeout { get; set; } + /// + /// The URL we should call to send amd status information to your application + /// + public Uri AmdStatusCallback { get; set; } + /// + /// HTTP Method to use with amd_status_callback + /// + public Twilio.Http.HttpMethod AmdStatusCallbackMethod { get; set; } /// /// Construct a new CreateParticipantOptions @@ -588,6 +616,41 @@ public List> GetParams() p.Add(new KeyValuePair("TimeLimit", TimeLimit.ToString())); } + if (MachineDetection != null) + { + p.Add(new KeyValuePair("MachineDetection", MachineDetection)); + } + + if (MachineDetectionTimeout != null) + { + p.Add(new KeyValuePair("MachineDetectionTimeout", MachineDetectionTimeout.ToString())); + } + + if (MachineDetectionSpeechThreshold != null) + { + p.Add(new KeyValuePair("MachineDetectionSpeechThreshold", MachineDetectionSpeechThreshold.ToString())); + } + + if (MachineDetectionSpeechEndThreshold != null) + { + p.Add(new KeyValuePair("MachineDetectionSpeechEndThreshold", MachineDetectionSpeechEndThreshold.ToString())); + } + + if (MachineDetectionSilenceTimeout != null) + { + p.Add(new KeyValuePair("MachineDetectionSilenceTimeout", MachineDetectionSilenceTimeout.ToString())); + } + + if (AmdStatusCallback != null) + { + p.Add(new KeyValuePair("AmdStatusCallback", Serializers.Url(AmdStatusCallback))); + } + + if (AmdStatusCallbackMethod != null) + { + p.Add(new KeyValuePair("AmdStatusCallbackMethod", AmdStatusCallbackMethod.ToString())); + } + return p; } } diff --git a/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantResource.cs b/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantResource.cs index 33b208473..1b9bf2122 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantResource.cs @@ -338,6 +338,14 @@ public static async System.Threading.Tasks.Task CreateAsync /// Reason for the call (Branded Calls Beta) /// The track(s) to record /// The maximum duration of the call in seconds. + /// Enable machine detection or end of greeting detection + /// Number of seconds to wait for machine detection + /// Number of milliseconds for measuring stick for the length of the + /// speech activity + /// Number of milliseconds of silence after speech activity + /// Number of milliseconds of initial silence + /// The URL we should call to send amd status information to your application + /// HTTP Method to use with amd_status_callback /// Client to make requests to Twilio /// A single instance of Participant public static ParticipantResource Create(string pathConferenceSid, @@ -381,9 +389,16 @@ public static ParticipantResource Create(string pathConferenceSid, string callReason = null, string recordingTrack = null, int? timeLimit = null, + string machineDetection = null, + int? machineDetectionTimeout = null, + int? machineDetectionSpeechThreshold = null, + int? machineDetectionSpeechEndThreshold = null, + int? machineDetectionSilenceTimeout = null, + Uri amdStatusCallback = null, + Twilio.Http.HttpMethod amdStatusCallbackMethod = null, ITwilioRestClient client = null) { - var options = new CreateParticipantOptions(pathConferenceSid, from, to){PathAccountSid = pathAccountSid, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, StatusCallbackEvent = statusCallbackEvent, Label = label, Timeout = timeout, Record = record, Muted = muted, Beep = beep, StartConferenceOnEnter = startConferenceOnEnter, EndConferenceOnExit = endConferenceOnExit, WaitUrl = waitUrl, WaitMethod = waitMethod, EarlyMedia = earlyMedia, MaxParticipants = maxParticipants, ConferenceRecord = conferenceRecord, ConferenceTrim = conferenceTrim, ConferenceStatusCallback = conferenceStatusCallback, ConferenceStatusCallbackMethod = conferenceStatusCallbackMethod, ConferenceStatusCallbackEvent = conferenceStatusCallbackEvent, RecordingChannels = recordingChannels, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, SipAuthUsername = sipAuthUsername, SipAuthPassword = sipAuthPassword, Region = region, ConferenceRecordingStatusCallback = conferenceRecordingStatusCallback, ConferenceRecordingStatusCallbackMethod = conferenceRecordingStatusCallbackMethod, RecordingStatusCallbackEvent = recordingStatusCallbackEvent, ConferenceRecordingStatusCallbackEvent = conferenceRecordingStatusCallbackEvent, Coaching = coaching, CallSidToCoach = callSidToCoach, JitterBufferSize = jitterBufferSize, Byoc = byoc, CallerId = callerId, CallReason = callReason, RecordingTrack = recordingTrack, TimeLimit = timeLimit}; + var options = new CreateParticipantOptions(pathConferenceSid, from, to){PathAccountSid = pathAccountSid, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, StatusCallbackEvent = statusCallbackEvent, Label = label, Timeout = timeout, Record = record, Muted = muted, Beep = beep, StartConferenceOnEnter = startConferenceOnEnter, EndConferenceOnExit = endConferenceOnExit, WaitUrl = waitUrl, WaitMethod = waitMethod, EarlyMedia = earlyMedia, MaxParticipants = maxParticipants, ConferenceRecord = conferenceRecord, ConferenceTrim = conferenceTrim, ConferenceStatusCallback = conferenceStatusCallback, ConferenceStatusCallbackMethod = conferenceStatusCallbackMethod, ConferenceStatusCallbackEvent = conferenceStatusCallbackEvent, RecordingChannels = recordingChannels, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, SipAuthUsername = sipAuthUsername, SipAuthPassword = sipAuthPassword, Region = region, ConferenceRecordingStatusCallback = conferenceRecordingStatusCallback, ConferenceRecordingStatusCallbackMethod = conferenceRecordingStatusCallbackMethod, RecordingStatusCallbackEvent = recordingStatusCallbackEvent, ConferenceRecordingStatusCallbackEvent = conferenceRecordingStatusCallbackEvent, Coaching = coaching, CallSidToCoach = callSidToCoach, JitterBufferSize = jitterBufferSize, Byoc = byoc, CallerId = callerId, CallReason = callReason, RecordingTrack = recordingTrack, TimeLimit = timeLimit, MachineDetection = machineDetection, MachineDetectionTimeout = machineDetectionTimeout, MachineDetectionSpeechThreshold = machineDetectionSpeechThreshold, MachineDetectionSpeechEndThreshold = machineDetectionSpeechEndThreshold, MachineDetectionSilenceTimeout = machineDetectionSilenceTimeout, AmdStatusCallback = amdStatusCallback, AmdStatusCallbackMethod = amdStatusCallbackMethod}; return Create(options, client); } @@ -444,6 +459,14 @@ public static ParticipantResource Create(string pathConferenceSid, /// Reason for the call (Branded Calls Beta) /// The track(s) to record /// The maximum duration of the call in seconds. + /// Enable machine detection or end of greeting detection + /// Number of seconds to wait for machine detection + /// Number of milliseconds for measuring stick for the length of the + /// speech activity + /// Number of milliseconds of silence after speech activity + /// Number of milliseconds of initial silence + /// The URL we should call to send amd status information to your application + /// HTTP Method to use with amd_status_callback /// Client to make requests to Twilio /// Task that resolves to A single instance of Participant public static async System.Threading.Tasks.Task CreateAsync(string pathConferenceSid, @@ -487,9 +510,16 @@ public static async System.Threading.Tasks.Task CreateAsync string callReason = null, string recordingTrack = null, int? timeLimit = null, + string machineDetection = null, + int? machineDetectionTimeout = null, + int? machineDetectionSpeechThreshold = null, + int? machineDetectionSpeechEndThreshold = null, + int? machineDetectionSilenceTimeout = null, + Uri amdStatusCallback = null, + Twilio.Http.HttpMethod amdStatusCallbackMethod = null, ITwilioRestClient client = null) { - var options = new CreateParticipantOptions(pathConferenceSid, from, to){PathAccountSid = pathAccountSid, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, StatusCallbackEvent = statusCallbackEvent, Label = label, Timeout = timeout, Record = record, Muted = muted, Beep = beep, StartConferenceOnEnter = startConferenceOnEnter, EndConferenceOnExit = endConferenceOnExit, WaitUrl = waitUrl, WaitMethod = waitMethod, EarlyMedia = earlyMedia, MaxParticipants = maxParticipants, ConferenceRecord = conferenceRecord, ConferenceTrim = conferenceTrim, ConferenceStatusCallback = conferenceStatusCallback, ConferenceStatusCallbackMethod = conferenceStatusCallbackMethod, ConferenceStatusCallbackEvent = conferenceStatusCallbackEvent, RecordingChannels = recordingChannels, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, SipAuthUsername = sipAuthUsername, SipAuthPassword = sipAuthPassword, Region = region, ConferenceRecordingStatusCallback = conferenceRecordingStatusCallback, ConferenceRecordingStatusCallbackMethod = conferenceRecordingStatusCallbackMethod, RecordingStatusCallbackEvent = recordingStatusCallbackEvent, ConferenceRecordingStatusCallbackEvent = conferenceRecordingStatusCallbackEvent, Coaching = coaching, CallSidToCoach = callSidToCoach, JitterBufferSize = jitterBufferSize, Byoc = byoc, CallerId = callerId, CallReason = callReason, RecordingTrack = recordingTrack, TimeLimit = timeLimit}; + var options = new CreateParticipantOptions(pathConferenceSid, from, to){PathAccountSid = pathAccountSid, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, StatusCallbackEvent = statusCallbackEvent, Label = label, Timeout = timeout, Record = record, Muted = muted, Beep = beep, StartConferenceOnEnter = startConferenceOnEnter, EndConferenceOnExit = endConferenceOnExit, WaitUrl = waitUrl, WaitMethod = waitMethod, EarlyMedia = earlyMedia, MaxParticipants = maxParticipants, ConferenceRecord = conferenceRecord, ConferenceTrim = conferenceTrim, ConferenceStatusCallback = conferenceStatusCallback, ConferenceStatusCallbackMethod = conferenceStatusCallbackMethod, ConferenceStatusCallbackEvent = conferenceStatusCallbackEvent, RecordingChannels = recordingChannels, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, SipAuthUsername = sipAuthUsername, SipAuthPassword = sipAuthPassword, Region = region, ConferenceRecordingStatusCallback = conferenceRecordingStatusCallback, ConferenceRecordingStatusCallbackMethod = conferenceRecordingStatusCallbackMethod, RecordingStatusCallbackEvent = recordingStatusCallbackEvent, ConferenceRecordingStatusCallbackEvent = conferenceRecordingStatusCallbackEvent, Coaching = coaching, CallSidToCoach = callSidToCoach, JitterBufferSize = jitterBufferSize, Byoc = byoc, CallerId = callerId, CallReason = callReason, RecordingTrack = recordingTrack, TimeLimit = timeLimit, MachineDetection = machineDetection, MachineDetectionTimeout = machineDetectionTimeout, MachineDetectionSpeechThreshold = machineDetectionSpeechThreshold, MachineDetectionSpeechEndThreshold = machineDetectionSpeechEndThreshold, MachineDetectionSilenceTimeout = machineDetectionSilenceTimeout, AmdStatusCallback = amdStatusCallback, AmdStatusCallbackMethod = amdStatusCallbackMethod}; return await CreateAsync(options, client); } #endif diff --git a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeResource.cs b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeResource.cs index 327c3eb9a..21e0adf5e 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeResource.cs @@ -228,6 +228,7 @@ public static implicit operator CategoryEnum(string value) public static readonly CategoryEnum VerifyTotp = new CategoryEnum("verify-totp"); public static readonly CategoryEnum VerifyWhatsappConversationsBusinessInitiated = new CategoryEnum("verify-whatsapp-conversations-business-initiated"); public static readonly CategoryEnum VideoRecordings = new CategoryEnum("video-recordings"); + public static readonly CategoryEnum VirtualAgent = new CategoryEnum("virtual-agent"); public static readonly CategoryEnum VoiceInsights = new CategoryEnum("voice-insights"); public static readonly CategoryEnum VoiceInsightsClientInsightsOnDemandMinute = new CategoryEnum("voice-insights-client-insights-on-demand-minute"); public static readonly CategoryEnum VoiceInsightsPtsnInsightsOnDemandMinute = new CategoryEnum("voice-insights-ptsn-insights-on-demand-minute"); diff --git a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyResource.cs b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyResource.cs index cd7edd0d7..36673b32f 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyResource.cs @@ -228,6 +228,7 @@ public static implicit operator CategoryEnum(string value) public static readonly CategoryEnum VerifyTotp = new CategoryEnum("verify-totp"); public static readonly CategoryEnum VerifyWhatsappConversationsBusinessInitiated = new CategoryEnum("verify-whatsapp-conversations-business-initiated"); public static readonly CategoryEnum VideoRecordings = new CategoryEnum("video-recordings"); + public static readonly CategoryEnum VirtualAgent = new CategoryEnum("virtual-agent"); public static readonly CategoryEnum VoiceInsights = new CategoryEnum("voice-insights"); public static readonly CategoryEnum VoiceInsightsClientInsightsOnDemandMinute = new CategoryEnum("voice-insights-client-insights-on-demand-minute"); public static readonly CategoryEnum VoiceInsightsPtsnInsightsOnDemandMinute = new CategoryEnum("voice-insights-ptsn-insights-on-demand-minute"); diff --git a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthResource.cs b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthResource.cs index 6f4d4d7c9..b5a365164 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthResource.cs @@ -228,6 +228,7 @@ public static implicit operator CategoryEnum(string value) public static readonly CategoryEnum VerifyTotp = new CategoryEnum("verify-totp"); public static readonly CategoryEnum VerifyWhatsappConversationsBusinessInitiated = new CategoryEnum("verify-whatsapp-conversations-business-initiated"); public static readonly CategoryEnum VideoRecordings = new CategoryEnum("video-recordings"); + public static readonly CategoryEnum VirtualAgent = new CategoryEnum("virtual-agent"); public static readonly CategoryEnum VoiceInsights = new CategoryEnum("voice-insights"); public static readonly CategoryEnum VoiceInsightsClientInsightsOnDemandMinute = new CategoryEnum("voice-insights-client-insights-on-demand-minute"); public static readonly CategoryEnum VoiceInsightsPtsnInsightsOnDemandMinute = new CategoryEnum("voice-insights-ptsn-insights-on-demand-minute"); diff --git a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyResource.cs b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyResource.cs index 3ca4466d7..74eff997c 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyResource.cs @@ -228,6 +228,7 @@ public static implicit operator CategoryEnum(string value) public static readonly CategoryEnum VerifyTotp = new CategoryEnum("verify-totp"); public static readonly CategoryEnum VerifyWhatsappConversationsBusinessInitiated = new CategoryEnum("verify-whatsapp-conversations-business-initiated"); public static readonly CategoryEnum VideoRecordings = new CategoryEnum("video-recordings"); + public static readonly CategoryEnum VirtualAgent = new CategoryEnum("virtual-agent"); public static readonly CategoryEnum VoiceInsights = new CategoryEnum("voice-insights"); public static readonly CategoryEnum VoiceInsightsClientInsightsOnDemandMinute = new CategoryEnum("voice-insights-client-insights-on-demand-minute"); public static readonly CategoryEnum VoiceInsightsPtsnInsightsOnDemandMinute = new CategoryEnum("voice-insights-ptsn-insights-on-demand-minute"); diff --git a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthResource.cs b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthResource.cs index 6092539bc..f0b06e6e9 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthResource.cs @@ -228,6 +228,7 @@ public static implicit operator CategoryEnum(string value) public static readonly CategoryEnum VerifyTotp = new CategoryEnum("verify-totp"); public static readonly CategoryEnum VerifyWhatsappConversationsBusinessInitiated = new CategoryEnum("verify-whatsapp-conversations-business-initiated"); public static readonly CategoryEnum VideoRecordings = new CategoryEnum("video-recordings"); + public static readonly CategoryEnum VirtualAgent = new CategoryEnum("virtual-agent"); public static readonly CategoryEnum VoiceInsights = new CategoryEnum("voice-insights"); public static readonly CategoryEnum VoiceInsightsClientInsightsOnDemandMinute = new CategoryEnum("voice-insights-client-insights-on-demand-minute"); public static readonly CategoryEnum VoiceInsightsPtsnInsightsOnDemandMinute = new CategoryEnum("voice-insights-ptsn-insights-on-demand-minute"); diff --git a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayResource.cs b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayResource.cs index f425634b7..514ed629a 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayResource.cs @@ -228,6 +228,7 @@ public static implicit operator CategoryEnum(string value) public static readonly CategoryEnum VerifyTotp = new CategoryEnum("verify-totp"); public static readonly CategoryEnum VerifyWhatsappConversationsBusinessInitiated = new CategoryEnum("verify-whatsapp-conversations-business-initiated"); public static readonly CategoryEnum VideoRecordings = new CategoryEnum("video-recordings"); + public static readonly CategoryEnum VirtualAgent = new CategoryEnum("virtual-agent"); public static readonly CategoryEnum VoiceInsights = new CategoryEnum("voice-insights"); public static readonly CategoryEnum VoiceInsightsClientInsightsOnDemandMinute = new CategoryEnum("voice-insights-client-insights-on-demand-minute"); public static readonly CategoryEnum VoiceInsightsPtsnInsightsOnDemandMinute = new CategoryEnum("voice-insights-ptsn-insights-on-demand-minute"); diff --git a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyResource.cs b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyResource.cs index 4daeb8aa8..c3e4fc5d3 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyResource.cs @@ -228,6 +228,7 @@ public static implicit operator CategoryEnum(string value) public static readonly CategoryEnum VerifyTotp = new CategoryEnum("verify-totp"); public static readonly CategoryEnum VerifyWhatsappConversationsBusinessInitiated = new CategoryEnum("verify-whatsapp-conversations-business-initiated"); public static readonly CategoryEnum VideoRecordings = new CategoryEnum("video-recordings"); + public static readonly CategoryEnum VirtualAgent = new CategoryEnum("virtual-agent"); public static readonly CategoryEnum VoiceInsights = new CategoryEnum("voice-insights"); public static readonly CategoryEnum VoiceInsightsClientInsightsOnDemandMinute = new CategoryEnum("voice-insights-client-insights-on-demand-minute"); public static readonly CategoryEnum VoiceInsightsPtsnInsightsOnDemandMinute = new CategoryEnum("voice-insights-ptsn-insights-on-demand-minute"); diff --git a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayResource.cs b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayResource.cs index c0504c084..aeffbfe67 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayResource.cs @@ -228,6 +228,7 @@ public static implicit operator CategoryEnum(string value) public static readonly CategoryEnum VerifyTotp = new CategoryEnum("verify-totp"); public static readonly CategoryEnum VerifyWhatsappConversationsBusinessInitiated = new CategoryEnum("verify-whatsapp-conversations-business-initiated"); public static readonly CategoryEnum VideoRecordings = new CategoryEnum("video-recordings"); + public static readonly CategoryEnum VirtualAgent = new CategoryEnum("virtual-agent"); public static readonly CategoryEnum VoiceInsights = new CategoryEnum("voice-insights"); public static readonly CategoryEnum VoiceInsightsClientInsightsOnDemandMinute = new CategoryEnum("voice-insights-client-insights-on-demand-minute"); public static readonly CategoryEnum VoiceInsightsPtsnInsightsOnDemandMinute = new CategoryEnum("voice-insights-ptsn-insights-on-demand-minute"); diff --git a/src/Twilio/Rest/Api/V2010/Account/Usage/RecordResource.cs b/src/Twilio/Rest/Api/V2010/Account/Usage/RecordResource.cs index 8166ee070..24cfcc202 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Usage/RecordResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Usage/RecordResource.cs @@ -228,6 +228,7 @@ public static implicit operator CategoryEnum(string value) public static readonly CategoryEnum VerifyTotp = new CategoryEnum("verify-totp"); public static readonly CategoryEnum VerifyWhatsappConversationsBusinessInitiated = new CategoryEnum("verify-whatsapp-conversations-business-initiated"); public static readonly CategoryEnum VideoRecordings = new CategoryEnum("video-recordings"); + public static readonly CategoryEnum VirtualAgent = new CategoryEnum("virtual-agent"); public static readonly CategoryEnum VoiceInsights = new CategoryEnum("voice-insights"); public static readonly CategoryEnum VoiceInsightsClientInsightsOnDemandMinute = new CategoryEnum("voice-insights-client-insights-on-demand-minute"); public static readonly CategoryEnum VoiceInsightsPtsnInsightsOnDemandMinute = new CategoryEnum("voice-insights-ptsn-insights-on-demand-minute"); diff --git a/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerResource.cs b/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerResource.cs index 6d55675b2..86758dd81 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerResource.cs +++ b/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerResource.cs @@ -228,6 +228,7 @@ public static implicit operator UsageCategoryEnum(string value) public static readonly UsageCategoryEnum VerifyTotp = new UsageCategoryEnum("verify-totp"); public static readonly UsageCategoryEnum VerifyWhatsappConversationsBusinessInitiated = new UsageCategoryEnum("verify-whatsapp-conversations-business-initiated"); public static readonly UsageCategoryEnum VideoRecordings = new UsageCategoryEnum("video-recordings"); + public static readonly UsageCategoryEnum VirtualAgent = new UsageCategoryEnum("virtual-agent"); public static readonly UsageCategoryEnum VoiceInsights = new UsageCategoryEnum("voice-insights"); public static readonly UsageCategoryEnum VoiceInsightsClientInsightsOnDemandMinute = new UsageCategoryEnum("voice-insights-client-insights-on-demand-minute"); public static readonly UsageCategoryEnum VoiceInsightsPtsnInsightsOnDemandMinute = new UsageCategoryEnum("voice-insights-ptsn-insights-on-demand-minute"); diff --git a/src/Twilio/TwiML/Voice/Dial.cs b/src/Twilio/TwiML/Voice/Dial.cs index a30e28c46..685683aac 100644 --- a/src/Twilio/TwiML/Voice/Dial.cs +++ b/src/Twilio/TwiML/Voice/Dial.cs @@ -483,6 +483,14 @@ public Dial Conference(Conference conference) /// Status callback URL /// Status callback URL method /// BYOC trunk SID (Beta) + /// Enable machine detection or end of greeting detection + /// HTTP Method to use with amd_status_callback + /// The URL we should call to send amd status information to your application + /// Number of seconds to wait for machine detection + /// Number of milliseconds for measuring stick for the length of the + /// speech activity + /// Number of milliseconds of silence after speech activity + /// Number of milliseconds of initial silence public Dial Number(Types.PhoneNumber phoneNumber = null, string sendDigits = null, Uri url = null, @@ -490,7 +498,14 @@ public Dial Number(Types.PhoneNumber phoneNumber = null, List statusCallbackEvent = null, Uri statusCallback = null, Twilio.Http.HttpMethod statusCallbackMethod = null, - string byoc = null) + string byoc = null, + string machineDetection = null, + Twilio.Http.HttpMethod amdStatusCallbackMethod = null, + string amdStatusCallback = null, + int? machineDetectionTimeout = null, + int? machineDetectionSpeechThreshold = null, + int? machineDetectionSpeechEndThreshold = null, + int? machineDetectionSilenceTimeout = null) { var newChild = new Number( phoneNumber, @@ -500,7 +515,14 @@ public Dial Number(Types.PhoneNumber phoneNumber = null, statusCallbackEvent, statusCallback, statusCallbackMethod, - byoc + byoc, + machineDetection, + amdStatusCallbackMethod, + amdStatusCallback, + machineDetectionTimeout, + machineDetectionSpeechThreshold, + machineDetectionSpeechEndThreshold, + machineDetectionSilenceTimeout ); this.Append(newChild); return this; @@ -580,6 +602,14 @@ public Dial Sim(Sim sim) /// Status callback events /// Status callback URL /// Status callback URL method + /// Enable machine detection or end of greeting detection + /// HTTP Method to use with amd_status_callback + /// The URL we should call to send amd status information to your application + /// Number of seconds to wait for machine detection + /// Number of milliseconds for measuring stick for the length of the + /// speech activity + /// Number of milliseconds of silence after speech activity + /// Number of milliseconds of initial silence public Dial Sip(Uri sipUrl = null, string username = null, string password = null, @@ -587,7 +617,14 @@ public Dial Sip(Uri sipUrl = null, Twilio.Http.HttpMethod method = null, List statusCallbackEvent = null, Uri statusCallback = null, - Twilio.Http.HttpMethod statusCallbackMethod = null) + Twilio.Http.HttpMethod statusCallbackMethod = null, + string machineDetection = null, + Twilio.Http.HttpMethod amdStatusCallbackMethod = null, + string amdStatusCallback = null, + int? machineDetectionTimeout = null, + int? machineDetectionSpeechThreshold = null, + int? machineDetectionSpeechEndThreshold = null, + int? machineDetectionSilenceTimeout = null) { var newChild = new Sip( sipUrl, @@ -597,7 +634,14 @@ public Dial Sip(Uri sipUrl = null, method, statusCallbackEvent, statusCallback, - statusCallbackMethod + statusCallbackMethod, + machineDetection, + amdStatusCallbackMethod, + amdStatusCallback, + machineDetectionTimeout, + machineDetectionSpeechThreshold, + machineDetectionSpeechEndThreshold, + machineDetectionSilenceTimeout ); this.Append(newChild); return this; diff --git a/src/Twilio/TwiML/Voice/Number.cs b/src/Twilio/TwiML/Voice/Number.cs index 3e128bec0..70a21cdb7 100644 --- a/src/Twilio/TwiML/Voice/Number.cs +++ b/src/Twilio/TwiML/Voice/Number.cs @@ -67,6 +67,34 @@ public static implicit operator EventEnum(string value) /// BYOC trunk SID (Beta) /// public string Byoc { get; set; } + /// + /// Enable machine detection or end of greeting detection + /// + public string MachineDetection { get; set; } + /// + /// HTTP Method to use with amd_status_callback + /// + public Twilio.Http.HttpMethod AmdStatusCallbackMethod { get; set; } + /// + /// The URL we should call to send amd status information to your application + /// + public string AmdStatusCallback { get; set; } + /// + /// Number of seconds to wait for machine detection + /// + public int? MachineDetectionTimeout { get; set; } + /// + /// Number of milliseconds for measuring stick for the length of the speech activity + /// + public int? MachineDetectionSpeechThreshold { get; set; } + /// + /// Number of milliseconds of silence after speech activity + /// + public int? MachineDetectionSpeechEndThreshold { get; set; } + /// + /// Number of milliseconds of initial silence + /// + public int? MachineDetectionSilenceTimeout { get; set; } /// /// Create a new Number @@ -79,6 +107,14 @@ public static implicit operator EventEnum(string value) /// Status callback URL /// Status callback URL method /// BYOC trunk SID (Beta) + /// Enable machine detection or end of greeting detection + /// HTTP Method to use with amd_status_callback + /// The URL we should call to send amd status information to your application + /// Number of seconds to wait for machine detection + /// Number of milliseconds for measuring stick for the length of the + /// speech activity + /// Number of milliseconds of silence after speech activity + /// Number of milliseconds of initial silence public Number(Types.PhoneNumber phoneNumber = null, string sendDigits = null, Uri url = null, @@ -86,7 +122,14 @@ public Number(Types.PhoneNumber phoneNumber = null, List statusCallbackEvent = null, Uri statusCallback = null, Twilio.Http.HttpMethod statusCallbackMethod = null, - string byoc = null) : base("Number") + string byoc = null, + string machineDetection = null, + Twilio.Http.HttpMethod amdStatusCallbackMethod = null, + string amdStatusCallback = null, + int? machineDetectionTimeout = null, + int? machineDetectionSpeechThreshold = null, + int? machineDetectionSpeechEndThreshold = null, + int? machineDetectionSilenceTimeout = null) : base("Number") { this.PhoneNumber = phoneNumber; this.SendDigits = sendDigits; @@ -96,6 +139,13 @@ public Number(Types.PhoneNumber phoneNumber = null, this.StatusCallback = statusCallback; this.StatusCallbackMethod = statusCallbackMethod; this.Byoc = byoc; + this.MachineDetection = machineDetection; + this.AmdStatusCallbackMethod = amdStatusCallbackMethod; + this.AmdStatusCallback = amdStatusCallback; + this.MachineDetectionTimeout = machineDetectionTimeout; + this.MachineDetectionSpeechThreshold = machineDetectionSpeechThreshold; + this.MachineDetectionSpeechEndThreshold = machineDetectionSpeechEndThreshold; + this.MachineDetectionSilenceTimeout = machineDetectionSilenceTimeout; } /// @@ -140,6 +190,34 @@ protected override List GetElementAttributes() { attributes.Add(new XAttribute("byoc", this.Byoc.ToString())); } + if (this.MachineDetection != null) + { + attributes.Add(new XAttribute("machineDetection", this.MachineDetection)); + } + if (this.AmdStatusCallbackMethod != null) + { + attributes.Add(new XAttribute("amdStatusCallbackMethod", this.AmdStatusCallbackMethod.ToString())); + } + if (this.AmdStatusCallback != null) + { + attributes.Add(new XAttribute("amdStatusCallback", this.AmdStatusCallback)); + } + if (this.MachineDetectionTimeout != null) + { + attributes.Add(new XAttribute("machineDetectionTimeout", this.MachineDetectionTimeout.ToString())); + } + if (this.MachineDetectionSpeechThreshold != null) + { + attributes.Add(new XAttribute("machineDetectionSpeechThreshold", this.MachineDetectionSpeechThreshold.ToString())); + } + if (this.MachineDetectionSpeechEndThreshold != null) + { + attributes.Add(new XAttribute("machineDetectionSpeechEndThreshold", this.MachineDetectionSpeechEndThreshold.ToString())); + } + if (this.MachineDetectionSilenceTimeout != null) + { + attributes.Add(new XAttribute("machineDetectionSilenceTimeout", this.MachineDetectionSilenceTimeout.ToString())); + } return attributes; } diff --git a/src/Twilio/TwiML/Voice/Sip.cs b/src/Twilio/TwiML/Voice/Sip.cs index a726a1cb0..b75e839f3 100644 --- a/src/Twilio/TwiML/Voice/Sip.cs +++ b/src/Twilio/TwiML/Voice/Sip.cs @@ -67,6 +67,34 @@ public static implicit operator EventEnum(string value) /// Status callback URL method /// public Twilio.Http.HttpMethod StatusCallbackMethod { get; set; } + /// + /// Enable machine detection or end of greeting detection + /// + public string MachineDetection { get; set; } + /// + /// HTTP Method to use with amd_status_callback + /// + public Twilio.Http.HttpMethod AmdStatusCallbackMethod { get; set; } + /// + /// The URL we should call to send amd status information to your application + /// + public string AmdStatusCallback { get; set; } + /// + /// Number of seconds to wait for machine detection + /// + public int? MachineDetectionTimeout { get; set; } + /// + /// Number of milliseconds for measuring stick for the length of the speech activity + /// + public int? MachineDetectionSpeechThreshold { get; set; } + /// + /// Number of milliseconds of silence after speech activity + /// + public int? MachineDetectionSpeechEndThreshold { get; set; } + /// + /// Number of milliseconds of initial silence + /// + public int? MachineDetectionSilenceTimeout { get; set; } /// /// Create a new Sip @@ -79,6 +107,14 @@ public static implicit operator EventEnum(string value) /// Status callback events /// Status callback URL /// Status callback URL method + /// Enable machine detection or end of greeting detection + /// HTTP Method to use with amd_status_callback + /// The URL we should call to send amd status information to your application + /// Number of seconds to wait for machine detection + /// Number of milliseconds for measuring stick for the length of the + /// speech activity + /// Number of milliseconds of silence after speech activity + /// Number of milliseconds of initial silence public Sip(Uri sipUrl = null, string username = null, string password = null, @@ -86,7 +122,14 @@ public Sip(Uri sipUrl = null, Twilio.Http.HttpMethod method = null, List statusCallbackEvent = null, Uri statusCallback = null, - Twilio.Http.HttpMethod statusCallbackMethod = null) : base("Sip") + Twilio.Http.HttpMethod statusCallbackMethod = null, + string machineDetection = null, + Twilio.Http.HttpMethod amdStatusCallbackMethod = null, + string amdStatusCallback = null, + int? machineDetectionTimeout = null, + int? machineDetectionSpeechThreshold = null, + int? machineDetectionSpeechEndThreshold = null, + int? machineDetectionSilenceTimeout = null) : base("Sip") { this.SipUrl = sipUrl; this.Username = username; @@ -96,6 +139,13 @@ public Sip(Uri sipUrl = null, this.StatusCallbackEvent = statusCallbackEvent; this.StatusCallback = statusCallback; this.StatusCallbackMethod = statusCallbackMethod; + this.MachineDetection = machineDetection; + this.AmdStatusCallbackMethod = amdStatusCallbackMethod; + this.AmdStatusCallback = amdStatusCallback; + this.MachineDetectionTimeout = machineDetectionTimeout; + this.MachineDetectionSpeechThreshold = machineDetectionSpeechThreshold; + this.MachineDetectionSpeechEndThreshold = machineDetectionSpeechEndThreshold; + this.MachineDetectionSilenceTimeout = machineDetectionSilenceTimeout; } /// @@ -140,6 +190,34 @@ protected override List GetElementAttributes() { attributes.Add(new XAttribute("statusCallbackMethod", this.StatusCallbackMethod.ToString())); } + if (this.MachineDetection != null) + { + attributes.Add(new XAttribute("machineDetection", this.MachineDetection)); + } + if (this.AmdStatusCallbackMethod != null) + { + attributes.Add(new XAttribute("amdStatusCallbackMethod", this.AmdStatusCallbackMethod.ToString())); + } + if (this.AmdStatusCallback != null) + { + attributes.Add(new XAttribute("amdStatusCallback", this.AmdStatusCallback)); + } + if (this.MachineDetectionTimeout != null) + { + attributes.Add(new XAttribute("machineDetectionTimeout", this.MachineDetectionTimeout.ToString())); + } + if (this.MachineDetectionSpeechThreshold != null) + { + attributes.Add(new XAttribute("machineDetectionSpeechThreshold", this.MachineDetectionSpeechThreshold.ToString())); + } + if (this.MachineDetectionSpeechEndThreshold != null) + { + attributes.Add(new XAttribute("machineDetectionSpeechEndThreshold", this.MachineDetectionSpeechEndThreshold.ToString())); + } + if (this.MachineDetectionSilenceTimeout != null) + { + attributes.Add(new XAttribute("machineDetectionSilenceTimeout", this.MachineDetectionSilenceTimeout.ToString())); + } return attributes; } diff --git a/test/Twilio.Test/TwiML/DialTest.cs b/test/Twilio.Test/TwiML/DialTest.cs index 473521258..4ec6b0e76 100644 --- a/test/Twilio.Test/TwiML/DialTest.cs +++ b/test/Twilio.Test/TwiML/DialTest.cs @@ -134,7 +134,14 @@ public void TestElementWithChildren() Promoter.ListOfOne(Number.EventEnum.Initiated), new Uri("https://example.com"), Twilio.Http.HttpMethod.Get, - "BYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" + "BYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "machine_detection", + Twilio.Http.HttpMethod.Get, + "amd_status_callback", + 1, + 1, + 1, + 1 ); elem.Queue( @@ -155,7 +162,14 @@ public void TestElementWithChildren() Twilio.Http.HttpMethod.Get, Promoter.ListOfOne(Sip.EventEnum.Initiated), new Uri("https://example.com"), - Twilio.Http.HttpMethod.Get + Twilio.Http.HttpMethod.Get, + "machine_detection", + Twilio.Http.HttpMethod.Get, + "amd_status_callback", + 1, + 1, + 1, + 1 ); Assert.AreEqual( @@ -163,10 +177,10 @@ public void TestElementWithChildren() "" + Environment.NewLine + " identity" + Environment.NewLine + " name" + Environment.NewLine + - " +15017122661" + Environment.NewLine + + " +15017122661" + Environment.NewLine + " name" + Environment.NewLine + " DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" + Environment.NewLine + - " https://example.com" + Environment.NewLine + + " https://example.com" + Environment.NewLine + "", elem.ToString() ); diff --git a/test/Twilio.Test/TwiML/NumberTest.cs b/test/Twilio.Test/TwiML/NumberTest.cs index 79f172163..dc5fcbced 100644 --- a/test/Twilio.Test/TwiML/NumberTest.cs +++ b/test/Twilio.Test/TwiML/NumberTest.cs @@ -37,11 +37,18 @@ public void TestElementWithParams() Promoter.ListOfOne(Number.EventEnum.Initiated), new Uri("https://example.com"), Twilio.Http.HttpMethod.Get, - "BYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" + "BYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", + "machine_detection", + Twilio.Http.HttpMethod.Get, + "amd_status_callback", + 1, + 1, + 1, + 1 ); Assert.AreEqual( "" + Environment.NewLine + - "+15017122661", + "+15017122661", elem.ToString() ); } diff --git a/test/Twilio.Test/TwiML/SipTest.cs b/test/Twilio.Test/TwiML/SipTest.cs index 9cca2f709..cb81191d6 100644 --- a/test/Twilio.Test/TwiML/SipTest.cs +++ b/test/Twilio.Test/TwiML/SipTest.cs @@ -37,11 +37,18 @@ public void TestElementWithParams() Twilio.Http.HttpMethod.Get, Promoter.ListOfOne(Sip.EventEnum.Initiated), new Uri("https://example.com"), - Twilio.Http.HttpMethod.Get + Twilio.Http.HttpMethod.Get, + "machine_detection", + Twilio.Http.HttpMethod.Get, + "amd_status_callback", + 1, + 1, + 1, + 1 ); Assert.AreEqual( "" + Environment.NewLine + - "https://example.com", + "https://example.com", elem.ToString() ); }