com.amazonaws.services.datasync.model.CreateLocationObjectStorageRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-datasync 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.datasync.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* CreateLocationObjectStorageRequest
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateLocationObjectStorageRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* Specifies the domain name or IP address of the object storage server. A DataSync agent uses this hostname to
* mount the object storage server in a network.
*
*/
private String serverHostname;
/**
*
* Specifies the port that your object storage server accepts inbound network traffic on (for example, port 443).
*
*/
private Integer serverPort;
/**
*
* Specifies the protocol that your object storage server uses to communicate.
*
*/
private String serverProtocol;
/**
*
* Specifies the object prefix for your object storage server. If this is a source location, DataSync only copies
* objects with this prefix. If this is a destination location, DataSync writes all objects with this prefix.
*
*/
private String subdirectory;
/**
*
* Specifies the name of the object storage bucket involved in the transfer.
*
*/
private String bucketName;
/**
*
* Specifies the access key (for example, a user name) if credentials are required to authenticate with the object
* storage server.
*
*/
private String accessKey;
/**
*
* Specifies the secret key (for example, a password) if credentials are required to authenticate with the object
* storage server.
*
*/
private String secretKey;
/**
*
* Specifies the Amazon Resource Names (ARNs) of the DataSync agents that can securely connect with your location.
*
*/
private java.util.List agentArns;
/**
*
* Specifies the key-value pair that represents a tag that you want to add to the resource. Tags can help you
* manage, filter, and search for your resources. We recommend creating a name tag for your location.
*
*/
private java.util.List tags;
/**
*
* Specifies the domain name or IP address of the object storage server. A DataSync agent uses this hostname to
* mount the object storage server in a network.
*
*
* @param serverHostname
* Specifies the domain name or IP address of the object storage server. A DataSync agent uses this hostname
* to mount the object storage server in a network.
*/
public void setServerHostname(String serverHostname) {
this.serverHostname = serverHostname;
}
/**
*
* Specifies the domain name or IP address of the object storage server. A DataSync agent uses this hostname to
* mount the object storage server in a network.
*
*
* @return Specifies the domain name or IP address of the object storage server. A DataSync agent uses this hostname
* to mount the object storage server in a network.
*/
public String getServerHostname() {
return this.serverHostname;
}
/**
*
* Specifies the domain name or IP address of the object storage server. A DataSync agent uses this hostname to
* mount the object storage server in a network.
*
*
* @param serverHostname
* Specifies the domain name or IP address of the object storage server. A DataSync agent uses this hostname
* to mount the object storage server in a network.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateLocationObjectStorageRequest withServerHostname(String serverHostname) {
setServerHostname(serverHostname);
return this;
}
/**
*
* Specifies the port that your object storage server accepts inbound network traffic on (for example, port 443).
*
*
* @param serverPort
* Specifies the port that your object storage server accepts inbound network traffic on (for example, port
* 443).
*/
public void setServerPort(Integer serverPort) {
this.serverPort = serverPort;
}
/**
*
* Specifies the port that your object storage server accepts inbound network traffic on (for example, port 443).
*
*
* @return Specifies the port that your object storage server accepts inbound network traffic on (for example, port
* 443).
*/
public Integer getServerPort() {
return this.serverPort;
}
/**
*
* Specifies the port that your object storage server accepts inbound network traffic on (for example, port 443).
*
*
* @param serverPort
* Specifies the port that your object storage server accepts inbound network traffic on (for example, port
* 443).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateLocationObjectStorageRequest withServerPort(Integer serverPort) {
setServerPort(serverPort);
return this;
}
/**
*
* Specifies the protocol that your object storage server uses to communicate.
*
*
* @param serverProtocol
* Specifies the protocol that your object storage server uses to communicate.
* @see ObjectStorageServerProtocol
*/
public void setServerProtocol(String serverProtocol) {
this.serverProtocol = serverProtocol;
}
/**
*
* Specifies the protocol that your object storage server uses to communicate.
*
*
* @return Specifies the protocol that your object storage server uses to communicate.
* @see ObjectStorageServerProtocol
*/
public String getServerProtocol() {
return this.serverProtocol;
}
/**
*
* Specifies the protocol that your object storage server uses to communicate.
*
*
* @param serverProtocol
* Specifies the protocol that your object storage server uses to communicate.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ObjectStorageServerProtocol
*/
public CreateLocationObjectStorageRequest withServerProtocol(String serverProtocol) {
setServerProtocol(serverProtocol);
return this;
}
/**
*
* Specifies the protocol that your object storage server uses to communicate.
*
*
* @param serverProtocol
* Specifies the protocol that your object storage server uses to communicate.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ObjectStorageServerProtocol
*/
public CreateLocationObjectStorageRequest withServerProtocol(ObjectStorageServerProtocol serverProtocol) {
this.serverProtocol = serverProtocol.toString();
return this;
}
/**
*
* Specifies the object prefix for your object storage server. If this is a source location, DataSync only copies
* objects with this prefix. If this is a destination location, DataSync writes all objects with this prefix.
*
*
* @param subdirectory
* Specifies the object prefix for your object storage server. If this is a source location, DataSync only
* copies objects with this prefix. If this is a destination location, DataSync writes all objects with this
* prefix.
*/
public void setSubdirectory(String subdirectory) {
this.subdirectory = subdirectory;
}
/**
*
* Specifies the object prefix for your object storage server. If this is a source location, DataSync only copies
* objects with this prefix. If this is a destination location, DataSync writes all objects with this prefix.
*
*
* @return Specifies the object prefix for your object storage server. If this is a source location, DataSync only
* copies objects with this prefix. If this is a destination location, DataSync writes all objects with this
* prefix.
*/
public String getSubdirectory() {
return this.subdirectory;
}
/**
*
* Specifies the object prefix for your object storage server. If this is a source location, DataSync only copies
* objects with this prefix. If this is a destination location, DataSync writes all objects with this prefix.
*
*
* @param subdirectory
* Specifies the object prefix for your object storage server. If this is a source location, DataSync only
* copies objects with this prefix. If this is a destination location, DataSync writes all objects with this
* prefix.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateLocationObjectStorageRequest withSubdirectory(String subdirectory) {
setSubdirectory(subdirectory);
return this;
}
/**
*
* Specifies the name of the object storage bucket involved in the transfer.
*
*
* @param bucketName
* Specifies the name of the object storage bucket involved in the transfer.
*/
public void setBucketName(String bucketName) {
this.bucketName = bucketName;
}
/**
*
* Specifies the name of the object storage bucket involved in the transfer.
*
*
* @return Specifies the name of the object storage bucket involved in the transfer.
*/
public String getBucketName() {
return this.bucketName;
}
/**
*
* Specifies the name of the object storage bucket involved in the transfer.
*
*
* @param bucketName
* Specifies the name of the object storage bucket involved in the transfer.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateLocationObjectStorageRequest withBucketName(String bucketName) {
setBucketName(bucketName);
return this;
}
/**
*
* Specifies the access key (for example, a user name) if credentials are required to authenticate with the object
* storage server.
*
*
* @param accessKey
* Specifies the access key (for example, a user name) if credentials are required to authenticate with the
* object storage server.
*/
public void setAccessKey(String accessKey) {
this.accessKey = accessKey;
}
/**
*
* Specifies the access key (for example, a user name) if credentials are required to authenticate with the object
* storage server.
*
*
* @return Specifies the access key (for example, a user name) if credentials are required to authenticate with the
* object storage server.
*/
public String getAccessKey() {
return this.accessKey;
}
/**
*
* Specifies the access key (for example, a user name) if credentials are required to authenticate with the object
* storage server.
*
*
* @param accessKey
* Specifies the access key (for example, a user name) if credentials are required to authenticate with the
* object storage server.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateLocationObjectStorageRequest withAccessKey(String accessKey) {
setAccessKey(accessKey);
return this;
}
/**
*
* Specifies the secret key (for example, a password) if credentials are required to authenticate with the object
* storage server.
*
*
* @param secretKey
* Specifies the secret key (for example, a password) if credentials are required to authenticate with the
* object storage server.
*/
public void setSecretKey(String secretKey) {
this.secretKey = secretKey;
}
/**
*
* Specifies the secret key (for example, a password) if credentials are required to authenticate with the object
* storage server.
*
*
* @return Specifies the secret key (for example, a password) if credentials are required to authenticate with the
* object storage server.
*/
public String getSecretKey() {
return this.secretKey;
}
/**
*
* Specifies the secret key (for example, a password) if credentials are required to authenticate with the object
* storage server.
*
*
* @param secretKey
* Specifies the secret key (for example, a password) if credentials are required to authenticate with the
* object storage server.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateLocationObjectStorageRequest withSecretKey(String secretKey) {
setSecretKey(secretKey);
return this;
}
/**
*
* Specifies the Amazon Resource Names (ARNs) of the DataSync agents that can securely connect with your location.
*
*
* @return Specifies the Amazon Resource Names (ARNs) of the DataSync agents that can securely connect with your
* location.
*/
public java.util.List getAgentArns() {
return agentArns;
}
/**
*
* Specifies the Amazon Resource Names (ARNs) of the DataSync agents that can securely connect with your location.
*
*
* @param agentArns
* Specifies the Amazon Resource Names (ARNs) of the DataSync agents that can securely connect with your
* location.
*/
public void setAgentArns(java.util.Collection agentArns) {
if (agentArns == null) {
this.agentArns = null;
return;
}
this.agentArns = new java.util.ArrayList(agentArns);
}
/**
*
* Specifies the Amazon Resource Names (ARNs) of the DataSync agents that can securely connect with your location.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setAgentArns(java.util.Collection)} or {@link #withAgentArns(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param agentArns
* Specifies the Amazon Resource Names (ARNs) of the DataSync agents that can securely connect with your
* location.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateLocationObjectStorageRequest withAgentArns(String... agentArns) {
if (this.agentArns == null) {
setAgentArns(new java.util.ArrayList(agentArns.length));
}
for (String ele : agentArns) {
this.agentArns.add(ele);
}
return this;
}
/**
*
* Specifies the Amazon Resource Names (ARNs) of the DataSync agents that can securely connect with your location.
*
*
* @param agentArns
* Specifies the Amazon Resource Names (ARNs) of the DataSync agents that can securely connect with your
* location.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateLocationObjectStorageRequest withAgentArns(java.util.Collection agentArns) {
setAgentArns(agentArns);
return this;
}
/**
*
* Specifies the key-value pair that represents a tag that you want to add to the resource. Tags can help you
* manage, filter, and search for your resources. We recommend creating a name tag for your location.
*
*
* @return Specifies the key-value pair that represents a tag that you want to add to the resource. Tags can help
* you manage, filter, and search for your resources. We recommend creating a name tag for your location.
*/
public java.util.List getTags() {
return tags;
}
/**
*
* Specifies the key-value pair that represents a tag that you want to add to the resource. Tags can help you
* manage, filter, and search for your resources. We recommend creating a name tag for your location.
*
*
* @param tags
* Specifies the key-value pair that represents a tag that you want to add to the resource. Tags can help you
* manage, filter, and search for your resources. We recommend creating a name tag for your location.
*/
public void setTags(java.util.Collection tags) {
if (tags == null) {
this.tags = null;
return;
}
this.tags = new java.util.ArrayList(tags);
}
/**
*
* Specifies the key-value pair that represents a tag that you want to add to the resource. Tags can help you
* manage, filter, and search for your resources. We recommend creating a name tag for your location.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param tags
* Specifies the key-value pair that represents a tag that you want to add to the resource. Tags can help you
* manage, filter, and search for your resources. We recommend creating a name tag for your location.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateLocationObjectStorageRequest withTags(TagListEntry... tags) {
if (this.tags == null) {
setTags(new java.util.ArrayList(tags.length));
}
for (TagListEntry ele : tags) {
this.tags.add(ele);
}
return this;
}
/**
*
* Specifies the key-value pair that represents a tag that you want to add to the resource. Tags can help you
* manage, filter, and search for your resources. We recommend creating a name tag for your location.
*
*
* @param tags
* Specifies the key-value pair that represents a tag that you want to add to the resource. Tags can help you
* manage, filter, and search for your resources. We recommend creating a name tag for your location.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateLocationObjectStorageRequest withTags(java.util.Collection tags) {
setTags(tags);
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 (getServerHostname() != null)
sb.append("ServerHostname: ").append(getServerHostname()).append(",");
if (getServerPort() != null)
sb.append("ServerPort: ").append(getServerPort()).append(",");
if (getServerProtocol() != null)
sb.append("ServerProtocol: ").append(getServerProtocol()).append(",");
if (getSubdirectory() != null)
sb.append("Subdirectory: ").append(getSubdirectory()).append(",");
if (getBucketName() != null)
sb.append("BucketName: ").append(getBucketName()).append(",");
if (getAccessKey() != null)
sb.append("AccessKey: ").append(getAccessKey()).append(",");
if (getSecretKey() != null)
sb.append("SecretKey: ").append("***Sensitive Data Redacted***").append(",");
if (getAgentArns() != null)
sb.append("AgentArns: ").append(getAgentArns()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateLocationObjectStorageRequest == false)
return false;
CreateLocationObjectStorageRequest other = (CreateLocationObjectStorageRequest) obj;
if (other.getServerHostname() == null ^ this.getServerHostname() == null)
return false;
if (other.getServerHostname() != null && other.getServerHostname().equals(this.getServerHostname()) == false)
return false;
if (other.getServerPort() == null ^ this.getServerPort() == null)
return false;
if (other.getServerPort() != null && other.getServerPort().equals(this.getServerPort()) == false)
return false;
if (other.getServerProtocol() == null ^ this.getServerProtocol() == null)
return false;
if (other.getServerProtocol() != null && other.getServerProtocol().equals(this.getServerProtocol()) == false)
return false;
if (other.getSubdirectory() == null ^ this.getSubdirectory() == null)
return false;
if (other.getSubdirectory() != null && other.getSubdirectory().equals(this.getSubdirectory()) == false)
return false;
if (other.getBucketName() == null ^ this.getBucketName() == null)
return false;
if (other.getBucketName() != null && other.getBucketName().equals(this.getBucketName()) == false)
return false;
if (other.getAccessKey() == null ^ this.getAccessKey() == null)
return false;
if (other.getAccessKey() != null && other.getAccessKey().equals(this.getAccessKey()) == false)
return false;
if (other.getSecretKey() == null ^ this.getSecretKey() == null)
return false;
if (other.getSecretKey() != null && other.getSecretKey().equals(this.getSecretKey()) == false)
return false;
if (other.getAgentArns() == null ^ this.getAgentArns() == null)
return false;
if (other.getAgentArns() != null && other.getAgentArns().equals(this.getAgentArns()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getServerHostname() == null) ? 0 : getServerHostname().hashCode());
hashCode = prime * hashCode + ((getServerPort() == null) ? 0 : getServerPort().hashCode());
hashCode = prime * hashCode + ((getServerProtocol() == null) ? 0 : getServerProtocol().hashCode());
hashCode = prime * hashCode + ((getSubdirectory() == null) ? 0 : getSubdirectory().hashCode());
hashCode = prime * hashCode + ((getBucketName() == null) ? 0 : getBucketName().hashCode());
hashCode = prime * hashCode + ((getAccessKey() == null) ? 0 : getAccessKey().hashCode());
hashCode = prime * hashCode + ((getSecretKey() == null) ? 0 : getSecretKey().hashCode());
hashCode = prime * hashCode + ((getAgentArns() == null) ? 0 : getAgentArns().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
return hashCode;
}
@Override
public CreateLocationObjectStorageRequest clone() {
return (CreateLocationObjectStorageRequest) super.clone();
}
}