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.opsworks.model;
 
 
Container for the parameters to the SetPermission operation.

Specifies a user's permissions. For more information, see Security and Permissions .

Required Permissions : To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see Managing User Permissions .

 
 public class SetPermissionRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The stack ID.
 
     private String stackId;

    
The user's IAM ARN.
 
     private String iamUserArn;

    
The user is allowed to use SSH to communicate with the instance.
 
     private Boolean allowSsh;

    
The user is allowed to use sudo to elevate privileges.
 
     private Boolean allowSudo;

    
The user's permission level, which must be set to one of the following strings. You cannot set your own permissions level.
  • deny
  • show
  • deploy
  • manage
  • iam_only

For more information on the permissions associated with these levels, see Managing User Permissions

 
     private String level;

    
The stack ID.

Returns:
The stack ID.
 
     public String getStackId() {
         return ;
     }
    
    
The stack ID.

Parameters:
stackId The stack ID.
 
     public void setStackId(String stackId) {
         this. = stackId;
     }
    
    
The stack ID.

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

Parameters:
stackId The stack ID.
Returns:
A reference to this updated object so that method calls can be chained together.
    public SetPermissionRequest withStackId(String stackId) {
        this. = stackId;
        return this;
    }

    
The user's IAM ARN.

Returns:
The user's IAM ARN.
    public String getIamUserArn() {
        return ;
    }
    
    
The user's IAM ARN.

Parameters:
iamUserArn The user's IAM ARN.
    public void setIamUserArn(String iamUserArn) {
        this. = iamUserArn;
    }
    
    
The user's IAM ARN.

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

Parameters:
iamUserArn The user's IAM ARN.
Returns:
A reference to this updated object so that method calls can be chained together.
    public SetPermissionRequest withIamUserArn(String iamUserArn) {
        this. = iamUserArn;
        return this;
    }

    
The user is allowed to use SSH to communicate with the instance.

Returns:
The user is allowed to use SSH to communicate with the instance.
    public Boolean isAllowSsh() {
        return ;
    }
    
    
The user is allowed to use SSH to communicate with the instance.

Parameters:
allowSsh The user is allowed to use SSH to communicate with the instance.
    public void setAllowSsh(Boolean allowSsh) {
        this. = allowSsh;
    }
    
    
The user is allowed to use SSH to communicate with the instance.

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

Parameters:
allowSsh The user is allowed to use SSH to communicate with the instance.
Returns:
A reference to this updated object so that method calls can be chained together.
    public SetPermissionRequest withAllowSsh(Boolean allowSsh) {
        this. = allowSsh;
        return this;
    }

    
The user is allowed to use SSH to communicate with the instance.

Returns:
The user is allowed to use SSH to communicate with the instance.
    public Boolean getAllowSsh() {
        return ;
    }

    
The user is allowed to use sudo to elevate privileges.

Returns:
The user is allowed to use sudo to elevate privileges.
    public Boolean isAllowSudo() {
        return ;
    }
    
    
The user is allowed to use sudo to elevate privileges.

Parameters:
allowSudo The user is allowed to use sudo to elevate privileges.
    public void setAllowSudo(Boolean allowSudo) {
        this. = allowSudo;
    }
    
    
The user is allowed to use sudo to elevate privileges.

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

Parameters:
allowSudo The user is allowed to use sudo to elevate privileges.
Returns:
A reference to this updated object so that method calls can be chained together.
    public SetPermissionRequest withAllowSudo(Boolean allowSudo) {
        this. = allowSudo;
        return this;
    }

    
The user is allowed to use sudo to elevate privileges.

Returns:
The user is allowed to use sudo to elevate privileges.
    public Boolean getAllowSudo() {
        return ;
    }

    
The user's permission level, which must be set to one of the following strings. You cannot set your own permissions level.
  • deny
  • show
  • deploy
  • manage
  • iam_only

For more information on the permissions associated with these levels, see Managing User Permissions

Returns:
The user's permission level, which must be set to one of the following strings. You cannot set your own permissions level.
  • deny
  • show
  • deploy
  • manage
  • iam_only

For more information on the permissions associated with these levels, see Managing User Permissions

    public String getLevel() {
        return ;
    }
    
    
The user's permission level, which must be set to one of the following strings. You cannot set your own permissions level.
  • deny
  • show
  • deploy
  • manage
  • iam_only

For more information on the permissions associated with these levels, see Managing User Permissions

Parameters:
level The user's permission level, which must be set to one of the following strings. You cannot set your own permissions level.
  • deny
  • show
  • deploy
  • manage
  • iam_only

For more information on the permissions associated with these levels, see Managing User Permissions

    public void setLevel(String level) {
        this. = level;
    }
    
    
The user's permission level, which must be set to one of the following strings. You cannot set your own permissions level.
  • deny
  • show
  • deploy
  • manage
  • iam_only

For more information on the permissions associated with these levels, see Managing User Permissions

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

Parameters:
level The user's permission level, which must be set to one of the following strings. You cannot set your own permissions level.
  • deny
  • show
  • deploy
  • manage
  • iam_only

For more information on the permissions associated with these levels, see Managing User Permissions

Returns:
A reference to this updated object so that method calls can be chained together.
    public SetPermissionRequest withLevel(String level) {
        this. = level;
        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 (getStackId() != nullsb.append("StackId: " + getStackId() + ",");
        if (getIamUserArn() != nullsb.append("IamUserArn: " + getIamUserArn() + ",");
        if (isAllowSsh() != nullsb.append("AllowSsh: " + isAllowSsh() + ",");
        if (isAllowSudo() != nullsb.append("AllowSudo: " + isAllowSudo() + ",");
        if (getLevel() != nullsb.append("Level: " + getLevel() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getStackId() == null) ? 0 : getStackId().hashCode()); 
        hashCode = prime * hashCode + ((getIamUserArn() == null) ? 0 : getIamUserArn().hashCode()); 
        hashCode = prime * hashCode + ((isAllowSsh() == null) ? 0 : isAllowSsh().hashCode()); 
        hashCode = prime * hashCode + ((isAllowSudo() == null) ? 0 : isAllowSudo().hashCode()); 
        hashCode = prime * hashCode + ((getLevel() == null) ? 0 : getLevel().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof SetPermissionRequest == falsereturn false;
        SetPermissionRequest other = (SetPermissionRequest)obj;
        
        if (other.getStackId() == null ^ this.getStackId() == nullreturn false;
        if (other.getStackId() != null && other.getStackId().equals(this.getStackId()) == falsereturn false
        if (other.getIamUserArn() == null ^ this.getIamUserArn() == nullreturn false;
        if (other.getIamUserArn() != null && other.getIamUserArn().equals(this.getIamUserArn()) == falsereturn false
        if (other.isAllowSsh() == null ^ this.isAllowSsh() == nullreturn false;
        if (other.isAllowSsh() != null && other.isAllowSsh().equals(this.isAllowSsh()) == falsereturn false
        if (other.isAllowSudo() == null ^ this.isAllowSudo() == nullreturn false;
        if (other.isAllowSudo() != null && other.isAllowSudo().equals(this.isAllowSudo()) == falsereturn false
        if (other.getLevel() == null ^ this.getLevel() == nullreturn false;
        if (other.getLevel() != null && other.getLevel().equals(this.getLevel()) == falsereturn false
        return true;
    }
    
    @Override
    public SetPermissionRequest clone() {
        
            return (SetPermissionRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X