com.amazonaws.services.servermigration.model.CreateReplicationJobRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-servermigration Show documentation
/*
* Copyright 2018-2023 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.servermigration.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateReplicationJobRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The ID of the server.
*
*/
private String serverId;
/**
*
* The seed replication time.
*
*/
private java.util.Date seedReplicationTime;
/**
*
* The time between consecutive replication runs, in hours.
*
*/
private Integer frequency;
/**
*
* Indicates whether to run the replication job one time.
*
*/
private Boolean runOnce;
/**
*
* The license type to be used for the AMI created by a successful replication run.
*
*/
private String licenseType;
/**
*
* The name of the IAM role to be used by the Server Migration Service.
*
*/
private String roleName;
/**
*
* The description of the replication job.
*
*/
private String description;
/**
*
* The maximum number of SMS-created AMIs to retain. The oldest is deleted after the maximum number is reached and a
* new AMI is created.
*
*/
private Integer numberOfRecentAmisToKeep;
/**
*
* Indicates whether the replication job produces encrypted AMIs.
*
*/
private Boolean encrypted;
/**
*
* The ID of the KMS key for replication jobs that produce encrypted AMIs. This value can be any of the following:
*
*
* -
*
* KMS key ID
*
*
* -
*
* KMS key alias
*
*
* -
*
* ARN referring to the KMS key ID
*
*
* -
*
* ARN referring to the KMS key alias
*
*
*
*
* If encrypted is true but a KMS key ID is not specified, the customer's default KMS key for Amazon EBS is
* used.
*
*/
private String kmsKeyId;
/**
*
* The ID of the server.
*
*
* @param serverId
* The ID of the server.
*/
public void setServerId(String serverId) {
this.serverId = serverId;
}
/**
*
* The ID of the server.
*
*
* @return The ID of the server.
*/
public String getServerId() {
return this.serverId;
}
/**
*
* The ID of the server.
*
*
* @param serverId
* The ID of the server.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateReplicationJobRequest withServerId(String serverId) {
setServerId(serverId);
return this;
}
/**
*
* The seed replication time.
*
*
* @param seedReplicationTime
* The seed replication time.
*/
public void setSeedReplicationTime(java.util.Date seedReplicationTime) {
this.seedReplicationTime = seedReplicationTime;
}
/**
*
* The seed replication time.
*
*
* @return The seed replication time.
*/
public java.util.Date getSeedReplicationTime() {
return this.seedReplicationTime;
}
/**
*
* The seed replication time.
*
*
* @param seedReplicationTime
* The seed replication time.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateReplicationJobRequest withSeedReplicationTime(java.util.Date seedReplicationTime) {
setSeedReplicationTime(seedReplicationTime);
return this;
}
/**
*
* The time between consecutive replication runs, in hours.
*
*
* @param frequency
* The time between consecutive replication runs, in hours.
*/
public void setFrequency(Integer frequency) {
this.frequency = frequency;
}
/**
*
* The time between consecutive replication runs, in hours.
*
*
* @return The time between consecutive replication runs, in hours.
*/
public Integer getFrequency() {
return this.frequency;
}
/**
*
* The time between consecutive replication runs, in hours.
*
*
* @param frequency
* The time between consecutive replication runs, in hours.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateReplicationJobRequest withFrequency(Integer frequency) {
setFrequency(frequency);
return this;
}
/**
*
* Indicates whether to run the replication job one time.
*
*
* @param runOnce
* Indicates whether to run the replication job one time.
*/
public void setRunOnce(Boolean runOnce) {
this.runOnce = runOnce;
}
/**
*
* Indicates whether to run the replication job one time.
*
*
* @return Indicates whether to run the replication job one time.
*/
public Boolean getRunOnce() {
return this.runOnce;
}
/**
*
* Indicates whether to run the replication job one time.
*
*
* @param runOnce
* Indicates whether to run the replication job one time.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateReplicationJobRequest withRunOnce(Boolean runOnce) {
setRunOnce(runOnce);
return this;
}
/**
*
* Indicates whether to run the replication job one time.
*
*
* @return Indicates whether to run the replication job one time.
*/
public Boolean isRunOnce() {
return this.runOnce;
}
/**
*
* The license type to be used for the AMI created by a successful replication run.
*
*
* @param licenseType
* The license type to be used for the AMI created by a successful replication run.
* @see LicenseType
*/
public void setLicenseType(String licenseType) {
this.licenseType = licenseType;
}
/**
*
* The license type to be used for the AMI created by a successful replication run.
*
*
* @return The license type to be used for the AMI created by a successful replication run.
* @see LicenseType
*/
public String getLicenseType() {
return this.licenseType;
}
/**
*
* The license type to be used for the AMI created by a successful replication run.
*
*
* @param licenseType
* The license type to be used for the AMI created by a successful replication run.
* @return Returns a reference to this object so that method calls can be chained together.
* @see LicenseType
*/
public CreateReplicationJobRequest withLicenseType(String licenseType) {
setLicenseType(licenseType);
return this;
}
/**
*
* The license type to be used for the AMI created by a successful replication run.
*
*
* @param licenseType
* The license type to be used for the AMI created by a successful replication run.
* @see LicenseType
*/
public void setLicenseType(LicenseType licenseType) {
withLicenseType(licenseType);
}
/**
*
* The license type to be used for the AMI created by a successful replication run.
*
*
* @param licenseType
* The license type to be used for the AMI created by a successful replication run.
* @return Returns a reference to this object so that method calls can be chained together.
* @see LicenseType
*/
public CreateReplicationJobRequest withLicenseType(LicenseType licenseType) {
this.licenseType = licenseType.toString();
return this;
}
/**
*
* The name of the IAM role to be used by the Server Migration Service.
*
*
* @param roleName
* The name of the IAM role to be used by the Server Migration Service.
*/
public void setRoleName(String roleName) {
this.roleName = roleName;
}
/**
*
* The name of the IAM role to be used by the Server Migration Service.
*
*
* @return The name of the IAM role to be used by the Server Migration Service.
*/
public String getRoleName() {
return this.roleName;
}
/**
*
* The name of the IAM role to be used by the Server Migration Service.
*
*
* @param roleName
* The name of the IAM role to be used by the Server Migration Service.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateReplicationJobRequest withRoleName(String roleName) {
setRoleName(roleName);
return this;
}
/**
*
* The description of the replication job.
*
*
* @param description
* The description of the replication job.
*/
public void setDescription(String description) {
this.description = description;
}
/**
*
* The description of the replication job.
*
*
* @return The description of the replication job.
*/
public String getDescription() {
return this.description;
}
/**
*
* The description of the replication job.
*
*
* @param description
* The description of the replication job.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateReplicationJobRequest withDescription(String description) {
setDescription(description);
return this;
}
/**
*
* The maximum number of SMS-created AMIs to retain. The oldest is deleted after the maximum number is reached and a
* new AMI is created.
*
*
* @param numberOfRecentAmisToKeep
* The maximum number of SMS-created AMIs to retain. The oldest is deleted after the maximum number is
* reached and a new AMI is created.
*/
public void setNumberOfRecentAmisToKeep(Integer numberOfRecentAmisToKeep) {
this.numberOfRecentAmisToKeep = numberOfRecentAmisToKeep;
}
/**
*
* The maximum number of SMS-created AMIs to retain. The oldest is deleted after the maximum number is reached and a
* new AMI is created.
*
*
* @return The maximum number of SMS-created AMIs to retain. The oldest is deleted after the maximum number is
* reached and a new AMI is created.
*/
public Integer getNumberOfRecentAmisToKeep() {
return this.numberOfRecentAmisToKeep;
}
/**
*
* The maximum number of SMS-created AMIs to retain. The oldest is deleted after the maximum number is reached and a
* new AMI is created.
*
*
* @param numberOfRecentAmisToKeep
* The maximum number of SMS-created AMIs to retain. The oldest is deleted after the maximum number is
* reached and a new AMI is created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateReplicationJobRequest withNumberOfRecentAmisToKeep(Integer numberOfRecentAmisToKeep) {
setNumberOfRecentAmisToKeep(numberOfRecentAmisToKeep);
return this;
}
/**
*
* Indicates whether the replication job produces encrypted AMIs.
*
*
* @param encrypted
* Indicates whether the replication job produces encrypted AMIs.
*/
public void setEncrypted(Boolean encrypted) {
this.encrypted = encrypted;
}
/**
*
* Indicates whether the replication job produces encrypted AMIs.
*
*
* @return Indicates whether the replication job produces encrypted AMIs.
*/
public Boolean getEncrypted() {
return this.encrypted;
}
/**
*
* Indicates whether the replication job produces encrypted AMIs.
*
*
* @param encrypted
* Indicates whether the replication job produces encrypted AMIs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateReplicationJobRequest withEncrypted(Boolean encrypted) {
setEncrypted(encrypted);
return this;
}
/**
*
* Indicates whether the replication job produces encrypted AMIs.
*
*
* @return Indicates whether the replication job produces encrypted AMIs.
*/
public Boolean isEncrypted() {
return this.encrypted;
}
/**
*
* The ID of the KMS key for replication jobs that produce encrypted AMIs. This value can be any of the following:
*
*
* -
*
* KMS key ID
*
*
* -
*
* KMS key alias
*
*
* -
*
* ARN referring to the KMS key ID
*
*
* -
*
* ARN referring to the KMS key alias
*
*
*
*
* If encrypted is true but a KMS key ID is not specified, the customer's default KMS key for Amazon EBS is
* used.
*
*
* @param kmsKeyId
* The ID of the KMS key for replication jobs that produce encrypted AMIs. This value can be any of the
* following:
*
* -
*
* KMS key ID
*
*
* -
*
* KMS key alias
*
*
* -
*
* ARN referring to the KMS key ID
*
*
* -
*
* ARN referring to the KMS key alias
*
*
*
*
* If encrypted is true but a KMS key ID is not specified, the customer's default KMS key for Amazon
* EBS is used.
*/
public void setKmsKeyId(String kmsKeyId) {
this.kmsKeyId = kmsKeyId;
}
/**
*
* The ID of the KMS key for replication jobs that produce encrypted AMIs. This value can be any of the following:
*
*
* -
*
* KMS key ID
*
*
* -
*
* KMS key alias
*
*
* -
*
* ARN referring to the KMS key ID
*
*
* -
*
* ARN referring to the KMS key alias
*
*
*
*
* If encrypted is true but a KMS key ID is not specified, the customer's default KMS key for Amazon EBS is
* used.
*
*
* @return The ID of the KMS key for replication jobs that produce encrypted AMIs. This value can be any of the
* following:
*
* -
*
* KMS key ID
*
*
* -
*
* KMS key alias
*
*
* -
*
* ARN referring to the KMS key ID
*
*
* -
*
* ARN referring to the KMS key alias
*
*
*
*
* If encrypted is true but a KMS key ID is not specified, the customer's default KMS key for Amazon
* EBS is used.
*/
public String getKmsKeyId() {
return this.kmsKeyId;
}
/**
*
* The ID of the KMS key for replication jobs that produce encrypted AMIs. This value can be any of the following:
*
*
* -
*
* KMS key ID
*
*
* -
*
* KMS key alias
*
*
* -
*
* ARN referring to the KMS key ID
*
*
* -
*
* ARN referring to the KMS key alias
*
*
*
*
* If encrypted is true but a KMS key ID is not specified, the customer's default KMS key for Amazon EBS is
* used.
*
*
* @param kmsKeyId
* The ID of the KMS key for replication jobs that produce encrypted AMIs. This value can be any of the
* following:
*
* -
*
* KMS key ID
*
*
* -
*
* KMS key alias
*
*
* -
*
* ARN referring to the KMS key ID
*
*
* -
*
* ARN referring to the KMS key alias
*
*
*
*
* If encrypted is true but a KMS key ID is not specified, the customer's default KMS key for Amazon
* EBS is used.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateReplicationJobRequest withKmsKeyId(String kmsKeyId) {
setKmsKeyId(kmsKeyId);
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 (getServerId() != null)
sb.append("ServerId: ").append(getServerId()).append(",");
if (getSeedReplicationTime() != null)
sb.append("SeedReplicationTime: ").append(getSeedReplicationTime()).append(",");
if (getFrequency() != null)
sb.append("Frequency: ").append(getFrequency()).append(",");
if (getRunOnce() != null)
sb.append("RunOnce: ").append(getRunOnce()).append(",");
if (getLicenseType() != null)
sb.append("LicenseType: ").append(getLicenseType()).append(",");
if (getRoleName() != null)
sb.append("RoleName: ").append(getRoleName()).append(",");
if (getDescription() != null)
sb.append("Description: ").append(getDescription()).append(",");
if (getNumberOfRecentAmisToKeep() != null)
sb.append("NumberOfRecentAmisToKeep: ").append(getNumberOfRecentAmisToKeep()).append(",");
if (getEncrypted() != null)
sb.append("Encrypted: ").append(getEncrypted()).append(",");
if (getKmsKeyId() != null)
sb.append("KmsKeyId: ").append(getKmsKeyId());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateReplicationJobRequest == false)
return false;
CreateReplicationJobRequest other = (CreateReplicationJobRequest) obj;
if (other.getServerId() == null ^ this.getServerId() == null)
return false;
if (other.getServerId() != null && other.getServerId().equals(this.getServerId()) == false)
return false;
if (other.getSeedReplicationTime() == null ^ this.getSeedReplicationTime() == null)
return false;
if (other.getSeedReplicationTime() != null && other.getSeedReplicationTime().equals(this.getSeedReplicationTime()) == false)
return false;
if (other.getFrequency() == null ^ this.getFrequency() == null)
return false;
if (other.getFrequency() != null && other.getFrequency().equals(this.getFrequency()) == false)
return false;
if (other.getRunOnce() == null ^ this.getRunOnce() == null)
return false;
if (other.getRunOnce() != null && other.getRunOnce().equals(this.getRunOnce()) == false)
return false;
if (other.getLicenseType() == null ^ this.getLicenseType() == null)
return false;
if (other.getLicenseType() != null && other.getLicenseType().equals(this.getLicenseType()) == false)
return false;
if (other.getRoleName() == null ^ this.getRoleName() == null)
return false;
if (other.getRoleName() != null && other.getRoleName().equals(this.getRoleName()) == 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.getNumberOfRecentAmisToKeep() == null ^ this.getNumberOfRecentAmisToKeep() == null)
return false;
if (other.getNumberOfRecentAmisToKeep() != null && other.getNumberOfRecentAmisToKeep().equals(this.getNumberOfRecentAmisToKeep()) == false)
return false;
if (other.getEncrypted() == null ^ this.getEncrypted() == null)
return false;
if (other.getEncrypted() != null && other.getEncrypted().equals(this.getEncrypted()) == false)
return false;
if (other.getKmsKeyId() == null ^ this.getKmsKeyId() == null)
return false;
if (other.getKmsKeyId() != null && other.getKmsKeyId().equals(this.getKmsKeyId()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getServerId() == null) ? 0 : getServerId().hashCode());
hashCode = prime * hashCode + ((getSeedReplicationTime() == null) ? 0 : getSeedReplicationTime().hashCode());
hashCode = prime * hashCode + ((getFrequency() == null) ? 0 : getFrequency().hashCode());
hashCode = prime * hashCode + ((getRunOnce() == null) ? 0 : getRunOnce().hashCode());
hashCode = prime * hashCode + ((getLicenseType() == null) ? 0 : getLicenseType().hashCode());
hashCode = prime * hashCode + ((getRoleName() == null) ? 0 : getRoleName().hashCode());
hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
hashCode = prime * hashCode + ((getNumberOfRecentAmisToKeep() == null) ? 0 : getNumberOfRecentAmisToKeep().hashCode());
hashCode = prime * hashCode + ((getEncrypted() == null) ? 0 : getEncrypted().hashCode());
hashCode = prime * hashCode + ((getKmsKeyId() == null) ? 0 : getKmsKeyId().hashCode());
return hashCode;
}
@Override
public CreateReplicationJobRequest clone() {
return (CreateReplicationJobRequest) super.clone();
}
}