commonMain.aws.sdk.kotlin.services.transfer.model.CreateAgreementRequest.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of transfer-jvm Show documentation
Show all versions of transfer-jvm Show documentation
The AWS SDK for Kotlin client for Transfer
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.transfer.model
import aws.smithy.kotlin.runtime.SdkDsl
public class CreateAgreementRequest private constructor(builder: Builder) {
/**
* 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 val accessRole: kotlin.String? = builder.accessRole
/**
* The landing directory (folder) for files transferred by using the AS2 protocol.
*
* A `BaseDirectory` example is `/DOC-EXAMPLE-BUCKET/home/mydirectory`.
*/
public val baseDirectory: kotlin.String? = builder.baseDirectory
/**
* A name or short description to identify the agreement.
*/
public val description: kotlin.String? = builder.description
/**
* A unique identifier for the AS2 local profile.
*/
public val localProfileId: kotlin.String? = builder.localProfileId
/**
* A unique identifier for the partner profile used in the agreement.
*/
public val partnerProfileId: kotlin.String? = builder.partnerProfileId
/**
* A system-assigned unique identifier for a server instance. This is the specific server that the agreement uses.
*/
public val serverId: kotlin.String? = builder.serverId
/**
* The status of the agreement. The agreement can be either `ACTIVE` or `INACTIVE`.
*/
public val status: aws.sdk.kotlin.services.transfer.model.AgreementStatusType? = builder.status
/**
* Key-value pairs that can be used to group and search for agreements.
*/
public val tags: List? = builder.tags
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.transfer.model.CreateAgreementRequest = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("CreateAgreementRequest(")
append("accessRole=$accessRole,")
append("baseDirectory=$baseDirectory,")
append("description=$description,")
append("localProfileId=$localProfileId,")
append("partnerProfileId=$partnerProfileId,")
append("serverId=$serverId,")
append("status=$status,")
append("tags=$tags")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = accessRole?.hashCode() ?: 0
result = 31 * result + (baseDirectory?.hashCode() ?: 0)
result = 31 * result + (description?.hashCode() ?: 0)
result = 31 * result + (localProfileId?.hashCode() ?: 0)
result = 31 * result + (partnerProfileId?.hashCode() ?: 0)
result = 31 * result + (serverId?.hashCode() ?: 0)
result = 31 * result + (status?.hashCode() ?: 0)
result = 31 * result + (tags?.hashCode() ?: 0)
return result
}
override fun equals(other: kotlin.Any?): kotlin.Boolean {
if (this === other) return true
if (other == null || this::class != other::class) return false
other as CreateAgreementRequest
if (accessRole != other.accessRole) return false
if (baseDirectory != other.baseDirectory) return false
if (description != other.description) return false
if (localProfileId != other.localProfileId) return false
if (partnerProfileId != other.partnerProfileId) return false
if (serverId != other.serverId) return false
if (status != other.status) return false
if (tags != other.tags) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.transfer.model.CreateAgreementRequest = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* 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 var accessRole: kotlin.String? = null
/**
* The landing directory (folder) for files transferred by using the AS2 protocol.
*
* A `BaseDirectory` example is `/DOC-EXAMPLE-BUCKET/home/mydirectory`.
*/
public var baseDirectory: kotlin.String? = null
/**
* A name or short description to identify the agreement.
*/
public var description: kotlin.String? = null
/**
* A unique identifier for the AS2 local profile.
*/
public var localProfileId: kotlin.String? = null
/**
* A unique identifier for the partner profile used in the agreement.
*/
public var partnerProfileId: kotlin.String? = null
/**
* A system-assigned unique identifier for a server instance. This is the specific server that the agreement uses.
*/
public var serverId: kotlin.String? = null
/**
* The status of the agreement. The agreement can be either `ACTIVE` or `INACTIVE`.
*/
public var status: aws.sdk.kotlin.services.transfer.model.AgreementStatusType? = null
/**
* Key-value pairs that can be used to group and search for agreements.
*/
public var tags: List? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.transfer.model.CreateAgreementRequest) : this() {
this.accessRole = x.accessRole
this.baseDirectory = x.baseDirectory
this.description = x.description
this.localProfileId = x.localProfileId
this.partnerProfileId = x.partnerProfileId
this.serverId = x.serverId
this.status = x.status
this.tags = x.tags
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.transfer.model.CreateAgreementRequest = CreateAgreementRequest(this)
internal fun correctErrors(): Builder {
return this
}
}
}