|
| 1 | +using System; |
| 2 | +using System.Xml; |
| 3 | +using System.Xml.Schema; |
| 4 | +using System.Xml.Serialization; |
| 5 | + |
| 6 | +namespace Bandwidth.Standard.Voice.Bxml |
| 7 | +{ |
| 8 | + /// <summary> |
| 9 | + /// The StartStream verb allows a segment of a call to be sent off to another destination for additional processing. |
| 10 | + /// <para><seealso href="https://dev.bandwidth.com/voice/bxml/startStream" /></para> |
| 11 | + /// </summary> |
| 12 | + public class StartStream : IXmlSerializable, IVerb, IAudioProducer |
| 13 | + { |
| 14 | + /// <summary> |
| 15 | + /// A websocket URI to send the stream to |
| 16 | + /// </summary> |
| 17 | + public string Destination { get; set; } |
| 18 | + |
| 19 | + /// <summary> |
| 20 | + /// A name to refer to this stream by |
| 21 | + /// </summary> |
| 22 | + public string Name { get; set; } |
| 23 | + |
| 24 | + /// <summary> |
| 25 | + /// The part of the call to send a stream from. `inbound`, `outbound` or `both`. |
| 26 | + /// </summary> |
| 27 | + public string Tracks { get; set; } |
| 28 | + |
| 29 | + /// <summary> |
| 30 | + /// URL to send the associated Webhook events to during this stream's lifetime |
| 31 | + /// </summary> |
| 32 | + public string StreamEventUrl { get; set; } |
| 33 | + |
| 34 | + /// <summary> |
| 35 | + /// The HTTP method to use for the request to `streamEventUrl` |
| 36 | + /// </summary> |
| 37 | + public string StreamEventMethod { get; set; } |
| 38 | + |
| 39 | + /// <summary> |
| 40 | + /// The username to send in the HTTP request to `streamEventUrl` |
| 41 | + /// </summary> |
| 42 | + public string Username { get; set; } |
| 43 | + |
| 44 | + /// <summary> |
| 45 | + /// The password to send in the HTTP request to `streamEventUrl` |
| 46 | + /// </summary> |
| 47 | + public string Password { get; set; } |
| 48 | + |
| 49 | + XmlSchema IXmlSerializable.GetSchema() |
| 50 | + { |
| 51 | + return null; |
| 52 | + } |
| 53 | + |
| 54 | + void IXmlSerializable.ReadXml(XmlReader reader) |
| 55 | + { |
| 56 | + throw new NotImplementedException(); |
| 57 | + } |
| 58 | + |
| 59 | + void IXmlSerializable.WriteXml(XmlWriter writer) |
| 60 | + { |
| 61 | + writer.WriteAttributeString("destination", Destination); |
| 62 | + if (!string.IsNullOrEmpty(Name)) |
| 63 | + { |
| 64 | + writer.WriteAttributeString("name", Name); |
| 65 | + } |
| 66 | + if (!string.IsNullOrEmpty(Tracks)) |
| 67 | + { |
| 68 | + writer.WriteAttributeString("tracks", Tracks); |
| 69 | + } |
| 70 | + if (!string.IsNullOrEmpty(StreamEventUrl)) |
| 71 | + { |
| 72 | + writer.WriteAttributeString("streamEventUrl", StreamEventUrl); |
| 73 | + } |
| 74 | + if (!string.IsNullOrEmpty(StreamEventMethod)) |
| 75 | + { |
| 76 | + writer.WriteAttributeString("streamEventMethod", StreamEventMethod); |
| 77 | + } |
| 78 | + if (!string.IsNullOrEmpty(Username)) |
| 79 | + { |
| 80 | + writer.WriteAttributeString("username", Username); |
| 81 | + } |
| 82 | + if (!string.IsNullOrEmpty(Password)) |
| 83 | + { |
| 84 | + writer.WriteAttributeString("password", Password); |
| 85 | + } |
| 86 | + } |
| 87 | + } |
| 88 | +} |
0 commit comments