All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.backup.model.StartBackupJobRequest Maven / Gradle / Ivy

/*
 * 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.backup.model;

import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
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 StartBackupJobRequest extends BackupRequest implements
        ToCopyableBuilder {
    private static final SdkField BACKUP_VAULT_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("BackupVaultName").getter(getter(StartBackupJobRequest::backupVaultName))
            .setter(setter(Builder::backupVaultName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BackupVaultName").build()).build();

    private static final SdkField RESOURCE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ResourceArn").getter(getter(StartBackupJobRequest::resourceArn)).setter(setter(Builder::resourceArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ResourceArn").build()).build();

    private static final SdkField IAM_ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("IamRoleArn").getter(getter(StartBackupJobRequest::iamRoleArn)).setter(setter(Builder::iamRoleArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IamRoleArn").build()).build();

    private static final SdkField IDEMPOTENCY_TOKEN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("IdempotencyToken").getter(getter(StartBackupJobRequest::idempotencyToken))
            .setter(setter(Builder::idempotencyToken))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IdempotencyToken").build()).build();

    private static final SdkField START_WINDOW_MINUTES_FIELD = SdkField. builder(MarshallingType.LONG)
            .memberName("StartWindowMinutes").getter(getter(StartBackupJobRequest::startWindowMinutes))
            .setter(setter(Builder::startWindowMinutes))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StartWindowMinutes").build())
            .build();

    private static final SdkField COMPLETE_WINDOW_MINUTES_FIELD = SdkField. builder(MarshallingType.LONG)
            .memberName("CompleteWindowMinutes").getter(getter(StartBackupJobRequest::completeWindowMinutes))
            .setter(setter(Builder::completeWindowMinutes))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CompleteWindowMinutes").build())
            .build();

    private static final SdkField LIFECYCLE_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
            .memberName("Lifecycle").getter(getter(StartBackupJobRequest::lifecycle)).setter(setter(Builder::lifecycle))
            .constructor(Lifecycle::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Lifecycle").build()).build();

    private static final SdkField> RECOVERY_POINT_TAGS_FIELD = SdkField
            .> builder(MarshallingType.MAP)
            .memberName("RecoveryPointTags")
            .getter(getter(StartBackupJobRequest::recoveryPointTags))
            .setter(setter(Builder::recoveryPointTags))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RecoveryPointTags").build(),
                    MapTrait.builder()
                            .keyLocationName("key")
                            .valueLocationName("value")
                            .valueFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("value").build()).build()).build()).build();

    private static final SdkField> BACKUP_OPTIONS_FIELD = SdkField
            .> builder(MarshallingType.MAP)
            .memberName("BackupOptions")
            .getter(getter(StartBackupJobRequest::backupOptions))
            .setter(setter(Builder::backupOptions))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BackupOptions").build(),
                    MapTrait.builder()
                            .keyLocationName("key")
                            .valueLocationName("value")
                            .valueFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("value").build()).build()).build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BACKUP_VAULT_NAME_FIELD,
            RESOURCE_ARN_FIELD, IAM_ROLE_ARN_FIELD, IDEMPOTENCY_TOKEN_FIELD, START_WINDOW_MINUTES_FIELD,
            COMPLETE_WINDOW_MINUTES_FIELD, LIFECYCLE_FIELD, RECOVERY_POINT_TAGS_FIELD, BACKUP_OPTIONS_FIELD));

    private static final Map> SDK_NAME_TO_FIELD = Collections
            .unmodifiableMap(new HashMap>() {
                {
                    put("BackupVaultName", BACKUP_VAULT_NAME_FIELD);
                    put("ResourceArn", RESOURCE_ARN_FIELD);
                    put("IamRoleArn", IAM_ROLE_ARN_FIELD);
                    put("IdempotencyToken", IDEMPOTENCY_TOKEN_FIELD);
                    put("StartWindowMinutes", START_WINDOW_MINUTES_FIELD);
                    put("CompleteWindowMinutes", COMPLETE_WINDOW_MINUTES_FIELD);
                    put("Lifecycle", LIFECYCLE_FIELD);
                    put("RecoveryPointTags", RECOVERY_POINT_TAGS_FIELD);
                    put("BackupOptions", BACKUP_OPTIONS_FIELD);
                }
            });

    private final String backupVaultName;

    private final String resourceArn;

    private final String iamRoleArn;

    private final String idempotencyToken;

    private final Long startWindowMinutes;

    private final Long completeWindowMinutes;

    private final Lifecycle lifecycle;

    private final Map recoveryPointTags;

    private final Map 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 Amazon Web Services Region where they are created. *

* * @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 Amazon Web Services Region where they are created. */ public final 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 final 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 final String iamRoleArn() { return iamRoleArn; } /** *

* A customer-chosen string that you can use to distinguish between otherwise identical calls to * StartBackupJob. Retrying a successful request with the same idempotency token results in a success * message with no action taken. *

* * @return A customer-chosen string that you can use to distinguish between otherwise identical calls to * StartBackupJob. Retrying a successful request with the same idempotency token results in a * success message with no action taken. */ public final 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, and the default is 8 hours. If this value is included, it must be at least 60 minutes to * avoid errors. *

*

* This parameter has a maximum value of 100 years (52,560,000 minutes). *

*

* During the start window, the backup job status remains in CREATED status until it has successfully * begun or until the start window time has run out. If within the start window time Backup receives an error that * allows the job to be retried, Backup will automatically retry to begin the job at least every 10 minutes until * the backup successfully begins (the job status changes to RUNNING) or until the job status changes * to EXPIRED (which is expected to occur when the start window time is over). *

* * @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, and the default is 8 hours. If this value is included, it must be * at least 60 minutes to avoid errors.

*

* This parameter has a maximum value of 100 years (52,560,000 minutes). *

*

* During the start window, the backup job status remains in CREATED status until it has * successfully begun or until the start window time has run out. If within the start window time Backup * receives an error that allows the job to be retried, Backup will automatically retry to begin the job at * least every 10 minutes until the backup successfully begins (the job status changes to * RUNNING) or until the job status changes to EXPIRED (which is expected to occur * when the start window time is over). */ public final Long startWindowMinutes() { return startWindowMinutes; } /** *

* A value in minutes during which a successfully started backup must complete, or else Backup will cancel the job. * This value is optional. This value begins counting down from when the backup was scheduled. It does not add * additional time for StartWindowMinutes, or if the backup started later than scheduled. *

*

* Like StartWindowMinutes, this parameter has a maximum value of 100 years (52,560,000 minutes). *

* * @return A value in minutes during which a successfully started backup must complete, or else Backup will cancel * the job. This value is optional. This value begins counting down from when the backup was scheduled. It * does not add additional time for StartWindowMinutes, or if the backup started later than * scheduled.

*

* Like StartWindowMinutes, this parameter has a maximum value of 100 years (52,560,000 * minutes). */ public final Long completeWindowMinutes() { return completeWindowMinutes; } /** *

* The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. 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 * “retention” 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. *

*

* Resource types that can transition to cold storage are listed in the Feature availability by resource table. Backup ignores this expression for other resource types. *

*

* This parameter has a maximum value of 100 years (36,500 days). *

* * @return The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. * 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 “retention” 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. *

*

* Resource types that can transition to cold storage are listed in the Feature availability by resource table. Backup ignores this expression for other resource types. *

*

* This parameter has a maximum value of 100 years (36,500 days). */ public final Lifecycle lifecycle() { return lifecycle; } /** * For responses, this returns true if the service returned a value for the RecoveryPointTags property. This DOES * NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasRecoveryPointTags() { return recoveryPointTags != null && !(recoveryPointTags instanceof SdkAutoConstructMap); } /** *

* The tags to assign to the resources. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasRecoveryPointTags} method. *

* * @return The tags to assign to the resources. */ public final Map recoveryPointTags() { return recoveryPointTags; } /** * For responses, this returns true if the service returned a value for the BackupOptions property. This DOES NOT * check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasBackupOptions() { return backupOptions != null && !(backupOptions instanceof SdkAutoConstructMap); } /** *

* The backup option for a selected resource. This option is only available for Windows Volume Shadow Copy Service * (VSS) backup jobs. *

*

* Valid values: Set to "WindowsVSS":"enabled" to enable the WindowsVSS backup option and * create a Windows VSS backup. Set to "WindowsVSS""disabled" to create a regular backup. The * WindowsVSS option is not enabled by default. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasBackupOptions} method. *

* * @return The backup option for a selected resource. This option is only available for Windows Volume Shadow Copy * Service (VSS) backup jobs.

*

* Valid values: Set to "WindowsVSS":"enabled" to enable the WindowsVSS backup * option and create a Windows VSS backup. Set to "WindowsVSS""disabled" to create a regular * backup. The WindowsVSS option is not enabled by default. */ public final Map backupOptions() { return backupOptions; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final 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(hasRecoveryPointTags() ? recoveryPointTags() : null); hashCode = 31 * hashCode + Objects.hashCode(hasBackupOptions() ? backupOptions() : null); 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 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()) && hasRecoveryPointTags() == other.hasRecoveryPointTags() && Objects.equals(recoveryPointTags(), other.recoveryPointTags()) && hasBackupOptions() == other.hasBackupOptions() && 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 final 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", hasBackupOptions() ? backupOptions() : null).build(); } public final 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 final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } 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 Amazon Web Services Region where they are created. *

* * @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 Amazon Web Services Region where they are * created. * @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 you can use to distinguish between otherwise identical calls to * StartBackupJob. Retrying a successful request with the same idempotency token results in a * success message with no action taken. *

* * @param idempotencyToken * A customer-chosen string that you can use to distinguish between otherwise identical calls to * StartBackupJob. Retrying a successful request with the same idempotency token results in * a success message with no action taken. * @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, and the default is 8 hours. If this value is included, it must be at * least 60 minutes to avoid errors. *

*

* This parameter has a maximum value of 100 years (52,560,000 minutes). *

*

* During the start window, the backup job status remains in CREATED status until it has * successfully begun or until the start window time has run out. If within the start window time Backup * receives an error that allows the job to be retried, Backup will automatically retry to begin the job at * least every 10 minutes until the backup successfully begins (the job status changes to RUNNING) * or until the job status changes to EXPIRED (which is expected to occur when the start window * time is over). *

* * @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, and the default is 8 hours. If this value is included, it must * be at least 60 minutes to avoid errors.

*

* This parameter has a maximum value of 100 years (52,560,000 minutes). *

*

* During the start window, the backup job status remains in CREATED status until it has * successfully begun or until the start window time has run out. If within the start window time Backup * receives an error that allows the job to be retried, Backup will automatically retry to begin the job * at least every 10 minutes until the backup successfully begins (the job status changes to * RUNNING) or until the job status changes to EXPIRED (which is expected to * occur when the start window time is over). * @return Returns a reference to this object so that method calls can be chained together. */ Builder startWindowMinutes(Long startWindowMinutes); /** *

* A value in minutes during which a successfully started backup must complete, or else Backup will cancel the * job. This value is optional. This value begins counting down from when the backup was scheduled. It does not * add additional time for StartWindowMinutes, or if the backup started later than scheduled. *

*

* Like StartWindowMinutes, this parameter has a maximum value of 100 years (52,560,000 minutes). *

* * @param completeWindowMinutes * A value in minutes during which a successfully started backup must complete, or else Backup will * cancel the job. This value is optional. This value begins counting down from when the backup was * scheduled. It does not add additional time for StartWindowMinutes, or if the backup * started later than scheduled.

*

* Like StartWindowMinutes, this parameter has a maximum value of 100 years (52,560,000 * minutes). * @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. 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 * “retention” 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. *

*

* Resource types that can transition to cold storage are listed in the Feature availability by resource table. Backup ignores this expression for other resource types. *

*

* This parameter has a maximum value of 100 years (36,500 days). *

* * @param lifecycle * The lifecycle defines when a protected resource is transitioned to cold storage and when it expires. * 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 “retention” 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. *

*

* Resource types that can transition to cold storage are listed in the Feature availability by resource table. Backup ignores this expression for other resource types. *

*

* This parameter has a maximum value of 100 years (36,500 days). * @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. 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 * “retention” 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. *

*

* Resource types that can transition to cold storage are listed in the Feature availability by resource table. Backup ignores this expression for other resource types. *

*

* This parameter has a maximum value of 100 years (36,500 days). *

* This is a convenience method 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()); } /** *

* The tags to assign to the resources. *

* * @param recoveryPointTags * The tags to assign to the resources. * @return Returns a reference to this object so that method calls can be chained together. */ Builder recoveryPointTags(Map recoveryPointTags); /** *

* The backup option for a selected resource. This option is only available for Windows Volume Shadow Copy * Service (VSS) backup jobs. *

*

* Valid values: Set to "WindowsVSS":"enabled" to enable the WindowsVSS backup option * and create a Windows VSS backup. Set to "WindowsVSS""disabled" to create a regular backup. The * WindowsVSS option is not enabled by default. *

* * @param backupOptions * The backup option for a selected resource. This option is only available for Windows Volume Shadow * Copy Service (VSS) backup jobs.

*

* Valid values: Set to "WindowsVSS":"enabled" to enable the WindowsVSS backup * option and create a Windows VSS backup. Set to "WindowsVSS""disabled" to create a regular * backup. The WindowsVSS option is not enabled by default. * @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; } public final void setBackupVaultName(String backupVaultName) { this.backupVaultName = backupVaultName; } @Override public final Builder backupVaultName(String backupVaultName) { this.backupVaultName = backupVaultName; return this; } public final String getResourceArn() { return resourceArn; } public final void setResourceArn(String resourceArn) { this.resourceArn = resourceArn; } @Override public final Builder resourceArn(String resourceArn) { this.resourceArn = resourceArn; return this; } public final String getIamRoleArn() { return iamRoleArn; } public final void setIamRoleArn(String iamRoleArn) { this.iamRoleArn = iamRoleArn; } @Override public final Builder iamRoleArn(String iamRoleArn) { this.iamRoleArn = iamRoleArn; return this; } public final String getIdempotencyToken() { return idempotencyToken; } public final void setIdempotencyToken(String idempotencyToken) { this.idempotencyToken = idempotencyToken; } @Override public final Builder idempotencyToken(String idempotencyToken) { this.idempotencyToken = idempotencyToken; return this; } public final Long getStartWindowMinutes() { return startWindowMinutes; } public final void setStartWindowMinutes(Long startWindowMinutes) { this.startWindowMinutes = startWindowMinutes; } @Override public final Builder startWindowMinutes(Long startWindowMinutes) { this.startWindowMinutes = startWindowMinutes; return this; } public final Long getCompleteWindowMinutes() { return completeWindowMinutes; } public final void setCompleteWindowMinutes(Long completeWindowMinutes) { this.completeWindowMinutes = completeWindowMinutes; } @Override public final Builder completeWindowMinutes(Long completeWindowMinutes) { this.completeWindowMinutes = completeWindowMinutes; return this; } public final Lifecycle.Builder getLifecycle() { return lifecycle != null ? lifecycle.toBuilder() : null; } public final void setLifecycle(Lifecycle.BuilderImpl lifecycle) { this.lifecycle = lifecycle != null ? lifecycle.build() : null; } @Override public final Builder lifecycle(Lifecycle lifecycle) { this.lifecycle = lifecycle; return this; } public final Map getRecoveryPointTags() { if (recoveryPointTags instanceof SdkAutoConstructMap) { return null; } return recoveryPointTags; } public final void setRecoveryPointTags(Map recoveryPointTags) { this.recoveryPointTags = TagsCopier.copy(recoveryPointTags); } @Override public final Builder recoveryPointTags(Map recoveryPointTags) { this.recoveryPointTags = TagsCopier.copy(recoveryPointTags); return this; } public final Map getBackupOptions() { if (backupOptions instanceof SdkAutoConstructMap) { return null; } return backupOptions; } public final void setBackupOptions(Map backupOptions) { this.backupOptions = BackupOptionsCopier.copy(backupOptions); } @Override public final Builder backupOptions(Map backupOptions) { this.backupOptions = BackupOptionsCopier.copy(backupOptions); return this; } @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; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy