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

fix: Rename child twiml methods to be the tag name and deprecate old methods #504

Merged
merged 2 commits into from
Nov 20, 2019
Merged
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
22 changes: 11 additions & 11 deletions src/Twilio/TwiML/FaxResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,6 @@ public FaxResponse() : base("Response")
{
}

/// <summary>
/// Append a <Receive/> 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)
eshanholtz marked this conversation as resolved.
Show resolved Hide resolved
{
this.Append(receive);
return this;
}

/// <summary>
/// Create a new <Receive/> element and append it as a child of this element.
/// </summary>
Expand All @@ -48,6 +37,17 @@ public FaxResponse Receive(Uri action = null, Twilio.Http.HttpMethod method = nu
return this;
}

/// <summary>
/// Append a <Receive/> 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>
Expand Down
30 changes: 15 additions & 15 deletions src/Twilio/TwiML/Messaging/Message.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,6 @@ protected override List<XAttribute> GetElementAttributes()
return attributes;
}

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

/// <summary>
/// Create a new <Body/> element and append it as a child of this element.
/// </summary>
Expand All @@ -127,13 +116,13 @@ public Message Body(string message = null)
}

/// <summary>
/// Append a <Media/> element as a child of this element
/// Append a <Body/> element as a child of this element
/// </summary>
/// <param name="media"> A Media instance. </param>
/// <param name="body"> A Body instance. </param>
[System.Obsolete("This method is deprecated, use .Append() instead.")]
public Message Media(Media media)
public Message Body(Body body)
{
this.Append(media);
this.Append(body);
return this;
}

Expand All @@ -148,6 +137,17 @@ public Message Media(Uri url = null)
return this;
}

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

/// <summary>
/// Append a child TwiML element to this element returning this element to allow chaining.
/// </summary>
Expand Down
30 changes: 15 additions & 15 deletions src/Twilio/TwiML/MessagingResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,6 @@ public MessagingResponse() : base("Response")
{
}

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

/// <summary>
/// Create a new <Message/> element and append it as a child of this element.
/// </summary>
Expand All @@ -58,13 +47,13 @@ public MessagingResponse Message(string body = null,
}

/// <summary>
/// Append a <Redirect/> element as a child of this element
/// Append a <Message/> element as a child of this element
/// </summary>
/// <param name="redirect"> A Redirect instance. </param>
/// <param name="message"> A Message instance. </param>
[System.Obsolete("This method is deprecated, use .Append() instead.")]
public MessagingResponse Redirect(Redirect redirect)
public MessagingResponse Message(Message message)
{
this.Append(redirect);
this.Append(message);
return this;
}

Expand All @@ -80,6 +69,17 @@ public MessagingResponse Redirect(Uri url = null, Twilio.Http.HttpMethod method
return this;
}

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

/// <summary>
/// Append a child TwiML element to this element returning this element to allow chaining.
/// </summary>
Expand Down
30 changes: 15 additions & 15 deletions src/Twilio/TwiML/Voice/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,6 @@ protected override List<XAttribute> GetElementAttributes()
return attributes;
}

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

/// <summary>
/// Create a new <Identity/> element and append it as a child of this element.
/// </summary>
Expand All @@ -144,13 +133,13 @@ public Client Identity(string clientIdentity = null)
}

/// <summary>
/// Append a <Parameter/> element as a child of this element
/// Append a <Identity/> element as a child of this element
/// </summary>
/// <param name="parameter"> A Parameter instance. </param>
/// <param name="identity"> A Identity instance. </param>
[System.Obsolete("This method is deprecated, use .Append() instead.")]
public Client Parameter(Parameter parameter)
public Client Identity(Identity identity)
{
this.Append(parameter);
this.Append(identity);
return this;
}

Expand All @@ -166,6 +155,17 @@ public Client Parameter(string name = null, string value = null)
return this;
}

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

/// <summary>
/// Append a child TwiML element to this element returning this element to allow chaining.
/// </summary>
Expand Down
38 changes: 19 additions & 19 deletions src/Twilio/TwiML/Voice/Connect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,6 @@ protected override List<XAttribute> GetElementAttributes()
return attributes;
}

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

/// <summary>
/// Create a new <Room/> element and append it as a child of this element.
/// </summary>
Expand All @@ -79,13 +68,13 @@ public Connect Room(string name = null, string participantIdentity = null)
}

/// <summary>
/// Append a <Autopilot/> element as a child of this element
/// Append a <Room/> element as a child of this element
/// </summary>
/// <param name="autopilot"> A Autopilot instance. </param>
/// <param name="room"> A Room instance. </param>
[System.Obsolete("This method is deprecated, use .Append() instead.")]
public Connect Autopilot(Autopilot autopilot)
public Connect Room(Room room)
{
this.Append(autopilot);
this.Append(room);
return this;
}

Expand All @@ -101,13 +90,13 @@ public Connect Autopilot(string name = null)
}

/// <summary>
/// Append a <Stream/> element as a child of this element
/// Append a <Autopilot/> element as a child of this element
/// </summary>
/// <param name="stream"> A Stream instance. </param>
/// <param name="autopilot"> A Autopilot instance. </param>
[System.Obsolete("This method is deprecated, use .Append() instead.")]
public Connect Stream(Stream stream)
public Connect Autopilot(Autopilot autopilot)
{
this.Append(stream);
this.Append(autopilot);
return this;
}

Expand All @@ -128,6 +117,17 @@ public Connect Stream(string name = null,
return this;
}

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

/// <summary>
/// Append a child TwiML element to this element returning this element to allow chaining.
/// </summary>
Expand Down
62 changes: 31 additions & 31 deletions src/Twilio/TwiML/Voice/Dial.cs
Original file line number Diff line number Diff line change
Expand Up @@ -290,17 +290,6 @@ protected override List<XAttribute> GetElementAttributes()
return attributes;
}

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

/// <summary>
/// Create a new <Client/> element and append it as a child of this element.
/// </summary>
Expand Down Expand Up @@ -330,13 +319,13 @@ public Dial Client(string identity = null,
}

/// <summary>
/// Append a <Conference/> element as a child of this element
/// Append a <Client/> element as a child of this element
/// </summary>
/// <param name="conference"> A Conference instance. </param>
/// <param name="client"> A Client instance. </param>
[System.Obsolete("This method is deprecated, use .Append() instead.")]
public Dial Conference(Conference conference)
public Dial Client(Client client)
{
this.Append(conference);
this.Append(client);
return this;
}

Expand Down Expand Up @@ -408,13 +397,13 @@ public Dial Conference(string name = null,
}

/// <summary>
/// Append a <Number/> element as a child of this element
/// Append a <Conference/> element as a child of this element
/// </summary>
/// <param name="number"> A Number instance. </param>
/// <param name="conference"> A Conference instance. </param>
[System.Obsolete("This method is deprecated, use .Append() instead.")]
public Dial Number(Number number)
public Dial Conference(Conference conference)
{
this.Append(number);
this.Append(conference);
return this;
}

Expand Down Expand Up @@ -450,13 +439,13 @@ public Dial Number(Types.PhoneNumber phoneNumber = null,
}

/// <summary>
/// Append a <Queue/> element as a child of this element
/// Append a <Number/> element as a child of this element
/// </summary>
/// <param name="queue"> A Queue instance. </param>
/// <param name="number"> A Number instance. </param>
[System.Obsolete("This method is deprecated, use .Append() instead.")]
public Dial Queue(Queue queue)
public Dial Number(Number number)
{
this.Append(queue);
this.Append(number);
return this;
}

Expand All @@ -480,13 +469,13 @@ public Dial Queue(string name = null,
}

/// <summary>
/// Append a <Sim/> element as a child of this element
/// Append a <Queue/> element as a child of this element
/// </summary>
/// <param name="sim"> A Sim instance. </param>
/// <param name="queue"> A Queue instance. </param>
[System.Obsolete("This method is deprecated, use .Append() instead.")]
public Dial Sim(Sim sim)
public Dial Queue(Queue queue)
{
this.Append(sim);
this.Append(queue);
return this;
}

Expand All @@ -502,13 +491,13 @@ public Dial Sim(string simSid = null)
}

/// <summary>
/// Append a <Sip/> element as a child of this element
/// Append a <Sim/> element as a child of this element
/// </summary>
/// <param name="sip"> A Sip instance. </param>
/// <param name="sim"> A Sim instance. </param>
[System.Obsolete("This method is deprecated, use .Append() instead.")]
public Dial Sip(Sip sip)
public Dial Sim(Sim sim)
{
this.Append(sip);
this.Append(sim);
return this;
}

Expand Down Expand Up @@ -546,6 +535,17 @@ public Dial Sip(Uri sipUrl = null,
return this;
}

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

/// <summary>
/// Append a child TwiML element to this element returning this element to allow chaining.
/// </summary>
Expand Down
Loading