using System; using System.Xml; using System.Xml.Serialization; using System.Xml.Schema; namespace FlickrNet { /// /// The root object returned by Flickr. Used with Xml Serialization to get the relevant object. /// It is internal to the FlickrNet API Library and should not be used elsewhere. /// [XmlRoot("rsp", Namespace="", IsNullable=false)] [Serializable] public class Response { /// [XmlElement("blogs", Form=XmlSchemaForm.Unqualified)] public Blogs Blogs; /// [XmlElement("contacts", Form=XmlSchemaForm.Unqualified)] public Contacts Contacts; /// [XmlElement("photos", Form=XmlSchemaForm.Unqualified)] public Photos Photos; /// [XmlElement("category", Form=XmlSchemaForm.Unqualified)] public Category Category; /// [XmlElement("photocounts", Form=XmlSchemaForm.Unqualified)] public PhotoCounts PhotoCounts; /// [XmlElement("photo", Form=XmlSchemaForm.Unqualified)] public PhotoInfo PhotoInfo; /// [XmlElement("person", Form=XmlSchemaForm.Unqualified)] public Person Person; /// [XmlElement("photoset", Form=XmlSchemaForm.Unqualified)] public Photoset Photoset; /// [XmlElement("photosets", Form=XmlSchemaForm.Unqualified)] public Photosets Photosets; /// [XmlElement("sizes", Form=XmlSchemaForm.Unqualified)] public Sizes Sizes; /// [XmlElement("licenses", Form=XmlSchemaForm.Unqualified)] public Licenses Licenses; /// [XmlElement("count", Form=XmlSchemaForm.Unqualified)] public ContextCount ContextCount; /// [XmlElement("nextphoto", Form=XmlSchemaForm.Unqualified)] public ContextPhoto ContextNextPhoto; /// [XmlElement("prevphoto", Form=XmlSchemaForm.Unqualified)] public ContextPhoto ContextPrevPhoto; /// [XmlAttribute("stat", Form=XmlSchemaForm.Unqualified)] public ResponseStatus Status; /// /// If an error occurs the Error property is populated with /// a instance. /// [XmlElement("err", Form=XmlSchemaForm.Unqualified)] public ResponseError Error; /// /// A instance. /// [XmlElement("method", Form=XmlSchemaForm.Unqualified)] public Method Method; /// /// If using flickr.test.echo this contains all the other elements not covered above. /// /// /// t is an array of objects. Use the XmlElement Name and InnerXml properties /// to get the name and value of the returned property. /// [XmlAnyElement(), NonSerialized()] public XmlElement[] AllElements; } /// /// If an error occurs then Flickr returns this object. /// [System.Serializable] public class ResponseError { /// /// The code or number of the error. /// /// /// 100 - Invalid Api Key. /// 99 - User not logged in. /// Other codes are specific to a method. /// [XmlAttribute("code", Form=XmlSchemaForm.Unqualified)] public int Code; /// /// The verbose message matching the error code. /// [XmlAttribute("msg", Form=XmlSchemaForm.Unqualified)] public string Message; } /// /// The status of the response, either ok or fail. /// public enum ResponseStatus { /// /// The response returns "ok" on a successful execution of the method. /// [XmlEnum("ok")] OK, /// /// The response returns "fail" if there is an error, such as invalid API key or login failure. /// [XmlEnum("fail")] Failed } }