Skip to content

Commit

Permalink
Merge pull request #109 from twilio-labs/formatting-for-minimal-api-t…
Browse files Browse the repository at this point in the history
…wiml-result

Add missing `formattingOptions` parameter to `ToTwiMLResult` extension method
  • Loading branch information
Swimburger authored Nov 17, 2022
2 parents 88f523c + 1b8bdaa commit e9b7a63
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/Twilio.AspNet.Core/TwiMLExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Twilio.TwiML;
using System.Xml.Linq;
using Twilio.TwiML;

namespace Twilio.AspNet.Core
{
Expand All @@ -11,6 +12,15 @@ public static class TwiMLExtensions
/// <returns></returns>
public static TwiMLResult ToTwiMLResult(this VoiceResponse voiceResponse)
=> new TwiMLResult(voiceResponse);

/// <summary>
/// Returns a properly formatted TwiML response
/// </summary>
/// <param name="voiceResponse"></param>
/// <param name="formattingOptions">Specifies how to format TwiML</param>
/// <returns></returns>
public static TwiMLResult ToTwiMLResult(this VoiceResponse voiceResponse, SaveOptions formattingOptions)
=> new TwiMLResult(voiceResponse, formattingOptions);

/// <summary>
/// Returns a properly formatted TwiML response
Expand All @@ -19,5 +29,14 @@ public static TwiMLResult ToTwiMLResult(this VoiceResponse voiceResponse)
/// <returns></returns>
public static TwiMLResult ToTwiMLResult(this MessagingResponse messagingResponse)
=> new TwiMLResult(messagingResponse);

/// <summary>
/// Returns a properly formatted TwiML response
/// </summary>
/// <param name="messagingResponse"></param>
/// <param name="formattingOptions">Specifies how to format TwiML</param>
/// <returns></returns>
public static TwiMLResult ToTwiMLResult(this MessagingResponse messagingResponse, SaveOptions formattingOptions)
=> new TwiMLResult(messagingResponse, formattingOptions);
}
}

0 comments on commit e9b7a63

Please sign in to comment.