backupOptions;
private StartBackupJobRequest(BuilderImpl builder) {
super(builder);
this.backupVaultName = builder.backupVaultName;
this.resourceArn = builder.resourceArn;
this.iamRoleArn = builder.iamRoleArn;
this.idempotencyToken = builder.idempotencyToken;
this.startWindowMinutes = builder.startWindowMinutes;
this.completeWindowMinutes = builder.completeWindowMinutes;
this.lifecycle = builder.lifecycle;
this.recoveryPointTags = builder.recoveryPointTags;
this.backupOptions = builder.backupOptions;
}
/**
*
* The name of a logical container where backups are stored. Backup vaults are identified by names that are unique
* to the account used to create them and the AWS Region where they are created. They consist of lowercase letters,
* numbers, and hyphens.
*
*
* @return The name of a logical container where backups are stored. Backup vaults are identified by names that are
* unique to the account used to create them and the AWS Region where they are created. They consist of
* lowercase letters, numbers, and hyphens.
*/
public String backupVaultName() {
return backupVaultName;
}
/**
*
* An Amazon Resource Name (ARN) that uniquely identifies a resource. The format of the ARN depends on the resource
* type.
*
*
* @return An Amazon Resource Name (ARN) that uniquely identifies a resource. The format of the ARN depends on the
* resource type.
*/
public String resourceArn() {
return resourceArn;
}
/**
*
* Specifies the IAM role ARN used to create the target recovery point; for example,
* arn:aws:iam::123456789012:role/S3Access
.
*
*
* @return Specifies the IAM role ARN used to create the target recovery point; for example,
* arn:aws:iam::123456789012:role/S3Access
.
*/
public String iamRoleArn() {
return iamRoleArn;
}
/**
*
* A customer chosen string that can be used to distinguish between calls to StartBackupJob
.
*
*
* @return A customer chosen string that can be used to distinguish between calls to StartBackupJob
.
*/
public String idempotencyToken() {
return idempotencyToken;
}
/**
*
* A value in minutes after a backup is scheduled before a job will be canceled if it doesn't start successfully.
* This value is optional.
*
*
* @return A value in minutes after a backup is scheduled before a job will be canceled if it doesn't start
* successfully. This value is optional.
*/
public Long startWindowMinutes() {
return startWindowMinutes;
}
/**
*
* A value in minutes after a backup job is successfully started before it must be completed or it will be canceled
* by AWS Backup. This value is optional.
*
*
* @return A value in minutes after a backup job is successfully started before it must be completed or it will be
* canceled by AWS Backup. This value is optional.
*/
public Long completeWindowMinutes() {
return completeWindowMinutes;
}
/**
*
* The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. AWS Backup
* will transition and expire backups automatically according to the lifecycle that you define.
*
*
* Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, the
* “expire after days” setting must be 90 days greater than the “transition to cold after days” setting. The
* “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold.
*
*
* @return The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. AWS
* Backup will transition and expire backups automatically according to the lifecycle that you define.
*
* Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore,
* the “expire after days” setting must be 90 days greater than the “transition to cold after days” setting.
* The “transition to cold after days” setting cannot be changed after a backup has been transitioned to
* cold.
*/
public Lifecycle lifecycle() {
return lifecycle;
}
/**
* Returns true if the RecoveryPointTags property was specified by the sender (it may be empty), or false if the
* sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public boolean hasRecoveryPointTags() {
return recoveryPointTags != null && !(recoveryPointTags instanceof SdkAutoConstructMap);
}
/**
*
* To help organize your resources, you can assign your own metadata to the resources that you create. Each tag is a
* key-value pair.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasRecoveryPointTags()} to see if a value was sent in this field.
*
*
* @return To help organize your resources, you can assign your own metadata to the resources that you create. Each
* tag is a key-value pair.
*/
public Map recoveryPointTags() {
return recoveryPointTags;
}
/**
* Returns true if the BackupOptions property was specified by the sender (it may be empty), or false if the sender
* did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public boolean hasBackupOptions() {
return backupOptions != null && !(backupOptions instanceof SdkAutoConstructMap);
}
/**
*
* Specifies the backup option for a selected resource. This option is only available for Windows VSS backup jobs.
*
*
* Valid value: "WindowsVSS”:“enabled"
. If enabled, creates a VSS Windows backup; otherwise, creates a
* regular backup.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasBackupOptions()} to see if a value was sent in this field.
*
*
* @return Specifies the backup option for a selected resource. This option is only available for Windows VSS backup
* jobs.
*
* Valid value: "WindowsVSS”:“enabled"
. If enabled, creates a VSS Windows backup; otherwise,
* creates a regular backup.
*/
public Map backupOptions() {
return backupOptions;
}
@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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(backupVaultName());
hashCode = 31 * hashCode + Objects.hashCode(resourceArn());
hashCode = 31 * hashCode + Objects.hashCode(iamRoleArn());
hashCode = 31 * hashCode + Objects.hashCode(idempotencyToken());
hashCode = 31 * hashCode + Objects.hashCode(startWindowMinutes());
hashCode = 31 * hashCode + Objects.hashCode(completeWindowMinutes());
hashCode = 31 * hashCode + Objects.hashCode(lifecycle());
hashCode = 31 * hashCode + Objects.hashCode(recoveryPointTags());
hashCode = 31 * hashCode + Objects.hashCode(backupOptions());
return hashCode;
}
@Override
public boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof StartBackupJobRequest)) {
return false;
}
StartBackupJobRequest other = (StartBackupJobRequest) obj;
return Objects.equals(backupVaultName(), other.backupVaultName()) && Objects.equals(resourceArn(), other.resourceArn())
&& Objects.equals(iamRoleArn(), other.iamRoleArn())
&& Objects.equals(idempotencyToken(), other.idempotencyToken())
&& Objects.equals(startWindowMinutes(), other.startWindowMinutes())
&& Objects.equals(completeWindowMinutes(), other.completeWindowMinutes())
&& Objects.equals(lifecycle(), other.lifecycle())
&& Objects.equals(recoveryPointTags(), other.recoveryPointTags())
&& Objects.equals(backupOptions(), other.backupOptions());
}
/**
* 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 String toString() {
return ToString.builder("StartBackupJobRequest").add("BackupVaultName", backupVaultName())
.add("ResourceArn", resourceArn()).add("IamRoleArn", iamRoleArn()).add("IdempotencyToken", idempotencyToken())
.add("StartWindowMinutes", startWindowMinutes()).add("CompleteWindowMinutes", completeWindowMinutes())
.add("Lifecycle", lifecycle())
.add("RecoveryPointTags", recoveryPointTags() == null ? null : "*** Sensitive Data Redacted ***")
.add("BackupOptions", backupOptions()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "BackupVaultName":
return Optional.ofNullable(clazz.cast(backupVaultName()));
case "ResourceArn":
return Optional.ofNullable(clazz.cast(resourceArn()));
case "IamRoleArn":
return Optional.ofNullable(clazz.cast(iamRoleArn()));
case "IdempotencyToken":
return Optional.ofNullable(clazz.cast(idempotencyToken()));
case "StartWindowMinutes":
return Optional.ofNullable(clazz.cast(startWindowMinutes()));
case "CompleteWindowMinutes":
return Optional.ofNullable(clazz.cast(completeWindowMinutes()));
case "Lifecycle":
return Optional.ofNullable(clazz.cast(lifecycle()));
case "RecoveryPointTags":
return Optional.ofNullable(clazz.cast(recoveryPointTags()));
case "BackupOptions":
return Optional.ofNullable(clazz.cast(backupOptions()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((StartBackupJobRequest) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends BackupRequest.Builder, SdkPojo, CopyableBuilder {
/**
*
* The name of a logical container where backups are stored. Backup vaults are identified by names that are
* unique to the account used to create them and the AWS Region where they are created. They consist of
* lowercase letters, numbers, and hyphens.
*
*
* @param backupVaultName
* The name of a logical container where backups are stored. Backup vaults are identified by names that
* are unique to the account used to create them and the AWS Region where they are created. They consist
* of lowercase letters, numbers, and hyphens.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder backupVaultName(String backupVaultName);
/**
*
* An Amazon Resource Name (ARN) that uniquely identifies a resource. The format of the ARN depends on the
* resource type.
*
*
* @param resourceArn
* An Amazon Resource Name (ARN) that uniquely identifies a resource. The format of the ARN depends on
* the resource type.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder resourceArn(String resourceArn);
/**
*
* Specifies the IAM role ARN used to create the target recovery point; for example,
* arn:aws:iam::123456789012:role/S3Access
.
*
*
* @param iamRoleArn
* Specifies the IAM role ARN used to create the target recovery point; for example,
* arn:aws:iam::123456789012:role/S3Access
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder iamRoleArn(String iamRoleArn);
/**
*
* A customer chosen string that can be used to distinguish between calls to StartBackupJob
.
*
*
* @param idempotencyToken
* A customer chosen string that can be used to distinguish between calls to StartBackupJob
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder idempotencyToken(String idempotencyToken);
/**
*
* A value in minutes after a backup is scheduled before a job will be canceled if it doesn't start
* successfully. This value is optional.
*
*
* @param startWindowMinutes
* A value in minutes after a backup is scheduled before a job will be canceled if it doesn't start
* successfully. This value is optional.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder startWindowMinutes(Long startWindowMinutes);
/**
*
* A value in minutes after a backup job is successfully started before it must be completed or it will be
* canceled by AWS Backup. This value is optional.
*
*
* @param completeWindowMinutes
* A value in minutes after a backup job is successfully started before it must be completed or it will
* be canceled by AWS Backup. This value is optional.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder completeWindowMinutes(Long completeWindowMinutes);
/**
*
* The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. AWS
* Backup will transition and expire backups automatically according to the lifecycle that you define.
*
*
* Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, the
* “expire after days” setting must be 90 days greater than the “transition to cold after days” setting. The
* “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold.
*
*
* @param lifecycle
* The lifecycle defines when a protected resource is transitioned to cold storage and when it expires.
* AWS Backup will transition and expire backups automatically according to the lifecycle that you
* define.
*
* Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days.
* Therefore, the “expire after days” setting must be 90 days greater than the “transition to cold after
* days” setting. The “transition to cold after days” setting cannot be changed after a backup has been
* transitioned to cold.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder lifecycle(Lifecycle lifecycle);
/**
*
* The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. AWS
* Backup will transition and expire backups automatically according to the lifecycle that you define.
*
*
* Backups transitioned to cold storage must be stored in cold storage for a minimum of 90 days. Therefore, the
* “expire after days” setting must be 90 days greater than the “transition to cold after days” setting. The
* “transition to cold after days” setting cannot be changed after a backup has been transitioned to cold.
*
* This is a convenience that creates an instance of the {@link Lifecycle.Builder} avoiding the need to create
* one manually via {@link Lifecycle#builder()}.
*
* When the {@link Consumer} completes, {@link Lifecycle.Builder#build()} is called immediately and its result
* is passed to {@link #lifecycle(Lifecycle)}.
*
* @param lifecycle
* a consumer that will call methods on {@link Lifecycle.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #lifecycle(Lifecycle)
*/
default Builder lifecycle(Consumer lifecycle) {
return lifecycle(Lifecycle.builder().applyMutation(lifecycle).build());
}
/**
*
* To help organize your resources, you can assign your own metadata to the resources that you create. Each tag
* is a key-value pair.
*
*
* @param recoveryPointTags
* To help organize your resources, you can assign your own metadata to the resources that you create.
* Each tag is a key-value pair.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder recoveryPointTags(Map recoveryPointTags);
/**
*
* Specifies the backup option for a selected resource. This option is only available for Windows VSS backup
* jobs.
*
*
* Valid value: "WindowsVSS”:“enabled"
. If enabled, creates a VSS Windows backup; otherwise,
* creates a regular backup.
*
*
* @param backupOptions
* Specifies the backup option for a selected resource. This option is only available for Windows VSS
* backup jobs.
*
* Valid value: "WindowsVSS”:“enabled"
. If enabled, creates a VSS Windows backup; otherwise,
* creates a regular backup.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder backupOptions(Map backupOptions);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer builderConsumer);
}
static final class BuilderImpl extends BackupRequest.BuilderImpl implements Builder {
private String backupVaultName;
private String resourceArn;
private String iamRoleArn;
private String idempotencyToken;
private Long startWindowMinutes;
private Long completeWindowMinutes;
private Lifecycle lifecycle;
private Map recoveryPointTags = DefaultSdkAutoConstructMap.getInstance();
private Map backupOptions = DefaultSdkAutoConstructMap.getInstance();
private BuilderImpl() {
}
private BuilderImpl(StartBackupJobRequest model) {
super(model);
backupVaultName(model.backupVaultName);
resourceArn(model.resourceArn);
iamRoleArn(model.iamRoleArn);
idempotencyToken(model.idempotencyToken);
startWindowMinutes(model.startWindowMinutes);
completeWindowMinutes(model.completeWindowMinutes);
lifecycle(model.lifecycle);
recoveryPointTags(model.recoveryPointTags);
backupOptions(model.backupOptions);
}
public final String getBackupVaultName() {
return backupVaultName;
}
@Override
public final Builder backupVaultName(String backupVaultName) {
this.backupVaultName = backupVaultName;
return this;
}
public final void setBackupVaultName(String backupVaultName) {
this.backupVaultName = backupVaultName;
}
public final String getResourceArn() {
return resourceArn;
}
@Override
public final Builder resourceArn(String resourceArn) {
this.resourceArn = resourceArn;
return this;
}
public final void setResourceArn(String resourceArn) {
this.resourceArn = resourceArn;
}
public final String getIamRoleArn() {
return iamRoleArn;
}
@Override
public final Builder iamRoleArn(String iamRoleArn) {
this.iamRoleArn = iamRoleArn;
return this;
}
public final void setIamRoleArn(String iamRoleArn) {
this.iamRoleArn = iamRoleArn;
}
public final String getIdempotencyToken() {
return idempotencyToken;
}
@Override
public final Builder idempotencyToken(String idempotencyToken) {
this.idempotencyToken = idempotencyToken;
return this;
}
public final void setIdempotencyToken(String idempotencyToken) {
this.idempotencyToken = idempotencyToken;
}
public final Long getStartWindowMinutes() {
return startWindowMinutes;
}
@Override
public final Builder startWindowMinutes(Long startWindowMinutes) {
this.startWindowMinutes = startWindowMinutes;
return this;
}
public final void setStartWindowMinutes(Long startWindowMinutes) {
this.startWindowMinutes = startWindowMinutes;
}
public final Long getCompleteWindowMinutes() {
return completeWindowMinutes;
}
@Override
public final Builder completeWindowMinutes(Long completeWindowMinutes) {
this.completeWindowMinutes = completeWindowMinutes;
return this;
}
public final void setCompleteWindowMinutes(Long completeWindowMinutes) {
this.completeWindowMinutes = completeWindowMinutes;
}
public final Lifecycle.Builder getLifecycle() {
return lifecycle != null ? lifecycle.toBuilder() : null;
}
@Override
public final Builder lifecycle(Lifecycle lifecycle) {
this.lifecycle = lifecycle;
return this;
}
public final void setLifecycle(Lifecycle.BuilderImpl lifecycle) {
this.lifecycle = lifecycle != null ? lifecycle.build() : null;
}
public final Map getRecoveryPointTags() {
return recoveryPointTags;
}
@Override
public final Builder recoveryPointTags(Map recoveryPointTags) {
this.recoveryPointTags = TagsCopier.copy(recoveryPointTags);
return this;
}
public final void setRecoveryPointTags(Map recoveryPointTags) {
this.recoveryPointTags = TagsCopier.copy(recoveryPointTags);
}
public final Map getBackupOptions() {
return backupOptions;
}
@Override
public final Builder backupOptions(Map backupOptions) {
this.backupOptions = BackupOptionsCopier.copy(backupOptions);
return this;
}
public final void setBackupOptions(Map backupOptions) {
this.backupOptions = BackupOptionsCopier.copy(backupOptions);
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public StartBackupJobRequest build() {
return new StartBackupJobRequest(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}