/**
 * 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/core/utils/memory/stl/AWSVector.h>
#include <aws/ec2/EC2_EXPORTS.h>
#include <aws/ec2/model/DomainType.h>
#include <aws/ec2/model/ServiceManaged.h>
#include <aws/ec2/model/Tag.h>

#include <utility>

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

/**
 * <p>Describes an Elastic IP address, or a carrier IP address.</p><p><h3>See
 * Also:</h3>   <a
 * href="http://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/Address">AWS API
 * Reference</a></p>
 */
class Address {
 public:
  AWS_EC2_API Address() = default;
  AWS_EC2_API Address(const Aws::Utils::Xml::XmlNode& xmlNode);
  AWS_EC2_API Address& 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 ID representing the allocation of the address.</p>
   */
  inline const Aws::String& GetAllocationId() const { return m_allocationId; }
  inline bool AllocationIdHasBeenSet() const { return m_allocationIdHasBeenSet; }
  template <typename AllocationIdT = Aws::String>
  void SetAllocationId(AllocationIdT&& value) {
    m_allocationIdHasBeenSet = true;
    m_allocationId = std::forward<AllocationIdT>(value);
  }
  template <typename AllocationIdT = Aws::String>
  Address& WithAllocationId(AllocationIdT&& value) {
    SetAllocationId(std::forward<AllocationIdT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The ID representing the association of the address with an instance.</p>
   */
  inline const Aws::String& GetAssociationId() const { return m_associationId; }
  inline bool AssociationIdHasBeenSet() const { return m_associationIdHasBeenSet; }
  template <typename AssociationIdT = Aws::String>
  void SetAssociationId(AssociationIdT&& value) {
    m_associationIdHasBeenSet = true;
    m_associationId = std::forward<AssociationIdT>(value);
  }
  template <typename AssociationIdT = Aws::String>
  Address& WithAssociationId(AssociationIdT&& value) {
    SetAssociationId(std::forward<AssociationIdT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The network (<code>vpc</code>).</p>
   */
  inline DomainType GetDomain() const { return m_domain; }
  inline bool DomainHasBeenSet() const { return m_domainHasBeenSet; }
  inline void SetDomain(DomainType value) {
    m_domainHasBeenSet = true;
    m_domain = value;
  }
  inline Address& WithDomain(DomainType value) {
    SetDomain(value);
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The ID of the network interface.</p>
   */
  inline const Aws::String& GetNetworkInterfaceId() const { return m_networkInterfaceId; }
  inline bool NetworkInterfaceIdHasBeenSet() const { return m_networkInterfaceIdHasBeenSet; }
  template <typename NetworkInterfaceIdT = Aws::String>
  void SetNetworkInterfaceId(NetworkInterfaceIdT&& value) {
    m_networkInterfaceIdHasBeenSet = true;
    m_networkInterfaceId = std::forward<NetworkInterfaceIdT>(value);
  }
  template <typename NetworkInterfaceIdT = Aws::String>
  Address& WithNetworkInterfaceId(NetworkInterfaceIdT&& value) {
    SetNetworkInterfaceId(std::forward<NetworkInterfaceIdT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The ID of the Amazon Web Services account that owns the network
   * interface.</p>
   */
  inline const Aws::String& GetNetworkInterfaceOwnerId() const { return m_networkInterfaceOwnerId; }
  inline bool NetworkInterfaceOwnerIdHasBeenSet() const { return m_networkInterfaceOwnerIdHasBeenSet; }
  template <typename NetworkInterfaceOwnerIdT = Aws::String>
  void SetNetworkInterfaceOwnerId(NetworkInterfaceOwnerIdT&& value) {
    m_networkInterfaceOwnerIdHasBeenSet = true;
    m_networkInterfaceOwnerId = std::forward<NetworkInterfaceOwnerIdT>(value);
  }
  template <typename NetworkInterfaceOwnerIdT = Aws::String>
  Address& WithNetworkInterfaceOwnerId(NetworkInterfaceOwnerIdT&& value) {
    SetNetworkInterfaceOwnerId(std::forward<NetworkInterfaceOwnerIdT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The private IP address associated with the Elastic IP address.</p>
   */
  inline const Aws::String& GetPrivateIpAddress() const { return m_privateIpAddress; }
  inline bool PrivateIpAddressHasBeenSet() const { return m_privateIpAddressHasBeenSet; }
  template <typename PrivateIpAddressT = Aws::String>
  void SetPrivateIpAddress(PrivateIpAddressT&& value) {
    m_privateIpAddressHasBeenSet = true;
    m_privateIpAddress = std::forward<PrivateIpAddressT>(value);
  }
  template <typename PrivateIpAddressT = Aws::String>
  Address& WithPrivateIpAddress(PrivateIpAddressT&& value) {
    SetPrivateIpAddress(std::forward<PrivateIpAddressT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>Any tags assigned to the Elastic IP address.</p>
   */
  inline const Aws::Vector<Tag>& GetTags() const { return m_tags; }
  inline bool TagsHasBeenSet() const { return m_tagsHasBeenSet; }
  template <typename TagsT = Aws::Vector<Tag>>
  void SetTags(TagsT&& value) {
    m_tagsHasBeenSet = true;
    m_tags = std::forward<TagsT>(value);
  }
  template <typename TagsT = Aws::Vector<Tag>>
  Address& WithTags(TagsT&& value) {
    SetTags(std::forward<TagsT>(value));
    return *this;
  }
  template <typename TagsT = Tag>
  Address& AddTags(TagsT&& value) {
    m_tagsHasBeenSet = true;
    m_tags.emplace_back(std::forward<TagsT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The ID of an address pool.</p>
   */
  inline const Aws::String& GetPublicIpv4Pool() const { return m_publicIpv4Pool; }
  inline bool PublicIpv4PoolHasBeenSet() const { return m_publicIpv4PoolHasBeenSet; }
  template <typename PublicIpv4PoolT = Aws::String>
  void SetPublicIpv4Pool(PublicIpv4PoolT&& value) {
    m_publicIpv4PoolHasBeenSet = true;
    m_publicIpv4Pool = std::forward<PublicIpv4PoolT>(value);
  }
  template <typename PublicIpv4PoolT = Aws::String>
  Address& WithPublicIpv4Pool(PublicIpv4PoolT&& value) {
    SetPublicIpv4Pool(std::forward<PublicIpv4PoolT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The name of the unique set of Availability Zones, Local Zones, or Wavelength
   * Zones from which Amazon Web Services advertises IP addresses.</p>
   */
  inline const Aws::String& GetNetworkBorderGroup() const { return m_networkBorderGroup; }
  inline bool NetworkBorderGroupHasBeenSet() const { return m_networkBorderGroupHasBeenSet; }
  template <typename NetworkBorderGroupT = Aws::String>
  void SetNetworkBorderGroup(NetworkBorderGroupT&& value) {
    m_networkBorderGroupHasBeenSet = true;
    m_networkBorderGroup = std::forward<NetworkBorderGroupT>(value);
  }
  template <typename NetworkBorderGroupT = Aws::String>
  Address& WithNetworkBorderGroup(NetworkBorderGroupT&& value) {
    SetNetworkBorderGroup(std::forward<NetworkBorderGroupT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The customer-owned IP address.</p>
   */
  inline const Aws::String& GetCustomerOwnedIp() const { return m_customerOwnedIp; }
  inline bool CustomerOwnedIpHasBeenSet() const { return m_customerOwnedIpHasBeenSet; }
  template <typename CustomerOwnedIpT = Aws::String>
  void SetCustomerOwnedIp(CustomerOwnedIpT&& value) {
    m_customerOwnedIpHasBeenSet = true;
    m_customerOwnedIp = std::forward<CustomerOwnedIpT>(value);
  }
  template <typename CustomerOwnedIpT = Aws::String>
  Address& WithCustomerOwnedIp(CustomerOwnedIpT&& value) {
    SetCustomerOwnedIp(std::forward<CustomerOwnedIpT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The ID of the customer-owned address pool.</p>
   */
  inline const Aws::String& GetCustomerOwnedIpv4Pool() const { return m_customerOwnedIpv4Pool; }
  inline bool CustomerOwnedIpv4PoolHasBeenSet() const { return m_customerOwnedIpv4PoolHasBeenSet; }
  template <typename CustomerOwnedIpv4PoolT = Aws::String>
  void SetCustomerOwnedIpv4Pool(CustomerOwnedIpv4PoolT&& value) {
    m_customerOwnedIpv4PoolHasBeenSet = true;
    m_customerOwnedIpv4Pool = std::forward<CustomerOwnedIpv4PoolT>(value);
  }
  template <typename CustomerOwnedIpv4PoolT = Aws::String>
  Address& WithCustomerOwnedIpv4Pool(CustomerOwnedIpv4PoolT&& value) {
    SetCustomerOwnedIpv4Pool(std::forward<CustomerOwnedIpv4PoolT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The carrier IP address associated. This option is only available for network
   * interfaces which reside in a subnet in a Wavelength Zone (for example an EC2
   * instance). </p>
   */
  inline const Aws::String& GetCarrierIp() const { return m_carrierIp; }
  inline bool CarrierIpHasBeenSet() const { return m_carrierIpHasBeenSet; }
  template <typename CarrierIpT = Aws::String>
  void SetCarrierIp(CarrierIpT&& value) {
    m_carrierIpHasBeenSet = true;
    m_carrierIp = std::forward<CarrierIpT>(value);
  }
  template <typename CarrierIpT = Aws::String>
  Address& WithCarrierIp(CarrierIpT&& value) {
    SetCarrierIp(std::forward<CarrierIpT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The ID of the subnet where the IP address is allocated.</p>
   */
  inline const Aws::String& GetSubnetId() const { return m_subnetId; }
  inline bool SubnetIdHasBeenSet() const { return m_subnetIdHasBeenSet; }
  template <typename SubnetIdT = Aws::String>
  void SetSubnetId(SubnetIdT&& value) {
    m_subnetIdHasBeenSet = true;
    m_subnetId = std::forward<SubnetIdT>(value);
  }
  template <typename SubnetIdT = Aws::String>
  Address& WithSubnetId(SubnetIdT&& value) {
    SetSubnetId(std::forward<SubnetIdT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The service that manages the elastic IP address.</p>  <p>The only
   * option supported today is <code>alb</code>.</p>
   */
  inline ServiceManaged GetServiceManaged() const { return m_serviceManaged; }
  inline bool ServiceManagedHasBeenSet() const { return m_serviceManagedHasBeenSet; }
  inline void SetServiceManaged(ServiceManaged value) {
    m_serviceManagedHasBeenSet = true;
    m_serviceManaged = value;
  }
  inline Address& WithServiceManaged(ServiceManaged value) {
    SetServiceManaged(value);
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The ID of the instance that the address is associated with (if any).</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>
  Address& WithInstanceId(InstanceIdT&& value) {
    SetInstanceId(std::forward<InstanceIdT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The Elastic IP address.</p>
   */
  inline const Aws::String& GetPublicIp() const { return m_publicIp; }
  inline bool PublicIpHasBeenSet() const { return m_publicIpHasBeenSet; }
  template <typename PublicIpT = Aws::String>
  void SetPublicIp(PublicIpT&& value) {
    m_publicIpHasBeenSet = true;
    m_publicIp = std::forward<PublicIpT>(value);
  }
  template <typename PublicIpT = Aws::String>
  Address& WithPublicIp(PublicIpT&& value) {
    SetPublicIp(std::forward<PublicIpT>(value));
    return *this;
  }
  ///@}
 private:
  Aws::String m_allocationId;

  Aws::String m_associationId;

  DomainType m_domain{DomainType::NOT_SET};

  Aws::String m_networkInterfaceId;

  Aws::String m_networkInterfaceOwnerId;

  Aws::String m_privateIpAddress;

  Aws::Vector<Tag> m_tags;

  Aws::String m_publicIpv4Pool;

  Aws::String m_networkBorderGroup;

  Aws::String m_customerOwnedIp;

  Aws::String m_customerOwnedIpv4Pool;

  Aws::String m_carrierIp;

  Aws::String m_subnetId;

  ServiceManaged m_serviceManaged{ServiceManaged::NOT_SET};

  Aws::String m_instanceId;

  Aws::String m_publicIp;
  bool m_allocationIdHasBeenSet = false;
  bool m_associationIdHasBeenSet = false;
  bool m_domainHasBeenSet = false;
  bool m_networkInterfaceIdHasBeenSet = false;
  bool m_networkInterfaceOwnerIdHasBeenSet = false;
  bool m_privateIpAddressHasBeenSet = false;
  bool m_tagsHasBeenSet = false;
  bool m_publicIpv4PoolHasBeenSet = false;
  bool m_networkBorderGroupHasBeenSet = false;
  bool m_customerOwnedIpHasBeenSet = false;
  bool m_customerOwnedIpv4PoolHasBeenSet = false;
  bool m_carrierIpHasBeenSet = false;
  bool m_subnetIdHasBeenSet = false;
  bool m_serviceManagedHasBeenSet = false;
  bool m_instanceIdHasBeenSet = false;
  bool m_publicIpHasBeenSet = false;
};

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