Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 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.elastictranscoder.model;
 

The Permission structure.

 
 public class Permission implements SerializableCloneable {

    
The type of value that appears in the Grantee object:
  • Canonical: Either the canonical user ID for an AWS account or an origin access identity for an Amazon CloudFront distribution. <important>A canonical user ID is not the same as an AWS account number.</important>
  • Email: The registered email address of an AWS account.
  • Group: One of the following predefined Amazon S3 groups: AllUsers, AuthenticatedUsers, or LogDelivery.

Constraints:
Pattern: (^Canonical$)|(^Email$)|(^Group$)

 
     private String granteeType;

    
The AWS user or group that you want to have access to transcoded files and playlists. To identify the user or group, you can specify the canonical user ID for an AWS account, an origin access identity for a CloudFront distribution, the registered email address of an AWS account, or a predefined Amazon S3 group.

Constraints:
Length: 1 - 255

 
     private String grantee;

    
The permission that you want to give to the AWS user that is listed in Grantee. Valid values include:
  • READ: The grantee can read the thumbnails and metadata for thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
  • READ_ACP: The grantee can read the object ACL for thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
  • WRITE_ACP: The grantee can write the ACL for the thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
  • FULL_CONTROL: The grantee has READ, READ_ACP, and WRITE_ACP permissions for the thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.

Constraints:
Length: 0 - 30

 
The type of value that appears in the Grantee object:
  • Canonical: Either the canonical user ID for an AWS account or an origin access identity for an Amazon CloudFront distribution. <important>A canonical user ID is not the same as an AWS account number.</important>
  • Email: The registered email address of an AWS account.
  • Group: One of the following predefined Amazon S3 groups: AllUsers, AuthenticatedUsers, or LogDelivery.

Constraints:
Pattern: (^Canonical$)|(^Email$)|(^Group$)

Returns:
The type of value that appears in the Grantee object:
  • Canonical: Either the canonical user ID for an AWS account or an origin access identity for an Amazon CloudFront distribution. <important>A canonical user ID is not the same as an AWS account number.</important>
  • Email: The registered email address of an AWS account.
  • Group: One of the following predefined Amazon S3 groups: AllUsers, AuthenticatedUsers, or LogDelivery.
 
     public String getGranteeType() {
         return ;
     }
    
    
The type of value that appears in the Grantee object:
  • Canonical: Either the canonical user ID for an AWS account or an origin access identity for an Amazon CloudFront distribution. <important>A canonical user ID is not the same as an AWS account number.</important>
  • Email: The registered email address of an AWS account.
  • Group: One of the following predefined Amazon S3 groups: AllUsers, AuthenticatedUsers, or LogDelivery.

Constraints:
Pattern: (^Canonical$)|(^Email$)|(^Group$)

Parameters:
granteeType The type of value that appears in the Grantee object:
  • Canonical: Either the canonical user ID for an AWS account or an origin access identity for an Amazon CloudFront distribution. <important>A canonical user ID is not the same as an AWS account number.</important>
  • Email: The registered email address of an AWS account.
  • Group: One of the following predefined Amazon S3 groups: AllUsers, AuthenticatedUsers, or LogDelivery.
    public void setGranteeType(String granteeType) {
        this. = granteeType;
    }
    
    
The type of value that appears in the Grantee object:
  • Canonical: Either the canonical user ID for an AWS account or an origin access identity for an Amazon CloudFront distribution. <important>A canonical user ID is not the same as an AWS account number.</important>
  • Email: The registered email address of an AWS account.
  • Group: One of the following predefined Amazon S3 groups: AllUsers, AuthenticatedUsers, or LogDelivery.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Pattern: (^Canonical$)|(^Email$)|(^Group$)

Parameters:
granteeType The type of value that appears in the Grantee object:
  • Canonical: Either the canonical user ID for an AWS account or an origin access identity for an Amazon CloudFront distribution. <important>A canonical user ID is not the same as an AWS account number.</important>
  • Email: The registered email address of an AWS account.
  • Group: One of the following predefined Amazon S3 groups: AllUsers, AuthenticatedUsers, or LogDelivery.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Permission withGranteeType(String granteeType) {
        this. = granteeType;
        return this;
    }

    
The AWS user or group that you want to have access to transcoded files and playlists. To identify the user or group, you can specify the canonical user ID for an AWS account, an origin access identity for a CloudFront distribution, the registered email address of an AWS account, or a predefined Amazon S3 group.

Constraints:
Length: 1 - 255

Returns:
The AWS user or group that you want to have access to transcoded files and playlists. To identify the user or group, you can specify the canonical user ID for an AWS account, an origin access identity for a CloudFront distribution, the registered email address of an AWS account, or a predefined Amazon S3 group.
    public String getGrantee() {
        return ;
    }
    
    
The AWS user or group that you want to have access to transcoded files and playlists. To identify the user or group, you can specify the canonical user ID for an AWS account, an origin access identity for a CloudFront distribution, the registered email address of an AWS account, or a predefined Amazon S3 group.

Constraints:
Length: 1 - 255

Parameters:
grantee The AWS user or group that you want to have access to transcoded files and playlists. To identify the user or group, you can specify the canonical user ID for an AWS account, an origin access identity for a CloudFront distribution, the registered email address of an AWS account, or a predefined Amazon S3 group.
    public void setGrantee(String grantee) {
        this. = grantee;
    }
    
    
The AWS user or group that you want to have access to transcoded files and playlists. To identify the user or group, you can specify the canonical user ID for an AWS account, an origin access identity for a CloudFront distribution, the registered email address of an AWS account, or a predefined Amazon S3 group.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 255

Parameters:
grantee The AWS user or group that you want to have access to transcoded files and playlists. To identify the user or group, you can specify the canonical user ID for an AWS account, an origin access identity for a CloudFront distribution, the registered email address of an AWS account, or a predefined Amazon S3 group.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Permission withGrantee(String grantee) {
        this. = grantee;
        return this;
    }

    
The permission that you want to give to the AWS user that is listed in Grantee. Valid values include:
  • READ: The grantee can read the thumbnails and metadata for thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
  • READ_ACP: The grantee can read the object ACL for thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
  • WRITE_ACP: The grantee can write the ACL for the thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
  • FULL_CONTROL: The grantee has READ, READ_ACP, and WRITE_ACP permissions for the thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.

Constraints:
Length: 0 - 30

Returns:
The permission that you want to give to the AWS user that is listed in Grantee. Valid values include:
  • READ: The grantee can read the thumbnails and metadata for thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
  • READ_ACP: The grantee can read the object ACL for thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
  • WRITE_ACP: The grantee can write the ACL for the thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
  • FULL_CONTROL: The grantee has READ, READ_ACP, and WRITE_ACP permissions for the thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
    public java.util.List<StringgetAccess() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The permission that you want to give to the AWS user that is listed in Grantee. Valid values include:
  • READ: The grantee can read the thumbnails and metadata for thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
  • READ_ACP: The grantee can read the object ACL for thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
  • WRITE_ACP: The grantee can write the ACL for the thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
  • FULL_CONTROL: The grantee has READ, READ_ACP, and WRITE_ACP permissions for the thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.

Constraints:
Length: 0 - 30

Parameters:
access The permission that you want to give to the AWS user that is listed in Grantee. Valid values include:
  • READ: The grantee can read the thumbnails and metadata for thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
  • READ_ACP: The grantee can read the object ACL for thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
  • WRITE_ACP: The grantee can write the ACL for the thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
  • FULL_CONTROL: The grantee has READ, READ_ACP, and WRITE_ACP permissions for the thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
    public void setAccess(java.util.Collection<Stringaccess) {
        if (access == null) {
            this. = null;
            return;
        }
        accessCopy.addAll(access);
        this. = accessCopy;
    }
    
    
The permission that you want to give to the AWS user that is listed in Grantee. Valid values include:
  • READ: The grantee can read the thumbnails and metadata for thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
  • READ_ACP: The grantee can read the object ACL for thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
  • WRITE_ACP: The grantee can write the ACL for the thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
  • FULL_CONTROL: The grantee has READ, READ_ACP, and WRITE_ACP permissions for the thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.

NOTE: This method appends the values to the existing list (if any). Use setAccess(java.util.Collection) or withAccess(java.util.Collection) if you want to override the existing values.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 0 - 30

Parameters:
access The permission that you want to give to the AWS user that is listed in Grantee. Valid values include:
  • READ: The grantee can read the thumbnails and metadata for thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
  • READ_ACP: The grantee can read the object ACL for thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
  • WRITE_ACP: The grantee can write the ACL for the thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
  • FULL_CONTROL: The grantee has READ, READ_ACP, and WRITE_ACP permissions for the thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Permission withAccess(String... access) {
        if (getAccess() == nullsetAccess(new java.util.ArrayList<String>(access.length));
        for (String value : access) {
            getAccess().add(value);
        }
        return this;
    }
    
    
The permission that you want to give to the AWS user that is listed in Grantee. Valid values include:
  • READ: The grantee can read the thumbnails and metadata for thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
  • READ_ACP: The grantee can read the object ACL for thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
  • WRITE_ACP: The grantee can write the ACL for the thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
  • FULL_CONTROL: The grantee has READ, READ_ACP, and WRITE_ACP permissions for the thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 0 - 30

Parameters:
access The permission that you want to give to the AWS user that is listed in Grantee. Valid values include:
  • READ: The grantee can read the thumbnails and metadata for thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
  • READ_ACP: The grantee can read the object ACL for thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
  • WRITE_ACP: The grantee can write the ACL for the thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
  • FULL_CONTROL: The grantee has READ, READ_ACP, and WRITE_ACP permissions for the thumbnails that Elastic Transcoder adds to the Amazon S3 bucket.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Permission withAccess(java.util.Collection<Stringaccess) {
        if (access == null) {
            this. = null;
        } else {
            accessCopy.addAll(access);
            this. = accessCopy;
        }
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getGranteeType() != nullsb.append("GranteeType: " + getGranteeType() + ",");
        if (getGrantee() != nullsb.append("Grantee: " + getGrantee() + ",");
        if (getAccess() != nullsb.append("Access: " + getAccess() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getGranteeType() == null) ? 0 : getGranteeType().hashCode()); 
        hashCode = prime * hashCode + ((getGrantee() == null) ? 0 : getGrantee().hashCode()); 
        hashCode = prime * hashCode + ((getAccess() == null) ? 0 : getAccess().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof Permission == falsereturn false;
        Permission other = (Permission)obj;
        
        if (other.getGranteeType() == null ^ this.getGranteeType() == nullreturn false;
        if (other.getGranteeType() != null && other.getGranteeType().equals(this.getGranteeType()) == falsereturn false
        if (other.getGrantee() == null ^ this.getGrantee() == nullreturn false;
        if (other.getGrantee() != null && other.getGrantee().equals(this.getGrantee()) == falsereturn false
        if (other.getAccess() == null ^ this.getAccess() == nullreturn false;
        if (other.getAccess() != null && other.getAccess().equals(this.getAccess()) == falsereturn false
        return true;
    }
    
    @Override
    public Permission clone() {
        try {
            return (Permissionsuper.clone();
        
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                    + "even though we're Cloneable!",
                    e);
        }
        
    }
}
    
New to GrepCode? Check out our FAQ X