~ubuntu-branches/debian/lenny/libflickrnet/lenny

« back to all changes in this revision

Viewing changes to FlickrNet/Response.cs

  • Committer: Bazaar Package Importer
  • Author(s): Varun Hiremath
  • Date: 2007-09-17 01:21:17 UTC
  • Revision ID: james.westby@ubuntu.com-20070917012117-nfciefa8nm6doj4r
Tags: upstream-25277
Import upstream version 25277

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
using System;
 
2
using System.Xml;
 
3
using System.Xml.Serialization;
 
4
using System.Xml.Schema;
 
5
 
 
6
namespace FlickrNet
 
7
{
 
8
        /// <summary>
 
9
        /// The root object returned by Flickr. Used with Xml Serialization to get the relevant object.
 
10
        /// It is internal to the FlickrNet API Library and should not be used elsewhere.
 
11
        /// </summary>
 
12
        [XmlRoot("rsp", Namespace="", IsNullable=false)]
 
13
        [Serializable]
 
14
        public class Response 
 
15
        {
 
16
 
 
17
                /// <remarks/>
 
18
                [XmlElement("blogs", Form=XmlSchemaForm.Unqualified)]
 
19
                public Blogs Blogs;
 
20
 
 
21
                /// <remarks/>
 
22
                [XmlElement("contacts", Form=XmlSchemaForm.Unqualified)]
 
23
                public Contacts Contacts;
 
24
 
 
25
                /// <remarks/>
 
26
                [XmlElement("photos", Form=XmlSchemaForm.Unqualified)]
 
27
                public Photos Photos;
 
28
 
 
29
                /// <remarks/>
 
30
                [XmlElement("category", Form=XmlSchemaForm.Unqualified)]
 
31
                public Category Category;
 
32
 
 
33
                /// <remarks/>
 
34
                [XmlElement("photocounts", Form=XmlSchemaForm.Unqualified)]
 
35
                public PhotoCounts PhotoCounts;
 
36
 
 
37
                /// <remarks/>
 
38
                [XmlElement("photo", Form=XmlSchemaForm.Unqualified)]
 
39
                public PhotoInfo PhotoInfo;
 
40
 
 
41
                /// <remarks/>
 
42
                [XmlElement("photoset", Form=XmlSchemaForm.Unqualified)]
 
43
                public Photoset Photoset;
 
44
 
 
45
                /// <remarks/>
 
46
                [XmlElement("photosets", Form=XmlSchemaForm.Unqualified)]
 
47
                public Photosets Photosets;
 
48
 
 
49
                /// <remarks/>
 
50
                [XmlElement("sizes", Form=XmlSchemaForm.Unqualified)]
 
51
                public Sizes Sizes;
 
52
    
 
53
                /// <remarks/>
 
54
                [XmlElement("licenses", Form=XmlSchemaForm.Unqualified)]
 
55
                public Licenses Licenses;
 
56
 
 
57
                /// <remarks/>
 
58
                [XmlElement("count", Form=XmlSchemaForm.Unqualified)]
 
59
                public ContextCount ContextCount;
 
60
 
 
61
                /// <remarks/>
 
62
                [XmlElement("nextphoto", Form=XmlSchemaForm.Unqualified)]
 
63
                public ContextPhoto ContextNextPhoto;
 
64
 
 
65
                /// <remarks/>
 
66
                [XmlElement("prevphoto", Form=XmlSchemaForm.Unqualified)]
 
67
                public ContextPhoto ContextPrevPhoto;
 
68
 
 
69
                /// <remarks/>
 
70
                [XmlAttribute("stat", Form=XmlSchemaForm.Unqualified)]
 
71
                public ResponseStatus Status;
 
72
 
 
73
                /// <summary>
 
74
                /// If an error occurs the Error property is populated with 
 
75
                /// a <see cref="ResponseError"/> instance.
 
76
                /// </summary>
 
77
                [XmlElement("err", Form=XmlSchemaForm.Unqualified)]
 
78
                public ResponseError Error;
 
79
 
 
80
                /// <summary>
 
81
                /// A <see cref="Method"/> instance.
 
82
                /// </summary>
 
83
                [XmlElement("method", Form=XmlSchemaForm.Unqualified)]
 
84
                public Method Method;
 
85
 
 
86
                /// <summary>
 
87
                /// If using flickr.test.echo this contains all the other elements not covered above.
 
88
                /// </summary>
 
89
                /// <remarks>
 
90
                /// t is an array of <see cref="XmlElement"/> objects. Use the XmlElement Name and InnerXml properties
 
91
                /// to get the name and value of the returned property.
 
92
                /// </remarks>
 
93
                [XmlAnyElement(), NonSerialized()]
 
94
                public XmlElement[] AllElements;
 
95
        }
 
96
 
 
97
        /// <summary>
 
98
        /// If an error occurs then Flickr returns this object.
 
99
        /// </summary>
 
100
        [System.Serializable]
 
101
        public class ResponseError
 
102
        {
 
103
                /// <summary>
 
104
                /// The code or number of the error.
 
105
                /// </summary>
 
106
                /// <remarks>
 
107
                /// 100 - Invalid Api Key.
 
108
                /// 99  - User not logged in.
 
109
                /// Other codes are specific to a method.
 
110
                /// </remarks>
 
111
                [XmlAttribute("code", Form=XmlSchemaForm.Unqualified)]
 
112
                public int Code;
 
113
 
 
114
                /// <summary>
 
115
                /// The verbose message matching the error code.
 
116
                /// </summary>
 
117
                [XmlAttribute("msg", Form=XmlSchemaForm.Unqualified)]
 
118
                public string Message;
 
119
        }
 
120
 
 
121
        /// <summary>
 
122
        /// The status of the response, either ok or fail.
 
123
        /// </summary>
 
124
        public enum ResponseStatus
 
125
        {
 
126
                /// <summary>
 
127
                /// An unknown status, and the default value if not set.
 
128
                /// </summary>
 
129
                [XmlEnum("unknown")]
 
130
                Unknown,
 
131
 
 
132
                /// <summary>
 
133
                /// The response returns "ok" on a successful execution of the method.
 
134
                /// </summary>
 
135
                [XmlEnum("ok")]
 
136
                OK,
 
137
                /// <summary>
 
138
                /// The response returns "fail" if there is an error, such as invalid API key or login failure.
 
139
                /// </summary>
 
140
                [XmlEnum("fail")]
 
141
                Failed
 
142
        }
 
143
}
 
 
b'\\ No newline at end of file'