text: /*
   * Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. All Rights Reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *    http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  #include <tencentcloud/mariadb/v20170312/model/NodeInfo.h>
  
  using TencentCloud::CoreInternalOutcome;
  using namespace TencentCloud::Mariadb::V20170312::Model;
  using namespace std;
  
  NodeInfo::NodeInfo() :
      m_nodeIdHasBeenSet(false),
      m_roleHasBeenSet(false)
  {
  }
  
  CoreInternalOutcome NodeInfo::Deserialize(const rapidjson::Value &value)
  {
      string requestId = "";
  
  
      if (value.HasMember("NodeId") && !value["NodeId"].IsNull())
      {
          if (!value["NodeId"].IsString())
          {
              return CoreInternalOutcome(Error("response `NodeInfo.NodeId` IsString=false incorrectly").SetRequestId(requestId));
          }
          m_nodeId = string(value["NodeId"].GetString());
          m_nodeIdHasBeenSet = true;
      }
  
      if (value.HasMember("Role") && !value["Role"].IsNull())
      {
          if (!value["Role"].IsString())
          {
              return CoreInternalOutcome(Error("response `NodeInfo.Role` IsString=false incorrectly").SetRequestId(requestId));
          }
          m_role = string(value["Role"].GetString());
          m_roleHasBeenSet = true;
      }
  
  
      return CoreInternalOutcome(true);
  }
  
  void NodeInfo::ToJsonObject(rapidjson::Value &value, rapidjson::Document::AllocatorType& allocator) const
  {
  
      if (m_nodeIdHasBeenSet)
      {
          rapidjson::Value iKey(rapidjson::kStringType);
          string key = "NodeId";
          iKey.SetString(key.c_str(), allocator);
          value.AddMember(iKey, rapidjson::Value(m_nodeId.c_str(), allocator).Move(), allocator);
      }
  
      if (m_roleHasBeenSet)
      {
          rapidjson::Value iKey(rapidjson::kStringType);
          string key = "Role";
          iKey.SetString(key.c_str(), allocator);
          value.AddMember(iKey, rapidjson::Value(m_role.c_str(), allocator).Move(), allocator);
      }
  
  }
  
  
  string NodeInfo::GetNodeId() const
  {
      return m_nodeId;
  }
  
  void NodeInfo::SetNodeId(const string& _nodeId)
  {
      m_nodeId = _nodeId;
      m_nodeIdHasBeenSet = true;
  }
  
  bool NodeInfo::NodeIdHasBeenSet() const
  {
      return m_nodeIdHasBeenSet;
  }
  
  string NodeInfo::GetRole() const
  {
      return m_role;
  }
  
  void NodeInfo::SetRole(const string& _role)
  {
      m_role = _role;
      m_roleHasBeenSet = true;
  }
  
  bool NodeInfo::RoleHasBeenSet() const
  {
      return m_roleHasBeenSet;
  }
  
  