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

#pragma once
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/logs/CloudWatchLogs_EXPORTS.h>

#include <utility>

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

/**
 * <p>The fields contained in log events found by a <code>GetLogGroupFields</code>
 * operation, along with the percentage of queried log events in which each field
 * appears.</p><p><h3>See Also:</h3>   <a
 * href="http://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/LogGroupField">AWS
 * API Reference</a></p>
 */
class LogGroupField {
 public:
  AWS_CLOUDWATCHLOGS_API LogGroupField() = default;
  AWS_CLOUDWATCHLOGS_API LogGroupField(Aws::Utils::Json::JsonView jsonValue);
  AWS_CLOUDWATCHLOGS_API LogGroupField& operator=(Aws::Utils::Json::JsonView jsonValue);
  AWS_CLOUDWATCHLOGS_API Aws::Utils::Json::JsonValue Jsonize() const;

  ///@{
  /**
   * <p>The name of a log field.</p>
   */
  inline const Aws::String& GetName() const { return m_name; }
  inline bool NameHasBeenSet() const { return m_nameHasBeenSet; }
  template <typename NameT = Aws::String>
  void SetName(NameT&& value) {
    m_nameHasBeenSet = true;
    m_name = std::forward<NameT>(value);
  }
  template <typename NameT = Aws::String>
  LogGroupField& WithName(NameT&& value) {
    SetName(std::forward<NameT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The percentage of log events queried that contained the field.</p>
   */
  inline int GetPercent() const { return m_percent; }
  inline bool PercentHasBeenSet() const { return m_percentHasBeenSet; }
  inline void SetPercent(int value) {
    m_percentHasBeenSet = true;
    m_percent = value;
  }
  inline LogGroupField& WithPercent(int value) {
    SetPercent(value);
    return *this;
  }
  ///@}
 private:
  Aws::String m_name;

  int m_percent{0};
  bool m_nameHasBeenSet = false;
  bool m_percentHasBeenSet = false;
};

}  // namespace Model
}  // namespace CloudWatchLogs
}  // namespace Aws
