/**
 * 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/s3/S3_EXPORTS.h>
#include <aws/s3/model/AnalyticsAndOperator.h>
#include <aws/s3/model/Tag.h>

#include <utility>

namespace Aws {
namespace Utils {
namespace Xml {
class XmlNode;
}  // namespace Xml
}  // namespace Utils
namespace S3 {
namespace Model {

/**
 * <p>The filter used to describe a set of objects for analyses. A filter must have
 * exactly one prefix, one tag, or one conjunction (AnalyticsAndOperator). If no
 * filter is provided, all objects will be considered in any
 * analysis.</p><p><h3>See Also:</h3>   <a
 * href="http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AnalyticsFilter">AWS
 * API Reference</a></p>
 */
class AnalyticsFilter {
 public:
  AWS_S3_API AnalyticsFilter() = default;
  AWS_S3_API AnalyticsFilter(const Aws::Utils::Xml::XmlNode& xmlNode);
  AWS_S3_API AnalyticsFilter& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);

  AWS_S3_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const;

  ///@{
  /**
   * <p>The prefix to use when evaluating an analytics filter.</p>
   */
  inline const Aws::String& GetPrefix() const { return m_prefix; }
  inline bool PrefixHasBeenSet() const { return m_prefixHasBeenSet; }
  template <typename PrefixT = Aws::String>
  void SetPrefix(PrefixT&& value) {
    m_prefixHasBeenSet = true;
    m_prefix = std::forward<PrefixT>(value);
  }
  template <typename PrefixT = Aws::String>
  AnalyticsFilter& WithPrefix(PrefixT&& value) {
    SetPrefix(std::forward<PrefixT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The tag to use when evaluating an analytics filter.</p>
   */
  inline const Tag& GetTag() const { return m_tag; }
  inline bool TagHasBeenSet() const { return m_tagHasBeenSet; }
  template <typename TagT = Tag>
  void SetTag(TagT&& value) {
    m_tagHasBeenSet = true;
    m_tag = std::forward<TagT>(value);
  }
  template <typename TagT = Tag>
  AnalyticsFilter& WithTag(TagT&& value) {
    SetTag(std::forward<TagT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>A conjunction (logical AND) of predicates, which is used in evaluating an
   * analytics filter. The operator must have at least two predicates.</p>
   */
  inline const AnalyticsAndOperator& GetAnd() const { return m_and; }
  inline bool AndHasBeenSet() const { return m_andHasBeenSet; }
  template <typename AndT = AnalyticsAndOperator>
  void SetAnd(AndT&& value) {
    m_andHasBeenSet = true;
    m_and = std::forward<AndT>(value);
  }
  template <typename AndT = AnalyticsAndOperator>
  AnalyticsFilter& WithAnd(AndT&& value) {
    SetAnd(std::forward<AndT>(value));
    return *this;
  }
  ///@}
 private:
  Aws::String m_prefix;

  Tag m_tag;

  AnalyticsAndOperator m_and;
  bool m_prefixHasBeenSet = false;
  bool m_tagHasBeenSet = false;
  bool m_andHasBeenSet = false;
};

}  // namespace Model
}  // namespace S3
}  // namespace Aws
