﻿/**
 * 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/sns/SNS_EXPORTS.h>

#include <utility>

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

/**
 * <p>Gives a detailed description of failed messages in the batch.</p><p><h3>See
 * Also:</h3>   <a
 * href="http://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/BatchResultErrorEntry">AWS
 * API Reference</a></p>
 */
class BatchResultErrorEntry {
 public:
  AWS_SNS_API BatchResultErrorEntry() = default;
  AWS_SNS_API BatchResultErrorEntry(const Aws::Utils::Xml::XmlNode& xmlNode);
  AWS_SNS_API BatchResultErrorEntry& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);

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

  ///@{
  /**
   * <p>The <code>Id</code> of an entry in a batch request</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>
  BatchResultErrorEntry& WithId(IdT&& value) {
    SetId(std::forward<IdT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>An error code representing why the action failed on this entry.</p>
   */
  inline const Aws::String& GetCode() const { return m_code; }
  inline bool CodeHasBeenSet() const { return m_codeHasBeenSet; }
  template <typename CodeT = Aws::String>
  void SetCode(CodeT&& value) {
    m_codeHasBeenSet = true;
    m_code = std::forward<CodeT>(value);
  }
  template <typename CodeT = Aws::String>
  BatchResultErrorEntry& WithCode(CodeT&& value) {
    SetCode(std::forward<CodeT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>A message explaining why the action failed on this entry.</p>
   */
  inline const Aws::String& GetMessage() const { return m_message; }
  inline bool MessageHasBeenSet() const { return m_messageHasBeenSet; }
  template <typename MessageT = Aws::String>
  void SetMessage(MessageT&& value) {
    m_messageHasBeenSet = true;
    m_message = std::forward<MessageT>(value);
  }
  template <typename MessageT = Aws::String>
  BatchResultErrorEntry& WithMessage(MessageT&& value) {
    SetMessage(std::forward<MessageT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>Specifies whether the error happened due to the caller of the batch API
   * action.</p>
   */
  inline bool GetSenderFault() const { return m_senderFault; }
  inline bool SenderFaultHasBeenSet() const { return m_senderFaultHasBeenSet; }
  inline void SetSenderFault(bool value) {
    m_senderFaultHasBeenSet = true;
    m_senderFault = value;
  }
  inline BatchResultErrorEntry& WithSenderFault(bool value) {
    SetSenderFault(value);
    return *this;
  }
  ///@}
 private:
  Aws::String m_id;

  Aws::String m_code;

  Aws::String m_message;

  bool m_senderFault{false};
  bool m_idHasBeenSet = false;
  bool m_codeHasBeenSet = false;
  bool m_messageHasBeenSet = false;
  bool m_senderFaultHasBeenSet = false;
};

}  // namespace Model
}  // namespace SNS
}  // namespace Aws
