/** * 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 namespace Aws { namespace RecycleBin { namespace Model { /** */ class CreateRuleRequest : public RecycleBinRequest { public: AWS_RECYCLEBIN_API CreateRuleRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "CreateRule"; } AWS_RECYCLEBIN_API Aws::String SerializePayload() const override; /** *

Information about the retention period for which the retention rule is to * retain resources.

*/ inline const RetentionPeriod& GetRetentionPeriod() const{ return m_retentionPeriod; } /** *

Information about the retention period for which the retention rule is to * retain resources.

*/ inline bool RetentionPeriodHasBeenSet() const { return m_retentionPeriodHasBeenSet; } /** *

Information about the retention period for which the retention rule is to * retain resources.

*/ inline void SetRetentionPeriod(const RetentionPeriod& value) { m_retentionPeriodHasBeenSet = true; m_retentionPeriod = value; } /** *

Information about the retention period for which the retention rule is to * retain resources.

*/ inline void SetRetentionPeriod(RetentionPeriod&& value) { m_retentionPeriodHasBeenSet = true; m_retentionPeriod = std::move(value); } /** *

Information about the retention period for which the retention rule is to * retain resources.

*/ inline CreateRuleRequest& WithRetentionPeriod(const RetentionPeriod& value) { SetRetentionPeriod(value); return *this;} /** *

Information about the retention period for which the retention rule is to * retain resources.

*/ inline CreateRuleRequest& WithRetentionPeriod(RetentionPeriod&& value) { SetRetentionPeriod(std::move(value)); return *this;} /** *

The retention rule description.

*/ inline const Aws::String& GetDescription() const{ return m_description; } /** *

The retention rule description.

*/ inline bool DescriptionHasBeenSet() const { return m_descriptionHasBeenSet; } /** *

The retention rule description.

*/ inline void SetDescription(const Aws::String& value) { m_descriptionHasBeenSet = true; m_description = value; } /** *

The retention rule description.

*/ inline void SetDescription(Aws::String&& value) { m_descriptionHasBeenSet = true; m_description = std::move(value); } /** *

The retention rule description.

*/ inline void SetDescription(const char* value) { m_descriptionHasBeenSet = true; m_description.assign(value); } /** *

The retention rule description.

*/ inline CreateRuleRequest& WithDescription(const Aws::String& value) { SetDescription(value); return *this;} /** *

The retention rule description.

*/ inline CreateRuleRequest& WithDescription(Aws::String&& value) { SetDescription(std::move(value)); return *this;} /** *

The retention rule description.

*/ inline CreateRuleRequest& WithDescription(const char* value) { SetDescription(value); return *this;} /** *

Information about the tags to assign to the retention rule.

*/ inline const Aws::Vector& GetTags() const{ return m_tags; } /** *

Information about the tags to assign to the retention rule.

*/ inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; } /** *

Information about the tags to assign to the retention rule.

*/ inline void SetTags(const Aws::Vector& value) { m_tagsHasBeenSet = true; m_tags = value; } /** *

Information about the tags to assign to the retention rule.

*/ inline void SetTags(Aws::Vector&& value) { m_tagsHasBeenSet = true; m_tags = std::move(value); } /** *

Information about the tags to assign to the retention rule.

*/ inline CreateRuleRequest& WithTags(const Aws::Vector& value) { SetTags(value); return *this;} /** *

Information about the tags to assign to the retention rule.

*/ inline CreateRuleRequest& WithTags(Aws::Vector&& value) { SetTags(std::move(value)); return *this;} /** *

Information about the tags to assign to the retention rule.

*/ inline CreateRuleRequest& AddTags(const Tag& value) { m_tagsHasBeenSet = true; m_tags.push_back(value); return *this; } /** *

Information about the tags to assign to the retention rule.

*/ inline CreateRuleRequest& AddTags(Tag&& value) { m_tagsHasBeenSet = true; m_tags.push_back(std::move(value)); return *this; } /** *

The resource type to be retained by the retention rule. Currently, only * Amazon EBS snapshots and EBS-backed AMIs are supported. To retain snapshots, * specify EBS_SNAPSHOT. To retain EBS-backed AMIs, specify * EC2_IMAGE.

*/ inline const ResourceType& GetResourceType() const{ return m_resourceType; } /** *

The resource type to be retained by the retention rule. Currently, only * Amazon EBS snapshots and EBS-backed AMIs are supported. To retain snapshots, * specify EBS_SNAPSHOT. To retain EBS-backed AMIs, specify * EC2_IMAGE.

*/ inline bool ResourceTypeHasBeenSet() const { return m_resourceTypeHasBeenSet; } /** *

The resource type to be retained by the retention rule. Currently, only * Amazon EBS snapshots and EBS-backed AMIs are supported. To retain snapshots, * specify EBS_SNAPSHOT. To retain EBS-backed AMIs, specify * EC2_IMAGE.

*/ inline void SetResourceType(const ResourceType& value) { m_resourceTypeHasBeenSet = true; m_resourceType = value; } /** *

The resource type to be retained by the retention rule. Currently, only * Amazon EBS snapshots and EBS-backed AMIs are supported. To retain snapshots, * specify EBS_SNAPSHOT. To retain EBS-backed AMIs, specify * EC2_IMAGE.

*/ inline void SetResourceType(ResourceType&& value) { m_resourceTypeHasBeenSet = true; m_resourceType = std::move(value); } /** *

The resource type to be retained by the retention rule. Currently, only * Amazon EBS snapshots and EBS-backed AMIs are supported. To retain snapshots, * specify EBS_SNAPSHOT. To retain EBS-backed AMIs, specify * EC2_IMAGE.

*/ inline CreateRuleRequest& WithResourceType(const ResourceType& value) { SetResourceType(value); return *this;} /** *

The resource type to be retained by the retention rule. Currently, only * Amazon EBS snapshots and EBS-backed AMIs are supported. To retain snapshots, * specify EBS_SNAPSHOT. To retain EBS-backed AMIs, specify * EC2_IMAGE.

*/ inline CreateRuleRequest& WithResourceType(ResourceType&& value) { SetResourceType(std::move(value)); return *this;} /** *

Specifies the resource tags to use to identify resources that are to be * retained by a tag-level retention rule. For tag-level retention rules, only * deleted resources, of the specified resource type, that have one or more of the * specified tag key and value pairs are retained. If a resource is deleted, but it * does not have any of the specified tag key and value pairs, it is immediately * deleted without being retained by the retention rule.

You can add the * same tag key and value pair to a maximum or five retention rules.

To * create a Region-level retention rule, omit this parameter. A Region-level * retention rule does not have any resource tags specified. It retains all deleted * resources of the specified resource type in the Region in which the rule is * created, even if the resources are not tagged.

*/ inline const Aws::Vector& GetResourceTags() const{ return m_resourceTags; } /** *

Specifies the resource tags to use to identify resources that are to be * retained by a tag-level retention rule. For tag-level retention rules, only * deleted resources, of the specified resource type, that have one or more of the * specified tag key and value pairs are retained. If a resource is deleted, but it * does not have any of the specified tag key and value pairs, it is immediately * deleted without being retained by the retention rule.

You can add the * same tag key and value pair to a maximum or five retention rules.

To * create a Region-level retention rule, omit this parameter. A Region-level * retention rule does not have any resource tags specified. It retains all deleted * resources of the specified resource type in the Region in which the rule is * created, even if the resources are not tagged.

*/ inline bool ResourceTagsHasBeenSet() const { return m_resourceTagsHasBeenSet; } /** *

Specifies the resource tags to use to identify resources that are to be * retained by a tag-level retention rule. For tag-level retention rules, only * deleted resources, of the specified resource type, that have one or more of the * specified tag key and value pairs are retained. If a resource is deleted, but it * does not have any of the specified tag key and value pairs, it is immediately * deleted without being retained by the retention rule.

You can add the * same tag key and value pair to a maximum or five retention rules.

To * create a Region-level retention rule, omit this parameter. A Region-level * retention rule does not have any resource tags specified. It retains all deleted * resources of the specified resource type in the Region in which the rule is * created, even if the resources are not tagged.

*/ inline void SetResourceTags(const Aws::Vector& value) { m_resourceTagsHasBeenSet = true; m_resourceTags = value; } /** *

Specifies the resource tags to use to identify resources that are to be * retained by a tag-level retention rule. For tag-level retention rules, only * deleted resources, of the specified resource type, that have one or more of the * specified tag key and value pairs are retained. If a resource is deleted, but it * does not have any of the specified tag key and value pairs, it is immediately * deleted without being retained by the retention rule.

You can add the * same tag key and value pair to a maximum or five retention rules.

To * create a Region-level retention rule, omit this parameter. A Region-level * retention rule does not have any resource tags specified. It retains all deleted * resources of the specified resource type in the Region in which the rule is * created, even if the resources are not tagged.

*/ inline void SetResourceTags(Aws::Vector&& value) { m_resourceTagsHasBeenSet = true; m_resourceTags = std::move(value); } /** *

Specifies the resource tags to use to identify resources that are to be * retained by a tag-level retention rule. For tag-level retention rules, only * deleted resources, of the specified resource type, that have one or more of the * specified tag key and value pairs are retained. If a resource is deleted, but it * does not have any of the specified tag key and value pairs, it is immediately * deleted without being retained by the retention rule.

You can add the * same tag key and value pair to a maximum or five retention rules.

To * create a Region-level retention rule, omit this parameter. A Region-level * retention rule does not have any resource tags specified. It retains all deleted * resources of the specified resource type in the Region in which the rule is * created, even if the resources are not tagged.

*/ inline CreateRuleRequest& WithResourceTags(const Aws::Vector& value) { SetResourceTags(value); return *this;} /** *

Specifies the resource tags to use to identify resources that are to be * retained by a tag-level retention rule. For tag-level retention rules, only * deleted resources, of the specified resource type, that have one or more of the * specified tag key and value pairs are retained. If a resource is deleted, but it * does not have any of the specified tag key and value pairs, it is immediately * deleted without being retained by the retention rule.

You can add the * same tag key and value pair to a maximum or five retention rules.

To * create a Region-level retention rule, omit this parameter. A Region-level * retention rule does not have any resource tags specified. It retains all deleted * resources of the specified resource type in the Region in which the rule is * created, even if the resources are not tagged.

*/ inline CreateRuleRequest& WithResourceTags(Aws::Vector&& value) { SetResourceTags(std::move(value)); return *this;} /** *

Specifies the resource tags to use to identify resources that are to be * retained by a tag-level retention rule. For tag-level retention rules, only * deleted resources, of the specified resource type, that have one or more of the * specified tag key and value pairs are retained. If a resource is deleted, but it * does not have any of the specified tag key and value pairs, it is immediately * deleted without being retained by the retention rule.

You can add the * same tag key and value pair to a maximum or five retention rules.

To * create a Region-level retention rule, omit this parameter. A Region-level * retention rule does not have any resource tags specified. It retains all deleted * resources of the specified resource type in the Region in which the rule is * created, even if the resources are not tagged.

*/ inline CreateRuleRequest& AddResourceTags(const ResourceTag& value) { m_resourceTagsHasBeenSet = true; m_resourceTags.push_back(value); return *this; } /** *

Specifies the resource tags to use to identify resources that are to be * retained by a tag-level retention rule. For tag-level retention rules, only * deleted resources, of the specified resource type, that have one or more of the * specified tag key and value pairs are retained. If a resource is deleted, but it * does not have any of the specified tag key and value pairs, it is immediately * deleted without being retained by the retention rule.

You can add the * same tag key and value pair to a maximum or five retention rules.

To * create a Region-level retention rule, omit this parameter. A Region-level * retention rule does not have any resource tags specified. It retains all deleted * resources of the specified resource type in the Region in which the rule is * created, even if the resources are not tagged.

*/ inline CreateRuleRequest& AddResourceTags(ResourceTag&& value) { m_resourceTagsHasBeenSet = true; m_resourceTags.push_back(std::move(value)); return *this; } /** *

Information about the retention rule lock configuration.

*/ inline const LockConfiguration& GetLockConfiguration() const{ return m_lockConfiguration; } /** *

Information about the retention rule lock configuration.

*/ inline bool LockConfigurationHasBeenSet() const { return m_lockConfigurationHasBeenSet; } /** *

Information about the retention rule lock configuration.

*/ inline void SetLockConfiguration(const LockConfiguration& value) { m_lockConfigurationHasBeenSet = true; m_lockConfiguration = value; } /** *

Information about the retention rule lock configuration.

*/ inline void SetLockConfiguration(LockConfiguration&& value) { m_lockConfigurationHasBeenSet = true; m_lockConfiguration = std::move(value); } /** *

Information about the retention rule lock configuration.

*/ inline CreateRuleRequest& WithLockConfiguration(const LockConfiguration& value) { SetLockConfiguration(value); return *this;} /** *

Information about the retention rule lock configuration.

*/ inline CreateRuleRequest& WithLockConfiguration(LockConfiguration&& value) { SetLockConfiguration(std::move(value)); return *this;} private: RetentionPeriod m_retentionPeriod; bool m_retentionPeriodHasBeenSet = false; Aws::String m_description; bool m_descriptionHasBeenSet = false; Aws::Vector m_tags; bool m_tagsHasBeenSet = false; ResourceType m_resourceType; bool m_resourceTypeHasBeenSet = false; Aws::Vector m_resourceTags; bool m_resourceTagsHasBeenSet = false; LockConfiguration m_lockConfiguration; bool m_lockConfigurationHasBeenSet = false; }; } // namespace Model } // namespace RecycleBin } // namespace Aws