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/vod/v20180717/model/AiRecognitionTaskAsrWordsSegmentItem.h>
  
  using TencentCloud::CoreInternalOutcome;
  using namespace TencentCloud::Vod::V20180717::Model;
  using namespace rapidjson;
  using namespace std;
  
  AiRecognitionTaskAsrWordsSegmentItem::AiRecognitionTaskAsrWordsSegmentItem() :
      m_startTimeOffsetHasBeenSet(false),
      m_endTimeOffsetHasBeenSet(false),
      m_confidenceHasBeenSet(false)
  {
  }
  
  CoreInternalOutcome AiRecognitionTaskAsrWordsSegmentItem::Deserialize(const Value &value)
  {
      string requestId = "";
  
  
      if (value.HasMember("StartTimeOffset") && !value["StartTimeOffset"].IsNull())
      {
          if (!value["StartTimeOffset"].IsDouble())
          {
              return CoreInternalOutcome(Error("response `AiRecognitionTaskAsrWordsSegmentItem.StartTimeOffset` IsDouble=false incorrectly").SetRequestId(requestId));
          }
          m_startTimeOffset = value["StartTimeOffset"].GetDouble();
          m_startTimeOffsetHasBeenSet = true;
      }
  
      if (value.HasMember("EndTimeOffset") && !value["EndTimeOffset"].IsNull())
      {
          if (!value["EndTimeOffset"].IsDouble())
          {
              return CoreInternalOutcome(Error("response `AiRecognitionTaskAsrWordsSegmentItem.EndTimeOffset` IsDouble=false incorrectly").SetRequestId(requestId));
          }
          m_endTimeOffset = value["EndTimeOffset"].GetDouble();
          m_endTimeOffsetHasBeenSet = true;
      }
  
      if (value.HasMember("Confidence") && !value["Confidence"].IsNull())
      {
          if (!value["Confidence"].IsDouble())
          {
              return CoreInternalOutcome(Error("response `AiRecognitionTaskAsrWordsSegmentItem.Confidence` IsDouble=false incorrectly").SetRequestId(requestId));
          }
          m_confidence = value["Confidence"].GetDouble();
          m_confidenceHasBeenSet = true;
      }
  
  
      return CoreInternalOutcome(true);
  }
  
  void AiRecognitionTaskAsrWordsSegmentItem::ToJsonObject(Value &value, Document::AllocatorType& allocator) const
  {
  
      if (m_startTimeOffsetHasBeenSet)
      {
          Value iKey(kStringType);
          string key = "StartTimeOffset";
          iKey.SetString(key.c_str(), allocator);
          value.AddMember(iKey, m_startTimeOffset, allocator);
      }
  
      if (m_endTimeOffsetHasBeenSet)
      {
          Value iKey(kStringType);
          string key = "EndTimeOffset";
          iKey.SetString(key.c_str(), allocator);
          value.AddMember(iKey, m_endTimeOffset, allocator);
      }
  
      if (m_confidenceHasBeenSet)
      {
          Value iKey(kStringType);
          string key = "Confidence";
          iKey.SetString(key.c_str(), allocator);
          value.AddMember(iKey, m_confidence, allocator);
      }
  
  }
  
  
  double AiRecognitionTaskAsrWordsSegmentItem::GetStartTimeOffset() const
  {
      return m_startTimeOffset;
  }
  
  void AiRecognitionTaskAsrWordsSegmentItem::SetStartTimeOffset(const double& _startTimeOffset)
  {
      m_startTimeOffset = _startTimeOffset;
      m_startTimeOffsetHasBeenSet = true;
  }
  
  bool AiRecognitionTaskAsrWordsSegmentItem::StartTimeOffsetHasBeenSet() const
  {
      return m_startTimeOffsetHasBeenSet;
  }
  
  double AiRecognitionTaskAsrWordsSegmentItem::GetEndTimeOffset() const
  {
      return m_endTimeOffset;
  }
  
  void AiRecognitionTaskAsrWordsSegmentItem::SetEndTimeOffset(const double& _endTimeOffset)
  {
      m_endTimeOffset = _endTimeOffset;
      m_endTimeOffsetHasBeenSet = true;
  }
  
  bool AiRecognitionTaskAsrWordsSegmentItem::EndTimeOffsetHasBeenSet() const
  {
      return m_endTimeOffsetHasBeenSet;
  }
  
  double AiRecognitionTaskAsrWordsSegmentItem::GetConfidence() const
  {
      return m_confidence;
  }
  
  void AiRecognitionTaskAsrWordsSegmentItem::SetConfidence(const double& _confidence)
  {
      m_confidence = _confidence;
      m_confidenceHasBeenSet = true;
  }
  
  bool AiRecognitionTaskAsrWordsSegmentItem::ConfidenceHasBeenSet() const
  {
      return m_confidenceHasBeenSet;
  }
  
  