|
| 1 | +/** |
| 2 | + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 3 | + * SPDX-License-Identifier: Apache-2.0. |
| 4 | + */ |
| 5 | + |
| 6 | +#pragma once |
| 7 | +#include <aws/autoscaling/AutoScaling_EXPORTS.h> |
| 8 | +#include <aws/core/utils/memory/stl/AWSStreamFwd.h> |
| 9 | +#include <aws/autoscaling/model/CapacityReservationPreference.h> |
| 10 | +#include <aws/autoscaling/model/CapacityReservationTarget.h> |
| 11 | +#include <utility> |
| 12 | + |
| 13 | +namespace Aws |
| 14 | +{ |
| 15 | +namespace Utils |
| 16 | +{ |
| 17 | +namespace Xml |
| 18 | +{ |
| 19 | + class XmlNode; |
| 20 | +} // namespace Xml |
| 21 | +} // namespace Utils |
| 22 | +namespace AutoScaling |
| 23 | +{ |
| 24 | +namespace Model |
| 25 | +{ |
| 26 | + |
| 27 | + /** |
| 28 | + * <p> Describes the Capacity Reservation preference and targeting options. If you |
| 29 | + * specify <code>open</code> or <code>none</code> for |
| 30 | + * <code>CapacityReservationPreference</code>, do not specify a |
| 31 | + * <code>CapacityReservationTarget</code>. </p><p><h3>See Also:</h3> <a |
| 32 | + * href="http://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CapacityReservationSpecification">AWS |
| 33 | + * API Reference</a></p> |
| 34 | + */ |
| 35 | + class CapacityReservationSpecification |
| 36 | + { |
| 37 | + public: |
| 38 | + AWS_AUTOSCALING_API CapacityReservationSpecification(); |
| 39 | + AWS_AUTOSCALING_API CapacityReservationSpecification(const Aws::Utils::Xml::XmlNode& xmlNode); |
| 40 | + AWS_AUTOSCALING_API CapacityReservationSpecification& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); |
| 41 | + |
| 42 | + AWS_AUTOSCALING_API void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const; |
| 43 | + AWS_AUTOSCALING_API void OutputToStream(Aws::OStream& oStream, const char* location) const; |
| 44 | + |
| 45 | + |
| 46 | + ///@{ |
| 47 | + /** |
| 48 | + * <p> The capacity reservation preference. The following options are available: |
| 49 | + * </p> <ul> <li> <p> <code>capacity-reservations-only</code> - Auto Scaling will |
| 50 | + * only launch instances into a Capacity Reservation or Capacity Reservation |
| 51 | + * resource group. If capacity isn't available, instances will fail to launch.</p> |
| 52 | + * </li> <li> <p> <code>capacity-reservations-first</code> - Auto Scaling will try |
| 53 | + * to launch instances into a Capacity Reservation or Capacity Reservation resource |
| 54 | + * group first. If capacity isn't available, instances will run in On-Demand |
| 55 | + * capacity.</p> </li> <li> <p> <code>none</code> - Auto Scaling will not launch |
| 56 | + * instances into a Capacity Reservation. Instances will run in On-Demand capacity. |
| 57 | + * </p> </li> <li> <p> <code>default</code> - Auto Scaling uses the Capacity |
| 58 | + * Reservation preference from your launch template or an open Capacity |
| 59 | + * Reservation.</p> </li> </ul> |
| 60 | + */ |
| 61 | + inline const CapacityReservationPreference& GetCapacityReservationPreference() const{ return m_capacityReservationPreference; } |
| 62 | + inline bool CapacityReservationPreferenceHasBeenSet() const { return m_capacityReservationPreferenceHasBeenSet; } |
| 63 | + inline void SetCapacityReservationPreference(const CapacityReservationPreference& value) { m_capacityReservationPreferenceHasBeenSet = true; m_capacityReservationPreference = value; } |
| 64 | + inline void SetCapacityReservationPreference(CapacityReservationPreference&& value) { m_capacityReservationPreferenceHasBeenSet = true; m_capacityReservationPreference = std::move(value); } |
| 65 | + inline CapacityReservationSpecification& WithCapacityReservationPreference(const CapacityReservationPreference& value) { SetCapacityReservationPreference(value); return *this;} |
| 66 | + inline CapacityReservationSpecification& WithCapacityReservationPreference(CapacityReservationPreference&& value) { SetCapacityReservationPreference(std::move(value)); return *this;} |
| 67 | + ///@} |
| 68 | + |
| 69 | + ///@{ |
| 70 | + /** |
| 71 | + * <p> Describes a target Capacity Reservation or Capacity Reservation resource |
| 72 | + * group. </p> |
| 73 | + */ |
| 74 | + inline const CapacityReservationTarget& GetCapacityReservationTarget() const{ return m_capacityReservationTarget; } |
| 75 | + inline bool CapacityReservationTargetHasBeenSet() const { return m_capacityReservationTargetHasBeenSet; } |
| 76 | + inline void SetCapacityReservationTarget(const CapacityReservationTarget& value) { m_capacityReservationTargetHasBeenSet = true; m_capacityReservationTarget = value; } |
| 77 | + inline void SetCapacityReservationTarget(CapacityReservationTarget&& value) { m_capacityReservationTargetHasBeenSet = true; m_capacityReservationTarget = std::move(value); } |
| 78 | + inline CapacityReservationSpecification& WithCapacityReservationTarget(const CapacityReservationTarget& value) { SetCapacityReservationTarget(value); return *this;} |
| 79 | + inline CapacityReservationSpecification& WithCapacityReservationTarget(CapacityReservationTarget&& value) { SetCapacityReservationTarget(std::move(value)); return *this;} |
| 80 | + ///@} |
| 81 | + private: |
| 82 | + |
| 83 | + CapacityReservationPreference m_capacityReservationPreference; |
| 84 | + bool m_capacityReservationPreferenceHasBeenSet = false; |
| 85 | + |
| 86 | + CapacityReservationTarget m_capacityReservationTarget; |
| 87 | + bool m_capacityReservationTargetHasBeenSet = false; |
| 88 | + }; |
| 89 | + |
| 90 | +} // namespace Model |
| 91 | +} // namespace AutoScaling |
| 92 | +} // namespace Aws |
0 commit comments