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

#pragma once
#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/ec2/EC2_EXPORTS.h>
#include <aws/ec2/model/DatafeedSubscriptionState.h>
#include <aws/ec2/model/SpotInstanceStateFault.h>

#include <utility>

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

/**
 * <p>Describes the data feed for a Spot Instance.</p><p><h3>See Also:</h3>   <a
 * href="http://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SpotDatafeedSubscription">AWS
 * API Reference</a></p>
 */
class SpotDatafeedSubscription {
 public:
  AWS_EC2_API SpotDatafeedSubscription() = default;
  AWS_EC2_API SpotDatafeedSubscription(const Aws::Utils::Xml::XmlNode& xmlNode);
  AWS_EC2_API SpotDatafeedSubscription& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);

  AWS_EC2_API void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
  AWS_EC2_API void OutputToStream(Aws::OStream& oStream, const char* location) const;

  ///@{
  /**
   * <p>The name of the Amazon S3 bucket where the Spot Instance data feed is
   * located.</p>
   */
  inline const Aws::String& GetBucket() const { return m_bucket; }
  inline bool BucketHasBeenSet() const { return m_bucketHasBeenSet; }
  template <typename BucketT = Aws::String>
  void SetBucket(BucketT&& value) {
    m_bucketHasBeenSet = true;
    m_bucket = std::forward<BucketT>(value);
  }
  template <typename BucketT = Aws::String>
  SpotDatafeedSubscription& WithBucket(BucketT&& value) {
    SetBucket(std::forward<BucketT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The fault codes for the Spot Instance request, if any.</p>
   */
  inline const SpotInstanceStateFault& GetFault() const { return m_fault; }
  inline bool FaultHasBeenSet() const { return m_faultHasBeenSet; }
  template <typename FaultT = SpotInstanceStateFault>
  void SetFault(FaultT&& value) {
    m_faultHasBeenSet = true;
    m_fault = std::forward<FaultT>(value);
  }
  template <typename FaultT = SpotInstanceStateFault>
  SpotDatafeedSubscription& WithFault(FaultT&& value) {
    SetFault(std::forward<FaultT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The Amazon Web Services account ID of the account.</p>
   */
  inline const Aws::String& GetOwnerId() const { return m_ownerId; }
  inline bool OwnerIdHasBeenSet() const { return m_ownerIdHasBeenSet; }
  template <typename OwnerIdT = Aws::String>
  void SetOwnerId(OwnerIdT&& value) {
    m_ownerIdHasBeenSet = true;
    m_ownerId = std::forward<OwnerIdT>(value);
  }
  template <typename OwnerIdT = Aws::String>
  SpotDatafeedSubscription& WithOwnerId(OwnerIdT&& value) {
    SetOwnerId(std::forward<OwnerIdT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The prefix for the data feed files.</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>
  SpotDatafeedSubscription& WithPrefix(PrefixT&& value) {
    SetPrefix(std::forward<PrefixT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The state of the Spot Instance data feed subscription.</p>
   */
  inline DatafeedSubscriptionState GetState() const { return m_state; }
  inline bool StateHasBeenSet() const { return m_stateHasBeenSet; }
  inline void SetState(DatafeedSubscriptionState value) {
    m_stateHasBeenSet = true;
    m_state = value;
  }
  inline SpotDatafeedSubscription& WithState(DatafeedSubscriptionState value) {
    SetState(value);
    return *this;
  }
  ///@}
 private:
  Aws::String m_bucket;

  SpotInstanceStateFault m_fault;

  Aws::String m_ownerId;

  Aws::String m_prefix;

  DatafeedSubscriptionState m_state{DatafeedSubscriptionState::NOT_SET};
  bool m_bucketHasBeenSet = false;
  bool m_faultHasBeenSet = false;
  bool m_ownerIdHasBeenSet = false;
  bool m_prefixHasBeenSet = false;
  bool m_stateHasBeenSet = false;
};

}  // namespace Model
}  // namespace EC2
}  // namespace Aws
