/**
 * 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/ec2/EC2Request.h>
#include <aws/ec2/EC2_EXPORTS.h>
#include <aws/ec2/model/Affinity.h>
#include <aws/ec2/model/HostTenancy.h>

#include <utility>

namespace Aws {
namespace EC2 {
namespace Model {

/**
 */
class ModifyInstancePlacementRequest : public EC2Request {
 public:
  AWS_EC2_API ModifyInstancePlacementRequest() = 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 "ModifyInstancePlacement"; }

  AWS_EC2_API Aws::String SerializePayload() const override;

 protected:
  AWS_EC2_API void DumpBodyToUrl(Aws::Http::URI& uri) const override;

 public:
  ///@{
  /**
   * <p>The name of the placement group in which to place the instance. For spread
   * placement groups, the instance must have a tenancy of <code>default</code>. For
   * cluster and partition placement groups, the instance must have a tenancy of
   * <code>default</code> or <code>dedicated</code>.</p> <p>To remove an instance
   * from a placement group, specify an empty string ("").</p>
   */
  inline const Aws::String& GetGroupName() const { return m_groupName; }
  inline bool GroupNameHasBeenSet() const { return m_groupNameHasBeenSet; }
  template <typename GroupNameT = Aws::String>
  void SetGroupName(GroupNameT&& value) {
    m_groupNameHasBeenSet = true;
    m_groupName = std::forward<GroupNameT>(value);
  }
  template <typename GroupNameT = Aws::String>
  ModifyInstancePlacementRequest& WithGroupName(GroupNameT&& value) {
    SetGroupName(std::forward<GroupNameT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The number of the partition in which to place the instance. Valid only if the
   * placement group strategy is set to <code>partition</code>.</p>
   */
  inline int GetPartitionNumber() const { return m_partitionNumber; }
  inline bool PartitionNumberHasBeenSet() const { return m_partitionNumberHasBeenSet; }
  inline void SetPartitionNumber(int value) {
    m_partitionNumberHasBeenSet = true;
    m_partitionNumber = value;
  }
  inline ModifyInstancePlacementRequest& WithPartitionNumber(int value) {
    SetPartitionNumber(value);
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The ARN of the host resource group in which to place the instance. The
   * instance must have a tenancy of <code>host</code> to specify this parameter.</p>
   */
  inline const Aws::String& GetHostResourceGroupArn() const { return m_hostResourceGroupArn; }
  inline bool HostResourceGroupArnHasBeenSet() const { return m_hostResourceGroupArnHasBeenSet; }
  template <typename HostResourceGroupArnT = Aws::String>
  void SetHostResourceGroupArn(HostResourceGroupArnT&& value) {
    m_hostResourceGroupArnHasBeenSet = true;
    m_hostResourceGroupArn = std::forward<HostResourceGroupArnT>(value);
  }
  template <typename HostResourceGroupArnT = Aws::String>
  ModifyInstancePlacementRequest& WithHostResourceGroupArn(HostResourceGroupArnT&& value) {
    SetHostResourceGroupArn(std::forward<HostResourceGroupArnT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The Group Id of a placement group. You must specify the Placement Group
   * <b>Group Id</b> to launch an instance in a shared placement group.</p>
   */
  inline const Aws::String& GetGroupId() const { return m_groupId; }
  inline bool GroupIdHasBeenSet() const { return m_groupIdHasBeenSet; }
  template <typename GroupIdT = Aws::String>
  void SetGroupId(GroupIdT&& value) {
    m_groupIdHasBeenSet = true;
    m_groupId = std::forward<GroupIdT>(value);
  }
  template <typename GroupIdT = Aws::String>
  ModifyInstancePlacementRequest& WithGroupId(GroupIdT&& value) {
    SetGroupId(std::forward<GroupIdT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The ID of the instance that you are modifying.</p>
   */
  inline const Aws::String& GetInstanceId() const { return m_instanceId; }
  inline bool InstanceIdHasBeenSet() const { return m_instanceIdHasBeenSet; }
  template <typename InstanceIdT = Aws::String>
  void SetInstanceId(InstanceIdT&& value) {
    m_instanceIdHasBeenSet = true;
    m_instanceId = std::forward<InstanceIdT>(value);
  }
  template <typename InstanceIdT = Aws::String>
  ModifyInstancePlacementRequest& WithInstanceId(InstanceIdT&& value) {
    SetInstanceId(std::forward<InstanceIdT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The tenancy for the instance.</p>  <p>For T3 instances, you must launch
   * the instance on a Dedicated Host to use a tenancy of <code>host</code>. You
   * can't change the tenancy from <code>host</code> to <code>dedicated</code> or
   * <code>default</code>. Attempting to make one of these unsupported tenancy
   * changes results in an <code>InvalidRequest</code> error code.</p>
   */
  inline HostTenancy GetTenancy() const { return m_tenancy; }
  inline bool TenancyHasBeenSet() const { return m_tenancyHasBeenSet; }
  inline void SetTenancy(HostTenancy value) {
    m_tenancyHasBeenSet = true;
    m_tenancy = value;
  }
  inline ModifyInstancePlacementRequest& WithTenancy(HostTenancy value) {
    SetTenancy(value);
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The affinity setting for the instance. For more information, see <a
   * href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#dedicated-hosts-affinity">Host
   * affinity</a> in the <i>Amazon EC2 User Guide</i>.</p>
   */
  inline Affinity GetAffinity() const { return m_affinity; }
  inline bool AffinityHasBeenSet() const { return m_affinityHasBeenSet; }
  inline void SetAffinity(Affinity value) {
    m_affinityHasBeenSet = true;
    m_affinity = value;
  }
  inline ModifyInstancePlacementRequest& WithAffinity(Affinity value) {
    SetAffinity(value);
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The ID of the Dedicated Host with which to associate the instance.</p>
   */
  inline const Aws::String& GetHostId() const { return m_hostId; }
  inline bool HostIdHasBeenSet() const { return m_hostIdHasBeenSet; }
  template <typename HostIdT = Aws::String>
  void SetHostId(HostIdT&& value) {
    m_hostIdHasBeenSet = true;
    m_hostId = std::forward<HostIdT>(value);
  }
  template <typename HostIdT = Aws::String>
  ModifyInstancePlacementRequest& WithHostId(HostIdT&& value) {
    SetHostId(std::forward<HostIdT>(value));
    return *this;
  }
  ///@}
 private:
  Aws::String m_groupName;

  int m_partitionNumber{0};

  Aws::String m_hostResourceGroupArn;

  Aws::String m_groupId;

  Aws::String m_instanceId;

  HostTenancy m_tenancy{HostTenancy::NOT_SET};

  Affinity m_affinity{Affinity::NOT_SET};

  Aws::String m_hostId;
  bool m_groupNameHasBeenSet = false;
  bool m_partitionNumberHasBeenSet = false;
  bool m_hostResourceGroupArnHasBeenSet = false;
  bool m_groupIdHasBeenSet = false;
  bool m_instanceIdHasBeenSet = false;
  bool m_tenancyHasBeenSet = false;
  bool m_affinityHasBeenSet = false;
  bool m_hostIdHasBeenSet = false;
};

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