Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.amazon.awssdk.services.backup.model.BackupRuleInput Maven / Gradle / Ivy
Go to download
The AWS Java SDK for Backup module holds the client classes that are used for
communicating with Backup.
/*
* 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.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
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 java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
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;
/**
*
* Specifies a scheduled task used to back up a selection of resources.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class BackupRuleInput implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField RULE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RuleName").getter(getter(BackupRuleInput::ruleName)).setter(setter(Builder::ruleName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RuleName").build()).build();
private static final SdkField TARGET_BACKUP_VAULT_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TargetBackupVaultName").getter(getter(BackupRuleInput::targetBackupVaultName))
.setter(setter(Builder::targetBackupVaultName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TargetBackupVaultName").build())
.build();
private static final SdkField SCHEDULE_EXPRESSION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ScheduleExpression").getter(getter(BackupRuleInput::scheduleExpression))
.setter(setter(Builder::scheduleExpression))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ScheduleExpression").build())
.build();
private static final SdkField START_WINDOW_MINUTES_FIELD = SdkField. builder(MarshallingType.LONG)
.memberName("StartWindowMinutes").getter(getter(BackupRuleInput::startWindowMinutes))
.setter(setter(Builder::startWindowMinutes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StartWindowMinutes").build())
.build();
private static final SdkField COMPLETION_WINDOW_MINUTES_FIELD = SdkField. builder(MarshallingType.LONG)
.memberName("CompletionWindowMinutes").getter(getter(BackupRuleInput::completionWindowMinutes))
.setter(setter(Builder::completionWindowMinutes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CompletionWindowMinutes").build())
.build();
private static final SdkField LIFECYCLE_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("Lifecycle").getter(getter(BackupRuleInput::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(BackupRuleInput::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> COPY_ACTIONS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("CopyActions")
.getter(getter(BackupRuleInput::copyActions))
.setter(setter(Builder::copyActions))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CopyActions").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(CopyAction::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField ENABLE_CONTINUOUS_BACKUP_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("EnableContinuousBackup").getter(getter(BackupRuleInput::enableContinuousBackup))
.setter(setter(Builder::enableContinuousBackup))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnableContinuousBackup").build())
.build();
private static final SdkField SCHEDULE_EXPRESSION_TIMEZONE_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("ScheduleExpressionTimezone")
.getter(getter(BackupRuleInput::scheduleExpressionTimezone))
.setter(setter(Builder::scheduleExpressionTimezone))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ScheduleExpressionTimezone").build())
.build();
private static final SdkField> INDEX_ACTIONS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("IndexActions")
.getter(getter(BackupRuleInput::indexActions))
.setter(setter(Builder::indexActions))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IndexActions").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(IndexAction::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(RULE_NAME_FIELD,
TARGET_BACKUP_VAULT_NAME_FIELD, SCHEDULE_EXPRESSION_FIELD, START_WINDOW_MINUTES_FIELD,
COMPLETION_WINDOW_MINUTES_FIELD, LIFECYCLE_FIELD, RECOVERY_POINT_TAGS_FIELD, COPY_ACTIONS_FIELD,
ENABLE_CONTINUOUS_BACKUP_FIELD, SCHEDULE_EXPRESSION_TIMEZONE_FIELD, INDEX_ACTIONS_FIELD));
private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer();
private static final long serialVersionUID = 1L;
private final String ruleName;
private final String targetBackupVaultName;
private final String scheduleExpression;
private final Long startWindowMinutes;
private final Long completionWindowMinutes;
private final Lifecycle lifecycle;
private final Map recoveryPointTags;
private final List copyActions;
private final Boolean enableContinuousBackup;
private final String scheduleExpressionTimezone;
private final List indexActions;
private BackupRuleInput(BuilderImpl builder) {
this.ruleName = builder.ruleName;
this.targetBackupVaultName = builder.targetBackupVaultName;
this.scheduleExpression = builder.scheduleExpression;
this.startWindowMinutes = builder.startWindowMinutes;
this.completionWindowMinutes = builder.completionWindowMinutes;
this.lifecycle = builder.lifecycle;
this.recoveryPointTags = builder.recoveryPointTags;
this.copyActions = builder.copyActions;
this.enableContinuousBackup = builder.enableContinuousBackup;
this.scheduleExpressionTimezone = builder.scheduleExpressionTimezone;
this.indexActions = builder.indexActions;
}
/**
*
* A display name for a backup rule. Must contain 1 to 50 alphanumeric or '-_.' characters.
*
*
* @return A display name for a backup rule. Must contain 1 to 50 alphanumeric or '-_.' characters.
*/
public final String ruleName() {
return ruleName;
}
/**
*
* 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 targetBackupVaultName() {
return targetBackupVaultName;
}
/**
*
* A CRON expression in UTC specifying when Backup initiates a backup job.
*
*
* @return A CRON expression in UTC specifying when Backup initiates a backup job.
*/
public final String scheduleExpression() {
return scheduleExpression;
}
/**
*
* 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. 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. 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 after a backup job is successfully started before it must be completed or it will be canceled
* by 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 Backup. This value is optional.
*/
public final Long completionWindowMinutes() {
return completionWindowMinutes;
}
/**
*
* 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 storage.
*
*
* 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
* storage.
*
*
* 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 CopyActions 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 hasCopyActions() {
return copyActions != null && !(copyActions instanceof SdkAutoConstructList);
}
/**
*
* An array of CopyAction
objects, which contains the details of the copy operation.
*
*
* 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 #hasCopyActions} method.
*
*
* @return An array of CopyAction
objects, which contains the details of the copy operation.
*/
public final List copyActions() {
return copyActions;
}
/**
*
* Specifies whether Backup creates continuous backups. True causes Backup to create continuous backups capable of
* point-in-time restore (PITR). False (or not specified) causes Backup to create snapshot backups.
*
*
* @return Specifies whether Backup creates continuous backups. True causes Backup to create continuous backups
* capable of point-in-time restore (PITR). False (or not specified) causes Backup to create snapshot
* backups.
*/
public final Boolean enableContinuousBackup() {
return enableContinuousBackup;
}
/**
*
* The timezone in which the schedule expression is set. By default, ScheduleExpressions are in UTC. You can modify
* this to a specified timezone.
*
*
* @return The timezone in which the schedule expression is set. By default, ScheduleExpressions are in UTC. You can
* modify this to a specified timezone.
*/
public final String scheduleExpressionTimezone() {
return scheduleExpressionTimezone;
}
/**
* For responses, this returns true if the service returned a value for the IndexActions 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 hasIndexActions() {
return indexActions != null && !(indexActions instanceof SdkAutoConstructList);
}
/**
*
* There can up to one IndexAction in each BackupRule, as each backup can have 0 or 1 backup index associated with
* it.
*
*
* Within the array is ResourceTypes. Only 1 resource type will be accepted for each BackupRule. Valid values:
*
*
*
* 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 #hasIndexActions} method.
*
*
* @return There can up to one IndexAction in each BackupRule, as each backup can have 0 or 1 backup index
* associated with it.
*
* Within the array is ResourceTypes. Only 1 resource type will be accepted for each BackupRule. Valid
* values:
*
*