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/tbaas/v20180416/model/ClusterDetailForUser.h>
  
  using TencentCloud::CoreInternalOutcome;
  using namespace TencentCloud::Tbaas::V20180416::Model;
  using namespace std;
  
  ClusterDetailForUser::ClusterDetailForUser() :
      m_clusterIdHasBeenSet(false),
      m_groupListHasBeenSet(false),
      m_clusterNameHasBeenSet(false)
  {
  }
  
  CoreInternalOutcome ClusterDetailForUser::Deserialize(const rapidjson::Value &value)
  {
      string requestId = "";
  
  
      if (value.HasMember("ClusterId") && !value["ClusterId"].IsNull())
      {
          if (!value["ClusterId"].IsString())
          {
              return CoreInternalOutcome(Core::Error("response `ClusterDetailForUser.ClusterId` IsString=false incorrectly").SetRequestId(requestId));
          }
          m_clusterId = string(value["ClusterId"].GetString());
          m_clusterIdHasBeenSet = true;
      }
  
      if (value.HasMember("GroupList") && !value["GroupList"].IsNull())
      {
          if (!value["GroupList"].IsArray())
              return CoreInternalOutcome(Core::Error("response `ClusterDetailForUser.GroupList` is not array type"));
  
          const rapidjson::Value &tmpValue = value["GroupList"];
          for (rapidjson::Value::ConstValueIterator itr = tmpValue.Begin(); itr != tmpValue.End(); ++itr)
          {
              GroupDetailForUser item;
              CoreInternalOutcome outcome = item.Deserialize(*itr);
              if (!outcome.IsSuccess())
              {
                  outcome.GetError().SetRequestId(requestId);
                  return outcome;
              }
              m_groupList.push_back(item);
          }
          m_groupListHasBeenSet = true;
      }
  
      if (value.HasMember("ClusterName") && !value["ClusterName"].IsNull())
      {
          if (!value["ClusterName"].IsString())
          {
              return CoreInternalOutcome(Core::Error("response `ClusterDetailForUser.ClusterName` IsString=false incorrectly").SetRequestId(requestId));
          }
          m_clusterName = string(value["ClusterName"].GetString());
          m_clusterNameHasBeenSet = true;
      }
  
  
      return CoreInternalOutcome(true);
  }
  
  void ClusterDetailForUser::ToJsonObject(rapidjson::Value &value, rapidjson::Document::AllocatorType& allocator) const
  {
  
      if (m_clusterIdHasBeenSet)
      {
          rapidjson::Value iKey(rapidjson::kStringType);
          string key = "ClusterId";
          iKey.SetString(key.c_str(), allocator);
          value.AddMember(iKey, rapidjson::Value(m_clusterId.c_str(), allocator).Move(), allocator);
      }
  
      if (m_groupListHasBeenSet)
      {
          rapidjson::Value iKey(rapidjson::kStringType);
          string key = "GroupList";
          iKey.SetString(key.c_str(), allocator);
          value.AddMember(iKey, rapidjson::Value(rapidjson::kArrayType).Move(), allocator);
  
          int i=0;
          for (auto itr = m_groupList.begin(); itr != m_groupList.end(); ++itr, ++i)
          {
              value[key.c_str()].PushBack(rapidjson::Value(rapidjson::kObjectType).Move(), allocator);
              (*itr).ToJsonObject(value[key.c_str()][i], allocator);
          }
      }
  
      if (m_clusterNameHasBeenSet)
      {
          rapidjson::Value iKey(rapidjson::kStringType);
          string key = "ClusterName";
          iKey.SetString(key.c_str(), allocator);
          value.AddMember(iKey, rapidjson::Value(m_clusterName.c_str(), allocator).Move(), allocator);
      }
  
  }
  
  
  string ClusterDetailForUser::GetClusterId() const
  {
      return m_clusterId;
  }
  
  void ClusterDetailForUser::SetClusterId(const string& _clusterId)
  {
      m_clusterId = _clusterId;
      m_clusterIdHasBeenSet = true;
  }
  
  bool ClusterDetailForUser::ClusterIdHasBeenSet() const
  {
      return m_clusterIdHasBeenSet;
  }
  
  vector<GroupDetailForUser> ClusterDetailForUser::GetGroupList() const
  {
      return m_groupList;
  }
  
  void ClusterDetailForUser::SetGroupList(const vector<GroupDetailForUser>& _groupList)
  {
      m_groupList = _groupList;
      m_groupListHasBeenSet = true;
  }
  
  bool ClusterDetailForUser::GroupListHasBeenSet() const
  {
      return m_groupListHasBeenSet;
  }
  
  string ClusterDetailForUser::GetClusterName() const
  {
      return m_clusterName;
  }
  
  void ClusterDetailForUser::SetClusterName(const string& _clusterName)
  {
      m_clusterName = _clusterName;
      m_clusterNameHasBeenSet = true;
  }
  
  bool ClusterDetailForUser::ClusterNameHasBeenSet() const
  {
      return m_clusterNameHasBeenSet;
  }
  
  