AWS SDK for C++

AWS SDK for C++ Version 1.11.835

Loading...
Searching...
No Matches
PortSpecification.h
1
6#pragma once
7#include <aws/lambda-microvms/LambdaMicrovms_EXPORTS.h>
8#include <aws/lambda-microvms/model/PortRange.h>
9#include <aws/lambda-microvms/model/Unit.h>
10
11#include <utility>
12
13namespace Aws {
14namespace Utils {
15namespace Json {
16class JsonValue;
17class JsonView;
18} // namespace Json
19} // namespace Utils
20namespace LambdaMicrovms {
21namespace Model {
22
30 public:
31 AWS_LAMBDAMICROVMS_API PortSpecification() = default;
32 AWS_LAMBDAMICROVMS_API PortSpecification(Aws::Utils::Json::JsonView jsonValue);
33 AWS_LAMBDAMICROVMS_API PortSpecification& operator=(Aws::Utils::Json::JsonView jsonValue);
34 AWS_LAMBDAMICROVMS_API Aws::Utils::Json::JsonValue Jsonize() const;
35
37
40 inline int GetPort() const { return m_port; }
41 inline bool PortHasBeenSet() const { return m_portHasBeenSet; }
42 inline void SetPort(int value) {
43 m_portHasBeenSet = true;
44 m_port = value;
45 }
46 inline PortSpecification& WithPort(int value) {
47 SetPort(value);
48 return *this;
49 }
51
53
56 inline const PortRange& GetRange() const { return m_range; }
57 inline bool RangeHasBeenSet() const { return m_rangeHasBeenSet; }
58 template <typename RangeT = PortRange>
59 void SetRange(RangeT&& value) {
60 m_rangeHasBeenSet = true;
61 m_range = std::forward<RangeT>(value);
62 }
63 template <typename RangeT = PortRange>
64 PortSpecification& WithRange(RangeT&& value) {
65 SetRange(std::forward<RangeT>(value));
66 return *this;
67 }
69
71
74 inline const Unit& GetAllPorts() const { return m_allPorts; }
75 inline bool AllPortsHasBeenSet() const { return m_allPortsHasBeenSet; }
76 template <typename AllPortsT = Unit>
77 void SetAllPorts(AllPortsT&& value) {
78 m_allPortsHasBeenSet = true;
79 m_allPorts = std::forward<AllPortsT>(value);
80 }
81 template <typename AllPortsT = Unit>
82 PortSpecification& WithAllPorts(AllPortsT&& value) {
83 SetAllPorts(std::forward<AllPortsT>(value));
84 return *this;
85 }
87 private:
88 int m_port{0};
89
90 PortRange m_range;
91
92 Unit m_allPorts;
93 bool m_portHasBeenSet = false;
94 bool m_rangeHasBeenSet = false;
95 bool m_allPortsHasBeenSet = false;
96};
97
98} // namespace Model
99} // namespace LambdaMicrovms
100} // namespace Aws
AWS_LAMBDAMICROVMS_API PortSpecification()=default
PortSpecification & WithRange(RangeT &&value)
AWS_LAMBDAMICROVMS_API PortSpecification(Aws::Utils::Json::JsonView jsonValue)
AWS_LAMBDAMICROVMS_API PortSpecification & operator=(Aws::Utils::Json::JsonView jsonValue)
AWS_LAMBDAMICROVMS_API Aws::Utils::Json::JsonValue Jsonize() const
PortSpecification & WithAllPorts(AllPortsT &&value)
Aws::Utils::Json::JsonValue JsonValue