/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.s3control.model; import java.io.Serializable; import javax.annotation.Generated; /** *
* An access point used to access a bucket. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AccessPoint implements Serializable, Cloneable { /** ** The name of this access point. *
*/ private String name; /** *
* Indicates whether this access point allows access from the public internet. If VpcConfiguration
is
* specified for this access point, then NetworkOrigin
is VPC
, and the access point
* doesn't allow access from the public internet. Otherwise, NetworkOrigin
is Internet
,
* and the access point allows access from the public internet, subject to the access point and bucket access
* policies.
*
* The virtual private cloud (VPC) configuration for this access point, if one exists. *
** This element is empty if this access point is an Amazon S3 on Outposts access point that is used by other Amazon * Web Services. *
** The name of the bucket associated with this access point. *
*/ private String bucket; /** ** The ARN for the access point. *
*/ private String accessPointArn; /** ** The name or alias of the access point. *
*/ private String alias; /** ** The Amazon Web Services account ID associated with the S3 bucket associated with this access point. *
*/ private String bucketAccountId; /** ** The name of this access point. *
* * @param name * The name of this access point. */ public void setName(String name) { this.name = name; } /** ** The name of this access point. *
* * @return The name of this access point. */ public String getName() { return this.name; } /** ** The name of this access point. *
* * @param name * The name of this access point. * @return Returns a reference to this object so that method calls can be chained together. */ public AccessPoint withName(String name) { setName(name); return this; } /** *
* Indicates whether this access point allows access from the public internet. If VpcConfiguration
is
* specified for this access point, then NetworkOrigin
is VPC
, and the access point
* doesn't allow access from the public internet. Otherwise, NetworkOrigin
is Internet
,
* and the access point allows access from the public internet, subject to the access point and bucket access
* policies.
*
VpcConfiguration
is specified for this access point, then NetworkOrigin
is
* VPC
, and the access point doesn't allow access from the public internet. Otherwise,
* NetworkOrigin
is Internet
, and the access point allows access from the public
* internet, subject to the access point and bucket access policies.
* @see NetworkOrigin
*/
public void setNetworkOrigin(String networkOrigin) {
this.networkOrigin = networkOrigin;
}
/**
*
* Indicates whether this access point allows access from the public internet. If VpcConfiguration
is
* specified for this access point, then NetworkOrigin
is VPC
, and the access point
* doesn't allow access from the public internet. Otherwise, NetworkOrigin
is Internet
,
* and the access point allows access from the public internet, subject to the access point and bucket access
* policies.
*
VpcConfiguration
is specified for this access point, then NetworkOrigin
is
* VPC
, and the access point doesn't allow access from the public internet. Otherwise,
* NetworkOrigin
is Internet
, and the access point allows access from the public
* internet, subject to the access point and bucket access policies.
* @see NetworkOrigin
*/
public String getNetworkOrigin() {
return this.networkOrigin;
}
/**
*
* Indicates whether this access point allows access from the public internet. If VpcConfiguration
is
* specified for this access point, then NetworkOrigin
is VPC
, and the access point
* doesn't allow access from the public internet. Otherwise, NetworkOrigin
is Internet
,
* and the access point allows access from the public internet, subject to the access point and bucket access
* policies.
*
VpcConfiguration
is specified for this access point, then NetworkOrigin
is
* VPC
, and the access point doesn't allow access from the public internet. Otherwise,
* NetworkOrigin
is Internet
, and the access point allows access from the public
* internet, subject to the access point and bucket access policies.
* @return Returns a reference to this object so that method calls can be chained together.
* @see NetworkOrigin
*/
public AccessPoint withNetworkOrigin(String networkOrigin) {
setNetworkOrigin(networkOrigin);
return this;
}
/**
*
* Indicates whether this access point allows access from the public internet. If VpcConfiguration
is
* specified for this access point, then NetworkOrigin
is VPC
, and the access point
* doesn't allow access from the public internet. Otherwise, NetworkOrigin
is Internet
,
* and the access point allows access from the public internet, subject to the access point and bucket access
* policies.
*
VpcConfiguration
is specified for this access point, then NetworkOrigin
is
* VPC
, and the access point doesn't allow access from the public internet. Otherwise,
* NetworkOrigin
is Internet
, and the access point allows access from the public
* internet, subject to the access point and bucket access policies.
* @return Returns a reference to this object so that method calls can be chained together.
* @see NetworkOrigin
*/
public AccessPoint withNetworkOrigin(NetworkOrigin networkOrigin) {
this.networkOrigin = networkOrigin.toString();
return this;
}
/**
* * The virtual private cloud (VPC) configuration for this access point, if one exists. *
** This element is empty if this access point is an Amazon S3 on Outposts access point that is used by other Amazon * Web Services. *
** This element is empty if this access point is an Amazon S3 on Outposts access point that is used by other * Amazon Web Services. *
*/ public void setVpcConfiguration(VpcConfiguration vpcConfiguration) { this.vpcConfiguration = vpcConfiguration; } /** ** The virtual private cloud (VPC) configuration for this access point, if one exists. *
** This element is empty if this access point is an Amazon S3 on Outposts access point that is used by other Amazon * Web Services. *
** This element is empty if this access point is an Amazon S3 on Outposts access point that is used by other * Amazon Web Services. *
*/ public VpcConfiguration getVpcConfiguration() { return this.vpcConfiguration; } /** ** The virtual private cloud (VPC) configuration for this access point, if one exists. *
** This element is empty if this access point is an Amazon S3 on Outposts access point that is used by other Amazon * Web Services. *
** This element is empty if this access point is an Amazon S3 on Outposts access point that is used by other * Amazon Web Services. *
* @return Returns a reference to this object so that method calls can be chained together. */ public AccessPoint withVpcConfiguration(VpcConfiguration vpcConfiguration) { setVpcConfiguration(vpcConfiguration); return this; } /** ** The name of the bucket associated with this access point. *
* * @param bucket * The name of the bucket associated with this access point. */ public void setBucket(String bucket) { this.bucket = bucket; } /** ** The name of the bucket associated with this access point. *
* * @return The name of the bucket associated with this access point. */ public String getBucket() { return this.bucket; } /** ** The name of the bucket associated with this access point. *
* * @param bucket * The name of the bucket associated with this access point. * @return Returns a reference to this object so that method calls can be chained together. */ public AccessPoint withBucket(String bucket) { setBucket(bucket); return this; } /** ** The ARN for the access point. *
* * @param accessPointArn * The ARN for the access point. */ public void setAccessPointArn(String accessPointArn) { this.accessPointArn = accessPointArn; } /** ** The ARN for the access point. *
* * @return The ARN for the access point. */ public String getAccessPointArn() { return this.accessPointArn; } /** ** The ARN for the access point. *
* * @param accessPointArn * The ARN for the access point. * @return Returns a reference to this object so that method calls can be chained together. */ public AccessPoint withAccessPointArn(String accessPointArn) { setAccessPointArn(accessPointArn); return this; } /** ** The name or alias of the access point. *
* * @param alias * The name or alias of the access point. */ public void setAlias(String alias) { this.alias = alias; } /** ** The name or alias of the access point. *
* * @return The name or alias of the access point. */ public String getAlias() { return this.alias; } /** ** The name or alias of the access point. *
* * @param alias * The name or alias of the access point. * @return Returns a reference to this object so that method calls can be chained together. */ public AccessPoint withAlias(String alias) { setAlias(alias); return this; } /** ** The Amazon Web Services account ID associated with the S3 bucket associated with this access point. *
* * @param bucketAccountId * The Amazon Web Services account ID associated with the S3 bucket associated with this access point. */ public void setBucketAccountId(String bucketAccountId) { this.bucketAccountId = bucketAccountId; } /** ** The Amazon Web Services account ID associated with the S3 bucket associated with this access point. *
* * @return The Amazon Web Services account ID associated with the S3 bucket associated with this access point. */ public String getBucketAccountId() { return this.bucketAccountId; } /** ** The Amazon Web Services account ID associated with the S3 bucket associated with this access point. *
* * @param bucketAccountId * The Amazon Web Services account ID associated with the S3 bucket associated with this access point. * @return Returns a reference to this object so that method calls can be chained together. */ public AccessPoint withBucketAccountId(String bucketAccountId) { setBucketAccountId(bucketAccountId); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getNetworkOrigin() != null) sb.append("NetworkOrigin: ").append(getNetworkOrigin()).append(","); if (getVpcConfiguration() != null) sb.append("VpcConfiguration: ").append(getVpcConfiguration()).append(","); if (getBucket() != null) sb.append("Bucket: ").append(getBucket()).append(","); if (getAccessPointArn() != null) sb.append("AccessPointArn: ").append(getAccessPointArn()).append(","); if (getAlias() != null) sb.append("Alias: ").append(getAlias()).append(","); if (getBucketAccountId() != null) sb.append("BucketAccountId: ").append(getBucketAccountId()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AccessPoint == false) return false; AccessPoint other = (AccessPoint) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getNetworkOrigin() == null ^ this.getNetworkOrigin() == null) return false; if (other.getNetworkOrigin() != null && other.getNetworkOrigin().equals(this.getNetworkOrigin()) == false) return false; if (other.getVpcConfiguration() == null ^ this.getVpcConfiguration() == null) return false; if (other.getVpcConfiguration() != null && other.getVpcConfiguration().equals(this.getVpcConfiguration()) == false) return false; if (other.getBucket() == null ^ this.getBucket() == null) return false; if (other.getBucket() != null && other.getBucket().equals(this.getBucket()) == false) return false; if (other.getAccessPointArn() == null ^ this.getAccessPointArn() == null) return false; if (other.getAccessPointArn() != null && other.getAccessPointArn().equals(this.getAccessPointArn()) == false) return false; if (other.getAlias() == null ^ this.getAlias() == null) return false; if (other.getAlias() != null && other.getAlias().equals(this.getAlias()) == false) return false; if (other.getBucketAccountId() == null ^ this.getBucketAccountId() == null) return false; if (other.getBucketAccountId() != null && other.getBucketAccountId().equals(this.getBucketAccountId()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getNetworkOrigin() == null) ? 0 : getNetworkOrigin().hashCode()); hashCode = prime * hashCode + ((getVpcConfiguration() == null) ? 0 : getVpcConfiguration().hashCode()); hashCode = prime * hashCode + ((getBucket() == null) ? 0 : getBucket().hashCode()); hashCode = prime * hashCode + ((getAccessPointArn() == null) ? 0 : getAccessPointArn().hashCode()); hashCode = prime * hashCode + ((getAlias() == null) ? 0 : getAlias().hashCode()); hashCode = prime * hashCode + ((getBucketAccountId() == null) ? 0 : getBucketAccountId().hashCode()); return hashCode; } @Override public AccessPoint clone() { try { return (AccessPoint) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }