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

[AMI policies only] Specifies an AMI deprecation rule for AMIs * created by an AMI lifecycle policy.

For age-based schedules, you must * specify Interval and IntervalUnit. For count-based schedules, you * must specify Count.

See Also:

AWS * API Reference

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

If the schedule has a count-based retention rule, this parameter specifies * the number of oldest AMIs to deprecate. The count must be less than or equal to * the schedule's retention count, and it can't be greater than 1000.

*/ inline int GetCount() const{ return m_count; } /** *

If the schedule has a count-based retention rule, this parameter specifies * the number of oldest AMIs to deprecate. The count must be less than or equal to * the schedule's retention count, and it can't be greater than 1000.

*/ inline bool CountHasBeenSet() const { return m_countHasBeenSet; } /** *

If the schedule has a count-based retention rule, this parameter specifies * the number of oldest AMIs to deprecate. The count must be less than or equal to * the schedule's retention count, and it can't be greater than 1000.

*/ inline void SetCount(int value) { m_countHasBeenSet = true; m_count = value; } /** *

If the schedule has a count-based retention rule, this parameter specifies * the number of oldest AMIs to deprecate. The count must be less than or equal to * the schedule's retention count, and it can't be greater than 1000.

*/ inline DeprecateRule& WithCount(int value) { SetCount(value); return *this;} /** *

If the schedule has an age-based retention rule, this parameter specifies the * period after which to deprecate AMIs created by the schedule. The period must be * less than or equal to the schedule's retention period, and it can't be greater * than 10 years. This is equivalent to 120 months, 520 weeks, or 3650 days.

*/ inline int GetInterval() const{ return m_interval; } /** *

If the schedule has an age-based retention rule, this parameter specifies the * period after which to deprecate AMIs created by the schedule. The period must be * less than or equal to the schedule's retention period, and it can't be greater * than 10 years. This is equivalent to 120 months, 520 weeks, or 3650 days.

*/ inline bool IntervalHasBeenSet() const { return m_intervalHasBeenSet; } /** *

If the schedule has an age-based retention rule, this parameter specifies the * period after which to deprecate AMIs created by the schedule. The period must be * less than or equal to the schedule's retention period, and it can't be greater * than 10 years. This is equivalent to 120 months, 520 weeks, or 3650 days.

*/ inline void SetInterval(int value) { m_intervalHasBeenSet = true; m_interval = value; } /** *

If the schedule has an age-based retention rule, this parameter specifies the * period after which to deprecate AMIs created by the schedule. The period must be * less than or equal to the schedule's retention period, and it can't be greater * than 10 years. This is equivalent to 120 months, 520 weeks, or 3650 days.

*/ inline DeprecateRule& WithInterval(int value) { SetInterval(value); return *this;} /** *

The unit of time in which to measure the Interval.

*/ inline const RetentionIntervalUnitValues& GetIntervalUnit() const{ return m_intervalUnit; } /** *

The unit of time in which to measure the Interval.

*/ inline bool IntervalUnitHasBeenSet() const { return m_intervalUnitHasBeenSet; } /** *

The unit of time in which to measure the Interval.

*/ inline void SetIntervalUnit(const RetentionIntervalUnitValues& value) { m_intervalUnitHasBeenSet = true; m_intervalUnit = value; } /** *

The unit of time in which to measure the Interval.

*/ inline void SetIntervalUnit(RetentionIntervalUnitValues&& value) { m_intervalUnitHasBeenSet = true; m_intervalUnit = std::move(value); } /** *

The unit of time in which to measure the Interval.

*/ inline DeprecateRule& WithIntervalUnit(const RetentionIntervalUnitValues& value) { SetIntervalUnit(value); return *this;} /** *

The unit of time in which to measure the Interval.

*/ inline DeprecateRule& WithIntervalUnit(RetentionIntervalUnitValues&& value) { SetIntervalUnit(std::move(value)); return *this;} private: int m_count; bool m_countHasBeenSet = false; int m_interval; bool m_intervalHasBeenSet = false; RetentionIntervalUnitValues m_intervalUnit; bool m_intervalUnitHasBeenSet = false; }; } // namespace Model } // namespace DLM } // namespace Aws