/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include #include #include #include #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace DLM { namespace Model { /** *

[Snapshot and AMI policies only] Specifies a schedule for a snapshot * or AMI lifecycle policy.

See Also:

AWS API * Reference

*/ class Schedule { public: AWS_DLM_API Schedule(); AWS_DLM_API Schedule(Aws::Utils::Json::JsonView jsonValue); AWS_DLM_API Schedule& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_DLM_API Aws::Utils::Json::JsonValue Jsonize() const; /** *

The name of the schedule.

*/ inline const Aws::String& GetName() const{ return m_name; } /** *

The name of the schedule.

*/ inline bool NameHasBeenSet() const { return m_nameHasBeenSet; } /** *

The name of the schedule.

*/ inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; } /** *

The name of the schedule.

*/ inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); } /** *

The name of the schedule.

*/ inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); } /** *

The name of the schedule.

*/ inline Schedule& WithName(const Aws::String& value) { SetName(value); return *this;} /** *

The name of the schedule.

*/ inline Schedule& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;} /** *

The name of the schedule.

*/ inline Schedule& WithName(const char* value) { SetName(value); return *this;} /** *

Copy all user-defined tags on a source volume to snapshots of the volume * created by this policy.

*/ inline bool GetCopyTags() const{ return m_copyTags; } /** *

Copy all user-defined tags on a source volume to snapshots of the volume * created by this policy.

*/ inline bool CopyTagsHasBeenSet() const { return m_copyTagsHasBeenSet; } /** *

Copy all user-defined tags on a source volume to snapshots of the volume * created by this policy.

*/ inline void SetCopyTags(bool value) { m_copyTagsHasBeenSet = true; m_copyTags = value; } /** *

Copy all user-defined tags on a source volume to snapshots of the volume * created by this policy.

*/ inline Schedule& WithCopyTags(bool value) { SetCopyTags(value); return *this;} /** *

The tags to apply to policy-created resources. These user-defined tags are in * addition to the Amazon Web Services-added lifecycle tags.

*/ inline const Aws::Vector& GetTagsToAdd() const{ return m_tagsToAdd; } /** *

The tags to apply to policy-created resources. These user-defined tags are in * addition to the Amazon Web Services-added lifecycle tags.

*/ inline bool TagsToAddHasBeenSet() const { return m_tagsToAddHasBeenSet; } /** *

The tags to apply to policy-created resources. These user-defined tags are in * addition to the Amazon Web Services-added lifecycle tags.

*/ inline void SetTagsToAdd(const Aws::Vector& value) { m_tagsToAddHasBeenSet = true; m_tagsToAdd = value; } /** *

The tags to apply to policy-created resources. These user-defined tags are in * addition to the Amazon Web Services-added lifecycle tags.

*/ inline void SetTagsToAdd(Aws::Vector&& value) { m_tagsToAddHasBeenSet = true; m_tagsToAdd = std::move(value); } /** *

The tags to apply to policy-created resources. These user-defined tags are in * addition to the Amazon Web Services-added lifecycle tags.

*/ inline Schedule& WithTagsToAdd(const Aws::Vector& value) { SetTagsToAdd(value); return *this;} /** *

The tags to apply to policy-created resources. These user-defined tags are in * addition to the Amazon Web Services-added lifecycle tags.

*/ inline Schedule& WithTagsToAdd(Aws::Vector&& value) { SetTagsToAdd(std::move(value)); return *this;} /** *

The tags to apply to policy-created resources. These user-defined tags are in * addition to the Amazon Web Services-added lifecycle tags.

*/ inline Schedule& AddTagsToAdd(const Tag& value) { m_tagsToAddHasBeenSet = true; m_tagsToAdd.push_back(value); return *this; } /** *

The tags to apply to policy-created resources. These user-defined tags are in * addition to the Amazon Web Services-added lifecycle tags.

*/ inline Schedule& AddTagsToAdd(Tag&& value) { m_tagsToAddHasBeenSet = true; m_tagsToAdd.push_back(std::move(value)); return *this; } /** *

[AMI policies and snapshot policies that target instances only] A * collection of key/value pairs with values determined dynamically when the policy * is executed. Keys may be any valid Amazon EC2 tag key. Values must be in one of * the two following formats: $(instance-id) or * $(timestamp). Variable tags are only valid for EBS Snapshot * Management – Instance policies.

*/ inline const Aws::Vector& GetVariableTags() const{ return m_variableTags; } /** *

[AMI policies and snapshot policies that target instances only] A * collection of key/value pairs with values determined dynamically when the policy * is executed. Keys may be any valid Amazon EC2 tag key. Values must be in one of * the two following formats: $(instance-id) or * $(timestamp). Variable tags are only valid for EBS Snapshot * Management – Instance policies.

*/ inline bool VariableTagsHasBeenSet() const { return m_variableTagsHasBeenSet; } /** *

[AMI policies and snapshot policies that target instances only] A * collection of key/value pairs with values determined dynamically when the policy * is executed. Keys may be any valid Amazon EC2 tag key. Values must be in one of * the two following formats: $(instance-id) or * $(timestamp). Variable tags are only valid for EBS Snapshot * Management – Instance policies.

*/ inline void SetVariableTags(const Aws::Vector& value) { m_variableTagsHasBeenSet = true; m_variableTags = value; } /** *

[AMI policies and snapshot policies that target instances only] A * collection of key/value pairs with values determined dynamically when the policy * is executed. Keys may be any valid Amazon EC2 tag key. Values must be in one of * the two following formats: $(instance-id) or * $(timestamp). Variable tags are only valid for EBS Snapshot * Management – Instance policies.

*/ inline void SetVariableTags(Aws::Vector&& value) { m_variableTagsHasBeenSet = true; m_variableTags = std::move(value); } /** *

[AMI policies and snapshot policies that target instances only] A * collection of key/value pairs with values determined dynamically when the policy * is executed. Keys may be any valid Amazon EC2 tag key. Values must be in one of * the two following formats: $(instance-id) or * $(timestamp). Variable tags are only valid for EBS Snapshot * Management – Instance policies.

*/ inline Schedule& WithVariableTags(const Aws::Vector& value) { SetVariableTags(value); return *this;} /** *

[AMI policies and snapshot policies that target instances only] A * collection of key/value pairs with values determined dynamically when the policy * is executed. Keys may be any valid Amazon EC2 tag key. Values must be in one of * the two following formats: $(instance-id) or * $(timestamp). Variable tags are only valid for EBS Snapshot * Management – Instance policies.

*/ inline Schedule& WithVariableTags(Aws::Vector&& value) { SetVariableTags(std::move(value)); return *this;} /** *

[AMI policies and snapshot policies that target instances only] A * collection of key/value pairs with values determined dynamically when the policy * is executed. Keys may be any valid Amazon EC2 tag key. Values must be in one of * the two following formats: $(instance-id) or * $(timestamp). Variable tags are only valid for EBS Snapshot * Management – Instance policies.

*/ inline Schedule& AddVariableTags(const Tag& value) { m_variableTagsHasBeenSet = true; m_variableTags.push_back(value); return *this; } /** *

[AMI policies and snapshot policies that target instances only] A * collection of key/value pairs with values determined dynamically when the policy * is executed. Keys may be any valid Amazon EC2 tag key. Values must be in one of * the two following formats: $(instance-id) or * $(timestamp). Variable tags are only valid for EBS Snapshot * Management – Instance policies.

*/ inline Schedule& AddVariableTags(Tag&& value) { m_variableTagsHasBeenSet = true; m_variableTags.push_back(std::move(value)); return *this; } /** *

The creation rule.

*/ inline const CreateRule& GetCreateRule() const{ return m_createRule; } /** *

The creation rule.

*/ inline bool CreateRuleHasBeenSet() const { return m_createRuleHasBeenSet; } /** *

The creation rule.

*/ inline void SetCreateRule(const CreateRule& value) { m_createRuleHasBeenSet = true; m_createRule = value; } /** *

The creation rule.

*/ inline void SetCreateRule(CreateRule&& value) { m_createRuleHasBeenSet = true; m_createRule = std::move(value); } /** *

The creation rule.

*/ inline Schedule& WithCreateRule(const CreateRule& value) { SetCreateRule(value); return *this;} /** *

The creation rule.

*/ inline Schedule& WithCreateRule(CreateRule&& value) { SetCreateRule(std::move(value)); return *this;} /** *

The retention rule for snapshots or AMIs created by the policy.

*/ inline const RetainRule& GetRetainRule() const{ return m_retainRule; } /** *

The retention rule for snapshots or AMIs created by the policy.

*/ inline bool RetainRuleHasBeenSet() const { return m_retainRuleHasBeenSet; } /** *

The retention rule for snapshots or AMIs created by the policy.

*/ inline void SetRetainRule(const RetainRule& value) { m_retainRuleHasBeenSet = true; m_retainRule = value; } /** *

The retention rule for snapshots or AMIs created by the policy.

*/ inline void SetRetainRule(RetainRule&& value) { m_retainRuleHasBeenSet = true; m_retainRule = std::move(value); } /** *

The retention rule for snapshots or AMIs created by the policy.

*/ inline Schedule& WithRetainRule(const RetainRule& value) { SetRetainRule(value); return *this;} /** *

The retention rule for snapshots or AMIs created by the policy.

*/ inline Schedule& WithRetainRule(RetainRule&& value) { SetRetainRule(std::move(value)); return *this;} /** *

[Snapshot policies only] The rule for enabling fast snapshot * restore.

*/ inline const FastRestoreRule& GetFastRestoreRule() const{ return m_fastRestoreRule; } /** *

[Snapshot policies only] The rule for enabling fast snapshot * restore.

*/ inline bool FastRestoreRuleHasBeenSet() const { return m_fastRestoreRuleHasBeenSet; } /** *

[Snapshot policies only] The rule for enabling fast snapshot * restore.

*/ inline void SetFastRestoreRule(const FastRestoreRule& value) { m_fastRestoreRuleHasBeenSet = true; m_fastRestoreRule = value; } /** *

[Snapshot policies only] The rule for enabling fast snapshot * restore.

*/ inline void SetFastRestoreRule(FastRestoreRule&& value) { m_fastRestoreRuleHasBeenSet = true; m_fastRestoreRule = std::move(value); } /** *

[Snapshot policies only] The rule for enabling fast snapshot * restore.

*/ inline Schedule& WithFastRestoreRule(const FastRestoreRule& value) { SetFastRestoreRule(value); return *this;} /** *

[Snapshot policies only] The rule for enabling fast snapshot * restore.

*/ inline Schedule& WithFastRestoreRule(FastRestoreRule&& value) { SetFastRestoreRule(std::move(value)); return *this;} /** *

Specifies a rule for copying snapshots or AMIs across regions.

*

You can't specify cross-Region copy rules for policies that create snapshots * on an Outpost. If the policy creates snapshots in a Region, then snapshots can * be copied to up to three Regions or Outposts.

*/ inline const Aws::Vector& GetCrossRegionCopyRules() const{ return m_crossRegionCopyRules; } /** *

Specifies a rule for copying snapshots or AMIs across regions.

*

You can't specify cross-Region copy rules for policies that create snapshots * on an Outpost. If the policy creates snapshots in a Region, then snapshots can * be copied to up to three Regions or Outposts.

*/ inline bool CrossRegionCopyRulesHasBeenSet() const { return m_crossRegionCopyRulesHasBeenSet; } /** *

Specifies a rule for copying snapshots or AMIs across regions.

*

You can't specify cross-Region copy rules for policies that create snapshots * on an Outpost. If the policy creates snapshots in a Region, then snapshots can * be copied to up to three Regions or Outposts.

*/ inline void SetCrossRegionCopyRules(const Aws::Vector& value) { m_crossRegionCopyRulesHasBeenSet = true; m_crossRegionCopyRules = value; } /** *

Specifies a rule for copying snapshots or AMIs across regions.

*

You can't specify cross-Region copy rules for policies that create snapshots * on an Outpost. If the policy creates snapshots in a Region, then snapshots can * be copied to up to three Regions or Outposts.

*/ inline void SetCrossRegionCopyRules(Aws::Vector&& value) { m_crossRegionCopyRulesHasBeenSet = true; m_crossRegionCopyRules = std::move(value); } /** *

Specifies a rule for copying snapshots or AMIs across regions.

*

You can't specify cross-Region copy rules for policies that create snapshots * on an Outpost. If the policy creates snapshots in a Region, then snapshots can * be copied to up to three Regions or Outposts.

*/ inline Schedule& WithCrossRegionCopyRules(const Aws::Vector& value) { SetCrossRegionCopyRules(value); return *this;} /** *

Specifies a rule for copying snapshots or AMIs across regions.

*

You can't specify cross-Region copy rules for policies that create snapshots * on an Outpost. If the policy creates snapshots in a Region, then snapshots can * be copied to up to three Regions or Outposts.

*/ inline Schedule& WithCrossRegionCopyRules(Aws::Vector&& value) { SetCrossRegionCopyRules(std::move(value)); return *this;} /** *

Specifies a rule for copying snapshots or AMIs across regions.

*

You can't specify cross-Region copy rules for policies that create snapshots * on an Outpost. If the policy creates snapshots in a Region, then snapshots can * be copied to up to three Regions or Outposts.

*/ inline Schedule& AddCrossRegionCopyRules(const CrossRegionCopyRule& value) { m_crossRegionCopyRulesHasBeenSet = true; m_crossRegionCopyRules.push_back(value); return *this; } /** *

Specifies a rule for copying snapshots or AMIs across regions.

*

You can't specify cross-Region copy rules for policies that create snapshots * on an Outpost. If the policy creates snapshots in a Region, then snapshots can * be copied to up to three Regions or Outposts.

*/ inline Schedule& AddCrossRegionCopyRules(CrossRegionCopyRule&& value) { m_crossRegionCopyRulesHasBeenSet = true; m_crossRegionCopyRules.push_back(std::move(value)); return *this; } /** *

[Snapshot policies only] The rule for sharing snapshots with other * Amazon Web Services accounts.

*/ inline const Aws::Vector& GetShareRules() const{ return m_shareRules; } /** *

[Snapshot policies only] The rule for sharing snapshots with other * Amazon Web Services accounts.

*/ inline bool ShareRulesHasBeenSet() const { return m_shareRulesHasBeenSet; } /** *

[Snapshot policies only] The rule for sharing snapshots with other * Amazon Web Services accounts.

*/ inline void SetShareRules(const Aws::Vector& value) { m_shareRulesHasBeenSet = true; m_shareRules = value; } /** *

[Snapshot policies only] The rule for sharing snapshots with other * Amazon Web Services accounts.

*/ inline void SetShareRules(Aws::Vector&& value) { m_shareRulesHasBeenSet = true; m_shareRules = std::move(value); } /** *

[Snapshot policies only] The rule for sharing snapshots with other * Amazon Web Services accounts.

*/ inline Schedule& WithShareRules(const Aws::Vector& value) { SetShareRules(value); return *this;} /** *

[Snapshot policies only] The rule for sharing snapshots with other * Amazon Web Services accounts.

*/ inline Schedule& WithShareRules(Aws::Vector&& value) { SetShareRules(std::move(value)); return *this;} /** *

[Snapshot policies only] The rule for sharing snapshots with other * Amazon Web Services accounts.

*/ inline Schedule& AddShareRules(const ShareRule& value) { m_shareRulesHasBeenSet = true; m_shareRules.push_back(value); return *this; } /** *

[Snapshot policies only] The rule for sharing snapshots with other * Amazon Web Services accounts.

*/ inline Schedule& AddShareRules(ShareRule&& value) { m_shareRulesHasBeenSet = true; m_shareRules.push_back(std::move(value)); return *this; } /** *

[AMI policies only] The AMI deprecation rule for the schedule.

*/ inline const DeprecateRule& GetDeprecateRule() const{ return m_deprecateRule; } /** *

[AMI policies only] The AMI deprecation rule for the schedule.

*/ inline bool DeprecateRuleHasBeenSet() const { return m_deprecateRuleHasBeenSet; } /** *

[AMI policies only] The AMI deprecation rule for the schedule.

*/ inline void SetDeprecateRule(const DeprecateRule& value) { m_deprecateRuleHasBeenSet = true; m_deprecateRule = value; } /** *

[AMI policies only] The AMI deprecation rule for the schedule.

*/ inline void SetDeprecateRule(DeprecateRule&& value) { m_deprecateRuleHasBeenSet = true; m_deprecateRule = std::move(value); } /** *

[AMI policies only] The AMI deprecation rule for the schedule.

*/ inline Schedule& WithDeprecateRule(const DeprecateRule& value) { SetDeprecateRule(value); return *this;} /** *

[AMI policies only] The AMI deprecation rule for the schedule.

*/ inline Schedule& WithDeprecateRule(DeprecateRule&& value) { SetDeprecateRule(std::move(value)); return *this;} /** *

[Snapshot policies that target volumes only] The snapshot archiving * rule for the schedule. When you specify an archiving rule, snapshots are * automatically moved from the standard tier to the archive tier once the * schedule's retention threshold is met. Snapshots are then retained in the * archive tier for the archive retention period that you specify.

For more * information about using snapshot archiving, see Considerations * for snapshot lifecycle policies.

*/ inline const ArchiveRule& GetArchiveRule() const{ return m_archiveRule; } /** *

[Snapshot policies that target volumes only] The snapshot archiving * rule for the schedule. When you specify an archiving rule, snapshots are * automatically moved from the standard tier to the archive tier once the * schedule's retention threshold is met. Snapshots are then retained in the * archive tier for the archive retention period that you specify.

For more * information about using snapshot archiving, see Considerations * for snapshot lifecycle policies.

*/ inline bool ArchiveRuleHasBeenSet() const { return m_archiveRuleHasBeenSet; } /** *

[Snapshot policies that target volumes only] The snapshot archiving * rule for the schedule. When you specify an archiving rule, snapshots are * automatically moved from the standard tier to the archive tier once the * schedule's retention threshold is met. Snapshots are then retained in the * archive tier for the archive retention period that you specify.

For more * information about using snapshot archiving, see Considerations * for snapshot lifecycle policies.

*/ inline void SetArchiveRule(const ArchiveRule& value) { m_archiveRuleHasBeenSet = true; m_archiveRule = value; } /** *

[Snapshot policies that target volumes only] The snapshot archiving * rule for the schedule. When you specify an archiving rule, snapshots are * automatically moved from the standard tier to the archive tier once the * schedule's retention threshold is met. Snapshots are then retained in the * archive tier for the archive retention period that you specify.

For more * information about using snapshot archiving, see Considerations * for snapshot lifecycle policies.

*/ inline void SetArchiveRule(ArchiveRule&& value) { m_archiveRuleHasBeenSet = true; m_archiveRule = std::move(value); } /** *

[Snapshot policies that target volumes only] The snapshot archiving * rule for the schedule. When you specify an archiving rule, snapshots are * automatically moved from the standard tier to the archive tier once the * schedule's retention threshold is met. Snapshots are then retained in the * archive tier for the archive retention period that you specify.

For more * information about using snapshot archiving, see Considerations * for snapshot lifecycle policies.

*/ inline Schedule& WithArchiveRule(const ArchiveRule& value) { SetArchiveRule(value); return *this;} /** *

[Snapshot policies that target volumes only] The snapshot archiving * rule for the schedule. When you specify an archiving rule, snapshots are * automatically moved from the standard tier to the archive tier once the * schedule's retention threshold is met. Snapshots are then retained in the * archive tier for the archive retention period that you specify.

For more * information about using snapshot archiving, see Considerations * for snapshot lifecycle policies.

*/ inline Schedule& WithArchiveRule(ArchiveRule&& value) { SetArchiveRule(std::move(value)); return *this;} private: Aws::String m_name; bool m_nameHasBeenSet = false; bool m_copyTags; bool m_copyTagsHasBeenSet = false; Aws::Vector m_tagsToAdd; bool m_tagsToAddHasBeenSet = false; Aws::Vector m_variableTags; bool m_variableTagsHasBeenSet = false; CreateRule m_createRule; bool m_createRuleHasBeenSet = false; RetainRule m_retainRule; bool m_retainRuleHasBeenSet = false; FastRestoreRule m_fastRestoreRule; bool m_fastRestoreRuleHasBeenSet = false; Aws::Vector m_crossRegionCopyRules; bool m_crossRegionCopyRulesHasBeenSet = false; Aws::Vector m_shareRules; bool m_shareRulesHasBeenSet = false; DeprecateRule m_deprecateRule; bool m_deprecateRuleHasBeenSet = false; ArchiveRule m_archiveRule; bool m_archiveRuleHasBeenSet = false; }; } // namespace Model } // namespace DLM } // namespace Aws