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/ec2/EC2_EXPORTS.h> 8 #include <aws/core/utils/memory/stl/AWSStreamFwd.h> 9 #include <aws/core/utils/memory/stl/AWSString.h> 10 #include <aws/core/utils/memory/stl/AWSVector.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 EC2 23 { 24 namespace Model 25 { 26 27 /** 28 * <p>Describes the recurring schedule for a Scheduled Instance.</p><p><h3>See 29 * Also:</h3> <a 30 * href="http://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ScheduledInstanceRecurrence">AWS 31 * API Reference</a></p> 32 */ 33 class AWS_EC2_API ScheduledInstanceRecurrence 34 { 35 public: 36 ScheduledInstanceRecurrence(); 37 ScheduledInstanceRecurrence(const Aws::Utils::Xml::XmlNode& xmlNode); 38 ScheduledInstanceRecurrence& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); 39 40 void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const; 41 void OutputToStream(Aws::OStream& oStream, const char* location) const; 42 43 44 /** 45 * <p>The frequency (<code>Daily</code>, <code>Weekly</code>, or 46 * <code>Monthly</code>).</p> 47 */ GetFrequency()48 inline const Aws::String& GetFrequency() const{ return m_frequency; } 49 50 /** 51 * <p>The frequency (<code>Daily</code>, <code>Weekly</code>, or 52 * <code>Monthly</code>).</p> 53 */ FrequencyHasBeenSet()54 inline bool FrequencyHasBeenSet() const { return m_frequencyHasBeenSet; } 55 56 /** 57 * <p>The frequency (<code>Daily</code>, <code>Weekly</code>, or 58 * <code>Monthly</code>).</p> 59 */ SetFrequency(const Aws::String & value)60 inline void SetFrequency(const Aws::String& value) { m_frequencyHasBeenSet = true; m_frequency = value; } 61 62 /** 63 * <p>The frequency (<code>Daily</code>, <code>Weekly</code>, or 64 * <code>Monthly</code>).</p> 65 */ SetFrequency(Aws::String && value)66 inline void SetFrequency(Aws::String&& value) { m_frequencyHasBeenSet = true; m_frequency = std::move(value); } 67 68 /** 69 * <p>The frequency (<code>Daily</code>, <code>Weekly</code>, or 70 * <code>Monthly</code>).</p> 71 */ SetFrequency(const char * value)72 inline void SetFrequency(const char* value) { m_frequencyHasBeenSet = true; m_frequency.assign(value); } 73 74 /** 75 * <p>The frequency (<code>Daily</code>, <code>Weekly</code>, or 76 * <code>Monthly</code>).</p> 77 */ WithFrequency(const Aws::String & value)78 inline ScheduledInstanceRecurrence& WithFrequency(const Aws::String& value) { SetFrequency(value); return *this;} 79 80 /** 81 * <p>The frequency (<code>Daily</code>, <code>Weekly</code>, or 82 * <code>Monthly</code>).</p> 83 */ WithFrequency(Aws::String && value)84 inline ScheduledInstanceRecurrence& WithFrequency(Aws::String&& value) { SetFrequency(std::move(value)); return *this;} 85 86 /** 87 * <p>The frequency (<code>Daily</code>, <code>Weekly</code>, or 88 * <code>Monthly</code>).</p> 89 */ WithFrequency(const char * value)90 inline ScheduledInstanceRecurrence& WithFrequency(const char* value) { SetFrequency(value); return *this;} 91 92 93 /** 94 * <p>The interval quantity. The interval unit depends on the value of 95 * <code>frequency</code>. For example, every 2 weeks or every 2 months.</p> 96 */ GetInterval()97 inline int GetInterval() const{ return m_interval; } 98 99 /** 100 * <p>The interval quantity. The interval unit depends on the value of 101 * <code>frequency</code>. For example, every 2 weeks or every 2 months.</p> 102 */ IntervalHasBeenSet()103 inline bool IntervalHasBeenSet() const { return m_intervalHasBeenSet; } 104 105 /** 106 * <p>The interval quantity. The interval unit depends on the value of 107 * <code>frequency</code>. For example, every 2 weeks or every 2 months.</p> 108 */ SetInterval(int value)109 inline void SetInterval(int value) { m_intervalHasBeenSet = true; m_interval = value; } 110 111 /** 112 * <p>The interval quantity. The interval unit depends on the value of 113 * <code>frequency</code>. For example, every 2 weeks or every 2 months.</p> 114 */ WithInterval(int value)115 inline ScheduledInstanceRecurrence& WithInterval(int value) { SetInterval(value); return *this;} 116 117 118 /** 119 * <p>The days. For a monthly schedule, this is one or more days of the month 120 * (1-31). For a weekly schedule, this is one or more days of the week (1-7, where 121 * 1 is Sunday).</p> 122 */ GetOccurrenceDaySet()123 inline const Aws::Vector<int>& GetOccurrenceDaySet() const{ return m_occurrenceDaySet; } 124 125 /** 126 * <p>The days. For a monthly schedule, this is one or more days of the month 127 * (1-31). For a weekly schedule, this is one or more days of the week (1-7, where 128 * 1 is Sunday).</p> 129 */ OccurrenceDaySetHasBeenSet()130 inline bool OccurrenceDaySetHasBeenSet() const { return m_occurrenceDaySetHasBeenSet; } 131 132 /** 133 * <p>The days. For a monthly schedule, this is one or more days of the month 134 * (1-31). For a weekly schedule, this is one or more days of the week (1-7, where 135 * 1 is Sunday).</p> 136 */ SetOccurrenceDaySet(const Aws::Vector<int> & value)137 inline void SetOccurrenceDaySet(const Aws::Vector<int>& value) { m_occurrenceDaySetHasBeenSet = true; m_occurrenceDaySet = value; } 138 139 /** 140 * <p>The days. For a monthly schedule, this is one or more days of the month 141 * (1-31). For a weekly schedule, this is one or more days of the week (1-7, where 142 * 1 is Sunday).</p> 143 */ SetOccurrenceDaySet(Aws::Vector<int> && value)144 inline void SetOccurrenceDaySet(Aws::Vector<int>&& value) { m_occurrenceDaySetHasBeenSet = true; m_occurrenceDaySet = std::move(value); } 145 146 /** 147 * <p>The days. For a monthly schedule, this is one or more days of the month 148 * (1-31). For a weekly schedule, this is one or more days of the week (1-7, where 149 * 1 is Sunday).</p> 150 */ WithOccurrenceDaySet(const Aws::Vector<int> & value)151 inline ScheduledInstanceRecurrence& WithOccurrenceDaySet(const Aws::Vector<int>& value) { SetOccurrenceDaySet(value); return *this;} 152 153 /** 154 * <p>The days. For a monthly schedule, this is one or more days of the month 155 * (1-31). For a weekly schedule, this is one or more days of the week (1-7, where 156 * 1 is Sunday).</p> 157 */ WithOccurrenceDaySet(Aws::Vector<int> && value)158 inline ScheduledInstanceRecurrence& WithOccurrenceDaySet(Aws::Vector<int>&& value) { SetOccurrenceDaySet(std::move(value)); return *this;} 159 160 /** 161 * <p>The days. For a monthly schedule, this is one or more days of the month 162 * (1-31). For a weekly schedule, this is one or more days of the week (1-7, where 163 * 1 is Sunday).</p> 164 */ AddOccurrenceDaySet(int value)165 inline ScheduledInstanceRecurrence& AddOccurrenceDaySet(int value) { m_occurrenceDaySetHasBeenSet = true; m_occurrenceDaySet.push_back(value); return *this; } 166 167 168 /** 169 * <p>Indicates whether the occurrence is relative to the end of the specified week 170 * or month.</p> 171 */ GetOccurrenceRelativeToEnd()172 inline bool GetOccurrenceRelativeToEnd() const{ return m_occurrenceRelativeToEnd; } 173 174 /** 175 * <p>Indicates whether the occurrence is relative to the end of the specified week 176 * or month.</p> 177 */ OccurrenceRelativeToEndHasBeenSet()178 inline bool OccurrenceRelativeToEndHasBeenSet() const { return m_occurrenceRelativeToEndHasBeenSet; } 179 180 /** 181 * <p>Indicates whether the occurrence is relative to the end of the specified week 182 * or month.</p> 183 */ SetOccurrenceRelativeToEnd(bool value)184 inline void SetOccurrenceRelativeToEnd(bool value) { m_occurrenceRelativeToEndHasBeenSet = true; m_occurrenceRelativeToEnd = value; } 185 186 /** 187 * <p>Indicates whether the occurrence is relative to the end of the specified week 188 * or month.</p> 189 */ WithOccurrenceRelativeToEnd(bool value)190 inline ScheduledInstanceRecurrence& WithOccurrenceRelativeToEnd(bool value) { SetOccurrenceRelativeToEnd(value); return *this;} 191 192 193 /** 194 * <p>The unit for <code>occurrenceDaySet</code> (<code>DayOfWeek</code> or 195 * <code>DayOfMonth</code>).</p> 196 */ GetOccurrenceUnit()197 inline const Aws::String& GetOccurrenceUnit() const{ return m_occurrenceUnit; } 198 199 /** 200 * <p>The unit for <code>occurrenceDaySet</code> (<code>DayOfWeek</code> or 201 * <code>DayOfMonth</code>).</p> 202 */ OccurrenceUnitHasBeenSet()203 inline bool OccurrenceUnitHasBeenSet() const { return m_occurrenceUnitHasBeenSet; } 204 205 /** 206 * <p>The unit for <code>occurrenceDaySet</code> (<code>DayOfWeek</code> or 207 * <code>DayOfMonth</code>).</p> 208 */ SetOccurrenceUnit(const Aws::String & value)209 inline void SetOccurrenceUnit(const Aws::String& value) { m_occurrenceUnitHasBeenSet = true; m_occurrenceUnit = value; } 210 211 /** 212 * <p>The unit for <code>occurrenceDaySet</code> (<code>DayOfWeek</code> or 213 * <code>DayOfMonth</code>).</p> 214 */ SetOccurrenceUnit(Aws::String && value)215 inline void SetOccurrenceUnit(Aws::String&& value) { m_occurrenceUnitHasBeenSet = true; m_occurrenceUnit = std::move(value); } 216 217 /** 218 * <p>The unit for <code>occurrenceDaySet</code> (<code>DayOfWeek</code> or 219 * <code>DayOfMonth</code>).</p> 220 */ SetOccurrenceUnit(const char * value)221 inline void SetOccurrenceUnit(const char* value) { m_occurrenceUnitHasBeenSet = true; m_occurrenceUnit.assign(value); } 222 223 /** 224 * <p>The unit for <code>occurrenceDaySet</code> (<code>DayOfWeek</code> or 225 * <code>DayOfMonth</code>).</p> 226 */ WithOccurrenceUnit(const Aws::String & value)227 inline ScheduledInstanceRecurrence& WithOccurrenceUnit(const Aws::String& value) { SetOccurrenceUnit(value); return *this;} 228 229 /** 230 * <p>The unit for <code>occurrenceDaySet</code> (<code>DayOfWeek</code> or 231 * <code>DayOfMonth</code>).</p> 232 */ WithOccurrenceUnit(Aws::String && value)233 inline ScheduledInstanceRecurrence& WithOccurrenceUnit(Aws::String&& value) { SetOccurrenceUnit(std::move(value)); return *this;} 234 235 /** 236 * <p>The unit for <code>occurrenceDaySet</code> (<code>DayOfWeek</code> or 237 * <code>DayOfMonth</code>).</p> 238 */ WithOccurrenceUnit(const char * value)239 inline ScheduledInstanceRecurrence& WithOccurrenceUnit(const char* value) { SetOccurrenceUnit(value); return *this;} 240 241 private: 242 243 Aws::String m_frequency; 244 bool m_frequencyHasBeenSet; 245 246 int m_interval; 247 bool m_intervalHasBeenSet; 248 249 Aws::Vector<int> m_occurrenceDaySet; 250 bool m_occurrenceDaySetHasBeenSet; 251 252 bool m_occurrenceRelativeToEnd; 253 bool m_occurrenceRelativeToEndHasBeenSet; 254 255 Aws::String m_occurrenceUnit; 256 bool m_occurrenceUnitHasBeenSet; 257 }; 258 259 } // namespace Model 260 } // namespace EC2 261 } // namespace Aws 262