/**
 * 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/ec2/EC2_EXPORTS.h>
#include <aws/ec2/model/AmdSevSnpSpecification.h>
#include <aws/ec2/model/NestedVirtualizationSpecification.h>

#include <utility>

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

/**
 * <p>The CPU options for the instance.</p><p><h3>See Also:</h3>   <a
 * href="http://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CpuOptions">AWS API
 * Reference</a></p>
 */
class CpuOptions {
 public:
  AWS_EC2_API CpuOptions() = default;
  AWS_EC2_API CpuOptions(const Aws::Utils::Xml::XmlNode& xmlNode);
  AWS_EC2_API CpuOptions& 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 number of CPU cores for the instance.</p>
   */
  inline int GetCoreCount() const { return m_coreCount; }
  inline bool CoreCountHasBeenSet() const { return m_coreCountHasBeenSet; }
  inline void SetCoreCount(int value) {
    m_coreCountHasBeenSet = true;
    m_coreCount = value;
  }
  inline CpuOptions& WithCoreCount(int value) {
    SetCoreCount(value);
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The number of threads per CPU core.</p>
   */
  inline int GetThreadsPerCore() const { return m_threadsPerCore; }
  inline bool ThreadsPerCoreHasBeenSet() const { return m_threadsPerCoreHasBeenSet; }
  inline void SetThreadsPerCore(int value) {
    m_threadsPerCoreHasBeenSet = true;
    m_threadsPerCore = value;
  }
  inline CpuOptions& WithThreadsPerCore(int value) {
    SetThreadsPerCore(value);
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>Indicates whether the instance is enabled for AMD SEV-SNP. For more
   * information, see <a
   * href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sev-snp.html">AMD
   * SEV-SNP</a>.</p>
   */
  inline AmdSevSnpSpecification GetAmdSevSnp() const { return m_amdSevSnp; }
  inline bool AmdSevSnpHasBeenSet() const { return m_amdSevSnpHasBeenSet; }
  inline void SetAmdSevSnp(AmdSevSnpSpecification value) {
    m_amdSevSnpHasBeenSet = true;
    m_amdSevSnp = value;
  }
  inline CpuOptions& WithAmdSevSnp(AmdSevSnpSpecification value) {
    SetAmdSevSnp(value);
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>Indicates whether the instance is enabled for nested virtualization.</p>
   */
  inline NestedVirtualizationSpecification GetNestedVirtualization() const { return m_nestedVirtualization; }
  inline bool NestedVirtualizationHasBeenSet() const { return m_nestedVirtualizationHasBeenSet; }
  inline void SetNestedVirtualization(NestedVirtualizationSpecification value) {
    m_nestedVirtualizationHasBeenSet = true;
    m_nestedVirtualization = value;
  }
  inline CpuOptions& WithNestedVirtualization(NestedVirtualizationSpecification value) {
    SetNestedVirtualization(value);
    return *this;
  }
  ///@}
 private:
  int m_coreCount{0};

  int m_threadsPerCore{0};

  AmdSevSnpSpecification m_amdSevSnp{AmdSevSnpSpecification::NOT_SET};

  NestedVirtualizationSpecification m_nestedVirtualization{NestedVirtualizationSpecification::NOT_SET};
  bool m_coreCountHasBeenSet = false;
  bool m_threadsPerCoreHasBeenSet = false;
  bool m_amdSevSnpHasBeenSet = false;
  bool m_nestedVirtualizationHasBeenSet = false;
};

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