com.aliyun.sdk.service.ecs20140526.models.PurchaseReservedInstancesOfferingRequest Maven / Gradle / Ivy
Show all versions of alibabacloud-ecs20140526 Show documentation
// This file is auto-generated, don't edit it. Thanks.
package com.aliyun.sdk.service.ecs20140526.models;
import com.aliyun.sdk.gateway.pop.*;
import darabonba.core.*;
import darabonba.core.async.*;
import darabonba.core.sync.*;
import darabonba.core.client.*;
import darabonba.core.RequestModel;
import darabonba.core.TeaModel;
import com.aliyun.sdk.gateway.pop.models.*;
/**
*
* {@link PurchaseReservedInstancesOfferingRequest} extends {@link RequestModel}
*
* PurchaseReservedInstancesOfferingRequest
*/
public class PurchaseReservedInstancesOfferingRequest extends Request {
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("AutoRenew")
private Boolean autoRenew;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("AutoRenewPeriod")
private Integer autoRenewPeriod;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("ClientToken")
private String clientToken;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("Description")
private String description;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("InstanceAmount")
@com.aliyun.core.annotation.Validation(maximum = 100, minimum = 1)
private Integer instanceAmount;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("InstanceType")
@com.aliyun.core.annotation.Validation(required = true)
private String instanceType;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("OfferingType")
private String offeringType;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("OwnerAccount")
private String ownerAccount;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("OwnerId")
private Long ownerId;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("Period")
private Integer period;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("PeriodUnit")
private String periodUnit;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("Platform")
private String platform;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("RegionId")
@com.aliyun.core.annotation.Validation(required = true)
private String regionId;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("ReservedInstanceName")
private String reservedInstanceName;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("ResourceGroupId")
private String resourceGroupId;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("ResourceOwnerAccount")
private String resourceOwnerAccount;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("ResourceOwnerId")
private Long resourceOwnerId;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("Scope")
private String scope;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("StartTime")
private String startTime;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("Tag")
private java.util.List tag;
@com.aliyun.core.annotation.Query
@com.aliyun.core.annotation.NameInMap("ZoneId")
private String zoneId;
private PurchaseReservedInstancesOfferingRequest(Builder builder) {
super(builder);
this.autoRenew = builder.autoRenew;
this.autoRenewPeriod = builder.autoRenewPeriod;
this.clientToken = builder.clientToken;
this.description = builder.description;
this.instanceAmount = builder.instanceAmount;
this.instanceType = builder.instanceType;
this.offeringType = builder.offeringType;
this.ownerAccount = builder.ownerAccount;
this.ownerId = builder.ownerId;
this.period = builder.period;
this.periodUnit = builder.periodUnit;
this.platform = builder.platform;
this.regionId = builder.regionId;
this.reservedInstanceName = builder.reservedInstanceName;
this.resourceGroupId = builder.resourceGroupId;
this.resourceOwnerAccount = builder.resourceOwnerAccount;
this.resourceOwnerId = builder.resourceOwnerId;
this.scope = builder.scope;
this.startTime = builder.startTime;
this.tag = builder.tag;
this.zoneId = builder.zoneId;
}
public static Builder builder() {
return new Builder();
}
public static PurchaseReservedInstancesOfferingRequest create() {
return builder().build();
}
@Override
public Builder toBuilder() {
return new Builder(this);
}
/**
* @return autoRenew
*/
public Boolean getAutoRenew() {
return this.autoRenew;
}
/**
* @return autoRenewPeriod
*/
public Integer getAutoRenewPeriod() {
return this.autoRenewPeriod;
}
/**
* @return clientToken
*/
public String getClientToken() {
return this.clientToken;
}
/**
* @return description
*/
public String getDescription() {
return this.description;
}
/**
* @return instanceAmount
*/
public Integer getInstanceAmount() {
return this.instanceAmount;
}
/**
* @return instanceType
*/
public String getInstanceType() {
return this.instanceType;
}
/**
* @return offeringType
*/
public String getOfferingType() {
return this.offeringType;
}
/**
* @return ownerAccount
*/
public String getOwnerAccount() {
return this.ownerAccount;
}
/**
* @return ownerId
*/
public Long getOwnerId() {
return this.ownerId;
}
/**
* @return period
*/
public Integer getPeriod() {
return this.period;
}
/**
* @return periodUnit
*/
public String getPeriodUnit() {
return this.periodUnit;
}
/**
* @return platform
*/
public String getPlatform() {
return this.platform;
}
/**
* @return regionId
*/
public String getRegionId() {
return this.regionId;
}
/**
* @return reservedInstanceName
*/
public String getReservedInstanceName() {
return this.reservedInstanceName;
}
/**
* @return resourceGroupId
*/
public String getResourceGroupId() {
return this.resourceGroupId;
}
/**
* @return resourceOwnerAccount
*/
public String getResourceOwnerAccount() {
return this.resourceOwnerAccount;
}
/**
* @return resourceOwnerId
*/
public Long getResourceOwnerId() {
return this.resourceOwnerId;
}
/**
* @return scope
*/
public String getScope() {
return this.scope;
}
/**
* @return startTime
*/
public String getStartTime() {
return this.startTime;
}
/**
* @return tag
*/
public java.util.List getTag() {
return this.tag;
}
/**
* @return zoneId
*/
public String getZoneId() {
return this.zoneId;
}
public static final class Builder extends Request.Builder {
private Boolean autoRenew;
private Integer autoRenewPeriod;
private String clientToken;
private String description;
private Integer instanceAmount;
private String instanceType;
private String offeringType;
private String ownerAccount;
private Long ownerId;
private Integer period;
private String periodUnit;
private String platform;
private String regionId;
private String reservedInstanceName;
private String resourceGroupId;
private String resourceOwnerAccount;
private Long resourceOwnerId;
private String scope;
private String startTime;
private java.util.List tag;
private String zoneId;
private Builder() {
super();
}
private Builder(PurchaseReservedInstancesOfferingRequest request) {
super(request);
this.autoRenew = request.autoRenew;
this.autoRenewPeriod = request.autoRenewPeriod;
this.clientToken = request.clientToken;
this.description = request.description;
this.instanceAmount = request.instanceAmount;
this.instanceType = request.instanceType;
this.offeringType = request.offeringType;
this.ownerAccount = request.ownerAccount;
this.ownerId = request.ownerId;
this.period = request.period;
this.periodUnit = request.periodUnit;
this.platform = request.platform;
this.regionId = request.regionId;
this.reservedInstanceName = request.reservedInstanceName;
this.resourceGroupId = request.resourceGroupId;
this.resourceOwnerAccount = request.resourceOwnerAccount;
this.resourceOwnerId = request.resourceOwnerId;
this.scope = request.scope;
this.startTime = request.startTime;
this.tag = request.tag;
this.zoneId = request.zoneId;
}
/**
* Specifies whether to enable auto-renewal for the reserved instance. Valid values:
*
* - true
* - false (default)
*
*
* example:
* true
*/
public Builder autoRenew(Boolean autoRenew) {
this.putQueryParameter("AutoRenew", autoRenew);
this.autoRenew = autoRenew;
return this;
}
/**
* The auto-renewal term of the reserved instance. Unit: months. This parameter takes effect only when AutoRenew is set to true.
* Valid values: 12 and 36.
* Default value when PeriodUnit is set to Year: 12.
*
* example:
* 1
*/
public Builder autoRenewPeriod(Integer autoRenewPeriod) {
this.putQueryParameter("AutoRenewPeriod", autoRenewPeriod);
this.autoRenewPeriod = autoRenewPeriod;
return this;
}
/**
* The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The ClientToken value can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence.
*
* example:
* 123e4567-e89b-12d3-a456-426655440000
*/
public Builder clientToken(String clientToken) {
this.putQueryParameter("ClientToken", clientToken);
this.clientToken = clientToken;
return this;
}
/**
* The description of the reserved instance. The description can be 2 to 256 characters in length and cannot start with http:// or https://.
* This parameter is left empty by default.
*
* example:
* testDescription
*/
public Builder description(String description) {
this.putQueryParameter("Description", description);
this.description = description;
return this;
}
/**
* The number of pay-as-you-go instances of the same instance type that the reserved instance can match. Valid values: 1 to 50.
* Default value: 1.
*
* example:
* 3
*/
public Builder instanceAmount(Integer instanceAmount) {
this.putQueryParameter("InstanceAmount", instanceAmount);
this.instanceAmount = instanceAmount;
return this;
}
/**
* The instance type that the reserved instance can match.
*
* The instance types that support reserved instances are subject to updates. For more information, see Reserved instance overview.
*
* This parameter is required.
*
* example:
* ecs.g5.large
*/
public Builder instanceType(String instanceType) {
this.putQueryParameter("InstanceType", instanceType);
this.instanceType = instanceType;
return this;
}
/**
* The payment option of the reserved instance. Valid values:
*
* - No Upfront
* - Partial Upfront
* - All Upfront
*
* Default value: All Upfront.
*
* example:
* All Upfront
*/
public Builder offeringType(String offeringType) {
this.putQueryParameter("OfferingType", offeringType);
this.offeringType = offeringType;
return this;
}
/**
* OwnerAccount.
*/
public Builder ownerAccount(String ownerAccount) {
this.putQueryParameter("OwnerAccount", ownerAccount);
this.ownerAccount = ownerAccount;
return this;
}
/**
* OwnerId.
*/
public Builder ownerId(Long ownerId) {
this.putQueryParameter("OwnerId", ownerId);
this.ownerId = ownerId;
return this;
}
/**
* The validity period of the reserved instance.
* Valid values: 1 and 3.
* Default value: 1.
*
* example:
* 1
*/
public Builder period(Integer period) {
this.putQueryParameter("Period", period);
this.period = period;
return this;
}
/**
* The unit of the validity period of the reserved instance.
* Valid value: Year.
* Default value: Year.
*
* example:
* Year
*/
public Builder periodUnit(String periodUnit) {
this.putQueryParameter("PeriodUnit", periodUnit);
this.periodUnit = periodUnit;
return this;
}
/**
* The operating system of the image used by the instance. Valid values:
*
* - Windows: Windows Server operating system
* - Linux: Linux and UNIX-like operating system
*
* Default value: Linux.
*
* example:
* Linux
*/
public Builder platform(String platform) {
this.putQueryParameter("Platform", platform);
this.platform = platform;
return this;
}
/**
* The region ID of the instance. You can call the DescribeRegions operation to query the most recent region list.
* This parameter is required.
*
* example:
* cn-hangzhou
*/
public Builder regionId(String regionId) {
this.putQueryParameter("RegionId", regionId);
this.regionId = regionId;
return this;
}
/**
* The name of the reserved instance. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with http:// or https://. The name can contain letters, digits, colons (:), underscores (_), and hyphens (-).
*
* example:
* testReservedInstanceName
*/
public Builder reservedInstanceName(String reservedInstanceName) {
this.putQueryParameter("ReservedInstanceName", reservedInstanceName);
this.reservedInstanceName = reservedInstanceName;
return this;
}
/**
* The ID of the resource group.
*
* example:
* rg-bp199lyny9b3****
*/
public Builder resourceGroupId(String resourceGroupId) {
this.putQueryParameter("ResourceGroupId", resourceGroupId);
this.resourceGroupId = resourceGroupId;
return this;
}
/**
* ResourceOwnerAccount.
*/
public Builder resourceOwnerAccount(String resourceOwnerAccount) {
this.putQueryParameter("ResourceOwnerAccount", resourceOwnerAccount);
this.resourceOwnerAccount = resourceOwnerAccount;
return this;
}
/**
* ResourceOwnerId.
*/
public Builder resourceOwnerId(Long resourceOwnerId) {
this.putQueryParameter("ResourceOwnerId", resourceOwnerId);
this.resourceOwnerId = resourceOwnerId;
return this;
}
/**
* The scope of reserved instance N. Valid values:
*
* - Region: regional
* - Zone: zonal
*
* Default value: Region.
*
* example:
* Zone
*/
public Builder scope(String scope) {
this.putQueryParameter("Scope", scope);
this.scope = scope;
return this;
}
/**
* The time when the reserved instance takes effect. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHHZ
format. The time must be in UTC.
*
* If you do not specify this parameter, the reserved instance takes effect starting on the hour when the reserved instance is purchased. For example, if you purchased a reserved instance at 13:45:35 on November 1, 2024, the instance took effect starting 13:00:00 on November 1, 2024.
*
*
* example:
* 2024-07-04T15Z
*/
public Builder startTime(String startTime) {
this.putQueryParameter("StartTime", startTime);
this.startTime = startTime;
return this;
}
/**
* The tags to add to the reserved instance. You can add up to 20 tags.
*/
public Builder tag(java.util.List tag) {
this.putQueryParameter("Tag", tag);
this.tag = tag;
return this;
}
/**
* The ID of the zone in which to purchase the reserved instance. This parameter is required when Scope
is set to Zone
. You can call the DescribeZones operation to query the most recent zone list.
*
* example:
* cn-hangzhou-g
*/
public Builder zoneId(String zoneId) {
this.putQueryParameter("ZoneId", zoneId);
this.zoneId = zoneId;
return this;
}
@Override
public PurchaseReservedInstancesOfferingRequest build() {
return new PurchaseReservedInstancesOfferingRequest(this);
}
}
/**
*
* {@link PurchaseReservedInstancesOfferingRequest} extends {@link TeaModel}
*
* PurchaseReservedInstancesOfferingRequest
*/
public static class Tag extends TeaModel {
@com.aliyun.core.annotation.NameInMap("Key")
private String key;
@com.aliyun.core.annotation.NameInMap("Value")
private String value;
private Tag(Builder builder) {
this.key = builder.key;
this.value = builder.value;
}
public static Builder builder() {
return new Builder();
}
public static Tag create() {
return builder().build();
}
/**
* @return key
*/
public String getKey() {
return this.key;
}
/**
* @return value
*/
public String getValue() {
return this.value;
}
public static final class Builder {
private String key;
private String value;
/**
* The tag key to add to the reserved instance. The tag key cannot be an empty string. The tag key can be up to 128 characters in length and cannot contain http://
or https://
. The tag key cannot start with acs:
or aliyun
.
*
* example:
* TestKey
*/
public Builder key(String key) {
this.key = key;
return this;
}
/**
* The tag value to add to the reserved instance. The tag value cannot be an empty string. The tag value can be up to 128 characters in length and cannot contain http://
or https://
. The tag value cannot start with acs:
or aliyun
.
*
* example:
* TestValue
*/
public Builder value(String value) {
this.value = value;
return this;
}
public Tag build() {
return new Tag(this);
}
}
}
}