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/memorydb/MemoryDB_EXPORTS.h> 8 #include <aws/core/utils/memory/stl/AWSString.h> 9 #include <aws/core/utils/memory/stl/AWSVector.h> 10 #include <aws/memorydb/model/Node.h> 11 #include <utility> 12 13 namespace Aws 14 { 15 namespace Utils 16 { 17 namespace Json 18 { 19 class JsonValue; 20 class JsonView; 21 } // namespace Json 22 } // namespace Utils 23 namespace MemoryDB 24 { 25 namespace Model 26 { 27 28 /** 29 * <p>Represents a collection of nodes in a cluster. One node in the node group is 30 * the read/write primary node. All the other nodes are read-only Replica 31 * nodes.</p><p><h3>See Also:</h3> <a 32 * href="http://docs.aws.amazon.com/goto/WebAPI/memorydb-2021-01-01/Shard">AWS API 33 * Reference</a></p> 34 */ 35 class AWS_MEMORYDB_API Shard 36 { 37 public: 38 Shard(); 39 Shard(Aws::Utils::Json::JsonView jsonValue); 40 Shard& operator=(Aws::Utils::Json::JsonView jsonValue); 41 Aws::Utils::Json::JsonValue Jsonize() const; 42 43 44 /** 45 * <p>The name of the shard</p> 46 */ GetName()47 inline const Aws::String& GetName() const{ return m_name; } 48 49 /** 50 * <p>The name of the shard</p> 51 */ NameHasBeenSet()52 inline bool NameHasBeenSet() const { return m_nameHasBeenSet; } 53 54 /** 55 * <p>The name of the shard</p> 56 */ SetName(const Aws::String & value)57 inline void SetName(const Aws::String& value) { m_nameHasBeenSet = true; m_name = value; } 58 59 /** 60 * <p>The name of the shard</p> 61 */ SetName(Aws::String && value)62 inline void SetName(Aws::String&& value) { m_nameHasBeenSet = true; m_name = std::move(value); } 63 64 /** 65 * <p>The name of the shard</p> 66 */ SetName(const char * value)67 inline void SetName(const char* value) { m_nameHasBeenSet = true; m_name.assign(value); } 68 69 /** 70 * <p>The name of the shard</p> 71 */ WithName(const Aws::String & value)72 inline Shard& WithName(const Aws::String& value) { SetName(value); return *this;} 73 74 /** 75 * <p>The name of the shard</p> 76 */ WithName(Aws::String && value)77 inline Shard& WithName(Aws::String&& value) { SetName(std::move(value)); return *this;} 78 79 /** 80 * <p>The name of the shard</p> 81 */ WithName(const char * value)82 inline Shard& WithName(const char* value) { SetName(value); return *this;} 83 84 85 /** 86 * <p>The current state of this replication group - creating, available, modifying, 87 * deleting.</p> 88 */ GetStatus()89 inline const Aws::String& GetStatus() const{ return m_status; } 90 91 /** 92 * <p>The current state of this replication group - creating, available, modifying, 93 * deleting.</p> 94 */ StatusHasBeenSet()95 inline bool StatusHasBeenSet() const { return m_statusHasBeenSet; } 96 97 /** 98 * <p>The current state of this replication group - creating, available, modifying, 99 * deleting.</p> 100 */ SetStatus(const Aws::String & value)101 inline void SetStatus(const Aws::String& value) { m_statusHasBeenSet = true; m_status = value; } 102 103 /** 104 * <p>The current state of this replication group - creating, available, modifying, 105 * deleting.</p> 106 */ SetStatus(Aws::String && value)107 inline void SetStatus(Aws::String&& value) { m_statusHasBeenSet = true; m_status = std::move(value); } 108 109 /** 110 * <p>The current state of this replication group - creating, available, modifying, 111 * deleting.</p> 112 */ SetStatus(const char * value)113 inline void SetStatus(const char* value) { m_statusHasBeenSet = true; m_status.assign(value); } 114 115 /** 116 * <p>The current state of this replication group - creating, available, modifying, 117 * deleting.</p> 118 */ WithStatus(const Aws::String & value)119 inline Shard& WithStatus(const Aws::String& value) { SetStatus(value); return *this;} 120 121 /** 122 * <p>The current state of this replication group - creating, available, modifying, 123 * deleting.</p> 124 */ WithStatus(Aws::String && value)125 inline Shard& WithStatus(Aws::String&& value) { SetStatus(std::move(value)); return *this;} 126 127 /** 128 * <p>The current state of this replication group - creating, available, modifying, 129 * deleting.</p> 130 */ WithStatus(const char * value)131 inline Shard& WithStatus(const char* value) { SetStatus(value); return *this;} 132 133 134 /** 135 * <p>The keyspace for this shard.</p> 136 */ GetSlots()137 inline const Aws::String& GetSlots() const{ return m_slots; } 138 139 /** 140 * <p>The keyspace for this shard.</p> 141 */ SlotsHasBeenSet()142 inline bool SlotsHasBeenSet() const { return m_slotsHasBeenSet; } 143 144 /** 145 * <p>The keyspace for this shard.</p> 146 */ SetSlots(const Aws::String & value)147 inline void SetSlots(const Aws::String& value) { m_slotsHasBeenSet = true; m_slots = value; } 148 149 /** 150 * <p>The keyspace for this shard.</p> 151 */ SetSlots(Aws::String && value)152 inline void SetSlots(Aws::String&& value) { m_slotsHasBeenSet = true; m_slots = std::move(value); } 153 154 /** 155 * <p>The keyspace for this shard.</p> 156 */ SetSlots(const char * value)157 inline void SetSlots(const char* value) { m_slotsHasBeenSet = true; m_slots.assign(value); } 158 159 /** 160 * <p>The keyspace for this shard.</p> 161 */ WithSlots(const Aws::String & value)162 inline Shard& WithSlots(const Aws::String& value) { SetSlots(value); return *this;} 163 164 /** 165 * <p>The keyspace for this shard.</p> 166 */ WithSlots(Aws::String && value)167 inline Shard& WithSlots(Aws::String&& value) { SetSlots(std::move(value)); return *this;} 168 169 /** 170 * <p>The keyspace for this shard.</p> 171 */ WithSlots(const char * value)172 inline Shard& WithSlots(const char* value) { SetSlots(value); return *this;} 173 174 175 /** 176 * <p>A list containing information about individual nodes within the shard</p> 177 */ GetNodes()178 inline const Aws::Vector<Node>& GetNodes() const{ return m_nodes; } 179 180 /** 181 * <p>A list containing information about individual nodes within the shard</p> 182 */ NodesHasBeenSet()183 inline bool NodesHasBeenSet() const { return m_nodesHasBeenSet; } 184 185 /** 186 * <p>A list containing information about individual nodes within the shard</p> 187 */ SetNodes(const Aws::Vector<Node> & value)188 inline void SetNodes(const Aws::Vector<Node>& value) { m_nodesHasBeenSet = true; m_nodes = value; } 189 190 /** 191 * <p>A list containing information about individual nodes within the shard</p> 192 */ SetNodes(Aws::Vector<Node> && value)193 inline void SetNodes(Aws::Vector<Node>&& value) { m_nodesHasBeenSet = true; m_nodes = std::move(value); } 194 195 /** 196 * <p>A list containing information about individual nodes within the shard</p> 197 */ WithNodes(const Aws::Vector<Node> & value)198 inline Shard& WithNodes(const Aws::Vector<Node>& value) { SetNodes(value); return *this;} 199 200 /** 201 * <p>A list containing information about individual nodes within the shard</p> 202 */ WithNodes(Aws::Vector<Node> && value)203 inline Shard& WithNodes(Aws::Vector<Node>&& value) { SetNodes(std::move(value)); return *this;} 204 205 /** 206 * <p>A list containing information about individual nodes within the shard</p> 207 */ AddNodes(const Node & value)208 inline Shard& AddNodes(const Node& value) { m_nodesHasBeenSet = true; m_nodes.push_back(value); return *this; } 209 210 /** 211 * <p>A list containing information about individual nodes within the shard</p> 212 */ AddNodes(Node && value)213 inline Shard& AddNodes(Node&& value) { m_nodesHasBeenSet = true; m_nodes.push_back(std::move(value)); return *this; } 214 215 216 /** 217 * <p>The number of nodes in the shard</p> 218 */ GetNumberOfNodes()219 inline int GetNumberOfNodes() const{ return m_numberOfNodes; } 220 221 /** 222 * <p>The number of nodes in the shard</p> 223 */ NumberOfNodesHasBeenSet()224 inline bool NumberOfNodesHasBeenSet() const { return m_numberOfNodesHasBeenSet; } 225 226 /** 227 * <p>The number of nodes in the shard</p> 228 */ SetNumberOfNodes(int value)229 inline void SetNumberOfNodes(int value) { m_numberOfNodesHasBeenSet = true; m_numberOfNodes = value; } 230 231 /** 232 * <p>The number of nodes in the shard</p> 233 */ WithNumberOfNodes(int value)234 inline Shard& WithNumberOfNodes(int value) { SetNumberOfNodes(value); return *this;} 235 236 private: 237 238 Aws::String m_name; 239 bool m_nameHasBeenSet; 240 241 Aws::String m_status; 242 bool m_statusHasBeenSet; 243 244 Aws::String m_slots; 245 bool m_slotsHasBeenSet; 246 247 Aws::Vector<Node> m_nodes; 248 bool m_nodesHasBeenSet; 249 250 int m_numberOfNodes; 251 bool m_numberOfNodesHasBeenSet; 252 }; 253 254 } // namespace Model 255 } // namespace MemoryDB 256 } // namespace Aws 257