AWS SDK for C++

AWS SDK for C++ Version 1.11.717

Loading...
Searching...
No Matches
Purchase.h
1
6#pragma once
7#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
8#include <aws/core/utils/memory/stl/AWSString.h>
9#include <aws/core/utils/memory/stl/AWSVector.h>
10#include <aws/ec2/EC2_EXPORTS.h>
11#include <aws/ec2/model/CurrencyCodeValues.h>
12#include <aws/ec2/model/PaymentOption.h>
13
14#include <utility>
15
16namespace Aws {
17namespace Utils {
18namespace Xml {
19class XmlNode;
20} // namespace Xml
21} // namespace Utils
22namespace EC2 {
23namespace Model {
24
30class Purchase {
31 public:
32 AWS_EC2_API Purchase() = default;
33 AWS_EC2_API Purchase(const Aws::Utils::Xml::XmlNode& xmlNode);
34 AWS_EC2_API Purchase& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
35
36 AWS_EC2_API void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
37 AWS_EC2_API void OutputToStream(Aws::OStream& oStream, const char* location) const;
38
40
45 inline CurrencyCodeValues GetCurrencyCode() const { return m_currencyCode; }
46 inline bool CurrencyCodeHasBeenSet() const { return m_currencyCodeHasBeenSet; }
48 m_currencyCodeHasBeenSet = true;
49 m_currencyCode = value;
50 }
52 SetCurrencyCode(value);
53 return *this;
54 }
56
58
61 inline int GetDuration() const { return m_duration; }
62 inline bool DurationHasBeenSet() const { return m_durationHasBeenSet; }
63 inline void SetDuration(int value) {
64 m_durationHasBeenSet = true;
65 m_duration = value;
66 }
67 inline Purchase& WithDuration(int value) {
68 SetDuration(value);
69 return *this;
70 }
72
74
77 inline const Aws::Vector<Aws::String>& GetHostIdSet() const { return m_hostIdSet; }
78 inline bool HostIdSetHasBeenSet() const { return m_hostIdSetHasBeenSet; }
79 template <typename HostIdSetT = Aws::Vector<Aws::String>>
80 void SetHostIdSet(HostIdSetT&& value) {
81 m_hostIdSetHasBeenSet = true;
82 m_hostIdSet = std::forward<HostIdSetT>(value);
83 }
84 template <typename HostIdSetT = Aws::Vector<Aws::String>>
85 Purchase& WithHostIdSet(HostIdSetT&& value) {
86 SetHostIdSet(std::forward<HostIdSetT>(value));
87 return *this;
88 }
89 template <typename HostIdSetT = Aws::String>
90 Purchase& AddHostIdSet(HostIdSetT&& value) {
91 m_hostIdSetHasBeenSet = true;
92 m_hostIdSet.emplace_back(std::forward<HostIdSetT>(value));
93 return *this;
94 }
96
98
101 inline const Aws::String& GetHostReservationId() const { return m_hostReservationId; }
102 inline bool HostReservationIdHasBeenSet() const { return m_hostReservationIdHasBeenSet; }
103 template <typename HostReservationIdT = Aws::String>
104 void SetHostReservationId(HostReservationIdT&& value) {
105 m_hostReservationIdHasBeenSet = true;
106 m_hostReservationId = std::forward<HostReservationIdT>(value);
107 }
108 template <typename HostReservationIdT = Aws::String>
109 Purchase& WithHostReservationId(HostReservationIdT&& value) {
110 SetHostReservationId(std::forward<HostReservationIdT>(value));
111 return *this;
112 }
114
116
119 inline const Aws::String& GetHourlyPrice() const { return m_hourlyPrice; }
120 inline bool HourlyPriceHasBeenSet() const { return m_hourlyPriceHasBeenSet; }
121 template <typename HourlyPriceT = Aws::String>
122 void SetHourlyPrice(HourlyPriceT&& value) {
123 m_hourlyPriceHasBeenSet = true;
124 m_hourlyPrice = std::forward<HourlyPriceT>(value);
125 }
126 template <typename HourlyPriceT = Aws::String>
127 Purchase& WithHourlyPrice(HourlyPriceT&& value) {
128 SetHourlyPrice(std::forward<HourlyPriceT>(value));
129 return *this;
130 }
132
134
138 inline const Aws::String& GetInstanceFamily() const { return m_instanceFamily; }
139 inline bool InstanceFamilyHasBeenSet() const { return m_instanceFamilyHasBeenSet; }
140 template <typename InstanceFamilyT = Aws::String>
141 void SetInstanceFamily(InstanceFamilyT&& value) {
142 m_instanceFamilyHasBeenSet = true;
143 m_instanceFamily = std::forward<InstanceFamilyT>(value);
144 }
145 template <typename InstanceFamilyT = Aws::String>
146 Purchase& WithInstanceFamily(InstanceFamilyT&& value) {
147 SetInstanceFamily(std::forward<InstanceFamilyT>(value));
148 return *this;
149 }
151
153
156 inline PaymentOption GetPaymentOption() const { return m_paymentOption; }
157 inline bool PaymentOptionHasBeenSet() const { return m_paymentOptionHasBeenSet; }
158 inline void SetPaymentOption(PaymentOption value) {
159 m_paymentOptionHasBeenSet = true;
160 m_paymentOption = value;
161 }
163 SetPaymentOption(value);
164 return *this;
165 }
167
169
172 inline const Aws::String& GetUpfrontPrice() const { return m_upfrontPrice; }
173 inline bool UpfrontPriceHasBeenSet() const { return m_upfrontPriceHasBeenSet; }
174 template <typename UpfrontPriceT = Aws::String>
175 void SetUpfrontPrice(UpfrontPriceT&& value) {
176 m_upfrontPriceHasBeenSet = true;
177 m_upfrontPrice = std::forward<UpfrontPriceT>(value);
178 }
179 template <typename UpfrontPriceT = Aws::String>
180 Purchase& WithUpfrontPrice(UpfrontPriceT&& value) {
181 SetUpfrontPrice(std::forward<UpfrontPriceT>(value));
182 return *this;
183 }
185 private:
187
188 int m_duration{0};
189
190 Aws::Vector<Aws::String> m_hostIdSet;
191
192 Aws::String m_hostReservationId;
193
194 Aws::String m_hourlyPrice;
195
196 Aws::String m_instanceFamily;
197
198 PaymentOption m_paymentOption{PaymentOption::NOT_SET};
199
200 Aws::String m_upfrontPrice;
201 bool m_currencyCodeHasBeenSet = false;
202 bool m_durationHasBeenSet = false;
203 bool m_hostIdSetHasBeenSet = false;
204 bool m_hostReservationIdHasBeenSet = false;
205 bool m_hourlyPriceHasBeenSet = false;
206 bool m_instanceFamilyHasBeenSet = false;
207 bool m_paymentOptionHasBeenSet = false;
208 bool m_upfrontPriceHasBeenSet = false;
209};
210
211} // namespace Model
212} // namespace EC2
213} // namespace Aws
bool HourlyPriceHasBeenSet() const
Definition Purchase.h:120
const Aws::String & GetInstanceFamily() const
Definition Purchase.h:138
AWS_EC2_API Purchase & operator=(const Aws::Utils::Xml::XmlNode &xmlNode)
bool HostIdSetHasBeenSet() const
Definition Purchase.h:78
const Aws::String & GetHostReservationId() const
Definition Purchase.h:101
Purchase & WithInstanceFamily(InstanceFamilyT &&value)
Definition Purchase.h:146
Purchase & AddHostIdSet(HostIdSetT &&value)
Definition Purchase.h:90
Purchase & WithHostReservationId(HostReservationIdT &&value)
Definition Purchase.h:109
void SetCurrencyCode(CurrencyCodeValues value)
Definition Purchase.h:47
void SetHostIdSet(HostIdSetT &&value)
Definition Purchase.h:80
bool CurrencyCodeHasBeenSet() const
Definition Purchase.h:46
Purchase & WithUpfrontPrice(UpfrontPriceT &&value)
Definition Purchase.h:180
const Aws::Vector< Aws::String > & GetHostIdSet() const
Definition Purchase.h:77
AWS_EC2_API Purchase(const Aws::Utils::Xml::XmlNode &xmlNode)
bool InstanceFamilyHasBeenSet() const
Definition Purchase.h:139
int GetDuration() const
Definition Purchase.h:61
bool DurationHasBeenSet() const
Definition Purchase.h:62
Purchase & WithHourlyPrice(HourlyPriceT &&value)
Definition Purchase.h:127
void SetHostReservationId(HostReservationIdT &&value)
Definition Purchase.h:104
void SetInstanceFamily(InstanceFamilyT &&value)
Definition Purchase.h:141
Purchase & WithCurrencyCode(CurrencyCodeValues value)
Definition Purchase.h:51
AWS_EC2_API Purchase()=default
Purchase & WithPaymentOption(PaymentOption value)
Definition Purchase.h:162
Purchase & WithHostIdSet(HostIdSetT &&value)
Definition Purchase.h:85
bool UpfrontPriceHasBeenSet() const
Definition Purchase.h:173
void SetDuration(int value)
Definition Purchase.h:63
AWS_EC2_API void OutputToStream(Aws::OStream &ostream, const char *location, unsigned index, const char *locationValue) const
AWS_EC2_API void OutputToStream(Aws::OStream &oStream, const char *location) const
CurrencyCodeValues GetCurrencyCode() const
Definition Purchase.h:45
bool HostReservationIdHasBeenSet() const
Definition Purchase.h:102
Purchase & WithDuration(int value)
Definition Purchase.h:67
PaymentOption GetPaymentOption() const
Definition Purchase.h:156
void SetHourlyPrice(HourlyPriceT &&value)
Definition Purchase.h:122
const Aws::String & GetHourlyPrice() const
Definition Purchase.h:119
const Aws::String & GetUpfrontPrice() const
Definition Purchase.h:172
void SetUpfrontPrice(UpfrontPriceT &&value)
Definition Purchase.h:175
bool PaymentOptionHasBeenSet() const
Definition Purchase.h:157
void SetPaymentOption(PaymentOption value)
Definition Purchase.h:158
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::vector< T, Aws::Allocator< T > > Vector
std::basic_ostream< char, std::char_traits< char > > OStream