/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the ec2-2016-11-15.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.EC2.Model
{
///
/// The options for Spot Instances.
///
public partial class SpotMarketOptions
{
private int? _blockDurationMinutes;
private InstanceInterruptionBehavior _instanceInterruptionBehavior;
private string _maxPrice;
private SpotInstanceType _spotInstanceType;
private DateTime? _validUntilUtc;
///
/// Gets and sets the property BlockDurationMinutes.
///
/// Deprecated.
///
///
public int BlockDurationMinutes
{
get { return this._blockDurationMinutes.GetValueOrDefault(); }
set { this._blockDurationMinutes = value; }
}
// Check to see if BlockDurationMinutes property is set
internal bool IsSetBlockDurationMinutes()
{
return this._blockDurationMinutes.HasValue;
}
///
/// Gets and sets the property InstanceInterruptionBehavior.
///
/// The behavior when a Spot Instance is interrupted. The default is terminate
.
///
///
public InstanceInterruptionBehavior InstanceInterruptionBehavior
{
get { return this._instanceInterruptionBehavior; }
set { this._instanceInterruptionBehavior = value; }
}
// Check to see if InstanceInterruptionBehavior property is set
internal bool IsSetInstanceInterruptionBehavior()
{
return this._instanceInterruptionBehavior != null;
}
///
/// Gets and sets the property MaxPrice.
///
/// The maximum hourly price that you're willing to pay for a Spot Instance. We do not
/// recommend using this parameter because it can lead to increased interruptions. If
/// you do not specify this parameter, you will pay the current Spot price.
///
///
///
/// If you specify a maximum price, your Spot Instances will be interrupted more frequently
/// than if you do not specify this parameter.
///
///
///
public string MaxPrice
{
get { return this._maxPrice; }
set { this._maxPrice = value; }
}
// Check to see if MaxPrice property is set
internal bool IsSetMaxPrice()
{
return this._maxPrice != null;
}
///
/// Gets and sets the property SpotInstanceType.
///
/// The Spot Instance request type. For RunInstances,
/// persistent Spot Instance requests are only supported when the instance interruption
/// behavior is either hibernate
or stop
.
///
///
public SpotInstanceType SpotInstanceType
{
get { return this._spotInstanceType; }
set { this._spotInstanceType = value; }
}
// Check to see if SpotInstanceType property is set
internal bool IsSetSpotInstanceType()
{
return this._spotInstanceType != null;
}
///
/// Gets and sets the property ValidUntilUtc.
///
/// The end date of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ).
/// Supported only for persistent requests.
///
/// -
///
/// For a persistent request, the request remains active until the
ValidUntil
/// date and time is reached. Otherwise, the request remains active until you cancel it.
///
/// -
///
/// For a one-time request,
ValidUntil
is not supported. The request remains
/// active until all instances launch or you cancel the request.
///
///
///
public DateTime ValidUntilUtc
{
get { return this._validUntilUtc.GetValueOrDefault(); }
set { this._validUntil = this._validUntilUtc = value; }
}
// Check to see if ValidUntilUtc property is set
internal bool IsSetValidUntilUtc()
{
return this._validUntilUtc.HasValue;
}
#region Backwards compatible properties
private DateTime? _validUntil;
///
/// Gets and sets the property ValidUntilUtc.
///
/// This property is deprecated. Setting this property results in non-UTC DateTimes not
/// being marshalled correctly. Use ValidUntilUtc instead. Setting either ValidUntil or
/// ValidUntilUtc results in both ValidUntil and ValidUntilUtc being assigned, the latest
/// assignment to either one of the two property is reflected in the value of both. ValidUntil
/// is provided for backwards compatibility only and assigning a non-Utc DateTime to it
/// results in the wrong timestamp being passed to the service.
///
///
///
/// The end date of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ).
/// Supported only for persistent requests.
///
/// -
///
/// For a persistent request, the request remains active until the
ValidUntil
/// date and time is reached. Otherwise, the request remains active until you cancel it.
///
/// -
///
/// For a one-time request,
ValidUntil
is not supported. The request remains
/// active until all instances launch or you cancel the request.
///
///
///
[Obsolete("Setting this property results in non-UTC DateTimes not being marshalled correctly. " +
"Use ValidUntilUtc instead. Setting either ValidUntil or ValidUntilUtc results in both ValidUntil and " +
"ValidUntilUtc being assigned, the latest assignment to either one of the two property is " +
"reflected in the value of both. ValidUntil is provided for backwards compatibility only and " +
"assigning a non-Utc DateTime to it results in the wrong timestamp being passed to the service.", false)]
public DateTime ValidUntil
{
get { return this._validUntil.GetValueOrDefault(); }
set
{
this._validUntil = value;
this._validUntilUtc = new DateTime(value.Ticks, DateTimeKind.Utc);
}
}
#endregion
}
}