com.amazonaws.services.s3control.model.GetAccessGrantResult Maven / Gradle / Ivy
/*
* Copyright 2019-2024 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;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class GetAccessGrantResult extends com.amazonaws.AmazonWebServiceResult implements
Serializable, Cloneable {
/**
*
* The date and time when you created the access grant.
*
*/
private java.util.Date createdAt;
/**
*
* The ID of the access grant. S3 Access Grants auto-generates this ID when you create the access grant.
*
*/
private String accessGrantId;
/**
*
* The Amazon Resource Name (ARN) of the access grant.
*
*/
private String accessGrantArn;
/**
*
* The user, group, or role to which you are granting access. You can grant access to an IAM user or role. If you
* have added a corporate directory to Amazon Web Services IAM Identity Center and associated this Identity Center
* instance with the S3 Access Grants instance, the grantee can also be a corporate directory user or group.
*
*/
private Grantee grantee;
/**
*
* The type of permission that was granted in the access grant. Can be one of the following values:
*
*
* -
*
* READ
– Grant read-only access to the S3 data.
*
*
* -
*
* WRITE
– Grant write-only access to the S3 data.
*
*
* -
*
* READWRITE
– Grant both read and write access to the S3 data.
*
*
*
*/
private String permission;
/**
*
* The ID of the registered location to which you are granting access. S3 Access Grants assigns this ID when you
* register the location. S3 Access Grants assigns the ID default
to the default location
* s3://
and assigns an auto-generated ID to other locations that you register.
*
*/
private String accessGrantsLocationId;
/**
*
* The configuration options of the grant location. The grant location is the S3 path to the data to which you are
* granting access.
*
*/
private AccessGrantsLocationConfiguration accessGrantsLocationConfiguration;
/**
*
* The S3 path of the data to which you are granting access. It is the result of appending the
* Subprefix
to the location scope.
*
*/
private String grantScope;
/**
*
* The Amazon Resource Name (ARN) of an Amazon Web Services IAM Identity Center application associated with your
* Identity Center instance. If the grant includes an application ARN, the grantee can only access the S3 data
* through this application.
*
*/
private String applicationArn;
/**
*
* The date and time when you created the access grant.
*
*
* @param createdAt
* The date and time when you created the access grant.
*/
public void setCreatedAt(java.util.Date createdAt) {
this.createdAt = createdAt;
}
/**
*
* The date and time when you created the access grant.
*
*
* @return The date and time when you created the access grant.
*/
public java.util.Date getCreatedAt() {
return this.createdAt;
}
/**
*
* The date and time when you created the access grant.
*
*
* @param createdAt
* The date and time when you created the access grant.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetAccessGrantResult withCreatedAt(java.util.Date createdAt) {
setCreatedAt(createdAt);
return this;
}
/**
*
* The ID of the access grant. S3 Access Grants auto-generates this ID when you create the access grant.
*
*
* @param accessGrantId
* The ID of the access grant. S3 Access Grants auto-generates this ID when you create the access grant.
*/
public void setAccessGrantId(String accessGrantId) {
this.accessGrantId = accessGrantId;
}
/**
*
* The ID of the access grant. S3 Access Grants auto-generates this ID when you create the access grant.
*
*
* @return The ID of the access grant. S3 Access Grants auto-generates this ID when you create the access grant.
*/
public String getAccessGrantId() {
return this.accessGrantId;
}
/**
*
* The ID of the access grant. S3 Access Grants auto-generates this ID when you create the access grant.
*
*
* @param accessGrantId
* The ID of the access grant. S3 Access Grants auto-generates this ID when you create the access grant.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetAccessGrantResult withAccessGrantId(String accessGrantId) {
setAccessGrantId(accessGrantId);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the access grant.
*
*
* @param accessGrantArn
* The Amazon Resource Name (ARN) of the access grant.
*/
public void setAccessGrantArn(String accessGrantArn) {
this.accessGrantArn = accessGrantArn;
}
/**
*
* The Amazon Resource Name (ARN) of the access grant.
*
*
* @return The Amazon Resource Name (ARN) of the access grant.
*/
public String getAccessGrantArn() {
return this.accessGrantArn;
}
/**
*
* The Amazon Resource Name (ARN) of the access grant.
*
*
* @param accessGrantArn
* The Amazon Resource Name (ARN) of the access grant.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetAccessGrantResult withAccessGrantArn(String accessGrantArn) {
setAccessGrantArn(accessGrantArn);
return this;
}
/**
*
* The user, group, or role to which you are granting access. You can grant access to an IAM user or role. If you
* have added a corporate directory to Amazon Web Services IAM Identity Center and associated this Identity Center
* instance with the S3 Access Grants instance, the grantee can also be a corporate directory user or group.
*
*
* @param grantee
* The user, group, or role to which you are granting access. You can grant access to an IAM user or role. If
* you have added a corporate directory to Amazon Web Services IAM Identity Center and associated this
* Identity Center instance with the S3 Access Grants instance, the grantee can also be a corporate directory
* user or group.
*/
public void setGrantee(Grantee grantee) {
this.grantee = grantee;
}
/**
*
* The user, group, or role to which you are granting access. You can grant access to an IAM user or role. If you
* have added a corporate directory to Amazon Web Services IAM Identity Center and associated this Identity Center
* instance with the S3 Access Grants instance, the grantee can also be a corporate directory user or group.
*
*
* @return The user, group, or role to which you are granting access. You can grant access to an IAM user or role.
* If you have added a corporate directory to Amazon Web Services IAM Identity Center and associated this
* Identity Center instance with the S3 Access Grants instance, the grantee can also be a corporate
* directory user or group.
*/
public Grantee getGrantee() {
return this.grantee;
}
/**
*
* The user, group, or role to which you are granting access. You can grant access to an IAM user or role. If you
* have added a corporate directory to Amazon Web Services IAM Identity Center and associated this Identity Center
* instance with the S3 Access Grants instance, the grantee can also be a corporate directory user or group.
*
*
* @param grantee
* The user, group, or role to which you are granting access. You can grant access to an IAM user or role. If
* you have added a corporate directory to Amazon Web Services IAM Identity Center and associated this
* Identity Center instance with the S3 Access Grants instance, the grantee can also be a corporate directory
* user or group.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetAccessGrantResult withGrantee(Grantee grantee) {
setGrantee(grantee);
return this;
}
/**
*
* The type of permission that was granted in the access grant. Can be one of the following values:
*
*
* -
*
* READ
– Grant read-only access to the S3 data.
*
*
* -
*
* WRITE
– Grant write-only access to the S3 data.
*
*
* -
*
* READWRITE
– Grant both read and write access to the S3 data.
*
*
*
*
* @param permission
* The type of permission that was granted in the access grant. Can be one of the following values:
*
* -
*
* READ
– Grant read-only access to the S3 data.
*
*
* -
*
* WRITE
– Grant write-only access to the S3 data.
*
*
* -
*
* READWRITE
– Grant both read and write access to the S3 data.
*
*
* @see Permission
*/
public void setPermission(String permission) {
this.permission = permission;
}
/**
*
* The type of permission that was granted in the access grant. Can be one of the following values:
*
*
* -
*
* READ
– Grant read-only access to the S3 data.
*
*
* -
*
* WRITE
– Grant write-only access to the S3 data.
*
*
* -
*
* READWRITE
– Grant both read and write access to the S3 data.
*
*
*
*
* @return The type of permission that was granted in the access grant. Can be one of the following values:
*
* -
*
* READ
– Grant read-only access to the S3 data.
*
*
* -
*
* WRITE
– Grant write-only access to the S3 data.
*
*
* -
*
* READWRITE
– Grant both read and write access to the S3 data.
*
*
* @see Permission
*/
public String getPermission() {
return this.permission;
}
/**
*
* The type of permission that was granted in the access grant. Can be one of the following values:
*
*
* -
*
* READ
– Grant read-only access to the S3 data.
*
*
* -
*
* WRITE
– Grant write-only access to the S3 data.
*
*
* -
*
* READWRITE
– Grant both read and write access to the S3 data.
*
*
*
*
* @param permission
* The type of permission that was granted in the access grant. Can be one of the following values:
*
* -
*
* READ
– Grant read-only access to the S3 data.
*
*
* -
*
* WRITE
– Grant write-only access to the S3 data.
*
*
* -
*
* READWRITE
– Grant both read and write access to the S3 data.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see Permission
*/
public GetAccessGrantResult withPermission(String permission) {
setPermission(permission);
return this;
}
/**
*
* The type of permission that was granted in the access grant. Can be one of the following values:
*
*
* -
*
* READ
– Grant read-only access to the S3 data.
*
*
* -
*
* WRITE
– Grant write-only access to the S3 data.
*
*
* -
*
* READWRITE
– Grant both read and write access to the S3 data.
*
*
*
*
* @param permission
* The type of permission that was granted in the access grant. Can be one of the following values:
*
* -
*
* READ
– Grant read-only access to the S3 data.
*
*
* -
*
* WRITE
– Grant write-only access to the S3 data.
*
*
* -
*
* READWRITE
– Grant both read and write access to the S3 data.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see Permission
*/
public GetAccessGrantResult withPermission(Permission permission) {
this.permission = permission.toString();
return this;
}
/**
*
* The ID of the registered location to which you are granting access. S3 Access Grants assigns this ID when you
* register the location. S3 Access Grants assigns the ID default
to the default location
* s3://
and assigns an auto-generated ID to other locations that you register.
*
*
* @param accessGrantsLocationId
* The ID of the registered location to which you are granting access. S3 Access Grants assigns this ID when
* you register the location. S3 Access Grants assigns the ID default
to the default location
* s3://
and assigns an auto-generated ID to other locations that you register.
*/
public void setAccessGrantsLocationId(String accessGrantsLocationId) {
this.accessGrantsLocationId = accessGrantsLocationId;
}
/**
*
* The ID of the registered location to which you are granting access. S3 Access Grants assigns this ID when you
* register the location. S3 Access Grants assigns the ID default
to the default location
* s3://
and assigns an auto-generated ID to other locations that you register.
*
*
* @return The ID of the registered location to which you are granting access. S3 Access Grants assigns this ID when
* you register the location. S3 Access Grants assigns the ID default
to the default location
* s3://
and assigns an auto-generated ID to other locations that you register.
*/
public String getAccessGrantsLocationId() {
return this.accessGrantsLocationId;
}
/**
*
* The ID of the registered location to which you are granting access. S3 Access Grants assigns this ID when you
* register the location. S3 Access Grants assigns the ID default
to the default location
* s3://
and assigns an auto-generated ID to other locations that you register.
*
*
* @param accessGrantsLocationId
* The ID of the registered location to which you are granting access. S3 Access Grants assigns this ID when
* you register the location. S3 Access Grants assigns the ID default
to the default location
* s3://
and assigns an auto-generated ID to other locations that you register.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetAccessGrantResult withAccessGrantsLocationId(String accessGrantsLocationId) {
setAccessGrantsLocationId(accessGrantsLocationId);
return this;
}
/**
*
* The configuration options of the grant location. The grant location is the S3 path to the data to which you are
* granting access.
*
*
* @param accessGrantsLocationConfiguration
* The configuration options of the grant location. The grant location is the S3 path to the data to which
* you are granting access.
*/
public void setAccessGrantsLocationConfiguration(AccessGrantsLocationConfiguration accessGrantsLocationConfiguration) {
this.accessGrantsLocationConfiguration = accessGrantsLocationConfiguration;
}
/**
*
* The configuration options of the grant location. The grant location is the S3 path to the data to which you are
* granting access.
*
*
* @return The configuration options of the grant location. The grant location is the S3 path to the data to which
* you are granting access.
*/
public AccessGrantsLocationConfiguration getAccessGrantsLocationConfiguration() {
return this.accessGrantsLocationConfiguration;
}
/**
*
* The configuration options of the grant location. The grant location is the S3 path to the data to which you are
* granting access.
*
*
* @param accessGrantsLocationConfiguration
* The configuration options of the grant location. The grant location is the S3 path to the data to which
* you are granting access.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetAccessGrantResult withAccessGrantsLocationConfiguration(AccessGrantsLocationConfiguration accessGrantsLocationConfiguration) {
setAccessGrantsLocationConfiguration(accessGrantsLocationConfiguration);
return this;
}
/**
*
* The S3 path of the data to which you are granting access. It is the result of appending the
* Subprefix
to the location scope.
*
*
* @param grantScope
* The S3 path of the data to which you are granting access. It is the result of appending the
* Subprefix
to the location scope.
*/
public void setGrantScope(String grantScope) {
this.grantScope = grantScope;
}
/**
*
* The S3 path of the data to which you are granting access. It is the result of appending the
* Subprefix
to the location scope.
*
*
* @return The S3 path of the data to which you are granting access. It is the result of appending the
* Subprefix
to the location scope.
*/
public String getGrantScope() {
return this.grantScope;
}
/**
*
* The S3 path of the data to which you are granting access. It is the result of appending the
* Subprefix
to the location scope.
*
*
* @param grantScope
* The S3 path of the data to which you are granting access. It is the result of appending the
* Subprefix
to the location scope.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetAccessGrantResult withGrantScope(String grantScope) {
setGrantScope(grantScope);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of an Amazon Web Services IAM Identity Center application associated with your
* Identity Center instance. If the grant includes an application ARN, the grantee can only access the S3 data
* through this application.
*
*
* @param applicationArn
* The Amazon Resource Name (ARN) of an Amazon Web Services IAM Identity Center application associated with
* your Identity Center instance. If the grant includes an application ARN, the grantee can only access the
* S3 data through this application.
*/
public void setApplicationArn(String applicationArn) {
this.applicationArn = applicationArn;
}
/**
*
* The Amazon Resource Name (ARN) of an Amazon Web Services IAM Identity Center application associated with your
* Identity Center instance. If the grant includes an application ARN, the grantee can only access the S3 data
* through this application.
*
*
* @return The Amazon Resource Name (ARN) of an Amazon Web Services IAM Identity Center application associated with
* your Identity Center instance. If the grant includes an application ARN, the grantee can only access the
* S3 data through this application.
*/
public String getApplicationArn() {
return this.applicationArn;
}
/**
*
* The Amazon Resource Name (ARN) of an Amazon Web Services IAM Identity Center application associated with your
* Identity Center instance. If the grant includes an application ARN, the grantee can only access the S3 data
* through this application.
*
*
* @param applicationArn
* The Amazon Resource Name (ARN) of an Amazon Web Services IAM Identity Center application associated with
* your Identity Center instance. If the grant includes an application ARN, the grantee can only access the
* S3 data through this application.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetAccessGrantResult withApplicationArn(String applicationArn) {
setApplicationArn(applicationArn);
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 (getCreatedAt() != null)
sb.append("CreatedAt: ").append(getCreatedAt()).append(",");
if (getAccessGrantId() != null)
sb.append("AccessGrantId: ").append(getAccessGrantId()).append(",");
if (getAccessGrantArn() != null)
sb.append("AccessGrantArn: ").append(getAccessGrantArn()).append(",");
if (getGrantee() != null)
sb.append("Grantee: ").append(getGrantee()).append(",");
if (getPermission() != null)
sb.append("Permission: ").append(getPermission()).append(",");
if (getAccessGrantsLocationId() != null)
sb.append("AccessGrantsLocationId: ").append(getAccessGrantsLocationId()).append(",");
if (getAccessGrantsLocationConfiguration() != null)
sb.append("AccessGrantsLocationConfiguration: ").append(getAccessGrantsLocationConfiguration()).append(",");
if (getGrantScope() != null)
sb.append("GrantScope: ").append(getGrantScope()).append(",");
if (getApplicationArn() != null)
sb.append("ApplicationArn: ").append(getApplicationArn());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof GetAccessGrantResult == false)
return false;
GetAccessGrantResult other = (GetAccessGrantResult) obj;
if (other.getCreatedAt() == null ^ this.getCreatedAt() == null)
return false;
if (other.getCreatedAt() != null && other.getCreatedAt().equals(this.getCreatedAt()) == false)
return false;
if (other.getAccessGrantId() == null ^ this.getAccessGrantId() == null)
return false;
if (other.getAccessGrantId() != null && other.getAccessGrantId().equals(this.getAccessGrantId()) == false)
return false;
if (other.getAccessGrantArn() == null ^ this.getAccessGrantArn() == null)
return false;
if (other.getAccessGrantArn() != null && other.getAccessGrantArn().equals(this.getAccessGrantArn()) == false)
return false;
if (other.getGrantee() == null ^ this.getGrantee() == null)
return false;
if (other.getGrantee() != null && other.getGrantee().equals(this.getGrantee()) == false)
return false;
if (other.getPermission() == null ^ this.getPermission() == null)
return false;
if (other.getPermission() != null && other.getPermission().equals(this.getPermission()) == false)
return false;
if (other.getAccessGrantsLocationId() == null ^ this.getAccessGrantsLocationId() == null)
return false;
if (other.getAccessGrantsLocationId() != null && other.getAccessGrantsLocationId().equals(this.getAccessGrantsLocationId()) == false)
return false;
if (other.getAccessGrantsLocationConfiguration() == null ^ this.getAccessGrantsLocationConfiguration() == null)
return false;
if (other.getAccessGrantsLocationConfiguration() != null
&& other.getAccessGrantsLocationConfiguration().equals(this.getAccessGrantsLocationConfiguration()) == false)
return false;
if (other.getGrantScope() == null ^ this.getGrantScope() == null)
return false;
if (other.getGrantScope() != null && other.getGrantScope().equals(this.getGrantScope()) == false)
return false;
if (other.getApplicationArn() == null ^ this.getApplicationArn() == null)
return false;
if (other.getApplicationArn() != null && other.getApplicationArn().equals(this.getApplicationArn()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
hashCode = prime * hashCode + ((getAccessGrantId() == null) ? 0 : getAccessGrantId().hashCode());
hashCode = prime * hashCode + ((getAccessGrantArn() == null) ? 0 : getAccessGrantArn().hashCode());
hashCode = prime * hashCode + ((getGrantee() == null) ? 0 : getGrantee().hashCode());
hashCode = prime * hashCode + ((getPermission() == null) ? 0 : getPermission().hashCode());
hashCode = prime * hashCode + ((getAccessGrantsLocationId() == null) ? 0 : getAccessGrantsLocationId().hashCode());
hashCode = prime * hashCode + ((getAccessGrantsLocationConfiguration() == null) ? 0 : getAccessGrantsLocationConfiguration().hashCode());
hashCode = prime * hashCode + ((getGrantScope() == null) ? 0 : getGrantScope().hashCode());
hashCode = prime * hashCode + ((getApplicationArn() == null) ? 0 : getApplicationArn().hashCode());
return hashCode;
}
@Override
public GetAccessGrantResult clone() {
try {
return (GetAccessGrantResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}