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/sqlserver/v20180328/model/RegionInfo.h>
  
  using TencentCloud::CoreInternalOutcome;
  using namespace TencentCloud::Sqlserver::V20180328::Model;
  using namespace std;
  
  RegionInfo::RegionInfo() :
      m_regionHasBeenSet(false),
      m_regionNameHasBeenSet(false),
      m_regionIdHasBeenSet(false),
      m_regionStateHasBeenSet(false)
  {
  }
  
  CoreInternalOutcome RegionInfo::Deserialize(const rapidjson::Value &value)
  {
      string requestId = "";
  
  
      if (value.HasMember("Region") && !value["Region"].IsNull())
      {
          if (!value["Region"].IsString())
          {
              return CoreInternalOutcome(Core::Error("response `RegionInfo.Region` IsString=false incorrectly").SetRequestId(requestId));
          }
          m_region = string(value["Region"].GetString());
          m_regionHasBeenSet = true;
      }
  
      if (value.HasMember("RegionName") && !value["RegionName"].IsNull())
      {
          if (!value["RegionName"].IsString())
          {
              return CoreInternalOutcome(Core::Error("response `RegionInfo.RegionName` IsString=false incorrectly").SetRequestId(requestId));
          }
          m_regionName = string(value["RegionName"].GetString());
          m_regionNameHasBeenSet = true;
      }
  
      if (value.HasMember("RegionId") && !value["RegionId"].IsNull())
      {
          if (!value["RegionId"].IsInt64())
          {
              return CoreInternalOutcome(Core::Error("response `RegionInfo.RegionId` IsInt64=false incorrectly").SetRequestId(requestId));
          }
          m_regionId = value["RegionId"].GetInt64();
          m_regionIdHasBeenSet = true;
      }
  
      if (value.HasMember("RegionState") && !value["RegionState"].IsNull())
      {
          if (!value["RegionState"].IsString())
          {
              return CoreInternalOutcome(Core::Error("response `RegionInfo.RegionState` IsString=false incorrectly").SetRequestId(requestId));
          }
          m_regionState = string(value["RegionState"].GetString());
          m_regionStateHasBeenSet = true;
      }
  
  
      return CoreInternalOutcome(true);
  }
  
  void RegionInfo::ToJsonObject(rapidjson::Value &value, rapidjson::Document::AllocatorType& allocator) const
  {
  
      if (m_regionHasBeenSet)
      {
          rapidjson::Value iKey(rapidjson::kStringType);
          string key = "Region";
          iKey.SetString(key.c_str(), allocator);
          value.AddMember(iKey, rapidjson::Value(m_region.c_str(), allocator).Move(), allocator);
      }
  
      if (m_regionNameHasBeenSet)
      {
          rapidjson::Value iKey(rapidjson::kStringType);
          string key = "RegionName";
          iKey.SetString(key.c_str(), allocator);
          value.AddMember(iKey, rapidjson::Value(m_regionName.c_str(), allocator).Move(), allocator);
      }
  
      if (m_regionIdHasBeenSet)
      {
          rapidjson::Value iKey(rapidjson::kStringType);
          string key = "RegionId";
          iKey.SetString(key.c_str(), allocator);
          value.AddMember(iKey, m_regionId, allocator);
      }
  
      if (m_regionStateHasBeenSet)
      {
          rapidjson::Value iKey(rapidjson::kStringType);
          string key = "RegionState";
          iKey.SetString(key.c_str(), allocator);
          value.AddMember(iKey, rapidjson::Value(m_regionState.c_str(), allocator).Move(), allocator);
      }
  
  }
  
  
  string RegionInfo::GetRegion() const
  {
      return m_region;
  }
  
  void RegionInfo::SetRegion(const string& _region)
  {
      m_region = _region;
      m_regionHasBeenSet = true;
  }
  
  bool RegionInfo::RegionHasBeenSet() const
  {
      return m_regionHasBeenSet;
  }
  
  string RegionInfo::GetRegionName() const
  {
      return m_regionName;
  }
  
  void RegionInfo::SetRegionName(const string& _regionName)
  {
      m_regionName = _regionName;
      m_regionNameHasBeenSet = true;
  }
  
  bool RegionInfo::RegionNameHasBeenSet() const
  {
      return m_regionNameHasBeenSet;
  }
  
  int64_t RegionInfo::GetRegionId() const
  {
      return m_regionId;
  }
  
  void RegionInfo::SetRegionId(const int64_t& _regionId)
  {
      m_regionId = _regionId;
      m_regionIdHasBeenSet = true;
  }
  
  bool RegionInfo::RegionIdHasBeenSet() const
  {
      return m_regionIdHasBeenSet;
  }
  
  string RegionInfo::GetRegionState() const
  {
      return m_regionState;
  }
  
  void RegionInfo::SetRegionState(const string& _regionState)
  {
      m_regionState = _regionState;
      m_regionStateHasBeenSet = true;
  }
  
  bool RegionInfo::RegionStateHasBeenSet() const
  {
      return m_regionStateHasBeenSet;
  }
  
  