AWS SDK for C++  0.14.3
AWS SDK for C++
IpPermission.h
Go to the documentation of this file.
1 /*
2 * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License").
5 * You may not use this file except in compliance with the License.
6 * A copy of the License is located at
7 *
8 * http://aws.amazon.com/apache2.0
9 *
10 * or in the "license" file accompanying this file. This file is distributed
11 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 * express or implied. See the License for the specific language governing
13 * permissions and limitations under the License.
14 */
15 #pragma once
16 #include <aws/ec2/EC2_EXPORTS.h>
21 #include <aws/ec2/model/IpRange.h>
23 
24 namespace Aws
25 {
26 namespace Utils
27 {
28 namespace Xml
29 {
30  class XmlNode;
31 } // namespace Xml
32 } // namespace Utils
33 namespace EC2
34 {
35 namespace Model
36 {
37 
42  {
43  public:
44  IpPermission();
45  IpPermission(const Aws::Utils::Xml::XmlNode& xmlNode);
46  IpPermission& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
47 
48  void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
49  void OutputToStream(Aws::OStream& oStream, const char* location) const;
50 
58  inline const Aws::String& GetIpProtocol() const{ return m_ipProtocol; }
59 
67  inline void SetIpProtocol(const Aws::String& value) { m_ipProtocolHasBeenSet = true; m_ipProtocol = value; }
68 
76  inline void SetIpProtocol(Aws::String&& value) { m_ipProtocolHasBeenSet = true; m_ipProtocol = value; }
77 
85  inline void SetIpProtocol(const char* value) { m_ipProtocolHasBeenSet = true; m_ipProtocol.assign(value); }
86 
94  inline IpPermission& WithIpProtocol(const Aws::String& value) { SetIpProtocol(value); return *this;}
95 
103  inline IpPermission& WithIpProtocol(Aws::String&& value) { SetIpProtocol(value); return *this;}
104 
112  inline IpPermission& WithIpProtocol(const char* value) { SetIpProtocol(value); return *this;}
113 
118  inline int GetFromPort() const{ return m_fromPort; }
119 
124  inline void SetFromPort(int value) { m_fromPortHasBeenSet = true; m_fromPort = value; }
125 
130  inline IpPermission& WithFromPort(int value) { SetFromPort(value); return *this;}
131 
136  inline int GetToPort() const{ return m_toPort; }
137 
142  inline void SetToPort(int value) { m_toPortHasBeenSet = true; m_toPort = value; }
143 
148  inline IpPermission& WithToPort(int value) { SetToPort(value); return *this;}
149 
153  inline const Aws::Vector<UserIdGroupPair>& GetUserIdGroupPairs() const{ return m_userIdGroupPairs; }
154 
158  inline void SetUserIdGroupPairs(const Aws::Vector<UserIdGroupPair>& value) { m_userIdGroupPairsHasBeenSet = true; m_userIdGroupPairs = value; }
159 
163  inline void SetUserIdGroupPairs(Aws::Vector<UserIdGroupPair>&& value) { m_userIdGroupPairsHasBeenSet = true; m_userIdGroupPairs = value; }
164 
168  inline IpPermission& WithUserIdGroupPairs(const Aws::Vector<UserIdGroupPair>& value) { SetUserIdGroupPairs(value); return *this;}
169 
173  inline IpPermission& WithUserIdGroupPairs(Aws::Vector<UserIdGroupPair>&& value) { SetUserIdGroupPairs(value); return *this;}
174 
178  inline IpPermission& AddUserIdGroupPairs(const UserIdGroupPair& value) { m_userIdGroupPairsHasBeenSet = true; m_userIdGroupPairs.push_back(value); return *this; }
179 
183  inline IpPermission& AddUserIdGroupPairs(UserIdGroupPair&& value) { m_userIdGroupPairsHasBeenSet = true; m_userIdGroupPairs.push_back(value); return *this; }
184 
188  inline const Aws::Vector<IpRange>& GetIpRanges() const{ return m_ipRanges; }
189 
193  inline void SetIpRanges(const Aws::Vector<IpRange>& value) { m_ipRangesHasBeenSet = true; m_ipRanges = value; }
194 
198  inline void SetIpRanges(Aws::Vector<IpRange>&& value) { m_ipRangesHasBeenSet = true; m_ipRanges = value; }
199 
203  inline IpPermission& WithIpRanges(const Aws::Vector<IpRange>& value) { SetIpRanges(value); return *this;}
204 
208  inline IpPermission& WithIpRanges(Aws::Vector<IpRange>&& value) { SetIpRanges(value); return *this;}
209 
213  inline IpPermission& AddIpRanges(const IpRange& value) { m_ipRangesHasBeenSet = true; m_ipRanges.push_back(value); return *this; }
214 
218  inline IpPermission& AddIpRanges(IpRange&& value) { m_ipRangesHasBeenSet = true; m_ipRanges.push_back(value); return *this; }
219 
228  inline const Aws::Vector<PrefixListId>& GetPrefixListIds() const{ return m_prefixListIds; }
229 
238  inline void SetPrefixListIds(const Aws::Vector<PrefixListId>& value) { m_prefixListIdsHasBeenSet = true; m_prefixListIds = value; }
239 
248  inline void SetPrefixListIds(Aws::Vector<PrefixListId>&& value) { m_prefixListIdsHasBeenSet = true; m_prefixListIds = value; }
249 
258  inline IpPermission& WithPrefixListIds(const Aws::Vector<PrefixListId>& value) { SetPrefixListIds(value); return *this;}
259 
268  inline IpPermission& WithPrefixListIds(Aws::Vector<PrefixListId>&& value) { SetPrefixListIds(value); return *this;}
269 
278  inline IpPermission& AddPrefixListIds(const PrefixListId& value) { m_prefixListIdsHasBeenSet = true; m_prefixListIds.push_back(value); return *this; }
279 
288  inline IpPermission& AddPrefixListIds(PrefixListId&& value) { m_prefixListIdsHasBeenSet = true; m_prefixListIds.push_back(value); return *this; }
289 
290  private:
291  Aws::String m_ipProtocol;
292  bool m_ipProtocolHasBeenSet;
293  int m_fromPort;
294  bool m_fromPortHasBeenSet;
295  int m_toPort;
296  bool m_toPortHasBeenSet;
297  Aws::Vector<UserIdGroupPair> m_userIdGroupPairs;
298  bool m_userIdGroupPairsHasBeenSet;
299  Aws::Vector<IpRange> m_ipRanges;
300  bool m_ipRangesHasBeenSet;
301  Aws::Vector<PrefixListId> m_prefixListIds;
302  bool m_prefixListIdsHasBeenSet;
303  };
304 
305 } // namespace Model
306 } // namespace EC2
307 } // namespace Aws
IpPermission & WithIpProtocol(const char *value)
Definition: IpPermission.h:112
IpPermission & WithUserIdGroupPairs(const Aws::Vector< UserIdGroupPair > &value)
Definition: IpPermission.h:168
IpPermission & WithPrefixListIds(Aws::Vector< PrefixListId > &&value)
Definition: IpPermission.h:268
void SetPrefixListIds(const Aws::Vector< PrefixListId > &value)
Definition: IpPermission.h:238
void SetIpRanges(const Aws::Vector< IpRange > &value)
Definition: IpPermission.h:193
std::vector< T, Aws::Allocator< T > > Vector
Definition: AWSVector.h:27
IpPermission & WithIpRanges(const Aws::Vector< IpRange > &value)
Definition: IpPermission.h:203
void SetIpProtocol(const char *value)
Definition: IpPermission.h:85
const Aws::Vector< PrefixListId > & GetPrefixListIds() const
Definition: IpPermission.h:228
void SetPrefixListIds(Aws::Vector< PrefixListId > &&value)
Definition: IpPermission.h:248
void SetIpProtocol(const Aws::String &value)
Definition: IpPermission.h:67
IpPermission & WithIpProtocol(Aws::String &&value)
Definition: IpPermission.h:103
void SetUserIdGroupPairs(Aws::Vector< UserIdGroupPair > &&value)
Definition: IpPermission.h:163
IpPermission & AddPrefixListIds(const PrefixListId &value)
Definition: IpPermission.h:278
void SetIpProtocol(Aws::String &&value)
Definition: IpPermission.h:76
IpPermission & AddUserIdGroupPairs(UserIdGroupPair &&value)
Definition: IpPermission.h:183
std::basic_ostream< char, std::char_traits< char > > OStream
Definition: AWSStreamFwd.h:31
IpPermission & WithToPort(int value)
Definition: IpPermission.h:148
IpPermission & WithUserIdGroupPairs(Aws::Vector< UserIdGroupPair > &&value)
Definition: IpPermission.h:173
IpPermission & WithIpProtocol(const Aws::String &value)
Definition: IpPermission.h:94
IpPermission & WithPrefixListIds(const Aws::Vector< PrefixListId > &value)
Definition: IpPermission.h:258
const Aws::Vector< IpRange > & GetIpRanges() const
Definition: IpPermission.h:188
IpPermission & AddIpRanges(const IpRange &value)
Definition: IpPermission.h:213
IpPermission & WithFromPort(int value)
Definition: IpPermission.h:130
void SetUserIdGroupPairs(const Aws::Vector< UserIdGroupPair > &value)
Definition: IpPermission.h:158
const Aws::Vector< UserIdGroupPair > & GetUserIdGroupPairs() const
Definition: IpPermission.h:153
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Definition: AWSString.h:97
IpPermission & AddUserIdGroupPairs(const UserIdGroupPair &value)
Definition: IpPermission.h:178
IpPermission & AddIpRanges(IpRange &&value)
Definition: IpPermission.h:218
#define AWS_EC2_API
Definition: EC2_EXPORTS.h:37
void SetIpRanges(Aws::Vector< IpRange > &&value)
Definition: IpPermission.h:198
IpPermission & AddPrefixListIds(PrefixListId &&value)
Definition: IpPermission.h:288
IpPermission & WithIpRanges(Aws::Vector< IpRange > &&value)
Definition: IpPermission.h:208
JSON (JavaScript Object Notation).
const Aws::String & GetIpProtocol() const
Definition: IpPermission.h:58