AWS SDK for C++

AWS SDK for C++ Version 1.11.941

Loading...
Searching...
No Matches
Constraint.h
1
6#pragma once
7#include <aws/appconfigcloudextension/AppConfigCloudExtension_EXPORTS.h>
8#include <aws/appconfigcloudextension/model/EnumConstraint.h>
9#include <aws/appconfigcloudextension/model/LengthConstraint.h>
10#include <aws/appconfigcloudextension/model/PatternConstraint.h>
11#include <aws/appconfigcloudextension/model/RangeConstraint.h>
12#include <aws/appconfigcloudextension/model/TypeConstraint.h>
13
14#include <utility>
15
16namespace Aws {
17namespace Utils {
18namespace Json {
19class JsonValue;
20class JsonView;
21} // namespace Json
22} // namespace Utils
23namespace AppConfigCloudExtension {
24namespace Model {
25
33 public:
34 AWS_APPCONFIGCLOUDEXTENSION_API Constraint() = default;
35 AWS_APPCONFIGCLOUDEXTENSION_API Constraint(Aws::Utils::Json::JsonView jsonValue);
36 AWS_APPCONFIGCLOUDEXTENSION_API Constraint& operator=(Aws::Utils::Json::JsonView jsonValue);
37 AWS_APPCONFIGCLOUDEXTENSION_API Aws::Utils::Json::JsonValue Jsonize() const;
38
40
43 inline bool GetRequired() const { return m_required; }
44 inline bool RequiredHasBeenSet() const { return m_requiredHasBeenSet; }
45 inline void SetRequired(bool value) {
46 m_requiredHasBeenSet = true;
47 m_required = value;
48 }
49 inline Constraint& WithRequired(bool value) {
50 SetRequired(value);
51 return *this;
52 }
54
56
59 inline const TypeConstraint& GetType() const { return m_type; }
60 inline bool TypeHasBeenSet() const { return m_typeHasBeenSet; }
61 template <typename TypeT = TypeConstraint>
62 void SetType(TypeT&& value) {
63 m_typeHasBeenSet = true;
64 m_type = std::forward<TypeT>(value);
65 }
66 template <typename TypeT = TypeConstraint>
67 Constraint& WithType(TypeT&& value) {
68 SetType(std::forward<TypeT>(value));
69 return *this;
70 }
72
74
77 inline const LengthConstraint& GetLength() const { return m_length; }
78 inline bool LengthHasBeenSet() const { return m_lengthHasBeenSet; }
79 template <typename LengthT = LengthConstraint>
80 void SetLength(LengthT&& value) {
81 m_lengthHasBeenSet = true;
82 m_length = std::forward<LengthT>(value);
83 }
84 template <typename LengthT = LengthConstraint>
85 Constraint& WithLength(LengthT&& value) {
86 SetLength(std::forward<LengthT>(value));
87 return *this;
88 }
90
92
95 inline const RangeConstraint& GetRange() const { return m_range; }
96 inline bool RangeHasBeenSet() const { return m_rangeHasBeenSet; }
97 template <typename RangeT = RangeConstraint>
98 void SetRange(RangeT&& value) {
99 m_rangeHasBeenSet = true;
100 m_range = std::forward<RangeT>(value);
101 }
102 template <typename RangeT = RangeConstraint>
103 Constraint& WithRange(RangeT&& value) {
104 SetRange(std::forward<RangeT>(value));
105 return *this;
106 }
108
110
113 inline const PatternConstraint& GetPattern() const { return m_pattern; }
114 inline bool PatternHasBeenSet() const { return m_patternHasBeenSet; }
115 template <typename PatternT = PatternConstraint>
116 void SetPattern(PatternT&& value) {
117 m_patternHasBeenSet = true;
118 m_pattern = std::forward<PatternT>(value);
119 }
120 template <typename PatternT = PatternConstraint>
121 Constraint& WithPattern(PatternT&& value) {
122 SetPattern(std::forward<PatternT>(value));
123 return *this;
124 }
126
128
131 inline const EnumConstraint& GetEnum() const { return m_enum; }
132 inline bool EnumHasBeenSet() const { return m_enumHasBeenSet; }
133 template <typename EnumT = EnumConstraint>
134 void SetEnum(EnumT&& value) {
135 m_enumHasBeenSet = true;
136 m_enum = std::forward<EnumT>(value);
137 }
138 template <typename EnumT = EnumConstraint>
139 Constraint& WithEnum(EnumT&& value) {
140 SetEnum(std::forward<EnumT>(value));
141 return *this;
142 }
144
146
149 inline bool GetUnion() const { return m_union; }
150 inline bool UnionHasBeenSet() const { return m_unionHasBeenSet; }
151 inline void SetUnion(bool value) {
152 m_unionHasBeenSet = true;
153 m_union = value;
154 }
155 inline Constraint& WithUnion(bool value) {
156 SetUnion(value);
157 return *this;
158 }
160 private:
161 bool m_required{false};
162
163 TypeConstraint m_type;
164
165 LengthConstraint m_length;
166
167 RangeConstraint m_range;
168
169 PatternConstraint m_pattern;
170
171 EnumConstraint m_enum;
172
173 bool m_union{false};
174 bool m_requiredHasBeenSet = false;
175 bool m_typeHasBeenSet = false;
176 bool m_lengthHasBeenSet = false;
177 bool m_rangeHasBeenSet = false;
178 bool m_patternHasBeenSet = false;
179 bool m_enumHasBeenSet = false;
180 bool m_unionHasBeenSet = false;
181};
182
183} // namespace Model
184} // namespace AppConfigCloudExtension
185} // namespace Aws
AWS_APPCONFIGCLOUDEXTENSION_API Aws::Utils::Json::JsonValue Jsonize() const
AWS_APPCONFIGCLOUDEXTENSION_API Constraint & operator=(Aws::Utils::Json::JsonView jsonValue)
AWS_APPCONFIGCLOUDEXTENSION_API Constraint()=default
const TypeConstraint & GetType() const
Definition Constraint.h:59
Constraint & WithPattern(PatternT &&value)
Definition Constraint.h:121
const RangeConstraint & GetRange() const
Definition Constraint.h:95
Constraint & WithLength(LengthT &&value)
Definition Constraint.h:85
AWS_APPCONFIGCLOUDEXTENSION_API Constraint(Aws::Utils::Json::JsonView jsonValue)
const EnumConstraint & GetEnum() const
Definition Constraint.h:131
const LengthConstraint & GetLength() const
Definition Constraint.h:77
const PatternConstraint & GetPattern() const
Definition Constraint.h:113
Aws::Utils::Json::JsonValue JsonValue