/AWSWP7SDK/Amazon.SimpleDB/AmazonSimpleDB.cs

https://bitbucket.org/mdavid/aws-sdk-for-wp · C# · 352 lines · 56 code · 42 blank · 254 comment · 0 complexity · c04e25934eb344900035de25094d8682 MD5 · raw file

  1. /*
  2. Copyright 2011 Microsoft Corp.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. /*******************************************************************************
  14. * AWS SDK for WP7
  15. */
  16. using System;
  17. using Amazon.SimpleDB.Model;
  18. namespace Amazon.SimpleDB
  19. {
  20. /// <summary>
  21. /// Amazon SimpleDB is a web service for running queries on structured
  22. /// data in real time. This service works in close conjunction with Amazon
  23. /// Simple Storage Service (Amazon S3) and Amazon Elastic Compute Cloud
  24. /// (Amazon EC2), collectively providing the ability to store, process
  25. /// and query data sets in the cloud. These services are designed to make
  26. /// web-scale computing easier and more cost-effective for developers.
  27. /// Traditionally, this type of functionality has been accomplished with
  28. /// a clustered relational database that requires a sizable upfront
  29. /// investment, brings more complexity than is typically needed, and often
  30. /// requires a DBA to maintain and administer. In contrast, Amazon SimpleDB
  31. /// is easy to use and provides the core functionality of a database -
  32. /// real-time lookup and simple querying of structured data without the
  33. /// operational complexity. Amazon SimpleDB requires no schema, automatically
  34. /// indexes your data and provides a simple API for storage and access.
  35. /// This eliminates the administrative burden of data modeling, index
  36. /// maintenance, and performance tuning. Developers gain access to this
  37. /// functionality within Amazon's proven computing environment, are able
  38. /// to scale instantly, and pay only for what they use.
  39. /// </summary>
  40. public interface AmazonSimpleDB : IDisposable
  41. {
  42. event SimpleDBResponseEventHandler<object, ResponseEventArgs> OnSimpleDBResponse;
  43. #region CreateDomain Operation
  44. /// <summary>
  45. /// Initiates the asynchronous execution of the CreateDomain operation.
  46. /// <seealso cref="M:Amazon.SimpleDB.AmazonSimpleDB.CreateDomain"/>
  47. /// </summary>
  48. /// <param name="request">The CreateDomainRequest that defines the parameters of
  49. /// the operation.</param>
  50. /// <exception cref="T:System.ArgumentNullException"></exception>
  51. /// <exception cref="T:System.Net.WebException"></exception>
  52. /// <exception cref="T:Amazon.SimpleDB.AmazonSimpleDBException"></exception>
  53. void BeginCreateDomain(CreateDomainRequest request);
  54. /// <summary>
  55. /// Create Domain.
  56. /// <seealso cref="M:Amazon.SimpleDB.AmazonSimpleDB.CreateDomain"/>
  57. /// </summary>
  58. /// <param name="request">The CreateDomainRequest that defines the parameters of
  59. /// the operation.</param>
  60. /// <exception cref="T:System.ArgumentNullException"></exception>
  61. /// <exception cref="T:System.Net.WebException"></exception>
  62. /// <exception cref="T:Amazon.SimpleDB.AmazonSimpleDBException"></exception>
  63. void CreateDomain(CreateDomainRequest request);
  64. #endregion
  65. #region ListDomains Operation
  66. /// <summary>
  67. /// Initiates the asynchronous execution of the ListDomains operation.
  68. /// <seealso cref="M:Amazon.SimpleDB.AmazonSimpleDB.ListDomains"/>
  69. /// </summary>
  70. /// <param name="request">The ListDomainsRequest that defines the parameters of
  71. /// the operation.</param>
  72. /// <exception cref="T:System.ArgumentNullException"></exception>
  73. /// <exception cref="T:System.Net.WebException"></exception>
  74. /// <exception cref="T:Amazon.SimpleDB.AmazonSimpleDBException"></exception>
  75. void BeginListDomains(ListDomainsRequest request);
  76. /// <summary>
  77. /// List Domains.
  78. /// <seealso cref="M:Amazon.SimpleDB.AmazonSimpleDB.ListDomains"/>
  79. /// </summary>
  80. /// <param name="request">The ListDomainsRequest that defines the parameters of
  81. /// the operation.</param>
  82. /// <exception cref="T:System.ArgumentNullException"></exception>
  83. /// <exception cref="T:System.Net.WebException"></exception>
  84. /// <exception cref="T:Amazon.SimpleDB.AmazonSimpleDBException"></exception>
  85. void ListDomains(ListDomainsRequest request);
  86. #endregion
  87. #region DomainMetadata Operation
  88. /// <summary>
  89. /// Initiates the asynchronous execution of the DomainMetadata operation.
  90. /// <seealso cref="M:Amazon.SimpleDB.AmazonSimpleDB.DomainMetadata"/>
  91. /// </summary>
  92. /// <param name="request">The DomainMetadataRequest that defines the parameters of
  93. /// the operation.</param>
  94. /// <exception cref="T:System.ArgumentNullException"></exception>
  95. /// <exception cref="T:System.Net.WebException"></exception>
  96. /// <exception cref="T:Amazon.SimpleDB.AmazonSimpleDBException"></exception>
  97. void BeginDomainMetadata(DomainMetadataRequest request);
  98. /// <summary>
  99. /// Domain Metadata.
  100. /// <seealso cref="M:Amazon.SimpleDB.AmazonSimpleDB.DomainMetadata"/>
  101. /// </summary>
  102. /// <param name="request">The DomainMetadataRequest that defines the parameters of
  103. /// the operation.</param>
  104. /// <exception cref="T:System.ArgumentNullException"></exception>
  105. /// <exception cref="T:System.Net.WebException"></exception>
  106. /// <exception cref="T:Amazon.SimpleDB.AmazonSimpleDBException"></exception>
  107. void DomainMetadata(DomainMetadataRequest request);
  108. #endregion
  109. #region DeleteDomain Operation
  110. /// <summary>
  111. /// Initiates the asynchronous execution of the DeleteDomain operation.
  112. /// <seealso cref="M:Amazon.SimpleDB.AmazonSimpleDB.DeleteDomain"/>
  113. /// </summary>
  114. /// <param name="request">The DeleteDomainRequest that defines the parameters of
  115. /// the operation.</param>
  116. /// <exception cref="T:System.ArgumentNullException"></exception>
  117. /// <exception cref="T:System.Net.WebException"></exception>
  118. /// <exception cref="T:Amazon.SimpleDB.AmazonSimpleDBException"></exception>
  119. void BeginDeleteDomain(DeleteDomainRequest request);
  120. /// <summary>
  121. /// Delete Domain.
  122. /// <seealso cref="M:Amazon.SimpleDB.AmazonSimpleDB.DeleteDomain"/>
  123. /// </summary>
  124. /// <param name="request">The DeleteDomainRequest that defines the parameters of
  125. /// the operation.</param>
  126. /// <exception cref="T:System.ArgumentNullException"></exception>
  127. /// <exception cref="T:System.Net.WebException"></exception>
  128. /// <exception cref="T:Amazon.SimpleDB.AmazonSimpleDBException"></exception>
  129. void DeleteDomain(DeleteDomainRequest request);
  130. #endregion
  131. #region PutAttributes Operation
  132. /// <summary>
  133. /// Put Attribute
  134. /// </summary>
  135. /// <param name="request">Put Attribute request</param>
  136. /// <exception cref="T:System.ArgumentNullException"></exception>
  137. /// <exception cref="T:System.Net.WebException"></exception>
  138. /// <exception cref="T:Amazon.SimpleDB.AmazonSimpleDBException"></exception>
  139. /// <remarks>
  140. /// The PutAttributes operation creates or replaces attributes within an item. You specify new attributes
  141. /// using a combination of the Attribute.X.Name and Attribute.X.Value parameters. You specify
  142. /// the first attribute by the parameters Attribute.0.Name and Attribute.0.Value, the second
  143. /// attribute by the parameters Attribute.1.Name and Attribute.1.Value, and so on.
  144. /// Attribute are uniquely identified within an item by their name/value combination. For example, a single
  145. /// item can have the attributes { "first_name", "first_value" } and { "first_name",
  146. /// second_value" }. However, it cannot have two attribute instances where both the Attribute.X.Name and
  147. /// Attribute.X.Value are the same.
  148. /// Optionally, the requestor can supply the Replace parameter for each individual value. Setting this value
  149. /// to true will cause the new attribute value to replace the existing attribute value(s). For example, if an
  150. /// item has the attributes { 'a', '1' }, { 'b', '2'} and { 'b', '3' } and the requestor does a
  151. /// PutAttributes of { 'b', '4' } with the Replace parameter set to true, the final attributes of the
  152. /// item will be { 'a', '1' } and { 'b', '4' }, replacing the previous values of the 'b' attribute
  153. /// with the new value.
  154. /// </remarks>
  155. void PutAttributes(PutAttributesRequest request);
  156. /// <summary>
  157. /// Initiates the asynchronous execution of the PutAttributes operation.
  158. /// </summary>
  159. /// <param name="request">Put Attribute request</param>
  160. /// <exception cref="T:System.ArgumentNullException"></exception>
  161. /// <exception cref="T:System.Net.WebException"></exception>
  162. /// <exception cref="T:Amazon.SimpleDB.AmazonSimpleDBException"></exception>
  163. /// <remarks>
  164. /// The PutAttributes operation creates or replaces attributes within an item. You specify new attributes
  165. /// using a combination of the Attribute.X.Name and Attribute.X.Value parameters. You specify
  166. /// the first attribute by the parameters Attribute.0.Name and Attribute.0.Value, the second
  167. /// attribute by the parameters Attribute.1.Name and Attribute.1.Value, and so on.
  168. /// Attribute are uniquely identified within an item by their name/value combination. For example, a single
  169. /// item can have the attributes { "first_name", "first_value" } and { "first_name",
  170. /// second_value" }. However, it cannot have two attribute instances where both the Attribute.X.Name and
  171. /// Attribute.X.Value are the same.
  172. /// Optionally, the requestor can supply the Replace parameter for each individual value. Setting this value
  173. /// to true will cause the new attribute value to replace the existing attribute value(s). For example, if an
  174. /// item has the attributes { 'a', '1' }, { 'b', '2'} and { 'b', '3' } and the requestor does a
  175. /// PutAttributes of { 'b', '4' } with the Replace parameter set to true, the final attributes of the
  176. /// item will be { 'a', '1' } and { 'b', '4' }, replacing the previous values of the 'b' attribute
  177. /// with the new value.
  178. /// </remarks>
  179. void BeginPutAttributes(PutAttributesRequest request);
  180. #endregion
  181. #region BatchPutAttributes Operation
  182. /// <summary>
  183. /// Batch Put Attributes.
  184. /// <seealso cref="M:Amazon.SimpleDB.AmazonSimpleDB.BatchPutAttributes"/>
  185. /// </summary>
  186. /// <param name="request">The BatchPutAttributesRequest that defines the parameters of
  187. /// the operation.</param>
  188. /// <exception cref="T:System.ArgumentNullException"></exception>
  189. /// <exception cref="T:System.Net.WebException"></exception>
  190. /// <exception cref="T:Amazon.SimpleDB.AmazonSimpleDBException"></exception>
  191. void BatchPutAttributes(BatchPutAttributesRequest request);
  192. /// <summary>
  193. /// Initiates the asynchronous execution of the BatchPutAttributes operation.
  194. /// <seealso cref="M:Amazon.SimpleDB.AmazonSimpleDB.BatchPutAttributes"/>
  195. /// </summary>
  196. /// <param name="request">The BatchPutAttributesRequest that defines the parameters of
  197. /// the operation.</param>
  198. /// <exception cref="T:System.ArgumentNullException"></exception>
  199. /// <exception cref="T:System.Net.WebException"></exception>
  200. /// <exception cref="T:Amazon.SimpleDB.AmazonSimpleDBException"></exception>
  201. void BeginBatchPutAttributes(BatchPutAttributesRequest request);
  202. #endregion
  203. #region GetAttributes Operation
  204. /// <summary>
  205. /// Get Attributes.
  206. /// </summary>
  207. /// <param name="request">Get Attribute request</param>
  208. /// <exception cref="T:System.ArgumentNullException"></exception>
  209. /// <exception cref="T:System.Net.WebException"></exception>
  210. /// <exception cref="T:Amazon.SimpleDB.AmazonSimpleDBException"></exception>
  211. /// <remarks>
  212. /// Returns all of the attributes associated with the item. Optionally, the attributes returned can be limited to
  213. /// the specified AttributeName parameter.
  214. /// If the item does not exist on the replica that was accessed for this operation, an empty attribute is
  215. /// returned. The system does not return an error as it cannot guarantee the item does not exist on other
  216. /// replicas.
  217. /// </remarks>
  218. void GetAttributes(GetAttributesRequest request);
  219. /// <summary>
  220. /// Initiates the asynchronous execution of the GetAttributes operation.
  221. /// </summary>
  222. /// <param name="request">Get Attribute request</param>
  223. /// <exception cref="T:System.ArgumentNullException"></exception>
  224. /// <exception cref="T:System.Net.WebException"></exception>
  225. /// <exception cref="T:Amazon.SimpleDB.AmazonSimpleDBException"></exception>
  226. /// <remarks>
  227. /// Returns all of the attributes associated with the item. Optionally, the attributes returned can be limited to
  228. /// the specified AttributeName parameter.
  229. /// If the item does not exist on the replica that was accessed for this operation, an empty attribute is
  230. /// returned. The system does not return an error as it cannot guarantee the item does not exist on other
  231. /// replicas.
  232. /// </remarks>
  233. void BeginGetAttributes(GetAttributesRequest request);
  234. #endregion
  235. #region DeleteAttributes Operation
  236. /// <summary>
  237. /// Delete Attributes.
  238. /// <seealso cref="M:Amazon.SimpleDB.AmazonSimpleDB.DeleteAttributes"/>
  239. /// </summary>
  240. /// <param name="request">The DeleteAttributesRequest that defines the parameters of
  241. /// the operation.</param>
  242. /// <exception cref="T:System.ArgumentNullException"></exception>
  243. /// <exception cref="T:System.Net.WebException"></exception>
  244. /// <exception cref="T:Amazon.SimpleDB.AmazonSimpleDBException"></exception>
  245. void DeleteAttributes(DeleteAttributesRequest request);
  246. /// <summary>
  247. /// Initiates the asynchronous execution of the DeleteAttributes operation.
  248. /// <seealso cref="M:Amazon.SimpleDB.AmazonSimpleDB.DeleteAttributes"/>
  249. /// </summary>
  250. /// <param name="request">The DeleteAttributesRequest that defines the parameters of
  251. /// the operation.</param>
  252. /// <exception cref="T:System.ArgumentNullException"></exception>
  253. /// <exception cref="T:System.Net.WebException"></exception>
  254. /// <exception cref="T:Amazon.SimpleDB.AmazonSimpleDBException"></exception>
  255. void BeginDeleteAttributes(DeleteAttributesRequest request);
  256. #endregion
  257. #region BatchDeleteAttributes Operation
  258. /// <summary>
  259. /// Initiates the asynchronous execution of the BatchDeleteAttributes operation.
  260. /// <seealso cref="M:Amazon.SimpleDB.AmazonSimpleDB.BatchDeleteAttributes"/>
  261. /// </summary>
  262. /// <param name="request">The BatchDeleteAttributesRequest that defines the parameters of
  263. /// the operation.</param>
  264. /// <exception cref="T:System.ArgumentNullException"></exception>
  265. /// <exception cref="T:System.Net.WebException"></exception>
  266. /// <exception cref="T:Amazon.SimpleDB.AmazonSimpleDBException"></exception>
  267. void BeginBatchDeleteAttributes(BatchDeleteAttributesRequest request);
  268. /// <summary>
  269. /// Batch Delete Attributes.
  270. /// <seealso cref="M:Amazon.SimpleDB.AmazonSimpleDB.BatchDeleteAttributes"/>
  271. /// </summary>
  272. /// <param name="request">The BatchDeleteAttributesRequest that defines the parameters of
  273. /// the operation.</param>
  274. /// <exception cref="T:System.ArgumentNullException"></exception>
  275. /// <exception cref="T:System.Net.WebException"></exception>
  276. /// <exception cref="T:Amazon.SimpleDB.AmazonSimpleDBException"></exception>
  277. void BatchDeleteAttributes(BatchDeleteAttributesRequest request);
  278. #endregion
  279. #region Select Operation
  280. /// <summary>
  281. /// Select
  282. /// </summary>
  283. /// <param name="request">Select request</param>
  284. /// <remarks>
  285. /// The Select operation returns a set of item names and associate attributes that match the
  286. /// query expression. Select operations that run longer than 5 seconds will likely time-out
  287. /// and return a time-out error response.
  288. /// </remarks>
  289. void Select(SelectRequest request);
  290. #endregion
  291. }
  292. /// <summary>
  293. /// A type that acts as the event argument for the <see cref=""/> event.
  294. /// </summary>
  295. public class ResponseEventArgs : EventArgs
  296. {
  297. /// <summary>
  298. /// Gets the <see cref="ISimpleDBResponse"/> object.
  299. /// </summary>
  300. public ISimpleDBResponse Response { get; private set; }
  301. public ResponseEventArgs(ISimpleDBResponse response)
  302. {
  303. this.Response = response;
  304. }
  305. }
  306. }