com.amazonaws.services.transfer.model.CreateAgreementRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-transfer Show documentation
/*
* Copyright 2019-2024 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.transfer.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 CreateAgreementRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* A name or short description to identify the agreement.
*
*/
private String description;
/**
*
* A system-assigned unique identifier for a server instance. This is the specific server that the agreement uses.
*
*/
private String serverId;
/**
*
* A unique identifier for the AS2 local profile.
*
*/
private String localProfileId;
/**
*
* A unique identifier for the partner profile used in the agreement.
*
*/
private String partnerProfileId;
/**
*
* The landing directory (folder) for files transferred by using the AS2 protocol.
*
*
* A BaseDirectory
example is /DOC-EXAMPLE-BUCKET/home/mydirectory
.
*
*/
private String baseDirectory;
/**
*
* Connectors are used to send files using either the AS2 or SFTP protocol. For the access role, provide the Amazon
* Resource Name (ARN) of the Identity and Access Management role to use.
*
*
* For AS2 connectors
*
*
* With AS2, you can send files by calling StartFileTransfer
and specifying the file paths in the
* request parameter, SendFilePaths
. We use the file’s parent directory (for example, for
* --send-file-paths /bucket/dir/file.txt
, parent directory is /bucket/dir/
) to
* temporarily store a processed AS2 message file, store the MDN when we receive them from the partner, and write a
* final JSON file containing relevant metadata of the transmission. So, the AccessRole
needs to
* provide read and write access to the parent directory of the file location used in the
* StartFileTransfer
request. Additionally, you need to provide read and write access to the parent
* directory of the files that you intend to send with StartFileTransfer
.
*
*
* If you are using Basic authentication for your AS2 connector, the access role requires the
* secretsmanager:GetSecretValue
permission for the secret. If the secret is encrypted using a
* customer-managed key instead of the Amazon Web Services managed key in Secrets Manager, then the role also needs
* the kms:Decrypt
permission for that key.
*
*
* For SFTP connectors
*
*
* Make sure that the access role provides read and write access to the parent directory of the file location that's
* used in the StartFileTransfer
request. Additionally, make sure that the role provides
* secretsmanager:GetSecretValue
permission to Secrets Manager.
*
*/
private String accessRole;
/**
*
* The status of the agreement. The agreement can be either ACTIVE
or INACTIVE
.
*
*/
private String status;
/**
*
* Key-value pairs that can be used to group and search for agreements.
*
*/
private java.util.List tags;
/**
*
* A name or short description to identify the agreement.
*
*
* @param description
* A name or short description to identify the agreement.
*/
public void setDescription(String description) {
this.description = description;
}
/**
*
* A name or short description to identify the agreement.
*
*
* @return A name or short description to identify the agreement.
*/
public String getDescription() {
return this.description;
}
/**
*
* A name or short description to identify the agreement.
*
*
* @param description
* A name or short description to identify the agreement.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateAgreementRequest withDescription(String description) {
setDescription(description);
return this;
}
/**
*
* A system-assigned unique identifier for a server instance. This is the specific server that the agreement uses.
*
*
* @param serverId
* A system-assigned unique identifier for a server instance. This is the specific server that the agreement
* uses.
*/
public void setServerId(String serverId) {
this.serverId = serverId;
}
/**
*
* A system-assigned unique identifier for a server instance. This is the specific server that the agreement uses.
*
*
* @return A system-assigned unique identifier for a server instance. This is the specific server that the agreement
* uses.
*/
public String getServerId() {
return this.serverId;
}
/**
*
* A system-assigned unique identifier for a server instance. This is the specific server that the agreement uses.
*
*
* @param serverId
* A system-assigned unique identifier for a server instance. This is the specific server that the agreement
* uses.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateAgreementRequest withServerId(String serverId) {
setServerId(serverId);
return this;
}
/**
*
* A unique identifier for the AS2 local profile.
*
*
* @param localProfileId
* A unique identifier for the AS2 local profile.
*/
public void setLocalProfileId(String localProfileId) {
this.localProfileId = localProfileId;
}
/**
*
* A unique identifier for the AS2 local profile.
*
*
* @return A unique identifier for the AS2 local profile.
*/
public String getLocalProfileId() {
return this.localProfileId;
}
/**
*
* A unique identifier for the AS2 local profile.
*
*
* @param localProfileId
* A unique identifier for the AS2 local profile.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateAgreementRequest withLocalProfileId(String localProfileId) {
setLocalProfileId(localProfileId);
return this;
}
/**
*
* A unique identifier for the partner profile used in the agreement.
*
*
* @param partnerProfileId
* A unique identifier for the partner profile used in the agreement.
*/
public void setPartnerProfileId(String partnerProfileId) {
this.partnerProfileId = partnerProfileId;
}
/**
*
* A unique identifier for the partner profile used in the agreement.
*
*
* @return A unique identifier for the partner profile used in the agreement.
*/
public String getPartnerProfileId() {
return this.partnerProfileId;
}
/**
*
* A unique identifier for the partner profile used in the agreement.
*
*
* @param partnerProfileId
* A unique identifier for the partner profile used in the agreement.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateAgreementRequest withPartnerProfileId(String partnerProfileId) {
setPartnerProfileId(partnerProfileId);
return this;
}
/**
*
* The landing directory (folder) for files transferred by using the AS2 protocol.
*
*
* A BaseDirectory
example is /DOC-EXAMPLE-BUCKET/home/mydirectory
.
*
*
* @param baseDirectory
* The landing directory (folder) for files transferred by using the AS2 protocol.
*
* A BaseDirectory
example is /DOC-EXAMPLE-BUCKET/home/mydirectory
.
*/
public void setBaseDirectory(String baseDirectory) {
this.baseDirectory = baseDirectory;
}
/**
*
* The landing directory (folder) for files transferred by using the AS2 protocol.
*
*
* A BaseDirectory
example is /DOC-EXAMPLE-BUCKET/home/mydirectory
.
*
*
* @return The landing directory (folder) for files transferred by using the AS2 protocol.
*
* A BaseDirectory
example is /DOC-EXAMPLE-BUCKET/home/mydirectory
.
*/
public String getBaseDirectory() {
return this.baseDirectory;
}
/**
*
* The landing directory (folder) for files transferred by using the AS2 protocol.
*
*
* A BaseDirectory
example is /DOC-EXAMPLE-BUCKET/home/mydirectory
.
*
*
* @param baseDirectory
* The landing directory (folder) for files transferred by using the AS2 protocol.
*
* A BaseDirectory
example is /DOC-EXAMPLE-BUCKET/home/mydirectory
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateAgreementRequest withBaseDirectory(String baseDirectory) {
setBaseDirectory(baseDirectory);
return this;
}
/**
*
* Connectors are used to send files using either the AS2 or SFTP protocol. For the access role, provide the Amazon
* Resource Name (ARN) of the Identity and Access Management role to use.
*
*
* For AS2 connectors
*
*
* With AS2, you can send files by calling StartFileTransfer
and specifying the file paths in the
* request parameter, SendFilePaths
. We use the file’s parent directory (for example, for
* --send-file-paths /bucket/dir/file.txt
, parent directory is /bucket/dir/
) to
* temporarily store a processed AS2 message file, store the MDN when we receive them from the partner, and write a
* final JSON file containing relevant metadata of the transmission. So, the AccessRole
needs to
* provide read and write access to the parent directory of the file location used in the
* StartFileTransfer
request. Additionally, you need to provide read and write access to the parent
* directory of the files that you intend to send with StartFileTransfer
.
*
*
* If you are using Basic authentication for your AS2 connector, the access role requires the
* secretsmanager:GetSecretValue
permission for the secret. If the secret is encrypted using a
* customer-managed key instead of the Amazon Web Services managed key in Secrets Manager, then the role also needs
* the kms:Decrypt
permission for that key.
*
*
* For SFTP connectors
*
*
* Make sure that the access role provides read and write access to the parent directory of the file location that's
* used in the StartFileTransfer
request. Additionally, make sure that the role provides
* secretsmanager:GetSecretValue
permission to Secrets Manager.
*
*
* @param accessRole
* Connectors are used to send files using either the AS2 or SFTP protocol. For the access role, provide the
* Amazon Resource Name (ARN) of the Identity and Access Management role to use.
*
* For AS2 connectors
*
*
* With AS2, you can send files by calling StartFileTransfer
and specifying the file paths in
* the request parameter, SendFilePaths
. We use the file’s parent directory (for example, for
* --send-file-paths /bucket/dir/file.txt
, parent directory is /bucket/dir/
) to
* temporarily store a processed AS2 message file, store the MDN when we receive them from the partner, and
* write a final JSON file containing relevant metadata of the transmission. So, the AccessRole
* needs to provide read and write access to the parent directory of the file location used in the
* StartFileTransfer
request. Additionally, you need to provide read and write access to the
* parent directory of the files that you intend to send with StartFileTransfer
.
*
*
* If you are using Basic authentication for your AS2 connector, the access role requires the
* secretsmanager:GetSecretValue
permission for the secret. If the secret is encrypted using a
* customer-managed key instead of the Amazon Web Services managed key in Secrets Manager, then the role also
* needs the kms:Decrypt
permission for that key.
*
*
* For SFTP connectors
*
*
* Make sure that the access role provides read and write access to the parent directory of the file location
* that's used in the StartFileTransfer
request. Additionally, make sure that the role provides
* secretsmanager:GetSecretValue
permission to Secrets Manager.
*/
public void setAccessRole(String accessRole) {
this.accessRole = accessRole;
}
/**
*
* Connectors are used to send files using either the AS2 or SFTP protocol. For the access role, provide the Amazon
* Resource Name (ARN) of the Identity and Access Management role to use.
*
*
* For AS2 connectors
*
*
* With AS2, you can send files by calling StartFileTransfer
and specifying the file paths in the
* request parameter, SendFilePaths
. We use the file’s parent directory (for example, for
* --send-file-paths /bucket/dir/file.txt
, parent directory is /bucket/dir/
) to
* temporarily store a processed AS2 message file, store the MDN when we receive them from the partner, and write a
* final JSON file containing relevant metadata of the transmission. So, the AccessRole
needs to
* provide read and write access to the parent directory of the file location used in the
* StartFileTransfer
request. Additionally, you need to provide read and write access to the parent
* directory of the files that you intend to send with StartFileTransfer
.
*
*
* If you are using Basic authentication for your AS2 connector, the access role requires the
* secretsmanager:GetSecretValue
permission for the secret. If the secret is encrypted using a
* customer-managed key instead of the Amazon Web Services managed key in Secrets Manager, then the role also needs
* the kms:Decrypt
permission for that key.
*
*
* For SFTP connectors
*
*
* Make sure that the access role provides read and write access to the parent directory of the file location that's
* used in the StartFileTransfer
request. Additionally, make sure that the role provides
* secretsmanager:GetSecretValue
permission to Secrets Manager.
*
*
* @return Connectors are used to send files using either the AS2 or SFTP protocol. For the access role, provide the
* Amazon Resource Name (ARN) of the Identity and Access Management role to use.
*
* For AS2 connectors
*
*
* With AS2, you can send files by calling StartFileTransfer
and specifying the file paths in
* the request parameter, SendFilePaths
. We use the file’s parent directory (for example, for
* --send-file-paths /bucket/dir/file.txt
, parent directory is /bucket/dir/
) to
* temporarily store a processed AS2 message file, store the MDN when we receive them from the partner, and
* write a final JSON file containing relevant metadata of the transmission. So, the AccessRole
* needs to provide read and write access to the parent directory of the file location used in the
* StartFileTransfer
request. Additionally, you need to provide read and write access to the
* parent directory of the files that you intend to send with StartFileTransfer
.
*
*
* If you are using Basic authentication for your AS2 connector, the access role requires the
* secretsmanager:GetSecretValue
permission for the secret. If the secret is encrypted using a
* customer-managed key instead of the Amazon Web Services managed key in Secrets Manager, then the role
* also needs the kms:Decrypt
permission for that key.
*
*
* For SFTP connectors
*
*
* Make sure that the access role provides read and write access to the parent directory of the file
* location that's used in the StartFileTransfer
request. Additionally, make sure that the role
* provides secretsmanager:GetSecretValue
permission to Secrets Manager.
*/
public String getAccessRole() {
return this.accessRole;
}
/**
*
* Connectors are used to send files using either the AS2 or SFTP protocol. For the access role, provide the Amazon
* Resource Name (ARN) of the Identity and Access Management role to use.
*
*
* For AS2 connectors
*
*
* With AS2, you can send files by calling StartFileTransfer
and specifying the file paths in the
* request parameter, SendFilePaths
. We use the file’s parent directory (for example, for
* --send-file-paths /bucket/dir/file.txt
, parent directory is /bucket/dir/
) to
* temporarily store a processed AS2 message file, store the MDN when we receive them from the partner, and write a
* final JSON file containing relevant metadata of the transmission. So, the AccessRole
needs to
* provide read and write access to the parent directory of the file location used in the
* StartFileTransfer
request. Additionally, you need to provide read and write access to the parent
* directory of the files that you intend to send with StartFileTransfer
.
*
*
* If you are using Basic authentication for your AS2 connector, the access role requires the
* secretsmanager:GetSecretValue
permission for the secret. If the secret is encrypted using a
* customer-managed key instead of the Amazon Web Services managed key in Secrets Manager, then the role also needs
* the kms:Decrypt
permission for that key.
*
*
* For SFTP connectors
*
*
* Make sure that the access role provides read and write access to the parent directory of the file location that's
* used in the StartFileTransfer
request. Additionally, make sure that the role provides
* secretsmanager:GetSecretValue
permission to Secrets Manager.
*
*
* @param accessRole
* Connectors are used to send files using either the AS2 or SFTP protocol. For the access role, provide the
* Amazon Resource Name (ARN) of the Identity and Access Management role to use.
*
* For AS2 connectors
*
*
* With AS2, you can send files by calling StartFileTransfer
and specifying the file paths in
* the request parameter, SendFilePaths
. We use the file’s parent directory (for example, for
* --send-file-paths /bucket/dir/file.txt
, parent directory is /bucket/dir/
) to
* temporarily store a processed AS2 message file, store the MDN when we receive them from the partner, and
* write a final JSON file containing relevant metadata of the transmission. So, the AccessRole
* needs to provide read and write access to the parent directory of the file location used in the
* StartFileTransfer
request. Additionally, you need to provide read and write access to the
* parent directory of the files that you intend to send with StartFileTransfer
.
*
*
* If you are using Basic authentication for your AS2 connector, the access role requires the
* secretsmanager:GetSecretValue
permission for the secret. If the secret is encrypted using a
* customer-managed key instead of the Amazon Web Services managed key in Secrets Manager, then the role also
* needs the kms:Decrypt
permission for that key.
*
*
* For SFTP connectors
*
*
* Make sure that the access role provides read and write access to the parent directory of the file location
* that's used in the StartFileTransfer
request. Additionally, make sure that the role provides
* secretsmanager:GetSecretValue
permission to Secrets Manager.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateAgreementRequest withAccessRole(String accessRole) {
setAccessRole(accessRole);
return this;
}
/**
*
* The status of the agreement. The agreement can be either ACTIVE
or INACTIVE
.
*
*
* @param status
* The status of the agreement. The agreement can be either ACTIVE
or INACTIVE
.
* @see AgreementStatusType
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* The status of the agreement. The agreement can be either ACTIVE
or INACTIVE
.
*
*
* @return The status of the agreement. The agreement can be either ACTIVE
or INACTIVE
.
* @see AgreementStatusType
*/
public String getStatus() {
return this.status;
}
/**
*
* The status of the agreement. The agreement can be either ACTIVE
or INACTIVE
.
*
*
* @param status
* The status of the agreement. The agreement can be either ACTIVE
or INACTIVE
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AgreementStatusType
*/
public CreateAgreementRequest withStatus(String status) {
setStatus(status);
return this;
}
/**
*
* The status of the agreement. The agreement can be either ACTIVE
or INACTIVE
.
*
*
* @param status
* The status of the agreement. The agreement can be either ACTIVE
or INACTIVE
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AgreementStatusType
*/
public CreateAgreementRequest withStatus(AgreementStatusType status) {
this.status = status.toString();
return this;
}
/**
*
* Key-value pairs that can be used to group and search for agreements.
*
*
* @return Key-value pairs that can be used to group and search for agreements.
*/
public java.util.List getTags() {
return tags;
}
/**
*
* Key-value pairs that can be used to group and search for agreements.
*
*
* @param tags
* Key-value pairs that can be used to group and search for agreements.
*/
public void setTags(java.util.Collection tags) {
if (tags == null) {
this.tags = null;
return;
}
this.tags = new java.util.ArrayList(tags);
}
/**
*
* Key-value pairs that can be used to group and search for agreements.
*
*
* 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
* Key-value pairs that can be used to group and search for agreements.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateAgreementRequest withTags(Tag... tags) {
if (this.tags == null) {
setTags(new java.util.ArrayList(tags.length));
}
for (Tag ele : tags) {
this.tags.add(ele);
}
return this;
}
/**
*
* Key-value pairs that can be used to group and search for agreements.
*
*
* @param tags
* Key-value pairs that can be used to group and search for agreements.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateAgreementRequest 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 (getDescription() != null)
sb.append("Description: ").append(getDescription()).append(",");
if (getServerId() != null)
sb.append("ServerId: ").append(getServerId()).append(",");
if (getLocalProfileId() != null)
sb.append("LocalProfileId: ").append(getLocalProfileId()).append(",");
if (getPartnerProfileId() != null)
sb.append("PartnerProfileId: ").append(getPartnerProfileId()).append(",");
if (getBaseDirectory() != null)
sb.append("BaseDirectory: ").append(getBaseDirectory()).append(",");
if (getAccessRole() != null)
sb.append("AccessRole: ").append(getAccessRole()).append(",");
if (getStatus() != null)
sb.append("Status: ").append(getStatus()).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 CreateAgreementRequest == false)
return false;
CreateAgreementRequest other = (CreateAgreementRequest) obj;
if (other.getDescription() == null ^ this.getDescription() == null)
return false;
if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false)
return false;
if (other.getServerId() == null ^ this.getServerId() == null)
return false;
if (other.getServerId() != null && other.getServerId().equals(this.getServerId()) == false)
return false;
if (other.getLocalProfileId() == null ^ this.getLocalProfileId() == null)
return false;
if (other.getLocalProfileId() != null && other.getLocalProfileId().equals(this.getLocalProfileId()) == false)
return false;
if (other.getPartnerProfileId() == null ^ this.getPartnerProfileId() == null)
return false;
if (other.getPartnerProfileId() != null && other.getPartnerProfileId().equals(this.getPartnerProfileId()) == false)
return false;
if (other.getBaseDirectory() == null ^ this.getBaseDirectory() == null)
return false;
if (other.getBaseDirectory() != null && other.getBaseDirectory().equals(this.getBaseDirectory()) == false)
return false;
if (other.getAccessRole() == null ^ this.getAccessRole() == null)
return false;
if (other.getAccessRole() != null && other.getAccessRole().equals(this.getAccessRole()) == false)
return false;
if (other.getStatus() == null ^ this.getStatus() == null)
return false;
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == 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 + ((getDescription() == null) ? 0 : getDescription().hashCode());
hashCode = prime * hashCode + ((getServerId() == null) ? 0 : getServerId().hashCode());
hashCode = prime * hashCode + ((getLocalProfileId() == null) ? 0 : getLocalProfileId().hashCode());
hashCode = prime * hashCode + ((getPartnerProfileId() == null) ? 0 : getPartnerProfileId().hashCode());
hashCode = prime * hashCode + ((getBaseDirectory() == null) ? 0 : getBaseDirectory().hashCode());
hashCode = prime * hashCode + ((getAccessRole() == null) ? 0 : getAccessRole().hashCode());
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
return hashCode;
}
@Override
public CreateAgreementRequest clone() {
return (CreateAgreementRequest) super.clone();
}
}