AWS SDK for C++

AWS SDK for C++ Version 1.11.743

Loading...
Searching...
No Matches
Resource.h
1
6#pragma once
7#include <aws/core/utils/memory/stl/AWSMap.h>
8#include <aws/core/utils/memory/stl/AWSString.h>
9#include <aws/inspector2/Inspector2_EXPORTS.h>
10#include <aws/inspector2/model/ResourceDetails.h>
11#include <aws/inspector2/model/ResourceType.h>
12
13#include <utility>
14
15namespace Aws {
16namespace Utils {
17namespace Json {
18class JsonValue;
19class JsonView;
20} // namespace Json
21} // namespace Utils
22namespace Inspector2 {
23namespace Model {
24
31class Resource {
32 public:
33 AWS_INSPECTOR2_API Resource() = default;
34 AWS_INSPECTOR2_API Resource(Aws::Utils::Json::JsonView jsonValue);
35 AWS_INSPECTOR2_API Resource& operator=(Aws::Utils::Json::JsonView jsonValue);
36 AWS_INSPECTOR2_API Aws::Utils::Json::JsonValue Jsonize() const;
37
39
42 inline ResourceType GetType() const { return m_type; }
43 inline bool TypeHasBeenSet() const { return m_typeHasBeenSet; }
44 inline void SetType(ResourceType value) {
45 m_typeHasBeenSet = true;
46 m_type = value;
47 }
49 SetType(value);
50 return *this;
51 }
53
55
58 inline const Aws::String& GetId() const { return m_id; }
59 inline bool IdHasBeenSet() const { return m_idHasBeenSet; }
60 template <typename IdT = Aws::String>
61 void SetId(IdT&& value) {
62 m_idHasBeenSet = true;
63 m_id = std::forward<IdT>(value);
64 }
65 template <typename IdT = Aws::String>
66 Resource& WithId(IdT&& value) {
67 SetId(std::forward<IdT>(value));
68 return *this;
69 }
71
73
76 inline const Aws::String& GetPartition() const { return m_partition; }
77 inline bool PartitionHasBeenSet() const { return m_partitionHasBeenSet; }
78 template <typename PartitionT = Aws::String>
79 void SetPartition(PartitionT&& value) {
80 m_partitionHasBeenSet = true;
81 m_partition = std::forward<PartitionT>(value);
82 }
83 template <typename PartitionT = Aws::String>
84 Resource& WithPartition(PartitionT&& value) {
85 SetPartition(std::forward<PartitionT>(value));
86 return *this;
87 }
89
91
94 inline const Aws::String& GetRegion() const { return m_region; }
95 inline bool RegionHasBeenSet() const { return m_regionHasBeenSet; }
96 template <typename RegionT = Aws::String>
97 void SetRegion(RegionT&& value) {
98 m_regionHasBeenSet = true;
99 m_region = std::forward<RegionT>(value);
100 }
101 template <typename RegionT = Aws::String>
102 Resource& WithRegion(RegionT&& value) {
103 SetRegion(std::forward<RegionT>(value));
104 return *this;
105 }
107
109
112 inline const Aws::Map<Aws::String, Aws::String>& GetTags() const { return m_tags; }
113 inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }
114 template <typename TagsT = Aws::Map<Aws::String, Aws::String>>
115 void SetTags(TagsT&& value) {
116 m_tagsHasBeenSet = true;
117 m_tags = std::forward<TagsT>(value);
118 }
119 template <typename TagsT = Aws::Map<Aws::String, Aws::String>>
120 Resource& WithTags(TagsT&& value) {
121 SetTags(std::forward<TagsT>(value));
122 return *this;
123 }
124 template <typename TagsKeyT = Aws::String, typename TagsValueT = Aws::String>
125 Resource& AddTags(TagsKeyT&& key, TagsValueT&& value) {
126 m_tagsHasBeenSet = true;
127 m_tags.emplace(std::forward<TagsKeyT>(key), std::forward<TagsValueT>(value));
128 return *this;
129 }
131
133
136 inline const ResourceDetails& GetDetails() const { return m_details; }
137 inline bool DetailsHasBeenSet() const { return m_detailsHasBeenSet; }
138 template <typename DetailsT = ResourceDetails>
139 void SetDetails(DetailsT&& value) {
140 m_detailsHasBeenSet = true;
141 m_details = std::forward<DetailsT>(value);
142 }
143 template <typename DetailsT = ResourceDetails>
144 Resource& WithDetails(DetailsT&& value) {
145 SetDetails(std::forward<DetailsT>(value));
146 return *this;
147 }
149 private:
151
152 Aws::String m_id;
153
154 Aws::String m_partition;
155
156 Aws::String m_region;
157
159
160 ResourceDetails m_details;
161 bool m_typeHasBeenSet = false;
162 bool m_idHasBeenSet = false;
163 bool m_partitionHasBeenSet = false;
164 bool m_regionHasBeenSet = false;
165 bool m_tagsHasBeenSet = false;
166 bool m_detailsHasBeenSet = false;
167};
168
169} // namespace Model
170} // namespace Inspector2
171} // namespace Aws
AWS_INSPECTOR2_API Resource(Aws::Utils::Json::JsonView jsonValue)
Resource & WithDetails(DetailsT &&value)
Definition Resource.h:144
void SetDetails(DetailsT &&value)
Definition Resource.h:139
Resource & WithType(ResourceType value)
Definition Resource.h:48
Resource & WithRegion(RegionT &&value)
Definition Resource.h:102
const ResourceDetails & GetDetails() const
Definition Resource.h:136
const Aws::String & GetPartition() const
Definition Resource.h:76
void SetRegion(RegionT &&value)
Definition Resource.h:97
AWS_INSPECTOR2_API Resource()=default
const Aws::String & GetRegion() const
Definition Resource.h:94
ResourceType GetType() const
Definition Resource.h:42
void SetType(ResourceType value)
Definition Resource.h:44
void SetPartition(PartitionT &&value)
Definition Resource.h:79
Resource & WithTags(TagsT &&value)
Definition Resource.h:120
Resource & AddTags(TagsKeyT &&key, TagsValueT &&value)
Definition Resource.h:125
AWS_INSPECTOR2_API Resource & operator=(Aws::Utils::Json::JsonView jsonValue)
void SetTags(TagsT &&value)
Definition Resource.h:115
Resource & WithPartition(PartitionT &&value)
Definition Resource.h:84
Resource & WithId(IdT &&value)
Definition Resource.h:66
const Aws::Map< Aws::String, Aws::String > & GetTags() const
Definition Resource.h:112
AWS_INSPECTOR2_API Aws::Utils::Json::JsonValue Jsonize() const
const Aws::String & GetId() const
Definition Resource.h:58
std::map< K, V, std::less< K >, Aws::Allocator< std::pair< const K, V > > > Map
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Aws::Utils::Json::JsonValue JsonValue