Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc: Improve TwiML XML Docs #681

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 26 additions & 42 deletions src/Twilio/TwiML/Fax/Receive.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// This code was generated by
/// \ / _ _ _| _ _
/// | (_)\/(_)(_|\/| |(/_ v1.0.0
/// / /
// This code was generated by
// \ / _ _ _| _ _
// | (_)\/(_)(_|\/| |(/_ v1.0.0
// / /

using System;
using System.Collections.Generic;
Expand All @@ -14,9 +14,7 @@
namespace Twilio.TwiML.Fax
{

/// <summary>
/// Receive TwiML Verb
/// </summary>
/// <summary>Receive TwiML Verb</summary>
public class Receive : TwiML
{
public sealed class MediaTypeEnum : StringEnum
Expand Down Expand Up @@ -46,35 +44,27 @@ public static implicit operator PageSizeEnum(string value)
public static readonly PageSizeEnum A4 = new PageSizeEnum("a4");
}

/// <summary>
/// Receive action URL
/// </summary>
/// <summary>Receive action URL</summary>
public Uri Action { get; set; }
/// <summary>
/// Receive action URL method
/// </summary>

/// <summary>Receive action URL method</summary>
public Twilio.Http.HttpMethod Method { get; set; }
/// <summary>
/// The media type used to store media in the fax media store
/// </summary>

/// <summary>The media type used to store media in the fax media store</summary>
public Receive.MediaTypeEnum MediaType { get; set; }
/// <summary>
/// What size to interpret received pages as
/// </summary>

/// <summary>What size to interpret received pages as</summary>
public Receive.PageSizeEnum PageSize { get; set; }
/// <summary>
/// Whether or not to store received media in the fax media store
/// </summary>

/// <summary>Whether or not to store received media in the fax media store</summary>
public bool? StoreMedia { get; set; }

/// <summary>
/// Create a new Receive
/// </summary>
/// <param name="action"> Receive action URL </param>
/// <param name="method"> Receive action URL method </param>
/// <param name="mediaType"> The media type used to store media in the fax media store </param>
/// <param name="pageSize"> What size to interpret received pages as </param>
/// <param name="storeMedia"> Whether or not to store received media in the fax media store </param>
/// <summary>Create a new Receive</summary>
/// <param name="action">Receive action URL</param>
/// <param name="method">Receive action URL method</param>
/// <param name="mediaType">The media type used to store media in the fax media store</param>
/// <param name="pageSize">What size to interpret received pages as</param>
/// <param name="storeMedia">Whether or not to store received media in the fax media store</param>
public Receive(Uri action = null,
Twilio.Http.HttpMethod method = null,
Receive.MediaTypeEnum mediaType = null,
Expand All @@ -88,9 +78,7 @@ public Receive(Uri action = null,
this.StoreMedia = storeMedia;
}

/// <summary>
/// Return the attributes of the TwiML tag
/// </summary>
/// <summary>Return the attributes of the TwiML tag</summary>
protected override List<XAttribute> GetElementAttributes()
{
var attributes = new List<XAttribute>();
Expand All @@ -117,20 +105,16 @@ protected override List<XAttribute> GetElementAttributes()
return attributes;
}

/// <summary>
/// Append a child TwiML element to this element returning this element to allow chaining.
/// </summary>
/// <param name="childElem"> Child TwiML element to add </param>
/// <summary>Append a child TwiML element to this element returning this element to allow chaining.</summary>
/// <param name="childElem">Child TwiML element to add</param>
public new Receive Append(TwiML childElem)
{
return (Receive) base.Append(childElem);
}

/// <summary>
/// Add freeform key-value attributes to the generated xml
/// </summary>
/// <param name="key"> Option key </param>
/// <param name="value"> Option value </param>
/// <summary>Add freeform key-value attributes to the generated xml</summary>
/// <param name="key">Option key</param>
/// <param name="value">Option value</param>
public new Receive SetOption(string key, object value)
{
return (Receive) base.SetOption(key, value);
Expand Down
50 changes: 19 additions & 31 deletions src/Twilio/TwiML/FaxResponse.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// This code was generated by
/// \ / _ _ _| _ _
/// | (_)\/(_)(_|\/| |(/_ v1.0.0
/// / /
// This code was generated by
// \ / _ _ _| _ _
// | (_)\/(_)(_|\/| |(/_ v1.0.0
// / /

using System;
using System.IO;
Expand All @@ -13,26 +13,20 @@
namespace Twilio.TwiML
{

/// <summary>
/// Response TwiML for Faxes
/// </summary>
/// <summary>Response TwiML for Faxes</summary>
public class FaxResponse : TwiML
{
/// <summary>
/// Create a new FaxResponse
/// </summary>
/// <summary>Create a new FaxResponse</summary>
public FaxResponse() : base("Response")
{
}

/// <summary>
/// Create a new <Receive/> element and append it as a child of this element.
/// </summary>
/// <param name="action"> Receive action URL </param>
/// <param name="method"> Receive action URL method </param>
/// <param name="mediaType"> The media type used to store media in the fax media store </param>
/// <param name="pageSize"> What size to interpret received pages as </param>
/// <param name="storeMedia"> Whether or not to store received media in the fax media store </param>
/// <summary>Create a new &lt;Receive/&gt; element and append it as a child of this element.</summary>
/// <param name="action">Receive action URL</param>
/// <param name="method">Receive action URL method</param>
/// <param name="mediaType">The media type used to store media in the fax media store</param>
/// <param name="pageSize">What size to interpret received pages as</param>
/// <param name="storeMedia">Whether or not to store received media in the fax media store</param>
public FaxResponse Receive(Uri action = null,
Twilio.Http.HttpMethod method = null,
Receive.MediaTypeEnum mediaType = null,
Expand All @@ -44,31 +38,25 @@ public FaxResponse Receive(Uri action = null,
return this;
}

/// <summary>
/// Append a <Receive/> element as a child of this element
/// </summary>
/// <param name="receive"> A Receive instance. </param>
/// <summary>Append a &lt;Receive/&gt; element as a child of this element</summary>
/// <param name="receive">A Receive instance.</param>
[System.Obsolete("This method is deprecated, use .Append() instead.")]
public FaxResponse Receive(Receive receive)
{
this.Append(receive);
return this;
}

/// <summary>
/// Append a child TwiML element to this element returning this element to allow chaining.
/// </summary>
/// <param name="childElem"> Child TwiML element to add </param>
/// <summary>Append a child TwiML element to this element returning this element to allow chaining.</summary>
/// <param name="childElem">Child TwiML element to add</param>
public new FaxResponse Append(TwiML childElem)
{
return (FaxResponse) base.Append(childElem);
}

/// <summary>
/// Add freeform key-value attributes to the generated xml
/// </summary>
/// <param name="key"> Option key </param>
/// <param name="value"> Option value </param>
/// <summary>Add freeform key-value attributes to the generated xml</summary>
/// <param name="key">Option key</param>
/// <param name="value">Option value</param>
public new FaxResponse SetOption(string key, object value)
{
return (FaxResponse) base.SetOption(key, value);
Expand Down
40 changes: 14 additions & 26 deletions src/Twilio/TwiML/Messaging/Body.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// This code was generated by
/// \ / _ _ _| _ _
/// | (_)\/(_)(_|\/| |(/_ v1.0.0
/// / /
// This code was generated by
// \ / _ _ _| _ _
// | (_)\/(_)(_|\/| |(/_ v1.0.0
// / /

using System.IO;
using System.Text;
Expand All @@ -10,47 +10,35 @@
namespace Twilio.TwiML.Messaging
{

/// <summary>
/// Body TwiML Noun
/// </summary>
/// <summary>Body TwiML Noun</summary>
public class Body : TwiML
{
/// <summary>
/// Message Body
/// </summary>
/// <summary>Message Body</summary>
public string Message { get; set; }

/// <summary>
/// Create a new Body
/// </summary>
/// <param name="message"> Message Body, the body of the TwiML Element. </param>
/// <summary>Create a new Body</summary>
/// <param name="message">Message Body, the body of the TwiML Element.</param>
public Body(string message = null) : base("Body")
{
this.Message = message;
}

/// <summary>
/// Return the body of the TwiML tag
/// </summary>
/// <summary>Return the body of the TwiML tag</summary>
protected override string GetElementBody()
{
return this.Message != null ? this.Message : string.Empty;
}

/// <summary>
/// Append a child TwiML element to this element returning this element to allow chaining.
/// </summary>
/// <param name="childElem"> Child TwiML element to add </param>
/// <summary>Append a child TwiML element to this element returning this element to allow chaining.</summary>
/// <param name="childElem">Child TwiML element to add</param>
public new Body Append(TwiML childElem)
{
return (Body) base.Append(childElem);
}

/// <summary>
/// Add freeform key-value attributes to the generated xml
/// </summary>
/// <param name="key"> Option key </param>
/// <param name="value"> Option value </param>
/// <summary>Add freeform key-value attributes to the generated xml</summary>
/// <param name="key">Option key</param>
/// <param name="value">Option value</param>
public new Body SetOption(string key, object value)
{
return (Body) base.SetOption(key, value);
Expand Down
40 changes: 14 additions & 26 deletions src/Twilio/TwiML/Messaging/Media.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// This code was generated by
/// \ / _ _ _| _ _
/// | (_)\/(_)(_|\/| |(/_ v1.0.0
/// / /
// This code was generated by
// \ / _ _ _| _ _
// | (_)\/(_)(_|\/| |(/_ v1.0.0
// / /

using System;
using System.IO;
Expand All @@ -12,47 +12,35 @@
namespace Twilio.TwiML.Messaging
{

/// <summary>
/// Media TwiML Noun
/// </summary>
/// <summary>Media TwiML Noun</summary>
public class Media : TwiML
{
/// <summary>
/// Media URL
/// </summary>
/// <summary>Media URL</summary>
public Uri Url { get; set; }

/// <summary>
/// Create a new Media
/// </summary>
/// <param name="url"> Media URL, the body of the TwiML Element. </param>
/// <summary>Create a new Media</summary>
/// <param name="url">Media URL, the body of the TwiML Element.</param>
public Media(Uri url = null) : base("Media")
{
this.Url = url;
}

/// <summary>
/// Return the body of the TwiML tag
/// </summary>
/// <summary>Return the body of the TwiML tag</summary>
protected override string GetElementBody()
{
return this.Url != null ? Serializers.Url(this.Url) : string.Empty;
}

/// <summary>
/// Append a child TwiML element to this element returning this element to allow chaining.
/// </summary>
/// <param name="childElem"> Child TwiML element to add </param>
/// <summary>Append a child TwiML element to this element returning this element to allow chaining.</summary>
/// <param name="childElem">Child TwiML element to add</param>
public new Media Append(TwiML childElem)
{
return (Media) base.Append(childElem);
}

/// <summary>
/// Add freeform key-value attributes to the generated xml
/// </summary>
/// <param name="key"> Option key </param>
/// <param name="value"> Option value </param>
/// <summary>Add freeform key-value attributes to the generated xml</summary>
/// <param name="key">Option key</param>
/// <param name="value">Option value</param>
public new Media SetOption(string key, object value)
{
return (Media) base.SetOption(key, value);
Expand Down
Loading