PageRenderTime 52ms CodeModel.GetById 34ms app.highlight 16ms RepoModel.GetById 0ms app.codeStats 1ms

/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
 22using System;
 23using System.Collections.Generic;
 24using System.Xml.Serialization;
 25using System.Text;
 26
 27namespace Amazon.EC2.Model
 28{
 29    /// <summary>
 30    /// Describes Reserved Instance offerings that are
 31    /// available for purchase. With Amazon EC2
 32    /// Reserved Instances, you
 33    /// purchase the right to launch Amazon EC2 instances
 34    /// for a period of time (without getting
 35    /// insufficient capacity errors) and pay a
 36    /// lower usage rate for the
 37    /// actual time used. For more information
 38    /// about Reserved Instances, go to the Amazon
 39    /// Elastic Compute Cloud Developer Guide.
 40    /// </summary>
 41    [XmlRootAttribute(Namespace = "http://ec2.amazonaws.com/doc/2012-04-01/", IsNullable = false)]
 42    public class DescribeReservedInstancesOfferingsRequest
 43    {    
 44        private List<string> reservedInstancesIdField;
 45        private string instanceTypeField;
 46        private string availabilityZoneField;
 47        private string productDescriptionField;
 48        private List<Filter> filterField;
 49        private string instanceTenancyField;
 50        private string offeringTypeField;
 51
 52        /// <summary>
 53        /// Gets and sets the ReservedInstancesId property.
 54        /// ID of the Reserved Instances to describe.
 55        /// </summary>
 56        [XmlElementAttribute(ElementName = "ReservedInstancesId")]
 57        public List<string> ReservedInstancesId
 58        {
 59            get
 60            {
 61                if (this.reservedInstancesIdField == null)
 62                {
 63                    this.reservedInstancesIdField = new List<string>();
 64                }
 65                return this.reservedInstancesIdField;
 66            }
 67            set { this.reservedInstancesIdField = value; }
 68        }
 69
 70        /// <summary>
 71        /// Sets the ReservedInstancesId property
 72        /// </summary>
 73        /// <param name="list">ID of the Reserved Instances to describe.</param>
 74        /// <returns>this instance</returns>
 75        public DescribeReservedInstancesOfferingsRequest WithReservedInstancesId(params string[] list)
 76        {
 77            foreach (string item in list)
 78            {
 79                ReservedInstancesId.Add(item);
 80            }
 81            return this;
 82        }
 83
 84        /// <summary>
 85        /// Checks if ReservedInstancesId property is set
 86        /// </summary>
 87        /// <returns>true if ReservedInstancesId property is set</returns>
 88        public bool IsSetReservedInstancesId()
 89        {
 90            return (ReservedInstancesId.Count > 0);
 91        }
 92
 93        /// <summary>
 94        /// Gets and sets the InstanceType property.
 95        /// The instance type on which the Reserved
 96        /// Instance can be used.
 97        /// </summary>
 98        [XmlElementAttribute(ElementName = "InstanceType")]
 99        public string InstanceType
100        {
101            get { return this.instanceTypeField; }
102            set { this.instanceTypeField = value; }
103        }
104
105        /// <summary>
106        /// Sets the InstanceType property
107        /// </summary>
108        /// <param name="instanceType">The instance type on which the Reserved
109        /// Instance can be used.</param>
110        /// <returns>this instance</returns>
111        public DescribeReservedInstancesOfferingsRequest WithInstanceType(string instanceType)
112        {
113            this.instanceTypeField = instanceType;
114            return this;
115        }
116
117        /// <summary>
118        /// Checks if InstanceType property is set
119        /// </summary>
120        /// <returns>true if InstanceType property is set</returns>
121        public bool IsSetInstanceType()
122        {
123            return this.instanceTypeField != null;
124        }
125
126        /// <summary>
127        /// Gets and sets the AvailabilityZone property.
128        /// The Availability Zone in which the Reserved
129        /// Instance can be used.
130        /// </summary>
131        [XmlElementAttribute(ElementName = "AvailabilityZone")]
132        public string AvailabilityZone
133        {
134            get { return this.availabilityZoneField; }
135            set { this.availabilityZoneField = value; }
136        }
137
138        /// <summary>
139        /// Sets the AvailabilityZone property
140        /// </summary>
141        /// <param name="availabilityZone">The Availability Zone in which the Reserved
142        /// Instance can be used.</param>
143        /// <returns>this instance</returns>
144        public DescribeReservedInstancesOfferingsRequest WithAvailabilityZone(string availabilityZone)
145        {
146            this.availabilityZoneField = availabilityZone;
147            return this;
148        }
149
150        /// <summary>
151        /// Checks if AvailabilityZone property is set
152        /// </summary>
153        /// <returns>true if AvailabilityZone property is set</returns>
154        public bool IsSetAvailabilityZone()
155        {
156            return this.availabilityZoneField != null;
157        }
158
159        /// <summary>
160        /// Gets and sets the ProductDescription property.
161        /// The Reserved Instance description.
162        /// </summary>
163        [XmlElementAttribute(ElementName = "ProductDescription")]
164        public string ProductDescription
165        {
166            get { return this.productDescriptionField; }
167            set { this.productDescriptionField = value; }
168        }
169
170        /// <summary>
171        /// Sets the ProductDescription property
172        /// </summary>
173        /// <param name="productDescription">The Reserved Instance description.</param>
174        /// <returns>this instance</returns>
175        public DescribeReservedInstancesOfferingsRequest WithProductDescription(string productDescription)
176        {
177            this.productDescriptionField = productDescription;
178            return this;
179        }
180
181        /// <summary>
182        /// Checks if ProductDescription property is set
183        /// </summary>
184        /// <returns>true if ProductDescription property is set</returns>
185        public bool IsSetProductDescription()
186        {
187            return this.productDescriptionField != null;
188        }
189
190        /// <summary>
191        /// Gets and sets the Filter property.
192        /// A list of filters used to match system-defined properties and user-defined tags 
193        /// associated with the specified ReservedInstances.
194        /// For a complete reference to the available filter keys for this operation, see the
195        /// Amazon EC2 API reference.
196        /// </summary>
197        [XmlElementAttribute(ElementName = "Filter")]
198        public List<Filter> Filter
199        {
200            get
201            {
202                if (this.filterField == null)
203                {
204                    this.filterField = new List<Filter>();
205                }
206                return this.filterField;
207            }
208            set { this.filterField = value; }
209        }
210
211        /// <summary>
212        /// Sets the Filter property
213        /// </summary>
214        /// <param name="list">A list of filters used to match system-defined properties and user-defined tags 
215        /// associated with the specified ReservedInstances.
216        /// For a complete reference to the available filter keys for this operation, see the
217        /// Amazon EC2 API reference.</param>
218        /// <returns>this instance</returns>
219        public DescribeReservedInstancesOfferingsRequest WithFilter(params Filter[] list)
220        {
221            foreach (Filter item in list)
222            {
223                Filter.Add(item);
224            }
225            return this;
226        }
227
228        /// <summary>
229        /// Checks if Filter property is set
230        /// </summary>
231        /// <returns>true if Filter property is set</returns>
232        public bool IsSetFilter()
233        {
234            return (Filter.Count > 0);
235        }
236
237        /// <summary>
238        /// The tenancy of the Reserved Instance offering. A Reserved Instance with tenancy of dedicated will run on 
239        /// single-tenant hardware and can only be launched within a VPC.
240        /// Valid Values: default | dedicated
241        /// </summary>
242        [XmlElementAttribute(ElementName = "InstanceTenancy")]
243        public string InstanceTenancy
244        {
245            get { return this.instanceTenancyField; }
246            set { this.instanceTenancyField = value; }
247        }
248
249        /// <summary>
250        /// Sets the tenancy of the Reserved Instance offering. A Reserved Instance with tenancy of dedicated will run on 
251        /// single-tenant hardware and can only be launched within a VPC.
252        /// </summary>
253        /// <param name="instanceTenancy">Instance Tenancy. Valid Values: default | dedicated</param>
254        /// <returns>this instance</returns>
255        public DescribeReservedInstancesOfferingsRequest WithInstanceTenancy(string instanceTenancy)
256        {
257            this.instanceTenancyField = instanceTenancy;
258            return this;
259        }
260
261        /// <summary>
262        /// Checks if the InstanceTenancy property is set.
263        /// </summary>
264        /// <returns>true if the InstanceTenancy property is set</returns>
265        public bool IsSetInstanceTenancy()
266        {
267            return !string.IsNullOrEmpty(this.instanceTenancyField);
268        }
269
270        /// <summary>
271        /// Gets and sets the Reserved Instance offering type.
272        /// Valid Values: Heavy Utilization | Medium Utilization | Light Utilization
273        /// </summary>
274        [XmlElementAttribute(ElementName = "OfferingType")]
275        public string OfferingType
276        {
277            get { return this.offeringTypeField; }
278            set { this.offeringTypeField = value; }
279        }
280
281        /// <summary>
282        /// Sets the Reserved Instance offering type.
283        /// </summary>
284        /// <param name="offeringType">Offering type. Valid values: Heavy Utilization | Medium Utilization | Light Utilization</param>
285        /// <returns>this instance</returns>
286        public DescribeReservedInstancesOfferingsRequest WithOfferingType(string offeringType)
287        {
288            this.offeringTypeField = offeringType;
289            return this;
290        }
291
292        /// <summary>
293        /// Checks if the OfferingType property is set.
294        /// </summary>
295        /// <returns>true if the OfferingType property is set</returns>
296        public bool IsSetOfferingType()
297        {
298            return !string.IsNullOrEmpty(this.offeringTypeField);
299        }
300    }
301}