/** * 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 namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace DLM { namespace Model { /** *

[All policy types] Specifies the configuration of a lifecycle * policy.

See Also:

AWS * API Reference

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

[All policy types] The valid target resource types and actions a * policy can manage. Specify EBS_SNAPSHOT_MANAGEMENT to create a * lifecycle policy that manages the lifecycle of Amazon EBS snapshots. Specify * IMAGE_MANAGEMENT to create a lifecycle policy that manages the * lifecycle of EBS-backed AMIs. Specify EVENT_BASED_POLICY to create * an event-based policy that performs specific actions when a defined event occurs * in your Amazon Web Services account.

The default is * EBS_SNAPSHOT_MANAGEMENT.

*/ inline const PolicyTypeValues& GetPolicyType() const{ return m_policyType; } /** *

[All policy types] The valid target resource types and actions a * policy can manage. Specify EBS_SNAPSHOT_MANAGEMENT to create a * lifecycle policy that manages the lifecycle of Amazon EBS snapshots. Specify * IMAGE_MANAGEMENT to create a lifecycle policy that manages the * lifecycle of EBS-backed AMIs. Specify EVENT_BASED_POLICY to create * an event-based policy that performs specific actions when a defined event occurs * in your Amazon Web Services account.

The default is * EBS_SNAPSHOT_MANAGEMENT.

*/ inline bool PolicyTypeHasBeenSet() const { return m_policyTypeHasBeenSet; } /** *

[All policy types] The valid target resource types and actions a * policy can manage. Specify EBS_SNAPSHOT_MANAGEMENT to create a * lifecycle policy that manages the lifecycle of Amazon EBS snapshots. Specify * IMAGE_MANAGEMENT to create a lifecycle policy that manages the * lifecycle of EBS-backed AMIs. Specify EVENT_BASED_POLICY to create * an event-based policy that performs specific actions when a defined event occurs * in your Amazon Web Services account.

The default is * EBS_SNAPSHOT_MANAGEMENT.

*/ inline void SetPolicyType(const PolicyTypeValues& value) { m_policyTypeHasBeenSet = true; m_policyType = value; } /** *

[All policy types] The valid target resource types and actions a * policy can manage. Specify EBS_SNAPSHOT_MANAGEMENT to create a * lifecycle policy that manages the lifecycle of Amazon EBS snapshots. Specify * IMAGE_MANAGEMENT to create a lifecycle policy that manages the * lifecycle of EBS-backed AMIs. Specify EVENT_BASED_POLICY to create * an event-based policy that performs specific actions when a defined event occurs * in your Amazon Web Services account.

The default is * EBS_SNAPSHOT_MANAGEMENT.

*/ inline void SetPolicyType(PolicyTypeValues&& value) { m_policyTypeHasBeenSet = true; m_policyType = std::move(value); } /** *

[All policy types] The valid target resource types and actions a * policy can manage. Specify EBS_SNAPSHOT_MANAGEMENT to create a * lifecycle policy that manages the lifecycle of Amazon EBS snapshots. Specify * IMAGE_MANAGEMENT to create a lifecycle policy that manages the * lifecycle of EBS-backed AMIs. Specify EVENT_BASED_POLICY to create * an event-based policy that performs specific actions when a defined event occurs * in your Amazon Web Services account.

The default is * EBS_SNAPSHOT_MANAGEMENT.

*/ inline PolicyDetails& WithPolicyType(const PolicyTypeValues& value) { SetPolicyType(value); return *this;} /** *

[All policy types] The valid target resource types and actions a * policy can manage. Specify EBS_SNAPSHOT_MANAGEMENT to create a * lifecycle policy that manages the lifecycle of Amazon EBS snapshots. Specify * IMAGE_MANAGEMENT to create a lifecycle policy that manages the * lifecycle of EBS-backed AMIs. Specify EVENT_BASED_POLICY to create * an event-based policy that performs specific actions when a defined event occurs * in your Amazon Web Services account.

The default is * EBS_SNAPSHOT_MANAGEMENT.

*/ inline PolicyDetails& WithPolicyType(PolicyTypeValues&& value) { SetPolicyType(std::move(value)); return *this;} /** *

[Snapshot policies only] The target resource type for snapshot and * AMI lifecycle policies. Use VOLUME to create snapshots of * individual volumes or use INSTANCE to create multi-volume snapshots * from the volumes for an instance.

*/ inline const Aws::Vector& GetResourceTypes() const{ return m_resourceTypes; } /** *

[Snapshot policies only] The target resource type for snapshot and * AMI lifecycle policies. Use VOLUME to create snapshots of * individual volumes or use INSTANCE to create multi-volume snapshots * from the volumes for an instance.

*/ inline bool ResourceTypesHasBeenSet() const { return m_resourceTypesHasBeenSet; } /** *

[Snapshot policies only] The target resource type for snapshot and * AMI lifecycle policies. Use VOLUME to create snapshots of * individual volumes or use INSTANCE to create multi-volume snapshots * from the volumes for an instance.

*/ inline void SetResourceTypes(const Aws::Vector& value) { m_resourceTypesHasBeenSet = true; m_resourceTypes = value; } /** *

[Snapshot policies only] The target resource type for snapshot and * AMI lifecycle policies. Use VOLUME to create snapshots of * individual volumes or use INSTANCE to create multi-volume snapshots * from the volumes for an instance.

*/ inline void SetResourceTypes(Aws::Vector&& value) { m_resourceTypesHasBeenSet = true; m_resourceTypes = std::move(value); } /** *

[Snapshot policies only] The target resource type for snapshot and * AMI lifecycle policies. Use VOLUME to create snapshots of * individual volumes or use INSTANCE to create multi-volume snapshots * from the volumes for an instance.

*/ inline PolicyDetails& WithResourceTypes(const Aws::Vector& value) { SetResourceTypes(value); return *this;} /** *

[Snapshot policies only] The target resource type for snapshot and * AMI lifecycle policies. Use VOLUME to create snapshots of * individual volumes or use INSTANCE to create multi-volume snapshots * from the volumes for an instance.

*/ inline PolicyDetails& WithResourceTypes(Aws::Vector&& value) { SetResourceTypes(std::move(value)); return *this;} /** *

[Snapshot policies only] The target resource type for snapshot and * AMI lifecycle policies. Use VOLUME to create snapshots of * individual volumes or use INSTANCE to create multi-volume snapshots * from the volumes for an instance.

*/ inline PolicyDetails& AddResourceTypes(const ResourceTypeValues& value) { m_resourceTypesHasBeenSet = true; m_resourceTypes.push_back(value); return *this; } /** *

[Snapshot policies only] The target resource type for snapshot and * AMI lifecycle policies. Use VOLUME to create snapshots of * individual volumes or use INSTANCE to create multi-volume snapshots * from the volumes for an instance.

*/ inline PolicyDetails& AddResourceTypes(ResourceTypeValues&& value) { m_resourceTypesHasBeenSet = true; m_resourceTypes.push_back(std::move(value)); return *this; } /** *

[Snapshot and AMI policies only] The location of the resources to * backup. If the source resources are located in an Amazon Web Services Region, * specify CLOUD. If the source resources are located on an Outpost in * your account, specify OUTPOST.

If you specify * OUTPOST, Amazon Data Lifecycle Manager backs up all resources of * the specified type with matching target tags across all of the Outposts in your * account.

*/ inline const Aws::Vector& GetResourceLocations() const{ return m_resourceLocations; } /** *

[Snapshot and AMI policies only] The location of the resources to * backup. If the source resources are located in an Amazon Web Services Region, * specify CLOUD. If the source resources are located on an Outpost in * your account, specify OUTPOST.

If you specify * OUTPOST, Amazon Data Lifecycle Manager backs up all resources of * the specified type with matching target tags across all of the Outposts in your * account.

*/ inline bool ResourceLocationsHasBeenSet() const { return m_resourceLocationsHasBeenSet; } /** *

[Snapshot and AMI policies only] The location of the resources to * backup. If the source resources are located in an Amazon Web Services Region, * specify CLOUD. If the source resources are located on an Outpost in * your account, specify OUTPOST.

If you specify * OUTPOST, Amazon Data Lifecycle Manager backs up all resources of * the specified type with matching target tags across all of the Outposts in your * account.

*/ inline void SetResourceLocations(const Aws::Vector& value) { m_resourceLocationsHasBeenSet = true; m_resourceLocations = value; } /** *

[Snapshot and AMI policies only] The location of the resources to * backup. If the source resources are located in an Amazon Web Services Region, * specify CLOUD. If the source resources are located on an Outpost in * your account, specify OUTPOST.

If you specify * OUTPOST, Amazon Data Lifecycle Manager backs up all resources of * the specified type with matching target tags across all of the Outposts in your * account.

*/ inline void SetResourceLocations(Aws::Vector&& value) { m_resourceLocationsHasBeenSet = true; m_resourceLocations = std::move(value); } /** *

[Snapshot and AMI policies only] The location of the resources to * backup. If the source resources are located in an Amazon Web Services Region, * specify CLOUD. If the source resources are located on an Outpost in * your account, specify OUTPOST.

If you specify * OUTPOST, Amazon Data Lifecycle Manager backs up all resources of * the specified type with matching target tags across all of the Outposts in your * account.

*/ inline PolicyDetails& WithResourceLocations(const Aws::Vector& value) { SetResourceLocations(value); return *this;} /** *

[Snapshot and AMI policies only] The location of the resources to * backup. If the source resources are located in an Amazon Web Services Region, * specify CLOUD. If the source resources are located on an Outpost in * your account, specify OUTPOST.

If you specify * OUTPOST, Amazon Data Lifecycle Manager backs up all resources of * the specified type with matching target tags across all of the Outposts in your * account.

*/ inline PolicyDetails& WithResourceLocations(Aws::Vector&& value) { SetResourceLocations(std::move(value)); return *this;} /** *

[Snapshot and AMI policies only] The location of the resources to * backup. If the source resources are located in an Amazon Web Services Region, * specify CLOUD. If the source resources are located on an Outpost in * your account, specify OUTPOST.

If you specify * OUTPOST, Amazon Data Lifecycle Manager backs up all resources of * the specified type with matching target tags across all of the Outposts in your * account.

*/ inline PolicyDetails& AddResourceLocations(const ResourceLocationValues& value) { m_resourceLocationsHasBeenSet = true; m_resourceLocations.push_back(value); return *this; } /** *

[Snapshot and AMI policies only] The location of the resources to * backup. If the source resources are located in an Amazon Web Services Region, * specify CLOUD. If the source resources are located on an Outpost in * your account, specify OUTPOST.

If you specify * OUTPOST, Amazon Data Lifecycle Manager backs up all resources of * the specified type with matching target tags across all of the Outposts in your * account.

*/ inline PolicyDetails& AddResourceLocations(ResourceLocationValues&& value) { m_resourceLocationsHasBeenSet = true; m_resourceLocations.push_back(std::move(value)); return *this; } /** *

[Snapshot and AMI policies only] The single tag that identifies * targeted resources for this policy.

*/ inline const Aws::Vector& GetTargetTags() const{ return m_targetTags; } /** *

[Snapshot and AMI policies only] The single tag that identifies * targeted resources for this policy.

*/ inline bool TargetTagsHasBeenSet() const { return m_targetTagsHasBeenSet; } /** *

[Snapshot and AMI policies only] The single tag that identifies * targeted resources for this policy.

*/ inline void SetTargetTags(const Aws::Vector& value) { m_targetTagsHasBeenSet = true; m_targetTags = value; } /** *

[Snapshot and AMI policies only] The single tag that identifies * targeted resources for this policy.

*/ inline void SetTargetTags(Aws::Vector&& value) { m_targetTagsHasBeenSet = true; m_targetTags = std::move(value); } /** *

[Snapshot and AMI policies only] The single tag that identifies * targeted resources for this policy.

*/ inline PolicyDetails& WithTargetTags(const Aws::Vector& value) { SetTargetTags(value); return *this;} /** *

[Snapshot and AMI policies only] The single tag that identifies * targeted resources for this policy.

*/ inline PolicyDetails& WithTargetTags(Aws::Vector&& value) { SetTargetTags(std::move(value)); return *this;} /** *

[Snapshot and AMI policies only] The single tag that identifies * targeted resources for this policy.

*/ inline PolicyDetails& AddTargetTags(const Tag& value) { m_targetTagsHasBeenSet = true; m_targetTags.push_back(value); return *this; } /** *

[Snapshot and AMI policies only] The single tag that identifies * targeted resources for this policy.

*/ inline PolicyDetails& AddTargetTags(Tag&& value) { m_targetTagsHasBeenSet = true; m_targetTags.push_back(std::move(value)); return *this; } /** *

[Snapshot and AMI policies only] The schedules of policy-defined * actions for snapshot and AMI lifecycle policies. A policy can have up to four * schedules—one mandatory schedule and up to three optional schedules.

*/ inline const Aws::Vector& GetSchedules() const{ return m_schedules; } /** *

[Snapshot and AMI policies only] The schedules of policy-defined * actions for snapshot and AMI lifecycle policies. A policy can have up to four * schedules—one mandatory schedule and up to three optional schedules.

*/ inline bool SchedulesHasBeenSet() const { return m_schedulesHasBeenSet; } /** *

[Snapshot and AMI policies only] The schedules of policy-defined * actions for snapshot and AMI lifecycle policies. A policy can have up to four * schedules—one mandatory schedule and up to three optional schedules.

*/ inline void SetSchedules(const Aws::Vector& value) { m_schedulesHasBeenSet = true; m_schedules = value; } /** *

[Snapshot and AMI policies only] The schedules of policy-defined * actions for snapshot and AMI lifecycle policies. A policy can have up to four * schedules—one mandatory schedule and up to three optional schedules.

*/ inline void SetSchedules(Aws::Vector&& value) { m_schedulesHasBeenSet = true; m_schedules = std::move(value); } /** *

[Snapshot and AMI policies only] The schedules of policy-defined * actions for snapshot and AMI lifecycle policies. A policy can have up to four * schedules—one mandatory schedule and up to three optional schedules.

*/ inline PolicyDetails& WithSchedules(const Aws::Vector& value) { SetSchedules(value); return *this;} /** *

[Snapshot and AMI policies only] The schedules of policy-defined * actions for snapshot and AMI lifecycle policies. A policy can have up to four * schedules—one mandatory schedule and up to three optional schedules.

*/ inline PolicyDetails& WithSchedules(Aws::Vector&& value) { SetSchedules(std::move(value)); return *this;} /** *

[Snapshot and AMI policies only] The schedules of policy-defined * actions for snapshot and AMI lifecycle policies. A policy can have up to four * schedules—one mandatory schedule and up to three optional schedules.

*/ inline PolicyDetails& AddSchedules(const Schedule& value) { m_schedulesHasBeenSet = true; m_schedules.push_back(value); return *this; } /** *

[Snapshot and AMI policies only] The schedules of policy-defined * actions for snapshot and AMI lifecycle policies. A policy can have up to four * schedules—one mandatory schedule and up to three optional schedules.

*/ inline PolicyDetails& AddSchedules(Schedule&& value) { m_schedulesHasBeenSet = true; m_schedules.push_back(std::move(value)); return *this; } /** *

[Snapshot and AMI policies only] A set of optional parameters for * snapshot and AMI lifecycle policies.

If you are modifying a * policy that was created or previously modified using the Amazon Data Lifecycle * Manager console, then you must include this parameter and specify either the * default values or the new values that you require. You can't omit this parameter * or set its values to null.

*/ inline const Parameters& GetParameters() const{ return m_parameters; } /** *

[Snapshot and AMI policies only] A set of optional parameters for * snapshot and AMI lifecycle policies.

If you are modifying a * policy that was created or previously modified using the Amazon Data Lifecycle * Manager console, then you must include this parameter and specify either the * default values or the new values that you require. You can't omit this parameter * or set its values to null.

*/ inline bool ParametersHasBeenSet() const { return m_parametersHasBeenSet; } /** *

[Snapshot and AMI policies only] A set of optional parameters for * snapshot and AMI lifecycle policies.

If you are modifying a * policy that was created or previously modified using the Amazon Data Lifecycle * Manager console, then you must include this parameter and specify either the * default values or the new values that you require. You can't omit this parameter * or set its values to null.

*/ inline void SetParameters(const Parameters& value) { m_parametersHasBeenSet = true; m_parameters = value; } /** *

[Snapshot and AMI policies only] A set of optional parameters for * snapshot and AMI lifecycle policies.

If you are modifying a * policy that was created or previously modified using the Amazon Data Lifecycle * Manager console, then you must include this parameter and specify either the * default values or the new values that you require. You can't omit this parameter * or set its values to null.

*/ inline void SetParameters(Parameters&& value) { m_parametersHasBeenSet = true; m_parameters = std::move(value); } /** *

[Snapshot and AMI policies only] A set of optional parameters for * snapshot and AMI lifecycle policies.

If you are modifying a * policy that was created or previously modified using the Amazon Data Lifecycle * Manager console, then you must include this parameter and specify either the * default values or the new values that you require. You can't omit this parameter * or set its values to null.

*/ inline PolicyDetails& WithParameters(const Parameters& value) { SetParameters(value); return *this;} /** *

[Snapshot and AMI policies only] A set of optional parameters for * snapshot and AMI lifecycle policies.

If you are modifying a * policy that was created or previously modified using the Amazon Data Lifecycle * Manager console, then you must include this parameter and specify either the * default values or the new values that you require. You can't omit this parameter * or set its values to null.

*/ inline PolicyDetails& WithParameters(Parameters&& value) { SetParameters(std::move(value)); return *this;} /** *

[Event-based policies only] The event that activates the event-based * policy.

*/ inline const EventSource& GetEventSource() const{ return m_eventSource; } /** *

[Event-based policies only] The event that activates the event-based * policy.

*/ inline bool EventSourceHasBeenSet() const { return m_eventSourceHasBeenSet; } /** *

[Event-based policies only] The event that activates the event-based * policy.

*/ inline void SetEventSource(const EventSource& value) { m_eventSourceHasBeenSet = true; m_eventSource = value; } /** *

[Event-based policies only] The event that activates the event-based * policy.

*/ inline void SetEventSource(EventSource&& value) { m_eventSourceHasBeenSet = true; m_eventSource = std::move(value); } /** *

[Event-based policies only] The event that activates the event-based * policy.

*/ inline PolicyDetails& WithEventSource(const EventSource& value) { SetEventSource(value); return *this;} /** *

[Event-based policies only] The event that activates the event-based * policy.

*/ inline PolicyDetails& WithEventSource(EventSource&& value) { SetEventSource(std::move(value)); return *this;} /** *

[Event-based policies only] The actions to be performed when the * event-based policy is activated. You can specify only one action per policy.

*/ inline const Aws::Vector& GetActions() const{ return m_actions; } /** *

[Event-based policies only] The actions to be performed when the * event-based policy is activated. You can specify only one action per policy.

*/ inline bool ActionsHasBeenSet() const { return m_actionsHasBeenSet; } /** *

[Event-based policies only] The actions to be performed when the * event-based policy is activated. You can specify only one action per policy.

*/ inline void SetActions(const Aws::Vector& value) { m_actionsHasBeenSet = true; m_actions = value; } /** *

[Event-based policies only] The actions to be performed when the * event-based policy is activated. You can specify only one action per policy.

*/ inline void SetActions(Aws::Vector&& value) { m_actionsHasBeenSet = true; m_actions = std::move(value); } /** *

[Event-based policies only] The actions to be performed when the * event-based policy is activated. You can specify only one action per policy.

*/ inline PolicyDetails& WithActions(const Aws::Vector& value) { SetActions(value); return *this;} /** *

[Event-based policies only] The actions to be performed when the * event-based policy is activated. You can specify only one action per policy.

*/ inline PolicyDetails& WithActions(Aws::Vector&& value) { SetActions(std::move(value)); return *this;} /** *

[Event-based policies only] The actions to be performed when the * event-based policy is activated. You can specify only one action per policy.

*/ inline PolicyDetails& AddActions(const Action& value) { m_actionsHasBeenSet = true; m_actions.push_back(value); return *this; } /** *

[Event-based policies only] The actions to be performed when the * event-based policy is activated. You can specify only one action per policy.

*/ inline PolicyDetails& AddActions(Action&& value) { m_actionsHasBeenSet = true; m_actions.push_back(std::move(value)); return *this; } private: PolicyTypeValues m_policyType; bool m_policyTypeHasBeenSet = false; Aws::Vector m_resourceTypes; bool m_resourceTypesHasBeenSet = false; Aws::Vector m_resourceLocations; bool m_resourceLocationsHasBeenSet = false; Aws::Vector m_targetTags; bool m_targetTagsHasBeenSet = false; Aws::Vector m_schedules; bool m_schedulesHasBeenSet = false; Parameters m_parameters; bool m_parametersHasBeenSet = false; EventSource m_eventSource; bool m_eventSourceHasBeenSet = false; Aws::Vector m_actions; bool m_actionsHasBeenSet = false; }; } // namespace Model } // namespace DLM } // namespace Aws