/**
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0.
 */

#pragma once
#include <aws/codeguruprofiler/CodeGuruProfiler_EXPORTS.h>
#include <aws/codeguruprofiler/model/UserFeedback.h>
#include <aws/core/utils/DateTime.h>
#include <aws/core/utils/memory/stl/AWSString.h>

#include <utility>

namespace Aws {
namespace Utils {
namespace Json {
class JsonValue;
class JsonView;
}  // namespace Json
}  // namespace Utils
namespace CodeGuruProfiler {
namespace Model {

/**
 * <p>The specific duration in which the metric is flagged as
 * anomalous.</p><p><h3>See Also:</h3>   <a
 * href="http://docs.aws.amazon.com/goto/WebAPI/codeguruprofiler-2019-07-18/AnomalyInstance">AWS
 * API Reference</a></p>
 */
class AnomalyInstance {
 public:
  AWS_CODEGURUPROFILER_API AnomalyInstance() = default;
  AWS_CODEGURUPROFILER_API AnomalyInstance(Aws::Utils::Json::JsonView jsonValue);
  AWS_CODEGURUPROFILER_API AnomalyInstance& operator=(Aws::Utils::Json::JsonView jsonValue);
  AWS_CODEGURUPROFILER_API Aws::Utils::Json::JsonValue Jsonize() const;

  ///@{
  /**
   * <p> The end time of the period during which the metric is flagged as anomalous.
   * This is specified using the ISO 8601 format. For example,
   * 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM
   * UTC. </p>
   */
  inline const Aws::Utils::DateTime& GetEndTime() const { return m_endTime; }
  inline bool EndTimeHasBeenSet() const { return m_endTimeHasBeenSet; }
  template <typename EndTimeT = Aws::Utils::DateTime>
  void SetEndTime(EndTimeT&& value) {
    m_endTimeHasBeenSet = true;
    m_endTime = std::forward<EndTimeT>(value);
  }
  template <typename EndTimeT = Aws::Utils::DateTime>
  AnomalyInstance& WithEndTime(EndTimeT&& value) {
    SetEndTime(std::forward<EndTimeT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p> The universally unique identifier (UUID) of an instance of an anomaly in a
   * metric. </p>
   */
  inline const Aws::String& GetId() const { return m_id; }
  inline bool IdHasBeenSet() const { return m_idHasBeenSet; }
  template <typename IdT = Aws::String>
  void SetId(IdT&& value) {
    m_idHasBeenSet = true;
    m_id = std::forward<IdT>(value);
  }
  template <typename IdT = Aws::String>
  AnomalyInstance& WithId(IdT&& value) {
    SetId(std::forward<IdT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p> The start time of the period during which the metric is flagged as
   * anomalous. This is specified using the ISO 8601 format. For example,
   * 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM
   * UTC. </p>
   */
  inline const Aws::Utils::DateTime& GetStartTime() const { return m_startTime; }
  inline bool StartTimeHasBeenSet() const { return m_startTimeHasBeenSet; }
  template <typename StartTimeT = Aws::Utils::DateTime>
  void SetStartTime(StartTimeT&& value) {
    m_startTimeHasBeenSet = true;
    m_startTime = std::forward<StartTimeT>(value);
  }
  template <typename StartTimeT = Aws::Utils::DateTime>
  AnomalyInstance& WithStartTime(StartTimeT&& value) {
    SetStartTime(std::forward<StartTimeT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>Feedback type on a specific instance of anomaly submitted by the user.</p>
   */
  inline const UserFeedback& GetUserFeedback() const { return m_userFeedback; }
  inline bool UserFeedbackHasBeenSet() const { return m_userFeedbackHasBeenSet; }
  template <typename UserFeedbackT = UserFeedback>
  void SetUserFeedback(UserFeedbackT&& value) {
    m_userFeedbackHasBeenSet = true;
    m_userFeedback = std::forward<UserFeedbackT>(value);
  }
  template <typename UserFeedbackT = UserFeedback>
  AnomalyInstance& WithUserFeedback(UserFeedbackT&& value) {
    SetUserFeedback(std::forward<UserFeedbackT>(value));
    return *this;
  }
  ///@}
 private:
  Aws::Utils::DateTime m_endTime{};

  Aws::String m_id;

  Aws::Utils::DateTime m_startTime{};

  UserFeedback m_userFeedback;
  bool m_endTimeHasBeenSet = false;
  bool m_idHasBeenSet = false;
  bool m_startTimeHasBeenSet = false;
  bool m_userFeedbackHasBeenSet = false;
};

}  // namespace Model
}  // namespace CodeGuruProfiler
}  // namespace Aws
