
com.amazonaws.services.simplesystemsmanagement.model.Activation Maven / Gradle / Ivy
/*
* Copyright 2011-2016 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.simplesystemsmanagement.model;
import java.io.Serializable;
/**
*
* An activation registers one or more on-premises servers or virtual machines (VMs) with AWS so that you can configure
* those servers or VMs using Run Command. A server or VM that has been registered with AWS is called a managed
* instance.
*
*/
public class Activation implements Serializable, Cloneable {
/**
*
* The ID created by SSM when you submitted the activation.
*
*/
private String activationId;
/**
*
* A user defined description of the activation.
*
*/
private String description;
/**
*
* A name for the managed instance when it is created.
*
*/
private String defaultInstanceName;
/**
*
* The Amazon Identity and Access Management (IAM) role to assign to the managed instance.
*
*/
private String iamRole;
/**
*
* The maximum number of managed instances that can be registered using this activation.
*
*/
private Integer registrationLimit;
/**
*
* The number of managed instances already registered with this activation.
*
*/
private Integer registrationsCount;
/**
*
* The date when this activation can no longer be used to register managed instances.
*
*/
private java.util.Date expirationDate;
/**
*
* Whether or not the activation is expired.
*
*/
private Boolean expired;
/**
*
* The date the activation was created.
*
*/
private java.util.Date createdDate;
/**
*
* The ID created by SSM when you submitted the activation.
*
*
* @param activationId
* The ID created by SSM when you submitted the activation.
*/
public void setActivationId(String activationId) {
this.activationId = activationId;
}
/**
*
* The ID created by SSM when you submitted the activation.
*
*
* @return The ID created by SSM when you submitted the activation.
*/
public String getActivationId() {
return this.activationId;
}
/**
*
* The ID created by SSM when you submitted the activation.
*
*
* @param activationId
* The ID created by SSM when you submitted the activation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Activation withActivationId(String activationId) {
setActivationId(activationId);
return this;
}
/**
*
* A user defined description of the activation.
*
*
* @param description
* A user defined description of the activation.
*/
public void setDescription(String description) {
this.description = description;
}
/**
*
* A user defined description of the activation.
*
*
* @return A user defined description of the activation.
*/
public String getDescription() {
return this.description;
}
/**
*
* A user defined description of the activation.
*
*
* @param description
* A user defined description of the activation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Activation withDescription(String description) {
setDescription(description);
return this;
}
/**
*
* A name for the managed instance when it is created.
*
*
* @param defaultInstanceName
* A name for the managed instance when it is created.
*/
public void setDefaultInstanceName(String defaultInstanceName) {
this.defaultInstanceName = defaultInstanceName;
}
/**
*
* A name for the managed instance when it is created.
*
*
* @return A name for the managed instance when it is created.
*/
public String getDefaultInstanceName() {
return this.defaultInstanceName;
}
/**
*
* A name for the managed instance when it is created.
*
*
* @param defaultInstanceName
* A name for the managed instance when it is created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Activation withDefaultInstanceName(String defaultInstanceName) {
setDefaultInstanceName(defaultInstanceName);
return this;
}
/**
*
* The Amazon Identity and Access Management (IAM) role to assign to the managed instance.
*
*
* @param iamRole
* The Amazon Identity and Access Management (IAM) role to assign to the managed instance.
*/
public void setIamRole(String iamRole) {
this.iamRole = iamRole;
}
/**
*
* The Amazon Identity and Access Management (IAM) role to assign to the managed instance.
*
*
* @return The Amazon Identity and Access Management (IAM) role to assign to the managed instance.
*/
public String getIamRole() {
return this.iamRole;
}
/**
*
* The Amazon Identity and Access Management (IAM) role to assign to the managed instance.
*
*
* @param iamRole
* The Amazon Identity and Access Management (IAM) role to assign to the managed instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Activation withIamRole(String iamRole) {
setIamRole(iamRole);
return this;
}
/**
*
* The maximum number of managed instances that can be registered using this activation.
*
*
* @param registrationLimit
* The maximum number of managed instances that can be registered using this activation.
*/
public void setRegistrationLimit(Integer registrationLimit) {
this.registrationLimit = registrationLimit;
}
/**
*
* The maximum number of managed instances that can be registered using this activation.
*
*
* @return The maximum number of managed instances that can be registered using this activation.
*/
public Integer getRegistrationLimit() {
return this.registrationLimit;
}
/**
*
* The maximum number of managed instances that can be registered using this activation.
*
*
* @param registrationLimit
* The maximum number of managed instances that can be registered using this activation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Activation withRegistrationLimit(Integer registrationLimit) {
setRegistrationLimit(registrationLimit);
return this;
}
/**
*
* The number of managed instances already registered with this activation.
*
*
* @param registrationsCount
* The number of managed instances already registered with this activation.
*/
public void setRegistrationsCount(Integer registrationsCount) {
this.registrationsCount = registrationsCount;
}
/**
*
* The number of managed instances already registered with this activation.
*
*
* @return The number of managed instances already registered with this activation.
*/
public Integer getRegistrationsCount() {
return this.registrationsCount;
}
/**
*
* The number of managed instances already registered with this activation.
*
*
* @param registrationsCount
* The number of managed instances already registered with this activation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Activation withRegistrationsCount(Integer registrationsCount) {
setRegistrationsCount(registrationsCount);
return this;
}
/**
*
* The date when this activation can no longer be used to register managed instances.
*
*
* @param expirationDate
* The date when this activation can no longer be used to register managed instances.
*/
public void setExpirationDate(java.util.Date expirationDate) {
this.expirationDate = expirationDate;
}
/**
*
* The date when this activation can no longer be used to register managed instances.
*
*
* @return The date when this activation can no longer be used to register managed instances.
*/
public java.util.Date getExpirationDate() {
return this.expirationDate;
}
/**
*
* The date when this activation can no longer be used to register managed instances.
*
*
* @param expirationDate
* The date when this activation can no longer be used to register managed instances.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Activation withExpirationDate(java.util.Date expirationDate) {
setExpirationDate(expirationDate);
return this;
}
/**
*
* Whether or not the activation is expired.
*
*
* @param expired
* Whether or not the activation is expired.
*/
public void setExpired(Boolean expired) {
this.expired = expired;
}
/**
*
* Whether or not the activation is expired.
*
*
* @return Whether or not the activation is expired.
*/
public Boolean getExpired() {
return this.expired;
}
/**
*
* Whether or not the activation is expired.
*
*
* @param expired
* Whether or not the activation is expired.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Activation withExpired(Boolean expired) {
setExpired(expired);
return this;
}
/**
*
* Whether or not the activation is expired.
*
*
* @return Whether or not the activation is expired.
*/
public Boolean isExpired() {
return this.expired;
}
/**
*
* The date the activation was created.
*
*
* @param createdDate
* The date the activation was created.
*/
public void setCreatedDate(java.util.Date createdDate) {
this.createdDate = createdDate;
}
/**
*
* The date the activation was created.
*
*
* @return The date the activation was created.
*/
public java.util.Date getCreatedDate() {
return this.createdDate;
}
/**
*
* The date the activation was created.
*
*
* @param createdDate
* The date the activation was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Activation withCreatedDate(java.util.Date createdDate) {
setCreatedDate(createdDate);
return this;
}
/**
* Returns a string representation of this object; useful for testing and debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getActivationId() != null)
sb.append("ActivationId: " + getActivationId() + ",");
if (getDescription() != null)
sb.append("Description: " + getDescription() + ",");
if (getDefaultInstanceName() != null)
sb.append("DefaultInstanceName: " + getDefaultInstanceName() + ",");
if (getIamRole() != null)
sb.append("IamRole: " + getIamRole() + ",");
if (getRegistrationLimit() != null)
sb.append("RegistrationLimit: " + getRegistrationLimit() + ",");
if (getRegistrationsCount() != null)
sb.append("RegistrationsCount: " + getRegistrationsCount() + ",");
if (getExpirationDate() != null)
sb.append("ExpirationDate: " + getExpirationDate() + ",");
if (getExpired() != null)
sb.append("Expired: " + getExpired() + ",");
if (getCreatedDate() != null)
sb.append("CreatedDate: " + getCreatedDate());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Activation == false)
return false;
Activation other = (Activation) obj;
if (other.getActivationId() == null ^ this.getActivationId() == null)
return false;
if (other.getActivationId() != null && other.getActivationId().equals(this.getActivationId()) == false)
return false;
if (other.getDescription() == null ^ this.getDescription() == null)
return false;
if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false)
return false;
if (other.getDefaultInstanceName() == null ^ this.getDefaultInstanceName() == null)
return false;
if (other.getDefaultInstanceName() != null && other.getDefaultInstanceName().equals(this.getDefaultInstanceName()) == false)
return false;
if (other.getIamRole() == null ^ this.getIamRole() == null)
return false;
if (other.getIamRole() != null && other.getIamRole().equals(this.getIamRole()) == false)
return false;
if (other.getRegistrationLimit() == null ^ this.getRegistrationLimit() == null)
return false;
if (other.getRegistrationLimit() != null && other.getRegistrationLimit().equals(this.getRegistrationLimit()) == false)
return false;
if (other.getRegistrationsCount() == null ^ this.getRegistrationsCount() == null)
return false;
if (other.getRegistrationsCount() != null && other.getRegistrationsCount().equals(this.getRegistrationsCount()) == false)
return false;
if (other.getExpirationDate() == null ^ this.getExpirationDate() == null)
return false;
if (other.getExpirationDate() != null && other.getExpirationDate().equals(this.getExpirationDate()) == false)
return false;
if (other.getExpired() == null ^ this.getExpired() == null)
return false;
if (other.getExpired() != null && other.getExpired().equals(this.getExpired()) == false)
return false;
if (other.getCreatedDate() == null ^ this.getCreatedDate() == null)
return false;
if (other.getCreatedDate() != null && other.getCreatedDate().equals(this.getCreatedDate()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getActivationId() == null) ? 0 : getActivationId().hashCode());
hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
hashCode = prime * hashCode + ((getDefaultInstanceName() == null) ? 0 : getDefaultInstanceName().hashCode());
hashCode = prime * hashCode + ((getIamRole() == null) ? 0 : getIamRole().hashCode());
hashCode = prime * hashCode + ((getRegistrationLimit() == null) ? 0 : getRegistrationLimit().hashCode());
hashCode = prime * hashCode + ((getRegistrationsCount() == null) ? 0 : getRegistrationsCount().hashCode());
hashCode = prime * hashCode + ((getExpirationDate() == null) ? 0 : getExpirationDate().hashCode());
hashCode = prime * hashCode + ((getExpired() == null) ? 0 : getExpired().hashCode());
hashCode = prime * hashCode + ((getCreatedDate() == null) ? 0 : getCreatedDate().hashCode());
return hashCode;
}
@Override
public Activation clone() {
try {
return (Activation) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}