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/redis/v20180412/model/HotKeyInfo.h>
  
  using TencentCloud::CoreInternalOutcome;
  using namespace TencentCloud::Redis::V20180412::Model;
  using namespace std;
  
  HotKeyInfo::HotKeyInfo() :
      m_keyHasBeenSet(false),
      m_typeHasBeenSet(false),
      m_countHasBeenSet(false)
  {
  }
  
  CoreInternalOutcome HotKeyInfo::Deserialize(const rapidjson::Value &value)
  {
      string requestId = "";
  
  
      if (value.HasMember("Key") && !value["Key"].IsNull())
      {
          if (!value["Key"].IsString())
          {
              return CoreInternalOutcome(Core::Error("response `HotKeyInfo.Key` IsString=false incorrectly").SetRequestId(requestId));
          }
          m_key = string(value["Key"].GetString());
          m_keyHasBeenSet = true;
      }
  
      if (value.HasMember("Type") && !value["Type"].IsNull())
      {
          if (!value["Type"].IsString())
          {
              return CoreInternalOutcome(Core::Error("response `HotKeyInfo.Type` IsString=false incorrectly").SetRequestId(requestId));
          }
          m_type = string(value["Type"].GetString());
          m_typeHasBeenSet = true;
      }
  
      if (value.HasMember("Count") && !value["Count"].IsNull())
      {
          if (!value["Count"].IsInt64())
          {
              return CoreInternalOutcome(Core::Error("response `HotKeyInfo.Count` IsInt64=false incorrectly").SetRequestId(requestId));
          }
          m_count = value["Count"].GetInt64();
          m_countHasBeenSet = true;
      }
  
  
      return CoreInternalOutcome(true);
  }
  
  void HotKeyInfo::ToJsonObject(rapidjson::Value &value, rapidjson::Document::AllocatorType& allocator) const
  {
  
      if (m_keyHasBeenSet)
      {
          rapidjson::Value iKey(rapidjson::kStringType);
          string key = "Key";
          iKey.SetString(key.c_str(), allocator);
          value.AddMember(iKey, rapidjson::Value(m_key.c_str(), allocator).Move(), allocator);
      }
  
      if (m_typeHasBeenSet)
      {
          rapidjson::Value iKey(rapidjson::kStringType);
          string key = "Type";
          iKey.SetString(key.c_str(), allocator);
          value.AddMember(iKey, rapidjson::Value(m_type.c_str(), allocator).Move(), allocator);
      }
  
      if (m_countHasBeenSet)
      {
          rapidjson::Value iKey(rapidjson::kStringType);
          string key = "Count";
          iKey.SetString(key.c_str(), allocator);
          value.AddMember(iKey, m_count, allocator);
      }
  
  }
  
  
  string HotKeyInfo::GetKey() const
  {
      return m_key;
  }
  
  void HotKeyInfo::SetKey(const string& _key)
  {
      m_key = _key;
      m_keyHasBeenSet = true;
  }
  
  bool HotKeyInfo::KeyHasBeenSet() const
  {
      return m_keyHasBeenSet;
  }
  
  string HotKeyInfo::GetType() const
  {
      return m_type;
  }
  
  void HotKeyInfo::SetType(const string& _type)
  {
      m_type = _type;
      m_typeHasBeenSet = true;
  }
  
  bool HotKeyInfo::TypeHasBeenSet() const
  {
      return m_typeHasBeenSet;
  }
  
  int64_t HotKeyInfo::GetCount() const
  {
      return m_count;
  }
  
  void HotKeyInfo::SetCount(const int64_t& _count)
  {
      m_count = _count;
      m_countHasBeenSet = true;
  }
  
  bool HotKeyInfo::CountHasBeenSet() const
  {
      return m_countHasBeenSet;
  }
  
  