![JAR search and dependency download from the Maven repository](/logo.png)
software.amazon.awssdk.services.rds.model.StartDbInstanceAutomatedBackupsReplicationRequest Maven / Gradle / Ivy
Show all versions of rds Show documentation
/*
* Copyright 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 software.amazon.awssdk.services.rds.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class StartDbInstanceAutomatedBackupsReplicationRequest extends RdsRequest
implements
ToCopyableBuilder {
private static final SdkField SOURCE_DB_INSTANCE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SourceDBInstanceArn")
.getter(getter(StartDbInstanceAutomatedBackupsReplicationRequest::sourceDBInstanceArn))
.setter(setter(Builder::sourceDBInstanceArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceDBInstanceArn").build())
.build();
private static final SdkField BACKUP_RETENTION_PERIOD_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("BackupRetentionPeriod")
.getter(getter(StartDbInstanceAutomatedBackupsReplicationRequest::backupRetentionPeriod))
.setter(setter(Builder::backupRetentionPeriod))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BackupRetentionPeriod").build())
.build();
private static final SdkField KMS_KEY_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("KmsKeyId").getter(getter(StartDbInstanceAutomatedBackupsReplicationRequest::kmsKeyId))
.setter(setter(Builder::kmsKeyId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KmsKeyId").build()).build();
private static final SdkField PRE_SIGNED_URL_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("PreSignedUrl").getter(getter(StartDbInstanceAutomatedBackupsReplicationRequest::preSignedUrl))
.setter(setter(Builder::preSignedUrl))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PreSignedUrl").build()).build();
private static final SdkField SOURCE_REGION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SourceRegion").getter(getter(StartDbInstanceAutomatedBackupsReplicationRequest::sourceRegion))
.setter(setter(Builder::sourceRegion))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceRegion").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(SOURCE_DB_INSTANCE_ARN_FIELD,
BACKUP_RETENTION_PERIOD_FIELD, KMS_KEY_ID_FIELD, PRE_SIGNED_URL_FIELD, SOURCE_REGION_FIELD));
private final String sourceDBInstanceArn;
private final Integer backupRetentionPeriod;
private final String kmsKeyId;
private final String preSignedUrl;
private final String sourceRegion;
private StartDbInstanceAutomatedBackupsReplicationRequest(BuilderImpl builder) {
super(builder);
this.sourceDBInstanceArn = builder.sourceDBInstanceArn;
this.backupRetentionPeriod = builder.backupRetentionPeriod;
this.kmsKeyId = builder.kmsKeyId;
this.preSignedUrl = builder.preSignedUrl;
this.sourceRegion = builder.sourceRegion;
}
/**
*
* The Amazon Resource Name (ARN) of the source DB instance for the replicated automated backups, for example,
* arn:aws:rds:us-west-2:123456789012:db:mydatabase
.
*
*
* @return The Amazon Resource Name (ARN) of the source DB instance for the replicated automated backups, for
* example, arn:aws:rds:us-west-2:123456789012:db:mydatabase
.
*/
public final String sourceDBInstanceArn() {
return sourceDBInstanceArn;
}
/**
*
* The retention period for the replicated automated backups.
*
*
* @return The retention period for the replicated automated backups.
*/
public final Integer backupRetentionPeriod() {
return backupRetentionPeriod;
}
/**
*
* The Amazon Web Services KMS key identifier for encryption of the replicated automated backups. The KMS key ID is
* the Amazon Resource Name (ARN) for the KMS encryption key in the destination Amazon Web Services Region, for
* example, arn:aws:kms:us-east-1:123456789012:key/AKIAIOSFODNN7EXAMPLE
.
*
*
* @return The Amazon Web Services KMS key identifier for encryption of the replicated automated backups. The KMS
* key ID is the Amazon Resource Name (ARN) for the KMS encryption key in the destination Amazon Web
* Services Region, for example, arn:aws:kms:us-east-1:123456789012:key/AKIAIOSFODNN7EXAMPLE
.
*/
public final String kmsKeyId() {
return kmsKeyId;
}
/**
*
* In an Amazon Web Services GovCloud (US) Region, an URL that contains a Signature Version 4 signed request for the
* StartDBInstanceAutomatedBackupsReplication
operation to call in the Amazon Web Services Region of
* the source DB instance. The presigned URL must be a valid request for the
* StartDBInstanceAutomatedBackupsReplication
API operation that can run in the Amazon Web Services
* Region that contains the source DB instance.
*
*
* This setting applies only to Amazon Web Services GovCloud (US) Regions. It's ignored in other Amazon Web Services
* Regions.
*
*
* To learn how to generate a Signature Version 4 signed request, see Authenticating Requests:
* Using Query Parameters (Amazon Web Services Signature Version 4) and Signature Version 4 Signing
* Process.
*
*
*
* If you are using an Amazon Web Services SDK tool or the CLI, you can specify SourceRegion
(or
* --source-region
for the CLI) instead of specifying PreSignedUrl
manually. Specifying
* SourceRegion
autogenerates a presigned URL that is a valid request for the operation that can run in
* the source Amazon Web Services Region.
*
*
*
* @return In an Amazon Web Services GovCloud (US) Region, an URL that contains a Signature Version 4 signed request
* for the StartDBInstanceAutomatedBackupsReplication
operation to call in the Amazon Web
* Services Region of the source DB instance. The presigned URL must be a valid request for the
* StartDBInstanceAutomatedBackupsReplication
API operation that can run in the Amazon Web
* Services Region that contains the source DB instance.
*
* This setting applies only to Amazon Web Services GovCloud (US) Regions. It's ignored in other Amazon Web
* Services Regions.
*
*
* To learn how to generate a Signature Version 4 signed request, see Authenticating
* Requests: Using Query Parameters (Amazon Web Services Signature Version 4) and Signature Version 4
* Signing Process.
*
*
*
* If you are using an Amazon Web Services SDK tool or the CLI, you can specify SourceRegion
* (or --source-region
for the CLI) instead of specifying PreSignedUrl
manually.
* Specifying SourceRegion
autogenerates a presigned URL that is a valid request for the
* operation that can run in the source Amazon Web Services Region.
*
*/
public final String preSignedUrl() {
return preSignedUrl;
}
/**
* If PreSignedUrl is not specified, this is the region where the source snapshot is located. A PreSignedUrl will be
* generated automatically by the SDK.
*
* @return If PreSignedUrl is not specified, this is the region where the source snapshot is located. A PreSignedUrl
* will be generated automatically by the SDK.
*/
public final String sourceRegion() {
return sourceRegion;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(sourceDBInstanceArn());
hashCode = 31 * hashCode + Objects.hashCode(backupRetentionPeriod());
hashCode = 31 * hashCode + Objects.hashCode(kmsKeyId());
hashCode = 31 * hashCode + Objects.hashCode(preSignedUrl());
hashCode = 31 * hashCode + Objects.hashCode(sourceRegion());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof StartDbInstanceAutomatedBackupsReplicationRequest)) {
return false;
}
StartDbInstanceAutomatedBackupsReplicationRequest other = (StartDbInstanceAutomatedBackupsReplicationRequest) obj;
return Objects.equals(sourceDBInstanceArn(), other.sourceDBInstanceArn())
&& Objects.equals(backupRetentionPeriod(), other.backupRetentionPeriod())
&& Objects.equals(kmsKeyId(), other.kmsKeyId()) && Objects.equals(preSignedUrl(), other.preSignedUrl())
&& Objects.equals(sourceRegion(), other.sourceRegion());
}
/**
* 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.
*/
@Override
public final String toString() {
return ToString.builder("StartDbInstanceAutomatedBackupsReplicationRequest")
.add("SourceDBInstanceArn", sourceDBInstanceArn()).add("BackupRetentionPeriod", backupRetentionPeriod())
.add("KmsKeyId", kmsKeyId()).add("PreSignedUrl", preSignedUrl()).add("SourceRegion", sourceRegion()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "SourceDBInstanceArn":
return Optional.ofNullable(clazz.cast(sourceDBInstanceArn()));
case "BackupRetentionPeriod":
return Optional.ofNullable(clazz.cast(backupRetentionPeriod()));
case "KmsKeyId":
return Optional.ofNullable(clazz.cast(kmsKeyId()));
case "PreSignedUrl":
return Optional.ofNullable(clazz.cast(preSignedUrl()));
case "SourceRegion":
return Optional.ofNullable(clazz.cast(sourceRegion()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function