Logo Search packages:      
Sourcecode: tasque version File versions  Download package

Response.cs

using System;
using System.Xml;
using System.Xml.Serialization;
using System.Xml.Schema;

namespace RtmNet
{
      /// <summary>
      /// The root object returned byRtm. Used with Xml Serialization to get the relevant object.
      /// It is internal to the RtmNet API Library and should not be used elsewhere.
      /// </summary>
      [XmlRoot("rsp", Namespace="", IsNullable=false)]
      [Serializable]
00014       public class Response 
      {

            /// <remarks/>
            [XmlElement("contacts", Form=XmlSchemaForm.Unqualified)]
00019             public Contacts Contacts;

            /// <remarks/>
            [XmlElement("lists", Form=XmlSchemaForm.Unqualified)]
00023             public Lists Lists;

            /// <remarks/>
            [XmlElement("tasks", Form=XmlSchemaForm.Unqualified)]
00027             public Tasks Tasks;

            /// <remarks/>
            [XmlAttribute("stat", Form=XmlSchemaForm.Unqualified)]
00031             public ResponseStatus Status;
            
            /// <remarks/>
            [XmlElement("list", Form=XmlSchemaForm.Unqualified)]
00035             public List List;
            
            /// <remarks/>
            [XmlElement("timeline", Form=XmlSchemaForm.Unqualified)]
00039             public string Timeline;

            /// <remarks/>
            [XmlElement("note", Form=XmlSchemaForm.Unqualified)]
00043             public Note Note;
            
            /// <summary>
            /// If an error occurs the Error property is populated with 
            /// a <see cref="ResponseError"/> instance.
            /// </summary>
            [XmlElement("err", Form=XmlSchemaForm.Unqualified)]
00050             public ResponseError Error;

            /// <summary>
            /// A <see cref="Method"/> instance.
            /// </summary>
            [XmlElement("method", Form=XmlSchemaForm.Unqualified)]
00056             public Method Method;

            /// <summary>
            /// If using Rtm.test.echo this contains all the other elements not covered above.
            /// </summary>
            /// <remarks>
            /// t is an array of <see cref="XmlElement"/> objects. Use the XmlElement Name and InnerXml properties
            /// to get the name and value of the returned property.
            /// </remarks>
            [XmlAnyElement(), NonSerialized()]
00066             public XmlElement[] AllElements;
      }

      /// <summary>
      /// If an error occurs then Rtm returns this object.
      /// </summary>
      [System.Serializable]
00073       public class ResponseError
      {
            /// <summary>
            /// The code or number of the error.
            /// </summary>
            /// <remarks>
            /// 100 - Invalid Api Key.
            /// 99  - User not logged in.
            /// Other codes are specific to a method.
            /// </remarks>
            [XmlAttribute("code", Form=XmlSchemaForm.Unqualified)]
00084             public int Code;

            /// <summary>
            /// The verbose message matching the error code.
            /// </summary>
            [XmlAttribute("msg", Form=XmlSchemaForm.Unqualified)]
00090             public string Message;
      }

      /// <summary>
      /// The status of the response, either ok or fail.
      /// </summary>
      public enum ResponseStatus
      {
            /// <summary>
            /// An unknown status, and the default value if not set.
            /// </summary>
            [XmlEnum("unknown")]
            Unknown,

            /// <summary>
            /// The response returns "ok" on a successful execution of the method.
            /// </summary>
            [XmlEnum("ok")]
            OK,
            /// <summary>
            /// The response returns "fail" if there is an error, such as invalid API key or login failure.
            /// </summary>
            [XmlEnum("fail")]
            Failed
      }
}

Generated by  Doxygen 1.6.0   Back to index