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

#pragma once
#include <aws/core/utils/Array.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/kms/KMSRequest.h>
#include <aws/kms/KMS_EXPORTS.h>
#include <aws/kms/model/MacAlgorithmSpec.h>

#include <utility>

namespace Aws {
namespace KMS {
namespace Model {

/**
 */
class VerifyMacRequest : public KMSRequest {
 public:
  AWS_KMS_API VerifyMacRequest() = default;

  // Service request name is the Operation name which will send this request out,
  // each operation should has unique request name, so that we can get operation's name from this request.
  // Note: this is not true for response, multiple operations may have the same response name,
  // so we can not get operation's name from response.
  inline virtual const char* GetServiceRequestName() const override { return "VerifyMac"; }

  AWS_KMS_API Aws::String SerializePayload() const override;

  AWS_KMS_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;

  ///@{
  /**
   * <p>The message that will be used in the verification. Enter the same message
   * that was used to generate the HMAC.</p> <p> <a>GenerateMac</a> and
   * <code>VerifyMac</code> do not provide special handling for message digests. If
   * you generated an HMAC for a hash digest of a message, you must verify the HMAC
   * for the same hash digest.</p>
   */
  inline const Aws::Utils::CryptoBuffer& GetMessage() const { return m_message; }
  inline bool MessageHasBeenSet() const { return m_messageHasBeenSet; }
  template <typename MessageT = Aws::Utils::CryptoBuffer>
  void SetMessage(MessageT&& value) {
    m_messageHasBeenSet = true;
    m_message = std::forward<MessageT>(value);
  }
  template <typename MessageT = Aws::Utils::CryptoBuffer>
  VerifyMacRequest& WithMessage(MessageT&& value) {
    SetMessage(std::forward<MessageT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The KMS key that will be used in the verification.</p> <p>Enter a key ID of
   * the KMS key that was used to generate the HMAC. If you identify a different KMS
   * key, the <code>VerifyMac</code> operation fails.</p>
   */
  inline const Aws::String& GetKeyId() const { return m_keyId; }
  inline bool KeyIdHasBeenSet() const { return m_keyIdHasBeenSet; }
  template <typename KeyIdT = Aws::String>
  void SetKeyId(KeyIdT&& value) {
    m_keyIdHasBeenSet = true;
    m_keyId = std::forward<KeyIdT>(value);
  }
  template <typename KeyIdT = Aws::String>
  VerifyMacRequest& WithKeyId(KeyIdT&& value) {
    SetKeyId(std::forward<KeyIdT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The MAC algorithm that will be used in the verification. Enter the same MAC
   * algorithm that was used to compute the HMAC. This algorithm must be supported by
   * the HMAC KMS key identified by the <code>KeyId</code> parameter.</p>
   */
  inline MacAlgorithmSpec GetMacAlgorithm() const { return m_macAlgorithm; }
  inline bool MacAlgorithmHasBeenSet() const { return m_macAlgorithmHasBeenSet; }
  inline void SetMacAlgorithm(MacAlgorithmSpec value) {
    m_macAlgorithmHasBeenSet = true;
    m_macAlgorithm = value;
  }
  inline VerifyMacRequest& WithMacAlgorithm(MacAlgorithmSpec value) {
    SetMacAlgorithm(value);
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The HMAC to verify. Enter the HMAC that was generated by the
   * <a>GenerateMac</a> operation when you specified the same message, HMAC KMS key,
   * and MAC algorithm as the values specified in this request.</p>
   */
  inline const Aws::Utils::ByteBuffer& GetMac() const { return m_mac; }
  inline bool MacHasBeenSet() const { return m_macHasBeenSet; }
  template <typename MacT = Aws::Utils::ByteBuffer>
  void SetMac(MacT&& value) {
    m_macHasBeenSet = true;
    m_mac = std::forward<MacT>(value);
  }
  template <typename MacT = Aws::Utils::ByteBuffer>
  VerifyMacRequest& WithMac(MacT&& value) {
    SetMac(std::forward<MacT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>A list of grant tokens.</p> <p>Use a grant token when your permission to call
   * this operation comes from a new grant that has not yet achieved <i>eventual
   * consistency</i>. For more information, see <a
   * href="https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#grant_token">Grant
   * token</a> and <a
   * href="https://docs.aws.amazon.com/kms/latest/developerguide/using-grant-token.html">Using
   * a grant token</a> in the <i>Key Management Service Developer Guide</i>.</p>
   */
  inline const Aws::Vector<Aws::String>& GetGrantTokens() const { return m_grantTokens; }
  inline bool GrantTokensHasBeenSet() const { return m_grantTokensHasBeenSet; }
  template <typename GrantTokensT = Aws::Vector<Aws::String>>
  void SetGrantTokens(GrantTokensT&& value) {
    m_grantTokensHasBeenSet = true;
    m_grantTokens = std::forward<GrantTokensT>(value);
  }
  template <typename GrantTokensT = Aws::Vector<Aws::String>>
  VerifyMacRequest& WithGrantTokens(GrantTokensT&& value) {
    SetGrantTokens(std::forward<GrantTokensT>(value));
    return *this;
  }
  template <typename GrantTokensT = Aws::String>
  VerifyMacRequest& AddGrantTokens(GrantTokensT&& value) {
    m_grantTokensHasBeenSet = true;
    m_grantTokens.emplace_back(std::forward<GrantTokensT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>Checks if your request will succeed. <code>DryRun</code> is an optional
   * parameter. </p> <p>To learn more about how to use this parameter, see <a
   * href="https://docs.aws.amazon.com/kms/latest/developerguide/testing-permissions.html">Testing
   * your permissions</a> in the <i>Key Management Service Developer Guide</i>.</p>
   */
  inline bool GetDryRun() const { return m_dryRun; }
  inline bool DryRunHasBeenSet() const { return m_dryRunHasBeenSet; }
  inline void SetDryRun(bool value) {
    m_dryRunHasBeenSet = true;
    m_dryRun = value;
  }
  inline VerifyMacRequest& WithDryRun(bool value) {
    SetDryRun(value);
    return *this;
  }
  ///@}
 private:
  Aws::Utils::CryptoBuffer m_message{};

  Aws::String m_keyId;

  MacAlgorithmSpec m_macAlgorithm{MacAlgorithmSpec::NOT_SET};

  Aws::Utils::ByteBuffer m_mac{};

  Aws::Vector<Aws::String> m_grantTokens;

  bool m_dryRun{false};
  bool m_messageHasBeenSet = false;
  bool m_keyIdHasBeenSet = false;
  bool m_macAlgorithmHasBeenSet = false;
  bool m_macHasBeenSet = false;
  bool m_grantTokensHasBeenSet = false;
  bool m_dryRunHasBeenSet = false;
};

}  // namespace Model
}  // namespace KMS
}  // namespace Aws
