com.amazonaws.services.gamelift.model.EC2InstanceLimit Maven / Gradle / Ivy
Show all versions of aws-java-sdk-gamelift Show documentation
/*
* Copyright 2017-2022 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.
*/
package com.amazonaws.services.gamelift.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The GameLift service limits for an Amazon EC2 instance type and current utilization. GameLift allows Amazon Web
* Services accounts a maximum number of instances, per instance type, per Amazon Web Services Region or location, for
* use with GameLift. You can request an limit increase for your account by using the Service limits page in the
* GameLift console.
*
*
* Related actions
*
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class EC2InstanceLimit implements Serializable, Cloneable, StructuredPojo {
/**
*
* The name of an Amazon EC2 instance type. See Amazon Elastic
* Compute Cloud Instance Types for detailed descriptions.
*
*/
private String eC2InstanceType;
/**
*
* The number of instances for the specified type and location that are currently being used by the Amazon Web
* Services account.
*
*/
private Integer currentInstances;
/**
*
* The number of instances that is allowed for the specified instance type and location.
*
*/
private Integer instanceLimit;
/**
*
* An Amazon Web Services Region code, such as us-west-2
.
*
*/
private String location;
/**
*
* The name of an Amazon EC2 instance type. See Amazon Elastic
* Compute Cloud Instance Types for detailed descriptions.
*
*
* @param eC2InstanceType
* The name of an Amazon EC2 instance type. See Amazon
* Elastic Compute Cloud Instance Types for detailed descriptions.
* @see EC2InstanceType
*/
public void setEC2InstanceType(String eC2InstanceType) {
this.eC2InstanceType = eC2InstanceType;
}
/**
*
* The name of an Amazon EC2 instance type. See Amazon Elastic
* Compute Cloud Instance Types for detailed descriptions.
*
*
* @return The name of an Amazon EC2 instance type. See Amazon
* Elastic Compute Cloud Instance Types for detailed descriptions.
* @see EC2InstanceType
*/
public String getEC2InstanceType() {
return this.eC2InstanceType;
}
/**
*
* The name of an Amazon EC2 instance type. See Amazon Elastic
* Compute Cloud Instance Types for detailed descriptions.
*
*
* @param eC2InstanceType
* The name of an Amazon EC2 instance type. See Amazon
* Elastic Compute Cloud Instance Types for detailed descriptions.
* @return Returns a reference to this object so that method calls can be chained together.
* @see EC2InstanceType
*/
public EC2InstanceLimit withEC2InstanceType(String eC2InstanceType) {
setEC2InstanceType(eC2InstanceType);
return this;
}
/**
*
* The name of an Amazon EC2 instance type. See Amazon Elastic
* Compute Cloud Instance Types for detailed descriptions.
*
*
* @param eC2InstanceType
* The name of an Amazon EC2 instance type. See Amazon
* Elastic Compute Cloud Instance Types for detailed descriptions.
* @see EC2InstanceType
*/
public void setEC2InstanceType(EC2InstanceType eC2InstanceType) {
withEC2InstanceType(eC2InstanceType);
}
/**
*
* The name of an Amazon EC2 instance type. See Amazon Elastic
* Compute Cloud Instance Types for detailed descriptions.
*
*
* @param eC2InstanceType
* The name of an Amazon EC2 instance type. See Amazon
* Elastic Compute Cloud Instance Types for detailed descriptions.
* @return Returns a reference to this object so that method calls can be chained together.
* @see EC2InstanceType
*/
public EC2InstanceLimit withEC2InstanceType(EC2InstanceType eC2InstanceType) {
this.eC2InstanceType = eC2InstanceType.toString();
return this;
}
/**
*
* The number of instances for the specified type and location that are currently being used by the Amazon Web
* Services account.
*
*
* @param currentInstances
* The number of instances for the specified type and location that are currently being used by the Amazon
* Web Services account.
*/
public void setCurrentInstances(Integer currentInstances) {
this.currentInstances = currentInstances;
}
/**
*
* The number of instances for the specified type and location that are currently being used by the Amazon Web
* Services account.
*
*
* @return The number of instances for the specified type and location that are currently being used by the Amazon
* Web Services account.
*/
public Integer getCurrentInstances() {
return this.currentInstances;
}
/**
*
* The number of instances for the specified type and location that are currently being used by the Amazon Web
* Services account.
*
*
* @param currentInstances
* The number of instances for the specified type and location that are currently being used by the Amazon
* Web Services account.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EC2InstanceLimit withCurrentInstances(Integer currentInstances) {
setCurrentInstances(currentInstances);
return this;
}
/**
*
* The number of instances that is allowed for the specified instance type and location.
*
*
* @param instanceLimit
* The number of instances that is allowed for the specified instance type and location.
*/
public void setInstanceLimit(Integer instanceLimit) {
this.instanceLimit = instanceLimit;
}
/**
*
* The number of instances that is allowed for the specified instance type and location.
*
*
* @return The number of instances that is allowed for the specified instance type and location.
*/
public Integer getInstanceLimit() {
return this.instanceLimit;
}
/**
*
* The number of instances that is allowed for the specified instance type and location.
*
*
* @param instanceLimit
* The number of instances that is allowed for the specified instance type and location.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EC2InstanceLimit withInstanceLimit(Integer instanceLimit) {
setInstanceLimit(instanceLimit);
return this;
}
/**
*
* An Amazon Web Services Region code, such as us-west-2
.
*
*
* @param location
* An Amazon Web Services Region code, such as us-west-2
.
*/
public void setLocation(String location) {
this.location = location;
}
/**
*
* An Amazon Web Services Region code, such as us-west-2
.
*
*
* @return An Amazon Web Services Region code, such as us-west-2
.
*/
public String getLocation() {
return this.location;
}
/**
*
* An Amazon Web Services Region code, such as us-west-2
.
*
*
* @param location
* An Amazon Web Services Region code, such as us-west-2
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public EC2InstanceLimit withLocation(String location) {
setLocation(location);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getEC2InstanceType() != null)
sb.append("EC2InstanceType: ").append(getEC2InstanceType()).append(",");
if (getCurrentInstances() != null)
sb.append("CurrentInstances: ").append(getCurrentInstances()).append(",");
if (getInstanceLimit() != null)
sb.append("InstanceLimit: ").append(getInstanceLimit()).append(",");
if (getLocation() != null)
sb.append("Location: ").append(getLocation());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof EC2InstanceLimit == false)
return false;
EC2InstanceLimit other = (EC2InstanceLimit) obj;
if (other.getEC2InstanceType() == null ^ this.getEC2InstanceType() == null)
return false;
if (other.getEC2InstanceType() != null && other.getEC2InstanceType().equals(this.getEC2InstanceType()) == false)
return false;
if (other.getCurrentInstances() == null ^ this.getCurrentInstances() == null)
return false;
if (other.getCurrentInstances() != null && other.getCurrentInstances().equals(this.getCurrentInstances()) == false)
return false;
if (other.getInstanceLimit() == null ^ this.getInstanceLimit() == null)
return false;
if (other.getInstanceLimit() != null && other.getInstanceLimit().equals(this.getInstanceLimit()) == false)
return false;
if (other.getLocation() == null ^ this.getLocation() == null)
return false;
if (other.getLocation() != null && other.getLocation().equals(this.getLocation()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getEC2InstanceType() == null) ? 0 : getEC2InstanceType().hashCode());
hashCode = prime * hashCode + ((getCurrentInstances() == null) ? 0 : getCurrentInstances().hashCode());
hashCode = prime * hashCode + ((getInstanceLimit() == null) ? 0 : getInstanceLimit().hashCode());
hashCode = prime * hashCode + ((getLocation() == null) ? 0 : getLocation().hashCode());
return hashCode;
}
@Override
public EC2InstanceLimit clone() {
try {
return (EC2InstanceLimit) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.gamelift.model.transform.EC2InstanceLimitMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}