PageRenderTime 83ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/Amazon.EC2/Model/DescribeReservedInstancesOfferingsRequest.cs

https://bitbucket.org/mdavid/aws-sdk-for-net
C# | 301 lines | 143 code | 23 blank | 135 comment | 7 complexity | e31f0087ccd64e9a7a6824ba124e95dc MD5 | raw file
  1. /*******************************************************************************
  2. * Copyright 2008-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  3. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use
  4. * this file except in compliance with the License. A copy of the License is located at
  5. *
  6. * http://aws.amazon.com/apache2.0
  7. *
  8. * or in the "license" file accompanying this file. This file is distributed on
  9. * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
  10. * or implied. See the License for the specific language governing permissions and
  11. * limitations under the License.
  12. * *****************************************************************************
  13. * __ _ _ ___
  14. * ( )( \/\/ )/ __)
  15. * /__\ \ / \__ \
  16. * (_)(_) \/\/ (___/
  17. *
  18. * AWS SDK for .NET
  19. * API Version: 2012-04-01
  20. */
  21. using System;
  22. using System.Collections.Generic;
  23. using System.Xml.Serialization;
  24. using System.Text;
  25. namespace Amazon.EC2.Model
  26. {
  27. /// <summary>
  28. /// Describes Reserved Instance offerings that are
  29. /// available for purchase. With Amazon EC2
  30. /// Reserved Instances, you
  31. /// purchase the right to launch Amazon EC2 instances
  32. /// for a period of time (without getting
  33. /// insufficient capacity errors) and pay a
  34. /// lower usage rate for the
  35. /// actual time used. For more information
  36. /// about Reserved Instances, go to the Amazon
  37. /// Elastic Compute Cloud Developer Guide.
  38. /// </summary>
  39. [XmlRootAttribute(Namespace = "http://ec2.amazonaws.com/doc/2012-04-01/", IsNullable = false)]
  40. public class DescribeReservedInstancesOfferingsRequest
  41. {
  42. private List<string> reservedInstancesIdField;
  43. private string instanceTypeField;
  44. private string availabilityZoneField;
  45. private string productDescriptionField;
  46. private List<Filter> filterField;
  47. private string instanceTenancyField;
  48. private string offeringTypeField;
  49. /// <summary>
  50. /// Gets and sets the ReservedInstancesId property.
  51. /// ID of the Reserved Instances to describe.
  52. /// </summary>
  53. [XmlElementAttribute(ElementName = "ReservedInstancesId")]
  54. public List<string> ReservedInstancesId
  55. {
  56. get
  57. {
  58. if (this.reservedInstancesIdField == null)
  59. {
  60. this.reservedInstancesIdField = new List<string>();
  61. }
  62. return this.reservedInstancesIdField;
  63. }
  64. set { this.reservedInstancesIdField = value; }
  65. }
  66. /// <summary>
  67. /// Sets the ReservedInstancesId property
  68. /// </summary>
  69. /// <param name="list">ID of the Reserved Instances to describe.</param>
  70. /// <returns>this instance</returns>
  71. public DescribeReservedInstancesOfferingsRequest WithReservedInstancesId(params string[] list)
  72. {
  73. foreach (string item in list)
  74. {
  75. ReservedInstancesId.Add(item);
  76. }
  77. return this;
  78. }
  79. /// <summary>
  80. /// Checks if ReservedInstancesId property is set
  81. /// </summary>
  82. /// <returns>true if ReservedInstancesId property is set</returns>
  83. public bool IsSetReservedInstancesId()
  84. {
  85. return (ReservedInstancesId.Count > 0);
  86. }
  87. /// <summary>
  88. /// Gets and sets the InstanceType property.
  89. /// The instance type on which the Reserved
  90. /// Instance can be used.
  91. /// </summary>
  92. [XmlElementAttribute(ElementName = "InstanceType")]
  93. public string InstanceType
  94. {
  95. get { return this.instanceTypeField; }
  96. set { this.instanceTypeField = value; }
  97. }
  98. /// <summary>
  99. /// Sets the InstanceType property
  100. /// </summary>
  101. /// <param name="instanceType">The instance type on which the Reserved
  102. /// Instance can be used.</param>
  103. /// <returns>this instance</returns>
  104. public DescribeReservedInstancesOfferingsRequest WithInstanceType(string instanceType)
  105. {
  106. this.instanceTypeField = instanceType;
  107. return this;
  108. }
  109. /// <summary>
  110. /// Checks if InstanceType property is set
  111. /// </summary>
  112. /// <returns>true if InstanceType property is set</returns>
  113. public bool IsSetInstanceType()
  114. {
  115. return this.instanceTypeField != null;
  116. }
  117. /// <summary>
  118. /// Gets and sets the AvailabilityZone property.
  119. /// The Availability Zone in which the Reserved
  120. /// Instance can be used.
  121. /// </summary>
  122. [XmlElementAttribute(ElementName = "AvailabilityZone")]
  123. public string AvailabilityZone
  124. {
  125. get { return this.availabilityZoneField; }
  126. set { this.availabilityZoneField = value; }
  127. }
  128. /// <summary>
  129. /// Sets the AvailabilityZone property
  130. /// </summary>
  131. /// <param name="availabilityZone">The Availability Zone in which the Reserved
  132. /// Instance can be used.</param>
  133. /// <returns>this instance</returns>
  134. public DescribeReservedInstancesOfferingsRequest WithAvailabilityZone(string availabilityZone)
  135. {
  136. this.availabilityZoneField = availabilityZone;
  137. return this;
  138. }
  139. /// <summary>
  140. /// Checks if AvailabilityZone property is set
  141. /// </summary>
  142. /// <returns>true if AvailabilityZone property is set</returns>
  143. public bool IsSetAvailabilityZone()
  144. {
  145. return this.availabilityZoneField != null;
  146. }
  147. /// <summary>
  148. /// Gets and sets the ProductDescription property.
  149. /// The Reserved Instance description.
  150. /// </summary>
  151. [XmlElementAttribute(ElementName = "ProductDescription")]
  152. public string ProductDescription
  153. {
  154. get { return this.productDescriptionField; }
  155. set { this.productDescriptionField = value; }
  156. }
  157. /// <summary>
  158. /// Sets the ProductDescription property
  159. /// </summary>
  160. /// <param name="productDescription">The Reserved Instance description.</param>
  161. /// <returns>this instance</returns>
  162. public DescribeReservedInstancesOfferingsRequest WithProductDescription(string productDescription)
  163. {
  164. this.productDescriptionField = productDescription;
  165. return this;
  166. }
  167. /// <summary>
  168. /// Checks if ProductDescription property is set
  169. /// </summary>
  170. /// <returns>true if ProductDescription property is set</returns>
  171. public bool IsSetProductDescription()
  172. {
  173. return this.productDescriptionField != null;
  174. }
  175. /// <summary>
  176. /// Gets and sets the Filter property.
  177. /// A list of filters used to match system-defined properties and user-defined tags
  178. /// associated with the specified ReservedInstances.
  179. /// For a complete reference to the available filter keys for this operation, see the
  180. /// Amazon EC2 API reference.
  181. /// </summary>
  182. [XmlElementAttribute(ElementName = "Filter")]
  183. public List<Filter> Filter
  184. {
  185. get
  186. {
  187. if (this.filterField == null)
  188. {
  189. this.filterField = new List<Filter>();
  190. }
  191. return this.filterField;
  192. }
  193. set { this.filterField = value; }
  194. }
  195. /// <summary>
  196. /// Sets the Filter property
  197. /// </summary>
  198. /// <param name="list">A list of filters used to match system-defined properties and user-defined tags
  199. /// associated with the specified ReservedInstances.
  200. /// For a complete reference to the available filter keys for this operation, see the
  201. /// Amazon EC2 API reference.</param>
  202. /// <returns>this instance</returns>
  203. public DescribeReservedInstancesOfferingsRequest WithFilter(params Filter[] list)
  204. {
  205. foreach (Filter item in list)
  206. {
  207. Filter.Add(item);
  208. }
  209. return this;
  210. }
  211. /// <summary>
  212. /// Checks if Filter property is set
  213. /// </summary>
  214. /// <returns>true if Filter property is set</returns>
  215. public bool IsSetFilter()
  216. {
  217. return (Filter.Count > 0);
  218. }
  219. /// <summary>
  220. /// The tenancy of the Reserved Instance offering. A Reserved Instance with tenancy of dedicated will run on
  221. /// single-tenant hardware and can only be launched within a VPC.
  222. /// Valid Values: default | dedicated
  223. /// </summary>
  224. [XmlElementAttribute(ElementName = "InstanceTenancy")]
  225. public string InstanceTenancy
  226. {
  227. get { return this.instanceTenancyField; }
  228. set { this.instanceTenancyField = value; }
  229. }
  230. /// <summary>
  231. /// Sets the tenancy of the Reserved Instance offering. A Reserved Instance with tenancy of dedicated will run on
  232. /// single-tenant hardware and can only be launched within a VPC.
  233. /// </summary>
  234. /// <param name="instanceTenancy">Instance Tenancy. Valid Values: default | dedicated</param>
  235. /// <returns>this instance</returns>
  236. public DescribeReservedInstancesOfferingsRequest WithInstanceTenancy(string instanceTenancy)
  237. {
  238. this.instanceTenancyField = instanceTenancy;
  239. return this;
  240. }
  241. /// <summary>
  242. /// Checks if the InstanceTenancy property is set.
  243. /// </summary>
  244. /// <returns>true if the InstanceTenancy property is set</returns>
  245. public bool IsSetInstanceTenancy()
  246. {
  247. return !string.IsNullOrEmpty(this.instanceTenancyField);
  248. }
  249. /// <summary>
  250. /// Gets and sets the Reserved Instance offering type.
  251. /// Valid Values: Heavy Utilization | Medium Utilization | Light Utilization
  252. /// </summary>
  253. [XmlElementAttribute(ElementName = "OfferingType")]
  254. public string OfferingType
  255. {
  256. get { return this.offeringTypeField; }
  257. set { this.offeringTypeField = value; }
  258. }
  259. /// <summary>
  260. /// Sets the Reserved Instance offering type.
  261. /// </summary>
  262. /// <param name="offeringType">Offering type. Valid values: Heavy Utilization | Medium Utilization | Light Utilization</param>
  263. /// <returns>this instance</returns>
  264. public DescribeReservedInstancesOfferingsRequest WithOfferingType(string offeringType)
  265. {
  266. this.offeringTypeField = offeringType;
  267. return this;
  268. }
  269. /// <summary>
  270. /// Checks if the OfferingType property is set.
  271. /// </summary>
  272. /// <returns>true if the OfferingType property is set</returns>
  273. public bool IsSetOfferingType()
  274. {
  275. return !string.IsNullOrEmpty(this.offeringTypeField);
  276. }
  277. }
  278. }