
com.amazonaws.services.cloudhsm.model.CreateHsmRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-cloudhsm Show documentation
/*
* Copyright 2010-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.cloudhsm.model;
import java.io.Serializable;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* Contains the inputs for the CreateHsm operation.
*
*/
public class CreateHsmRequest extends AmazonWebServiceRequest implements
Serializable, Cloneable {
/**
*
* The identifier of the subnet in your VPC in which to place the HSM.
*
*/
private String subnetId;
/**
*
* The SSH public key to install on the HSM.
*
*/
private String sshKey;
/**
*
* The IP address to assign to the HSM's ENI.
*
*
* If an IP address is not specified, an IP address will be randomly chosen
* from the CIDR range of the subnet.
*
*/
private String eniIp;
/**
*
* The ARN of an IAM role to enable the AWS CloudHSM service to allocate an
* ENI on your behalf.
*
*/
private String iamRoleArn;
/**
*
* The external ID from IamRoleArn, if present.
*
*/
private String externalId;
private String subscriptionType;
/**
*
* A user-defined token to ensure idempotence. Subsequent calls to this
* operation with the same token will be ignored.
*
*/
private String clientToken;
/**
*
* The IP address for the syslog monitoring server. The AWS CloudHSM service
* only supports one syslog monitoring server.
*
*/
private String syslogIp;
/**
*
* The identifier of the subnet in your VPC in which to place the HSM.
*
*
* @param subnetId
* The identifier of the subnet in your VPC in which to place the
* HSM.
*/
public void setSubnetId(String subnetId) {
this.subnetId = subnetId;
}
/**
*
* The identifier of the subnet in your VPC in which to place the HSM.
*
*
* @return The identifier of the subnet in your VPC in which to place the
* HSM.
*/
public String getSubnetId() {
return this.subnetId;
}
/**
*
* The identifier of the subnet in your VPC in which to place the HSM.
*
*
* @param subnetId
* The identifier of the subnet in your VPC in which to place the
* HSM.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public CreateHsmRequest withSubnetId(String subnetId) {
setSubnetId(subnetId);
return this;
}
/**
*
* The SSH public key to install on the HSM.
*
*
* @param sshKey
* The SSH public key to install on the HSM.
*/
public void setSshKey(String sshKey) {
this.sshKey = sshKey;
}
/**
*
* The SSH public key to install on the HSM.
*
*
* @return The SSH public key to install on the HSM.
*/
public String getSshKey() {
return this.sshKey;
}
/**
*
* The SSH public key to install on the HSM.
*
*
* @param sshKey
* The SSH public key to install on the HSM.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public CreateHsmRequest withSshKey(String sshKey) {
setSshKey(sshKey);
return this;
}
/**
*
* The IP address to assign to the HSM's ENI.
*
*
* If an IP address is not specified, an IP address will be randomly chosen
* from the CIDR range of the subnet.
*
*
* @param eniIp
* The IP address to assign to the HSM's ENI.
*
* If an IP address is not specified, an IP address will be randomly
* chosen from the CIDR range of the subnet.
*/
public void setEniIp(String eniIp) {
this.eniIp = eniIp;
}
/**
*
* The IP address to assign to the HSM's ENI.
*
*
* If an IP address is not specified, an IP address will be randomly chosen
* from the CIDR range of the subnet.
*
*
* @return The IP address to assign to the HSM's ENI.
*
* If an IP address is not specified, an IP address will be randomly
* chosen from the CIDR range of the subnet.
*/
public String getEniIp() {
return this.eniIp;
}
/**
*
* The IP address to assign to the HSM's ENI.
*
*
* If an IP address is not specified, an IP address will be randomly chosen
* from the CIDR range of the subnet.
*
*
* @param eniIp
* The IP address to assign to the HSM's ENI.
*
* If an IP address is not specified, an IP address will be randomly
* chosen from the CIDR range of the subnet.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public CreateHsmRequest withEniIp(String eniIp) {
setEniIp(eniIp);
return this;
}
/**
*
* The ARN of an IAM role to enable the AWS CloudHSM service to allocate an
* ENI on your behalf.
*
*
* @param iamRoleArn
* The ARN of an IAM role to enable the AWS CloudHSM service to
* allocate an ENI on your behalf.
*/
public void setIamRoleArn(String iamRoleArn) {
this.iamRoleArn = iamRoleArn;
}
/**
*
* The ARN of an IAM role to enable the AWS CloudHSM service to allocate an
* ENI on your behalf.
*
*
* @return The ARN of an IAM role to enable the AWS CloudHSM service to
* allocate an ENI on your behalf.
*/
public String getIamRoleArn() {
return this.iamRoleArn;
}
/**
*
* The ARN of an IAM role to enable the AWS CloudHSM service to allocate an
* ENI on your behalf.
*
*
* @param iamRoleArn
* The ARN of an IAM role to enable the AWS CloudHSM service to
* allocate an ENI on your behalf.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public CreateHsmRequest withIamRoleArn(String iamRoleArn) {
setIamRoleArn(iamRoleArn);
return this;
}
/**
*
* The external ID from IamRoleArn, if present.
*
*
* @param externalId
* The external ID from IamRoleArn, if present.
*/
public void setExternalId(String externalId) {
this.externalId = externalId;
}
/**
*
* The external ID from IamRoleArn, if present.
*
*
* @return The external ID from IamRoleArn, if present.
*/
public String getExternalId() {
return this.externalId;
}
/**
*
* The external ID from IamRoleArn, if present.
*
*
* @param externalId
* The external ID from IamRoleArn, if present.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public CreateHsmRequest withExternalId(String externalId) {
setExternalId(externalId);
return this;
}
/**
* @param subscriptionType
* @see SubscriptionType
*/
public void setSubscriptionType(String subscriptionType) {
this.subscriptionType = subscriptionType;
}
/**
* @return
* @see SubscriptionType
*/
public String getSubscriptionType() {
return this.subscriptionType;
}
/**
* @param subscriptionType
* @return Returns a reference to this object so that method calls can be
* chained together.
* @see SubscriptionType
*/
public CreateHsmRequest withSubscriptionType(String subscriptionType) {
setSubscriptionType(subscriptionType);
return this;
}
/**
* @param subscriptionType
* @see SubscriptionType
*/
public void setSubscriptionType(SubscriptionType subscriptionType) {
this.subscriptionType = subscriptionType.toString();
}
/**
* @param subscriptionType
* @return Returns a reference to this object so that method calls can be
* chained together.
* @see SubscriptionType
*/
public CreateHsmRequest withSubscriptionType(
SubscriptionType subscriptionType) {
setSubscriptionType(subscriptionType);
return this;
}
/**
*
* A user-defined token to ensure idempotence. Subsequent calls to this
* operation with the same token will be ignored.
*
*
* @param clientToken
* A user-defined token to ensure idempotence. Subsequent calls to
* this operation with the same token will be ignored.
*/
public void setClientToken(String clientToken) {
this.clientToken = clientToken;
}
/**
*
* A user-defined token to ensure idempotence. Subsequent calls to this
* operation with the same token will be ignored.
*
*
* @return A user-defined token to ensure idempotence. Subsequent calls to
* this operation with the same token will be ignored.
*/
public String getClientToken() {
return this.clientToken;
}
/**
*
* A user-defined token to ensure idempotence. Subsequent calls to this
* operation with the same token will be ignored.
*
*
* @param clientToken
* A user-defined token to ensure idempotence. Subsequent calls to
* this operation with the same token will be ignored.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public CreateHsmRequest withClientToken(String clientToken) {
setClientToken(clientToken);
return this;
}
/**
*
* The IP address for the syslog monitoring server. The AWS CloudHSM service
* only supports one syslog monitoring server.
*
*
* @param syslogIp
* The IP address for the syslog monitoring server. The AWS CloudHSM
* service only supports one syslog monitoring server.
*/
public void setSyslogIp(String syslogIp) {
this.syslogIp = syslogIp;
}
/**
*
* The IP address for the syslog monitoring server. The AWS CloudHSM service
* only supports one syslog monitoring server.
*
*
* @return The IP address for the syslog monitoring server. The AWS CloudHSM
* service only supports one syslog monitoring server.
*/
public String getSyslogIp() {
return this.syslogIp;
}
/**
*
* The IP address for the syslog monitoring server. The AWS CloudHSM service
* only supports one syslog monitoring server.
*
*
* @param syslogIp
* The IP address for the syslog monitoring server. The AWS CloudHSM
* service only supports one syslog monitoring server.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public CreateHsmRequest withSyslogIp(String syslogIp) {
setSyslogIp(syslogIp);
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 (getSubnetId() != null)
sb.append("SubnetId: " + getSubnetId() + ",");
if (getSshKey() != null)
sb.append("SshKey: " + getSshKey() + ",");
if (getEniIp() != null)
sb.append("EniIp: " + getEniIp() + ",");
if (getIamRoleArn() != null)
sb.append("IamRoleArn: " + getIamRoleArn() + ",");
if (getExternalId() != null)
sb.append("ExternalId: " + getExternalId() + ",");
if (getSubscriptionType() != null)
sb.append("SubscriptionType: " + getSubscriptionType() + ",");
if (getClientToken() != null)
sb.append("ClientToken: " + getClientToken() + ",");
if (getSyslogIp() != null)
sb.append("SyslogIp: " + getSyslogIp());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateHsmRequest == false)
return false;
CreateHsmRequest other = (CreateHsmRequest) obj;
if (other.getSubnetId() == null ^ this.getSubnetId() == null)
return false;
if (other.getSubnetId() != null
&& other.getSubnetId().equals(this.getSubnetId()) == false)
return false;
if (other.getSshKey() == null ^ this.getSshKey() == null)
return false;
if (other.getSshKey() != null
&& other.getSshKey().equals(this.getSshKey()) == false)
return false;
if (other.getEniIp() == null ^ this.getEniIp() == null)
return false;
if (other.getEniIp() != null
&& other.getEniIp().equals(this.getEniIp()) == false)
return false;
if (other.getIamRoleArn() == null ^ this.getIamRoleArn() == null)
return false;
if (other.getIamRoleArn() != null
&& other.getIamRoleArn().equals(this.getIamRoleArn()) == false)
return false;
if (other.getExternalId() == null ^ this.getExternalId() == null)
return false;
if (other.getExternalId() != null
&& other.getExternalId().equals(this.getExternalId()) == false)
return false;
if (other.getSubscriptionType() == null
^ this.getSubscriptionType() == null)
return false;
if (other.getSubscriptionType() != null
&& other.getSubscriptionType().equals(
this.getSubscriptionType()) == false)
return false;
if (other.getClientToken() == null ^ this.getClientToken() == null)
return false;
if (other.getClientToken() != null
&& other.getClientToken().equals(this.getClientToken()) == false)
return false;
if (other.getSyslogIp() == null ^ this.getSyslogIp() == null)
return false;
if (other.getSyslogIp() != null
&& other.getSyslogIp().equals(this.getSyslogIp()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode
+ ((getSubnetId() == null) ? 0 : getSubnetId().hashCode());
hashCode = prime * hashCode
+ ((getSshKey() == null) ? 0 : getSshKey().hashCode());
hashCode = prime * hashCode
+ ((getEniIp() == null) ? 0 : getEniIp().hashCode());
hashCode = prime * hashCode
+ ((getIamRoleArn() == null) ? 0 : getIamRoleArn().hashCode());
hashCode = prime * hashCode
+ ((getExternalId() == null) ? 0 : getExternalId().hashCode());
hashCode = prime
* hashCode
+ ((getSubscriptionType() == null) ? 0 : getSubscriptionType()
.hashCode());
hashCode = prime
* hashCode
+ ((getClientToken() == null) ? 0 : getClientToken().hashCode());
hashCode = prime * hashCode
+ ((getSyslogIp() == null) ? 0 : getSyslogIp().hashCode());
return hashCode;
}
@Override
public CreateHsmRequest clone() {
return (CreateHsmRequest) super.clone();
}
}