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/trtc/v20190722/model/QualityData.h>
  
  using TencentCloud::CoreInternalOutcome;
  using namespace TencentCloud::Trtc::V20190722::Model;
  using namespace rapidjson;
  using namespace std;
  
  QualityData::QualityData() :
      m_contentHasBeenSet(false),
      m_userIdHasBeenSet(false),
      m_peerIdHasBeenSet(false),
      m_dataTypeHasBeenSet(false)
  {
  }
  
  CoreInternalOutcome QualityData::Deserialize(const Value &value)
  {
      string requestId = "";
  
  
      if (value.HasMember("Content") && !value["Content"].IsNull())
      {
          if (!value["Content"].IsArray())
              return CoreInternalOutcome(Error("response `QualityData.Content` is not array type"));
  
          const Value &tmpValue = value["Content"];
          for (Value::ConstValueIterator itr = tmpValue.Begin(); itr != tmpValue.End(); ++itr)
          {
              TimeValue item;
              CoreInternalOutcome outcome = item.Deserialize(*itr);
              if (!outcome.IsSuccess())
              {
                  outcome.GetError().SetRequestId(requestId);
                  return outcome;
              }
              m_content.push_back(item);
          }
          m_contentHasBeenSet = true;
      }
  
      if (value.HasMember("UserId") && !value["UserId"].IsNull())
      {
          if (!value["UserId"].IsString())
          {
              return CoreInternalOutcome(Error("response `QualityData.UserId` IsString=false incorrectly").SetRequestId(requestId));
          }
          m_userId = string(value["UserId"].GetString());
          m_userIdHasBeenSet = true;
      }
  
      if (value.HasMember("PeerId") && !value["PeerId"].IsNull())
      {
          if (!value["PeerId"].IsString())
          {
              return CoreInternalOutcome(Error("response `QualityData.PeerId` IsString=false incorrectly").SetRequestId(requestId));
          }
          m_peerId = string(value["PeerId"].GetString());
          m_peerIdHasBeenSet = true;
      }
  
      if (value.HasMember("DataType") && !value["DataType"].IsNull())
      {
          if (!value["DataType"].IsString())
          {
              return CoreInternalOutcome(Error("response `QualityData.DataType` IsString=false incorrectly").SetRequestId(requestId));
          }
          m_dataType = string(value["DataType"].GetString());
          m_dataTypeHasBeenSet = true;
      }
  
  
      return CoreInternalOutcome(true);
  }
  
  void QualityData::ToJsonObject(Value &value, Document::AllocatorType& allocator) const
  {
  
      if (m_contentHasBeenSet)
      {
          Value iKey(kStringType);
          string key = "Content";
          iKey.SetString(key.c_str(), allocator);
          value.AddMember(iKey, Value(kArrayType).Move(), allocator);
  
          int i=0;
          for (auto itr = m_content.begin(); itr != m_content.end(); ++itr, ++i)
          {
              value[key.c_str()].PushBack(Value(kObjectType).Move(), allocator);
              (*itr).ToJsonObject(value[key.c_str()][i], allocator);
          }
      }
  
      if (m_userIdHasBeenSet)
      {
          Value iKey(kStringType);
          string key = "UserId";
          iKey.SetString(key.c_str(), allocator);
          value.AddMember(iKey, Value(m_userId.c_str(), allocator).Move(), allocator);
      }
  
      if (m_peerIdHasBeenSet)
      {
          Value iKey(kStringType);
          string key = "PeerId";
          iKey.SetString(key.c_str(), allocator);
          value.AddMember(iKey, Value(m_peerId.c_str(), allocator).Move(), allocator);
      }
  
      if (m_dataTypeHasBeenSet)
      {
          Value iKey(kStringType);
          string key = "DataType";
          iKey.SetString(key.c_str(), allocator);
          value.AddMember(iKey, Value(m_dataType.c_str(), allocator).Move(), allocator);
      }
  
  }
  
  
  vector<TimeValue> QualityData::GetContent() const
  {
      return m_content;
  }
  
  void QualityData::SetContent(const vector<TimeValue>& _content)
  {
      m_content = _content;
      m_contentHasBeenSet = true;
  }
  
  bool QualityData::ContentHasBeenSet() const
  {
      return m_contentHasBeenSet;
  }
  
  string QualityData::GetUserId() const
  {
      return m_userId;
  }
  
  void QualityData::SetUserId(const string& _userId)
  {
      m_userId = _userId;
      m_userIdHasBeenSet = true;
  }
  
  bool QualityData::UserIdHasBeenSet() const
  {
      return m_userIdHasBeenSet;
  }
  
  string QualityData::GetPeerId() const
  {
      return m_peerId;
  }
  
  void QualityData::SetPeerId(const string& _peerId)
  {
      m_peerId = _peerId;
      m_peerIdHasBeenSet = true;
  }
  
  bool QualityData::PeerIdHasBeenSet() const
  {
      return m_peerIdHasBeenSet;
  }
  
  string QualityData::GetDataType() const
  {
      return m_dataType;
  }
  
  void QualityData::SetDataType(const string& _dataType)
  {
      m_dataType = _dataType;
      m_dataTypeHasBeenSet = true;
  }
  
  bool QualityData::DataTypeHasBeenSet() const
  {
      return m_dataTypeHasBeenSet;
  }
  
  