
com.amazonaws.services.lightsail.model.AccessRules Maven / Gradle / Ivy
/*
* 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.lightsail.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Describes the anonymous access permissions for an Amazon Lightsail bucket and its objects.
*
*
* For more information about bucket access permissions, see Understanding bucket permissions in Amazon Lightsail in the
*
*
* Amazon Lightsail Developer Guide.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AccessRules implements Serializable, Cloneable, StructuredPojo {
/**
*
* Specifies the anonymous access to all objects in a bucket.
*
*
* The following options can be specified:
*
*
* -
*
* public
- Sets all objects in the bucket to public (read-only), making them readable by anyone in the
* world.
*
*
* If the getObject
value is set to public
, then all objects in the bucket default to
* public regardless of the allowPublicOverrides
value.
*
*
* -
*
* private
- Sets all objects in the bucket to private, making them readable only by you or anyone you
* give access to.
*
*
* If the getObject
value is set to private
, and the allowPublicOverrides
* value is set to true
, then all objects in the bucket default to private unless they are configured
* with a public-read
ACL. Individual objects with a public-read
ACL are readable by
* anyone in the world.
*
*
*
*/
private String getObject;
/**
*
* A Boolean value that indicates whether the access control list (ACL) permissions that are applied to individual
* objects override the getObject
option that is currently specified.
*
*
* When this is true, you can use the PutObjectAcl Amazon S3 API
* action to set individual objects to public (read-only) using the public-read
ACL, or to private
* using the private
ACL.
*
*/
private Boolean allowPublicOverrides;
/**
*
* Specifies the anonymous access to all objects in a bucket.
*
*
* The following options can be specified:
*
*
* -
*
* public
- Sets all objects in the bucket to public (read-only), making them readable by anyone in the
* world.
*
*
* If the getObject
value is set to public
, then all objects in the bucket default to
* public regardless of the allowPublicOverrides
value.
*
*
* -
*
* private
- Sets all objects in the bucket to private, making them readable only by you or anyone you
* give access to.
*
*
* If the getObject
value is set to private
, and the allowPublicOverrides
* value is set to true
, then all objects in the bucket default to private unless they are configured
* with a public-read
ACL. Individual objects with a public-read
ACL are readable by
* anyone in the world.
*
*
*
*
* @param getObject
* Specifies the anonymous access to all objects in a bucket.
*
* The following options can be specified:
*
*
* -
*
* public
- Sets all objects in the bucket to public (read-only), making them readable by anyone
* in the world.
*
*
* If the getObject
value is set to public
, then all objects in the bucket default
* to public regardless of the allowPublicOverrides
value.
*
*
* -
*
* private
- Sets all objects in the bucket to private, making them readable only by you or
* anyone you give access to.
*
*
* If the getObject
value is set to private
, and the
* allowPublicOverrides
value is set to true
, then all objects in the bucket
* default to private unless they are configured with a public-read
ACL. Individual objects with
* a public-read
ACL are readable by anyone in the world.
*
*
* @see AccessType
*/
public void setGetObject(String getObject) {
this.getObject = getObject;
}
/**
*
* Specifies the anonymous access to all objects in a bucket.
*
*
* The following options can be specified:
*
*
* -
*
* public
- Sets all objects in the bucket to public (read-only), making them readable by anyone in the
* world.
*
*
* If the getObject
value is set to public
, then all objects in the bucket default to
* public regardless of the allowPublicOverrides
value.
*
*
* -
*
* private
- Sets all objects in the bucket to private, making them readable only by you or anyone you
* give access to.
*
*
* If the getObject
value is set to private
, and the allowPublicOverrides
* value is set to true
, then all objects in the bucket default to private unless they are configured
* with a public-read
ACL. Individual objects with a public-read
ACL are readable by
* anyone in the world.
*
*
*
*
* @return Specifies the anonymous access to all objects in a bucket.
*
* The following options can be specified:
*
*
* -
*
* public
- Sets all objects in the bucket to public (read-only), making them readable by
* anyone in the world.
*
*
* If the getObject
value is set to public
, then all objects in the bucket default
* to public regardless of the allowPublicOverrides
value.
*
*
* -
*
* private
- Sets all objects in the bucket to private, making them readable only by you or
* anyone you give access to.
*
*
* If the getObject
value is set to private
, and the
* allowPublicOverrides
value is set to true
, then all objects in the bucket
* default to private unless they are configured with a public-read
ACL. Individual objects
* with a public-read
ACL are readable by anyone in the world.
*
*
* @see AccessType
*/
public String getGetObject() {
return this.getObject;
}
/**
*
* Specifies the anonymous access to all objects in a bucket.
*
*
* The following options can be specified:
*
*
* -
*
* public
- Sets all objects in the bucket to public (read-only), making them readable by anyone in the
* world.
*
*
* If the getObject
value is set to public
, then all objects in the bucket default to
* public regardless of the allowPublicOverrides
value.
*
*
* -
*
* private
- Sets all objects in the bucket to private, making them readable only by you or anyone you
* give access to.
*
*
* If the getObject
value is set to private
, and the allowPublicOverrides
* value is set to true
, then all objects in the bucket default to private unless they are configured
* with a public-read
ACL. Individual objects with a public-read
ACL are readable by
* anyone in the world.
*
*
*
*
* @param getObject
* Specifies the anonymous access to all objects in a bucket.
*
* The following options can be specified:
*
*
* -
*
* public
- Sets all objects in the bucket to public (read-only), making them readable by anyone
* in the world.
*
*
* If the getObject
value is set to public
, then all objects in the bucket default
* to public regardless of the allowPublicOverrides
value.
*
*
* -
*
* private
- Sets all objects in the bucket to private, making them readable only by you or
* anyone you give access to.
*
*
* If the getObject
value is set to private
, and the
* allowPublicOverrides
value is set to true
, then all objects in the bucket
* default to private unless they are configured with a public-read
ACL. Individual objects with
* a public-read
ACL are readable by anyone in the world.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see AccessType
*/
public AccessRules withGetObject(String getObject) {
setGetObject(getObject);
return this;
}
/**
*
* Specifies the anonymous access to all objects in a bucket.
*
*
* The following options can be specified:
*
*
* -
*
* public
- Sets all objects in the bucket to public (read-only), making them readable by anyone in the
* world.
*
*
* If the getObject
value is set to public
, then all objects in the bucket default to
* public regardless of the allowPublicOverrides
value.
*
*
* -
*
* private
- Sets all objects in the bucket to private, making them readable only by you or anyone you
* give access to.
*
*
* If the getObject
value is set to private
, and the allowPublicOverrides
* value is set to true
, then all objects in the bucket default to private unless they are configured
* with a public-read
ACL. Individual objects with a public-read
ACL are readable by
* anyone in the world.
*
*
*
*
* @param getObject
* Specifies the anonymous access to all objects in a bucket.
*
* The following options can be specified:
*
*
* -
*
* public
- Sets all objects in the bucket to public (read-only), making them readable by anyone
* in the world.
*
*
* If the getObject
value is set to public
, then all objects in the bucket default
* to public regardless of the allowPublicOverrides
value.
*
*
* -
*
* private
- Sets all objects in the bucket to private, making them readable only by you or
* anyone you give access to.
*
*
* If the getObject
value is set to private
, and the
* allowPublicOverrides
value is set to true
, then all objects in the bucket
* default to private unless they are configured with a public-read
ACL. Individual objects with
* a public-read
ACL are readable by anyone in the world.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see AccessType
*/
public AccessRules withGetObject(AccessType getObject) {
this.getObject = getObject.toString();
return this;
}
/**
*
* A Boolean value that indicates whether the access control list (ACL) permissions that are applied to individual
* objects override the getObject
option that is currently specified.
*
*
* When this is true, you can use the PutObjectAcl Amazon S3 API
* action to set individual objects to public (read-only) using the public-read
ACL, or to private
* using the private
ACL.
*
*
* @param allowPublicOverrides
* A Boolean value that indicates whether the access control list (ACL) permissions that are applied to
* individual objects override the getObject
option that is currently specified.
*
* When this is true, you can use the PutObjectAcl Amazon S3
* API action to set individual objects to public (read-only) using the public-read
ACL, or to
* private using the private
ACL.
*/
public void setAllowPublicOverrides(Boolean allowPublicOverrides) {
this.allowPublicOverrides = allowPublicOverrides;
}
/**
*
* A Boolean value that indicates whether the access control list (ACL) permissions that are applied to individual
* objects override the getObject
option that is currently specified.
*
*
* When this is true, you can use the PutObjectAcl Amazon S3 API
* action to set individual objects to public (read-only) using the public-read
ACL, or to private
* using the private
ACL.
*
*
* @return A Boolean value that indicates whether the access control list (ACL) permissions that are applied to
* individual objects override the getObject
option that is currently specified.
*
* When this is true, you can use the PutObjectAcl Amazon S3
* API action to set individual objects to public (read-only) using the public-read
ACL, or to
* private using the private
ACL.
*/
public Boolean getAllowPublicOverrides() {
return this.allowPublicOverrides;
}
/**
*
* A Boolean value that indicates whether the access control list (ACL) permissions that are applied to individual
* objects override the getObject
option that is currently specified.
*
*
* When this is true, you can use the PutObjectAcl Amazon S3 API
* action to set individual objects to public (read-only) using the public-read
ACL, or to private
* using the private
ACL.
*
*
* @param allowPublicOverrides
* A Boolean value that indicates whether the access control list (ACL) permissions that are applied to
* individual objects override the getObject
option that is currently specified.
*
* When this is true, you can use the PutObjectAcl Amazon S3
* API action to set individual objects to public (read-only) using the public-read
ACL, or to
* private using the private
ACL.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AccessRules withAllowPublicOverrides(Boolean allowPublicOverrides) {
setAllowPublicOverrides(allowPublicOverrides);
return this;
}
/**
*
* A Boolean value that indicates whether the access control list (ACL) permissions that are applied to individual
* objects override the getObject
option that is currently specified.
*
*
* When this is true, you can use the PutObjectAcl Amazon S3 API
* action to set individual objects to public (read-only) using the public-read
ACL, or to private
* using the private
ACL.
*
*
* @return A Boolean value that indicates whether the access control list (ACL) permissions that are applied to
* individual objects override the getObject
option that is currently specified.
*
* When this is true, you can use the PutObjectAcl Amazon S3
* API action to set individual objects to public (read-only) using the public-read
ACL, or to
* private using the private
ACL.
*/
public Boolean isAllowPublicOverrides() {
return this.allowPublicOverrides;
}
/**
* 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 (getGetObject() != null)
sb.append("GetObject: ").append(getGetObject()).append(",");
if (getAllowPublicOverrides() != null)
sb.append("AllowPublicOverrides: ").append(getAllowPublicOverrides());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof AccessRules == false)
return false;
AccessRules other = (AccessRules) obj;
if (other.getGetObject() == null ^ this.getGetObject() == null)
return false;
if (other.getGetObject() != null && other.getGetObject().equals(this.getGetObject()) == false)
return false;
if (other.getAllowPublicOverrides() == null ^ this.getAllowPublicOverrides() == null)
return false;
if (other.getAllowPublicOverrides() != null && other.getAllowPublicOverrides().equals(this.getAllowPublicOverrides()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getGetObject() == null) ? 0 : getGetObject().hashCode());
hashCode = prime * hashCode + ((getAllowPublicOverrides() == null) ? 0 : getAllowPublicOverrides().hashCode());
return hashCode;
}
@Override
public AccessRules clone() {
try {
return (AccessRules) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.lightsail.model.transform.AccessRulesMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}