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/medialive/MediaLive_EXPORTS.h>
8 #include <aws/core/utils/memory/stl/AWSVector.h>
9 #include <aws/medialive/model/InputPreference.h>
10 #include <aws/core/utils/memory/stl/AWSString.h>
11 #include <aws/medialive/model/FailoverCondition.h>
12 #include <utility>
13 
14 namespace Aws
15 {
16 namespace Utils
17 {
18 namespace Json
19 {
20   class JsonValue;
21   class JsonView;
22 } // namespace Json
23 } // namespace Utils
24 namespace MediaLive
25 {
26 namespace Model
27 {
28 
29   /**
30    * The settings for Automatic Input Failover.<p><h3>See Also:</h3>   <a
31    * href="http://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/AutomaticInputFailoverSettings">AWS
32    * API Reference</a></p>
33    */
34   class AWS_MEDIALIVE_API AutomaticInputFailoverSettings
35   {
36   public:
37     AutomaticInputFailoverSettings();
38     AutomaticInputFailoverSettings(Aws::Utils::Json::JsonView jsonValue);
39     AutomaticInputFailoverSettings& operator=(Aws::Utils::Json::JsonView jsonValue);
40     Aws::Utils::Json::JsonValue Jsonize() const;
41 
42 
43     /**
44      * This clear time defines the requirement a recovered input must meet to be
45      * considered healthy. The input must have no failover conditions for this length
46      * of time. Enter a time in milliseconds. This value is particularly important if
47      * the input_preference for the failover pair is set to PRIMARY_INPUT_PREFERRED,
48      * because after this time, MediaLive will switch back to the primary input.
49      */
GetErrorClearTimeMsec()50     inline int GetErrorClearTimeMsec() const{ return m_errorClearTimeMsec; }
51 
52     /**
53      * This clear time defines the requirement a recovered input must meet to be
54      * considered healthy. The input must have no failover conditions for this length
55      * of time. Enter a time in milliseconds. This value is particularly important if
56      * the input_preference for the failover pair is set to PRIMARY_INPUT_PREFERRED,
57      * because after this time, MediaLive will switch back to the primary input.
58      */
ErrorClearTimeMsecHasBeenSet()59     inline bool ErrorClearTimeMsecHasBeenSet() const { return m_errorClearTimeMsecHasBeenSet; }
60 
61     /**
62      * This clear time defines the requirement a recovered input must meet to be
63      * considered healthy. The input must have no failover conditions for this length
64      * of time. Enter a time in milliseconds. This value is particularly important if
65      * the input_preference for the failover pair is set to PRIMARY_INPUT_PREFERRED,
66      * because after this time, MediaLive will switch back to the primary input.
67      */
SetErrorClearTimeMsec(int value)68     inline void SetErrorClearTimeMsec(int value) { m_errorClearTimeMsecHasBeenSet = true; m_errorClearTimeMsec = value; }
69 
70     /**
71      * This clear time defines the requirement a recovered input must meet to be
72      * considered healthy. The input must have no failover conditions for this length
73      * of time. Enter a time in milliseconds. This value is particularly important if
74      * the input_preference for the failover pair is set to PRIMARY_INPUT_PREFERRED,
75      * because after this time, MediaLive will switch back to the primary input.
76      */
WithErrorClearTimeMsec(int value)77     inline AutomaticInputFailoverSettings& WithErrorClearTimeMsec(int value) { SetErrorClearTimeMsec(value); return *this;}
78 
79 
80     /**
81      * A list of failover conditions. If any of these conditions occur, MediaLive will
82      * perform a failover to the other input.
83      */
GetFailoverConditions()84     inline const Aws::Vector<FailoverCondition>& GetFailoverConditions() const{ return m_failoverConditions; }
85 
86     /**
87      * A list of failover conditions. If any of these conditions occur, MediaLive will
88      * perform a failover to the other input.
89      */
FailoverConditionsHasBeenSet()90     inline bool FailoverConditionsHasBeenSet() const { return m_failoverConditionsHasBeenSet; }
91 
92     /**
93      * A list of failover conditions. If any of these conditions occur, MediaLive will
94      * perform a failover to the other input.
95      */
SetFailoverConditions(const Aws::Vector<FailoverCondition> & value)96     inline void SetFailoverConditions(const Aws::Vector<FailoverCondition>& value) { m_failoverConditionsHasBeenSet = true; m_failoverConditions = value; }
97 
98     /**
99      * A list of failover conditions. If any of these conditions occur, MediaLive will
100      * perform a failover to the other input.
101      */
SetFailoverConditions(Aws::Vector<FailoverCondition> && value)102     inline void SetFailoverConditions(Aws::Vector<FailoverCondition>&& value) { m_failoverConditionsHasBeenSet = true; m_failoverConditions = std::move(value); }
103 
104     /**
105      * A list of failover conditions. If any of these conditions occur, MediaLive will
106      * perform a failover to the other input.
107      */
WithFailoverConditions(const Aws::Vector<FailoverCondition> & value)108     inline AutomaticInputFailoverSettings& WithFailoverConditions(const Aws::Vector<FailoverCondition>& value) { SetFailoverConditions(value); return *this;}
109 
110     /**
111      * A list of failover conditions. If any of these conditions occur, MediaLive will
112      * perform a failover to the other input.
113      */
WithFailoverConditions(Aws::Vector<FailoverCondition> && value)114     inline AutomaticInputFailoverSettings& WithFailoverConditions(Aws::Vector<FailoverCondition>&& value) { SetFailoverConditions(std::move(value)); return *this;}
115 
116     /**
117      * A list of failover conditions. If any of these conditions occur, MediaLive will
118      * perform a failover to the other input.
119      */
AddFailoverConditions(const FailoverCondition & value)120     inline AutomaticInputFailoverSettings& AddFailoverConditions(const FailoverCondition& value) { m_failoverConditionsHasBeenSet = true; m_failoverConditions.push_back(value); return *this; }
121 
122     /**
123      * A list of failover conditions. If any of these conditions occur, MediaLive will
124      * perform a failover to the other input.
125      */
AddFailoverConditions(FailoverCondition && value)126     inline AutomaticInputFailoverSettings& AddFailoverConditions(FailoverCondition&& value) { m_failoverConditionsHasBeenSet = true; m_failoverConditions.push_back(std::move(value)); return *this; }
127 
128 
129     /**
130      * Input preference when deciding which input to make active when a previously
131      * failed input has recovered.
132      */
GetInputPreference()133     inline const InputPreference& GetInputPreference() const{ return m_inputPreference; }
134 
135     /**
136      * Input preference when deciding which input to make active when a previously
137      * failed input has recovered.
138      */
InputPreferenceHasBeenSet()139     inline bool InputPreferenceHasBeenSet() const { return m_inputPreferenceHasBeenSet; }
140 
141     /**
142      * Input preference when deciding which input to make active when a previously
143      * failed input has recovered.
144      */
SetInputPreference(const InputPreference & value)145     inline void SetInputPreference(const InputPreference& value) { m_inputPreferenceHasBeenSet = true; m_inputPreference = value; }
146 
147     /**
148      * Input preference when deciding which input to make active when a previously
149      * failed input has recovered.
150      */
SetInputPreference(InputPreference && value)151     inline void SetInputPreference(InputPreference&& value) { m_inputPreferenceHasBeenSet = true; m_inputPreference = std::move(value); }
152 
153     /**
154      * Input preference when deciding which input to make active when a previously
155      * failed input has recovered.
156      */
WithInputPreference(const InputPreference & value)157     inline AutomaticInputFailoverSettings& WithInputPreference(const InputPreference& value) { SetInputPreference(value); return *this;}
158 
159     /**
160      * Input preference when deciding which input to make active when a previously
161      * failed input has recovered.
162      */
WithInputPreference(InputPreference && value)163     inline AutomaticInputFailoverSettings& WithInputPreference(InputPreference&& value) { SetInputPreference(std::move(value)); return *this;}
164 
165 
166     /**
167      * The input ID of the secondary input in the automatic input failover pair.
168      */
GetSecondaryInputId()169     inline const Aws::String& GetSecondaryInputId() const{ return m_secondaryInputId; }
170 
171     /**
172      * The input ID of the secondary input in the automatic input failover pair.
173      */
SecondaryInputIdHasBeenSet()174     inline bool SecondaryInputIdHasBeenSet() const { return m_secondaryInputIdHasBeenSet; }
175 
176     /**
177      * The input ID of the secondary input in the automatic input failover pair.
178      */
SetSecondaryInputId(const Aws::String & value)179     inline void SetSecondaryInputId(const Aws::String& value) { m_secondaryInputIdHasBeenSet = true; m_secondaryInputId = value; }
180 
181     /**
182      * The input ID of the secondary input in the automatic input failover pair.
183      */
SetSecondaryInputId(Aws::String && value)184     inline void SetSecondaryInputId(Aws::String&& value) { m_secondaryInputIdHasBeenSet = true; m_secondaryInputId = std::move(value); }
185 
186     /**
187      * The input ID of the secondary input in the automatic input failover pair.
188      */
SetSecondaryInputId(const char * value)189     inline void SetSecondaryInputId(const char* value) { m_secondaryInputIdHasBeenSet = true; m_secondaryInputId.assign(value); }
190 
191     /**
192      * The input ID of the secondary input in the automatic input failover pair.
193      */
WithSecondaryInputId(const Aws::String & value)194     inline AutomaticInputFailoverSettings& WithSecondaryInputId(const Aws::String& value) { SetSecondaryInputId(value); return *this;}
195 
196     /**
197      * The input ID of the secondary input in the automatic input failover pair.
198      */
WithSecondaryInputId(Aws::String && value)199     inline AutomaticInputFailoverSettings& WithSecondaryInputId(Aws::String&& value) { SetSecondaryInputId(std::move(value)); return *this;}
200 
201     /**
202      * The input ID of the secondary input in the automatic input failover pair.
203      */
WithSecondaryInputId(const char * value)204     inline AutomaticInputFailoverSettings& WithSecondaryInputId(const char* value) { SetSecondaryInputId(value); return *this;}
205 
206   private:
207 
208     int m_errorClearTimeMsec;
209     bool m_errorClearTimeMsecHasBeenSet;
210 
211     Aws::Vector<FailoverCondition> m_failoverConditions;
212     bool m_failoverConditionsHasBeenSet;
213 
214     InputPreference m_inputPreference;
215     bool m_inputPreferenceHasBeenSet;
216 
217     Aws::String m_secondaryInputId;
218     bool m_secondaryInputIdHasBeenSet;
219   };
220 
221 } // namespace Model
222 } // namespace MediaLive
223 } // namespace Aws
224