/**
 * 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/s3control/S3Control_EXPORTS.h>
#include <aws/s3control/model/NetworkOrigin.h>
#include <aws/s3control/model/VpcConfiguration.h>

#include <utility>

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

/**
 * <p>An access point used to access a bucket.</p><p><h3>See Also:</h3>   <a
 * href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/AccessPoint">AWS
 * API Reference</a></p>
 */
class AccessPoint {
 public:
  AWS_S3CONTROL_API AccessPoint() = default;
  AWS_S3CONTROL_API AccessPoint(const Aws::Utils::Xml::XmlNode& xmlNode);
  AWS_S3CONTROL_API AccessPoint& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);

  AWS_S3CONTROL_API void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const;

  ///@{
  /**
   * <p>The name of this access point.</p>
   */
  inline const Aws::String& GetName() const { return m_name; }
  inline bool NameHasBeenSet() const { return m_nameHasBeenSet; }
  template <typename NameT = Aws::String>
  void SetName(NameT&& value) {
    m_nameHasBeenSet = true;
    m_name = std::forward<NameT>(value);
  }
  template <typename NameT = Aws::String>
  AccessPoint& WithName(NameT&& value) {
    SetName(std::forward<NameT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>Indicates whether this access point allows access from the public internet.
   * If <code>VpcConfiguration</code> is specified for this access point, then
   * <code>NetworkOrigin</code> is <code>VPC</code>, and the access point doesn't
   * allow access from the public internet. Otherwise, <code>NetworkOrigin</code> is
   * <code>Internet</code>, and the access point allows access from the public
   * internet, subject to the access point and bucket access policies.</p>
   */
  inline NetworkOrigin GetNetworkOrigin() const { return m_networkOrigin; }
  inline bool NetworkOriginHasBeenSet() const { return m_networkOriginHasBeenSet; }
  inline void SetNetworkOrigin(NetworkOrigin value) {
    m_networkOriginHasBeenSet = true;
    m_networkOrigin = value;
  }
  inline AccessPoint& WithNetworkOrigin(NetworkOrigin value) {
    SetNetworkOrigin(value);
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The virtual private cloud (VPC) configuration for this access point, if one
   * exists.</p>  <p>This element is empty if this access point is an Amazon S3
   * on Outposts access point that is used by other Amazon Web Services services.</p>
   *
   */
  inline const VpcConfiguration& GetVpcConfiguration() const { return m_vpcConfiguration; }
  inline bool VpcConfigurationHasBeenSet() const { return m_vpcConfigurationHasBeenSet; }
  template <typename VpcConfigurationT = VpcConfiguration>
  void SetVpcConfiguration(VpcConfigurationT&& value) {
    m_vpcConfigurationHasBeenSet = true;
    m_vpcConfiguration = std::forward<VpcConfigurationT>(value);
  }
  template <typename VpcConfigurationT = VpcConfiguration>
  AccessPoint& WithVpcConfiguration(VpcConfigurationT&& value) {
    SetVpcConfiguration(std::forward<VpcConfigurationT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The name of the bucket associated with this access point.</p>
   */
  inline const Aws::String& GetBucket() const { return m_bucket; }
  inline bool BucketHasBeenSet() const { return m_bucketHasBeenSet; }
  template <typename BucketT = Aws::String>
  void SetBucket(BucketT&& value) {
    m_bucketHasBeenSet = true;
    m_bucket = std::forward<BucketT>(value);
  }
  template <typename BucketT = Aws::String>
  AccessPoint& WithBucket(BucketT&& value) {
    SetBucket(std::forward<BucketT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The ARN for the access point.</p>
   */
  inline const Aws::String& GetAccessPointArn() const { return m_accessPointArn; }
  inline bool AccessPointArnHasBeenSet() const { return m_accessPointArnHasBeenSet; }
  template <typename AccessPointArnT = Aws::String>
  void SetAccessPointArn(AccessPointArnT&& value) {
    m_accessPointArnHasBeenSet = true;
    m_accessPointArn = std::forward<AccessPointArnT>(value);
  }
  template <typename AccessPointArnT = Aws::String>
  AccessPoint& WithAccessPointArn(AccessPointArnT&& value) {
    SetAccessPointArn(std::forward<AccessPointArnT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The name or alias of the access point.</p>
   */
  inline const Aws::String& GetAlias() const { return m_alias; }
  inline bool AliasHasBeenSet() const { return m_aliasHasBeenSet; }
  template <typename AliasT = Aws::String>
  void SetAlias(AliasT&& value) {
    m_aliasHasBeenSet = true;
    m_alias = std::forward<AliasT>(value);
  }
  template <typename AliasT = Aws::String>
  AccessPoint& WithAlias(AliasT&& value) {
    SetAlias(std::forward<AliasT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The Amazon Web Services account ID associated with the S3 bucket associated
   * with this access point.</p>
   */
  inline const Aws::String& GetBucketAccountId() const { return m_bucketAccountId; }
  inline bool BucketAccountIdHasBeenSet() const { return m_bucketAccountIdHasBeenSet; }
  template <typename BucketAccountIdT = Aws::String>
  void SetBucketAccountId(BucketAccountIdT&& value) {
    m_bucketAccountIdHasBeenSet = true;
    m_bucketAccountId = std::forward<BucketAccountIdT>(value);
  }
  template <typename BucketAccountIdT = Aws::String>
  AccessPoint& WithBucketAccountId(BucketAccountIdT&& value) {
    SetBucketAccountId(std::forward<BucketAccountIdT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>A unique identifier for the data source of the access point.</p>
   */
  inline const Aws::String& GetDataSourceId() const { return m_dataSourceId; }
  inline bool DataSourceIdHasBeenSet() const { return m_dataSourceIdHasBeenSet; }
  template <typename DataSourceIdT = Aws::String>
  void SetDataSourceId(DataSourceIdT&& value) {
    m_dataSourceIdHasBeenSet = true;
    m_dataSourceId = std::forward<DataSourceIdT>(value);
  }
  template <typename DataSourceIdT = Aws::String>
  AccessPoint& WithDataSourceId(DataSourceIdT&& value) {
    SetDataSourceId(std::forward<DataSourceIdT>(value));
    return *this;
  }
  ///@}

  ///@{
  /**
   * <p>The type of the data source that the access point is attached to.</p>
   */
  inline const Aws::String& GetDataSourceType() const { return m_dataSourceType; }
  inline bool DataSourceTypeHasBeenSet() const { return m_dataSourceTypeHasBeenSet; }
  template <typename DataSourceTypeT = Aws::String>
  void SetDataSourceType(DataSourceTypeT&& value) {
    m_dataSourceTypeHasBeenSet = true;
    m_dataSourceType = std::forward<DataSourceTypeT>(value);
  }
  template <typename DataSourceTypeT = Aws::String>
  AccessPoint& WithDataSourceType(DataSourceTypeT&& value) {
    SetDataSourceType(std::forward<DataSourceTypeT>(value));
    return *this;
  }
  ///@}
 private:
  Aws::String m_name;

  NetworkOrigin m_networkOrigin{NetworkOrigin::NOT_SET};

  VpcConfiguration m_vpcConfiguration;

  Aws::String m_bucket;

  Aws::String m_accessPointArn;

  Aws::String m_alias;

  Aws::String m_bucketAccountId;

  Aws::String m_dataSourceId;

  Aws::String m_dataSourceType;
  bool m_nameHasBeenSet = false;
  bool m_networkOriginHasBeenSet = false;
  bool m_vpcConfigurationHasBeenSet = false;
  bool m_bucketHasBeenSet = false;
  bool m_accessPointArnHasBeenSet = false;
  bool m_aliasHasBeenSet = false;
  bool m_bucketAccountIdHasBeenSet = false;
  bool m_dataSourceIdHasBeenSet = false;
  bool m_dataSourceTypeHasBeenSet = false;
};

}  // namespace Model
}  // namespace S3Control
}  // namespace Aws
