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/msp/v20180319/model/DstInfo.h>
  
  using TencentCloud::CoreInternalOutcome;
  using namespace TencentCloud::Msp::V20180319::Model;
  using namespace std;
  
  DstInfo::DstInfo() :
      m_regionHasBeenSet(false),
      m_ipHasBeenSet(false),
      m_portHasBeenSet(false),
      m_instanceIdHasBeenSet(false)
  {
  }
  
  CoreInternalOutcome DstInfo::Deserialize(const rapidjson::Value &value)
  {
      string requestId = "";
  
  
      if (value.HasMember("Region") && !value["Region"].IsNull())
      {
          if (!value["Region"].IsString())
          {
              return CoreInternalOutcome(Error("response `DstInfo.Region` IsString=false incorrectly").SetRequestId(requestId));
          }
          m_region = string(value["Region"].GetString());
          m_regionHasBeenSet = true;
      }
  
      if (value.HasMember("Ip") && !value["Ip"].IsNull())
      {
          if (!value["Ip"].IsString())
          {
              return CoreInternalOutcome(Error("response `DstInfo.Ip` IsString=false incorrectly").SetRequestId(requestId));
          }
          m_ip = string(value["Ip"].GetString());
          m_ipHasBeenSet = true;
      }
  
      if (value.HasMember("Port") && !value["Port"].IsNull())
      {
          if (!value["Port"].IsString())
          {
              return CoreInternalOutcome(Error("response `DstInfo.Port` IsString=false incorrectly").SetRequestId(requestId));
          }
          m_port = string(value["Port"].GetString());
          m_portHasBeenSet = true;
      }
  
      if (value.HasMember("InstanceId") && !value["InstanceId"].IsNull())
      {
          if (!value["InstanceId"].IsString())
          {
              return CoreInternalOutcome(Error("response `DstInfo.InstanceId` IsString=false incorrectly").SetRequestId(requestId));
          }
          m_instanceId = string(value["InstanceId"].GetString());
          m_instanceIdHasBeenSet = true;
      }
  
  
      return CoreInternalOutcome(true);
  }
  
  void DstInfo::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_ipHasBeenSet)
      {
          rapidjson::Value iKey(rapidjson::kStringType);
          string key = "Ip";
          iKey.SetString(key.c_str(), allocator);
          value.AddMember(iKey, rapidjson::Value(m_ip.c_str(), allocator).Move(), allocator);
      }
  
      if (m_portHasBeenSet)
      {
          rapidjson::Value iKey(rapidjson::kStringType);
          string key = "Port";
          iKey.SetString(key.c_str(), allocator);
          value.AddMember(iKey, rapidjson::Value(m_port.c_str(), allocator).Move(), allocator);
      }
  
      if (m_instanceIdHasBeenSet)
      {
          rapidjson::Value iKey(rapidjson::kStringType);
          string key = "InstanceId";
          iKey.SetString(key.c_str(), allocator);
          value.AddMember(iKey, rapidjson::Value(m_instanceId.c_str(), allocator).Move(), allocator);
      }
  
  }
  
  
  string DstInfo::GetRegion() const
  {
      return m_region;
  }
  
  void DstInfo::SetRegion(const string& _region)
  {
      m_region = _region;
      m_regionHasBeenSet = true;
  }
  
  bool DstInfo::RegionHasBeenSet() const
  {
      return m_regionHasBeenSet;
  }
  
  string DstInfo::GetIp() const
  {
      return m_ip;
  }
  
  void DstInfo::SetIp(const string& _ip)
  {
      m_ip = _ip;
      m_ipHasBeenSet = true;
  }
  
  bool DstInfo::IpHasBeenSet() const
  {
      return m_ipHasBeenSet;
  }
  
  string DstInfo::GetPort() const
  {
      return m_port;
  }
  
  void DstInfo::SetPort(const string& _port)
  {
      m_port = _port;
      m_portHasBeenSet = true;
  }
  
  bool DstInfo::PortHasBeenSet() const
  {
      return m_portHasBeenSet;
  }
  
  string DstInfo::GetInstanceId() const
  {
      return m_instanceId;
  }
  
  void DstInfo::SetInstanceId(const string& _instanceId)
  {
      m_instanceId = _instanceId;
      m_instanceIdHasBeenSet = true;
  }
  
  bool DstInfo::InstanceIdHasBeenSet() const
  {
      return m_instanceIdHasBeenSet;
  }
  
  