com.amazonaws.services.s3control.model.Grantee Maven / Gradle / Ivy
Show all versions of aws-java-sdk-s3control Show documentation
/*
* 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;
/**
*
* 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 your corporate directory to Amazon Web Services IAM Identity Center and associated your Identity Center
* instance with your S3 Access Grants instance, the grantee can also be a corporate directory user or group.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Grantee implements Serializable, Cloneable {
/**
*
* The type of the grantee to which access has been granted. It can be one of the following values:
*
*
* -
*
* IAM
- An IAM user or role.
*
*
* -
*
* DIRECTORY_USER
- Your corporate directory user. You can use this option if you have added your
* corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3
* Access Grants instance.
*
*
* -
*
* DIRECTORY_GROUP
- Your corporate directory group. You can use this option if you have added your
* corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3
* Access Grants instance.
*
*
*
*/
private String granteeType;
/**
*
* The unique identifier of the Grantee
. If the grantee type is IAM
, the identifier is the
* IAM Amazon Resource Name (ARN) of the user or role. If the grantee type is a directory user or group, the
* identifier is 128-bit universally unique identifier (UUID) in the format
* a1b2c3d4-5678-90ab-cdef-EXAMPLE11111
. You can obtain this UUID from your Amazon Web Services IAM
* Identity Center instance.
*
*/
private String granteeIdentifier;
/**
*
* The type of the grantee to which access has been granted. It can be one of the following values:
*
*
* -
*
* IAM
- An IAM user or role.
*
*
* -
*
* DIRECTORY_USER
- Your corporate directory user. You can use this option if you have added your
* corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3
* Access Grants instance.
*
*
* -
*
* DIRECTORY_GROUP
- Your corporate directory group. You can use this option if you have added your
* corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3
* Access Grants instance.
*
*
*
*
* @param granteeType
* The type of the grantee to which access has been granted. It can be one of the following values:
*
* -
*
* IAM
- An IAM user or role.
*
*
* -
*
* DIRECTORY_USER
- Your corporate directory user. You can use this option if you have added
* your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance
* with your S3 Access Grants instance.
*
*
* -
*
* DIRECTORY_GROUP
- Your corporate directory group. You can use this option if you have added
* your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance
* with your S3 Access Grants instance.
*
*
* @see GranteeType
*/
public void setGranteeType(String granteeType) {
this.granteeType = granteeType;
}
/**
*
* The type of the grantee to which access has been granted. It can be one of the following values:
*
*
* -
*
* IAM
- An IAM user or role.
*
*
* -
*
* DIRECTORY_USER
- Your corporate directory user. You can use this option if you have added your
* corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3
* Access Grants instance.
*
*
* -
*
* DIRECTORY_GROUP
- Your corporate directory group. You can use this option if you have added your
* corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3
* Access Grants instance.
*
*
*
*
* @return The type of the grantee to which access has been granted. It can be one of the following values:
*
* -
*
* IAM
- An IAM user or role.
*
*
* -
*
* DIRECTORY_USER
- Your corporate directory user. You can use this option if you have added
* your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance
* with your S3 Access Grants instance.
*
*
* -
*
* DIRECTORY_GROUP
- Your corporate directory group. You can use this option if you have added
* your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance
* with your S3 Access Grants instance.
*
*
* @see GranteeType
*/
public String getGranteeType() {
return this.granteeType;
}
/**
*
* The type of the grantee to which access has been granted. It can be one of the following values:
*
*
* -
*
* IAM
- An IAM user or role.
*
*
* -
*
* DIRECTORY_USER
- Your corporate directory user. You can use this option if you have added your
* corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3
* Access Grants instance.
*
*
* -
*
* DIRECTORY_GROUP
- Your corporate directory group. You can use this option if you have added your
* corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3
* Access Grants instance.
*
*
*
*
* @param granteeType
* The type of the grantee to which access has been granted. It can be one of the following values:
*
* -
*
* IAM
- An IAM user or role.
*
*
* -
*
* DIRECTORY_USER
- Your corporate directory user. You can use this option if you have added
* your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance
* with your S3 Access Grants instance.
*
*
* -
*
* DIRECTORY_GROUP
- Your corporate directory group. You can use this option if you have added
* your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance
* with your S3 Access Grants instance.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see GranteeType
*/
public Grantee withGranteeType(String granteeType) {
setGranteeType(granteeType);
return this;
}
/**
*
* The type of the grantee to which access has been granted. It can be one of the following values:
*
*
* -
*
* IAM
- An IAM user or role.
*
*
* -
*
* DIRECTORY_USER
- Your corporate directory user. You can use this option if you have added your
* corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3
* Access Grants instance.
*
*
* -
*
* DIRECTORY_GROUP
- Your corporate directory group. You can use this option if you have added your
* corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3
* Access Grants instance.
*
*
*
*
* @param granteeType
* The type of the grantee to which access has been granted. It can be one of the following values:
*
* -
*
* IAM
- An IAM user or role.
*
*
* -
*
* DIRECTORY_USER
- Your corporate directory user. You can use this option if you have added
* your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance
* with your S3 Access Grants instance.
*
*
* -
*
* DIRECTORY_GROUP
- Your corporate directory group. You can use this option if you have added
* your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance
* with your S3 Access Grants instance.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see GranteeType
*/
public Grantee withGranteeType(GranteeType granteeType) {
this.granteeType = granteeType.toString();
return this;
}
/**
*
* The unique identifier of the Grantee
. If the grantee type is IAM
, the identifier is the
* IAM Amazon Resource Name (ARN) of the user or role. If the grantee type is a directory user or group, the
* identifier is 128-bit universally unique identifier (UUID) in the format
* a1b2c3d4-5678-90ab-cdef-EXAMPLE11111
. You can obtain this UUID from your Amazon Web Services IAM
* Identity Center instance.
*
*
* @param granteeIdentifier
* The unique identifier of the Grantee
. If the grantee type is IAM
, the identifier
* is the IAM Amazon Resource Name (ARN) of the user or role. If the grantee type is a directory user or
* group, the identifier is 128-bit universally unique identifier (UUID) in the format
* a1b2c3d4-5678-90ab-cdef-EXAMPLE11111
. You can obtain this UUID from your Amazon Web Services
* IAM Identity Center instance.
*/
public void setGranteeIdentifier(String granteeIdentifier) {
this.granteeIdentifier = granteeIdentifier;
}
/**
*
* The unique identifier of the Grantee
. If the grantee type is IAM
, the identifier is the
* IAM Amazon Resource Name (ARN) of the user or role. If the grantee type is a directory user or group, the
* identifier is 128-bit universally unique identifier (UUID) in the format
* a1b2c3d4-5678-90ab-cdef-EXAMPLE11111
. You can obtain this UUID from your Amazon Web Services IAM
* Identity Center instance.
*
*
* @return The unique identifier of the Grantee
. If the grantee type is IAM
, the
* identifier is the IAM Amazon Resource Name (ARN) of the user or role. If the grantee type is a directory
* user or group, the identifier is 128-bit universally unique identifier (UUID) in the format
* a1b2c3d4-5678-90ab-cdef-EXAMPLE11111
. You can obtain this UUID from your Amazon Web Services
* IAM Identity Center instance.
*/
public String getGranteeIdentifier() {
return this.granteeIdentifier;
}
/**
*
* The unique identifier of the Grantee
. If the grantee type is IAM
, the identifier is the
* IAM Amazon Resource Name (ARN) of the user or role. If the grantee type is a directory user or group, the
* identifier is 128-bit universally unique identifier (UUID) in the format
* a1b2c3d4-5678-90ab-cdef-EXAMPLE11111
. You can obtain this UUID from your Amazon Web Services IAM
* Identity Center instance.
*
*
* @param granteeIdentifier
* The unique identifier of the Grantee
. If the grantee type is IAM
, the identifier
* is the IAM Amazon Resource Name (ARN) of the user or role. If the grantee type is a directory user or
* group, the identifier is 128-bit universally unique identifier (UUID) in the format
* a1b2c3d4-5678-90ab-cdef-EXAMPLE11111
. You can obtain this UUID from your Amazon Web Services
* IAM Identity Center instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Grantee withGranteeIdentifier(String granteeIdentifier) {
setGranteeIdentifier(granteeIdentifier);
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 (getGranteeType() != null)
sb.append("GranteeType: ").append(getGranteeType()).append(",");
if (getGranteeIdentifier() != null)
sb.append("GranteeIdentifier: ").append(getGranteeIdentifier());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Grantee == false)
return false;
Grantee other = (Grantee) obj;
if (other.getGranteeType() == null ^ this.getGranteeType() == null)
return false;
if (other.getGranteeType() != null && other.getGranteeType().equals(this.getGranteeType()) == false)
return false;
if (other.getGranteeIdentifier() == null ^ this.getGranteeIdentifier() == null)
return false;
if (other.getGranteeIdentifier() != null && other.getGranteeIdentifier().equals(this.getGranteeIdentifier()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getGranteeType() == null) ? 0 : getGranteeType().hashCode());
hashCode = prime * hashCode + ((getGranteeIdentifier() == null) ? 0 : getGranteeIdentifier().hashCode());
return hashCode;
}
@Override
public Grantee clone() {
try {
return (Grantee) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}