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/dayu/v20180709/model/ResourceIp.h>
  
  using TencentCloud::CoreInternalOutcome;
  using namespace TencentCloud::Dayu::V20180709::Model;
  using namespace std;
  
  ResourceIp::ResourceIp() :
      m_idHasBeenSet(false),
      m_ipListHasBeenSet(false)
  {
  }
  
  CoreInternalOutcome ResourceIp::Deserialize(const rapidjson::Value &value)
  {
      string requestId = "";
  
  
      if (value.HasMember("Id") && !value["Id"].IsNull())
      {
          if (!value["Id"].IsString())
          {
              return CoreInternalOutcome(Error("response `ResourceIp.Id` IsString=false incorrectly").SetRequestId(requestId));
          }
          m_id = string(value["Id"].GetString());
          m_idHasBeenSet = true;
      }
  
      if (value.HasMember("IpList") && !value["IpList"].IsNull())
      {
          if (!value["IpList"].IsArray())
              return CoreInternalOutcome(Error("response `ResourceIp.IpList` is not array type"));
  
          const rapidjson::Value &tmpValue = value["IpList"];
          for (rapidjson::Value::ConstValueIterator itr = tmpValue.Begin(); itr != tmpValue.End(); ++itr)
          {
              m_ipList.push_back((*itr).GetString());
          }
          m_ipListHasBeenSet = true;
      }
  
  
      return CoreInternalOutcome(true);
  }
  
  void ResourceIp::ToJsonObject(rapidjson::Value &value, rapidjson::Document::AllocatorType& allocator) const
  {
  
      if (m_idHasBeenSet)
      {
          rapidjson::Value iKey(rapidjson::kStringType);
          string key = "Id";
          iKey.SetString(key.c_str(), allocator);
          value.AddMember(iKey, rapidjson::Value(m_id.c_str(), allocator).Move(), allocator);
      }
  
      if (m_ipListHasBeenSet)
      {
          rapidjson::Value iKey(rapidjson::kStringType);
          string key = "IpList";
          iKey.SetString(key.c_str(), allocator);
          value.AddMember(iKey, rapidjson::Value(rapidjson::kArrayType).Move(), allocator);
  
          for (auto itr = m_ipList.begin(); itr != m_ipList.end(); ++itr)
          {
              value[key.c_str()].PushBack(rapidjson::Value().SetString((*itr).c_str(), allocator), allocator);
          }
      }
  
  }
  
  
  string ResourceIp::GetId() const
  {
      return m_id;
  }
  
  void ResourceIp::SetId(const string& _id)
  {
      m_id = _id;
      m_idHasBeenSet = true;
  }
  
  bool ResourceIp::IdHasBeenSet() const
  {
      return m_idHasBeenSet;
  }
  
  vector<string> ResourceIp::GetIpList() const
  {
      return m_ipList;
  }
  
  void ResourceIp::SetIpList(const vector<string>& _ipList)
  {
      m_ipList = _ipList;
      m_ipListHasBeenSet = true;
  }
  
  bool ResourceIp::IpListHasBeenSet() const
  {
      return m_ipListHasBeenSet;
  }
  
  